From a8fc89bec170baaf27fd1e9f3dcef08843ad3a77 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Tue, 25 Sep 2018 09:33:32 -0700 Subject: [PATCH 1/5] vendor: add aws deprovision --- glide.lock | 28 +- glide.yaml | 8 +- .../aws/credentials/endpointcreds/provider.go | 7 + .../aws/aws-sdk-go/aws/defaults/defaults.go | 6 +- .../aws/aws-sdk-go/aws/ec2metadata/service.go | 1 + .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../private/protocol/eventstream/BUILD.bazel | 18 + .../private/protocol/eventstream/debug.go | 144 + .../private/protocol/eventstream/decode.go | 199 + .../private/protocol/eventstream/encode.go | 114 + .../private/protocol/eventstream/error.go | 23 + .../eventstream/eventstreamapi/BUILD.bazel | 17 + .../eventstream/eventstreamapi/api.go | 196 + .../eventstream/eventstreamapi/error.go | 24 + .../private/protocol/eventstream/header.go | 166 + .../protocol/eventstream/header_value.go | 501 + .../private/protocol/eventstream/message.go | 103 + .../private/protocol/restxml/BUILD.bazel | 16 + .../private/protocol/restxml/restxml.go | 77 + .../service/autoscaling/BUILD.bazel | 25 + .../aws/aws-sdk-go/service/autoscaling/api.go | 13146 +++++++ .../aws/aws-sdk-go/service/autoscaling/doc.go | 31 + .../aws-sdk-go/service/autoscaling/errors.go | 53 + .../aws-sdk-go/service/autoscaling/service.go | 95 + .../aws-sdk-go/service/autoscaling/waiters.go | 163 + .../aws/aws-sdk-go/service/elb/BUILD.bazel | 24 + .../aws/aws-sdk-go/service/elb/api.go | 6482 ++++ .../aws/aws-sdk-go/service/elb/doc.go | 50 + .../aws/aws-sdk-go/service/elb/errors.go | 145 + .../aws/aws-sdk-go/service/elb/service.go | 95 + .../aws/aws-sdk-go/service/elb/waiters.go | 158 + .../aws/aws-sdk-go/service/iam/BUILD.bazel | 25 + .../aws/aws-sdk-go/service/iam/api.go | 29394 ++++++++++++++++ .../aws/aws-sdk-go/service/iam/doc.go | 80 + .../aws/aws-sdk-go/service/iam/errors.go | 185 + .../aws/aws-sdk-go/service/iam/service.go | 95 + .../aws/aws-sdk-go/service/iam/waiters.go | 112 + .../aws-sdk-go/service/route53/BUILD.bazel | 27 + .../aws/aws-sdk-go/service/route53/api.go | 14969 ++++++++ .../service/route53/customizations.go | 42 + .../aws/aws-sdk-go/service/route53/doc.go | 26 + .../aws/aws-sdk-go/service/route53/errors.go | 436 + .../aws/aws-sdk-go/service/route53/service.go | 95 + .../service/route53/unmarshal_error.go | 77 + .../aws/aws-sdk-go/service/route53/waiters.go | 56 + .../aws/aws-sdk-go/service/s3/BUILD.bazel | 40 + .../aws/aws-sdk-go/service/s3/api.go | 22357 ++++++++++++ .../aws/aws-sdk-go/service/s3/body_hash.go | 249 + .../aws-sdk-go/service/s3/bucket_location.go | 106 + .../aws-sdk-go/service/s3/customizations.go | 70 + .../aws/aws-sdk-go/service/s3/doc.go | 26 + .../aws/aws-sdk-go/service/s3/doc_custom.go | 109 + .../aws/aws-sdk-go/service/s3/errors.go | 48 + .../service/s3/host_style_bucket.go | 155 + .../service/s3/platform_handlers.go | 8 + .../service/s3/platform_handlers_go1.6.go | 28 + .../aws-sdk-go/service/s3/s3iface/BUILD.bazel | 14 + .../service/s3/s3iface/interface.go | 403 + .../service/s3/s3manager/BUILD.bazel | 25 + .../aws-sdk-go/service/s3/s3manager/batch.go | 529 + .../service/s3/s3manager/bucket_region.go | 88 + .../aws-sdk-go/service/s3/s3manager/doc.go | 3 + .../service/s3/s3manager/download.go | 555 + .../aws-sdk-go/service/s3/s3manager/upload.go | 802 + .../aws/aws-sdk-go/service/s3/service.go | 97 + .../aws/aws-sdk-go/service/s3/sse.go | 54 + .../aws-sdk-go/service/s3/statusok_error.go | 36 + .../aws-sdk-go/service/s3/unmarshal_error.go | 103 + .../aws/aws-sdk-go/service/s3/waiters.go | 214 + .../inconshreveable/mousetrap/BUILD.bazel | 13 + .../inconshreveable/mousetrap/LICENSE | 13 + .../inconshreveable/mousetrap/trap_others.go | 15 + .../inconshreveable/mousetrap/trap_windows.go | 98 + .../mousetrap/trap_windows_1.4.go | 46 + .../github.com/libvirt/libvirt-go/BUILD.bazel | 88 + vendor/github.com/libvirt/libvirt-go/LICENSE | 21 + .../libvirt/libvirt-go/callbacks.go | 102 + .../libvirt/libvirt-go/callbacks_wrapper.go | 39 + .../libvirt/libvirt-go/callbacks_wrapper.h | 32 + .../github.com/libvirt/libvirt-go/connect.go | 2998 ++ .../libvirt/libvirt-go/connect_compat.h | 200 + .../libvirt/libvirt-go/connect_wrapper.go | 1766 + .../libvirt/libvirt-go/connect_wrapper.h | 730 + vendor/github.com/libvirt/libvirt-go/doc.go | 141 + .../github.com/libvirt/libvirt-go/domain.go | 4766 +++ .../libvirt/libvirt-go/domain_compat.h | 914 + .../libvirt/libvirt-go/domain_events.go | 1633 + .../libvirt-go/domain_events_wrapper.go | 259 + .../libvirt-go/domain_events_wrapper.h | 207 + .../libvirt/libvirt-go/domain_snapshot.go | 240 + .../libvirt-go/domain_snapshot_wrapper.go | 215 + .../libvirt-go/domain_snapshot_wrapper.h | 102 + .../libvirt/libvirt-go/domain_wrapper.go | 2330 ++ .../libvirt/libvirt-go/domain_wrapper.h | 986 + vendor/github.com/libvirt/libvirt-go/error.go | 604 + .../libvirt/libvirt-go/error_compat.h | 166 + .../github.com/libvirt/libvirt-go/events.go | 258 + .../libvirt/libvirt-go/events_wrapper.go | 193 + .../libvirt/libvirt-go/events_wrapper.h | 82 + .../libvirt/libvirt-go/interface.go | 145 + .../libvirt/libvirt-go/interface_wrapper.go | 158 + .../libvirt/libvirt-go/interface_wrapper.h | 76 + vendor/github.com/libvirt/libvirt-go/lxc.go | 155 + .../libvirt/libvirt-go/lxc_wrapper.go | 101 + .../libvirt/libvirt-go/lxc_wrapper.h | 63 + .../github.com/libvirt/libvirt-go/network.go | 335 + .../libvirt/libvirt-go/network_compat.h | 86 + .../libvirt/libvirt-go/network_events.go | 125 + .../libvirt-go/network_events_wrapper.go | 79 + .../libvirt-go/network_events_wrapper.h | 55 + .../libvirt/libvirt-go/network_wrapper.go | 267 + .../libvirt/libvirt-go/network_wrapper.h | 119 + .../libvirt/libvirt-go/node_device.go | 192 + .../libvirt/libvirt-go/node_device_compat.h | 55 + .../libvirt/libvirt-go/node_device_events.go | 156 + .../libvirt-go/node_device_events_wrapper.go | 88 + .../libvirt-go/node_device_events_wrapper.h | 60 + .../libvirt/libvirt-go/node_device_wrapper.go | 184 + .../libvirt/libvirt-go/node_device_wrapper.h | 88 + .../github.com/libvirt/libvirt-go/nwfilter.go | 118 + .../libvirt/libvirt-go/nwfilter_binding.go | 125 + .../libvirt-go/nwfilter_binding_compat.h | 33 + .../libvirt-go/nwfilter_binding_wrapper.go | 132 + .../libvirt-go/nwfilter_binding_wrapper.h | 60 + .../libvirt/libvirt-go/nwfilter_wrapper.go | 122 + .../libvirt/libvirt-go/nwfilter_wrapper.h | 65 + vendor/github.com/libvirt/libvirt-go/qemu.go | 189 + .../libvirt/libvirt-go/qemu_compat.h | 57 + .../libvirt/libvirt-go/qemu_wrapper.go | 133 + .../libvirt/libvirt-go/qemu_wrapper.h | 78 + .../github.com/libvirt/libvirt-go/secret.go | 184 + .../libvirt/libvirt-go/secret_compat.h | 61 + .../libvirt/libvirt-go/secret_events.go | 159 + .../libvirt-go/secret_events_wrapper.go | 88 + .../libvirt-go/secret_events_wrapper.h | 58 + .../libvirt/libvirt-go/secret_wrapper.go | 175 + .../libvirt/libvirt-go/secret_wrapper.h | 86 + .../libvirt/libvirt-go/storage_pool.go | 394 + .../libvirt/libvirt-go/storage_pool_compat.h | 92 + .../libvirt/libvirt-go/storage_pool_events.go | 174 + .../libvirt-go/storage_pool_events_wrapper.go | 89 + .../libvirt-go/storage_pool_events_wrapper.h | 59 + .../libvirt-go/storage_pool_wrapper.go | 343 + .../libvirt/libvirt-go/storage_pool_wrapper.h | 150 + .../libvirt/libvirt-go/storage_volume.go | 290 + .../libvirt-go/storage_volume_compat.h | 78 + .../libvirt-go/storage_volume_wrapper.go | 249 + .../libvirt-go/storage_volume_wrapper.h | 116 + .../github.com/libvirt/libvirt-go/stream.go | 418 + .../libvirt/libvirt-go/stream_compat.h | 36 + .../libvirt/libvirt-go/stream_wrapper.go | 331 + .../libvirt/libvirt-go/stream_wrapper.h | 120 + .../libvirt/libvirt-go/typedparams.go | 262 + vendor/github.com/openshift/hive/LICENSE | 201 + .../pkg/aws_tag_deprovision/BUILD.bazel | 24 + .../aws_tag_deprovision.go | 1383 + .../{Sirupsen => sirupsen}/logrus/BUILD.bazel | 4 +- .../{Sirupsen => sirupsen}/logrus/LICENSE | 0 .../{Sirupsen => sirupsen}/logrus/doc.go | 0 .../{Sirupsen => sirupsen}/logrus/entry.go | 0 .../{Sirupsen => sirupsen}/logrus/exported.go | 0 .../logrus/formatter.go | 0 .../{Sirupsen => sirupsen}/logrus/hooks.go | 0 .../logrus/json_formatter.go | 0 .../{Sirupsen => sirupsen}/logrus/logger.go | 0 .../{Sirupsen => sirupsen}/logrus/logrus.go | 0 .../logrus/terminal_bsd.go | 0 .../logrus/terminal_linux.go | 0 .../logrus/terminal_notwindows.go | 0 .../logrus/terminal_solaris.go | 0 .../logrus/terminal_windows.go | 0 .../logrus/text_formatter.go | 0 .../{Sirupsen => sirupsen}/logrus/writer.go | 0 vendor/github.com/spf13/cobra/BUILD.bazel | 25 + vendor/github.com/spf13/cobra/LICENSE.txt | 174 + vendor/github.com/spf13/cobra/args.go | 98 + .../spf13/cobra/bash_completions.go | 537 + vendor/github.com/spf13/cobra/cobra.go | 190 + vendor/github.com/spf13/cobra/command.go | 1409 + .../github.com/spf13/cobra/command_notwin.go | 5 + vendor/github.com/spf13/cobra/command_win.go | 20 + .../github.com/spf13/cobra/zsh_completions.go | 126 + 182 files changed, 125009 insertions(+), 10 deletions(-) create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/autoscaling/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/elb/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/elb/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/elb/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/elb/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/elb/service.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iam/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iam/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iam/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iam/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iam/service.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/service.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/BUILD.bazel create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/service.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/sse.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go create mode 100644 vendor/github.com/inconshreveable/mousetrap/BUILD.bazel create mode 100644 vendor/github.com/inconshreveable/mousetrap/LICENSE create mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_others.go create mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_windows.go create mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go create mode 100644 vendor/github.com/libvirt/libvirt-go/BUILD.bazel create mode 100644 vendor/github.com/libvirt/libvirt-go/LICENSE create mode 100644 vendor/github.com/libvirt/libvirt-go/callbacks.go create mode 100644 vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/connect.go create mode 100644 vendor/github.com/libvirt/libvirt-go/connect_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/connect_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/connect_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/doc.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_events.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_snapshot.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/domain_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/error.go create mode 100644 vendor/github.com/libvirt/libvirt-go/error_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/events.go create mode 100644 vendor/github.com/libvirt/libvirt-go/events_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/events_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/interface.go create mode 100644 vendor/github.com/libvirt/libvirt-go/interface_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/interface_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/lxc.go create mode 100644 vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/network.go create mode 100644 vendor/github.com/libvirt/libvirt-go/network_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/network_events.go create mode 100644 vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/network_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/network_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device.go create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device_events.go create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter.go create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/qemu.go create mode 100644 vendor/github.com/libvirt/libvirt-go/qemu_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/secret.go create mode 100644 vendor/github.com/libvirt/libvirt-go/secret_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/secret_events.go create mode 100644 vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/secret_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/secret_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool.go create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool_events.go create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_volume.go create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/stream.go create mode 100644 vendor/github.com/libvirt/libvirt-go/stream_compat.h create mode 100644 vendor/github.com/libvirt/libvirt-go/stream_wrapper.go create mode 100644 vendor/github.com/libvirt/libvirt-go/stream_wrapper.h create mode 100644 vendor/github.com/libvirt/libvirt-go/typedparams.go create mode 100644 vendor/github.com/openshift/hive/LICENSE create mode 100644 vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/BUILD.bazel create mode 100644 vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/aws_tag_deprovision.go rename vendor/github.com/{Sirupsen => sirupsen}/logrus/BUILD.bazel (86%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/LICENSE (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/doc.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/entry.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/exported.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/formatter.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/hooks.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/json_formatter.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/logger.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/logrus.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/terminal_bsd.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/terminal_linux.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/terminal_notwindows.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/terminal_solaris.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/terminal_windows.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/text_formatter.go (100%) rename vendor/github.com/{Sirupsen => sirupsen}/logrus/writer.go (100%) create mode 100644 vendor/github.com/spf13/cobra/BUILD.bazel create mode 100644 vendor/github.com/spf13/cobra/LICENSE.txt create mode 100644 vendor/github.com/spf13/cobra/args.go create mode 100644 vendor/github.com/spf13/cobra/bash_completions.go create mode 100644 vendor/github.com/spf13/cobra/cobra.go create mode 100644 vendor/github.com/spf13/cobra/command.go create mode 100644 vendor/github.com/spf13/cobra/command_notwin.go create mode 100644 vendor/github.com/spf13/cobra/command_win.go create mode 100644 vendor/github.com/spf13/cobra/zsh_completions.go diff --git a/glide.lock b/glide.lock index 486db6a1e80..6846c347f9f 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: ce9cd1b451f26f3d1b56c385e9534aef2b2435276c4872eca5ca925435a276a3 -updated: 2018-09-21T09:26:44.565140695-07:00 +hash: 2c4b7376f073ee54146d225a63286b1f94961aab9f733354c6b5aeeb107ba710 +updated: 2018-09-25T12:42:08.741945969-07:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 @@ -18,7 +18,7 @@ imports: subpackages: - cidr - name: github.com/aws/aws-sdk-go - version: a93d31c26045c00c52f58dda4dcad02a3e622534 + version: 0d5157217e4c72d0fc7fabad8e0501d3d5cb768d subpackages: - aws - aws/awserr @@ -43,11 +43,21 @@ imports: - internal/shareddefaults - private/protocol - private/protocol/ec2query + - private/protocol/eventstream + - private/protocol/eventstream/eventstreamapi - private/protocol/query - private/protocol/query/queryutil - private/protocol/rest + - private/protocol/restxml - private/protocol/xml/xmlutil + - service/autoscaling - service/ec2 + - service/elb + - service/iam + - service/route53 + - service/s3 + - service/s3/s3iface + - service/s3/s3manager - service/sts - name: github.com/beorn7/perks version: 3ac7bf7a47d159a033b107610db8a1b6575507a4 @@ -229,6 +239,8 @@ imports: version: bf9dde6d0d2c004a008c27aaee91170c786f6db8 - name: github.com/imdario/mergo version: 6633656539c1639d9d78127b7d47c622b5d7b6dc +- name: github.com/inconshreveable/mousetrap + version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 - name: github.com/jmespath/go-jmespath version: c2b33e8439af944379acbdd9c3a5fe0bc44bd8a5 - name: github.com/json-iterator/go @@ -241,6 +253,8 @@ imports: version: 14201e804a58a140011a0044b15331f477535f91 subpackages: - pkg/builders +- name: github.com/libvirt/libvirt-go + version: d5e0adac44d4365a2d97e259f51ab76cc3c01b20 - name: github.com/mailru/easyjson version: 2f5df55504ebc322e4d52d34df6a1f5b503bf26d subpackages: @@ -263,6 +277,10 @@ imports: - flowrate - name: github.com/NYTimes/gziphandler version: 56545f4a5d46df9a6648819d1664c3a03a13ffdb +- name: github.com/openshift/hive + version: 296cb990171c6da62e134f3590c120bd16ef4d43 + subpackages: + - contrib/pkg/aws_tag_deprovision - name: github.com/pborman/uuid version: ca53cad383cad2479bbba7f7a1a05797ec1386e4 - name: github.com/peterbourgon/diskv @@ -289,8 +307,10 @@ imports: version: 8a290539e2e8629dbc4e6bad948158f790ec31f4 - name: github.com/PuerkitoBio/urlesc version: 5bd2802263f21d8788851d5305584c82a5c75d7e -- name: github.com/Sirupsen/logrus +- name: github.com/sirupsen/logrus version: 081307d9bc1364753142d5962fc1d795c742baaf +- name: github.com/spf13/cobra + version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b - name: github.com/spf13/pflag version: e57e3eeb33f795204c1ca35f56c44f83227c6e66 - name: github.com/ugorji/go diff --git a/glide.yaml b/glide.yaml index 486269bbc87..b69bc82854f 100644 --- a/glide.yaml +++ b/glide.yaml @@ -4,7 +4,7 @@ excludeDirs: import: - package: github.com/ghodss/yaml version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee -- package: github.com/Sirupsen/logrus +- package: github.com/sirupsen/logrus version: 081307d9bc1364753142d5962fc1d795c742baaf - package: gopkg.in/yaml.v2 version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 @@ -28,6 +28,12 @@ import: version: 1.6.2 - package: github.com/aws/aws-sdk-go version: ^1.15.39 +- package: github.com/libvirt/libvirt-go + version: ^v4.7.0 +- package: github.com/openshift/hive + version: 296cb990171c6da62e134f3590c120bd16ef4d43 + subpackages: + - contrib/pkg/aws_tag_deprovision testImport: - package: github.com/stretchr/testify version: ^1.2.2 diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go index a4cec5c553a..ace51313820 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go @@ -65,6 +65,10 @@ type Provider struct { // // If ExpiryWindow is 0 or less it will be ignored. ExpiryWindow time.Duration + + // Optional authorization token value if set will be used as the value of + // the Authorization header of the endpoint credential request. + AuthorizationToken string } // NewProviderClient returns a credentials Provider for retrieving AWS credentials @@ -152,6 +156,9 @@ func (p *Provider) getCredentials() (*getCredentialsOutput, error) { out := &getCredentialsOutput{} req := p.Client.NewRequest(op, nil, out) req.HTTPRequest.Header.Set("Accept", "application/json") + if authToken := p.AuthorizationToken; len(authToken) != 0 { + req.HTTPRequest.Header.Set("Authorization", authToken) + } return out, req.Send() } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go index 5040a2f6477..6cd84cd96de 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go @@ -112,8 +112,9 @@ func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Pro } const ( - httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" - ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" + httpProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN" + httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" + ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" ) // RemoteCredProvider returns a credentials provider for the default remote @@ -187,6 +188,7 @@ func httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) crede return endpointcreds.NewProviderClient(cfg, handlers, u, func(p *endpointcreds.Provider) { p.ExpiryWindow = 5 * time.Minute + p.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar) }, ) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go index ef5f73292ba..53457cac368 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -72,6 +72,7 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio cfg, metadata.ClientInfo{ ServiceName: ServiceName, + ServiceID: ServiceName, Endpoint: endpoint, APIVersion: "latest", }, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index bdac1de1da8..13eb1060a51 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.15.39" +const SDKVersion = "1.15.41" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/BUILD.bazel new file mode 100644 index 00000000000..84b7df9cebe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "debug.go", + "decode.go", + "encode.go", + "error.go", + "header.go", + "header_value.go", + "message.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream", + importpath = "github.com/aws/aws-sdk-go/private/protocol/eventstream", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/aws/aws-sdk-go/aws:go_default_library"], +) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go new file mode 100644 index 00000000000..ecc7bf82fa2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go @@ -0,0 +1,144 @@ +package eventstream + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "strconv" +) + +type decodedMessage struct { + rawMessage + Headers decodedHeaders `json:"headers"` +} +type jsonMessage struct { + Length json.Number `json:"total_length"` + HeadersLen json.Number `json:"headers_length"` + PreludeCRC json.Number `json:"prelude_crc"` + Headers decodedHeaders `json:"headers"` + Payload []byte `json:"payload"` + CRC json.Number `json:"message_crc"` +} + +func (d *decodedMessage) UnmarshalJSON(b []byte) (err error) { + var jsonMsg jsonMessage + if err = json.Unmarshal(b, &jsonMsg); err != nil { + return err + } + + d.Length, err = numAsUint32(jsonMsg.Length) + if err != nil { + return err + } + d.HeadersLen, err = numAsUint32(jsonMsg.HeadersLen) + if err != nil { + return err + } + d.PreludeCRC, err = numAsUint32(jsonMsg.PreludeCRC) + if err != nil { + return err + } + d.Headers = jsonMsg.Headers + d.Payload = jsonMsg.Payload + d.CRC, err = numAsUint32(jsonMsg.CRC) + if err != nil { + return err + } + + return nil +} + +func (d *decodedMessage) MarshalJSON() ([]byte, error) { + jsonMsg := jsonMessage{ + Length: json.Number(strconv.Itoa(int(d.Length))), + HeadersLen: json.Number(strconv.Itoa(int(d.HeadersLen))), + PreludeCRC: json.Number(strconv.Itoa(int(d.PreludeCRC))), + Headers: d.Headers, + Payload: d.Payload, + CRC: json.Number(strconv.Itoa(int(d.CRC))), + } + + return json.Marshal(jsonMsg) +} + +func numAsUint32(n json.Number) (uint32, error) { + v, err := n.Int64() + if err != nil { + return 0, fmt.Errorf("failed to get int64 json number, %v", err) + } + + return uint32(v), nil +} + +func (d decodedMessage) Message() Message { + return Message{ + Headers: Headers(d.Headers), + Payload: d.Payload, + } +} + +type decodedHeaders Headers + +func (hs *decodedHeaders) UnmarshalJSON(b []byte) error { + var jsonHeaders []struct { + Name string `json:"name"` + Type valueType `json:"type"` + Value interface{} `json:"value"` + } + + decoder := json.NewDecoder(bytes.NewReader(b)) + decoder.UseNumber() + if err := decoder.Decode(&jsonHeaders); err != nil { + return err + } + + var headers Headers + for _, h := range jsonHeaders { + value, err := valueFromType(h.Type, h.Value) + if err != nil { + return err + } + headers.Set(h.Name, value) + } + (*hs) = decodedHeaders(headers) + + return nil +} + +func valueFromType(typ valueType, val interface{}) (Value, error) { + switch typ { + case trueValueType: + return BoolValue(true), nil + case falseValueType: + return BoolValue(false), nil + case int8ValueType: + v, err := val.(json.Number).Int64() + return Int8Value(int8(v)), err + case int16ValueType: + v, err := val.(json.Number).Int64() + return Int16Value(int16(v)), err + case int32ValueType: + v, err := val.(json.Number).Int64() + return Int32Value(int32(v)), err + case int64ValueType: + v, err := val.(json.Number).Int64() + return Int64Value(v), err + case bytesValueType: + v, err := base64.StdEncoding.DecodeString(val.(string)) + return BytesValue(v), err + case stringValueType: + v, err := base64.StdEncoding.DecodeString(val.(string)) + return StringValue(string(v)), err + case timestampValueType: + v, err := val.(json.Number).Int64() + return TimestampValue(timeFromEpochMilli(v)), err + case uuidValueType: + v, err := base64.StdEncoding.DecodeString(val.(string)) + var tv UUIDValue + copy(tv[:], v) + return tv, err + default: + panic(fmt.Sprintf("unknown type, %s, %T", typ.String(), val)) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go new file mode 100644 index 00000000000..4b972b2d666 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go @@ -0,0 +1,199 @@ +package eventstream + +import ( + "bytes" + "encoding/binary" + "encoding/hex" + "encoding/json" + "fmt" + "hash" + "hash/crc32" + "io" + + "github.com/aws/aws-sdk-go/aws" +) + +// Decoder provides decoding of an Event Stream messages. +type Decoder struct { + r io.Reader + logger aws.Logger +} + +// NewDecoder initializes and returns a Decoder for decoding event +// stream messages from the reader provided. +func NewDecoder(r io.Reader) *Decoder { + return &Decoder{ + r: r, + } +} + +// Decode attempts to decode a single message from the event stream reader. +// Will return the event stream message, or error if Decode fails to read +// the message from the stream. +func (d *Decoder) Decode(payloadBuf []byte) (m Message, err error) { + reader := d.r + if d.logger != nil { + debugMsgBuf := bytes.NewBuffer(nil) + reader = io.TeeReader(reader, debugMsgBuf) + defer func() { + logMessageDecode(d.logger, debugMsgBuf, m, err) + }() + } + + crc := crc32.New(crc32IEEETable) + hashReader := io.TeeReader(reader, crc) + + prelude, err := decodePrelude(hashReader, crc) + if err != nil { + return Message{}, err + } + + if prelude.HeadersLen > 0 { + lr := io.LimitReader(hashReader, int64(prelude.HeadersLen)) + m.Headers, err = decodeHeaders(lr) + if err != nil { + return Message{}, err + } + } + + if payloadLen := prelude.PayloadLen(); payloadLen > 0 { + buf, err := decodePayload(payloadBuf, io.LimitReader(hashReader, int64(payloadLen))) + if err != nil { + return Message{}, err + } + m.Payload = buf + } + + msgCRC := crc.Sum32() + if err := validateCRC(reader, msgCRC); err != nil { + return Message{}, err + } + + return m, nil +} + +// UseLogger specifies the Logger that that the decoder should use to log the +// message decode to. +func (d *Decoder) UseLogger(logger aws.Logger) { + d.logger = logger +} + +func logMessageDecode(logger aws.Logger, msgBuf *bytes.Buffer, msg Message, decodeErr error) { + w := bytes.NewBuffer(nil) + defer func() { logger.Log(w.String()) }() + + fmt.Fprintf(w, "Raw message:\n%s\n", + hex.Dump(msgBuf.Bytes())) + + if decodeErr != nil { + fmt.Fprintf(w, "Decode error: %v\n", decodeErr) + return + } + + rawMsg, err := msg.rawMessage() + if err != nil { + fmt.Fprintf(w, "failed to create raw message, %v\n", err) + return + } + + decodedMsg := decodedMessage{ + rawMessage: rawMsg, + Headers: decodedHeaders(msg.Headers), + } + + fmt.Fprintf(w, "Decoded message:\n") + encoder := json.NewEncoder(w) + if err := encoder.Encode(decodedMsg); err != nil { + fmt.Fprintf(w, "failed to generate decoded message, %v\n", err) + } +} + +func decodePrelude(r io.Reader, crc hash.Hash32) (messagePrelude, error) { + var p messagePrelude + + var err error + p.Length, err = decodeUint32(r) + if err != nil { + return messagePrelude{}, err + } + + p.HeadersLen, err = decodeUint32(r) + if err != nil { + return messagePrelude{}, err + } + + if err := p.ValidateLens(); err != nil { + return messagePrelude{}, err + } + + preludeCRC := crc.Sum32() + if err := validateCRC(r, preludeCRC); err != nil { + return messagePrelude{}, err + } + + p.PreludeCRC = preludeCRC + + return p, nil +} + +func decodePayload(buf []byte, r io.Reader) ([]byte, error) { + w := bytes.NewBuffer(buf[0:0]) + + _, err := io.Copy(w, r) + return w.Bytes(), err +} + +func decodeUint8(r io.Reader) (uint8, error) { + type byteReader interface { + ReadByte() (byte, error) + } + + if br, ok := r.(byteReader); ok { + v, err := br.ReadByte() + return uint8(v), err + } + + var b [1]byte + _, err := io.ReadFull(r, b[:]) + return uint8(b[0]), err +} +func decodeUint16(r io.Reader) (uint16, error) { + var b [2]byte + bs := b[:] + _, err := io.ReadFull(r, bs) + if err != nil { + return 0, err + } + return binary.BigEndian.Uint16(bs), nil +} +func decodeUint32(r io.Reader) (uint32, error) { + var b [4]byte + bs := b[:] + _, err := io.ReadFull(r, bs) + if err != nil { + return 0, err + } + return binary.BigEndian.Uint32(bs), nil +} +func decodeUint64(r io.Reader) (uint64, error) { + var b [8]byte + bs := b[:] + _, err := io.ReadFull(r, bs) + if err != nil { + return 0, err + } + return binary.BigEndian.Uint64(bs), nil +} + +func validateCRC(r io.Reader, expect uint32) error { + msgCRC, err := decodeUint32(r) + if err != nil { + return err + } + + if msgCRC != expect { + return ChecksumError{} + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go new file mode 100644 index 00000000000..150a60981d8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go @@ -0,0 +1,114 @@ +package eventstream + +import ( + "bytes" + "encoding/binary" + "hash" + "hash/crc32" + "io" +) + +// Encoder provides EventStream message encoding. +type Encoder struct { + w io.Writer + + headersBuf *bytes.Buffer +} + +// NewEncoder initializes and returns an Encoder to encode Event Stream +// messages to an io.Writer. +func NewEncoder(w io.Writer) *Encoder { + return &Encoder{ + w: w, + headersBuf: bytes.NewBuffer(nil), + } +} + +// Encode encodes a single EventStream message to the io.Writer the Encoder +// was created with. An error is returned if writing the message fails. +func (e *Encoder) Encode(msg Message) error { + e.headersBuf.Reset() + + err := encodeHeaders(e.headersBuf, msg.Headers) + if err != nil { + return err + } + + crc := crc32.New(crc32IEEETable) + hashWriter := io.MultiWriter(e.w, crc) + + headersLen := uint32(e.headersBuf.Len()) + payloadLen := uint32(len(msg.Payload)) + + if err := encodePrelude(hashWriter, crc, headersLen, payloadLen); err != nil { + return err + } + + if headersLen > 0 { + if _, err := io.Copy(hashWriter, e.headersBuf); err != nil { + return err + } + } + + if payloadLen > 0 { + if _, err := hashWriter.Write(msg.Payload); err != nil { + return err + } + } + + msgCRC := crc.Sum32() + return binary.Write(e.w, binary.BigEndian, msgCRC) +} + +func encodePrelude(w io.Writer, crc hash.Hash32, headersLen, payloadLen uint32) error { + p := messagePrelude{ + Length: minMsgLen + headersLen + payloadLen, + HeadersLen: headersLen, + } + if err := p.ValidateLens(); err != nil { + return err + } + + err := binaryWriteFields(w, binary.BigEndian, + p.Length, + p.HeadersLen, + ) + if err != nil { + return err + } + + p.PreludeCRC = crc.Sum32() + err = binary.Write(w, binary.BigEndian, p.PreludeCRC) + if err != nil { + return err + } + + return nil +} + +func encodeHeaders(w io.Writer, headers Headers) error { + for _, h := range headers { + hn := headerName{ + Len: uint8(len(h.Name)), + } + copy(hn.Name[:hn.Len], h.Name) + if err := hn.encode(w); err != nil { + return err + } + + if err := h.Value.encode(w); err != nil { + return err + } + } + + return nil +} + +func binaryWriteFields(w io.Writer, order binary.ByteOrder, vs ...interface{}) error { + for _, v := range vs { + if err := binary.Write(w, order, v); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go new file mode 100644 index 00000000000..5481ef30796 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go @@ -0,0 +1,23 @@ +package eventstream + +import "fmt" + +// LengthError provides the error for items being larger than a maximum length. +type LengthError struct { + Part string + Want int + Have int + Value interface{} +} + +func (e LengthError) Error() string { + return fmt.Sprintf("%s length invalid, %d/%d, %v", + e.Part, e.Want, e.Have, e.Value) +} + +// ChecksumError provides the error for message checksum invalidation errors. +type ChecksumError struct{} + +func (e ChecksumError) Error() string { + return "message checksum mismatch" +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/BUILD.bazel new file mode 100644 index 00000000000..5ab73770c41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "error.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi", + importpath = "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go new file mode 100644 index 00000000000..97937c8e598 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go @@ -0,0 +1,196 @@ +package eventstreamapi + +import ( + "fmt" + "io" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/eventstream" +) + +// Unmarshaler provides the interface for unmarshaling a EventStream +// message into a SDK type. +type Unmarshaler interface { + UnmarshalEvent(protocol.PayloadUnmarshaler, eventstream.Message) error +} + +// EventStream headers with specific meaning to async API functionality. +const ( + MessageTypeHeader = `:message-type` // Identifies type of message. + EventMessageType = `event` + ErrorMessageType = `error` + ExceptionMessageType = `exception` + + // Message Events + EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats". + + // Message Error + ErrorCodeHeader = `:error-code` + ErrorMessageHeader = `:error-message` + + // Message Exception + ExceptionTypeHeader = `:exception-type` +) + +// EventReader provides reading from the EventStream of an reader. +type EventReader struct { + reader io.ReadCloser + decoder *eventstream.Decoder + + unmarshalerForEventType func(string) (Unmarshaler, error) + payloadUnmarshaler protocol.PayloadUnmarshaler + + payloadBuf []byte +} + +// NewEventReader returns a EventReader built from the reader and unmarshaler +// provided. Use ReadStream method to start reading from the EventStream. +func NewEventReader( + reader io.ReadCloser, + payloadUnmarshaler protocol.PayloadUnmarshaler, + unmarshalerForEventType func(string) (Unmarshaler, error), +) *EventReader { + return &EventReader{ + reader: reader, + decoder: eventstream.NewDecoder(reader), + payloadUnmarshaler: payloadUnmarshaler, + unmarshalerForEventType: unmarshalerForEventType, + payloadBuf: make([]byte, 10*1024), + } +} + +// UseLogger instructs the EventReader to use the logger and log level +// specified. +func (r *EventReader) UseLogger(logger aws.Logger, logLevel aws.LogLevelType) { + if logger != nil && logLevel.Matches(aws.LogDebugWithEventStreamBody) { + r.decoder.UseLogger(logger) + } +} + +// ReadEvent attempts to read a message from the EventStream and return the +// unmarshaled event value that the message is for. +// +// For EventStream API errors check if the returned error satisfies the +// awserr.Error interface to get the error's Code and Message components. +// +// EventUnmarshalers called with EventStream messages must take copies of the +// message's Payload. The payload will is reused between events read. +func (r *EventReader) ReadEvent() (event interface{}, err error) { + msg, err := r.decoder.Decode(r.payloadBuf) + if err != nil { + return nil, err + } + defer func() { + // Reclaim payload buffer for next message read. + r.payloadBuf = msg.Payload[0:0] + }() + + typ, err := GetHeaderString(msg, MessageTypeHeader) + if err != nil { + return nil, err + } + + switch typ { + case EventMessageType: + return r.unmarshalEventMessage(msg) + case ExceptionMessageType: + err = r.unmarshalEventException(msg) + return nil, err + case ErrorMessageType: + return nil, r.unmarshalErrorMessage(msg) + default: + return nil, fmt.Errorf("unknown eventstream message type, %v", typ) + } +} + +func (r *EventReader) unmarshalEventMessage( + msg eventstream.Message, +) (event interface{}, err error) { + eventType, err := GetHeaderString(msg, EventTypeHeader) + if err != nil { + return nil, err + } + + ev, err := r.unmarshalerForEventType(eventType) + if err != nil { + return nil, err + } + + err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) + if err != nil { + return nil, err + } + + return ev, nil +} + +func (r *EventReader) unmarshalEventException( + msg eventstream.Message, +) (err error) { + eventType, err := GetHeaderString(msg, ExceptionTypeHeader) + if err != nil { + return err + } + + ev, err := r.unmarshalerForEventType(eventType) + if err != nil { + return err + } + + err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) + if err != nil { + return err + } + + var ok bool + err, ok = ev.(error) + if !ok { + err = messageError{ + code: "SerializationError", + msg: fmt.Sprintf( + "event stream exception %s mapped to non-error %T, %v", + eventType, ev, ev, + ), + } + } + + return err +} + +func (r *EventReader) unmarshalErrorMessage(msg eventstream.Message) (err error) { + var msgErr messageError + + msgErr.code, err = GetHeaderString(msg, ErrorCodeHeader) + if err != nil { + return err + } + + msgErr.msg, err = GetHeaderString(msg, ErrorMessageHeader) + if err != nil { + return err + } + + return msgErr +} + +// Close closes the EventReader's EventStream reader. +func (r *EventReader) Close() error { + return r.reader.Close() +} + +// GetHeaderString returns the value of the header as a string. If the header +// is not set or the value is not a string an error will be returned. +func GetHeaderString(msg eventstream.Message, headerName string) (string, error) { + headerVal := msg.Headers.Get(headerName) + if headerVal == nil { + return "", fmt.Errorf("error header %s not present", headerName) + } + + v, ok := headerVal.Get().(string) + if !ok { + return "", fmt.Errorf("error header value is not a string, %T", headerVal) + } + + return v, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go new file mode 100644 index 00000000000..5ea5a988b63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go @@ -0,0 +1,24 @@ +package eventstreamapi + +import "fmt" + +type messageError struct { + code string + msg string +} + +func (e messageError) Code() string { + return e.code +} + +func (e messageError) Message() string { + return e.msg +} + +func (e messageError) Error() string { + return fmt.Sprintf("%s: %s", e.code, e.msg) +} + +func (e messageError) OrigErr() error { + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go new file mode 100644 index 00000000000..3b44dde2f32 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go @@ -0,0 +1,166 @@ +package eventstream + +import ( + "encoding/binary" + "fmt" + "io" +) + +// Headers are a collection of EventStream header values. +type Headers []Header + +// Header is a single EventStream Key Value header pair. +type Header struct { + Name string + Value Value +} + +// Set associates the name with a value. If the header name already exists in +// the Headers the value will be replaced with the new one. +func (hs *Headers) Set(name string, value Value) { + var i int + for ; i < len(*hs); i++ { + if (*hs)[i].Name == name { + (*hs)[i].Value = value + return + } + } + + *hs = append(*hs, Header{ + Name: name, Value: value, + }) +} + +// Get returns the Value associated with the header. Nil is returned if the +// value does not exist. +func (hs Headers) Get(name string) Value { + for i := 0; i < len(hs); i++ { + if h := hs[i]; h.Name == name { + return h.Value + } + } + return nil +} + +// Del deletes the value in the Headers if it exists. +func (hs *Headers) Del(name string) { + for i := 0; i < len(*hs); i++ { + if (*hs)[i].Name == name { + copy((*hs)[i:], (*hs)[i+1:]) + (*hs) = (*hs)[:len(*hs)-1] + } + } +} + +func decodeHeaders(r io.Reader) (Headers, error) { + hs := Headers{} + + for { + name, err := decodeHeaderName(r) + if err != nil { + if err == io.EOF { + // EOF while getting header name means no more headers + break + } + return nil, err + } + + value, err := decodeHeaderValue(r) + if err != nil { + return nil, err + } + + hs.Set(name, value) + } + + return hs, nil +} + +func decodeHeaderName(r io.Reader) (string, error) { + var n headerName + + var err error + n.Len, err = decodeUint8(r) + if err != nil { + return "", err + } + + name := n.Name[:n.Len] + if _, err := io.ReadFull(r, name); err != nil { + return "", err + } + + return string(name), nil +} + +func decodeHeaderValue(r io.Reader) (Value, error) { + var raw rawValue + + typ, err := decodeUint8(r) + if err != nil { + return nil, err + } + raw.Type = valueType(typ) + + var v Value + + switch raw.Type { + case trueValueType: + v = BoolValue(true) + case falseValueType: + v = BoolValue(false) + case int8ValueType: + var tv Int8Value + err = tv.decode(r) + v = tv + case int16ValueType: + var tv Int16Value + err = tv.decode(r) + v = tv + case int32ValueType: + var tv Int32Value + err = tv.decode(r) + v = tv + case int64ValueType: + var tv Int64Value + err = tv.decode(r) + v = tv + case bytesValueType: + var tv BytesValue + err = tv.decode(r) + v = tv + case stringValueType: + var tv StringValue + err = tv.decode(r) + v = tv + case timestampValueType: + var tv TimestampValue + err = tv.decode(r) + v = tv + case uuidValueType: + var tv UUIDValue + err = tv.decode(r) + v = tv + default: + panic(fmt.Sprintf("unknown value type %d", raw.Type)) + } + + // Error could be EOF, let caller deal with it + return v, err +} + +const maxHeaderNameLen = 255 + +type headerName struct { + Len uint8 + Name [maxHeaderNameLen]byte +} + +func (v headerName) encode(w io.Writer) error { + if err := binary.Write(w, binary.BigEndian, v.Len); err != nil { + return err + } + + _, err := w.Write(v.Name[:v.Len]) + return err +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go new file mode 100644 index 00000000000..e3fc0766a9e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go @@ -0,0 +1,501 @@ +package eventstream + +import ( + "encoding/base64" + "encoding/binary" + "fmt" + "io" + "strconv" + "time" +) + +const maxHeaderValueLen = 1<<15 - 1 // 2^15-1 or 32KB - 1 + +// valueType is the EventStream header value type. +type valueType uint8 + +// Header value types +const ( + trueValueType valueType = iota + falseValueType + int8ValueType // Byte + int16ValueType // Short + int32ValueType // Integer + int64ValueType // Long + bytesValueType + stringValueType + timestampValueType + uuidValueType +) + +func (t valueType) String() string { + switch t { + case trueValueType: + return "bool" + case falseValueType: + return "bool" + case int8ValueType: + return "int8" + case int16ValueType: + return "int16" + case int32ValueType: + return "int32" + case int64ValueType: + return "int64" + case bytesValueType: + return "byte_array" + case stringValueType: + return "string" + case timestampValueType: + return "timestamp" + case uuidValueType: + return "uuid" + default: + return fmt.Sprintf("unknown value type %d", uint8(t)) + } +} + +type rawValue struct { + Type valueType + Len uint16 // Only set for variable length slices + Value []byte // byte representation of value, BigEndian encoding. +} + +func (r rawValue) encodeScalar(w io.Writer, v interface{}) error { + return binaryWriteFields(w, binary.BigEndian, + r.Type, + v, + ) +} + +func (r rawValue) encodeFixedSlice(w io.Writer, v []byte) error { + binary.Write(w, binary.BigEndian, r.Type) + + _, err := w.Write(v) + return err +} + +func (r rawValue) encodeBytes(w io.Writer, v []byte) error { + if len(v) > maxHeaderValueLen { + return LengthError{ + Part: "header value", + Want: maxHeaderValueLen, Have: len(v), + Value: v, + } + } + r.Len = uint16(len(v)) + + err := binaryWriteFields(w, binary.BigEndian, + r.Type, + r.Len, + ) + if err != nil { + return err + } + + _, err = w.Write(v) + return err +} + +func (r rawValue) encodeString(w io.Writer, v string) error { + if len(v) > maxHeaderValueLen { + return LengthError{ + Part: "header value", + Want: maxHeaderValueLen, Have: len(v), + Value: v, + } + } + r.Len = uint16(len(v)) + + type stringWriter interface { + WriteString(string) (int, error) + } + + err := binaryWriteFields(w, binary.BigEndian, + r.Type, + r.Len, + ) + if err != nil { + return err + } + + if sw, ok := w.(stringWriter); ok { + _, err = sw.WriteString(v) + } else { + _, err = w.Write([]byte(v)) + } + + return err +} + +func decodeFixedBytesValue(r io.Reader, buf []byte) error { + _, err := io.ReadFull(r, buf) + return err +} + +func decodeBytesValue(r io.Reader) ([]byte, error) { + var raw rawValue + var err error + raw.Len, err = decodeUint16(r) + if err != nil { + return nil, err + } + + buf := make([]byte, raw.Len) + _, err = io.ReadFull(r, buf) + if err != nil { + return nil, err + } + + return buf, nil +} + +func decodeStringValue(r io.Reader) (string, error) { + v, err := decodeBytesValue(r) + return string(v), err +} + +// Value represents the abstract header value. +type Value interface { + Get() interface{} + String() string + valueType() valueType + encode(io.Writer) error +} + +// An BoolValue provides eventstream encoding, and representation +// of a Go bool value. +type BoolValue bool + +// Get returns the underlying type +func (v BoolValue) Get() interface{} { + return bool(v) +} + +// valueType returns the EventStream header value type value. +func (v BoolValue) valueType() valueType { + if v { + return trueValueType + } + return falseValueType +} + +func (v BoolValue) String() string { + return strconv.FormatBool(bool(v)) +} + +// encode encodes the BoolValue into an eventstream binary value +// representation. +func (v BoolValue) encode(w io.Writer) error { + return binary.Write(w, binary.BigEndian, v.valueType()) +} + +// An Int8Value provides eventstream encoding, and representation of a Go +// int8 value. +type Int8Value int8 + +// Get returns the underlying value. +func (v Int8Value) Get() interface{} { + return int8(v) +} + +// valueType returns the EventStream header value type value. +func (Int8Value) valueType() valueType { + return int8ValueType +} + +func (v Int8Value) String() string { + return fmt.Sprintf("0x%02x", int8(v)) +} + +// encode encodes the Int8Value into an eventstream binary value +// representation. +func (v Int8Value) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + + return raw.encodeScalar(w, v) +} + +func (v *Int8Value) decode(r io.Reader) error { + n, err := decodeUint8(r) + if err != nil { + return err + } + + *v = Int8Value(n) + return nil +} + +// An Int16Value provides eventstream encoding, and representation of a Go +// int16 value. +type Int16Value int16 + +// Get returns the underlying value. +func (v Int16Value) Get() interface{} { + return int16(v) +} + +// valueType returns the EventStream header value type value. +func (Int16Value) valueType() valueType { + return int16ValueType +} + +func (v Int16Value) String() string { + return fmt.Sprintf("0x%04x", int16(v)) +} + +// encode encodes the Int16Value into an eventstream binary value +// representation. +func (v Int16Value) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + return raw.encodeScalar(w, v) +} + +func (v *Int16Value) decode(r io.Reader) error { + n, err := decodeUint16(r) + if err != nil { + return err + } + + *v = Int16Value(n) + return nil +} + +// An Int32Value provides eventstream encoding, and representation of a Go +// int32 value. +type Int32Value int32 + +// Get returns the underlying value. +func (v Int32Value) Get() interface{} { + return int32(v) +} + +// valueType returns the EventStream header value type value. +func (Int32Value) valueType() valueType { + return int32ValueType +} + +func (v Int32Value) String() string { + return fmt.Sprintf("0x%08x", int32(v)) +} + +// encode encodes the Int32Value into an eventstream binary value +// representation. +func (v Int32Value) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + return raw.encodeScalar(w, v) +} + +func (v *Int32Value) decode(r io.Reader) error { + n, err := decodeUint32(r) + if err != nil { + return err + } + + *v = Int32Value(n) + return nil +} + +// An Int64Value provides eventstream encoding, and representation of a Go +// int64 value. +type Int64Value int64 + +// Get returns the underlying value. +func (v Int64Value) Get() interface{} { + return int64(v) +} + +// valueType returns the EventStream header value type value. +func (Int64Value) valueType() valueType { + return int64ValueType +} + +func (v Int64Value) String() string { + return fmt.Sprintf("0x%016x", int64(v)) +} + +// encode encodes the Int64Value into an eventstream binary value +// representation. +func (v Int64Value) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + return raw.encodeScalar(w, v) +} + +func (v *Int64Value) decode(r io.Reader) error { + n, err := decodeUint64(r) + if err != nil { + return err + } + + *v = Int64Value(n) + return nil +} + +// An BytesValue provides eventstream encoding, and representation of a Go +// byte slice. +type BytesValue []byte + +// Get returns the underlying value. +func (v BytesValue) Get() interface{} { + return []byte(v) +} + +// valueType returns the EventStream header value type value. +func (BytesValue) valueType() valueType { + return bytesValueType +} + +func (v BytesValue) String() string { + return base64.StdEncoding.EncodeToString([]byte(v)) +} + +// encode encodes the BytesValue into an eventstream binary value +// representation. +func (v BytesValue) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + + return raw.encodeBytes(w, []byte(v)) +} + +func (v *BytesValue) decode(r io.Reader) error { + buf, err := decodeBytesValue(r) + if err != nil { + return err + } + + *v = BytesValue(buf) + return nil +} + +// An StringValue provides eventstream encoding, and representation of a Go +// string. +type StringValue string + +// Get returns the underlying value. +func (v StringValue) Get() interface{} { + return string(v) +} + +// valueType returns the EventStream header value type value. +func (StringValue) valueType() valueType { + return stringValueType +} + +func (v StringValue) String() string { + return string(v) +} + +// encode encodes the StringValue into an eventstream binary value +// representation. +func (v StringValue) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + + return raw.encodeString(w, string(v)) +} + +func (v *StringValue) decode(r io.Reader) error { + s, err := decodeStringValue(r) + if err != nil { + return err + } + + *v = StringValue(s) + return nil +} + +// An TimestampValue provides eventstream encoding, and representation of a Go +// timestamp. +type TimestampValue time.Time + +// Get returns the underlying value. +func (v TimestampValue) Get() interface{} { + return time.Time(v) +} + +// valueType returns the EventStream header value type value. +func (TimestampValue) valueType() valueType { + return timestampValueType +} + +func (v TimestampValue) epochMilli() int64 { + nano := time.Time(v).UnixNano() + msec := nano / int64(time.Millisecond) + return msec +} + +func (v TimestampValue) String() string { + msec := v.epochMilli() + return strconv.FormatInt(msec, 10) +} + +// encode encodes the TimestampValue into an eventstream binary value +// representation. +func (v TimestampValue) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + + msec := v.epochMilli() + return raw.encodeScalar(w, msec) +} + +func (v *TimestampValue) decode(r io.Reader) error { + n, err := decodeUint64(r) + if err != nil { + return err + } + + *v = TimestampValue(timeFromEpochMilli(int64(n))) + return nil +} + +func timeFromEpochMilli(t int64) time.Time { + secs := t / 1e3 + msec := t % 1e3 + return time.Unix(secs, msec*int64(time.Millisecond)).UTC() +} + +// An UUIDValue provides eventstream encoding, and representation of a UUID +// value. +type UUIDValue [16]byte + +// Get returns the underlying value. +func (v UUIDValue) Get() interface{} { + return v[:] +} + +// valueType returns the EventStream header value type value. +func (UUIDValue) valueType() valueType { + return uuidValueType +} + +func (v UUIDValue) String() string { + return fmt.Sprintf(`%X-%X-%X-%X-%X`, v[0:4], v[4:6], v[6:8], v[8:10], v[10:]) +} + +// encode encodes the UUIDValue into an eventstream binary value +// representation. +func (v UUIDValue) encode(w io.Writer) error { + raw := rawValue{ + Type: v.valueType(), + } + + return raw.encodeFixedSlice(w, v[:]) +} + +func (v *UUIDValue) decode(r io.Reader) error { + tv := (*v)[:] + return decodeFixedBytesValue(r, tv) +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go new file mode 100644 index 00000000000..2dc012a66e2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go @@ -0,0 +1,103 @@ +package eventstream + +import ( + "bytes" + "encoding/binary" + "hash/crc32" +) + +const preludeLen = 8 +const preludeCRCLen = 4 +const msgCRCLen = 4 +const minMsgLen = preludeLen + preludeCRCLen + msgCRCLen +const maxPayloadLen = 1024 * 1024 * 16 // 16MB +const maxHeadersLen = 1024 * 128 // 128KB +const maxMsgLen = minMsgLen + maxHeadersLen + maxPayloadLen + +var crc32IEEETable = crc32.MakeTable(crc32.IEEE) + +// A Message provides the eventstream message representation. +type Message struct { + Headers Headers + Payload []byte +} + +func (m *Message) rawMessage() (rawMessage, error) { + var raw rawMessage + + if len(m.Headers) > 0 { + var headers bytes.Buffer + if err := encodeHeaders(&headers, m.Headers); err != nil { + return rawMessage{}, err + } + raw.Headers = headers.Bytes() + raw.HeadersLen = uint32(len(raw.Headers)) + } + + raw.Length = raw.HeadersLen + uint32(len(m.Payload)) + minMsgLen + + hash := crc32.New(crc32IEEETable) + binaryWriteFields(hash, binary.BigEndian, raw.Length, raw.HeadersLen) + raw.PreludeCRC = hash.Sum32() + + binaryWriteFields(hash, binary.BigEndian, raw.PreludeCRC) + + if raw.HeadersLen > 0 { + hash.Write(raw.Headers) + } + + // Read payload bytes and update hash for it as well. + if len(m.Payload) > 0 { + raw.Payload = m.Payload + hash.Write(raw.Payload) + } + + raw.CRC = hash.Sum32() + + return raw, nil +} + +type messagePrelude struct { + Length uint32 + HeadersLen uint32 + PreludeCRC uint32 +} + +func (p messagePrelude) PayloadLen() uint32 { + return p.Length - p.HeadersLen - minMsgLen +} + +func (p messagePrelude) ValidateLens() error { + if p.Length == 0 || p.Length > maxMsgLen { + return LengthError{ + Part: "message prelude", + Want: maxMsgLen, + Have: int(p.Length), + } + } + if p.HeadersLen > maxHeadersLen { + return LengthError{ + Part: "message headers", + Want: maxHeadersLen, + Have: int(p.HeadersLen), + } + } + if payloadLen := p.PayloadLen(); payloadLen > maxPayloadLen { + return LengthError{ + Part: "message payload", + Want: maxPayloadLen, + Have: int(payloadLen), + } + } + + return nil +} + +type rawMessage struct { + messagePrelude + + Headers []byte + Payload []byte + + CRC uint32 +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/BUILD.bazel new file mode 100644 index 00000000000..4f3f77712ab --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["restxml.go"], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml", + importpath = "github.com/aws/aws-sdk-go/private/protocol/restxml", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/query:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/rest:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go new file mode 100644 index 00000000000..b0f4e245661 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go @@ -0,0 +1,77 @@ +// Package restxml provides RESTful XML serialization of AWS +// requests and responses. +package restxml + +//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/rest-xml.json build_test.go +//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/rest-xml.json unmarshal_test.go + +import ( + "bytes" + "encoding/xml" + + "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" + "github.com/aws/aws-sdk-go/private/protocol/rest" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" +) + +// BuildHandler is a named request handler for building restxml protocol requests +var BuildHandler = request.NamedHandler{Name: "awssdk.restxml.Build", Fn: Build} + +// UnmarshalHandler is a named request handler for unmarshaling restxml protocol requests +var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restxml.Unmarshal", Fn: Unmarshal} + +// UnmarshalMetaHandler is a named request handler for unmarshaling restxml protocol request metadata +var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalMeta", Fn: UnmarshalMeta} + +// UnmarshalErrorHandler is a named request handler for unmarshaling restxml protocol request errors +var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalError", Fn: UnmarshalError} + +// Build builds a request payload for the REST XML protocol. +func Build(r *request.Request) { + rest.Build(r) + + if t := rest.PayloadType(r.Params); t == "structure" || t == "" { + var buf bytes.Buffer + err := xmlutil.BuildXML(r.Params, xml.NewEncoder(&buf)) + if err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New("SerializationError", "failed to encode rest XML request", err), + r.HTTPResponse.StatusCode, + r.RequestID, + ) + return + } + r.SetBufferBody(buf.Bytes()) + } +} + +// Unmarshal unmarshals a payload response for the REST XML protocol. +func Unmarshal(r *request.Request) { + if t := rest.PayloadType(r.Data); t == "structure" || t == "" { + defer r.HTTPResponse.Body.Close() + decoder := xml.NewDecoder(r.HTTPResponse.Body) + err := xmlutil.UnmarshalXML(r.Data, decoder, "") + if err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New("SerializationError", "failed to decode REST XML response", err), + r.HTTPResponse.StatusCode, + r.RequestID, + ) + return + } + } else { + rest.Unmarshal(r) + } +} + +// UnmarshalMeta unmarshals response headers for the REST XML protocol. +func UnmarshalMeta(r *request.Request) { + rest.UnmarshalMeta(r) +} + +// UnmarshalError unmarshals a response error for the REST XML protocol. +func UnmarshalError(r *request.Request) { + query.UnmarshalError(r) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/BUILD.bazel new file mode 100644 index 00000000000..55891827276 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "doc.go", + "errors.go", + "service.go", + "waiters.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/autoscaling", + importpath = "github.com/aws/aws-sdk-go/service/autoscaling", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/query:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go new file mode 100644 index 00000000000..b883a33189a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -0,0 +1,13146 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package autoscaling + +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/query" +) + +const opAttachInstances = "AttachInstances" + +// AttachInstancesRequest generates a "aws/request.Request" representing the +// client's request for the AttachInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachInstances for more information on using the AttachInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachInstancesRequest method. +// req, resp := client.AttachInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstances +func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req *request.Request, output *AttachInstancesOutput) { + op := &request.Operation{ + Name: opAttachInstances, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachInstancesInput{} + } + + output = &AttachInstancesOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AttachInstances API operation for Auto Scaling. +// +// Attaches one or more EC2 instances to the specified Auto Scaling group. +// +// When you attach instances, Amazon EC2 Auto Scaling increases the desired +// capacity of the group by the number of instances being attached. If the number +// of instances being attached plus the desired capacity of the group exceeds +// the maximum size of the group, the operation fails. +// +// If there is a Classic Load Balancer attached to your Auto Scaling group, +// the instances are also registered with the load balancer. If there are target +// groups attached to your Auto Scaling group, the instances are also registered +// with the target groups. +// +// For more information, see Attach EC2 Instances to Your Auto Scaling Group +// (http://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation AttachInstances for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachInstances +func (c *AutoScaling) AttachInstances(input *AttachInstancesInput) (*AttachInstancesOutput, error) { + req, out := c.AttachInstancesRequest(input) + return out, req.Send() +} + +// AttachInstancesWithContext is the same as AttachInstances with the addition of +// the ability to pass a context and additional request options. +// +// See AttachInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) AttachInstancesWithContext(ctx aws.Context, input *AttachInstancesInput, opts ...request.Option) (*AttachInstancesOutput, error) { + req, out := c.AttachInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAttachLoadBalancerTargetGroups = "AttachLoadBalancerTargetGroups" + +// AttachLoadBalancerTargetGroupsRequest generates a "aws/request.Request" representing the +// client's request for the AttachLoadBalancerTargetGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachLoadBalancerTargetGroups for more information on using the AttachLoadBalancerTargetGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachLoadBalancerTargetGroupsRequest method. +// req, resp := client.AttachLoadBalancerTargetGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroups +func (c *AutoScaling) AttachLoadBalancerTargetGroupsRequest(input *AttachLoadBalancerTargetGroupsInput) (req *request.Request, output *AttachLoadBalancerTargetGroupsOutput) { + op := &request.Operation{ + Name: opAttachLoadBalancerTargetGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachLoadBalancerTargetGroupsInput{} + } + + output = &AttachLoadBalancerTargetGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// AttachLoadBalancerTargetGroups API operation for Auto Scaling. +// +// Attaches one or more target groups to the specified Auto Scaling group. +// +// To describe the target groups for an Auto Scaling group, use DescribeLoadBalancerTargetGroups. +// To detach the target group from the Auto Scaling group, use DetachLoadBalancerTargetGroups. +// +// For more information, see Attach a Load Balancer to Your Auto Scaling Group +// (http://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation AttachLoadBalancerTargetGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancerTargetGroups +func (c *AutoScaling) AttachLoadBalancerTargetGroups(input *AttachLoadBalancerTargetGroupsInput) (*AttachLoadBalancerTargetGroupsOutput, error) { + req, out := c.AttachLoadBalancerTargetGroupsRequest(input) + return out, req.Send() +} + +// AttachLoadBalancerTargetGroupsWithContext is the same as AttachLoadBalancerTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See AttachLoadBalancerTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) AttachLoadBalancerTargetGroupsWithContext(ctx aws.Context, input *AttachLoadBalancerTargetGroupsInput, opts ...request.Option) (*AttachLoadBalancerTargetGroupsOutput, error) { + req, out := c.AttachLoadBalancerTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAttachLoadBalancers = "AttachLoadBalancers" + +// AttachLoadBalancersRequest generates a "aws/request.Request" representing the +// client's request for the AttachLoadBalancers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachLoadBalancers for more information on using the AttachLoadBalancers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachLoadBalancersRequest method. +// req, resp := client.AttachLoadBalancersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancers +func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput) (req *request.Request, output *AttachLoadBalancersOutput) { + op := &request.Operation{ + Name: opAttachLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachLoadBalancersInput{} + } + + output = &AttachLoadBalancersOutput{} + req = c.newRequest(op, input, output) + return +} + +// AttachLoadBalancers API operation for Auto Scaling. +// +// Attaches one or more Classic Load Balancers to the specified Auto Scaling +// group. +// +// To attach an Application Load Balancer instead, see AttachLoadBalancerTargetGroups. +// +// To describe the load balancers for an Auto Scaling group, use DescribeLoadBalancers. +// To detach the load balancer from the Auto Scaling group, use DetachLoadBalancers. +// +// For more information, see Attach a Load Balancer to Your Auto Scaling Group +// (http://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation AttachLoadBalancers for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/AttachLoadBalancers +func (c *AutoScaling) AttachLoadBalancers(input *AttachLoadBalancersInput) (*AttachLoadBalancersOutput, error) { + req, out := c.AttachLoadBalancersRequest(input) + return out, req.Send() +} + +// AttachLoadBalancersWithContext is the same as AttachLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See AttachLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) AttachLoadBalancersWithContext(ctx aws.Context, input *AttachLoadBalancersInput, opts ...request.Option) (*AttachLoadBalancersOutput, error) { + req, out := c.AttachLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opBatchDeleteScheduledAction = "BatchDeleteScheduledAction" + +// BatchDeleteScheduledActionRequest generates a "aws/request.Request" representing the +// client's request for the BatchDeleteScheduledAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchDeleteScheduledAction for more information on using the BatchDeleteScheduledAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchDeleteScheduledActionRequest method. +// req, resp := client.BatchDeleteScheduledActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/BatchDeleteScheduledAction +func (c *AutoScaling) BatchDeleteScheduledActionRequest(input *BatchDeleteScheduledActionInput) (req *request.Request, output *BatchDeleteScheduledActionOutput) { + op := &request.Operation{ + Name: opBatchDeleteScheduledAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &BatchDeleteScheduledActionInput{} + } + + output = &BatchDeleteScheduledActionOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchDeleteScheduledAction API operation for Auto Scaling. +// +// Deletes one or more scheduled actions for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation BatchDeleteScheduledAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/BatchDeleteScheduledAction +func (c *AutoScaling) BatchDeleteScheduledAction(input *BatchDeleteScheduledActionInput) (*BatchDeleteScheduledActionOutput, error) { + req, out := c.BatchDeleteScheduledActionRequest(input) + return out, req.Send() +} + +// BatchDeleteScheduledActionWithContext is the same as BatchDeleteScheduledAction with the addition of +// the ability to pass a context and additional request options. +// +// See BatchDeleteScheduledAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) BatchDeleteScheduledActionWithContext(ctx aws.Context, input *BatchDeleteScheduledActionInput, opts ...request.Option) (*BatchDeleteScheduledActionOutput, error) { + req, out := c.BatchDeleteScheduledActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opBatchPutScheduledUpdateGroupAction = "BatchPutScheduledUpdateGroupAction" + +// BatchPutScheduledUpdateGroupActionRequest generates a "aws/request.Request" representing the +// client's request for the BatchPutScheduledUpdateGroupAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchPutScheduledUpdateGroupAction for more information on using the BatchPutScheduledUpdateGroupAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchPutScheduledUpdateGroupActionRequest method. +// req, resp := client.BatchPutScheduledUpdateGroupActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/BatchPutScheduledUpdateGroupAction +func (c *AutoScaling) BatchPutScheduledUpdateGroupActionRequest(input *BatchPutScheduledUpdateGroupActionInput) (req *request.Request, output *BatchPutScheduledUpdateGroupActionOutput) { + op := &request.Operation{ + Name: opBatchPutScheduledUpdateGroupAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &BatchPutScheduledUpdateGroupActionInput{} + } + + output = &BatchPutScheduledUpdateGroupActionOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchPutScheduledUpdateGroupAction API operation for Auto Scaling. +// +// Creates or updates one or more scheduled scaling actions for an Auto Scaling +// group. When updating a scheduled scaling action, if you leave a parameter +// unspecified, the corresponding value remains unchanged. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation BatchPutScheduledUpdateGroupAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAlreadyExistsFault "AlreadyExists" +// You already have an Auto Scaling group or launch configuration with this +// name. +// +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/BatchPutScheduledUpdateGroupAction +func (c *AutoScaling) BatchPutScheduledUpdateGroupAction(input *BatchPutScheduledUpdateGroupActionInput) (*BatchPutScheduledUpdateGroupActionOutput, error) { + req, out := c.BatchPutScheduledUpdateGroupActionRequest(input) + return out, req.Send() +} + +// BatchPutScheduledUpdateGroupActionWithContext is the same as BatchPutScheduledUpdateGroupAction with the addition of +// the ability to pass a context and additional request options. +// +// See BatchPutScheduledUpdateGroupAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) BatchPutScheduledUpdateGroupActionWithContext(ctx aws.Context, input *BatchPutScheduledUpdateGroupActionInput, opts ...request.Option) (*BatchPutScheduledUpdateGroupActionOutput, error) { + req, out := c.BatchPutScheduledUpdateGroupActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCompleteLifecycleAction = "CompleteLifecycleAction" + +// CompleteLifecycleActionRequest generates a "aws/request.Request" representing the +// client's request for the CompleteLifecycleAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CompleteLifecycleAction for more information on using the CompleteLifecycleAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CompleteLifecycleActionRequest method. +// req, resp := client.CompleteLifecycleActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleAction +func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleActionInput) (req *request.Request, output *CompleteLifecycleActionOutput) { + op := &request.Operation{ + Name: opCompleteLifecycleAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CompleteLifecycleActionInput{} + } + + output = &CompleteLifecycleActionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CompleteLifecycleAction API operation for Auto Scaling. +// +// Completes the lifecycle action for the specified token or instance with the +// specified result. +// +// This step is a part of the procedure for adding a lifecycle hook to an Auto +// Scaling group: +// +// (Optional) Create a Lambda function and a rule that allows CloudWatch Events +// to invoke your Lambda function when Amazon EC2 Auto Scaling launches or terminates +// instances. +// +// (Optional) Create a notification target and an IAM role. The target can be +// either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon +// EC2 Auto Scaling to publish lifecycle notifications to the target. +// +// Create the lifecycle hook. Specify whether the hook is used when the instances +// launch or terminate. +// +// If you need more time, record the lifecycle action heartbeat to keep the +// instance in a pending state. +// +// If you finish before the timeout period ends, complete the lifecycle action. +// +// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation CompleteLifecycleAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CompleteLifecycleAction +func (c *AutoScaling) CompleteLifecycleAction(input *CompleteLifecycleActionInput) (*CompleteLifecycleActionOutput, error) { + req, out := c.CompleteLifecycleActionRequest(input) + return out, req.Send() +} + +// CompleteLifecycleActionWithContext is the same as CompleteLifecycleAction with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteLifecycleAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) CompleteLifecycleActionWithContext(ctx aws.Context, input *CompleteLifecycleActionInput, opts ...request.Option) (*CompleteLifecycleActionOutput, error) { + req, out := c.CompleteLifecycleActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateAutoScalingGroup = "CreateAutoScalingGroup" + +// CreateAutoScalingGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateAutoScalingGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAutoScalingGroup for more information on using the CreateAutoScalingGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAutoScalingGroupRequest method. +// req, resp := client.CreateAutoScalingGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroup +func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGroupInput) (req *request.Request, output *CreateAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opCreateAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateAutoScalingGroupInput{} + } + + output = &CreateAutoScalingGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateAutoScalingGroup API operation for Auto Scaling. +// +// Creates an Auto Scaling group with the specified name and attributes. +// +// If you exceed your maximum limit of Auto Scaling groups, the call fails. +// For information about viewing this limit, see DescribeAccountLimits. For +// information about updating this limit, see Auto Scaling Limits (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// in the Amazon EC2 Auto Scaling User Guide. +// +// For more information, see Auto Scaling Groups (http://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation CreateAutoScalingGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAlreadyExistsFault "AlreadyExists" +// You already have an Auto Scaling group or launch configuration with this +// name. +// +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateAutoScalingGroup +func (c *AutoScaling) CreateAutoScalingGroup(input *CreateAutoScalingGroupInput) (*CreateAutoScalingGroupOutput, error) { + req, out := c.CreateAutoScalingGroupRequest(input) + return out, req.Send() +} + +// CreateAutoScalingGroupWithContext is the same as CreateAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) CreateAutoScalingGroupWithContext(ctx aws.Context, input *CreateAutoScalingGroupInput, opts ...request.Option) (*CreateAutoScalingGroupOutput, error) { + req, out := c.CreateAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLaunchConfiguration = "CreateLaunchConfiguration" + +// CreateLaunchConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the CreateLaunchConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLaunchConfiguration for more information on using the CreateLaunchConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLaunchConfigurationRequest method. +// req, resp := client.CreateLaunchConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfiguration +func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfigurationInput) (req *request.Request, output *CreateLaunchConfigurationOutput) { + op := &request.Operation{ + Name: opCreateLaunchConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLaunchConfigurationInput{} + } + + output = &CreateLaunchConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateLaunchConfiguration API operation for Auto Scaling. +// +// Creates a launch configuration. +// +// If you exceed your maximum limit of launch configurations, the call fails. +// For information about viewing this limit, see DescribeAccountLimits. For +// information about updating this limit, see Auto Scaling Limits (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// in the Amazon EC2 Auto Scaling User Guide. +// +// For more information, see Launch Configurations (http://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchConfiguration.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation CreateLaunchConfiguration for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAlreadyExistsFault "AlreadyExists" +// You already have an Auto Scaling group or launch configuration with this +// name. +// +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateLaunchConfiguration +func (c *AutoScaling) CreateLaunchConfiguration(input *CreateLaunchConfigurationInput) (*CreateLaunchConfigurationOutput, error) { + req, out := c.CreateLaunchConfigurationRequest(input) + return out, req.Send() +} + +// CreateLaunchConfigurationWithContext is the same as CreateLaunchConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLaunchConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) CreateLaunchConfigurationWithContext(ctx aws.Context, input *CreateLaunchConfigurationInput, opts ...request.Option) (*CreateLaunchConfigurationOutput, error) { + req, out := c.CreateLaunchConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateOrUpdateTags = "CreateOrUpdateTags" + +// CreateOrUpdateTagsRequest generates a "aws/request.Request" representing the +// client's request for the CreateOrUpdateTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateOrUpdateTags for more information on using the CreateOrUpdateTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateOrUpdateTagsRequest method. +// req, resp := client.CreateOrUpdateTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags +func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) (req *request.Request, output *CreateOrUpdateTagsOutput) { + op := &request.Operation{ + Name: opCreateOrUpdateTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateOrUpdateTagsInput{} + } + + output = &CreateOrUpdateTagsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateOrUpdateTags API operation for Auto Scaling. +// +// Creates or updates tags for the specified Auto Scaling group. +// +// When you specify a tag with a key that already exists, the operation overwrites +// the previous tag definition, and you do not get an error message. +// +// For more information, see Tagging Auto Scaling Groups and Instances (http://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation CreateOrUpdateTags for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeAlreadyExistsFault "AlreadyExists" +// You already have an Auto Scaling group or launch configuration with this +// name. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags +func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) { + req, out := c.CreateOrUpdateTagsRequest(input) + return out, req.Send() +} + +// CreateOrUpdateTagsWithContext is the same as CreateOrUpdateTags with the addition of +// the ability to pass a context and additional request options. +// +// See CreateOrUpdateTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) CreateOrUpdateTagsWithContext(ctx aws.Context, input *CreateOrUpdateTagsInput, opts ...request.Option) (*CreateOrUpdateTagsOutput, error) { + req, out := c.CreateOrUpdateTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAutoScalingGroup = "DeleteAutoScalingGroup" + +// DeleteAutoScalingGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAutoScalingGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAutoScalingGroup for more information on using the DeleteAutoScalingGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAutoScalingGroupRequest method. +// req, resp := client.DeleteAutoScalingGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroup +func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGroupInput) (req *request.Request, output *DeleteAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opDeleteAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteAutoScalingGroupInput{} + } + + output = &DeleteAutoScalingGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAutoScalingGroup API operation for Auto Scaling. +// +// Deletes the specified Auto Scaling group. +// +// If the group has instances or scaling activities in progress, you must specify +// the option to force the deletion in order for it to succeed. +// +// If the group has policies, deleting the group deletes the policies, the underlying +// alarm actions, and any alarm that no longer has an associated action. +// +// To remove instances from the Auto Scaling group before deleting it, call +// DetachInstances with the list of instances and the option to decrement the +// desired capacity so that Amazon EC2 Auto Scaling does not launch replacement +// instances. +// +// To terminate all instances before deleting the Auto Scaling group, call UpdateAutoScalingGroup +// and set the minimum size and desired capacity of the Auto Scaling group to +// zero. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeleteAutoScalingGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" +// The operation can't be performed because there are scaling activities in +// progress. +// +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteAutoScalingGroup +func (c *AutoScaling) DeleteAutoScalingGroup(input *DeleteAutoScalingGroupInput) (*DeleteAutoScalingGroupOutput, error) { + req, out := c.DeleteAutoScalingGroupRequest(input) + return out, req.Send() +} + +// DeleteAutoScalingGroupWithContext is the same as DeleteAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeleteAutoScalingGroupWithContext(ctx aws.Context, input *DeleteAutoScalingGroupInput, opts ...request.Option) (*DeleteAutoScalingGroupOutput, error) { + req, out := c.DeleteAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLaunchConfiguration = "DeleteLaunchConfiguration" + +// DeleteLaunchConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLaunchConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLaunchConfiguration for more information on using the DeleteLaunchConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLaunchConfigurationRequest method. +// req, resp := client.DeleteLaunchConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLaunchConfiguration +func (c *AutoScaling) DeleteLaunchConfigurationRequest(input *DeleteLaunchConfigurationInput) (req *request.Request, output *DeleteLaunchConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteLaunchConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLaunchConfigurationInput{} + } + + output = &DeleteLaunchConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteLaunchConfiguration API operation for Auto Scaling. +// +// Deletes the specified launch configuration. +// +// The launch configuration must not be attached to an Auto Scaling group. When +// this call completes, the launch configuration is no longer available for +// use. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeleteLaunchConfiguration for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLaunchConfiguration +func (c *AutoScaling) DeleteLaunchConfiguration(input *DeleteLaunchConfigurationInput) (*DeleteLaunchConfigurationOutput, error) { + req, out := c.DeleteLaunchConfigurationRequest(input) + return out, req.Send() +} + +// DeleteLaunchConfigurationWithContext is the same as DeleteLaunchConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLaunchConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeleteLaunchConfigurationWithContext(ctx aws.Context, input *DeleteLaunchConfigurationInput, opts ...request.Option) (*DeleteLaunchConfigurationOutput, error) { + req, out := c.DeleteLaunchConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLifecycleHook = "DeleteLifecycleHook" + +// DeleteLifecycleHookRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLifecycleHook operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLifecycleHook for more information on using the DeleteLifecycleHook +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLifecycleHookRequest method. +// req, resp := client.DeleteLifecycleHookRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHook +func (c *AutoScaling) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput) (req *request.Request, output *DeleteLifecycleHookOutput) { + op := &request.Operation{ + Name: opDeleteLifecycleHook, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLifecycleHookInput{} + } + + output = &DeleteLifecycleHookOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteLifecycleHook API operation for Auto Scaling. +// +// Deletes the specified lifecycle hook. +// +// If there are any outstanding lifecycle actions, they are completed first +// (ABANDON for launching instances, CONTINUE for terminating 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 Auto Scaling's +// API operation DeleteLifecycleHook for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteLifecycleHook +func (c *AutoScaling) DeleteLifecycleHook(input *DeleteLifecycleHookInput) (*DeleteLifecycleHookOutput, error) { + req, out := c.DeleteLifecycleHookRequest(input) + return out, req.Send() +} + +// DeleteLifecycleHookWithContext is the same as DeleteLifecycleHook with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLifecycleHook for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeleteLifecycleHookWithContext(ctx aws.Context, input *DeleteLifecycleHookInput, opts ...request.Option) (*DeleteLifecycleHookOutput, error) { + req, out := c.DeleteLifecycleHookRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteNotificationConfiguration = "DeleteNotificationConfiguration" + +// DeleteNotificationConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNotificationConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteNotificationConfiguration for more information on using the DeleteNotificationConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteNotificationConfigurationRequest method. +// req, resp := client.DeleteNotificationConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfiguration +func (c *AutoScaling) DeleteNotificationConfigurationRequest(input *DeleteNotificationConfigurationInput) (req *request.Request, output *DeleteNotificationConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteNotificationConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteNotificationConfigurationInput{} + } + + output = &DeleteNotificationConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteNotificationConfiguration API operation for Auto Scaling. +// +// Deletes the specified notification. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeleteNotificationConfiguration for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteNotificationConfiguration +func (c *AutoScaling) DeleteNotificationConfiguration(input *DeleteNotificationConfigurationInput) (*DeleteNotificationConfigurationOutput, error) { + req, out := c.DeleteNotificationConfigurationRequest(input) + return out, req.Send() +} + +// DeleteNotificationConfigurationWithContext is the same as DeleteNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeleteNotificationConfigurationWithContext(ctx aws.Context, input *DeleteNotificationConfigurationInput, opts ...request.Option) (*DeleteNotificationConfigurationOutput, error) { + req, out := c.DeleteNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeletePolicy = "DeletePolicy" + +// DeletePolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeletePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeletePolicy for more information on using the DeletePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeletePolicyRequest method. +// req, resp := client.DeletePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicy +func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { + op := &request.Operation{ + Name: opDeletePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeletePolicyInput{} + } + + output = &DeletePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeletePolicy API operation for Auto Scaling. +// +// Deletes the specified Auto Scaling policy. +// +// Deleting a policy deletes the underlying alarm action, but does not delete +// the alarm, even if it no longer has an associated action. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeletePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeletePolicy +func (c *AutoScaling) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + return out, req.Send() +} + +// DeletePolicyWithContext is the same as DeletePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteScheduledAction = "DeleteScheduledAction" + +// DeleteScheduledActionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteScheduledAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteScheduledAction for more information on using the DeleteScheduledAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteScheduledActionRequest method. +// req, resp := client.DeleteScheduledActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledAction +func (c *AutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionInput) (req *request.Request, output *DeleteScheduledActionOutput) { + op := &request.Operation{ + Name: opDeleteScheduledAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteScheduledActionInput{} + } + + output = &DeleteScheduledActionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteScheduledAction API operation for Auto Scaling. +// +// Deletes the specified scheduled action. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeleteScheduledAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteScheduledAction +func (c *AutoScaling) DeleteScheduledAction(input *DeleteScheduledActionInput) (*DeleteScheduledActionOutput, error) { + req, out := c.DeleteScheduledActionRequest(input) + return out, req.Send() +} + +// DeleteScheduledActionWithContext is the same as DeleteScheduledAction with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteScheduledAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeleteScheduledActionWithContext(ctx aws.Context, input *DeleteScheduledActionInput, opts ...request.Option) (*DeleteScheduledActionOutput, error) { + req, out := c.DeleteScheduledActionRequest(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/autoscaling-2011-01-01/DeleteTags +func (c *AutoScaling) 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(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteTags API operation for Auto Scaling. +// +// Deletes the specified tags. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeleteTags for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteTags +func (c *AutoScaling) 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 *AutoScaling) 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 opDescribeAccountLimits = "DescribeAccountLimits" + +// DescribeAccountLimitsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAccountLimits operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAccountLimits for more information on using the DescribeAccountLimits +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAccountLimitsRequest method. +// req, resp := client.DescribeAccountLimitsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimits +func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *request.Request, output *DescribeAccountLimitsOutput) { + op := &request.Operation{ + Name: opDescribeAccountLimits, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeAccountLimitsInput{} + } + + output = &DescribeAccountLimitsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAccountLimits API operation for Auto Scaling. +// +// Describes the current Auto Scaling resource limits for your AWS account. +// +// For information about requesting an increase in these limits, see Auto Scaling +// Limits (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation DescribeAccountLimits for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAccountLimits +func (c *AutoScaling) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { + req, out := c.DescribeAccountLimitsRequest(input) + return out, req.Send() +} + +// DescribeAccountLimitsWithContext is the same as DescribeAccountLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeAccountLimitsWithContext(ctx aws.Context, input *DescribeAccountLimitsInput, opts ...request.Option) (*DescribeAccountLimitsOutput, error) { + req, out := c.DescribeAccountLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeAdjustmentTypes = "DescribeAdjustmentTypes" + +// DescribeAdjustmentTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAdjustmentTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAdjustmentTypes for more information on using the DescribeAdjustmentTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAdjustmentTypesRequest method. +// req, resp := client.DescribeAdjustmentTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypes +func (c *AutoScaling) DescribeAdjustmentTypesRequest(input *DescribeAdjustmentTypesInput) (req *request.Request, output *DescribeAdjustmentTypesOutput) { + op := &request.Operation{ + Name: opDescribeAdjustmentTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeAdjustmentTypesInput{} + } + + output = &DescribeAdjustmentTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAdjustmentTypes API operation for Auto Scaling. +// +// Describes the policy adjustment types for use with PutScalingPolicy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeAdjustmentTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAdjustmentTypes +func (c *AutoScaling) DescribeAdjustmentTypes(input *DescribeAdjustmentTypesInput) (*DescribeAdjustmentTypesOutput, error) { + req, out := c.DescribeAdjustmentTypesRequest(input) + return out, req.Send() +} + +// DescribeAdjustmentTypesWithContext is the same as DescribeAdjustmentTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAdjustmentTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeAdjustmentTypesWithContext(ctx aws.Context, input *DescribeAdjustmentTypesInput, opts ...request.Option) (*DescribeAdjustmentTypesOutput, error) { + req, out := c.DescribeAdjustmentTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeAutoScalingGroups = "DescribeAutoScalingGroups" + +// DescribeAutoScalingGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAutoScalingGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAutoScalingGroups for more information on using the DescribeAutoScalingGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAutoScalingGroupsRequest method. +// req, resp := client.DescribeAutoScalingGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingGroups +func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalingGroupsInput) (req *request.Request, output *DescribeAutoScalingGroupsOutput) { + op := &request.Operation{ + Name: opDescribeAutoScalingGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeAutoScalingGroupsInput{} + } + + output = &DescribeAutoScalingGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAutoScalingGroups API operation for Auto Scaling. +// +// Describes one or more Auto Scaling groups. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeAutoScalingGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingGroups +func (c *AutoScaling) DescribeAutoScalingGroups(input *DescribeAutoScalingGroupsInput) (*DescribeAutoScalingGroupsOutput, error) { + req, out := c.DescribeAutoScalingGroupsRequest(input) + return out, req.Send() +} + +// DescribeAutoScalingGroupsWithContext is the same as DescribeAutoScalingGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutoScalingGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeAutoScalingGroupsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.Option) (*DescribeAutoScalingGroupsOutput, error) { + req, out := c.DescribeAutoScalingGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeAutoScalingGroupsPages iterates over the pages of a DescribeAutoScalingGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeAutoScalingGroups 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 DescribeAutoScalingGroups operation. +// pageNum := 0 +// err := client.DescribeAutoScalingGroupsPages(params, +// func(page *DescribeAutoScalingGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribeAutoScalingGroupsPages(input *DescribeAutoScalingGroupsInput, fn func(*DescribeAutoScalingGroupsOutput, bool) bool) error { + return c.DescribeAutoScalingGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeAutoScalingGroupsPagesWithContext same as DescribeAutoScalingGroupsPages 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 *AutoScaling) DescribeAutoScalingGroupsPagesWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, fn func(*DescribeAutoScalingGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opDescribeAutoScalingInstances = "DescribeAutoScalingInstances" + +// DescribeAutoScalingInstancesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAutoScalingInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAutoScalingInstances for more information on using the DescribeAutoScalingInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAutoScalingInstancesRequest method. +// req, resp := client.DescribeAutoScalingInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingInstances +func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoScalingInstancesInput) (req *request.Request, output *DescribeAutoScalingInstancesOutput) { + op := &request.Operation{ + Name: opDescribeAutoScalingInstances, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeAutoScalingInstancesInput{} + } + + output = &DescribeAutoScalingInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAutoScalingInstances API operation for Auto Scaling. +// +// Describes one or more Auto Scaling 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 Auto Scaling's +// API operation DescribeAutoScalingInstances for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingInstances +func (c *AutoScaling) DescribeAutoScalingInstances(input *DescribeAutoScalingInstancesInput) (*DescribeAutoScalingInstancesOutput, error) { + req, out := c.DescribeAutoScalingInstancesRequest(input) + return out, req.Send() +} + +// DescribeAutoScalingInstancesWithContext is the same as DescribeAutoScalingInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutoScalingInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeAutoScalingInstancesWithContext(ctx aws.Context, input *DescribeAutoScalingInstancesInput, opts ...request.Option) (*DescribeAutoScalingInstancesOutput, error) { + req, out := c.DescribeAutoScalingInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeAutoScalingInstancesPages iterates over the pages of a DescribeAutoScalingInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeAutoScalingInstances 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 DescribeAutoScalingInstances operation. +// pageNum := 0 +// err := client.DescribeAutoScalingInstancesPages(params, +// func(page *DescribeAutoScalingInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribeAutoScalingInstancesPages(input *DescribeAutoScalingInstancesInput, fn func(*DescribeAutoScalingInstancesOutput, bool) bool) error { + return c.DescribeAutoScalingInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeAutoScalingInstancesPagesWithContext same as DescribeAutoScalingInstancesPages 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 *AutoScaling) DescribeAutoScalingInstancesPagesWithContext(ctx aws.Context, input *DescribeAutoScalingInstancesInput, fn func(*DescribeAutoScalingInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAutoScalingInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opDescribeAutoScalingNotificationTypes = "DescribeAutoScalingNotificationTypes" + +// DescribeAutoScalingNotificationTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAutoScalingNotificationTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAutoScalingNotificationTypes for more information on using the DescribeAutoScalingNotificationTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAutoScalingNotificationTypesRequest method. +// req, resp := client.DescribeAutoScalingNotificationTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypes +func (c *AutoScaling) DescribeAutoScalingNotificationTypesRequest(input *DescribeAutoScalingNotificationTypesInput) (req *request.Request, output *DescribeAutoScalingNotificationTypesOutput) { + op := &request.Operation{ + Name: opDescribeAutoScalingNotificationTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeAutoScalingNotificationTypesInput{} + } + + output = &DescribeAutoScalingNotificationTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAutoScalingNotificationTypes API operation for Auto Scaling. +// +// Describes the notification types that are supported by Amazon EC2 Auto Scaling. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeAutoScalingNotificationTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeAutoScalingNotificationTypes +func (c *AutoScaling) DescribeAutoScalingNotificationTypes(input *DescribeAutoScalingNotificationTypesInput) (*DescribeAutoScalingNotificationTypesOutput, error) { + req, out := c.DescribeAutoScalingNotificationTypesRequest(input) + return out, req.Send() +} + +// DescribeAutoScalingNotificationTypesWithContext is the same as DescribeAutoScalingNotificationTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAutoScalingNotificationTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeAutoScalingNotificationTypesWithContext(ctx aws.Context, input *DescribeAutoScalingNotificationTypesInput, opts ...request.Option) (*DescribeAutoScalingNotificationTypesOutput, error) { + req, out := c.DescribeAutoScalingNotificationTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLaunchConfigurations = "DescribeLaunchConfigurations" + +// DescribeLaunchConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLaunchConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLaunchConfigurations for more information on using the DescribeLaunchConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLaunchConfigurationsRequest method. +// req, resp := client.DescribeLaunchConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLaunchConfigurations +func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchConfigurationsInput) (req *request.Request, output *DescribeLaunchConfigurationsOutput) { + op := &request.Operation{ + Name: opDescribeLaunchConfigurations, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeLaunchConfigurationsInput{} + } + + output = &DescribeLaunchConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLaunchConfigurations API operation for Auto Scaling. +// +// Describes one or more launch configurations. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeLaunchConfigurations for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLaunchConfigurations +func (c *AutoScaling) DescribeLaunchConfigurations(input *DescribeLaunchConfigurationsInput) (*DescribeLaunchConfigurationsOutput, error) { + req, out := c.DescribeLaunchConfigurationsRequest(input) + return out, req.Send() +} + +// DescribeLaunchConfigurationsWithContext is the same as DescribeLaunchConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLaunchConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeLaunchConfigurationsWithContext(ctx aws.Context, input *DescribeLaunchConfigurationsInput, opts ...request.Option) (*DescribeLaunchConfigurationsOutput, error) { + req, out := c.DescribeLaunchConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeLaunchConfigurationsPages iterates over the pages of a DescribeLaunchConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLaunchConfigurations 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 DescribeLaunchConfigurations operation. +// pageNum := 0 +// err := client.DescribeLaunchConfigurationsPages(params, +// func(page *DescribeLaunchConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribeLaunchConfigurationsPages(input *DescribeLaunchConfigurationsInput, fn func(*DescribeLaunchConfigurationsOutput, bool) bool) error { + return c.DescribeLaunchConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeLaunchConfigurationsPagesWithContext same as DescribeLaunchConfigurationsPages 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 *AutoScaling) DescribeLaunchConfigurationsPagesWithContext(ctx aws.Context, input *DescribeLaunchConfigurationsInput, fn func(*DescribeLaunchConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLaunchConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLaunchConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opDescribeLifecycleHookTypes = "DescribeLifecycleHookTypes" + +// DescribeLifecycleHookTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLifecycleHookTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLifecycleHookTypes for more information on using the DescribeLifecycleHookTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLifecycleHookTypesRequest method. +// req, resp := client.DescribeLifecycleHookTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypes +func (c *AutoScaling) DescribeLifecycleHookTypesRequest(input *DescribeLifecycleHookTypesInput) (req *request.Request, output *DescribeLifecycleHookTypesOutput) { + op := &request.Operation{ + Name: opDescribeLifecycleHookTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLifecycleHookTypesInput{} + } + + output = &DescribeLifecycleHookTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLifecycleHookTypes API operation for Auto Scaling. +// +// Describes the available types of lifecycle hooks. +// +// The following hook types are supported: +// +// * autoscaling:EC2_INSTANCE_LAUNCHING +// +// * autoscaling:EC2_INSTANCE_TERMINATING +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeLifecycleHookTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHookTypes +func (c *AutoScaling) DescribeLifecycleHookTypes(input *DescribeLifecycleHookTypesInput) (*DescribeLifecycleHookTypesOutput, error) { + req, out := c.DescribeLifecycleHookTypesRequest(input) + return out, req.Send() +} + +// DescribeLifecycleHookTypesWithContext is the same as DescribeLifecycleHookTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLifecycleHookTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeLifecycleHookTypesWithContext(ctx aws.Context, input *DescribeLifecycleHookTypesInput, opts ...request.Option) (*DescribeLifecycleHookTypesOutput, error) { + req, out := c.DescribeLifecycleHookTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLifecycleHooks = "DescribeLifecycleHooks" + +// DescribeLifecycleHooksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLifecycleHooks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLifecycleHooks for more information on using the DescribeLifecycleHooks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLifecycleHooksRequest method. +// req, resp := client.DescribeLifecycleHooksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooks +func (c *AutoScaling) DescribeLifecycleHooksRequest(input *DescribeLifecycleHooksInput) (req *request.Request, output *DescribeLifecycleHooksOutput) { + op := &request.Operation{ + Name: opDescribeLifecycleHooks, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLifecycleHooksInput{} + } + + output = &DescribeLifecycleHooksOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLifecycleHooks API operation for Auto Scaling. +// +// Describes the lifecycle hooks for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeLifecycleHooks for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooks +func (c *AutoScaling) DescribeLifecycleHooks(input *DescribeLifecycleHooksInput) (*DescribeLifecycleHooksOutput, error) { + req, out := c.DescribeLifecycleHooksRequest(input) + return out, req.Send() +} + +// DescribeLifecycleHooksWithContext is the same as DescribeLifecycleHooks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLifecycleHooks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeLifecycleHooksWithContext(ctx aws.Context, input *DescribeLifecycleHooksInput, opts ...request.Option) (*DescribeLifecycleHooksOutput, error) { + req, out := c.DescribeLifecycleHooksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLoadBalancerTargetGroups = "DescribeLoadBalancerTargetGroups" + +// DescribeLoadBalancerTargetGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLoadBalancerTargetGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLoadBalancerTargetGroups for more information on using the DescribeLoadBalancerTargetGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLoadBalancerTargetGroupsRequest method. +// req, resp := client.DescribeLoadBalancerTargetGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroups +func (c *AutoScaling) DescribeLoadBalancerTargetGroupsRequest(input *DescribeLoadBalancerTargetGroupsInput) (req *request.Request, output *DescribeLoadBalancerTargetGroupsOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerTargetGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancerTargetGroupsInput{} + } + + output = &DescribeLoadBalancerTargetGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLoadBalancerTargetGroups API operation for Auto Scaling. +// +// Describes the target groups for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeLoadBalancerTargetGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancerTargetGroups +func (c *AutoScaling) DescribeLoadBalancerTargetGroups(input *DescribeLoadBalancerTargetGroupsInput) (*DescribeLoadBalancerTargetGroupsOutput, error) { + req, out := c.DescribeLoadBalancerTargetGroupsRequest(input) + return out, req.Send() +} + +// DescribeLoadBalancerTargetGroupsWithContext is the same as DescribeLoadBalancerTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeLoadBalancerTargetGroupsWithContext(ctx aws.Context, input *DescribeLoadBalancerTargetGroupsInput, opts ...request.Option) (*DescribeLoadBalancerTargetGroupsOutput, error) { + req, out := c.DescribeLoadBalancerTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLoadBalancers = "DescribeLoadBalancers" + +// DescribeLoadBalancersRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLoadBalancers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLoadBalancers for more information on using the DescribeLoadBalancers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLoadBalancersRequest method. +// req, resp := client.DescribeLoadBalancersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancers +func (c *AutoScaling) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancersInput{} + } + + output = &DescribeLoadBalancersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLoadBalancers API operation for Auto Scaling. +// +// Describes the load balancers for the specified Auto Scaling group. +// +// Note that this operation describes only Classic Load Balancers. If you have +// Application Load Balancers, use DescribeLoadBalancerTargetGroups instead. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeLoadBalancers for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLoadBalancers +func (c *AutoScaling) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + return out, req.Send() +} + +// DescribeLoadBalancersWithContext is the same as DescribeLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeLoadBalancersWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.Option) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeMetricCollectionTypes = "DescribeMetricCollectionTypes" + +// DescribeMetricCollectionTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeMetricCollectionTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeMetricCollectionTypes for more information on using the DescribeMetricCollectionTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeMetricCollectionTypesRequest method. +// req, resp := client.DescribeMetricCollectionTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypes +func (c *AutoScaling) DescribeMetricCollectionTypesRequest(input *DescribeMetricCollectionTypesInput) (req *request.Request, output *DescribeMetricCollectionTypesOutput) { + op := &request.Operation{ + Name: opDescribeMetricCollectionTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeMetricCollectionTypesInput{} + } + + output = &DescribeMetricCollectionTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeMetricCollectionTypes API operation for Auto Scaling. +// +// Describes the available CloudWatch metrics for Amazon EC2 Auto Scaling. +// +// Note that the GroupStandbyInstances metric is not returned by default. You +// must explicitly request this metric when calling EnableMetricsCollection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeMetricCollectionTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeMetricCollectionTypes +func (c *AutoScaling) DescribeMetricCollectionTypes(input *DescribeMetricCollectionTypesInput) (*DescribeMetricCollectionTypesOutput, error) { + req, out := c.DescribeMetricCollectionTypesRequest(input) + return out, req.Send() +} + +// DescribeMetricCollectionTypesWithContext is the same as DescribeMetricCollectionTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMetricCollectionTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeMetricCollectionTypesWithContext(ctx aws.Context, input *DescribeMetricCollectionTypesInput, opts ...request.Option) (*DescribeMetricCollectionTypesOutput, error) { + req, out := c.DescribeMetricCollectionTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeNotificationConfigurations = "DescribeNotificationConfigurations" + +// DescribeNotificationConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNotificationConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeNotificationConfigurations for more information on using the DescribeNotificationConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeNotificationConfigurationsRequest method. +// req, resp := client.DescribeNotificationConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurations +func (c *AutoScaling) DescribeNotificationConfigurationsRequest(input *DescribeNotificationConfigurationsInput) (req *request.Request, output *DescribeNotificationConfigurationsOutput) { + op := &request.Operation{ + Name: opDescribeNotificationConfigurations, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeNotificationConfigurationsInput{} + } + + output = &DescribeNotificationConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeNotificationConfigurations API operation for Auto Scaling. +// +// Describes the notification actions associated with the specified Auto Scaling +// group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeNotificationConfigurations for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeNotificationConfigurations +func (c *AutoScaling) DescribeNotificationConfigurations(input *DescribeNotificationConfigurationsInput) (*DescribeNotificationConfigurationsOutput, error) { + req, out := c.DescribeNotificationConfigurationsRequest(input) + return out, req.Send() +} + +// DescribeNotificationConfigurationsWithContext is the same as DescribeNotificationConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNotificationConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeNotificationConfigurationsWithContext(ctx aws.Context, input *DescribeNotificationConfigurationsInput, opts ...request.Option) (*DescribeNotificationConfigurationsOutput, error) { + req, out := c.DescribeNotificationConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeNotificationConfigurationsPages iterates over the pages of a DescribeNotificationConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNotificationConfigurations 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 DescribeNotificationConfigurations operation. +// pageNum := 0 +// err := client.DescribeNotificationConfigurationsPages(params, +// func(page *DescribeNotificationConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribeNotificationConfigurationsPages(input *DescribeNotificationConfigurationsInput, fn func(*DescribeNotificationConfigurationsOutput, bool) bool) error { + return c.DescribeNotificationConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNotificationConfigurationsPagesWithContext same as DescribeNotificationConfigurationsPages 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 *AutoScaling) DescribeNotificationConfigurationsPagesWithContext(ctx aws.Context, input *DescribeNotificationConfigurationsInput, fn func(*DescribeNotificationConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNotificationConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNotificationConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opDescribePolicies = "DescribePolicies" + +// DescribePoliciesRequest generates a "aws/request.Request" representing the +// client's request for the DescribePolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribePolicies for more information on using the DescribePolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribePoliciesRequest method. +// req, resp := client.DescribePoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribePolicies +func (c *AutoScaling) DescribePoliciesRequest(input *DescribePoliciesInput) (req *request.Request, output *DescribePoliciesOutput) { + op := &request.Operation{ + Name: opDescribePolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribePoliciesInput{} + } + + output = &DescribePoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribePolicies API operation for Auto Scaling. +// +// Describes the policies for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribePolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribePolicies +func (c *AutoScaling) DescribePolicies(input *DescribePoliciesInput) (*DescribePoliciesOutput, error) { + req, out := c.DescribePoliciesRequest(input) + return out, req.Send() +} + +// DescribePoliciesWithContext is the same as DescribePolicies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribePoliciesWithContext(ctx aws.Context, input *DescribePoliciesInput, opts ...request.Option) (*DescribePoliciesOutput, error) { + req, out := c.DescribePoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribePoliciesPages iterates over the pages of a DescribePolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePolicies 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 DescribePolicies operation. +// pageNum := 0 +// err := client.DescribePoliciesPages(params, +// func(page *DescribePoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribePoliciesPages(input *DescribePoliciesInput, fn func(*DescribePoliciesOutput, bool) bool) error { + return c.DescribePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePoliciesPagesWithContext same as DescribePoliciesPages 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 *AutoScaling) DescribePoliciesPagesWithContext(ctx aws.Context, input *DescribePoliciesInput, fn func(*DescribePoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opDescribeScalingActivities = "DescribeScalingActivities" + +// DescribeScalingActivitiesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeScalingActivities operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeScalingActivities for more information on using the DescribeScalingActivities +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeScalingActivitiesRequest method. +// req, resp := client.DescribeScalingActivitiesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingActivities +func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *request.Request, output *DescribeScalingActivitiesOutput) { + op := &request.Operation{ + Name: opDescribeScalingActivities, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeScalingActivitiesInput{} + } + + output = &DescribeScalingActivitiesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeScalingActivities API operation for Auto Scaling. +// +// Describes one or more scaling activities for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeScalingActivities for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingActivities +func (c *AutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { + req, out := c.DescribeScalingActivitiesRequest(input) + return out, req.Send() +} + +// DescribeScalingActivitiesWithContext is the same as DescribeScalingActivities with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalingActivities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeScalingActivitiesWithContext(ctx aws.Context, input *DescribeScalingActivitiesInput, opts ...request.Option) (*DescribeScalingActivitiesOutput, error) { + req, out := c.DescribeScalingActivitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScalingActivities 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 DescribeScalingActivities operation. +// pageNum := 0 +// err := client.DescribeScalingActivitiesPages(params, +// func(page *DescribeScalingActivitiesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(*DescribeScalingActivitiesOutput, bool) bool) error { + return c.DescribeScalingActivitiesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeScalingActivitiesPagesWithContext same as DescribeScalingActivitiesPages 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 *AutoScaling) DescribeScalingActivitiesPagesWithContext(ctx aws.Context, input *DescribeScalingActivitiesInput, fn func(*DescribeScalingActivitiesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScalingActivitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScalingActivitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opDescribeScalingProcessTypes = "DescribeScalingProcessTypes" + +// DescribeScalingProcessTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeScalingProcessTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeScalingProcessTypes for more information on using the DescribeScalingProcessTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeScalingProcessTypesRequest method. +// req, resp := client.DescribeScalingProcessTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingProcessTypes +func (c *AutoScaling) DescribeScalingProcessTypesRequest(input *DescribeScalingProcessTypesInput) (req *request.Request, output *DescribeScalingProcessTypesOutput) { + op := &request.Operation{ + Name: opDescribeScalingProcessTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeScalingProcessTypesInput{} + } + + output = &DescribeScalingProcessTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeScalingProcessTypes API operation for Auto Scaling. +// +// Describes the scaling process types for use with ResumeProcesses and SuspendProcesses. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeScalingProcessTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScalingProcessTypes +func (c *AutoScaling) DescribeScalingProcessTypes(input *DescribeScalingProcessTypesInput) (*DescribeScalingProcessTypesOutput, error) { + req, out := c.DescribeScalingProcessTypesRequest(input) + return out, req.Send() +} + +// DescribeScalingProcessTypesWithContext is the same as DescribeScalingProcessTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScalingProcessTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeScalingProcessTypesWithContext(ctx aws.Context, input *DescribeScalingProcessTypesInput, opts ...request.Option) (*DescribeScalingProcessTypesOutput, error) { + req, out := c.DescribeScalingProcessTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeScheduledActions = "DescribeScheduledActions" + +// DescribeScheduledActionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeScheduledActions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeScheduledActions for more information on using the DescribeScheduledActions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeScheduledActionsRequest method. +// req, resp := client.DescribeScheduledActionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScheduledActions +func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledActionsInput) (req *request.Request, output *DescribeScheduledActionsOutput) { + op := &request.Operation{ + Name: opDescribeScheduledActions, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeScheduledActionsInput{} + } + + output = &DescribeScheduledActionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeScheduledActions API operation for Auto Scaling. +// +// Describes the actions scheduled for your Auto Scaling group that haven't +// run. To describe the actions that have already run, use DescribeScalingActivities. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeScheduledActions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeScheduledActions +func (c *AutoScaling) DescribeScheduledActions(input *DescribeScheduledActionsInput) (*DescribeScheduledActionsOutput, error) { + req, out := c.DescribeScheduledActionsRequest(input) + return out, req.Send() +} + +// DescribeScheduledActionsWithContext is the same as DescribeScheduledActions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeScheduledActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeScheduledActionsWithContext(ctx aws.Context, input *DescribeScheduledActionsInput, opts ...request.Option) (*DescribeScheduledActionsOutput, error) { + req, out := c.DescribeScheduledActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeScheduledActionsPages iterates over the pages of a DescribeScheduledActions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledActions 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 DescribeScheduledActions operation. +// pageNum := 0 +// err := client.DescribeScheduledActionsPages(params, +// func(page *DescribeScheduledActionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AutoScaling) DescribeScheduledActionsPages(input *DescribeScheduledActionsInput, fn func(*DescribeScheduledActionsOutput, bool) bool) error { + return c.DescribeScheduledActionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeScheduledActionsPagesWithContext same as DescribeScheduledActionsPages 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 *AutoScaling) DescribeScheduledActionsPagesWithContext(ctx aws.Context, input *DescribeScheduledActionsInput, fn func(*DescribeScheduledActionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledActionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledActionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) + } + return p.Err() +} + +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/autoscaling-2011-01-01/DescribeTags +func (c *AutoScaling) 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: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeTagsInput{} + } + + output = &DescribeTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTags API operation for Auto Scaling. +// +// Describes the specified tags. +// +// You can use filters to limit the results. For example, you can query for +// the tags for a specific Auto Scaling group. You can specify multiple values +// for a filter. A tag must match at least one of the specified values for it +// to be included in the results. +// +// You can also specify multiple filters. The result includes information for +// a particular tag only if it matches all the filters. If there's no match, +// no special message is returned. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeTags for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTags +func (c *AutoScaling) 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 *AutoScaling) 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 *AutoScaling) 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 *AutoScaling) 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 opDescribeTerminationPolicyTypes = "DescribeTerminationPolicyTypes" + +// DescribeTerminationPolicyTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTerminationPolicyTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTerminationPolicyTypes for more information on using the DescribeTerminationPolicyTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTerminationPolicyTypesRequest method. +// req, resp := client.DescribeTerminationPolicyTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypes +func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTerminationPolicyTypesInput) (req *request.Request, output *DescribeTerminationPolicyTypesOutput) { + op := &request.Operation{ + Name: opDescribeTerminationPolicyTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTerminationPolicyTypesInput{} + } + + output = &DescribeTerminationPolicyTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTerminationPolicyTypes API operation for Auto Scaling. +// +// Describes the termination policies supported by Amazon EC2 Auto Scaling. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeTerminationPolicyTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeTerminationPolicyTypes +func (c *AutoScaling) DescribeTerminationPolicyTypes(input *DescribeTerminationPolicyTypesInput) (*DescribeTerminationPolicyTypesOutput, error) { + req, out := c.DescribeTerminationPolicyTypesRequest(input) + return out, req.Send() +} + +// DescribeTerminationPolicyTypesWithContext is the same as DescribeTerminationPolicyTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTerminationPolicyTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeTerminationPolicyTypesWithContext(ctx aws.Context, input *DescribeTerminationPolicyTypesInput, opts ...request.Option) (*DescribeTerminationPolicyTypesOutput, error) { + req, out := c.DescribeTerminationPolicyTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDetachInstances = "DetachInstances" + +// DetachInstancesRequest generates a "aws/request.Request" representing the +// client's request for the DetachInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachInstances for more information on using the DetachInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachInstancesRequest method. +// req, resp := client.DetachInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstances +func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) (req *request.Request, output *DetachInstancesOutput) { + op := &request.Operation{ + Name: opDetachInstances, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachInstancesInput{} + } + + output = &DetachInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DetachInstances API operation for Auto Scaling. +// +// Removes one or more instances from the specified Auto Scaling group. +// +// After the instances are detached, you can manage them independent of the +// Auto Scaling group. +// +// If you do not specify the option to decrement the desired capacity, Amazon +// EC2 Auto Scaling launches instances to replace the ones that are detached. +// +// If there is a Classic Load Balancer attached to the Auto Scaling group, the +// instances are deregistered from the load balancer. If there are target groups +// attached to the Auto Scaling group, the instances are deregistered from the +// target groups. +// +// For more information, see Detach EC2 Instances from Your Auto Scaling Group +// (http://docs.aws.amazon.com/autoscaling/ec2/userguide/detach-instance-asg.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation DetachInstances for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachInstances +func (c *AutoScaling) DetachInstances(input *DetachInstancesInput) (*DetachInstancesOutput, error) { + req, out := c.DetachInstancesRequest(input) + return out, req.Send() +} + +// DetachInstancesWithContext is the same as DetachInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DetachInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DetachInstancesWithContext(ctx aws.Context, input *DetachInstancesInput, opts ...request.Option) (*DetachInstancesOutput, error) { + req, out := c.DetachInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDetachLoadBalancerTargetGroups = "DetachLoadBalancerTargetGroups" + +// DetachLoadBalancerTargetGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DetachLoadBalancerTargetGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachLoadBalancerTargetGroups for more information on using the DetachLoadBalancerTargetGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachLoadBalancerTargetGroupsRequest method. +// req, resp := client.DetachLoadBalancerTargetGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroups +func (c *AutoScaling) DetachLoadBalancerTargetGroupsRequest(input *DetachLoadBalancerTargetGroupsInput) (req *request.Request, output *DetachLoadBalancerTargetGroupsOutput) { + op := &request.Operation{ + Name: opDetachLoadBalancerTargetGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachLoadBalancerTargetGroupsInput{} + } + + output = &DetachLoadBalancerTargetGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DetachLoadBalancerTargetGroups API operation for Auto Scaling. +// +// Detaches one or more target groups from the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DetachLoadBalancerTargetGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroups +func (c *AutoScaling) DetachLoadBalancerTargetGroups(input *DetachLoadBalancerTargetGroupsInput) (*DetachLoadBalancerTargetGroupsOutput, error) { + req, out := c.DetachLoadBalancerTargetGroupsRequest(input) + return out, req.Send() +} + +// DetachLoadBalancerTargetGroupsWithContext is the same as DetachLoadBalancerTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DetachLoadBalancerTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DetachLoadBalancerTargetGroupsWithContext(ctx aws.Context, input *DetachLoadBalancerTargetGroupsInput, opts ...request.Option) (*DetachLoadBalancerTargetGroupsOutput, error) { + req, out := c.DetachLoadBalancerTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDetachLoadBalancers = "DetachLoadBalancers" + +// DetachLoadBalancersRequest generates a "aws/request.Request" representing the +// client's request for the DetachLoadBalancers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachLoadBalancers for more information on using the DetachLoadBalancers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachLoadBalancersRequest method. +// req, resp := client.DetachLoadBalancersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancers +func (c *AutoScaling) DetachLoadBalancersRequest(input *DetachLoadBalancersInput) (req *request.Request, output *DetachLoadBalancersOutput) { + op := &request.Operation{ + Name: opDetachLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachLoadBalancersInput{} + } + + output = &DetachLoadBalancersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DetachLoadBalancers API operation for Auto Scaling. +// +// Detaches one or more Classic Load Balancers from the specified Auto Scaling +// group. +// +// Note that this operation detaches only Classic Load Balancers. If you have +// Application Load Balancers, use DetachLoadBalancerTargetGroups instead. +// +// When you detach a load balancer, it enters the Removing state while deregistering +// the instances in the group. When all instances are deregistered, then you +// can no longer describe the load balancer using DescribeLoadBalancers. Note +// that the instances remain running. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DetachLoadBalancers for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancers +func (c *AutoScaling) DetachLoadBalancers(input *DetachLoadBalancersInput) (*DetachLoadBalancersOutput, error) { + req, out := c.DetachLoadBalancersRequest(input) + return out, req.Send() +} + +// DetachLoadBalancersWithContext is the same as DetachLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DetachLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DetachLoadBalancersWithContext(ctx aws.Context, input *DetachLoadBalancersInput, opts ...request.Option) (*DetachLoadBalancersOutput, error) { + req, out := c.DetachLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisableMetricsCollection = "DisableMetricsCollection" + +// DisableMetricsCollectionRequest generates a "aws/request.Request" representing the +// client's request for the DisableMetricsCollection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisableMetricsCollection for more information on using the DisableMetricsCollection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisableMetricsCollectionRequest method. +// req, resp := client.DisableMetricsCollectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollection +func (c *AutoScaling) DisableMetricsCollectionRequest(input *DisableMetricsCollectionInput) (req *request.Request, output *DisableMetricsCollectionOutput) { + op := &request.Operation{ + Name: opDisableMetricsCollection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableMetricsCollectionInput{} + } + + output = &DisableMetricsCollectionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DisableMetricsCollection API operation for Auto Scaling. +// +// Disables group metrics for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DisableMetricsCollection for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DisableMetricsCollection +func (c *AutoScaling) DisableMetricsCollection(input *DisableMetricsCollectionInput) (*DisableMetricsCollectionOutput, error) { + req, out := c.DisableMetricsCollectionRequest(input) + return out, req.Send() +} + +// DisableMetricsCollectionWithContext is the same as DisableMetricsCollection with the addition of +// the ability to pass a context and additional request options. +// +// See DisableMetricsCollection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DisableMetricsCollectionWithContext(ctx aws.Context, input *DisableMetricsCollectionInput, opts ...request.Option) (*DisableMetricsCollectionOutput, error) { + req, out := c.DisableMetricsCollectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opEnableMetricsCollection = "EnableMetricsCollection" + +// EnableMetricsCollectionRequest generates a "aws/request.Request" representing the +// client's request for the EnableMetricsCollection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableMetricsCollection for more information on using the EnableMetricsCollection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableMetricsCollectionRequest method. +// req, resp := client.EnableMetricsCollectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollection +func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollectionInput) (req *request.Request, output *EnableMetricsCollectionOutput) { + op := &request.Operation{ + Name: opEnableMetricsCollection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableMetricsCollectionInput{} + } + + output = &EnableMetricsCollectionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// EnableMetricsCollection API operation for Auto Scaling. +// +// Enables group metrics for the specified Auto Scaling group. For more information, +// see Monitoring Your Auto Scaling Groups and Instances (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation EnableMetricsCollection for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnableMetricsCollection +func (c *AutoScaling) EnableMetricsCollection(input *EnableMetricsCollectionInput) (*EnableMetricsCollectionOutput, error) { + req, out := c.EnableMetricsCollectionRequest(input) + return out, req.Send() +} + +// EnableMetricsCollectionWithContext is the same as EnableMetricsCollection with the addition of +// the ability to pass a context and additional request options. +// +// See EnableMetricsCollection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) EnableMetricsCollectionWithContext(ctx aws.Context, input *EnableMetricsCollectionInput, opts ...request.Option) (*EnableMetricsCollectionOutput, error) { + req, out := c.EnableMetricsCollectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opEnterStandby = "EnterStandby" + +// EnterStandbyRequest generates a "aws/request.Request" representing the +// client's request for the EnterStandby operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnterStandby for more information on using the EnterStandby +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnterStandbyRequest method. +// req, resp := client.EnterStandbyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandby +func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *request.Request, output *EnterStandbyOutput) { + op := &request.Operation{ + Name: opEnterStandby, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnterStandbyInput{} + } + + output = &EnterStandbyOutput{} + req = c.newRequest(op, input, output) + return +} + +// EnterStandby API operation for Auto Scaling. +// +// Moves the specified instances into the standby state. +// +// For more information, see Temporarily Removing Instances from Your Auto Scaling +// Group (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation EnterStandby for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/EnterStandby +func (c *AutoScaling) EnterStandby(input *EnterStandbyInput) (*EnterStandbyOutput, error) { + req, out := c.EnterStandbyRequest(input) + return out, req.Send() +} + +// EnterStandbyWithContext is the same as EnterStandby with the addition of +// the ability to pass a context and additional request options. +// +// See EnterStandby for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) EnterStandbyWithContext(ctx aws.Context, input *EnterStandbyInput, opts ...request.Option) (*EnterStandbyOutput, error) { + req, out := c.EnterStandbyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opExecutePolicy = "ExecutePolicy" + +// ExecutePolicyRequest generates a "aws/request.Request" representing the +// client's request for the ExecutePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ExecutePolicy for more information on using the ExecutePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ExecutePolicyRequest method. +// req, resp := client.ExecutePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicy +func (c *AutoScaling) ExecutePolicyRequest(input *ExecutePolicyInput) (req *request.Request, output *ExecutePolicyOutput) { + op := &request.Operation{ + Name: opExecutePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ExecutePolicyInput{} + } + + output = &ExecutePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// ExecutePolicy API operation for Auto Scaling. +// +// Executes the specified policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation ExecutePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" +// The operation can't be performed because there are scaling activities in +// progress. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExecutePolicy +func (c *AutoScaling) ExecutePolicy(input *ExecutePolicyInput) (*ExecutePolicyOutput, error) { + req, out := c.ExecutePolicyRequest(input) + return out, req.Send() +} + +// ExecutePolicyWithContext is the same as ExecutePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See ExecutePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) ExecutePolicyWithContext(ctx aws.Context, input *ExecutePolicyInput, opts ...request.Option) (*ExecutePolicyOutput, error) { + req, out := c.ExecutePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opExitStandby = "ExitStandby" + +// ExitStandbyRequest generates a "aws/request.Request" representing the +// client's request for the ExitStandby operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ExitStandby for more information on using the ExitStandby +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ExitStandbyRequest method. +// req, resp := client.ExitStandbyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandby +func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request.Request, output *ExitStandbyOutput) { + op := &request.Operation{ + Name: opExitStandby, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ExitStandbyInput{} + } + + output = &ExitStandbyOutput{} + req = c.newRequest(op, input, output) + return +} + +// ExitStandby API operation for Auto Scaling. +// +// Moves the specified instances out of the standby state. +// +// For more information, see Temporarily Removing Instances from Your Auto Scaling +// Group (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation ExitStandby for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ExitStandby +func (c *AutoScaling) ExitStandby(input *ExitStandbyInput) (*ExitStandbyOutput, error) { + req, out := c.ExitStandbyRequest(input) + return out, req.Send() +} + +// ExitStandbyWithContext is the same as ExitStandby with the addition of +// the ability to pass a context and additional request options. +// +// See ExitStandby for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) ExitStandbyWithContext(ctx aws.Context, input *ExitStandbyInput, opts ...request.Option) (*ExitStandbyOutput, error) { + req, out := c.ExitStandbyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutLifecycleHook = "PutLifecycleHook" + +// PutLifecycleHookRequest generates a "aws/request.Request" representing the +// client's request for the PutLifecycleHook operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutLifecycleHook for more information on using the PutLifecycleHook +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutLifecycleHookRequest method. +// req, resp := client.PutLifecycleHookRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHook +func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req *request.Request, output *PutLifecycleHookOutput) { + op := &request.Operation{ + Name: opPutLifecycleHook, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutLifecycleHookInput{} + } + + output = &PutLifecycleHookOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutLifecycleHook API operation for Auto Scaling. +// +// Creates or updates a lifecycle hook for the specified Auto Scaling Group. +// +// A lifecycle hook tells Amazon EC2 Auto Scaling that you want to perform an +// action on an instance that is not actively in service; for example, either +// when the instance launches or before the instance terminates. +// +// This step is a part of the procedure for adding a lifecycle hook to an Auto +// Scaling group: +// +// (Optional) Create a Lambda function and a rule that allows CloudWatch Events +// to invoke your Lambda function when Amazon EC2 Auto Scaling launches or terminates +// instances. +// +// (Optional) Create a notification target and an IAM role. The target can be +// either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon +// EC2 Auto Scaling to publish lifecycle notifications to the target. +// +// Create the lifecycle hook. Specify whether the hook is used when the instances +// launch or terminate. +// +// If you need more time, record the lifecycle action heartbeat to keep the +// instance in a pending state. +// +// If you finish before the timeout period ends, complete the lifecycle action. +// +// For more information, see Auto Scaling Lifecycle Hooks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// in the Amazon EC2 Auto Scaling User Guide. +// +// If you exceed your maximum limit of lifecycle hooks, which by default is +// 50 per Auto Scaling group, the call fails. For information about updating +// this limit, see AWS Service Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) +// in the Amazon Web Services General Reference. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation PutLifecycleHook for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutLifecycleHook +func (c *AutoScaling) PutLifecycleHook(input *PutLifecycleHookInput) (*PutLifecycleHookOutput, error) { + req, out := c.PutLifecycleHookRequest(input) + return out, req.Send() +} + +// PutLifecycleHookWithContext is the same as PutLifecycleHook with the addition of +// the ability to pass a context and additional request options. +// +// See PutLifecycleHook for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) PutLifecycleHookWithContext(ctx aws.Context, input *PutLifecycleHookInput, opts ...request.Option) (*PutLifecycleHookOutput, error) { + req, out := c.PutLifecycleHookRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutNotificationConfiguration = "PutNotificationConfiguration" + +// PutNotificationConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutNotificationConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutNotificationConfiguration for more information on using the PutNotificationConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutNotificationConfigurationRequest method. +// req, resp := client.PutNotificationConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfiguration +func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotificationConfigurationInput) (req *request.Request, output *PutNotificationConfigurationOutput) { + op := &request.Operation{ + Name: opPutNotificationConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutNotificationConfigurationInput{} + } + + output = &PutNotificationConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutNotificationConfiguration API operation for Auto Scaling. +// +// Configures an Auto Scaling group to send notifications when specified events +// take place. Subscribers to the specified topic can have messages delivered +// to an endpoint such as a web server or an email address. +// +// This configuration overwrites any existing configuration. +// +// For more information see Getting SNS Notifications When Your Auto Scaling +// Group Scales (http://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) +// in the Auto Scaling 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 Auto Scaling's +// API operation PutNotificationConfiguration for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutNotificationConfiguration +func (c *AutoScaling) PutNotificationConfiguration(input *PutNotificationConfigurationInput) (*PutNotificationConfigurationOutput, error) { + req, out := c.PutNotificationConfigurationRequest(input) + return out, req.Send() +} + +// PutNotificationConfigurationWithContext is the same as PutNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) PutNotificationConfigurationWithContext(ctx aws.Context, input *PutNotificationConfigurationInput, opts ...request.Option) (*PutNotificationConfigurationOutput, error) { + req, out := c.PutNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutScalingPolicy = "PutScalingPolicy" + +// PutScalingPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutScalingPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutScalingPolicy for more information on using the PutScalingPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutScalingPolicyRequest method. +// req, resp := client.PutScalingPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScalingPolicy +func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *request.Request, output *PutScalingPolicyOutput) { + op := &request.Operation{ + Name: opPutScalingPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutScalingPolicyInput{} + } + + output = &PutScalingPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutScalingPolicy API operation for Auto Scaling. +// +// Creates or updates a policy for an Auto Scaling group. To update an existing +// policy, use the existing policy name and set the parameters you want to change. +// Any existing parameter not changed in an update to an existing policy is +// not changed in this update request. +// +// If you exceed your maximum limit of step adjustments, which by default is +// 20 per region, the call fails. For information about updating this limit, +// see AWS Service Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) +// in the Amazon Web Services General Reference. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation PutScalingPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScalingPolicy +func (c *AutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) { + req, out := c.PutScalingPolicyRequest(input) + return out, req.Send() +} + +// PutScalingPolicyWithContext is the same as PutScalingPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutScalingPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) PutScalingPolicyWithContext(ctx aws.Context, input *PutScalingPolicyInput, opts ...request.Option) (*PutScalingPolicyOutput, error) { + req, out := c.PutScalingPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutScheduledUpdateGroupAction = "PutScheduledUpdateGroupAction" + +// PutScheduledUpdateGroupActionRequest generates a "aws/request.Request" representing the +// client's request for the PutScheduledUpdateGroupAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutScheduledUpdateGroupAction for more information on using the PutScheduledUpdateGroupAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutScheduledUpdateGroupActionRequest method. +// req, resp := client.PutScheduledUpdateGroupActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupAction +func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUpdateGroupActionInput) (req *request.Request, output *PutScheduledUpdateGroupActionOutput) { + op := &request.Operation{ + Name: opPutScheduledUpdateGroupAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutScheduledUpdateGroupActionInput{} + } + + output = &PutScheduledUpdateGroupActionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutScheduledUpdateGroupAction API operation for Auto Scaling. +// +// Creates or updates a scheduled scaling action for an Auto Scaling group. +// When updating a scheduled scaling action, if you leave a parameter unspecified, +// the corresponding value remains unchanged. +// +// For more information, see Scheduled Scaling (http://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation PutScheduledUpdateGroupAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAlreadyExistsFault "AlreadyExists" +// You already have an Auto Scaling group or launch configuration with this +// name. +// +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutScheduledUpdateGroupAction +func (c *AutoScaling) PutScheduledUpdateGroupAction(input *PutScheduledUpdateGroupActionInput) (*PutScheduledUpdateGroupActionOutput, error) { + req, out := c.PutScheduledUpdateGroupActionRequest(input) + return out, req.Send() +} + +// PutScheduledUpdateGroupActionWithContext is the same as PutScheduledUpdateGroupAction with the addition of +// the ability to pass a context and additional request options. +// +// See PutScheduledUpdateGroupAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) PutScheduledUpdateGroupActionWithContext(ctx aws.Context, input *PutScheduledUpdateGroupActionInput, opts ...request.Option) (*PutScheduledUpdateGroupActionOutput, error) { + req, out := c.PutScheduledUpdateGroupActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" + +// RecordLifecycleActionHeartbeatRequest generates a "aws/request.Request" representing the +// client's request for the RecordLifecycleActionHeartbeat operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RecordLifecycleActionHeartbeat for more information on using the RecordLifecycleActionHeartbeat +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RecordLifecycleActionHeartbeatRequest method. +// req, resp := client.RecordLifecycleActionHeartbeatRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat +func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecycleActionHeartbeatInput) (req *request.Request, output *RecordLifecycleActionHeartbeatOutput) { + op := &request.Operation{ + Name: opRecordLifecycleActionHeartbeat, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RecordLifecycleActionHeartbeatInput{} + } + + output = &RecordLifecycleActionHeartbeatOutput{} + req = c.newRequest(op, input, output) + return +} + +// RecordLifecycleActionHeartbeat API operation for Auto Scaling. +// +// Records a heartbeat for the lifecycle action associated with the specified +// token or instance. This extends the timeout by the length of time defined +// using PutLifecycleHook. +// +// This step is a part of the procedure for adding a lifecycle hook to an Auto +// Scaling group: +// +// (Optional) Create a Lambda function and a rule that allows CloudWatch Events +// to invoke your Lambda function when Amazon EC2 Auto Scaling launches or terminates +// instances. +// +// (Optional) Create a notification target and an IAM role. The target can be +// either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon +// EC2 Auto Scaling to publish lifecycle notifications to the target. +// +// Create the lifecycle hook. Specify whether the hook is used when the instances +// launch or terminate. +// +// If you need more time, record the lifecycle action heartbeat to keep the +// instance in a pending state. +// +// If you finish before the timeout period ends, complete the lifecycle action. +// +// For more information, see Auto Scaling Lifecycle (http://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation RecordLifecycleActionHeartbeat for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat +func (c *AutoScaling) RecordLifecycleActionHeartbeat(input *RecordLifecycleActionHeartbeatInput) (*RecordLifecycleActionHeartbeatOutput, error) { + req, out := c.RecordLifecycleActionHeartbeatRequest(input) + return out, req.Send() +} + +// RecordLifecycleActionHeartbeatWithContext is the same as RecordLifecycleActionHeartbeat with the addition of +// the ability to pass a context and additional request options. +// +// See RecordLifecycleActionHeartbeat for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) RecordLifecycleActionHeartbeatWithContext(ctx aws.Context, input *RecordLifecycleActionHeartbeatInput, opts ...request.Option) (*RecordLifecycleActionHeartbeatOutput, error) { + req, out := c.RecordLifecycleActionHeartbeatRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResumeProcesses = "ResumeProcesses" + +// ResumeProcessesRequest generates a "aws/request.Request" representing the +// client's request for the ResumeProcesses operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResumeProcesses for more information on using the ResumeProcesses +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResumeProcessesRequest method. +// req, resp := client.ResumeProcessesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ResumeProcesses +func (c *AutoScaling) ResumeProcessesRequest(input *ScalingProcessQuery) (req *request.Request, output *ResumeProcessesOutput) { + op := &request.Operation{ + Name: opResumeProcesses, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ScalingProcessQuery{} + } + + output = &ResumeProcessesOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// ResumeProcesses API operation for Auto Scaling. +// +// Resumes the specified suspended automatic scaling processes, or all suspended +// process, for the specified Auto Scaling group. +// +// For more information, see Suspending and Resuming Scaling Processes (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation ResumeProcesses for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/ResumeProcesses +func (c *AutoScaling) ResumeProcesses(input *ScalingProcessQuery) (*ResumeProcessesOutput, error) { + req, out := c.ResumeProcessesRequest(input) + return out, req.Send() +} + +// ResumeProcessesWithContext is the same as ResumeProcesses with the addition of +// the ability to pass a context and additional request options. +// +// See ResumeProcesses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) ResumeProcessesWithContext(ctx aws.Context, input *ScalingProcessQuery, opts ...request.Option) (*ResumeProcessesOutput, error) { + req, out := c.ResumeProcessesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetDesiredCapacity = "SetDesiredCapacity" + +// SetDesiredCapacityRequest generates a "aws/request.Request" representing the +// client's request for the SetDesiredCapacity operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetDesiredCapacity for more information on using the SetDesiredCapacity +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetDesiredCapacityRequest method. +// req, resp := client.SetDesiredCapacityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacity +func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) (req *request.Request, output *SetDesiredCapacityOutput) { + op := &request.Operation{ + Name: opSetDesiredCapacity, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetDesiredCapacityInput{} + } + + output = &SetDesiredCapacityOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// SetDesiredCapacity API operation for Auto Scaling. +// +// Sets the size of the specified Auto Scaling group. +// +// For more information about desired capacity, see What Is Amazon EC2 Auto +// Scaling? (http://docs.aws.amazon.com/autoscaling/ec2/userguide/WhatIsAutoScaling.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation SetDesiredCapacity for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" +// The operation can't be performed because there are scaling activities in +// progress. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetDesiredCapacity +func (c *AutoScaling) SetDesiredCapacity(input *SetDesiredCapacityInput) (*SetDesiredCapacityOutput, error) { + req, out := c.SetDesiredCapacityRequest(input) + return out, req.Send() +} + +// SetDesiredCapacityWithContext is the same as SetDesiredCapacity with the addition of +// the ability to pass a context and additional request options. +// +// See SetDesiredCapacity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) SetDesiredCapacityWithContext(ctx aws.Context, input *SetDesiredCapacityInput, opts ...request.Option) (*SetDesiredCapacityOutput, error) { + req, out := c.SetDesiredCapacityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetInstanceHealth = "SetInstanceHealth" + +// SetInstanceHealthRequest generates a "aws/request.Request" representing the +// client's request for the SetInstanceHealth operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetInstanceHealth for more information on using the SetInstanceHealth +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetInstanceHealthRequest method. +// req, resp := client.SetInstanceHealthRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealth +func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) (req *request.Request, output *SetInstanceHealthOutput) { + op := &request.Operation{ + Name: opSetInstanceHealth, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetInstanceHealthInput{} + } + + output = &SetInstanceHealthOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// SetInstanceHealth API operation for Auto Scaling. +// +// Sets the health status of the specified instance. +// +// For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation SetInstanceHealth for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceHealth +func (c *AutoScaling) SetInstanceHealth(input *SetInstanceHealthInput) (*SetInstanceHealthOutput, error) { + req, out := c.SetInstanceHealthRequest(input) + return out, req.Send() +} + +// SetInstanceHealthWithContext is the same as SetInstanceHealth with the addition of +// the ability to pass a context and additional request options. +// +// See SetInstanceHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) SetInstanceHealthWithContext(ctx aws.Context, input *SetInstanceHealthInput, opts ...request.Option) (*SetInstanceHealthOutput, error) { + req, out := c.SetInstanceHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetInstanceProtection = "SetInstanceProtection" + +// SetInstanceProtectionRequest generates a "aws/request.Request" representing the +// client's request for the SetInstanceProtection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetInstanceProtection for more information on using the SetInstanceProtection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetInstanceProtectionRequest method. +// req, resp := client.SetInstanceProtectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtection +func (c *AutoScaling) SetInstanceProtectionRequest(input *SetInstanceProtectionInput) (req *request.Request, output *SetInstanceProtectionOutput) { + op := &request.Operation{ + Name: opSetInstanceProtection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetInstanceProtectionInput{} + } + + output = &SetInstanceProtectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// SetInstanceProtection API operation for Auto Scaling. +// +// Updates the instance protection settings of the specified instances. +// +// For more information, see Instance Protection (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation SetInstanceProtection for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Auto Scaling resources (for example, +// groups, launch configurations, or lifecycle hooks). For more information, +// see DescribeAccountLimits. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SetInstanceProtection +func (c *AutoScaling) SetInstanceProtection(input *SetInstanceProtectionInput) (*SetInstanceProtectionOutput, error) { + req, out := c.SetInstanceProtectionRequest(input) + return out, req.Send() +} + +// SetInstanceProtectionWithContext is the same as SetInstanceProtection with the addition of +// the ability to pass a context and additional request options. +// +// See SetInstanceProtection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) SetInstanceProtectionWithContext(ctx aws.Context, input *SetInstanceProtectionInput, opts ...request.Option) (*SetInstanceProtectionOutput, error) { + req, out := c.SetInstanceProtectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSuspendProcesses = "SuspendProcesses" + +// SuspendProcessesRequest generates a "aws/request.Request" representing the +// client's request for the SuspendProcesses operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SuspendProcesses for more information on using the SuspendProcesses +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SuspendProcessesRequest method. +// req, resp := client.SuspendProcessesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendProcesses +func (c *AutoScaling) SuspendProcessesRequest(input *ScalingProcessQuery) (req *request.Request, output *SuspendProcessesOutput) { + op := &request.Operation{ + Name: opSuspendProcesses, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ScalingProcessQuery{} + } + + output = &SuspendProcessesOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// SuspendProcesses API operation for Auto Scaling. +// +// Suspends the specified automatic scaling processes, or all processes, for +// the specified Auto Scaling group. +// +// Note that if you suspend either the Launch or Terminate process types, it +// can prevent other process types from functioning properly. +// +// To resume processes that have been suspended, use ResumeProcesses. +// +// For more information, see Suspending and Resuming Scaling Processes (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) +// in the Amazon EC2 Auto Scaling 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 Auto Scaling's +// API operation SuspendProcesses for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/SuspendProcesses +func (c *AutoScaling) SuspendProcesses(input *ScalingProcessQuery) (*SuspendProcessesOutput, error) { + req, out := c.SuspendProcessesRequest(input) + return out, req.Send() +} + +// SuspendProcessesWithContext is the same as SuspendProcesses with the addition of +// the ability to pass a context and additional request options. +// +// See SuspendProcesses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) SuspendProcessesWithContext(ctx aws.Context, input *ScalingProcessQuery, opts ...request.Option) (*SuspendProcessesOutput, error) { + req, out := c.SuspendProcessesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTerminateInstanceInAutoScalingGroup = "TerminateInstanceInAutoScalingGroup" + +// TerminateInstanceInAutoScalingGroupRequest generates a "aws/request.Request" representing the +// client's request for the TerminateInstanceInAutoScalingGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TerminateInstanceInAutoScalingGroup for more information on using the TerminateInstanceInAutoScalingGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TerminateInstanceInAutoScalingGroupRequest method. +// req, resp := client.TerminateInstanceInAutoScalingGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TerminateInstanceInAutoScalingGroup +func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *TerminateInstanceInAutoScalingGroupInput) (req *request.Request, output *TerminateInstanceInAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opTerminateInstanceInAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TerminateInstanceInAutoScalingGroupInput{} + } + + output = &TerminateInstanceInAutoScalingGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// TerminateInstanceInAutoScalingGroup API operation for Auto Scaling. +// +// Terminates the specified instance and optionally adjusts the desired group +// size. +// +// This call simply makes a termination request. The instance is not terminated +// immediately. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation TerminateInstanceInAutoScalingGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" +// The operation can't be performed because there are scaling activities in +// progress. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/TerminateInstanceInAutoScalingGroup +func (c *AutoScaling) TerminateInstanceInAutoScalingGroup(input *TerminateInstanceInAutoScalingGroupInput) (*TerminateInstanceInAutoScalingGroupOutput, error) { + req, out := c.TerminateInstanceInAutoScalingGroupRequest(input) + return out, req.Send() +} + +// TerminateInstanceInAutoScalingGroupWithContext is the same as TerminateInstanceInAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateInstanceInAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) TerminateInstanceInAutoScalingGroupWithContext(ctx aws.Context, input *TerminateInstanceInAutoScalingGroupInput, opts ...request.Option) (*TerminateInstanceInAutoScalingGroupOutput, error) { + req, out := c.TerminateInstanceInAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateAutoScalingGroup = "UpdateAutoScalingGroup" + +// UpdateAutoScalingGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAutoScalingGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAutoScalingGroup for more information on using the UpdateAutoScalingGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAutoScalingGroupRequest method. +// req, resp := client.UpdateAutoScalingGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroup +func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGroupInput) (req *request.Request, output *UpdateAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opUpdateAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateAutoScalingGroupInput{} + } + + output = &UpdateAutoScalingGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateAutoScalingGroup API operation for Auto Scaling. +// +// Updates the configuration for the specified Auto Scaling group. +// +// The new settings take effect on any scaling activities after this call returns. +// Scaling activities that are currently in progress aren't affected. +// +// To update an Auto Scaling group with a launch configuration with InstanceMonitoring +// set to false, you must first disable the collection of group metrics. Otherwise, +// you will get an error. If you have previously enabled the collection of group +// metrics, you can disable it using DisableMetricsCollection. +// +// Note the following: +// +// * If you specify a new value for MinSize without specifying a value for +// DesiredCapacity, and the new MinSize is larger than the current size of +// the group, we implicitly call SetDesiredCapacity to set the size of the +// group to the new value of MinSize. +// +// * If you specify a new value for MaxSize without specifying a value for +// DesiredCapacity, and the new MaxSize is smaller than the current size +// of the group, we implicitly call SetDesiredCapacity to set the size of +// the group to the new value of MaxSize. +// +// * All other optional parameters are left unchanged if 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 Auto Scaling's +// API operation UpdateAutoScalingGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" +// The operation can't be performed because there are scaling activities in +// progress. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Auto Scaling resource (for example, +// a group, instance, or load balancer). +// +// * ErrCodeServiceLinkedRoleFailure "ServiceLinkedRoleFailure" +// The service-linked role is not yet ready for use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/UpdateAutoScalingGroup +func (c *AutoScaling) UpdateAutoScalingGroup(input *UpdateAutoScalingGroupInput) (*UpdateAutoScalingGroupOutput, error) { + req, out := c.UpdateAutoScalingGroupRequest(input) + return out, req.Send() +} + +// UpdateAutoScalingGroupWithContext is the same as UpdateAutoScalingGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAutoScalingGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) UpdateAutoScalingGroupWithContext(ctx aws.Context, input *UpdateAutoScalingGroupInput, opts ...request.Option) (*UpdateAutoScalingGroupOutput, error) { + req, out := c.UpdateAutoScalingGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Describes scaling activity, which is a long-running process that represents +// a change to your Auto Scaling group, such as changing its size or replacing +// an instance. +type Activity struct { + _ struct{} `type:"structure"` + + // The ID of the activity. + // + // ActivityId is a required field + ActivityId *string `type:"string" required:"true"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The reason the activity began. + // + // Cause is a required field + Cause *string `min:"1" type:"string" required:"true"` + + // A friendly, more verbose description of the activity. + Description *string `type:"string"` + + // The details about the activity. + Details *string `type:"string"` + + // The end time of the activity. + EndTime *time.Time `type:"timestamp"` + + // A value between 0 and 100 that indicates the progress of the activity. + Progress *int64 `type:"integer"` + + // The start time of the activity. + // + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` + + // The current status of the activity. + // + // StatusCode is a required field + StatusCode *string `type:"string" required:"true" enum:"ScalingActivityStatusCode"` + + // A friendly, more verbose description of the activity status. + StatusMessage *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s Activity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Activity) GoString() string { + return s.String() +} + +// SetActivityId sets the ActivityId field's value. +func (s *Activity) SetActivityId(v string) *Activity { + s.ActivityId = &v + return s +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *Activity) SetAutoScalingGroupName(v string) *Activity { + s.AutoScalingGroupName = &v + return s +} + +// SetCause sets the Cause field's value. +func (s *Activity) SetCause(v string) *Activity { + s.Cause = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *Activity) SetDescription(v string) *Activity { + s.Description = &v + return s +} + +// SetDetails sets the Details field's value. +func (s *Activity) SetDetails(v string) *Activity { + s.Details = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *Activity) SetEndTime(v time.Time) *Activity { + s.EndTime = &v + return s +} + +// SetProgress sets the Progress field's value. +func (s *Activity) SetProgress(v int64) *Activity { + s.Progress = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *Activity) SetStartTime(v time.Time) *Activity { + s.StartTime = &v + return s +} + +// SetStatusCode sets the StatusCode field's value. +func (s *Activity) SetStatusCode(v string) *Activity { + s.StatusCode = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *Activity) SetStatusMessage(v string) *Activity { + s.StatusMessage = &v + return s +} + +// Describes a policy adjustment type. +// +// For more information, see Dynamic Scaling (http://docs.aws.amazon.com/autoscaling/ec2/DeveloperGuide/as-scale-based-on-demand.html) +// in the Amazon EC2 Auto Scaling User Guide. +type AdjustmentType struct { + _ struct{} `type:"structure"` + + // The policy adjustment type. The valid values are ChangeInCapacity, ExactCapacity, + // and PercentChangeInCapacity. + AdjustmentType *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AdjustmentType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdjustmentType) GoString() string { + return s.String() +} + +// SetAdjustmentType sets the AdjustmentType field's value. +func (s *AdjustmentType) SetAdjustmentType(v string) *AdjustmentType { + s.AdjustmentType = &v + return s +} + +// Describes an alarm. +type Alarm struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the alarm. + AlarmARN *string `min:"1" type:"string"` + + // The name of the alarm. + AlarmName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s Alarm) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Alarm) GoString() string { + return s.String() +} + +// SetAlarmARN sets the AlarmARN field's value. +func (s *Alarm) SetAlarmARN(v string) *Alarm { + s.AlarmARN = &v + return s +} + +// SetAlarmName sets the AlarmName field's value. +func (s *Alarm) SetAlarmName(v string) *Alarm { + s.AlarmName = &v + return s +} + +type AttachInstancesInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The IDs of the instances. You can specify up to 20 instances. + InstanceIds []*string `type:"list"` +} + +// String returns the string representation +func (s AttachInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachInstancesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachInstancesInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *AttachInstancesInput) SetAutoScalingGroupName(v string) *AttachInstancesInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *AttachInstancesInput) SetInstanceIds(v []*string) *AttachInstancesInput { + s.InstanceIds = v + return s +} + +type AttachInstancesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachInstancesOutput) GoString() string { + return s.String() +} + +type AttachLoadBalancerTargetGroupsInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Names (ARN) of the target groups. You can specify up + // to 10 target groups. + // + // TargetGroupARNs is a required field + TargetGroupARNs []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s AttachLoadBalancerTargetGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancerTargetGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachLoadBalancerTargetGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancerTargetGroupsInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.TargetGroupARNs == nil { + invalidParams.Add(request.NewErrParamRequired("TargetGroupARNs")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *AttachLoadBalancerTargetGroupsInput) SetAutoScalingGroupName(v string) *AttachLoadBalancerTargetGroupsInput { + s.AutoScalingGroupName = &v + return s +} + +// SetTargetGroupARNs sets the TargetGroupARNs field's value. +func (s *AttachLoadBalancerTargetGroupsInput) SetTargetGroupARNs(v []*string) *AttachLoadBalancerTargetGroupsInput { + s.TargetGroupARNs = v + return s +} + +type AttachLoadBalancerTargetGroupsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachLoadBalancerTargetGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancerTargetGroupsOutput) GoString() string { + return s.String() +} + +type AttachLoadBalancersInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The names of the load balancers. You can specify up to 10 load balancers. + // + // LoadBalancerNames is a required field + LoadBalancerNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s AttachLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachLoadBalancersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancersInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.LoadBalancerNames == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *AttachLoadBalancersInput) SetAutoScalingGroupName(v string) *AttachLoadBalancersInput { + s.AutoScalingGroupName = &v + return s +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *AttachLoadBalancersInput) SetLoadBalancerNames(v []*string) *AttachLoadBalancersInput { + s.LoadBalancerNames = v + return s +} + +type AttachLoadBalancersOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancersOutput) GoString() string { + return s.String() +} + +type BatchDeleteScheduledActionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The names of the scheduled actions to delete. The maximum number allowed + // is 50. + // + // ScheduledActionNames is a required field + ScheduledActionNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchDeleteScheduledActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDeleteScheduledActionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchDeleteScheduledActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchDeleteScheduledActionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.ScheduledActionNames == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *BatchDeleteScheduledActionInput) SetAutoScalingGroupName(v string) *BatchDeleteScheduledActionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetScheduledActionNames sets the ScheduledActionNames field's value. +func (s *BatchDeleteScheduledActionInput) SetScheduledActionNames(v []*string) *BatchDeleteScheduledActionInput { + s.ScheduledActionNames = v + return s +} + +type BatchDeleteScheduledActionOutput struct { + _ struct{} `type:"structure"` + + // The names of the scheduled actions that could not be deleted, including an + // error message. + FailedScheduledActions []*FailedScheduledUpdateGroupActionRequest `type:"list"` +} + +// String returns the string representation +func (s BatchDeleteScheduledActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDeleteScheduledActionOutput) GoString() string { + return s.String() +} + +// SetFailedScheduledActions sets the FailedScheduledActions field's value. +func (s *BatchDeleteScheduledActionOutput) SetFailedScheduledActions(v []*FailedScheduledUpdateGroupActionRequest) *BatchDeleteScheduledActionOutput { + s.FailedScheduledActions = v + return s +} + +type BatchPutScheduledUpdateGroupActionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more scheduled actions. The maximum number allowed is 50. + // + // ScheduledUpdateGroupActions is a required field + ScheduledUpdateGroupActions []*ScheduledUpdateGroupActionRequest `type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchPutScheduledUpdateGroupActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchPutScheduledUpdateGroupActionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchPutScheduledUpdateGroupActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchPutScheduledUpdateGroupActionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.ScheduledUpdateGroupActions == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledUpdateGroupActions")) + } + if s.ScheduledUpdateGroupActions != nil { + for i, v := range s.ScheduledUpdateGroupActions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScheduledUpdateGroupActions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *BatchPutScheduledUpdateGroupActionInput) SetAutoScalingGroupName(v string) *BatchPutScheduledUpdateGroupActionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetScheduledUpdateGroupActions sets the ScheduledUpdateGroupActions field's value. +func (s *BatchPutScheduledUpdateGroupActionInput) SetScheduledUpdateGroupActions(v []*ScheduledUpdateGroupActionRequest) *BatchPutScheduledUpdateGroupActionInput { + s.ScheduledUpdateGroupActions = v + return s +} + +type BatchPutScheduledUpdateGroupActionOutput struct { + _ struct{} `type:"structure"` + + // The names of the scheduled actions that could not be created or updated, + // including an error message. + FailedScheduledUpdateGroupActions []*FailedScheduledUpdateGroupActionRequest `type:"list"` +} + +// String returns the string representation +func (s BatchPutScheduledUpdateGroupActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchPutScheduledUpdateGroupActionOutput) GoString() string { + return s.String() +} + +// SetFailedScheduledUpdateGroupActions sets the FailedScheduledUpdateGroupActions field's value. +func (s *BatchPutScheduledUpdateGroupActionOutput) SetFailedScheduledUpdateGroupActions(v []*FailedScheduledUpdateGroupActionRequest) *BatchPutScheduledUpdateGroupActionOutput { + s.FailedScheduledUpdateGroupActions = v + return s +} + +// Describes a block device mapping. +type BlockDeviceMapping struct { + _ struct{} `type:"structure"` + + // The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh). + // + // DeviceName is a required field + DeviceName *string `min:"1" type:"string" required:"true"` + + // The information about the Amazon EBS volume. + Ebs *Ebs `type:"structure"` + + // Suppresses a device mapping. + // + // If this parameter is true for the root device, the instance might fail the + // EC2 health check. Amazon EC2 Auto Scaling launches a replacement instance + // if the instance fails the health check. + NoDevice *bool `type:"boolean"` + + // The name of the virtual device (for example, ephemeral0). + VirtualName *string `min:"1" 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BlockDeviceMapping) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BlockDeviceMapping"} + if s.DeviceName == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceName")) + } + if s.DeviceName != nil && len(*s.DeviceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceName", 1)) + } + if s.VirtualName != nil && len(*s.VirtualName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VirtualName", 1)) + } + if s.Ebs != nil { + if err := s.Ebs.Validate(); err != nil { + invalidParams.AddNested("Ebs", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// 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 *Ebs) *BlockDeviceMapping { + s.Ebs = v + return s +} + +// SetNoDevice sets the NoDevice field's value. +func (s *BlockDeviceMapping) SetNoDevice(v bool) *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 +} + +type CompleteLifecycleActionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The ID of the instance. + InstanceId *string `min:"1" type:"string"` + + // The action for the group to take. This parameter can be either CONTINUE or + // ABANDON. + // + // LifecycleActionResult is a required field + LifecycleActionResult *string `type:"string" required:"true"` + + // A universally unique identifier (UUID) that identifies a specific lifecycle + // action associated with an instance. Amazon EC2 Auto Scaling sends this token + // to the notification target you specified when you created the lifecycle hook. + LifecycleActionToken *string `min:"36" type:"string"` + + // The name of the lifecycle hook. + // + // LifecycleHookName is a required field + LifecycleHookName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CompleteLifecycleActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteLifecycleActionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CompleteLifecycleActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CompleteLifecycleActionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.InstanceId != nil && len(*s.InstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) + } + if s.LifecycleActionResult == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleActionResult")) + } + if s.LifecycleActionToken != nil && len(*s.LifecycleActionToken) < 36 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleActionToken", 36)) + } + if s.LifecycleHookName == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) + } + if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *CompleteLifecycleActionInput) SetAutoScalingGroupName(v string) *CompleteLifecycleActionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *CompleteLifecycleActionInput) SetInstanceId(v string) *CompleteLifecycleActionInput { + s.InstanceId = &v + return s +} + +// SetLifecycleActionResult sets the LifecycleActionResult field's value. +func (s *CompleteLifecycleActionInput) SetLifecycleActionResult(v string) *CompleteLifecycleActionInput { + s.LifecycleActionResult = &v + return s +} + +// SetLifecycleActionToken sets the LifecycleActionToken field's value. +func (s *CompleteLifecycleActionInput) SetLifecycleActionToken(v string) *CompleteLifecycleActionInput { + s.LifecycleActionToken = &v + return s +} + +// SetLifecycleHookName sets the LifecycleHookName field's value. +func (s *CompleteLifecycleActionInput) SetLifecycleHookName(v string) *CompleteLifecycleActionInput { + s.LifecycleHookName = &v + return s +} + +type CompleteLifecycleActionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CompleteLifecycleActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteLifecycleActionOutput) GoString() string { + return s.String() +} + +type CreateAutoScalingGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. This name must be unique within the scope + // of your AWS account. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more Availability Zones for the group. This parameter is optional + // if you specify one or more subnets. + AvailabilityZones []*string `min:"1" type:"list"` + + // The amount of time, in seconds, after a scaling activity completes before + // another scaling activity can start. The default is 300. + // + // For more information, see Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // in the Amazon EC2 Auto Scaling User Guide. + DefaultCooldown *int64 `type:"integer"` + + // The number of EC2 instances that should be running in the group. This number + // must be greater than or equal to the minimum size of the group and less than + // or equal to the maximum size of the group. If you do not specify a desired + // capacity, the default is the minimum size of the group. + DesiredCapacity *int64 `type:"integer"` + + // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before + // checking the health status of an EC2 instance that has come into service. + // During this time, any health check failures for the instance are ignored. + // The default is 0. + // + // This parameter is required if you are adding an ELB health check. + // + // For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) + // in the Amazon EC2 Auto Scaling User Guide. + HealthCheckGracePeriod *int64 `type:"integer"` + + // The service to use for the health checks. The valid values are EC2 and ELB. + // + // By default, health checks use Amazon EC2 instance status checks to determine + // the health of an instance. For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) + // in the Amazon EC2 Auto Scaling User Guide. + HealthCheckType *string `min:"1" type:"string"` + + // The ID of the instance used to create a launch configuration for the group. + // You must specify one of the following: an EC2 instance, a launch configuration, + // or a launch template. + // + // When you specify an ID of an instance, Amazon EC2 Auto Scaling creates a + // new launch configuration and associates it with the group. This launch configuration + // derives its attributes from the specified instance, with the exception of + // the block device mapping. + // + // For more information, see Create an Auto Scaling Group Using an EC2 Instance + // (http://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) + // in the Amazon EC2 Auto Scaling User Guide. + InstanceId *string `min:"1" type:"string"` + + // The name of the launch configuration. You must specify one of the following: + // a launch configuration, a launch template, or an EC2 instance. + LaunchConfigurationName *string `min:"1" type:"string"` + + // The launch template to use to launch instances. You must specify one of the + // following: a launch template, a launch configuration, or an EC2 instance. + LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + + // One or more lifecycle hooks. + LifecycleHookSpecificationList []*LifecycleHookSpecification `type:"list"` + + // One or more Classic Load Balancers. To specify an Application Load Balancer, + // use TargetGroupARNs instead. + // + // For more information, see Using a Load Balancer With an Auto Scaling Group + // (http://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) + // in the Amazon EC2 Auto Scaling User Guide. + LoadBalancerNames []*string `type:"list"` + + // The maximum size of the group. + // + // MaxSize is a required field + MaxSize *int64 `type:"integer" required:"true"` + + // The minimum size of the group. + // + // MinSize is a required field + MinSize *int64 `type:"integer" required:"true"` + + // Indicates whether newly launched instances are protected from termination + // by Auto Scaling when scaling in. + NewInstancesProtectedFromScaleIn *bool `type:"boolean"` + + // The name of the placement group into which you'll launch your instances, + // if any. 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. + PlacementGroup *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling + // group uses to call other AWS services on your behalf. By default, Amazon + // EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling, + // which it creates if it does not exist. + ServiceLinkedRoleARN *string `min:"1" type:"string"` + + // One or more tags. + // + // For more information, see Tagging Auto Scaling Groups and Instances (http://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) + // in the Amazon EC2 Auto Scaling User Guide. + Tags []*Tag `type:"list"` + + // The Amazon Resource Names (ARN) of the target groups. + TargetGroupARNs []*string `type:"list"` + + // One or more termination policies used to select the instance to terminate. + // These policies are executed in the order that they are listed. + // + // For more information, see Controlling Which Instances Auto Scaling Terminates + // During Scale In (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) + // in the Auto Scaling User Guide. + TerminationPolicies []*string `type:"list"` + + // A comma-separated list of subnet identifiers for your virtual private cloud + // (VPC). + // + // If you specify subnets and Availability Zones with this call, ensure that + // the subnets' Availability Zones match the Availability Zones specified. + // + // For more information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // in the Amazon EC2 Auto Scaling User Guide. + VPCZoneIdentifier *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAutoScalingGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAutoScalingGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAutoScalingGroupInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) + } + if s.HealthCheckType != nil && len(*s.HealthCheckType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HealthCheckType", 1)) + } + if s.InstanceId != nil && len(*s.InstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) + } + if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) + } + if s.MaxSize == nil { + invalidParams.Add(request.NewErrParamRequired("MaxSize")) + } + if s.MinSize == nil { + invalidParams.Add(request.NewErrParamRequired("MinSize")) + } + if s.PlacementGroup != nil && len(*s.PlacementGroup) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PlacementGroup", 1)) + } + if s.ServiceLinkedRoleARN != nil && len(*s.ServiceLinkedRoleARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServiceLinkedRoleARN", 1)) + } + if s.VPCZoneIdentifier != nil && len(*s.VPCZoneIdentifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VPCZoneIdentifier", 1)) + } + if s.LaunchTemplate != nil { + if err := s.LaunchTemplate.Validate(); err != nil { + invalidParams.AddNested("LaunchTemplate", err.(request.ErrInvalidParams)) + } + } + if s.LifecycleHookSpecificationList != nil { + for i, v := range s.LifecycleHookSpecificationList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LifecycleHookSpecificationList", i), err.(request.ErrInvalidParams)) + } + } + } + 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 +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *CreateAutoScalingGroupInput) SetAutoScalingGroupName(v string) *CreateAutoScalingGroupInput { + s.AutoScalingGroupName = &v + return s +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *CreateAutoScalingGroupInput) SetAvailabilityZones(v []*string) *CreateAutoScalingGroupInput { + s.AvailabilityZones = v + return s +} + +// SetDefaultCooldown sets the DefaultCooldown field's value. +func (s *CreateAutoScalingGroupInput) SetDefaultCooldown(v int64) *CreateAutoScalingGroupInput { + s.DefaultCooldown = &v + return s +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *CreateAutoScalingGroupInput) SetDesiredCapacity(v int64) *CreateAutoScalingGroupInput { + s.DesiredCapacity = &v + return s +} + +// SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value. +func (s *CreateAutoScalingGroupInput) SetHealthCheckGracePeriod(v int64) *CreateAutoScalingGroupInput { + s.HealthCheckGracePeriod = &v + return s +} + +// SetHealthCheckType sets the HealthCheckType field's value. +func (s *CreateAutoScalingGroupInput) SetHealthCheckType(v string) *CreateAutoScalingGroupInput { + s.HealthCheckType = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *CreateAutoScalingGroupInput) SetInstanceId(v string) *CreateAutoScalingGroupInput { + s.InstanceId = &v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *CreateAutoScalingGroupInput) SetLaunchConfigurationName(v string) *CreateAutoScalingGroupInput { + s.LaunchConfigurationName = &v + return s +} + +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *CreateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *CreateAutoScalingGroupInput { + s.LaunchTemplate = v + return s +} + +// SetLifecycleHookSpecificationList sets the LifecycleHookSpecificationList field's value. +func (s *CreateAutoScalingGroupInput) SetLifecycleHookSpecificationList(v []*LifecycleHookSpecification) *CreateAutoScalingGroupInput { + s.LifecycleHookSpecificationList = v + return s +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *CreateAutoScalingGroupInput) SetLoadBalancerNames(v []*string) *CreateAutoScalingGroupInput { + s.LoadBalancerNames = v + return s +} + +// SetMaxSize sets the MaxSize field's value. +func (s *CreateAutoScalingGroupInput) SetMaxSize(v int64) *CreateAutoScalingGroupInput { + s.MaxSize = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *CreateAutoScalingGroupInput) SetMinSize(v int64) *CreateAutoScalingGroupInput { + s.MinSize = &v + return s +} + +// SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value. +func (s *CreateAutoScalingGroupInput) SetNewInstancesProtectedFromScaleIn(v bool) *CreateAutoScalingGroupInput { + s.NewInstancesProtectedFromScaleIn = &v + return s +} + +// SetPlacementGroup sets the PlacementGroup field's value. +func (s *CreateAutoScalingGroupInput) SetPlacementGroup(v string) *CreateAutoScalingGroupInput { + s.PlacementGroup = &v + return s +} + +// SetServiceLinkedRoleARN sets the ServiceLinkedRoleARN field's value. +func (s *CreateAutoScalingGroupInput) SetServiceLinkedRoleARN(v string) *CreateAutoScalingGroupInput { + s.ServiceLinkedRoleARN = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAutoScalingGroupInput) SetTags(v []*Tag) *CreateAutoScalingGroupInput { + s.Tags = v + return s +} + +// SetTargetGroupARNs sets the TargetGroupARNs field's value. +func (s *CreateAutoScalingGroupInput) SetTargetGroupARNs(v []*string) *CreateAutoScalingGroupInput { + s.TargetGroupARNs = v + return s +} + +// SetTerminationPolicies sets the TerminationPolicies field's value. +func (s *CreateAutoScalingGroupInput) SetTerminationPolicies(v []*string) *CreateAutoScalingGroupInput { + s.TerminationPolicies = v + return s +} + +// SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value. +func (s *CreateAutoScalingGroupInput) SetVPCZoneIdentifier(v string) *CreateAutoScalingGroupInput { + s.VPCZoneIdentifier = &v + return s +} + +type CreateAutoScalingGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAutoScalingGroupOutput) GoString() string { + return s.String() +} + +type CreateLaunchConfigurationInput struct { + _ struct{} `type:"structure"` + + // Used for groups that launch instances into a virtual private cloud (VPC). + // Specifies whether to assign a public IP address to each instance. For more + // information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // If you specify this parameter, be sure to specify at least one subnet when + // you create your group. + // + // Default: If the instance is launched into a default subnet, the default is + // to assign a public IP address. If the instance is launched into a nondefault + // subnet, the default is not to assign a public IP address. + AssociatePublicIpAddress *bool `type:"boolean"` + + // One or more mappings that specify how block devices are exposed to the instance. + // For more information, see Block Device Mapping (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) + // in the Amazon Elastic Compute Cloud User Guide. + BlockDeviceMappings []*BlockDeviceMapping `type:"list"` + + // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. + // This parameter is supported only if you are launching EC2-Classic instances. + // For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClassicLinkVPCId *string `min:"1" type:"string"` + + // The IDs of one or more security groups for the specified ClassicLink-enabled + // VPC. This parameter is required if you specify a ClassicLink-enabled VPC, + // and is not supported otherwise. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClassicLinkVPCSecurityGroups []*string `type:"list"` + + // Indicates whether the instance is optimized for Amazon EBS I/O. By default, + // the instance is not optimized for EBS I/O. The optimization provides dedicated + // throughput to Amazon EBS and an optimized configuration stack to provide + // optimal I/O performance. This optimization is not available with all instance + // types. Additional usage charges apply. For more information, see Amazon EBS-Optimized + // Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) + // in the Amazon Elastic Compute Cloud User Guide. + EbsOptimized *bool `type:"boolean"` + + // The name or the Amazon Resource Name (ARN) of the instance profile associated + // with the IAM role for the instance. + // + // EC2 instances launched with an IAM role will automatically have AWS security + // credentials available. You can use IAM roles with Amazon EC2 Auto Scaling + // to automatically enable applications running on your EC2 instances to securely + // access other AWS resources. For more information, see Launch Auto Scaling + // Instances with an IAM Role (http://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) + // in the Amazon EC2 Auto Scaling User Guide. + IamInstanceProfile *string `min:"1" type:"string"` + + // The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. + // + // If you do not specify InstanceId, you must specify ImageId. + // + // For more information, see Finding an AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) + // in the Amazon Elastic Compute Cloud User Guide. + ImageId *string `min:"1" type:"string"` + + // The ID of the instance to use to create the launch configuration. The new + // launch configuration derives attributes from the instance, with the exception + // of the block device mapping. + // + // If you do not specify InstanceId, you must specify both ImageId and InstanceType. + // + // To create a launch configuration with a block device mapping or override + // any other instance attributes, specify them as part of the same request. + // + // For more information, see Create a Launch Configuration Using an EC2 Instance + // (http://docs.aws.amazon.com/autoscaling/ec2/userguide/create-lc-with-instanceID.html) + // in the Amazon EC2 Auto Scaling User Guide. + InstanceId *string `min:"1" type:"string"` + + // Enables detailed monitoring (true) or basic monitoring (false) for the Auto + // Scaling instances. The default is true. + InstanceMonitoring *InstanceMonitoring `type:"structure"` + + // The instance type of the EC2 instance. + // + // If you do not specify InstanceId, you must specify InstanceType. + // + // For information about available instance types, see Available Instance Types + // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) + // in the Amazon Elastic Compute Cloud User Guide. + InstanceType *string `min:"1" type:"string"` + + // The ID of the kernel associated with the AMI. + KernelId *string `min:"1" type:"string"` + + // The name of the key pair. For more information, see Amazon EC2 Key Pairs + // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) in + // the Amazon Elastic Compute Cloud User Guide. + KeyName *string `min:"1" type:"string"` + + // The name of the launch configuration. This name must be unique within the + // scope of your AWS account. + // + // LaunchConfigurationName is a required field + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` + + // The tenancy of the instance. An instance with a tenancy of dedicated runs + // on single-tenant hardware and can only be launched into a VPC. + // + // You must set the value of this parameter to dedicated if want to launch Dedicated + // Instances into a shared tenancy VPC (VPC with instance placement tenancy + // attribute set to default). + // + // If you specify this parameter, be sure to specify at least one subnet when + // you create your group. + // + // For more information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // Valid values: default | dedicated + PlacementTenancy *string `min:"1" type:"string"` + + // The ID of the RAM disk associated with the AMI. + RamdiskId *string `min:"1" type:"string"` + + // One or more security groups with which to associate the instances. + // + // If your instances are launched in EC2-Classic, you can either specify security + // group names or the security group IDs. For more information about security + // groups for EC2-Classic, 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. + // + // If your instances are launched into a VPC, specify security group IDs. 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. + SecurityGroups []*string `type:"list"` + + // The maximum hourly price to be paid for any Spot Instance launched to fulfill + // the request. Spot Instances are launched when the price you specify exceeds + // the current Spot market price. For more information, see Launching Spot Instances + // in Your Auto Scaling Group (http://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) + // in the Amazon EC2 Auto Scaling User Guide. + SpotPrice *string `min:"1" type:"string"` + + // The user data to make available to the launched EC2 instances. For more information, + // see Instance Metadata and User Data (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // in the Amazon Elastic Compute Cloud User Guide. + UserData *string `type:"string"` +} + +// String returns the string representation +func (s CreateLaunchConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLaunchConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLaunchConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLaunchConfigurationInput"} + if s.ClassicLinkVPCId != nil && len(*s.ClassicLinkVPCId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClassicLinkVPCId", 1)) + } + if s.IamInstanceProfile != nil && len(*s.IamInstanceProfile) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IamInstanceProfile", 1)) + } + if s.ImageId != nil && len(*s.ImageId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ImageId", 1)) + } + if s.InstanceId != nil && len(*s.InstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) + } + if s.InstanceType != nil && len(*s.InstanceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceType", 1)) + } + if s.KernelId != nil && len(*s.KernelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KernelId", 1)) + } + if s.KeyName != nil && len(*s.KeyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KeyName", 1)) + } + if s.LaunchConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("LaunchConfigurationName")) + } + if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) + } + if s.PlacementTenancy != nil && len(*s.PlacementTenancy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PlacementTenancy", 1)) + } + if s.RamdiskId != nil && len(*s.RamdiskId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RamdiskId", 1)) + } + if s.SpotPrice != nil && len(*s.SpotPrice) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SpotPrice", 1)) + } + if s.BlockDeviceMappings != nil { + for i, v := range s.BlockDeviceMappings { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "BlockDeviceMappings", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. +func (s *CreateLaunchConfigurationInput) SetAssociatePublicIpAddress(v bool) *CreateLaunchConfigurationInput { + s.AssociatePublicIpAddress = &v + return s +} + +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *CreateLaunchConfigurationInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *CreateLaunchConfigurationInput { + s.BlockDeviceMappings = v + return s +} + +// SetClassicLinkVPCId sets the ClassicLinkVPCId field's value. +func (s *CreateLaunchConfigurationInput) SetClassicLinkVPCId(v string) *CreateLaunchConfigurationInput { + s.ClassicLinkVPCId = &v + return s +} + +// SetClassicLinkVPCSecurityGroups sets the ClassicLinkVPCSecurityGroups field's value. +func (s *CreateLaunchConfigurationInput) SetClassicLinkVPCSecurityGroups(v []*string) *CreateLaunchConfigurationInput { + s.ClassicLinkVPCSecurityGroups = v + return s +} + +// SetEbsOptimized sets the EbsOptimized field's value. +func (s *CreateLaunchConfigurationInput) SetEbsOptimized(v bool) *CreateLaunchConfigurationInput { + s.EbsOptimized = &v + return s +} + +// SetIamInstanceProfile sets the IamInstanceProfile field's value. +func (s *CreateLaunchConfigurationInput) SetIamInstanceProfile(v string) *CreateLaunchConfigurationInput { + s.IamInstanceProfile = &v + return s +} + +// SetImageId sets the ImageId field's value. +func (s *CreateLaunchConfigurationInput) SetImageId(v string) *CreateLaunchConfigurationInput { + s.ImageId = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *CreateLaunchConfigurationInput) SetInstanceId(v string) *CreateLaunchConfigurationInput { + s.InstanceId = &v + return s +} + +// SetInstanceMonitoring sets the InstanceMonitoring field's value. +func (s *CreateLaunchConfigurationInput) SetInstanceMonitoring(v *InstanceMonitoring) *CreateLaunchConfigurationInput { + s.InstanceMonitoring = v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *CreateLaunchConfigurationInput) SetInstanceType(v string) *CreateLaunchConfigurationInput { + s.InstanceType = &v + return s +} + +// SetKernelId sets the KernelId field's value. +func (s *CreateLaunchConfigurationInput) SetKernelId(v string) *CreateLaunchConfigurationInput { + s.KernelId = &v + return s +} + +// SetKeyName sets the KeyName field's value. +func (s *CreateLaunchConfigurationInput) SetKeyName(v string) *CreateLaunchConfigurationInput { + s.KeyName = &v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *CreateLaunchConfigurationInput) SetLaunchConfigurationName(v string) *CreateLaunchConfigurationInput { + s.LaunchConfigurationName = &v + return s +} + +// SetPlacementTenancy sets the PlacementTenancy field's value. +func (s *CreateLaunchConfigurationInput) SetPlacementTenancy(v string) *CreateLaunchConfigurationInput { + s.PlacementTenancy = &v + return s +} + +// SetRamdiskId sets the RamdiskId field's value. +func (s *CreateLaunchConfigurationInput) SetRamdiskId(v string) *CreateLaunchConfigurationInput { + s.RamdiskId = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *CreateLaunchConfigurationInput) SetSecurityGroups(v []*string) *CreateLaunchConfigurationInput { + s.SecurityGroups = v + return s +} + +// SetSpotPrice sets the SpotPrice field's value. +func (s *CreateLaunchConfigurationInput) SetSpotPrice(v string) *CreateLaunchConfigurationInput { + s.SpotPrice = &v + return s +} + +// SetUserData sets the UserData field's value. +func (s *CreateLaunchConfigurationInput) SetUserData(v string) *CreateLaunchConfigurationInput { + s.UserData = &v + return s +} + +type CreateLaunchConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateLaunchConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLaunchConfigurationOutput) GoString() string { + return s.String() +} + +type CreateOrUpdateTagsInput struct { + _ struct{} `type:"structure"` + + // One or more tags. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` +} + +// String returns the string representation +func (s CreateOrUpdateTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateOrUpdateTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateOrUpdateTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateOrUpdateTagsInput"} + 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 +} + +// SetTags sets the Tags field's value. +func (s *CreateOrUpdateTagsInput) SetTags(v []*Tag) *CreateOrUpdateTagsInput { + s.Tags = v + return s +} + +type CreateOrUpdateTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateOrUpdateTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateOrUpdateTagsOutput) GoString() string { + return s.String() +} + +// Configures a customized metric for a target tracking policy. +type CustomizedMetricSpecification struct { + _ struct{} `type:"structure"` + + // The dimensions of the metric. + Dimensions []*MetricDimension `type:"list"` + + // The name of the metric. + // + // MetricName is a required field + MetricName *string `type:"string" required:"true"` + + // The namespace of the metric. + // + // Namespace is a required field + Namespace *string `type:"string" required:"true"` + + // The statistic of the metric. + // + // Statistic is a required field + Statistic *string `type:"string" required:"true" enum:"MetricStatistic"` + + // The unit of the metric. + Unit *string `type:"string"` +} + +// String returns the string representation +func (s CustomizedMetricSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomizedMetricSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CustomizedMetricSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CustomizedMetricSpecification"} + if s.MetricName == nil { + invalidParams.Add(request.NewErrParamRequired("MetricName")) + } + if s.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Statistic == nil { + invalidParams.Add(request.NewErrParamRequired("Statistic")) + } + if s.Dimensions != nil { + for i, v := range s.Dimensions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDimensions sets the Dimensions field's value. +func (s *CustomizedMetricSpecification) SetDimensions(v []*MetricDimension) *CustomizedMetricSpecification { + s.Dimensions = v + return s +} + +// SetMetricName sets the MetricName field's value. +func (s *CustomizedMetricSpecification) SetMetricName(v string) *CustomizedMetricSpecification { + s.MetricName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *CustomizedMetricSpecification) SetNamespace(v string) *CustomizedMetricSpecification { + s.Namespace = &v + return s +} + +// SetStatistic sets the Statistic field's value. +func (s *CustomizedMetricSpecification) SetStatistic(v string) *CustomizedMetricSpecification { + s.Statistic = &v + return s +} + +// SetUnit sets the Unit field's value. +func (s *CustomizedMetricSpecification) SetUnit(v string) *CustomizedMetricSpecification { + s.Unit = &v + return s +} + +type DeleteAutoScalingGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // Specifies that the group will be deleted along with all instances associated + // with the group, without waiting for all instances to be terminated. This + // parameter also deletes any lifecycle actions associated with the group. + ForceDelete *bool `type:"boolean"` +} + +// String returns the string representation +func (s DeleteAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAutoScalingGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAutoScalingGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAutoScalingGroupInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DeleteAutoScalingGroupInput) SetAutoScalingGroupName(v string) *DeleteAutoScalingGroupInput { + s.AutoScalingGroupName = &v + return s +} + +// SetForceDelete sets the ForceDelete field's value. +func (s *DeleteAutoScalingGroupInput) SetForceDelete(v bool) *DeleteAutoScalingGroupInput { + s.ForceDelete = &v + return s +} + +type DeleteAutoScalingGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAutoScalingGroupOutput) GoString() string { + return s.String() +} + +type DeleteLaunchConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the launch configuration. + // + // LaunchConfigurationName is a required field + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLaunchConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLaunchConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLaunchConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchConfigurationInput"} + if s.LaunchConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("LaunchConfigurationName")) + } + if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *DeleteLaunchConfigurationInput) SetLaunchConfigurationName(v string) *DeleteLaunchConfigurationInput { + s.LaunchConfigurationName = &v + return s +} + +type DeleteLaunchConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLaunchConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLaunchConfigurationOutput) GoString() string { + return s.String() +} + +type DeleteLifecycleHookInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The name of the lifecycle hook. + // + // LifecycleHookName is a required field + LifecycleHookName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLifecycleHookInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLifecycleHookInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLifecycleHookInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLifecycleHookInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.LifecycleHookName == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) + } + if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DeleteLifecycleHookInput) SetAutoScalingGroupName(v string) *DeleteLifecycleHookInput { + s.AutoScalingGroupName = &v + return s +} + +// SetLifecycleHookName sets the LifecycleHookName field's value. +func (s *DeleteLifecycleHookInput) SetLifecycleHookName(v string) *DeleteLifecycleHookInput { + s.LifecycleHookName = &v + return s +} + +type DeleteLifecycleHookOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLifecycleHookOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLifecycleHookOutput) GoString() string { + return s.String() +} + +type DeleteNotificationConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service + // (SNS) topic. + // + // TopicARN is a required field + TopicARN *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNotificationConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotificationConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNotificationConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNotificationConfigurationInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.TopicARN == nil { + invalidParams.Add(request.NewErrParamRequired("TopicARN")) + } + if s.TopicARN != nil && len(*s.TopicARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TopicARN", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DeleteNotificationConfigurationInput) SetAutoScalingGroupName(v string) *DeleteNotificationConfigurationInput { + s.AutoScalingGroupName = &v + return s +} + +// SetTopicARN sets the TopicARN field's value. +func (s *DeleteNotificationConfigurationInput) SetTopicARN(v string) *DeleteNotificationConfigurationInput { + s.TopicARN = &v + return s +} + +type DeleteNotificationConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteNotificationConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotificationConfigurationOutput) GoString() string { + return s.String() +} + +type DeletePolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The name or Amazon Resource Name (ARN) of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DeletePolicyInput) SetAutoScalingGroupName(v string) *DeletePolicyInput { + s.AutoScalingGroupName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *DeletePolicyInput) SetPolicyName(v string) *DeletePolicyInput { + s.PolicyName = &v + return s +} + +type DeletePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyOutput) GoString() string { + return s.String() +} + +type DeleteScheduledActionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The name of the action to delete. + // + // ScheduledActionName is a required field + ScheduledActionName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteScheduledActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteScheduledActionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteScheduledActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteScheduledActionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.ScheduledActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) + } + if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DeleteScheduledActionInput) SetAutoScalingGroupName(v string) *DeleteScheduledActionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *DeleteScheduledActionInput) SetScheduledActionName(v string) *DeleteScheduledActionInput { + s.ScheduledActionName = &v + return s +} + +type DeleteScheduledActionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteScheduledActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteScheduledActionOutput) GoString() string { + return s.String() +} + +type DeleteTagsInput struct { + _ struct{} `type:"structure"` + + // One or more tags. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` +} + +// 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.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 +} + +// 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() +} + +type DescribeAccountLimitsInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeAccountLimitsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsInput) GoString() string { + return s.String() +} + +type DescribeAccountLimitsOutput struct { + _ struct{} `type:"structure"` + + // The maximum number of groups allowed for your AWS account. The default limit + // is 20 per region. + MaxNumberOfAutoScalingGroups *int64 `type:"integer"` + + // The maximum number of launch configurations allowed for your AWS account. + // The default limit is 100 per region. + MaxNumberOfLaunchConfigurations *int64 `type:"integer"` + + // The current number of groups for your AWS account. + NumberOfAutoScalingGroups *int64 `type:"integer"` + + // The current number of launch configurations for your AWS account. + NumberOfLaunchConfigurations *int64 `type:"integer"` +} + +// String returns the string representation +func (s DescribeAccountLimitsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsOutput) GoString() string { + return s.String() +} + +// SetMaxNumberOfAutoScalingGroups sets the MaxNumberOfAutoScalingGroups field's value. +func (s *DescribeAccountLimitsOutput) SetMaxNumberOfAutoScalingGroups(v int64) *DescribeAccountLimitsOutput { + s.MaxNumberOfAutoScalingGroups = &v + return s +} + +// SetMaxNumberOfLaunchConfigurations sets the MaxNumberOfLaunchConfigurations field's value. +func (s *DescribeAccountLimitsOutput) SetMaxNumberOfLaunchConfigurations(v int64) *DescribeAccountLimitsOutput { + s.MaxNumberOfLaunchConfigurations = &v + return s +} + +// SetNumberOfAutoScalingGroups sets the NumberOfAutoScalingGroups field's value. +func (s *DescribeAccountLimitsOutput) SetNumberOfAutoScalingGroups(v int64) *DescribeAccountLimitsOutput { + s.NumberOfAutoScalingGroups = &v + return s +} + +// SetNumberOfLaunchConfigurations sets the NumberOfLaunchConfigurations field's value. +func (s *DescribeAccountLimitsOutput) SetNumberOfLaunchConfigurations(v int64) *DescribeAccountLimitsOutput { + s.NumberOfLaunchConfigurations = &v + return s +} + +type DescribeAdjustmentTypesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeAdjustmentTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAdjustmentTypesInput) GoString() string { + return s.String() +} + +type DescribeAdjustmentTypesOutput struct { + _ struct{} `type:"structure"` + + // The policy adjustment types. + AdjustmentTypes []*AdjustmentType `type:"list"` +} + +// String returns the string representation +func (s DescribeAdjustmentTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAdjustmentTypesOutput) GoString() string { + return s.String() +} + +// SetAdjustmentTypes sets the AdjustmentTypes field's value. +func (s *DescribeAdjustmentTypesOutput) SetAdjustmentTypes(v []*AdjustmentType) *DescribeAdjustmentTypesOutput { + s.AdjustmentTypes = v + return s +} + +type DescribeAutoScalingGroupsInput struct { + _ struct{} `type:"structure"` + + // The names of the Auto Scaling groups. You can specify up to MaxRecords names. + // If you omit this parameter, all Auto Scaling groups are described. + AutoScalingGroupNames []*string `type:"list"` + + // The maximum number of items to return with this call. The default value is + // 50 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAutoScalingGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingGroupsInput) GoString() string { + return s.String() +} + +// SetAutoScalingGroupNames sets the AutoScalingGroupNames field's value. +func (s *DescribeAutoScalingGroupsInput) SetAutoScalingGroupNames(v []*string) *DescribeAutoScalingGroupsInput { + s.AutoScalingGroupNames = v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeAutoScalingGroupsInput) SetMaxRecords(v int64) *DescribeAutoScalingGroupsInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAutoScalingGroupsInput) SetNextToken(v string) *DescribeAutoScalingGroupsInput { + s.NextToken = &v + return s +} + +type DescribeAutoScalingGroupsOutput struct { + _ struct{} `type:"structure"` + + // The groups. + // + // AutoScalingGroups is a required field + AutoScalingGroups []*Group `type:"list" required:"true"` + + // 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 `type:"string"` +} + +// String returns the string representation +func (s DescribeAutoScalingGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingGroupsOutput) GoString() string { + return s.String() +} + +// SetAutoScalingGroups sets the AutoScalingGroups field's value. +func (s *DescribeAutoScalingGroupsOutput) SetAutoScalingGroups(v []*Group) *DescribeAutoScalingGroupsOutput { + s.AutoScalingGroups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAutoScalingGroupsOutput) SetNextToken(v string) *DescribeAutoScalingGroupsOutput { + s.NextToken = &v + return s +} + +type DescribeAutoScalingInstancesInput struct { + _ struct{} `type:"structure"` + + // The IDs of the instances. You can specify up to MaxRecords IDs. If you omit + // this parameter, all Auto Scaling instances are described. If you specify + // an ID that does not exist, it is ignored with no error. + InstanceIds []*string `type:"list"` + + // The maximum number of items to return with this call. The default value is + // 50 and the maximum value is 50. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAutoScalingInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingInstancesInput) GoString() string { + return s.String() +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *DescribeAutoScalingInstancesInput) SetInstanceIds(v []*string) *DescribeAutoScalingInstancesInput { + s.InstanceIds = v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeAutoScalingInstancesInput) SetMaxRecords(v int64) *DescribeAutoScalingInstancesInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAutoScalingInstancesInput) SetNextToken(v string) *DescribeAutoScalingInstancesInput { + s.NextToken = &v + return s +} + +type DescribeAutoScalingInstancesOutput struct { + _ struct{} `type:"structure"` + + // The instances. + AutoScalingInstances []*InstanceDetails `type:"list"` + + // 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 `type:"string"` +} + +// String returns the string representation +func (s DescribeAutoScalingInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingInstancesOutput) GoString() string { + return s.String() +} + +// SetAutoScalingInstances sets the AutoScalingInstances field's value. +func (s *DescribeAutoScalingInstancesOutput) SetAutoScalingInstances(v []*InstanceDetails) *DescribeAutoScalingInstancesOutput { + s.AutoScalingInstances = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAutoScalingInstancesOutput) SetNextToken(v string) *DescribeAutoScalingInstancesOutput { + s.NextToken = &v + return s +} + +type DescribeAutoScalingNotificationTypesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeAutoScalingNotificationTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingNotificationTypesInput) GoString() string { + return s.String() +} + +type DescribeAutoScalingNotificationTypesOutput struct { + _ struct{} `type:"structure"` + + // The notification types. + AutoScalingNotificationTypes []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeAutoScalingNotificationTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingNotificationTypesOutput) GoString() string { + return s.String() +} + +// SetAutoScalingNotificationTypes sets the AutoScalingNotificationTypes field's value. +func (s *DescribeAutoScalingNotificationTypesOutput) SetAutoScalingNotificationTypes(v []*string) *DescribeAutoScalingNotificationTypesOutput { + s.AutoScalingNotificationTypes = v + return s +} + +type DescribeLaunchConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The launch configuration names. If you omit this parameter, all launch configurations + // are described. + LaunchConfigurationNames []*string `type:"list"` + + // The maximum number of items to return with this call. The default value is + // 50 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeLaunchConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLaunchConfigurationsInput) GoString() string { + return s.String() +} + +// SetLaunchConfigurationNames sets the LaunchConfigurationNames field's value. +func (s *DescribeLaunchConfigurationsInput) SetLaunchConfigurationNames(v []*string) *DescribeLaunchConfigurationsInput { + s.LaunchConfigurationNames = v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeLaunchConfigurationsInput) SetMaxRecords(v int64) *DescribeLaunchConfigurationsInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLaunchConfigurationsInput) SetNextToken(v string) *DescribeLaunchConfigurationsInput { + s.NextToken = &v + return s +} + +type DescribeLaunchConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // The launch configurations. + // + // LaunchConfigurations is a required field + LaunchConfigurations []*LaunchConfiguration `type:"list" required:"true"` + + // 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 `type:"string"` +} + +// String returns the string representation +func (s DescribeLaunchConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLaunchConfigurationsOutput) GoString() string { + return s.String() +} + +// SetLaunchConfigurations sets the LaunchConfigurations field's value. +func (s *DescribeLaunchConfigurationsOutput) SetLaunchConfigurations(v []*LaunchConfiguration) *DescribeLaunchConfigurationsOutput { + s.LaunchConfigurations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLaunchConfigurationsOutput) SetNextToken(v string) *DescribeLaunchConfigurationsOutput { + s.NextToken = &v + return s +} + +type DescribeLifecycleHookTypesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeLifecycleHookTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHookTypesInput) GoString() string { + return s.String() +} + +type DescribeLifecycleHookTypesOutput struct { + _ struct{} `type:"structure"` + + // The lifecycle hook types. + LifecycleHookTypes []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeLifecycleHookTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHookTypesOutput) GoString() string { + return s.String() +} + +// SetLifecycleHookTypes sets the LifecycleHookTypes field's value. +func (s *DescribeLifecycleHookTypesOutput) SetLifecycleHookTypes(v []*string) *DescribeLifecycleHookTypesOutput { + s.LifecycleHookTypes = v + return s +} + +type DescribeLifecycleHooksInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The names of one or more lifecycle hooks. If you omit this parameter, all + // lifecycle hooks are described. + LifecycleHookNames []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeLifecycleHooksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHooksInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLifecycleHooksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLifecycleHooksInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DescribeLifecycleHooksInput) SetAutoScalingGroupName(v string) *DescribeLifecycleHooksInput { + s.AutoScalingGroupName = &v + return s +} + +// SetLifecycleHookNames sets the LifecycleHookNames field's value. +func (s *DescribeLifecycleHooksInput) SetLifecycleHookNames(v []*string) *DescribeLifecycleHooksInput { + s.LifecycleHookNames = v + return s +} + +type DescribeLifecycleHooksOutput struct { + _ struct{} `type:"structure"` + + // The lifecycle hooks for the specified group. + LifecycleHooks []*LifecycleHook `type:"list"` +} + +// String returns the string representation +func (s DescribeLifecycleHooksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHooksOutput) GoString() string { + return s.String() +} + +// SetLifecycleHooks sets the LifecycleHooks field's value. +func (s *DescribeLifecycleHooksOutput) SetLifecycleHooks(v []*LifecycleHook) *DescribeLifecycleHooksOutput { + s.LifecycleHooks = v + return s +} + +type DescribeLoadBalancerTargetGroupsInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The maximum number of items to return with this call. The default value is + // 100 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeLoadBalancerTargetGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerTargetGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLoadBalancerTargetGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancerTargetGroupsInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DescribeLoadBalancerTargetGroupsInput) SetAutoScalingGroupName(v string) *DescribeLoadBalancerTargetGroupsInput { + s.AutoScalingGroupName = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeLoadBalancerTargetGroupsInput) SetMaxRecords(v int64) *DescribeLoadBalancerTargetGroupsInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLoadBalancerTargetGroupsInput) SetNextToken(v string) *DescribeLoadBalancerTargetGroupsInput { + s.NextToken = &v + return s +} + +type DescribeLoadBalancerTargetGroupsOutput struct { + _ struct{} `type:"structure"` + + // Information about the target groups. + LoadBalancerTargetGroups []*LoadBalancerTargetGroupState `type:"list"` + + // 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 `type:"string"` +} + +// String returns the string representation +func (s DescribeLoadBalancerTargetGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerTargetGroupsOutput) GoString() string { + return s.String() +} + +// SetLoadBalancerTargetGroups sets the LoadBalancerTargetGroups field's value. +func (s *DescribeLoadBalancerTargetGroupsOutput) SetLoadBalancerTargetGroups(v []*LoadBalancerTargetGroupState) *DescribeLoadBalancerTargetGroupsOutput { + s.LoadBalancerTargetGroups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLoadBalancerTargetGroupsOutput) SetNextToken(v string) *DescribeLoadBalancerTargetGroupsOutput { + s.NextToken = &v + return s +} + +type DescribeLoadBalancersInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The maximum number of items to return with this call. The default value is + // 100 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLoadBalancersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancersInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DescribeLoadBalancersInput) SetAutoScalingGroupName(v string) *DescribeLoadBalancersInput { + s.AutoScalingGroupName = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeLoadBalancersInput) SetMaxRecords(v int64) *DescribeLoadBalancersInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLoadBalancersInput) SetNextToken(v string) *DescribeLoadBalancersInput { + s.NextToken = &v + return s +} + +type DescribeLoadBalancersOutput struct { + _ struct{} `type:"structure"` + + // The load balancers. + LoadBalancers []*LoadBalancerState `type:"list"` + + // 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 `type:"string"` +} + +// String returns the string representation +func (s DescribeLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersOutput) GoString() string { + return s.String() +} + +// SetLoadBalancers sets the LoadBalancers field's value. +func (s *DescribeLoadBalancersOutput) SetLoadBalancers(v []*LoadBalancerState) *DescribeLoadBalancersOutput { + s.LoadBalancers = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLoadBalancersOutput) SetNextToken(v string) *DescribeLoadBalancersOutput { + s.NextToken = &v + return s +} + +type DescribeMetricCollectionTypesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeMetricCollectionTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMetricCollectionTypesInput) GoString() string { + return s.String() +} + +type DescribeMetricCollectionTypesOutput struct { + _ struct{} `type:"structure"` + + // The granularities for the metrics. + Granularities []*MetricGranularityType `type:"list"` + + // One or more metrics. + Metrics []*MetricCollectionType `type:"list"` +} + +// String returns the string representation +func (s DescribeMetricCollectionTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMetricCollectionTypesOutput) GoString() string { + return s.String() +} + +// SetGranularities sets the Granularities field's value. +func (s *DescribeMetricCollectionTypesOutput) SetGranularities(v []*MetricGranularityType) *DescribeMetricCollectionTypesOutput { + s.Granularities = v + return s +} + +// SetMetrics sets the Metrics field's value. +func (s *DescribeMetricCollectionTypesOutput) SetMetrics(v []*MetricCollectionType) *DescribeMetricCollectionTypesOutput { + s.Metrics = v + return s +} + +type DescribeNotificationConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupNames []*string `type:"list"` + + // The maximum number of items to return with this call. The default value is + // 50 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeNotificationConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotificationConfigurationsInput) GoString() string { + return s.String() +} + +// SetAutoScalingGroupNames sets the AutoScalingGroupNames field's value. +func (s *DescribeNotificationConfigurationsInput) SetAutoScalingGroupNames(v []*string) *DescribeNotificationConfigurationsInput { + s.AutoScalingGroupNames = v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeNotificationConfigurationsInput) SetMaxRecords(v int64) *DescribeNotificationConfigurationsInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeNotificationConfigurationsInput) SetNextToken(v string) *DescribeNotificationConfigurationsInput { + s.NextToken = &v + return s +} + +type DescribeNotificationConfigurationsOutput 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 `type:"string"` + + // The notification configurations. + // + // NotificationConfigurations is a required field + NotificationConfigurations []*NotificationConfiguration `type:"list" required:"true"` +} + +// String returns the string representation +func (s DescribeNotificationConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotificationConfigurationsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeNotificationConfigurationsOutput) SetNextToken(v string) *DescribeNotificationConfigurationsOutput { + s.NextToken = &v + return s +} + +// SetNotificationConfigurations sets the NotificationConfigurations field's value. +func (s *DescribeNotificationConfigurationsOutput) SetNotificationConfigurations(v []*NotificationConfiguration) *DescribeNotificationConfigurationsOutput { + s.NotificationConfigurations = v + return s +} + +type DescribePoliciesInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The maximum number of items to be returned with each call. The default value + // is 50 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` + + // The names of one or more policies. If you omit this parameter, all policies + // are described. If an group name is provided, the results are limited to that + // group. This list is limited to 50 items. If you specify an unknown policy + // name, it is ignored with no error. + PolicyNames []*string `type:"list"` + + // One or more policy types. Valid values are SimpleScaling and StepScaling. + PolicyTypes []*string `type:"list"` +} + +// String returns the string representation +func (s DescribePoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribePoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribePoliciesInput"} + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DescribePoliciesInput) SetAutoScalingGroupName(v string) *DescribePoliciesInput { + s.AutoScalingGroupName = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribePoliciesInput) SetMaxRecords(v int64) *DescribePoliciesInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribePoliciesInput) SetNextToken(v string) *DescribePoliciesInput { + s.NextToken = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *DescribePoliciesInput) SetPolicyNames(v []*string) *DescribePoliciesInput { + s.PolicyNames = v + return s +} + +// SetPolicyTypes sets the PolicyTypes field's value. +func (s *DescribePoliciesInput) SetPolicyTypes(v []*string) *DescribePoliciesInput { + s.PolicyTypes = v + return s +} + +type DescribePoliciesOutput 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 `type:"string"` + + // The scaling policies. + ScalingPolicies []*ScalingPolicy `type:"list"` +} + +// String returns the string representation +func (s DescribePoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePoliciesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribePoliciesOutput) SetNextToken(v string) *DescribePoliciesOutput { + s.NextToken = &v + return s +} + +// SetScalingPolicies sets the ScalingPolicies field's value. +func (s *DescribePoliciesOutput) SetScalingPolicies(v []*ScalingPolicy) *DescribePoliciesOutput { + s.ScalingPolicies = v + return s +} + +type DescribeScalingActivitiesInput struct { + _ struct{} `type:"structure"` + + // The activity IDs of the desired scaling activities. You can specify up to + // 50 IDs. If you omit this parameter, all activities for the past six weeks + // are described. If unknown activities are requested, they are ignored with + // no error. If you specify an Auto Scaling group, the results are limited to + // that group. + ActivityIds []*string `type:"list"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The maximum number of items to return with this call. The default value is + // 100 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeScalingActivitiesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingActivitiesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeScalingActivitiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeScalingActivitiesInput"} + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActivityIds sets the ActivityIds field's value. +func (s *DescribeScalingActivitiesInput) SetActivityIds(v []*string) *DescribeScalingActivitiesInput { + s.ActivityIds = v + return s +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DescribeScalingActivitiesInput) SetAutoScalingGroupName(v string) *DescribeScalingActivitiesInput { + s.AutoScalingGroupName = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeScalingActivitiesInput) SetMaxRecords(v int64) *DescribeScalingActivitiesInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeScalingActivitiesInput) SetNextToken(v string) *DescribeScalingActivitiesInput { + s.NextToken = &v + return s +} + +type DescribeScalingActivitiesOutput struct { + _ struct{} `type:"structure"` + + // The scaling activities. Activities are sorted by start time. Activities still + // in progress are described first. + // + // Activities is a required field + Activities []*Activity `type:"list" required:"true"` + + // 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 `type:"string"` +} + +// String returns the string representation +func (s DescribeScalingActivitiesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingActivitiesOutput) GoString() string { + return s.String() +} + +// SetActivities sets the Activities field's value. +func (s *DescribeScalingActivitiesOutput) SetActivities(v []*Activity) *DescribeScalingActivitiesOutput { + s.Activities = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeScalingActivitiesOutput) SetNextToken(v string) *DescribeScalingActivitiesOutput { + s.NextToken = &v + return s +} + +type DescribeScalingProcessTypesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeScalingProcessTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingProcessTypesInput) GoString() string { + return s.String() +} + +type DescribeScalingProcessTypesOutput struct { + _ struct{} `type:"structure"` + + // The names of the process types. + Processes []*ProcessType `type:"list"` +} + +// String returns the string representation +func (s DescribeScalingProcessTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingProcessTypesOutput) GoString() string { + return s.String() +} + +// SetProcesses sets the Processes field's value. +func (s *DescribeScalingProcessTypesOutput) SetProcesses(v []*ProcessType) *DescribeScalingProcessTypesOutput { + s.Processes = v + return s +} + +type DescribeScheduledActionsInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The latest scheduled start time to return. If scheduled action names are + // provided, this parameter is ignored. + EndTime *time.Time `type:"timestamp"` + + // The maximum number of items to return with this call. The default value is + // 50 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` + + // The names of one or more scheduled actions. You can specify up to 50 actions. + // If you omit this parameter, all scheduled actions are described. If you specify + // an unknown scheduled action, it is ignored with no error. + ScheduledActionNames []*string `type:"list"` + + // The earliest scheduled start time to return. If scheduled action names are + // provided, this parameter is ignored. + StartTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s DescribeScheduledActionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScheduledActionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeScheduledActionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeScheduledActionsInput"} + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DescribeScheduledActionsInput) SetAutoScalingGroupName(v string) *DescribeScheduledActionsInput { + s.AutoScalingGroupName = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *DescribeScheduledActionsInput) SetEndTime(v time.Time) *DescribeScheduledActionsInput { + s.EndTime = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeScheduledActionsInput) SetMaxRecords(v int64) *DescribeScheduledActionsInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeScheduledActionsInput) SetNextToken(v string) *DescribeScheduledActionsInput { + s.NextToken = &v + return s +} + +// SetScheduledActionNames sets the ScheduledActionNames field's value. +func (s *DescribeScheduledActionsInput) SetScheduledActionNames(v []*string) *DescribeScheduledActionsInput { + s.ScheduledActionNames = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *DescribeScheduledActionsInput) SetStartTime(v time.Time) *DescribeScheduledActionsInput { + s.StartTime = &v + return s +} + +type DescribeScheduledActionsOutput 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 `type:"string"` + + // The scheduled actions. + ScheduledUpdateGroupActions []*ScheduledUpdateGroupAction `type:"list"` +} + +// String returns the string representation +func (s DescribeScheduledActionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScheduledActionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeScheduledActionsOutput) SetNextToken(v string) *DescribeScheduledActionsOutput { + s.NextToken = &v + return s +} + +// SetScheduledUpdateGroupActions sets the ScheduledUpdateGroupActions field's value. +func (s *DescribeScheduledActionsOutput) SetScheduledUpdateGroupActions(v []*ScheduledUpdateGroupAction) *DescribeScheduledActionsOutput { + s.ScheduledUpdateGroupActions = v + return s +} + +type DescribeTagsInput struct { + _ struct{} `type:"structure"` + + // A filter used to scope the tags to return. + Filters []*Filter `type:"list"` + + // The maximum number of items to return with this call. The default value is + // 50 and the maximum value is 100. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `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() +} + +// SetFilters sets the Filters field's value. +func (s *DescribeTagsInput) SetFilters(v []*Filter) *DescribeTagsInput { + s.Filters = v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeTagsInput) SetMaxRecords(v int64) *DescribeTagsInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTagsInput) SetNextToken(v string) *DescribeTagsInput { + s.NextToken = &v + return s +} + +type DescribeTagsOutput 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 `type:"string"` + + // One or more tags. + Tags []*TagDescription `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 +} + +type DescribeTerminationPolicyTypesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeTerminationPolicyTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTerminationPolicyTypesInput) GoString() string { + return s.String() +} + +type DescribeTerminationPolicyTypesOutput struct { + _ struct{} `type:"structure"` + + // The termination policies supported by Amazon EC2 Auto Scaling (OldestInstance, + // OldestLaunchConfiguration, NewestInstance, ClosestToNextInstanceHour, and + // Default). + TerminationPolicyTypes []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeTerminationPolicyTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTerminationPolicyTypesOutput) GoString() string { + return s.String() +} + +// SetTerminationPolicyTypes sets the TerminationPolicyTypes field's value. +func (s *DescribeTerminationPolicyTypesOutput) SetTerminationPolicyTypes(v []*string) *DescribeTerminationPolicyTypesOutput { + s.TerminationPolicyTypes = v + return s +} + +type DetachInstancesInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The IDs of the instances. You can specify up to 20 instances. + InstanceIds []*string `type:"list"` + + // Indicates whether the Auto Scaling group decrements the desired capacity + // value by the number of instances detached. + // + // ShouldDecrementDesiredCapacity is a required field + ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s DetachInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInstancesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachInstancesInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.ShouldDecrementDesiredCapacity == nil { + invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DetachInstancesInput) SetAutoScalingGroupName(v string) *DetachInstancesInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *DetachInstancesInput) SetInstanceIds(v []*string) *DetachInstancesInput { + s.InstanceIds = v + return s +} + +// SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. +func (s *DetachInstancesInput) SetShouldDecrementDesiredCapacity(v bool) *DetachInstancesInput { + s.ShouldDecrementDesiredCapacity = &v + return s +} + +type DetachInstancesOutput struct { + _ struct{} `type:"structure"` + + // The activities related to detaching the instances from the Auto Scaling group. + Activities []*Activity `type:"list"` +} + +// String returns the string representation +func (s DetachInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInstancesOutput) GoString() string { + return s.String() +} + +// SetActivities sets the Activities field's value. +func (s *DetachInstancesOutput) SetActivities(v []*Activity) *DetachInstancesOutput { + s.Activities = v + return s +} + +type DetachLoadBalancerTargetGroupsInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Names (ARN) of the target groups. You can specify up + // to 10 target groups. + // + // TargetGroupARNs is a required field + TargetGroupARNs []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s DetachLoadBalancerTargetGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancerTargetGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachLoadBalancerTargetGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancerTargetGroupsInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.TargetGroupARNs == nil { + invalidParams.Add(request.NewErrParamRequired("TargetGroupARNs")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DetachLoadBalancerTargetGroupsInput) SetAutoScalingGroupName(v string) *DetachLoadBalancerTargetGroupsInput { + s.AutoScalingGroupName = &v + return s +} + +// SetTargetGroupARNs sets the TargetGroupARNs field's value. +func (s *DetachLoadBalancerTargetGroupsInput) SetTargetGroupARNs(v []*string) *DetachLoadBalancerTargetGroupsInput { + s.TargetGroupARNs = v + return s +} + +type DetachLoadBalancerTargetGroupsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachLoadBalancerTargetGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancerTargetGroupsOutput) GoString() string { + return s.String() +} + +type DetachLoadBalancersInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The names of the load balancers. You can specify up to 10 load balancers. + // + // LoadBalancerNames is a required field + LoadBalancerNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s DetachLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachLoadBalancersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancersInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.LoadBalancerNames == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DetachLoadBalancersInput) SetAutoScalingGroupName(v string) *DetachLoadBalancersInput { + s.AutoScalingGroupName = &v + return s +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *DetachLoadBalancersInput) SetLoadBalancerNames(v []*string) *DetachLoadBalancersInput { + s.LoadBalancerNames = v + return s +} + +type DetachLoadBalancersOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancersOutput) GoString() string { + return s.String() +} + +type DisableMetricsCollectionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more of the following metrics. If you omit this parameter, all metrics + // are disabled. + // + // * GroupMinSize + // + // * GroupMaxSize + // + // * GroupDesiredCapacity + // + // * GroupInServiceInstances + // + // * GroupPendingInstances + // + // * GroupStandbyInstances + // + // * GroupTerminatingInstances + // + // * GroupTotalInstances + Metrics []*string `type:"list"` +} + +// String returns the string representation +func (s DisableMetricsCollectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableMetricsCollectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableMetricsCollectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableMetricsCollectionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DisableMetricsCollectionInput) SetAutoScalingGroupName(v string) *DisableMetricsCollectionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetMetrics sets the Metrics field's value. +func (s *DisableMetricsCollectionInput) SetMetrics(v []*string) *DisableMetricsCollectionInput { + s.Metrics = v + return s +} + +type DisableMetricsCollectionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisableMetricsCollectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableMetricsCollectionOutput) GoString() string { + return s.String() +} + +// Describes an Amazon EBS volume. +type Ebs struct { + _ struct{} `type:"structure"` + + // Indicates whether the volume is deleted on instance termination. The default + // is true. + DeleteOnTermination *bool `type:"boolean"` + + // Indicates whether the volume should be encrypted. Encrypted EBS volumes must + // 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 an unencrypted + // volume from an encrypted snapshot. 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 `type:"boolean"` + + // The number of I/O operations per second (IOPS) to provision for the volume. + // + // Constraint: Required when the volume type is io1. + Iops *int64 `min:"100" type:"integer"` + + // The ID of the snapshot. + SnapshotId *string `min:"1" type:"string"` + + // The volume size, in GiB. For standard volumes, specify a value from 1 to + // 1,024. For io1 volumes, specify a value from 4 to 16,384. For gp2 volumes, + // specify a value from 1 to 16,384. If you specify a snapshot, the volume size + // must be equal to or larger than the snapshot size. + // + // Default: If you create a volume from a snapshot and you don't specify a volume + // size, the default is the snapshot size. + VolumeSize *int64 `min:"1" type:"integer"` + + // The volume type. For more information, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. + // + // Valid values: standard | io1 | gp2 + VolumeType *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s Ebs) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ebs) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Ebs) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Ebs"} + if s.Iops != nil && *s.Iops < 100 { + invalidParams.Add(request.NewErrParamMinValue("Iops", 100)) + } + if s.SnapshotId != nil && len(*s.SnapshotId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SnapshotId", 1)) + } + if s.VolumeSize != nil && *s.VolumeSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("VolumeSize", 1)) + } + if s.VolumeType != nil && len(*s.VolumeType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VolumeType", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeleteOnTermination sets the DeleteOnTermination field's value. +func (s *Ebs) SetDeleteOnTermination(v bool) *Ebs { + s.DeleteOnTermination = &v + return s +} + +// SetEncrypted sets the Encrypted field's value. +func (s *Ebs) SetEncrypted(v bool) *Ebs { + s.Encrypted = &v + return s +} + +// SetIops sets the Iops field's value. +func (s *Ebs) SetIops(v int64) *Ebs { + s.Iops = &v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *Ebs) SetSnapshotId(v string) *Ebs { + s.SnapshotId = &v + return s +} + +// SetVolumeSize sets the VolumeSize field's value. +func (s *Ebs) SetVolumeSize(v int64) *Ebs { + s.VolumeSize = &v + return s +} + +// SetVolumeType sets the VolumeType field's value. +func (s *Ebs) SetVolumeType(v string) *Ebs { + s.VolumeType = &v + return s +} + +type EnableMetricsCollectionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The granularity to associate with the metrics to collect. The only valid + // value is 1Minute. + // + // Granularity is a required field + Granularity *string `min:"1" type:"string" required:"true"` + + // One or more of the following metrics. If you omit this parameter, all metrics + // are enabled. + // + // * GroupMinSize + // + // * GroupMaxSize + // + // * GroupDesiredCapacity + // + // * GroupInServiceInstances + // + // * GroupPendingInstances + // + // * GroupStandbyInstances + // + // * GroupTerminatingInstances + // + // * GroupTotalInstances + Metrics []*string `type:"list"` +} + +// String returns the string representation +func (s EnableMetricsCollectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableMetricsCollectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableMetricsCollectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableMetricsCollectionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.Granularity == nil { + invalidParams.Add(request.NewErrParamRequired("Granularity")) + } + if s.Granularity != nil && len(*s.Granularity) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Granularity", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *EnableMetricsCollectionInput) SetAutoScalingGroupName(v string) *EnableMetricsCollectionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetGranularity sets the Granularity field's value. +func (s *EnableMetricsCollectionInput) SetGranularity(v string) *EnableMetricsCollectionInput { + s.Granularity = &v + return s +} + +// SetMetrics sets the Metrics field's value. +func (s *EnableMetricsCollectionInput) SetMetrics(v []*string) *EnableMetricsCollectionInput { + s.Metrics = v + return s +} + +type EnableMetricsCollectionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s EnableMetricsCollectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableMetricsCollectionOutput) GoString() string { + return s.String() +} + +// Describes an enabled metric. +type EnabledMetric struct { + _ struct{} `type:"structure"` + + // The granularity of the metric. The only valid value is 1Minute. + Granularity *string `min:"1" type:"string"` + + // One of the following metrics: + // + // * GroupMinSize + // + // * GroupMaxSize + // + // * GroupDesiredCapacity + // + // * GroupInServiceInstances + // + // * GroupPendingInstances + // + // * GroupStandbyInstances + // + // * GroupTerminatingInstances + // + // * GroupTotalInstances + Metric *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s EnabledMetric) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnabledMetric) GoString() string { + return s.String() +} + +// SetGranularity sets the Granularity field's value. +func (s *EnabledMetric) SetGranularity(v string) *EnabledMetric { + s.Granularity = &v + return s +} + +// SetMetric sets the Metric field's value. +func (s *EnabledMetric) SetMetric(v string) *EnabledMetric { + s.Metric = &v + return s +} + +type EnterStandbyInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The IDs of the instances. You can specify up to 20 instances. + InstanceIds []*string `type:"list"` + + // Indicates whether to decrement the desired capacity of the Auto Scaling group + // by the number of instances moved to Standby mode. + // + // ShouldDecrementDesiredCapacity is a required field + ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s EnterStandbyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnterStandbyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnterStandbyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnterStandbyInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.ShouldDecrementDesiredCapacity == nil { + invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *EnterStandbyInput) SetAutoScalingGroupName(v string) *EnterStandbyInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *EnterStandbyInput) SetInstanceIds(v []*string) *EnterStandbyInput { + s.InstanceIds = v + return s +} + +// SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. +func (s *EnterStandbyInput) SetShouldDecrementDesiredCapacity(v bool) *EnterStandbyInput { + s.ShouldDecrementDesiredCapacity = &v + return s +} + +type EnterStandbyOutput struct { + _ struct{} `type:"structure"` + + // The activities related to moving instances into Standby mode. + Activities []*Activity `type:"list"` +} + +// String returns the string representation +func (s EnterStandbyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnterStandbyOutput) GoString() string { + return s.String() +} + +// SetActivities sets the Activities field's value. +func (s *EnterStandbyOutput) SetActivities(v []*Activity) *EnterStandbyOutput { + s.Activities = v + return s +} + +type ExecutePolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The breach threshold for the alarm. + // + // This parameter is required if the policy type is StepScaling and not supported + // otherwise. + BreachThreshold *float64 `type:"double"` + + // Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to + // complete before executing the policy. + // + // This parameter is not supported if the policy type is StepScaling. + // + // For more information, see Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // in the Amazon EC2 Auto Scaling User Guide. + HonorCooldown *bool `type:"boolean"` + + // The metric value to compare to BreachThreshold. This enables you to execute + // a policy of type StepScaling and determine which step adjustment to use. + // For example, if the breach threshold is 50 and you want to use a step adjustment + // with a lower bound of 0 and an upper bound of 10, you can set the metric + // value to 59. + // + // If you specify a metric value that doesn't correspond to a step adjustment + // for the policy, the call returns an error. + // + // This parameter is required if the policy type is StepScaling and not supported + // otherwise. + MetricValue *float64 `type:"double"` + + // The name or ARN of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ExecutePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ExecutePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExecutePolicyInput"} + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *ExecutePolicyInput) SetAutoScalingGroupName(v string) *ExecutePolicyInput { + s.AutoScalingGroupName = &v + return s +} + +// SetBreachThreshold sets the BreachThreshold field's value. +func (s *ExecutePolicyInput) SetBreachThreshold(v float64) *ExecutePolicyInput { + s.BreachThreshold = &v + return s +} + +// SetHonorCooldown sets the HonorCooldown field's value. +func (s *ExecutePolicyInput) SetHonorCooldown(v bool) *ExecutePolicyInput { + s.HonorCooldown = &v + return s +} + +// SetMetricValue sets the MetricValue field's value. +func (s *ExecutePolicyInput) SetMetricValue(v float64) *ExecutePolicyInput { + s.MetricValue = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *ExecutePolicyInput) SetPolicyName(v string) *ExecutePolicyInput { + s.PolicyName = &v + return s +} + +type ExecutePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ExecutePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutePolicyOutput) GoString() string { + return s.String() +} + +type ExitStandbyInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The IDs of the instances. You can specify up to 20 instances. + InstanceIds []*string `type:"list"` +} + +// String returns the string representation +func (s ExitStandbyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExitStandbyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ExitStandbyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExitStandbyInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *ExitStandbyInput) SetAutoScalingGroupName(v string) *ExitStandbyInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *ExitStandbyInput) SetInstanceIds(v []*string) *ExitStandbyInput { + s.InstanceIds = v + return s +} + +type ExitStandbyOutput struct { + _ struct{} `type:"structure"` + + // The activities related to moving instances out of Standby mode. + Activities []*Activity `type:"list"` +} + +// String returns the string representation +func (s ExitStandbyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExitStandbyOutput) GoString() string { + return s.String() +} + +// SetActivities sets the Activities field's value. +func (s *ExitStandbyOutput) SetActivities(v []*Activity) *ExitStandbyOutput { + s.Activities = v + return s +} + +// Describes a scheduled action that could not be created, updated, or deleted. +type FailedScheduledUpdateGroupActionRequest struct { + _ struct{} `type:"structure"` + + // The error code. + ErrorCode *string `min:"1" type:"string"` + + // The error message accompanying the error code. + ErrorMessage *string `type:"string"` + + // The name of the scheduled action. + // + // ScheduledActionName is a required field + ScheduledActionName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s FailedScheduledUpdateGroupActionRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FailedScheduledUpdateGroupActionRequest) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *FailedScheduledUpdateGroupActionRequest) SetErrorCode(v string) *FailedScheduledUpdateGroupActionRequest { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *FailedScheduledUpdateGroupActionRequest) SetErrorMessage(v string) *FailedScheduledUpdateGroupActionRequest { + s.ErrorMessage = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *FailedScheduledUpdateGroupActionRequest) SetScheduledActionName(v string) *FailedScheduledUpdateGroupActionRequest { + s.ScheduledActionName = &v + return s +} + +// Describes a filter. +type Filter struct { + _ struct{} `type:"structure"` + + // The name of the filter. The valid values are: "auto-scaling-group", "key", + // "value", and "propagate-at-launch". + Name *string `type:"string"` + + // The value of the filter. + Values []*string `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 Auto Scaling group. +type Group struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the Auto Scaling group. + AutoScalingGroupARN *string `min:"1" type:"string"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more Availability Zones for the group. + // + // AvailabilityZones is a required field + AvailabilityZones []*string `min:"1" type:"list" required:"true"` + + // The date and time the group was created. + // + // CreatedTime is a required field + CreatedTime *time.Time `type:"timestamp" required:"true"` + + // The amount of time, in seconds, after a scaling activity completes before + // another scaling activity can start. + // + // DefaultCooldown is a required field + DefaultCooldown *int64 `type:"integer" required:"true"` + + // The desired size of the group. + // + // DesiredCapacity is a required field + DesiredCapacity *int64 `type:"integer" required:"true"` + + // The metrics enabled for the group. + EnabledMetrics []*EnabledMetric `type:"list"` + + // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before + // checking the health status of an EC2 instance that has come into service. + HealthCheckGracePeriod *int64 `type:"integer"` + + // The service to use for the health checks. The valid values are EC2 and ELB. + // + // HealthCheckType is a required field + HealthCheckType *string `min:"1" type:"string" required:"true"` + + // The EC2 instances associated with the group. + Instances []*Instance `type:"list"` + + // The name of the associated launch configuration. + LaunchConfigurationName *string `min:"1" type:"string"` + + // The launch template for the group. + LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + + // One or more load balancers associated with the group. + LoadBalancerNames []*string `type:"list"` + + // The maximum size of the group. + // + // MaxSize is a required field + MaxSize *int64 `type:"integer" required:"true"` + + // The minimum size of the group. + // + // MinSize is a required field + MinSize *int64 `type:"integer" required:"true"` + + // Indicates whether newly launched instances are protected from termination + // by Auto Scaling when scaling in. + NewInstancesProtectedFromScaleIn *bool `type:"boolean"` + + // The name of the placement group into which you'll launch your instances, + // if any. 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. + PlacementGroup *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling + // group uses to call other AWS services on your behalf. + ServiceLinkedRoleARN *string `min:"1" type:"string"` + + // The current state of the group when DeleteAutoScalingGroup is in progress. + Status *string `min:"1" type:"string"` + + // The suspended processes associated with the group. + SuspendedProcesses []*SuspendedProcess `type:"list"` + + // The tags for the group. + Tags []*TagDescription `type:"list"` + + // The Amazon Resource Names (ARN) of the target groups for your load balancer. + TargetGroupARNs []*string `type:"list"` + + // The termination policies for the group. + TerminationPolicies []*string `type:"list"` + + // One or more subnet IDs, if applicable, separated by commas. + // + // If you specify VPCZoneIdentifier and AvailabilityZones, ensure that the Availability + // Zones of the subnets match the values for AvailabilityZones. + VPCZoneIdentifier *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s Group) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Group) GoString() string { + return s.String() +} + +// SetAutoScalingGroupARN sets the AutoScalingGroupARN field's value. +func (s *Group) SetAutoScalingGroupARN(v string) *Group { + s.AutoScalingGroupARN = &v + return s +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *Group) SetAutoScalingGroupName(v string) *Group { + s.AutoScalingGroupName = &v + return s +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *Group) SetAvailabilityZones(v []*string) *Group { + s.AvailabilityZones = v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *Group) SetCreatedTime(v time.Time) *Group { + s.CreatedTime = &v + return s +} + +// SetDefaultCooldown sets the DefaultCooldown field's value. +func (s *Group) SetDefaultCooldown(v int64) *Group { + s.DefaultCooldown = &v + return s +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *Group) SetDesiredCapacity(v int64) *Group { + s.DesiredCapacity = &v + return s +} + +// SetEnabledMetrics sets the EnabledMetrics field's value. +func (s *Group) SetEnabledMetrics(v []*EnabledMetric) *Group { + s.EnabledMetrics = v + return s +} + +// SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value. +func (s *Group) SetHealthCheckGracePeriod(v int64) *Group { + s.HealthCheckGracePeriod = &v + return s +} + +// SetHealthCheckType sets the HealthCheckType field's value. +func (s *Group) SetHealthCheckType(v string) *Group { + s.HealthCheckType = &v + return s +} + +// SetInstances sets the Instances field's value. +func (s *Group) SetInstances(v []*Instance) *Group { + s.Instances = v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *Group) SetLaunchConfigurationName(v string) *Group { + s.LaunchConfigurationName = &v + return s +} + +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *Group) SetLaunchTemplate(v *LaunchTemplateSpecification) *Group { + s.LaunchTemplate = v + return s +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *Group) SetLoadBalancerNames(v []*string) *Group { + s.LoadBalancerNames = v + return s +} + +// SetMaxSize sets the MaxSize field's value. +func (s *Group) SetMaxSize(v int64) *Group { + s.MaxSize = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *Group) SetMinSize(v int64) *Group { + s.MinSize = &v + return s +} + +// SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value. +func (s *Group) SetNewInstancesProtectedFromScaleIn(v bool) *Group { + s.NewInstancesProtectedFromScaleIn = &v + return s +} + +// SetPlacementGroup sets the PlacementGroup field's value. +func (s *Group) SetPlacementGroup(v string) *Group { + s.PlacementGroup = &v + return s +} + +// SetServiceLinkedRoleARN sets the ServiceLinkedRoleARN field's value. +func (s *Group) SetServiceLinkedRoleARN(v string) *Group { + s.ServiceLinkedRoleARN = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Group) SetStatus(v string) *Group { + s.Status = &v + return s +} + +// SetSuspendedProcesses sets the SuspendedProcesses field's value. +func (s *Group) SetSuspendedProcesses(v []*SuspendedProcess) *Group { + s.SuspendedProcesses = v + return s +} + +// SetTags sets the Tags field's value. +func (s *Group) SetTags(v []*TagDescription) *Group { + s.Tags = v + return s +} + +// SetTargetGroupARNs sets the TargetGroupARNs field's value. +func (s *Group) SetTargetGroupARNs(v []*string) *Group { + s.TargetGroupARNs = v + return s +} + +// SetTerminationPolicies sets the TerminationPolicies field's value. +func (s *Group) SetTerminationPolicies(v []*string) *Group { + s.TerminationPolicies = v + return s +} + +// SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value. +func (s *Group) SetVPCZoneIdentifier(v string) *Group { + s.VPCZoneIdentifier = &v + return s +} + +// Describes an EC2 instance. +type Instance struct { + _ struct{} `type:"structure"` + + // The Availability Zone in which the instance is running. + // + // AvailabilityZone is a required field + AvailabilityZone *string `min:"1" type:"string" required:"true"` + + // The last reported health status of the instance. "Healthy" means that the + // instance is healthy and should remain in service. "Unhealthy" means that + // the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and + // replace it. + // + // HealthStatus is a required field + HealthStatus *string `min:"1" type:"string" required:"true"` + + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `min:"1" type:"string" required:"true"` + + // The launch configuration associated with the instance. + LaunchConfigurationName *string `min:"1" type:"string"` + + // The launch template for the instance. + LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + + // A description of the current lifecycle state. Note that the Quarantined state + // is not used. + // + // LifecycleState is a required field + LifecycleState *string `type:"string" required:"true" enum:"LifecycleState"` + + // Indicates whether the instance is protected from termination by Amazon EC2 + // Auto Scaling when scaling in. + // + // ProtectedFromScaleIn is a required field + ProtectedFromScaleIn *bool `type:"boolean" required:"true"` +} + +// 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() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *Instance) SetAvailabilityZone(v string) *Instance { + s.AvailabilityZone = &v + return s +} + +// SetHealthStatus sets the HealthStatus field's value. +func (s *Instance) SetHealthStatus(v string) *Instance { + s.HealthStatus = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *Instance) SetInstanceId(v string) *Instance { + s.InstanceId = &v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *Instance) SetLaunchConfigurationName(v string) *Instance { + s.LaunchConfigurationName = &v + return s +} + +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *Instance) SetLaunchTemplate(v *LaunchTemplateSpecification) *Instance { + s.LaunchTemplate = v + return s +} + +// SetLifecycleState sets the LifecycleState field's value. +func (s *Instance) SetLifecycleState(v string) *Instance { + s.LifecycleState = &v + return s +} + +// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. +func (s *Instance) SetProtectedFromScaleIn(v bool) *Instance { + s.ProtectedFromScaleIn = &v + return s +} + +// Describes an EC2 instance associated with an Auto Scaling group. +type InstanceDetails struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group for the instance. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The Availability Zone for the instance. + // + // AvailabilityZone is a required field + AvailabilityZone *string `min:"1" type:"string" required:"true"` + + // The last reported health status of this instance. "Healthy" means that the + // instance is healthy and should remain in service. "Unhealthy" means that + // the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and + // replace it. + // + // HealthStatus is a required field + HealthStatus *string `min:"1" type:"string" required:"true"` + + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `min:"1" type:"string" required:"true"` + + // The launch configuration used to launch the instance. This value is not available + // if you attached the instance to the Auto Scaling group. + LaunchConfigurationName *string `min:"1" type:"string"` + + // The launch template for the instance. + LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + + // The lifecycle state for the instance. For more information, see Auto Scaling + // Lifecycle (http://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // LifecycleState is a required field + LifecycleState *string `min:"1" type:"string" required:"true"` + + // Indicates whether the instance is protected from termination by Amazon EC2 + // Auto Scaling when scaling in. + // + // ProtectedFromScaleIn is a required field + ProtectedFromScaleIn *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s InstanceDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceDetails) GoString() string { + return s.String() +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *InstanceDetails) SetAutoScalingGroupName(v string) *InstanceDetails { + s.AutoScalingGroupName = &v + return s +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *InstanceDetails) SetAvailabilityZone(v string) *InstanceDetails { + s.AvailabilityZone = &v + return s +} + +// SetHealthStatus sets the HealthStatus field's value. +func (s *InstanceDetails) SetHealthStatus(v string) *InstanceDetails { + s.HealthStatus = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *InstanceDetails) SetInstanceId(v string) *InstanceDetails { + s.InstanceId = &v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *InstanceDetails) SetLaunchConfigurationName(v string) *InstanceDetails { + s.LaunchConfigurationName = &v + return s +} + +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *InstanceDetails) SetLaunchTemplate(v *LaunchTemplateSpecification) *InstanceDetails { + s.LaunchTemplate = v + return s +} + +// SetLifecycleState sets the LifecycleState field's value. +func (s *InstanceDetails) SetLifecycleState(v string) *InstanceDetails { + s.LifecycleState = &v + return s +} + +// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. +func (s *InstanceDetails) SetProtectedFromScaleIn(v bool) *InstanceDetails { + s.ProtectedFromScaleIn = &v + return s +} + +// Describes whether detailed monitoring is enabled for the Auto Scaling instances. +type InstanceMonitoring struct { + _ struct{} `type:"structure"` + + // If true, detailed monitoring is enabled. Otherwise, basic monitoring is enabled. + Enabled *bool `type:"boolean"` +} + +// 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() +} + +// SetEnabled sets the Enabled field's value. +func (s *InstanceMonitoring) SetEnabled(v bool) *InstanceMonitoring { + s.Enabled = &v + return s +} + +// Describes a launch configuration. +type LaunchConfiguration struct { + _ struct{} `type:"structure"` + + // [EC2-VPC] Indicates whether to assign a public IP address to each instance. + AssociatePublicIpAddress *bool `type:"boolean"` + + // A block device mapping, which specifies the block devices for the instance. + BlockDeviceMappings []*BlockDeviceMapping `type:"list"` + + // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. + // This parameter can only be used if you are launching EC2-Classic instances. + // For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClassicLinkVPCId *string `min:"1" type:"string"` + + // The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. + // This parameter is required if you specify a ClassicLink-enabled VPC, and + // cannot be used otherwise. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClassicLinkVPCSecurityGroups []*string `type:"list"` + + // The creation date and time for the launch configuration. + // + // CreatedTime is a required field + CreatedTime *time.Time `type:"timestamp" required:"true"` + + // Controls whether the instance is optimized for EBS I/O (true) or not (false). + EbsOptimized *bool `type:"boolean"` + + // The name or Amazon Resource Name (ARN) of the instance profile associated + // with the IAM role for the instance. + IamInstanceProfile *string `min:"1" type:"string"` + + // The ID of the Amazon Machine Image (AMI). + // + // ImageId is a required field + ImageId *string `min:"1" type:"string" required:"true"` + + // Controls whether instances in this group are launched with detailed (true) + // or basic (false) monitoring. + InstanceMonitoring *InstanceMonitoring `type:"structure"` + + // The instance type for the instances. + // + // InstanceType is a required field + InstanceType *string `min:"1" type:"string" required:"true"` + + // The ID of the kernel associated with the AMI. + KernelId *string `min:"1" type:"string"` + + // The name of the key pair. + KeyName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the launch configuration. + LaunchConfigurationARN *string `min:"1" type:"string"` + + // The name of the launch configuration. + // + // LaunchConfigurationName is a required field + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` + + // The tenancy of the instance, either default or dedicated. An instance with + // dedicated tenancy runs in an isolated, single-tenant hardware and can only + // be launched into a VPC. + PlacementTenancy *string `min:"1" type:"string"` + + // The ID of the RAM disk associated with the AMI. + RamdiskId *string `min:"1" type:"string"` + + // The security groups to associate with the instances. + SecurityGroups []*string `type:"list"` + + // The price to bid when launching Spot Instances. + SpotPrice *string `min:"1" type:"string"` + + // The user data available to the instances. + UserData *string `type:"string"` +} + +// String returns the string representation +func (s LaunchConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchConfiguration) GoString() string { + return s.String() +} + +// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. +func (s *LaunchConfiguration) SetAssociatePublicIpAddress(v bool) *LaunchConfiguration { + s.AssociatePublicIpAddress = &v + return s +} + +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *LaunchConfiguration) SetBlockDeviceMappings(v []*BlockDeviceMapping) *LaunchConfiguration { + s.BlockDeviceMappings = v + return s +} + +// SetClassicLinkVPCId sets the ClassicLinkVPCId field's value. +func (s *LaunchConfiguration) SetClassicLinkVPCId(v string) *LaunchConfiguration { + s.ClassicLinkVPCId = &v + return s +} + +// SetClassicLinkVPCSecurityGroups sets the ClassicLinkVPCSecurityGroups field's value. +func (s *LaunchConfiguration) SetClassicLinkVPCSecurityGroups(v []*string) *LaunchConfiguration { + s.ClassicLinkVPCSecurityGroups = v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *LaunchConfiguration) SetCreatedTime(v time.Time) *LaunchConfiguration { + s.CreatedTime = &v + return s +} + +// SetEbsOptimized sets the EbsOptimized field's value. +func (s *LaunchConfiguration) SetEbsOptimized(v bool) *LaunchConfiguration { + s.EbsOptimized = &v + return s +} + +// SetIamInstanceProfile sets the IamInstanceProfile field's value. +func (s *LaunchConfiguration) SetIamInstanceProfile(v string) *LaunchConfiguration { + s.IamInstanceProfile = &v + return s +} + +// SetImageId sets the ImageId field's value. +func (s *LaunchConfiguration) SetImageId(v string) *LaunchConfiguration { + s.ImageId = &v + return s +} + +// SetInstanceMonitoring sets the InstanceMonitoring field's value. +func (s *LaunchConfiguration) SetInstanceMonitoring(v *InstanceMonitoring) *LaunchConfiguration { + s.InstanceMonitoring = v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *LaunchConfiguration) SetInstanceType(v string) *LaunchConfiguration { + s.InstanceType = &v + return s +} + +// SetKernelId sets the KernelId field's value. +func (s *LaunchConfiguration) SetKernelId(v string) *LaunchConfiguration { + s.KernelId = &v + return s +} + +// SetKeyName sets the KeyName field's value. +func (s *LaunchConfiguration) SetKeyName(v string) *LaunchConfiguration { + s.KeyName = &v + return s +} + +// SetLaunchConfigurationARN sets the LaunchConfigurationARN field's value. +func (s *LaunchConfiguration) SetLaunchConfigurationARN(v string) *LaunchConfiguration { + s.LaunchConfigurationARN = &v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *LaunchConfiguration) SetLaunchConfigurationName(v string) *LaunchConfiguration { + s.LaunchConfigurationName = &v + return s +} + +// SetPlacementTenancy sets the PlacementTenancy field's value. +func (s *LaunchConfiguration) SetPlacementTenancy(v string) *LaunchConfiguration { + s.PlacementTenancy = &v + return s +} + +// SetRamdiskId sets the RamdiskId field's value. +func (s *LaunchConfiguration) SetRamdiskId(v string) *LaunchConfiguration { + s.RamdiskId = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *LaunchConfiguration) SetSecurityGroups(v []*string) *LaunchConfiguration { + s.SecurityGroups = v + return s +} + +// SetSpotPrice sets the SpotPrice field's value. +func (s *LaunchConfiguration) SetSpotPrice(v string) *LaunchConfiguration { + s.SpotPrice = &v + return s +} + +// SetUserData sets the UserData field's value. +func (s *LaunchConfiguration) SetUserData(v string) *LaunchConfiguration { + s.UserData = &v + return s +} + +// Describes a launch template. +type LaunchTemplateSpecification struct { + _ struct{} `type:"structure"` + + // The ID of the launch template. You must specify either a template ID or a + // template name. + LaunchTemplateId *string `min:"1" type:"string"` + + // The name of the launch template. You must specify either a template name + // or a template ID. + LaunchTemplateName *string `min:"3" type:"string"` + + // The version number, $Latest, or $Default. If the value is $Latest, Amazon + // EC2 Auto Scaling selects the latest version of the launch template when launching + // instances. If the value is $Default, Amazon EC2 Auto Scaling selects the + // default version of the launch template when launching instances. The default + // value is $Default. + Version *string `min:"1" 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LaunchTemplateSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LaunchTemplateSpecification"} + if s.LaunchTemplateId != nil && len(*s.LaunchTemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateId", 1)) + } + if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) + } + if s.Version != nil && len(*s.Version) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Version", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// 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 +} + +// Describes a lifecycle hook, which tells Amazon EC2 Auto Scaling that you +// want to perform an action whenever it launches instances or whenever it terminates +// instances. +// +// For more information, see Lifecycle Hooks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// in the Amazon EC2 Auto Scaling User Guide. +type LifecycleHook struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group for the lifecycle hook. + AutoScalingGroupName *string `min:"1" type:"string"` + + // Defines the action the Auto Scaling group should take when the lifecycle + // hook timeout elapses or if an unexpected failure occurs. The valid values + // are CONTINUE and ABANDON. The default value is CONTINUE. + DefaultResult *string `type:"string"` + + // The maximum time, in seconds, that an instance can remain in a Pending:Wait + // or Terminating:Wait state. The maximum is 172800 seconds (48 hours) or 100 + // times HeartbeatTimeout, whichever is smaller. + GlobalTimeout *int64 `type:"integer"` + + // The maximum time, in seconds, that can elapse before the lifecycle hook times + // out. If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the + // default action. You can prevent the lifecycle hook from timing out by calling + // RecordLifecycleActionHeartbeat. + HeartbeatTimeout *int64 `type:"integer"` + + // The name of the lifecycle hook. + LifecycleHookName *string `min:"1" type:"string"` + + // The state of the EC2 instance to which you want to attach the lifecycle hook. + // The following are possible values: + // + // * autoscaling:EC2_INSTANCE_LAUNCHING + // + // * autoscaling:EC2_INSTANCE_TERMINATING + LifecycleTransition *string `type:"string"` + + // Additional information that you want to include any time Amazon EC2 Auto + // Scaling sends a message to the notification target. + NotificationMetadata *string `min:"1" type:"string"` + + // The ARN of the target that Amazon EC2 Auto Scaling sends notifications to + // when an instance is in the transition state for the lifecycle hook. The notification + // target can be either an SQS queue or an SNS topic. + NotificationTargetARN *string `min:"1" type:"string"` + + // The ARN of the IAM role that allows the Auto Scaling group to publish to + // the specified notification target. + RoleARN *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s LifecycleHook) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleHook) GoString() string { + return s.String() +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *LifecycleHook) SetAutoScalingGroupName(v string) *LifecycleHook { + s.AutoScalingGroupName = &v + return s +} + +// SetDefaultResult sets the DefaultResult field's value. +func (s *LifecycleHook) SetDefaultResult(v string) *LifecycleHook { + s.DefaultResult = &v + return s +} + +// SetGlobalTimeout sets the GlobalTimeout field's value. +func (s *LifecycleHook) SetGlobalTimeout(v int64) *LifecycleHook { + s.GlobalTimeout = &v + return s +} + +// SetHeartbeatTimeout sets the HeartbeatTimeout field's value. +func (s *LifecycleHook) SetHeartbeatTimeout(v int64) *LifecycleHook { + s.HeartbeatTimeout = &v + return s +} + +// SetLifecycleHookName sets the LifecycleHookName field's value. +func (s *LifecycleHook) SetLifecycleHookName(v string) *LifecycleHook { + s.LifecycleHookName = &v + return s +} + +// SetLifecycleTransition sets the LifecycleTransition field's value. +func (s *LifecycleHook) SetLifecycleTransition(v string) *LifecycleHook { + s.LifecycleTransition = &v + return s +} + +// SetNotificationMetadata sets the NotificationMetadata field's value. +func (s *LifecycleHook) SetNotificationMetadata(v string) *LifecycleHook { + s.NotificationMetadata = &v + return s +} + +// SetNotificationTargetARN sets the NotificationTargetARN field's value. +func (s *LifecycleHook) SetNotificationTargetARN(v string) *LifecycleHook { + s.NotificationTargetARN = &v + return s +} + +// SetRoleARN sets the RoleARN field's value. +func (s *LifecycleHook) SetRoleARN(v string) *LifecycleHook { + s.RoleARN = &v + return s +} + +// Describes a lifecycle hook, which tells Amazon EC2 Auto Scaling that you +// want to perform an action whenever it launches instances or whenever it terminates +// instances. +// +// For more information, see Lifecycle Hooks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// in the Amazon EC2 Auto Scaling User Guide. +type LifecycleHookSpecification struct { + _ struct{} `type:"structure"` + + // Defines the action the Auto Scaling group should take when the lifecycle + // hook timeout elapses or if an unexpected failure occurs. The valid values + // are CONTINUE and ABANDON. + DefaultResult *string `type:"string"` + + // The maximum time, in seconds, that can elapse before the lifecycle hook times + // out. If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the + // default action. You can prevent the lifecycle hook from timing out by calling + // RecordLifecycleActionHeartbeat. + HeartbeatTimeout *int64 `type:"integer"` + + // The name of the lifecycle hook. + // + // LifecycleHookName is a required field + LifecycleHookName *string `min:"1" type:"string" required:"true"` + + // The state of the EC2 instance to which you want to attach the lifecycle hook. + // The possible values are: + // + // * autoscaling:EC2_INSTANCE_LAUNCHING + // + // * autoscaling:EC2_INSTANCE_TERMINATING + // + // LifecycleTransition is a required field + LifecycleTransition *string `type:"string" required:"true"` + + // Additional information that you want to include any time Amazon EC2 Auto + // Scaling sends a message to the notification target. + NotificationMetadata *string `min:"1" type:"string"` + + // The ARN of the target that Amazon EC2 Auto Scaling sends notifications to + // when an instance is in the transition state for the lifecycle hook. The notification + // target can be either an SQS queue or an SNS topic. + NotificationTargetARN *string `type:"string"` + + // The ARN of the IAM role that allows the Auto Scaling group to publish to + // the specified notification target. + RoleARN *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s LifecycleHookSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleHookSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LifecycleHookSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LifecycleHookSpecification"} + if s.LifecycleHookName == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) + } + if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) + } + if s.LifecycleTransition == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleTransition")) + } + if s.NotificationMetadata != nil && len(*s.NotificationMetadata) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NotificationMetadata", 1)) + } + if s.RoleARN != nil && len(*s.RoleARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDefaultResult sets the DefaultResult field's value. +func (s *LifecycleHookSpecification) SetDefaultResult(v string) *LifecycleHookSpecification { + s.DefaultResult = &v + return s +} + +// SetHeartbeatTimeout sets the HeartbeatTimeout field's value. +func (s *LifecycleHookSpecification) SetHeartbeatTimeout(v int64) *LifecycleHookSpecification { + s.HeartbeatTimeout = &v + return s +} + +// SetLifecycleHookName sets the LifecycleHookName field's value. +func (s *LifecycleHookSpecification) SetLifecycleHookName(v string) *LifecycleHookSpecification { + s.LifecycleHookName = &v + return s +} + +// SetLifecycleTransition sets the LifecycleTransition field's value. +func (s *LifecycleHookSpecification) SetLifecycleTransition(v string) *LifecycleHookSpecification { + s.LifecycleTransition = &v + return s +} + +// SetNotificationMetadata sets the NotificationMetadata field's value. +func (s *LifecycleHookSpecification) SetNotificationMetadata(v string) *LifecycleHookSpecification { + s.NotificationMetadata = &v + return s +} + +// SetNotificationTargetARN sets the NotificationTargetARN field's value. +func (s *LifecycleHookSpecification) SetNotificationTargetARN(v string) *LifecycleHookSpecification { + s.NotificationTargetARN = &v + return s +} + +// SetRoleARN sets the RoleARN field's value. +func (s *LifecycleHookSpecification) SetRoleARN(v string) *LifecycleHookSpecification { + s.RoleARN = &v + return s +} + +// Describes the state of a Classic Load Balancer. +// +// If you specify a load balancer when creating the Auto Scaling group, the +// state of the load balancer is InService. +// +// If you attach a load balancer to an existing Auto Scaling group, the initial +// state is Adding. The state transitions to Added after all instances in the +// group are registered with the load balancer. If ELB health checks are enabled +// for the load balancer, the state transitions to InService after at least +// one instance in the group passes the health check. If EC2 health checks are +// enabled instead, the load balancer remains in the Added state. +type LoadBalancerState struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + LoadBalancerName *string `min:"1" type:"string"` + + // One of the following load balancer states: + // + // * Adding - The instances in the group are being registered with the load + // balancer. + // + // * Added - All instances in the group are registered with the load balancer. + // + // * InService - At least one instance in the group passed an ELB health + // check. + // + // * Removing - The instances in the group are being deregistered from the + // load balancer. If connection draining is enabled, Elastic Load Balancing + // waits for in-flight requests to complete before deregistering the instances. + // + // * Removed - All instances in the group are deregistered from the load + // balancer. + State *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s LoadBalancerState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerState) GoString() string { + return s.String() +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *LoadBalancerState) SetLoadBalancerName(v string) *LoadBalancerState { + s.LoadBalancerName = &v + return s +} + +// SetState sets the State field's value. +func (s *LoadBalancerState) SetState(v string) *LoadBalancerState { + s.State = &v + return s +} + +// Describes the state of a target group. +// +// If you attach a target group to an existing Auto Scaling group, the initial +// state is Adding. The state transitions to Added after all Auto Scaling instances +// are registered with the target group. If ELB health checks are enabled, the +// state transitions to InService after at least one Auto Scaling instance passes +// the health check. If EC2 health checks are enabled instead, the target group +// remains in the Added state. +type LoadBalancerTargetGroupState struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + LoadBalancerTargetGroupARN *string `min:"1" type:"string"` + + // The state of the target group. + // + // * Adding - The Auto Scaling instances are being registered with the target + // group. + // + // * Added - All Auto Scaling instances are registered with the target group. + // + // * InService - At least one Auto Scaling instance passed an ELB health + // check. + // + // * Removing - The Auto Scaling instances are being deregistered from the + // target group. If connection draining is enabled, Elastic Load Balancing + // waits for in-flight requests to complete before deregistering the instances. + // + // * Removed - All Auto Scaling instances are deregistered from the target + // group. + State *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s LoadBalancerTargetGroupState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerTargetGroupState) GoString() string { + return s.String() +} + +// SetLoadBalancerTargetGroupARN sets the LoadBalancerTargetGroupARN field's value. +func (s *LoadBalancerTargetGroupState) SetLoadBalancerTargetGroupARN(v string) *LoadBalancerTargetGroupState { + s.LoadBalancerTargetGroupARN = &v + return s +} + +// SetState sets the State field's value. +func (s *LoadBalancerTargetGroupState) SetState(v string) *LoadBalancerTargetGroupState { + s.State = &v + return s +} + +// Describes a metric. +type MetricCollectionType struct { + _ struct{} `type:"structure"` + + // One of the following metrics: + // + // * GroupMinSize + // + // * GroupMaxSize + // + // * GroupDesiredCapacity + // + // * GroupInServiceInstances + // + // * GroupPendingInstances + // + // * GroupStandbyInstances + // + // * GroupTerminatingInstances + // + // * GroupTotalInstances + Metric *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s MetricCollectionType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricCollectionType) GoString() string { + return s.String() +} + +// SetMetric sets the Metric field's value. +func (s *MetricCollectionType) SetMetric(v string) *MetricCollectionType { + s.Metric = &v + return s +} + +// Describes the dimension of a metric. +type MetricDimension struct { + _ struct{} `type:"structure"` + + // The name of the dimension. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The value of the dimension. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s MetricDimension) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricDimension) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MetricDimension) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MetricDimension"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *MetricDimension) SetName(v string) *MetricDimension { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *MetricDimension) SetValue(v string) *MetricDimension { + s.Value = &v + return s +} + +// Describes a granularity of a metric. +type MetricGranularityType struct { + _ struct{} `type:"structure"` + + // The granularity. The only valid value is 1Minute. + Granularity *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s MetricGranularityType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricGranularityType) GoString() string { + return s.String() +} + +// SetGranularity sets the Granularity field's value. +func (s *MetricGranularityType) SetGranularity(v string) *MetricGranularityType { + s.Granularity = &v + return s +} + +// Describes a notification. +type NotificationConfiguration struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // One of the following event notification types: + // + // * autoscaling:EC2_INSTANCE_LAUNCH + // + // * autoscaling:EC2_INSTANCE_LAUNCH_ERROR + // + // * autoscaling:EC2_INSTANCE_TERMINATE + // + // * autoscaling:EC2_INSTANCE_TERMINATE_ERROR + // + // * autoscaling:TEST_NOTIFICATION + NotificationType *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service + // (SNS) topic. + TopicARN *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s NotificationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotificationConfiguration) GoString() string { + return s.String() +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *NotificationConfiguration) SetAutoScalingGroupName(v string) *NotificationConfiguration { + s.AutoScalingGroupName = &v + return s +} + +// SetNotificationType sets the NotificationType field's value. +func (s *NotificationConfiguration) SetNotificationType(v string) *NotificationConfiguration { + s.NotificationType = &v + return s +} + +// SetTopicARN sets the TopicARN field's value. +func (s *NotificationConfiguration) SetTopicARN(v string) *NotificationConfiguration { + s.TopicARN = &v + return s +} + +// Configures a predefined metric for a target tracking policy. +type PredefinedMetricSpecification struct { + _ struct{} `type:"structure"` + + // The metric type. + // + // PredefinedMetricType is a required field + PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` + + // Identifies the resource associated with the metric type. The following predefined + // metrics are available: + // + // * ASGAverageCPUUtilization - average CPU utilization of the Auto Scaling + // group + // + // * ASGAverageNetworkIn - average number of bytes received on all network + // interfaces by the Auto Scaling group + // + // * ASGAverageNetworkOut - average number of bytes sent out on all network + // interfaces by the Auto Scaling group + // + // * ALBRequestCountPerTarget - number of requests completed per target in + // an Application Load Balancer target group + // + // For predefined metric types ASGAverageCPUUtilization, ASGAverageNetworkIn, + // and ASGAverageNetworkOut, the parameter must not be specified as the resource + // associated with the metric type is the Auto Scaling group. For predefined + // metric type ALBRequestCountPerTarget, the parameter must be specified in + // the format: app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id, + // where app/load-balancer-name/load-balancer-id is the final portion of the + // load balancer ARN, and targetgroup/target-group-name/target-group-id is the + // final portion of the target group ARN. The target group must be attached + // to the Auto Scaling group. + ResourceLabel *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PredefinedMetricSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredefinedMetricSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PredefinedMetricSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredefinedMetricSpecification"} + if s.PredefinedMetricType == nil { + invalidParams.Add(request.NewErrParamRequired("PredefinedMetricType")) + } + if s.ResourceLabel != nil && len(*s.ResourceLabel) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceLabel", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPredefinedMetricType sets the PredefinedMetricType field's value. +func (s *PredefinedMetricSpecification) SetPredefinedMetricType(v string) *PredefinedMetricSpecification { + s.PredefinedMetricType = &v + return s +} + +// SetResourceLabel sets the ResourceLabel field's value. +func (s *PredefinedMetricSpecification) SetResourceLabel(v string) *PredefinedMetricSpecification { + s.ResourceLabel = &v + return s +} + +// Describes a process type. +// +// For more information, see Scaling Processes (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types) +// in the Amazon EC2 Auto Scaling User Guide. +type ProcessType struct { + _ struct{} `type:"structure"` + + // One of the following processes: + // + // * Launch + // + // * Terminate + // + // * AddToLoadBalancer + // + // * AlarmNotification + // + // * AZRebalance + // + // * HealthCheck + // + // * ReplaceUnhealthy + // + // * ScheduledActions + // + // ProcessName is a required field + ProcessName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ProcessType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProcessType) GoString() string { + return s.String() +} + +// SetProcessName sets the ProcessName field's value. +func (s *ProcessType) SetProcessName(v string) *ProcessType { + s.ProcessName = &v + return s +} + +type PutLifecycleHookInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // Defines the action the Auto Scaling group should take when the lifecycle + // hook timeout elapses or if an unexpected failure occurs. This parameter can + // be either CONTINUE or ABANDON. The default value is ABANDON. + DefaultResult *string `type:"string"` + + // The maximum time, in seconds, that can elapse before the lifecycle hook times + // out. The range is from 30 to 7200 seconds. The default is 3600 seconds (1 + // hour). + // + // If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the default + // action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. + HeartbeatTimeout *int64 `type:"integer"` + + // The name of the lifecycle hook. + // + // LifecycleHookName is a required field + LifecycleHookName *string `min:"1" type:"string" required:"true"` + + // The instance state to which you want to attach the lifecycle hook. The possible + // values are: + // + // * autoscaling:EC2_INSTANCE_LAUNCHING + // + // * autoscaling:EC2_INSTANCE_TERMINATING + // + // This parameter is required for new lifecycle hooks, but optional when updating + // existing hooks. + LifecycleTransition *string `type:"string"` + + // Contains additional information that you want to include any time Amazon + // EC2 Auto Scaling sends a message to the notification target. + NotificationMetadata *string `min:"1" type:"string"` + + // The ARN of the notification target that Amazon EC2 Auto Scaling will use + // to notify you when an instance is in the transition state for the lifecycle + // hook. This target can be either an SQS queue or an SNS topic. If you specify + // an empty string, this overrides the current ARN. + // + // This operation uses the JSON format when sending notifications to an Amazon + // SQS queue, and an email key/value pair format when sending notifications + // to an Amazon SNS topic. + // + // When you specify a notification target, Amazon EC2 Auto Scaling sends it + // a test message. Test messages contains the following additional key/value + // pair: "Event": "autoscaling:TEST_NOTIFICATION". + NotificationTargetARN *string `type:"string"` + + // The ARN of the IAM role that allows the Auto Scaling group to publish to + // the specified notification target. + // + // This parameter is required for new lifecycle hooks, but optional when updating + // existing hooks. + RoleARN *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutLifecycleHookInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLifecycleHookInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutLifecycleHookInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutLifecycleHookInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.LifecycleHookName == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) + } + if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) + } + if s.NotificationMetadata != nil && len(*s.NotificationMetadata) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NotificationMetadata", 1)) + } + if s.RoleARN != nil && len(*s.RoleARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *PutLifecycleHookInput) SetAutoScalingGroupName(v string) *PutLifecycleHookInput { + s.AutoScalingGroupName = &v + return s +} + +// SetDefaultResult sets the DefaultResult field's value. +func (s *PutLifecycleHookInput) SetDefaultResult(v string) *PutLifecycleHookInput { + s.DefaultResult = &v + return s +} + +// SetHeartbeatTimeout sets the HeartbeatTimeout field's value. +func (s *PutLifecycleHookInput) SetHeartbeatTimeout(v int64) *PutLifecycleHookInput { + s.HeartbeatTimeout = &v + return s +} + +// SetLifecycleHookName sets the LifecycleHookName field's value. +func (s *PutLifecycleHookInput) SetLifecycleHookName(v string) *PutLifecycleHookInput { + s.LifecycleHookName = &v + return s +} + +// SetLifecycleTransition sets the LifecycleTransition field's value. +func (s *PutLifecycleHookInput) SetLifecycleTransition(v string) *PutLifecycleHookInput { + s.LifecycleTransition = &v + return s +} + +// SetNotificationMetadata sets the NotificationMetadata field's value. +func (s *PutLifecycleHookInput) SetNotificationMetadata(v string) *PutLifecycleHookInput { + s.NotificationMetadata = &v + return s +} + +// SetNotificationTargetARN sets the NotificationTargetARN field's value. +func (s *PutLifecycleHookInput) SetNotificationTargetARN(v string) *PutLifecycleHookInput { + s.NotificationTargetARN = &v + return s +} + +// SetRoleARN sets the RoleARN field's value. +func (s *PutLifecycleHookInput) SetRoleARN(v string) *PutLifecycleHookInput { + s.RoleARN = &v + return s +} + +type PutLifecycleHookOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutLifecycleHookOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLifecycleHookOutput) GoString() string { + return s.String() +} + +type PutNotificationConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The type of event that will cause the notification to be sent. For details + // about notification types supported by Amazon EC2 Auto Scaling, see DescribeAutoScalingNotificationTypes. + // + // NotificationTypes is a required field + NotificationTypes []*string `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service + // (SNS) topic. + // + // TopicARN is a required field + TopicARN *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutNotificationConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutNotificationConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutNotificationConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutNotificationConfigurationInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.NotificationTypes == nil { + invalidParams.Add(request.NewErrParamRequired("NotificationTypes")) + } + if s.TopicARN == nil { + invalidParams.Add(request.NewErrParamRequired("TopicARN")) + } + if s.TopicARN != nil && len(*s.TopicARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TopicARN", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *PutNotificationConfigurationInput) SetAutoScalingGroupName(v string) *PutNotificationConfigurationInput { + s.AutoScalingGroupName = &v + return s +} + +// SetNotificationTypes sets the NotificationTypes field's value. +func (s *PutNotificationConfigurationInput) SetNotificationTypes(v []*string) *PutNotificationConfigurationInput { + s.NotificationTypes = v + return s +} + +// SetTopicARN sets the TopicARN field's value. +func (s *PutNotificationConfigurationInput) SetTopicARN(v string) *PutNotificationConfigurationInput { + s.TopicARN = &v + return s +} + +type PutNotificationConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutNotificationConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutNotificationConfigurationOutput) GoString() string { + return s.String() +} + +type PutScalingPolicyInput struct { + _ struct{} `type:"structure"` + + // The adjustment type. The valid values are ChangeInCapacity, ExactCapacity, + // and PercentChangeInCapacity. + // + // This parameter is supported if the policy type is SimpleScaling or StepScaling. + // + // For more information, see Dynamic Scaling (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) + // in the Amazon EC2 Auto Scaling User Guide. + AdjustmentType *string `min:"1" type:"string"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The amount of time, in seconds, after a scaling activity completes and before + // the next scaling activity can start. If this parameter is not specified, + // the default cooldown period for the group applies. + // + // This parameter is supported if the policy type is SimpleScaling. + // + // For more information, see Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // in the Amazon EC2 Auto Scaling User Guide. + Cooldown *int64 `type:"integer"` + + // The estimated time, in seconds, until a newly launched instance can contribute + // to the CloudWatch metrics. The default is to use the value specified for + // the default cooldown period for the group. + // + // This parameter is supported if the policy type is StepScaling or TargetTrackingScaling. + EstimatedInstanceWarmup *int64 `type:"integer"` + + // The aggregation type for the CloudWatch metrics. The valid values are Minimum, + // Maximum, and Average. If the aggregation type is null, the value is treated + // as Average. + // + // This parameter is supported if the policy type is StepScaling. + MetricAggregationType *string `min:"1" type:"string"` + + // The minimum number of instances to scale. If the value of AdjustmentType + // is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity + // of the Auto Scaling group by at least this many instances. Otherwise, the + // error is ValidationError. + // + // This parameter is supported if the policy type is SimpleScaling or StepScaling. + MinAdjustmentMagnitude *int64 `type:"integer"` + + // Available for backward compatibility. Use MinAdjustmentMagnitude instead. + MinAdjustmentStep *int64 `deprecated:"true" type:"integer"` + + // The name of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The policy type. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling. + // If the policy type is null, the value is treated as SimpleScaling. + PolicyType *string `min:"1" type:"string"` + + // The amount by which to scale, based on the specified adjustment type. A positive + // value adds to the current capacity while a negative number removes from the + // current capacity. + // + // This parameter is required if the policy type is SimpleScaling and not supported + // otherwise. + ScalingAdjustment *int64 `type:"integer"` + + // A set of adjustments that enable you to scale based on the size of the alarm + // breach. + // + // This parameter is required if the policy type is StepScaling and not supported + // otherwise. + StepAdjustments []*StepAdjustment `type:"list"` + + // A target tracking policy. + // + // This parameter is required if the policy type is TargetTrackingScaling and + // not supported otherwise. + TargetTrackingConfiguration *TargetTrackingConfiguration `type:"structure"` +} + +// String returns the string representation +func (s PutScalingPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScalingPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutScalingPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutScalingPolicyInput"} + if s.AdjustmentType != nil && len(*s.AdjustmentType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AdjustmentType", 1)) + } + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.MetricAggregationType != nil && len(*s.MetricAggregationType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MetricAggregationType", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.PolicyType != nil && len(*s.PolicyType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyType", 1)) + } + if s.StepAdjustments != nil { + for i, v := range s.StepAdjustments { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StepAdjustments", i), err.(request.ErrInvalidParams)) + } + } + } + if s.TargetTrackingConfiguration != nil { + if err := s.TargetTrackingConfiguration.Validate(); err != nil { + invalidParams.AddNested("TargetTrackingConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAdjustmentType sets the AdjustmentType field's value. +func (s *PutScalingPolicyInput) SetAdjustmentType(v string) *PutScalingPolicyInput { + s.AdjustmentType = &v + return s +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *PutScalingPolicyInput) SetAutoScalingGroupName(v string) *PutScalingPolicyInput { + s.AutoScalingGroupName = &v + return s +} + +// SetCooldown sets the Cooldown field's value. +func (s *PutScalingPolicyInput) SetCooldown(v int64) *PutScalingPolicyInput { + s.Cooldown = &v + return s +} + +// SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value. +func (s *PutScalingPolicyInput) SetEstimatedInstanceWarmup(v int64) *PutScalingPolicyInput { + s.EstimatedInstanceWarmup = &v + return s +} + +// SetMetricAggregationType sets the MetricAggregationType field's value. +func (s *PutScalingPolicyInput) SetMetricAggregationType(v string) *PutScalingPolicyInput { + s.MetricAggregationType = &v + return s +} + +// SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value. +func (s *PutScalingPolicyInput) SetMinAdjustmentMagnitude(v int64) *PutScalingPolicyInput { + s.MinAdjustmentMagnitude = &v + return s +} + +// SetMinAdjustmentStep sets the MinAdjustmentStep field's value. +func (s *PutScalingPolicyInput) SetMinAdjustmentStep(v int64) *PutScalingPolicyInput { + s.MinAdjustmentStep = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *PutScalingPolicyInput) SetPolicyName(v string) *PutScalingPolicyInput { + s.PolicyName = &v + return s +} + +// SetPolicyType sets the PolicyType field's value. +func (s *PutScalingPolicyInput) SetPolicyType(v string) *PutScalingPolicyInput { + s.PolicyType = &v + return s +} + +// SetScalingAdjustment sets the ScalingAdjustment field's value. +func (s *PutScalingPolicyInput) SetScalingAdjustment(v int64) *PutScalingPolicyInput { + s.ScalingAdjustment = &v + return s +} + +// SetStepAdjustments sets the StepAdjustments field's value. +func (s *PutScalingPolicyInput) SetStepAdjustments(v []*StepAdjustment) *PutScalingPolicyInput { + s.StepAdjustments = v + return s +} + +// SetTargetTrackingConfiguration sets the TargetTrackingConfiguration field's value. +func (s *PutScalingPolicyInput) SetTargetTrackingConfiguration(v *TargetTrackingConfiguration) *PutScalingPolicyInput { + s.TargetTrackingConfiguration = v + return s +} + +// Contains the output of PutScalingPolicy. +type PutScalingPolicyOutput struct { + _ struct{} `type:"structure"` + + // The CloudWatch alarms created for the target tracking policy. + Alarms []*Alarm `type:"list"` + + // The Amazon Resource Name (ARN) of the policy. + PolicyARN *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutScalingPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScalingPolicyOutput) GoString() string { + return s.String() +} + +// SetAlarms sets the Alarms field's value. +func (s *PutScalingPolicyOutput) SetAlarms(v []*Alarm) *PutScalingPolicyOutput { + s.Alarms = v + return s +} + +// SetPolicyARN sets the PolicyARN field's value. +func (s *PutScalingPolicyOutput) SetPolicyARN(v string) *PutScalingPolicyOutput { + s.PolicyARN = &v + return s +} + +type PutScheduledUpdateGroupActionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The number of EC2 instances that should be running in the group. + DesiredCapacity *int64 `type:"integer"` + + // The time for the recurring schedule to end. Amazon EC2 Auto Scaling does + // not perform the action after this time. + EndTime *time.Time `type:"timestamp"` + + // The maximum size for the Auto Scaling group. + MaxSize *int64 `type:"integer"` + + // The minimum size for the Auto Scaling group. + MinSize *int64 `type:"integer"` + + // The recurring schedule for this action, in Unix cron syntax format. For more + // information about this format, see Crontab (http://crontab.org). + Recurrence *string `min:"1" type:"string"` + + // The name of this scaling action. + // + // ScheduledActionName is a required field + ScheduledActionName *string `min:"1" type:"string" required:"true"` + + // The time for this action to start, in "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT + // only (for example, 2014-06-01T00:00:00Z). + // + // If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs + // the action at this time, and then performs the action based on the specified + // recurrence. + // + // If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns + // an error message. + StartTime *time.Time `type:"timestamp"` + + // This parameter is deprecated. + Time *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s PutScheduledUpdateGroupActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScheduledUpdateGroupActionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutScheduledUpdateGroupActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutScheduledUpdateGroupActionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.Recurrence != nil && len(*s.Recurrence) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Recurrence", 1)) + } + if s.ScheduledActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) + } + if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *PutScheduledUpdateGroupActionInput) SetAutoScalingGroupName(v string) *PutScheduledUpdateGroupActionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *PutScheduledUpdateGroupActionInput) SetDesiredCapacity(v int64) *PutScheduledUpdateGroupActionInput { + s.DesiredCapacity = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *PutScheduledUpdateGroupActionInput) SetEndTime(v time.Time) *PutScheduledUpdateGroupActionInput { + s.EndTime = &v + return s +} + +// SetMaxSize sets the MaxSize field's value. +func (s *PutScheduledUpdateGroupActionInput) SetMaxSize(v int64) *PutScheduledUpdateGroupActionInput { + s.MaxSize = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *PutScheduledUpdateGroupActionInput) SetMinSize(v int64) *PutScheduledUpdateGroupActionInput { + s.MinSize = &v + return s +} + +// SetRecurrence sets the Recurrence field's value. +func (s *PutScheduledUpdateGroupActionInput) SetRecurrence(v string) *PutScheduledUpdateGroupActionInput { + s.Recurrence = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *PutScheduledUpdateGroupActionInput) SetScheduledActionName(v string) *PutScheduledUpdateGroupActionInput { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *PutScheduledUpdateGroupActionInput) SetStartTime(v time.Time) *PutScheduledUpdateGroupActionInput { + s.StartTime = &v + return s +} + +// SetTime sets the Time field's value. +func (s *PutScheduledUpdateGroupActionInput) SetTime(v time.Time) *PutScheduledUpdateGroupActionInput { + s.Time = &v + return s +} + +type PutScheduledUpdateGroupActionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutScheduledUpdateGroupActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScheduledUpdateGroupActionOutput) GoString() string { + return s.String() +} + +type RecordLifecycleActionHeartbeatInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The ID of the instance. + InstanceId *string `min:"1" type:"string"` + + // A token that uniquely identifies a specific lifecycle action associated with + // an instance. Amazon EC2 Auto Scaling sends this token to the notification + // target you specified when you created the lifecycle hook. + LifecycleActionToken *string `min:"36" type:"string"` + + // The name of the lifecycle hook. + // + // LifecycleHookName is a required field + LifecycleHookName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RecordLifecycleActionHeartbeatInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordLifecycleActionHeartbeatInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RecordLifecycleActionHeartbeatInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RecordLifecycleActionHeartbeatInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.InstanceId != nil && len(*s.InstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) + } + if s.LifecycleActionToken != nil && len(*s.LifecycleActionToken) < 36 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleActionToken", 36)) + } + if s.LifecycleHookName == nil { + invalidParams.Add(request.NewErrParamRequired("LifecycleHookName")) + } + if s.LifecycleHookName != nil && len(*s.LifecycleHookName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LifecycleHookName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *RecordLifecycleActionHeartbeatInput) SetAutoScalingGroupName(v string) *RecordLifecycleActionHeartbeatInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *RecordLifecycleActionHeartbeatInput) SetInstanceId(v string) *RecordLifecycleActionHeartbeatInput { + s.InstanceId = &v + return s +} + +// SetLifecycleActionToken sets the LifecycleActionToken field's value. +func (s *RecordLifecycleActionHeartbeatInput) SetLifecycleActionToken(v string) *RecordLifecycleActionHeartbeatInput { + s.LifecycleActionToken = &v + return s +} + +// SetLifecycleHookName sets the LifecycleHookName field's value. +func (s *RecordLifecycleActionHeartbeatInput) SetLifecycleHookName(v string) *RecordLifecycleActionHeartbeatInput { + s.LifecycleHookName = &v + return s +} + +type RecordLifecycleActionHeartbeatOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RecordLifecycleActionHeartbeatOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordLifecycleActionHeartbeatOutput) GoString() string { + return s.String() +} + +type ResumeProcessesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ResumeProcessesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResumeProcessesOutput) GoString() string { + return s.String() +} + +// Describes a scaling policy. +type ScalingPolicy struct { + _ struct{} `type:"structure"` + + // The adjustment type, which specifies how ScalingAdjustment is interpreted. + // Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. + AdjustmentType *string `min:"1" type:"string"` + + // The CloudWatch alarms related to the policy. + Alarms []*Alarm `type:"list"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The amount of time, in seconds, after a scaling activity completes before + // any further dynamic scaling activities can start. + Cooldown *int64 `type:"integer"` + + // The estimated time, in seconds, until a newly launched instance can contribute + // to the CloudWatch metrics. + EstimatedInstanceWarmup *int64 `type:"integer"` + + // The aggregation type for the CloudWatch metrics. Valid values are Minimum, + // Maximum, and Average. + MetricAggregationType *string `min:"1" type:"string"` + + // The minimum number of instances to scale. If the value of AdjustmentType + // is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity + // of the Auto Scaling group by at least this many instances. Otherwise, the + // error is ValidationError. + MinAdjustmentMagnitude *int64 `type:"integer"` + + // Available for backward compatibility. Use MinAdjustmentMagnitude instead. + MinAdjustmentStep *int64 `deprecated:"true" type:"integer"` + + // The Amazon Resource Name (ARN) of the policy. + PolicyARN *string `min:"1" type:"string"` + + // The name of the scaling policy. + PolicyName *string `min:"1" type:"string"` + + // The policy type. Valid values are SimpleScaling and StepScaling. + PolicyType *string `min:"1" type:"string"` + + // The amount by which to scale, based on the specified adjustment type. A positive + // value adds to the current capacity while a negative number removes from the + // current capacity. + ScalingAdjustment *int64 `type:"integer"` + + // A set of adjustments that enable you to scale based on the size of the alarm + // breach. + StepAdjustments []*StepAdjustment `type:"list"` + + // A target tracking policy. + TargetTrackingConfiguration *TargetTrackingConfiguration `type:"structure"` +} + +// String returns the string representation +func (s ScalingPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScalingPolicy) GoString() string { + return s.String() +} + +// SetAdjustmentType sets the AdjustmentType field's value. +func (s *ScalingPolicy) SetAdjustmentType(v string) *ScalingPolicy { + s.AdjustmentType = &v + return s +} + +// SetAlarms sets the Alarms field's value. +func (s *ScalingPolicy) SetAlarms(v []*Alarm) *ScalingPolicy { + s.Alarms = v + return s +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *ScalingPolicy) SetAutoScalingGroupName(v string) *ScalingPolicy { + s.AutoScalingGroupName = &v + return s +} + +// SetCooldown sets the Cooldown field's value. +func (s *ScalingPolicy) SetCooldown(v int64) *ScalingPolicy { + s.Cooldown = &v + return s +} + +// SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value. +func (s *ScalingPolicy) SetEstimatedInstanceWarmup(v int64) *ScalingPolicy { + s.EstimatedInstanceWarmup = &v + return s +} + +// SetMetricAggregationType sets the MetricAggregationType field's value. +func (s *ScalingPolicy) SetMetricAggregationType(v string) *ScalingPolicy { + s.MetricAggregationType = &v + return s +} + +// SetMinAdjustmentMagnitude sets the MinAdjustmentMagnitude field's value. +func (s *ScalingPolicy) SetMinAdjustmentMagnitude(v int64) *ScalingPolicy { + s.MinAdjustmentMagnitude = &v + return s +} + +// SetMinAdjustmentStep sets the MinAdjustmentStep field's value. +func (s *ScalingPolicy) SetMinAdjustmentStep(v int64) *ScalingPolicy { + s.MinAdjustmentStep = &v + return s +} + +// SetPolicyARN sets the PolicyARN field's value. +func (s *ScalingPolicy) SetPolicyARN(v string) *ScalingPolicy { + s.PolicyARN = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *ScalingPolicy) SetPolicyName(v string) *ScalingPolicy { + s.PolicyName = &v + return s +} + +// SetPolicyType sets the PolicyType field's value. +func (s *ScalingPolicy) SetPolicyType(v string) *ScalingPolicy { + s.PolicyType = &v + return s +} + +// SetScalingAdjustment sets the ScalingAdjustment field's value. +func (s *ScalingPolicy) SetScalingAdjustment(v int64) *ScalingPolicy { + s.ScalingAdjustment = &v + return s +} + +// SetStepAdjustments sets the StepAdjustments field's value. +func (s *ScalingPolicy) SetStepAdjustments(v []*StepAdjustment) *ScalingPolicy { + s.StepAdjustments = v + return s +} + +// SetTargetTrackingConfiguration sets the TargetTrackingConfiguration field's value. +func (s *ScalingPolicy) SetTargetTrackingConfiguration(v *TargetTrackingConfiguration) *ScalingPolicy { + s.TargetTrackingConfiguration = v + return s +} + +type ScalingProcessQuery struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more of the following processes. If you omit this parameter, all processes + // are specified. + // + // * Launch + // + // * Terminate + // + // * HealthCheck + // + // * ReplaceUnhealthy + // + // * AZRebalance + // + // * AlarmNotification + // + // * ScheduledActions + // + // * AddToLoadBalancer + ScalingProcesses []*string `type:"list"` +} + +// String returns the string representation +func (s ScalingProcessQuery) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScalingProcessQuery) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScalingProcessQuery) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScalingProcessQuery"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *ScalingProcessQuery) SetAutoScalingGroupName(v string) *ScalingProcessQuery { + s.AutoScalingGroupName = &v + return s +} + +// SetScalingProcesses sets the ScalingProcesses field's value. +func (s *ScalingProcessQuery) SetScalingProcesses(v []*string) *ScalingProcessQuery { + s.ScalingProcesses = v + return s +} + +// Describes a scheduled scaling action. Used in response to DescribeScheduledActions. +type ScheduledUpdateGroupAction struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // The number of instances you prefer to maintain in the group. + DesiredCapacity *int64 `type:"integer"` + + // The date and time that the action is scheduled to end. This date and time + // can be up to one month in the future. + EndTime *time.Time `type:"timestamp"` + + // The maximum size of the group. + MaxSize *int64 `type:"integer"` + + // The minimum size of the group. + MinSize *int64 `type:"integer"` + + // The recurring schedule for the action. + Recurrence *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the scheduled action. + ScheduledActionARN *string `min:"1" type:"string"` + + // The name of the scheduled action. + ScheduledActionName *string `min:"1" type:"string"` + + // The date and time that the action is scheduled to begin. This date and time + // can be up to one month in the future. + // + // When StartTime and EndTime are specified with Recurrence, they form the boundaries + // of when the recurring action will start and stop. + StartTime *time.Time `type:"timestamp"` + + // This parameter is deprecated. + Time *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s ScheduledUpdateGroupAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduledUpdateGroupAction) GoString() string { + return s.String() +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *ScheduledUpdateGroupAction) SetAutoScalingGroupName(v string) *ScheduledUpdateGroupAction { + s.AutoScalingGroupName = &v + return s +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *ScheduledUpdateGroupAction) SetDesiredCapacity(v int64) *ScheduledUpdateGroupAction { + s.DesiredCapacity = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *ScheduledUpdateGroupAction) SetEndTime(v time.Time) *ScheduledUpdateGroupAction { + s.EndTime = &v + return s +} + +// SetMaxSize sets the MaxSize field's value. +func (s *ScheduledUpdateGroupAction) SetMaxSize(v int64) *ScheduledUpdateGroupAction { + s.MaxSize = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *ScheduledUpdateGroupAction) SetMinSize(v int64) *ScheduledUpdateGroupAction { + s.MinSize = &v + return s +} + +// SetRecurrence sets the Recurrence field's value. +func (s *ScheduledUpdateGroupAction) SetRecurrence(v string) *ScheduledUpdateGroupAction { + s.Recurrence = &v + return s +} + +// SetScheduledActionARN sets the ScheduledActionARN field's value. +func (s *ScheduledUpdateGroupAction) SetScheduledActionARN(v string) *ScheduledUpdateGroupAction { + s.ScheduledActionARN = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *ScheduledUpdateGroupAction) SetScheduledActionName(v string) *ScheduledUpdateGroupAction { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ScheduledUpdateGroupAction) SetStartTime(v time.Time) *ScheduledUpdateGroupAction { + s.StartTime = &v + return s +} + +// SetTime sets the Time field's value. +func (s *ScheduledUpdateGroupAction) SetTime(v time.Time) *ScheduledUpdateGroupAction { + s.Time = &v + return s +} + +// Describes one or more scheduled scaling action updates for a specified Auto +// Scaling group. Used in combination with BatchPutScheduledUpdateGroupAction. +// +// When updating a scheduled scaling action, all optional parameters are left +// unchanged if not specified. +type ScheduledUpdateGroupActionRequest struct { + _ struct{} `type:"structure"` + + // The number of EC2 instances that should be running in the group. + DesiredCapacity *int64 `type:"integer"` + + // The time for the recurring schedule to end. Amazon EC2 Auto Scaling does + // not perform the action after this time. + EndTime *time.Time `type:"timestamp"` + + // The maximum size of the group. + MaxSize *int64 `type:"integer"` + + // The minimum size of the group. + MinSize *int64 `type:"integer"` + + // The recurring schedule for the action, in Unix cron syntax format. For more + // information about this format, see Crontab (http://crontab.org). + Recurrence *string `min:"1" type:"string"` + + // The name of the scaling action. + // + // ScheduledActionName is a required field + ScheduledActionName *string `min:"1" type:"string" required:"true"` + + // The time for the action to start, in "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT + // only (for example, 2014-06-01T00:00:00Z). + // + // If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs + // the action at this time, and then performs the action based on the specified + // recurrence. + // + // If you try to schedule the action in the past, Amazon EC2 Auto Scaling returns + // an error message. + StartTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s ScheduledUpdateGroupActionRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduledUpdateGroupActionRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduledUpdateGroupActionRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduledUpdateGroupActionRequest"} + if s.Recurrence != nil && len(*s.Recurrence) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Recurrence", 1)) + } + if s.ScheduledActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) + } + if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *ScheduledUpdateGroupActionRequest) SetDesiredCapacity(v int64) *ScheduledUpdateGroupActionRequest { + s.DesiredCapacity = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *ScheduledUpdateGroupActionRequest) SetEndTime(v time.Time) *ScheduledUpdateGroupActionRequest { + s.EndTime = &v + return s +} + +// SetMaxSize sets the MaxSize field's value. +func (s *ScheduledUpdateGroupActionRequest) SetMaxSize(v int64) *ScheduledUpdateGroupActionRequest { + s.MaxSize = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *ScheduledUpdateGroupActionRequest) SetMinSize(v int64) *ScheduledUpdateGroupActionRequest { + s.MinSize = &v + return s +} + +// SetRecurrence sets the Recurrence field's value. +func (s *ScheduledUpdateGroupActionRequest) SetRecurrence(v string) *ScheduledUpdateGroupActionRequest { + s.Recurrence = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *ScheduledUpdateGroupActionRequest) SetScheduledActionName(v string) *ScheduledUpdateGroupActionRequest { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ScheduledUpdateGroupActionRequest) SetStartTime(v time.Time) *ScheduledUpdateGroupActionRequest { + s.StartTime = &v + return s +} + +type SetDesiredCapacityInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The number of EC2 instances that should be running in the Auto Scaling group. + // + // DesiredCapacity is a required field + DesiredCapacity *int64 `type:"integer" required:"true"` + + // Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to + // complete before initiating a scaling activity to set your Auto Scaling group + // to its new capacity. By default, Amazon EC2 Auto Scaling does not honor the + // cooldown period during manual scaling activities. + HonorCooldown *bool `type:"boolean"` +} + +// String returns the string representation +func (s SetDesiredCapacityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDesiredCapacityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetDesiredCapacityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetDesiredCapacityInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.DesiredCapacity == nil { + invalidParams.Add(request.NewErrParamRequired("DesiredCapacity")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *SetDesiredCapacityInput) SetAutoScalingGroupName(v string) *SetDesiredCapacityInput { + s.AutoScalingGroupName = &v + return s +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *SetDesiredCapacityInput) SetDesiredCapacity(v int64) *SetDesiredCapacityInput { + s.DesiredCapacity = &v + return s +} + +// SetHonorCooldown sets the HonorCooldown field's value. +func (s *SetDesiredCapacityInput) SetHonorCooldown(v bool) *SetDesiredCapacityInput { + s.HonorCooldown = &v + return s +} + +type SetDesiredCapacityOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetDesiredCapacityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDesiredCapacityOutput) GoString() string { + return s.String() +} + +type SetInstanceHealthInput struct { + _ struct{} `type:"structure"` + + // The health status of the instance. Set to Healthy if you want the instance + // to remain in service. Set to Unhealthy if you want the instance to be out + // of service. Amazon EC2 Auto Scaling will terminate and replace the unhealthy + // instance. + // + // HealthStatus is a required field + HealthStatus *string `min:"1" type:"string" required:"true"` + + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `min:"1" type:"string" required:"true"` + + // If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod + // specified for the group, by default, this call will respect the grace period. + // Set this to False, if you do not want the call to respect the grace period + // associated with the group. + // + // For more information, see the description of the health check grace period + // for CreateAutoScalingGroup. + ShouldRespectGracePeriod *bool `type:"boolean"` +} + +// String returns the string representation +func (s SetInstanceHealthInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetInstanceHealthInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetInstanceHealthInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetInstanceHealthInput"} + if s.HealthStatus == nil { + invalidParams.Add(request.NewErrParamRequired("HealthStatus")) + } + if s.HealthStatus != nil && len(*s.HealthStatus) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HealthStatus", 1)) + } + if s.InstanceId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceId")) + } + if s.InstanceId != nil && len(*s.InstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthStatus sets the HealthStatus field's value. +func (s *SetInstanceHealthInput) SetHealthStatus(v string) *SetInstanceHealthInput { + s.HealthStatus = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *SetInstanceHealthInput) SetInstanceId(v string) *SetInstanceHealthInput { + s.InstanceId = &v + return s +} + +// SetShouldRespectGracePeriod sets the ShouldRespectGracePeriod field's value. +func (s *SetInstanceHealthInput) SetShouldRespectGracePeriod(v bool) *SetInstanceHealthInput { + s.ShouldRespectGracePeriod = &v + return s +} + +type SetInstanceHealthOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetInstanceHealthOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetInstanceHealthOutput) GoString() string { + return s.String() +} + +type SetInstanceProtectionInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more instance IDs. + // + // InstanceIds is a required field + InstanceIds []*string `type:"list" required:"true"` + + // Indicates whether the instance is protected from termination by Amazon EC2 + // Auto Scaling when scaling in. + // + // ProtectedFromScaleIn is a required field + ProtectedFromScaleIn *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s SetInstanceProtectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetInstanceProtectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetInstanceProtectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetInstanceProtectionInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.InstanceIds == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceIds")) + } + if s.ProtectedFromScaleIn == nil { + invalidParams.Add(request.NewErrParamRequired("ProtectedFromScaleIn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *SetInstanceProtectionInput) SetAutoScalingGroupName(v string) *SetInstanceProtectionInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *SetInstanceProtectionInput) SetInstanceIds(v []*string) *SetInstanceProtectionInput { + s.InstanceIds = v + return s +} + +// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. +func (s *SetInstanceProtectionInput) SetProtectedFromScaleIn(v bool) *SetInstanceProtectionInput { + s.ProtectedFromScaleIn = &v + return s +} + +type SetInstanceProtectionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetInstanceProtectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetInstanceProtectionOutput) GoString() string { + return s.String() +} + +// Describes an adjustment based on the difference between the value of the +// aggregated CloudWatch metric and the breach threshold that you've defined +// for the alarm. +// +// For the following examples, suppose that you have an alarm with a breach +// threshold of 50: +// +// * If you want the adjustment to be triggered when the metric is greater +// than or equal to 50 and less than 60, specify a lower bound of 0 and an +// upper bound of 10. +// +// * If you want the adjustment to be triggered when the metric is greater +// than 40 and less than or equal to 50, specify a lower bound of -10 and +// an upper bound of 0. +// +// There are a few rules for the step adjustments for your step policy: +// +// * The ranges of your step adjustments can't overlap or have a gap. +// +// * At most one step adjustment can have a null lower bound. If one step +// adjustment has a negative lower bound, then there must be a step adjustment +// with a null lower bound. +// +// * At most one step adjustment can have a null upper bound. If one step +// adjustment has a positive upper bound, then there must be a step adjustment +// with a null upper bound. +// +// * The upper and lower bound can't be null in the same step adjustment. +type StepAdjustment struct { + _ struct{} `type:"structure"` + + // The lower bound for the difference between the alarm threshold and the CloudWatch + // metric. If the metric value is above the breach threshold, the lower bound + // is inclusive (the metric must be greater than or equal to the threshold plus + // the lower bound). Otherwise, it is exclusive (the metric must be greater + // than the threshold plus the lower bound). A null value indicates negative + // infinity. + MetricIntervalLowerBound *float64 `type:"double"` + + // The upper bound for the difference between the alarm threshold and the CloudWatch + // metric. If the metric value is above the breach threshold, the upper bound + // is exclusive (the metric must be less than the threshold plus the upper bound). + // Otherwise, it is inclusive (the metric must be less than or equal to the + // threshold plus the upper bound). A null value indicates positive infinity. + // + // The upper bound must be greater than the lower bound. + MetricIntervalUpperBound *float64 `type:"double"` + + // The amount by which to scale, based on the specified adjustment type. A positive + // value adds to the current capacity while a negative number removes from the + // current capacity. + // + // ScalingAdjustment is a required field + ScalingAdjustment *int64 `type:"integer" required:"true"` +} + +// String returns the string representation +func (s StepAdjustment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StepAdjustment) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StepAdjustment) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StepAdjustment"} + if s.ScalingAdjustment == nil { + invalidParams.Add(request.NewErrParamRequired("ScalingAdjustment")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMetricIntervalLowerBound sets the MetricIntervalLowerBound field's value. +func (s *StepAdjustment) SetMetricIntervalLowerBound(v float64) *StepAdjustment { + s.MetricIntervalLowerBound = &v + return s +} + +// SetMetricIntervalUpperBound sets the MetricIntervalUpperBound field's value. +func (s *StepAdjustment) SetMetricIntervalUpperBound(v float64) *StepAdjustment { + s.MetricIntervalUpperBound = &v + return s +} + +// SetScalingAdjustment sets the ScalingAdjustment field's value. +func (s *StepAdjustment) SetScalingAdjustment(v int64) *StepAdjustment { + s.ScalingAdjustment = &v + return s +} + +type SuspendProcessesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SuspendProcessesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SuspendProcessesOutput) GoString() string { + return s.String() +} + +// Describes an automatic scaling process that has been suspended. For more +// information, see ProcessType. +type SuspendedProcess struct { + _ struct{} `type:"structure"` + + // The name of the suspended process. + ProcessName *string `min:"1" type:"string"` + + // The reason that the process was suspended. + SuspensionReason *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s SuspendedProcess) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SuspendedProcess) GoString() string { + return s.String() +} + +// SetProcessName sets the ProcessName field's value. +func (s *SuspendedProcess) SetProcessName(v string) *SuspendedProcess { + s.ProcessName = &v + return s +} + +// SetSuspensionReason sets the SuspensionReason field's value. +func (s *SuspendedProcess) SetSuspensionReason(v string) *SuspendedProcess { + s.SuspensionReason = &v + return s +} + +// Describes a tag for an Auto Scaling group. +type Tag struct { + _ struct{} `type:"structure"` + + // The tag key. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // Determines whether the tag is added to new instances as they are launched + // in the group. + PropagateAtLaunch *bool `type:"boolean"` + + // The name of the group. + ResourceId *string `type:"string"` + + // The type of resource. The only supported value is auto-scaling-group. + ResourceType *string `type:"string"` + + // The tag value. + Value *string `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() +} + +// 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 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 +} + +// SetPropagateAtLaunch sets the PropagateAtLaunch field's value. +func (s *Tag) SetPropagateAtLaunch(v bool) *Tag { + s.PropagateAtLaunch = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *Tag) SetResourceId(v string) *Tag { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *Tag) SetResourceType(v string) *Tag { + s.ResourceType = &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 for an Auto Scaling group. +type TagDescription struct { + _ struct{} `type:"structure"` + + // The tag key. + Key *string `min:"1" type:"string"` + + // Determines whether the tag is added to new instances as they are launched + // in the group. + PropagateAtLaunch *bool `type:"boolean"` + + // The name of the group. + ResourceId *string `type:"string"` + + // The type of resource. The only supported value is auto-scaling-group. + ResourceType *string `type:"string"` + + // The tag value. + Value *string `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 +} + +// SetPropagateAtLaunch sets the PropagateAtLaunch field's value. +func (s *TagDescription) SetPropagateAtLaunch(v bool) *TagDescription { + s.PropagateAtLaunch = &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 +} + +// Represents a target tracking policy configuration. +type TargetTrackingConfiguration struct { + _ struct{} `type:"structure"` + + // A customized metric. + CustomizedMetricSpecification *CustomizedMetricSpecification `type:"structure"` + + // Indicates whether scale in by the target tracking policy is disabled. If + // scale in is disabled, the target tracking policy won't remove instances from + // the Auto Scaling group. Otherwise, the target tracking policy can remove + // instances from the Auto Scaling group. The default is disabled. + DisableScaleIn *bool `type:"boolean"` + + // A predefined metric. You can specify either a predefined metric or a customized + // metric. + PredefinedMetricSpecification *PredefinedMetricSpecification `type:"structure"` + + // The target value for the metric. + // + // TargetValue is a required field + TargetValue *float64 `type:"double" required:"true"` +} + +// String returns the string representation +func (s TargetTrackingConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetTrackingConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TargetTrackingConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TargetTrackingConfiguration"} + if s.TargetValue == nil { + invalidParams.Add(request.NewErrParamRequired("TargetValue")) + } + if s.CustomizedMetricSpecification != nil { + if err := s.CustomizedMetricSpecification.Validate(); err != nil { + invalidParams.AddNested("CustomizedMetricSpecification", err.(request.ErrInvalidParams)) + } + } + if s.PredefinedMetricSpecification != nil { + if err := s.PredefinedMetricSpecification.Validate(); err != nil { + invalidParams.AddNested("PredefinedMetricSpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomizedMetricSpecification sets the CustomizedMetricSpecification field's value. +func (s *TargetTrackingConfiguration) SetCustomizedMetricSpecification(v *CustomizedMetricSpecification) *TargetTrackingConfiguration { + s.CustomizedMetricSpecification = v + return s +} + +// SetDisableScaleIn sets the DisableScaleIn field's value. +func (s *TargetTrackingConfiguration) SetDisableScaleIn(v bool) *TargetTrackingConfiguration { + s.DisableScaleIn = &v + return s +} + +// SetPredefinedMetricSpecification sets the PredefinedMetricSpecification field's value. +func (s *TargetTrackingConfiguration) SetPredefinedMetricSpecification(v *PredefinedMetricSpecification) *TargetTrackingConfiguration { + s.PredefinedMetricSpecification = v + return s +} + +// SetTargetValue sets the TargetValue field's value. +func (s *TargetTrackingConfiguration) SetTargetValue(v float64) *TargetTrackingConfiguration { + s.TargetValue = &v + return s +} + +type TerminateInstanceInAutoScalingGroupInput struct { + _ struct{} `type:"structure"` + + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `min:"1" type:"string" required:"true"` + + // Indicates whether terminating the instance also decrements the size of the + // Auto Scaling group. + // + // ShouldDecrementDesiredCapacity is a required field + ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s TerminateInstanceInAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminateInstanceInAutoScalingGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TerminateInstanceInAutoScalingGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TerminateInstanceInAutoScalingGroupInput"} + if s.InstanceId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceId")) + } + if s.InstanceId != nil && len(*s.InstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) + } + if s.ShouldDecrementDesiredCapacity == nil { + invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceId sets the InstanceId field's value. +func (s *TerminateInstanceInAutoScalingGroupInput) SetInstanceId(v string) *TerminateInstanceInAutoScalingGroupInput { + s.InstanceId = &v + return s +} + +// SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. +func (s *TerminateInstanceInAutoScalingGroupInput) SetShouldDecrementDesiredCapacity(v bool) *TerminateInstanceInAutoScalingGroupInput { + s.ShouldDecrementDesiredCapacity = &v + return s +} + +type TerminateInstanceInAutoScalingGroupOutput struct { + _ struct{} `type:"structure"` + + // A scaling activity. + Activity *Activity `type:"structure"` +} + +// String returns the string representation +func (s TerminateInstanceInAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminateInstanceInAutoScalingGroupOutput) GoString() string { + return s.String() +} + +// SetActivity sets the Activity field's value. +func (s *TerminateInstanceInAutoScalingGroupOutput) SetActivity(v *Activity) *TerminateInstanceInAutoScalingGroupOutput { + s.Activity = v + return s +} + +type UpdateAutoScalingGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // One or more Availability Zones for the group. + AvailabilityZones []*string `min:"1" type:"list"` + + // The amount of time, in seconds, after a scaling activity completes before + // another scaling activity can start. The default is 300. + // + // For more information, see Scaling Cooldowns (http://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // in the Amazon EC2 Auto Scaling User Guide. + DefaultCooldown *int64 `type:"integer"` + + // The number of EC2 instances that should be running in the Auto Scaling group. + // This number must be greater than or equal to the minimum size of the group + // and less than or equal to the maximum size of the group. + DesiredCapacity *int64 `type:"integer"` + + // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before + // checking the health status of an EC2 instance that has come into service. + // The default is 0. + // + // For more information, see Health Checks (http://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) + // in the Amazon EC2 Auto Scaling User Guide. + HealthCheckGracePeriod *int64 `type:"integer"` + + // The service to use for the health checks. The valid values are EC2 and ELB. + HealthCheckType *string `min:"1" type:"string"` + + // The name of the launch configuration. If you specify a launch configuration, + // you can't specify a launch template. + LaunchConfigurationName *string `min:"1" type:"string"` + + // The launch template to use to specify the updates. If you specify a launch + // template, you can't specify a launch configuration. + LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + + // The maximum size of the Auto Scaling group. + MaxSize *int64 `type:"integer"` + + // The minimum size of the Auto Scaling group. + MinSize *int64 `type:"integer"` + + // Indicates whether newly launched instances are protected from termination + // by Auto Scaling when scaling in. + NewInstancesProtectedFromScaleIn *bool `type:"boolean"` + + // The name of the placement group into which you'll launch your instances, + // if any. 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. + PlacementGroup *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling + // group uses to call other AWS services on your behalf. + ServiceLinkedRoleARN *string `min:"1" type:"string"` + + // A standalone termination policy or a list of termination policies used to + // select the instance to terminate. The policies are executed in the order + // that they are listed. + // + // For more information, see Controlling Which Instances Auto Scaling Terminates + // During Scale In (http://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) + // in the Auto Scaling User Guide. + TerminationPolicies []*string `type:"list"` + + // The ID of the subnet, if you are launching into a VPC. You can specify several + // subnets in a comma-separated list. + // + // When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the + // subnets' Availability Zones match the values you specify for AvailabilityZones. + // + // For more information, see Launching Auto Scaling Instances in a VPC (http://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // in the Amazon EC2 Auto Scaling User Guide. + VPCZoneIdentifier *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAutoScalingGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateAutoScalingGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateAutoScalingGroupInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) + } + if s.HealthCheckType != nil && len(*s.HealthCheckType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HealthCheckType", 1)) + } + if s.LaunchConfigurationName != nil && len(*s.LaunchConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LaunchConfigurationName", 1)) + } + if s.PlacementGroup != nil && len(*s.PlacementGroup) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PlacementGroup", 1)) + } + if s.ServiceLinkedRoleARN != nil && len(*s.ServiceLinkedRoleARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServiceLinkedRoleARN", 1)) + } + if s.VPCZoneIdentifier != nil && len(*s.VPCZoneIdentifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VPCZoneIdentifier", 1)) + } + if s.LaunchTemplate != nil { + if err := s.LaunchTemplate.Validate(); err != nil { + invalidParams.AddNested("LaunchTemplate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *UpdateAutoScalingGroupInput) SetAutoScalingGroupName(v string) *UpdateAutoScalingGroupInput { + s.AutoScalingGroupName = &v + return s +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *UpdateAutoScalingGroupInput) SetAvailabilityZones(v []*string) *UpdateAutoScalingGroupInput { + s.AvailabilityZones = v + return s +} + +// SetDefaultCooldown sets the DefaultCooldown field's value. +func (s *UpdateAutoScalingGroupInput) SetDefaultCooldown(v int64) *UpdateAutoScalingGroupInput { + s.DefaultCooldown = &v + return s +} + +// SetDesiredCapacity sets the DesiredCapacity field's value. +func (s *UpdateAutoScalingGroupInput) SetDesiredCapacity(v int64) *UpdateAutoScalingGroupInput { + s.DesiredCapacity = &v + return s +} + +// SetHealthCheckGracePeriod sets the HealthCheckGracePeriod field's value. +func (s *UpdateAutoScalingGroupInput) SetHealthCheckGracePeriod(v int64) *UpdateAutoScalingGroupInput { + s.HealthCheckGracePeriod = &v + return s +} + +// SetHealthCheckType sets the HealthCheckType field's value. +func (s *UpdateAutoScalingGroupInput) SetHealthCheckType(v string) *UpdateAutoScalingGroupInput { + s.HealthCheckType = &v + return s +} + +// SetLaunchConfigurationName sets the LaunchConfigurationName field's value. +func (s *UpdateAutoScalingGroupInput) SetLaunchConfigurationName(v string) *UpdateAutoScalingGroupInput { + s.LaunchConfigurationName = &v + return s +} + +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *UpdateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *UpdateAutoScalingGroupInput { + s.LaunchTemplate = v + return s +} + +// SetMaxSize sets the MaxSize field's value. +func (s *UpdateAutoScalingGroupInput) SetMaxSize(v int64) *UpdateAutoScalingGroupInput { + s.MaxSize = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *UpdateAutoScalingGroupInput) SetMinSize(v int64) *UpdateAutoScalingGroupInput { + s.MinSize = &v + return s +} + +// SetNewInstancesProtectedFromScaleIn sets the NewInstancesProtectedFromScaleIn field's value. +func (s *UpdateAutoScalingGroupInput) SetNewInstancesProtectedFromScaleIn(v bool) *UpdateAutoScalingGroupInput { + s.NewInstancesProtectedFromScaleIn = &v + return s +} + +// SetPlacementGroup sets the PlacementGroup field's value. +func (s *UpdateAutoScalingGroupInput) SetPlacementGroup(v string) *UpdateAutoScalingGroupInput { + s.PlacementGroup = &v + return s +} + +// SetServiceLinkedRoleARN sets the ServiceLinkedRoleARN field's value. +func (s *UpdateAutoScalingGroupInput) SetServiceLinkedRoleARN(v string) *UpdateAutoScalingGroupInput { + s.ServiceLinkedRoleARN = &v + return s +} + +// SetTerminationPolicies sets the TerminationPolicies field's value. +func (s *UpdateAutoScalingGroupInput) SetTerminationPolicies(v []*string) *UpdateAutoScalingGroupInput { + s.TerminationPolicies = v + return s +} + +// SetVPCZoneIdentifier sets the VPCZoneIdentifier field's value. +func (s *UpdateAutoScalingGroupInput) SetVPCZoneIdentifier(v string) *UpdateAutoScalingGroupInput { + s.VPCZoneIdentifier = &v + return s +} + +type UpdateAutoScalingGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAutoScalingGroupOutput) GoString() string { + return s.String() +} + +const ( + // LifecycleStatePending is a LifecycleState enum value + LifecycleStatePending = "Pending" + + // LifecycleStatePendingWait is a LifecycleState enum value + LifecycleStatePendingWait = "Pending:Wait" + + // LifecycleStatePendingProceed is a LifecycleState enum value + LifecycleStatePendingProceed = "Pending:Proceed" + + // LifecycleStateQuarantined is a LifecycleState enum value + LifecycleStateQuarantined = "Quarantined" + + // LifecycleStateInService is a LifecycleState enum value + LifecycleStateInService = "InService" + + // LifecycleStateTerminating is a LifecycleState enum value + LifecycleStateTerminating = "Terminating" + + // LifecycleStateTerminatingWait is a LifecycleState enum value + LifecycleStateTerminatingWait = "Terminating:Wait" + + // LifecycleStateTerminatingProceed is a LifecycleState enum value + LifecycleStateTerminatingProceed = "Terminating:Proceed" + + // LifecycleStateTerminated is a LifecycleState enum value + LifecycleStateTerminated = "Terminated" + + // LifecycleStateDetaching is a LifecycleState enum value + LifecycleStateDetaching = "Detaching" + + // LifecycleStateDetached is a LifecycleState enum value + LifecycleStateDetached = "Detached" + + // LifecycleStateEnteringStandby is a LifecycleState enum value + LifecycleStateEnteringStandby = "EnteringStandby" + + // LifecycleStateStandby is a LifecycleState enum value + LifecycleStateStandby = "Standby" +) + +const ( + // MetricStatisticAverage is a MetricStatistic enum value + MetricStatisticAverage = "Average" + + // MetricStatisticMinimum is a MetricStatistic enum value + MetricStatisticMinimum = "Minimum" + + // MetricStatisticMaximum is a MetricStatistic enum value + MetricStatisticMaximum = "Maximum" + + // MetricStatisticSampleCount is a MetricStatistic enum value + MetricStatisticSampleCount = "SampleCount" + + // MetricStatisticSum is a MetricStatistic enum value + MetricStatisticSum = "Sum" +) + +const ( + // MetricTypeAsgaverageCpuutilization is a MetricType enum value + MetricTypeAsgaverageCpuutilization = "ASGAverageCPUUtilization" + + // MetricTypeAsgaverageNetworkIn is a MetricType enum value + MetricTypeAsgaverageNetworkIn = "ASGAverageNetworkIn" + + // MetricTypeAsgaverageNetworkOut is a MetricType enum value + MetricTypeAsgaverageNetworkOut = "ASGAverageNetworkOut" + + // MetricTypeAlbrequestCountPerTarget is a MetricType enum value + MetricTypeAlbrequestCountPerTarget = "ALBRequestCountPerTarget" +) + +const ( + // ScalingActivityStatusCodePendingSpotBidPlacement is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodePendingSpotBidPlacement = "PendingSpotBidPlacement" + + // ScalingActivityStatusCodeWaitingForSpotInstanceRequestId is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeWaitingForSpotInstanceRequestId = "WaitingForSpotInstanceRequestId" + + // ScalingActivityStatusCodeWaitingForSpotInstanceId is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeWaitingForSpotInstanceId = "WaitingForSpotInstanceId" + + // ScalingActivityStatusCodeWaitingForInstanceId is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeWaitingForInstanceId = "WaitingForInstanceId" + + // ScalingActivityStatusCodePreInService is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodePreInService = "PreInService" + + // ScalingActivityStatusCodeInProgress is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeInProgress = "InProgress" + + // ScalingActivityStatusCodeWaitingForElbconnectionDraining is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeWaitingForElbconnectionDraining = "WaitingForELBConnectionDraining" + + // ScalingActivityStatusCodeMidLifecycleAction is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeMidLifecycleAction = "MidLifecycleAction" + + // ScalingActivityStatusCodeWaitingForInstanceWarmup is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeWaitingForInstanceWarmup = "WaitingForInstanceWarmup" + + // ScalingActivityStatusCodeSuccessful is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeSuccessful = "Successful" + + // ScalingActivityStatusCodeFailed is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeFailed = "Failed" + + // ScalingActivityStatusCodeCancelled is a ScalingActivityStatusCode enum value + ScalingActivityStatusCodeCancelled = "Cancelled" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go new file mode 100644 index 00000000000..f431b8aa39b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go @@ -0,0 +1,31 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package autoscaling provides the client and types for making API +// requests to Auto Scaling. +// +// Amazon EC2 Auto Scaling is designed to automatically launch or terminate +// EC2 instances based on user-defined policies, schedules, and health checks. +// Use this service in conjunction with the AWS Auto Scaling, Amazon CloudWatch, +// and Elastic Load Balancing services. +// +// See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service. +// +// See autoscaling package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/autoscaling/ +// +// Using the Client +// +// To contact Auto Scaling 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 Auto Scaling client AutoScaling for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/autoscaling/#New +package autoscaling diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go new file mode 100644 index 00000000000..be8b7e70b13 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go @@ -0,0 +1,53 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package autoscaling + +const ( + + // ErrCodeAlreadyExistsFault for service response error code + // "AlreadyExists". + // + // You already have an Auto Scaling group or launch configuration with this + // name. + ErrCodeAlreadyExistsFault = "AlreadyExists" + + // ErrCodeInvalidNextToken for service response error code + // "InvalidNextToken". + // + // The NextToken value is not valid. + ErrCodeInvalidNextToken = "InvalidNextToken" + + // ErrCodeLimitExceededFault for service response error code + // "LimitExceeded". + // + // You have already reached a limit for your Auto Scaling resources (for example, + // groups, launch configurations, or lifecycle hooks). For more information, + // see DescribeAccountLimits. + ErrCodeLimitExceededFault = "LimitExceeded" + + // ErrCodeResourceContentionFault for service response error code + // "ResourceContention". + // + // You already have a pending update to an Auto Scaling resource (for example, + // a group, instance, or load balancer). + ErrCodeResourceContentionFault = "ResourceContention" + + // ErrCodeResourceInUseFault for service response error code + // "ResourceInUse". + // + // The operation can't be performed because the resource is in use. + ErrCodeResourceInUseFault = "ResourceInUse" + + // ErrCodeScalingActivityInProgressFault for service response error code + // "ScalingActivityInProgress". + // + // The operation can't be performed because there are scaling activities in + // progress. + ErrCodeScalingActivityInProgressFault = "ScalingActivityInProgress" + + // ErrCodeServiceLinkedRoleFailure for service response error code + // "ServiceLinkedRoleFailure". + // + // The service-linked role is not yet ready for use. + ErrCodeServiceLinkedRoleFailure = "ServiceLinkedRoleFailure" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go new file mode 100644 index 00000000000..e1da9fd7546 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go @@ -0,0 +1,95 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package autoscaling + +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/query" +) + +// AutoScaling provides the API operation methods for making requests to +// Auto Scaling. See this package's package overview docs +// for details on the service. +// +// AutoScaling methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type AutoScaling 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 = "autoscaling" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "Auto Scaling" // ServiceID is a unique identifer of a specific service. +) + +// New creates a new instance of the AutoScaling 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 AutoScaling client from just a session. +// svc := autoscaling.New(mySession) +// +// // Create a AutoScaling client with additional configuration +// svc := autoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *AutoScaling { + 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) *AutoScaling { + svc := &AutoScaling{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2011-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(query.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a AutoScaling operation and runs any +// custom request initialization. +func (c *AutoScaling) 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/autoscaling/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go new file mode 100644 index 00000000000..c2e7e2ed8d2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go @@ -0,0 +1,163 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package autoscaling + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilGroupExists uses the Auto Scaling API operation +// DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error { + return c.WaitUntilGroupExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilGroupExistsWithContext is an extended version of WaitUntilGroupExists. +// 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 *AutoScaling) WaitUntilGroupExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilGroupExists", + MaxAttempts: 10, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", + Expected: true, + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", + Expected: false, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilGroupInService uses the Auto Scaling API operation +// DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error { + return c.WaitUntilGroupInServiceWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilGroupInServiceWithContext is an extended version of WaitUntilGroupInService. +// 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 *AutoScaling) WaitUntilGroupInServiceWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilGroupInService", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", + Expected: false, + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)", + Expected: true, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilGroupNotExists uses the Auto Scaling API operation +// DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error { + return c.WaitUntilGroupNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilGroupNotExistsWithContext is an extended version of WaitUntilGroupNotExists. +// 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 *AutoScaling) WaitUntilGroupNotExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilGroupNotExists", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", + Expected: false, + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`", + Expected: true, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAutoScalingGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAutoScalingGroupsRequest(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/elb/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/elb/BUILD.bazel new file mode 100644 index 00000000000..eb15df09b06 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "doc.go", + "errors.go", + "service.go", + "waiters.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/elb", + importpath = "github.com/aws/aws-sdk-go/service/elb", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/query:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go new file mode 100644 index 00000000000..bb3af054023 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go @@ -0,0 +1,6482 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elb + +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 opAddTags = "AddTags" + +// AddTagsRequest generates a "aws/request.Request" representing the +// client's request for the AddTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AddTags for more information on using the AddTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AddTagsRequest method. +// req, resp := client.AddTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags +func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { + op := &request.Operation{ + Name: opAddTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddTagsInput{} + } + + output = &AddTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// AddTags API operation for Elastic Load Balancing. +// +// Adds the specified tags to the specified load balancer. Each load balancer +// can have a maximum of 10 tags. +// +// Each tag consists of a key and an optional value. If a tag with the same +// key is already associated with the load balancer, AddTags updates its value. +// +// For more information, see Tag Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation AddTags for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeTooManyTagsException "TooManyTags" +// The quota for the number of tags that can be assigned to a load balancer +// has been reached. +// +// * ErrCodeDuplicateTagKeysException "DuplicateTagKeys" +// A tag key was specified more than once. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags +func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opApplySecurityGroupsToLoadBalancer = "ApplySecurityGroupsToLoadBalancer" + +// ApplySecurityGroupsToLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the ApplySecurityGroupsToLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ApplySecurityGroupsToLoadBalancer for more information on using the ApplySecurityGroupsToLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ApplySecurityGroupsToLoadBalancerRequest method. +// req, resp := client.ApplySecurityGroupsToLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer +func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroupsToLoadBalancerInput) (req *request.Request, output *ApplySecurityGroupsToLoadBalancerOutput) { + op := &request.Operation{ + Name: opApplySecurityGroupsToLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ApplySecurityGroupsToLoadBalancerInput{} + } + + output = &ApplySecurityGroupsToLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// ApplySecurityGroupsToLoadBalancer API operation for Elastic Load Balancing. +// +// Associates one or more security groups with your load balancer in a virtual +// private cloud (VPC). The specified security groups override the previously +// associated security groups. +// +// For more information, see Security Groups for Load Balancers in a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation ApplySecurityGroupsToLoadBalancer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// * ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" +// One or more of the specified security groups do not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer +func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error) { + req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) + return out, req.Send() +} + +// ApplySecurityGroupsToLoadBalancerWithContext is the same as ApplySecurityGroupsToLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See ApplySecurityGroupsToLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) ApplySecurityGroupsToLoadBalancerWithContext(ctx aws.Context, input *ApplySecurityGroupsToLoadBalancerInput, opts ...request.Option) (*ApplySecurityGroupsToLoadBalancerOutput, error) { + req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAttachLoadBalancerToSubnets = "AttachLoadBalancerToSubnets" + +// AttachLoadBalancerToSubnetsRequest generates a "aws/request.Request" representing the +// client's request for the AttachLoadBalancerToSubnets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachLoadBalancerToSubnets for more information on using the AttachLoadBalancerToSubnets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachLoadBalancerToSubnetsRequest method. +// req, resp := client.AttachLoadBalancerToSubnetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets +func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubnetsInput) (req *request.Request, output *AttachLoadBalancerToSubnetsOutput) { + op := &request.Operation{ + Name: opAttachLoadBalancerToSubnets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachLoadBalancerToSubnetsInput{} + } + + output = &AttachLoadBalancerToSubnetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// AttachLoadBalancerToSubnets API operation for Elastic Load Balancing. +// +// Adds one or more subnets to the set of configured subnets for the specified +// load balancer. +// +// The load balancer evenly distributes requests across all registered subnets. +// For more information, see Add or Remove Subnets for Your Load Balancer in +// a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation AttachLoadBalancerToSubnets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// * ErrCodeSubnetNotFoundException "SubnetNotFound" +// One or more of the specified subnets do not exist. +// +// * ErrCodeInvalidSubnetException "InvalidSubnet" +// The specified VPC has no associated Internet gateway. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets +func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error) { + req, out := c.AttachLoadBalancerToSubnetsRequest(input) + return out, req.Send() +} + +// AttachLoadBalancerToSubnetsWithContext is the same as AttachLoadBalancerToSubnets with the addition of +// the ability to pass a context and additional request options. +// +// See AttachLoadBalancerToSubnets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) AttachLoadBalancerToSubnetsWithContext(ctx aws.Context, input *AttachLoadBalancerToSubnetsInput, opts ...request.Option) (*AttachLoadBalancerToSubnetsOutput, error) { + req, out := c.AttachLoadBalancerToSubnetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opConfigureHealthCheck = "ConfigureHealthCheck" + +// ConfigureHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the ConfigureHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ConfigureHealthCheck for more information on using the ConfigureHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ConfigureHealthCheckRequest method. +// req, resp := client.ConfigureHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck +func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req *request.Request, output *ConfigureHealthCheckOutput) { + op := &request.Operation{ + Name: opConfigureHealthCheck, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ConfigureHealthCheckInput{} + } + + output = &ConfigureHealthCheckOutput{} + req = c.newRequest(op, input, output) + return +} + +// ConfigureHealthCheck API operation for Elastic Load Balancing. +// +// Specifies the health check settings to use when evaluating the health state +// of your EC2 instances. +// +// For more information, see Configure Health Checks for Your Load Balancer +// (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation ConfigureHealthCheck for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck +func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error) { + req, out := c.ConfigureHealthCheckRequest(input) + return out, req.Send() +} + +// ConfigureHealthCheckWithContext is the same as ConfigureHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See ConfigureHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) ConfigureHealthCheckWithContext(ctx aws.Context, input *ConfigureHealthCheckInput, opts ...request.Option) (*ConfigureHealthCheckOutput, error) { + req, out := c.ConfigureHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateAppCookieStickinessPolicy = "CreateAppCookieStickinessPolicy" + +// CreateAppCookieStickinessPolicyRequest generates a "aws/request.Request" representing the +// client's request for the CreateAppCookieStickinessPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAppCookieStickinessPolicy for more information on using the CreateAppCookieStickinessPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAppCookieStickinessPolicyRequest method. +// req, resp := client.CreateAppCookieStickinessPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy +func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStickinessPolicyInput) (req *request.Request, output *CreateAppCookieStickinessPolicyOutput) { + op := &request.Operation{ + Name: opCreateAppCookieStickinessPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateAppCookieStickinessPolicyInput{} + } + + output = &CreateAppCookieStickinessPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateAppCookieStickinessPolicy API operation for Elastic Load Balancing. +// +// Generates a stickiness policy with sticky session lifetimes that follow that +// of an application-generated cookie. This policy can be associated only with +// HTTP/HTTPS listeners. +// +// This policy is similar to the policy created by CreateLBCookieStickinessPolicy, +// except that the lifetime of the special Elastic Load Balancing cookie, AWSELB, +// follows the lifetime of the application-generated cookie specified in the +// policy configuration. The load balancer only inserts a new stickiness cookie +// when the application response includes a new application cookie. +// +// If the application cookie is explicitly removed or expires, the session stops +// being sticky until a new application cookie is issued. +// +// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation CreateAppCookieStickinessPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" +// A policy with the specified name already exists for this load balancer. +// +// * ErrCodeTooManyPoliciesException "TooManyPolicies" +// The quota for the number of policies for this load balancer has been reached. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy +func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error) { + req, out := c.CreateAppCookieStickinessPolicyRequest(input) + return out, req.Send() +} + +// CreateAppCookieStickinessPolicyWithContext is the same as CreateAppCookieStickinessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAppCookieStickinessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) CreateAppCookieStickinessPolicyWithContext(ctx aws.Context, input *CreateAppCookieStickinessPolicyInput, opts ...request.Option) (*CreateAppCookieStickinessPolicyOutput, error) { + req, out := c.CreateAppCookieStickinessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLBCookieStickinessPolicy = "CreateLBCookieStickinessPolicy" + +// CreateLBCookieStickinessPolicyRequest generates a "aws/request.Request" representing the +// client's request for the CreateLBCookieStickinessPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLBCookieStickinessPolicy for more information on using the CreateLBCookieStickinessPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLBCookieStickinessPolicyRequest method. +// req, resp := client.CreateLBCookieStickinessPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy +func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickinessPolicyInput) (req *request.Request, output *CreateLBCookieStickinessPolicyOutput) { + op := &request.Operation{ + Name: opCreateLBCookieStickinessPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLBCookieStickinessPolicyInput{} + } + + output = &CreateLBCookieStickinessPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLBCookieStickinessPolicy API operation for Elastic Load Balancing. +// +// Generates a stickiness policy with sticky session lifetimes controlled by +// the lifetime of the browser (user-agent) or a specified expiration period. +// This policy can be associated only with HTTP/HTTPS listeners. +// +// When a load balancer implements this policy, the load balancer uses a special +// cookie to track the instance for each request. When the load balancer receives +// a request, it first checks to see if this cookie is present in the request. +// If so, the load balancer sends the request to the application server specified +// in the cookie. If not, the load balancer sends the request to a server that +// is chosen based on the existing load-balancing algorithm. +// +// A cookie is inserted into the response for binding subsequent requests from +// the same user to that server. The validity of the cookie is based on the +// cookie expiration time, which is specified in the policy configuration. +// +// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation CreateLBCookieStickinessPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" +// A policy with the specified name already exists for this load balancer. +// +// * ErrCodeTooManyPoliciesException "TooManyPolicies" +// The quota for the number of policies for this load balancer has been reached. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy +func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error) { + req, out := c.CreateLBCookieStickinessPolicyRequest(input) + return out, req.Send() +} + +// CreateLBCookieStickinessPolicyWithContext is the same as CreateLBCookieStickinessPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLBCookieStickinessPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) CreateLBCookieStickinessPolicyWithContext(ctx aws.Context, input *CreateLBCookieStickinessPolicyInput, opts ...request.Option) (*CreateLBCookieStickinessPolicyOutput, error) { + req, out := c.CreateLBCookieStickinessPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLoadBalancer = "CreateLoadBalancer" + +// CreateLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the CreateLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLoadBalancer for more information on using the CreateLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLoadBalancerRequest method. +// req, resp := client.CreateLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer +func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *request.Request, output *CreateLoadBalancerOutput) { + op := &request.Operation{ + Name: opCreateLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLoadBalancerInput{} + } + + output = &CreateLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLoadBalancer API operation for Elastic Load Balancing. +// +// Creates a Classic Load Balancer. +// +// You can add listeners, security groups, subnets, and tags when you create +// your load balancer, or you can add them later using CreateLoadBalancerListeners, +// ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags. +// +// To describe your current load balancers, see DescribeLoadBalancers. When +// you are finished with a load balancer, you can delete it using DeleteLoadBalancer. +// +// You can create up to 20 load balancers per region per account. You can request +// an increase for the number of load balancers for your account. For more information, +// see Limits for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation CreateLoadBalancer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDuplicateAccessPointNameException "DuplicateLoadBalancerName" +// The specified load balancer name already exists for this account. +// +// * ErrCodeTooManyAccessPointsException "TooManyLoadBalancers" +// The quota for the number of load balancers has been reached. +// +// * ErrCodeCertificateNotFoundException "CertificateNotFound" +// The specified ARN does not refer to a valid SSL certificate in AWS Identity +// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if +// you recently uploaded the certificate to IAM, this error might indicate that +// the certificate is not fully available yet. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// * ErrCodeSubnetNotFoundException "SubnetNotFound" +// One or more of the specified subnets do not exist. +// +// * ErrCodeInvalidSubnetException "InvalidSubnet" +// The specified VPC has no associated Internet gateway. +// +// * ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" +// One or more of the specified security groups do not exist. +// +// * ErrCodeInvalidSchemeException "InvalidScheme" +// The specified value for the schema is not valid. You can only specify a scheme +// for load balancers in a VPC. +// +// * ErrCodeTooManyTagsException "TooManyTags" +// The quota for the number of tags that can be assigned to a load balancer +// has been reached. +// +// * ErrCodeDuplicateTagKeysException "DuplicateTagKeys" +// A tag key was specified more than once. +// +// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" +// The specified protocol or signature version is not supported. +// +// * ErrCodeOperationNotPermittedException "OperationNotPermitted" +// This operation is not allowed. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer +func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { + req, out := c.CreateLoadBalancerRequest(input) + return out, req.Send() +} + +// CreateLoadBalancerWithContext is the same as CreateLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) CreateLoadBalancerWithContext(ctx aws.Context, input *CreateLoadBalancerInput, opts ...request.Option) (*CreateLoadBalancerOutput, error) { + req, out := c.CreateLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLoadBalancerListeners = "CreateLoadBalancerListeners" + +// CreateLoadBalancerListenersRequest generates a "aws/request.Request" representing the +// client's request for the CreateLoadBalancerListeners operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLoadBalancerListeners for more information on using the CreateLoadBalancerListeners +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLoadBalancerListenersRequest method. +// req, resp := client.CreateLoadBalancerListenersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners +func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListenersInput) (req *request.Request, output *CreateLoadBalancerListenersOutput) { + op := &request.Operation{ + Name: opCreateLoadBalancerListeners, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLoadBalancerListenersInput{} + } + + output = &CreateLoadBalancerListenersOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLoadBalancerListeners API operation for Elastic Load Balancing. +// +// Creates one or more listeners for the specified load balancer. If a listener +// with the specified port does not already exist, it is created; otherwise, +// the properties of the new listener must match the properties of the existing +// listener. +// +// For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation CreateLoadBalancerListeners for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeDuplicateListenerException "DuplicateListener" +// A listener already exists for the specified load balancer name and port, +// but with a different instance port, protocol, or SSL certificate. +// +// * ErrCodeCertificateNotFoundException "CertificateNotFound" +// The specified ARN does not refer to a valid SSL certificate in AWS Identity +// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if +// you recently uploaded the certificate to IAM, this error might indicate that +// the certificate is not fully available yet. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" +// The specified protocol or signature version is not supported. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners +func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (*CreateLoadBalancerListenersOutput, error) { + req, out := c.CreateLoadBalancerListenersRequest(input) + return out, req.Send() +} + +// CreateLoadBalancerListenersWithContext is the same as CreateLoadBalancerListeners with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancerListeners for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) CreateLoadBalancerListenersWithContext(ctx aws.Context, input *CreateLoadBalancerListenersInput, opts ...request.Option) (*CreateLoadBalancerListenersOutput, error) { + req, out := c.CreateLoadBalancerListenersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLoadBalancerPolicy = "CreateLoadBalancerPolicy" + +// CreateLoadBalancerPolicyRequest generates a "aws/request.Request" representing the +// client's request for the CreateLoadBalancerPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLoadBalancerPolicy for more information on using the CreateLoadBalancerPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLoadBalancerPolicyRequest method. +// req, resp := client.CreateLoadBalancerPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy +func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInput) (req *request.Request, output *CreateLoadBalancerPolicyOutput) { + op := &request.Operation{ + Name: opCreateLoadBalancerPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLoadBalancerPolicyInput{} + } + + output = &CreateLoadBalancerPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLoadBalancerPolicy API operation for Elastic Load Balancing. +// +// Creates a policy with the specified attributes for the specified load balancer. +// +// Policies are settings that are saved for your load balancer and that can +// be applied to the listener or the application server, depending on the policy +// 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 Elastic Load Balancing's +// API operation CreateLoadBalancerPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodePolicyTypeNotFoundException "PolicyTypeNotFound" +// One or more of the specified policy types do not exist. +// +// * ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" +// A policy with the specified name already exists for this load balancer. +// +// * ErrCodeTooManyPoliciesException "TooManyPolicies" +// The quota for the number of policies for this load balancer has been reached. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy +func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error) { + req, out := c.CreateLoadBalancerPolicyRequest(input) + return out, req.Send() +} + +// CreateLoadBalancerPolicyWithContext is the same as CreateLoadBalancerPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoadBalancerPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) CreateLoadBalancerPolicyWithContext(ctx aws.Context, input *CreateLoadBalancerPolicyInput, opts ...request.Option) (*CreateLoadBalancerPolicyOutput, error) { + req, out := c.CreateLoadBalancerPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLoadBalancer = "DeleteLoadBalancer" + +// DeleteLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLoadBalancer for more information on using the DeleteLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLoadBalancerRequest method. +// req, resp := client.DeleteLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer +func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *request.Request, output *DeleteLoadBalancerOutput) { + op := &request.Operation{ + Name: opDeleteLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLoadBalancerInput{} + } + + output = &DeleteLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteLoadBalancer API operation for Elastic Load Balancing. +// +// Deletes the specified load balancer. +// +// If you are attempting to recreate a load balancer, you must reconfigure all +// settings. The DNS name associated with a deleted load balancer are no longer +// usable. The name and associated DNS record of the deleted load balancer no +// longer exist and traffic sent to any of its IP addresses is no longer delivered +// to your instances. +// +// If the load balancer does not exist or has already been deleted, the call +// to DeleteLoadBalancer still succeeds. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DeleteLoadBalancer for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer +func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error) { + req, out := c.DeleteLoadBalancerRequest(input) + return out, req.Send() +} + +// DeleteLoadBalancerWithContext is the same as DeleteLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DeleteLoadBalancerWithContext(ctx aws.Context, input *DeleteLoadBalancerInput, opts ...request.Option) (*DeleteLoadBalancerOutput, error) { + req, out := c.DeleteLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLoadBalancerListeners = "DeleteLoadBalancerListeners" + +// DeleteLoadBalancerListenersRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLoadBalancerListeners operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLoadBalancerListeners for more information on using the DeleteLoadBalancerListeners +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLoadBalancerListenersRequest method. +// req, resp := client.DeleteLoadBalancerListenersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners +func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListenersInput) (req *request.Request, output *DeleteLoadBalancerListenersOutput) { + op := &request.Operation{ + Name: opDeleteLoadBalancerListeners, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLoadBalancerListenersInput{} + } + + output = &DeleteLoadBalancerListenersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteLoadBalancerListeners API operation for Elastic Load Balancing. +// +// Deletes the specified listeners from the specified load balancer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DeleteLoadBalancerListeners for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners +func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInput) (*DeleteLoadBalancerListenersOutput, error) { + req, out := c.DeleteLoadBalancerListenersRequest(input) + return out, req.Send() +} + +// DeleteLoadBalancerListenersWithContext is the same as DeleteLoadBalancerListeners with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancerListeners for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DeleteLoadBalancerListenersWithContext(ctx aws.Context, input *DeleteLoadBalancerListenersInput, opts ...request.Option) (*DeleteLoadBalancerListenersOutput, error) { + req, out := c.DeleteLoadBalancerListenersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLoadBalancerPolicy = "DeleteLoadBalancerPolicy" + +// DeleteLoadBalancerPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLoadBalancerPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLoadBalancerPolicy for more information on using the DeleteLoadBalancerPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLoadBalancerPolicyRequest method. +// req, resp := client.DeleteLoadBalancerPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy +func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInput) (req *request.Request, output *DeleteLoadBalancerPolicyOutput) { + op := &request.Operation{ + Name: opDeleteLoadBalancerPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLoadBalancerPolicyInput{} + } + + output = &DeleteLoadBalancerPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteLoadBalancerPolicy API operation for Elastic Load Balancing. +// +// Deletes the specified policy from the specified load balancer. This policy +// must not be enabled for any listeners. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DeleteLoadBalancerPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy +func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (*DeleteLoadBalancerPolicyOutput, error) { + req, out := c.DeleteLoadBalancerPolicyRequest(input) + return out, req.Send() +} + +// DeleteLoadBalancerPolicyWithContext is the same as DeleteLoadBalancerPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoadBalancerPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DeleteLoadBalancerPolicyWithContext(ctx aws.Context, input *DeleteLoadBalancerPolicyInput, opts ...request.Option) (*DeleteLoadBalancerPolicyOutput, error) { + req, out := c.DeleteLoadBalancerPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeregisterInstancesFromLoadBalancer = "DeregisterInstancesFromLoadBalancer" + +// DeregisterInstancesFromLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterInstancesFromLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterInstancesFromLoadBalancer for more information on using the DeregisterInstancesFromLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterInstancesFromLoadBalancerRequest method. +// req, resp := client.DeregisterInstancesFromLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer +func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstancesFromLoadBalancerInput) (req *request.Request, output *DeregisterInstancesFromLoadBalancerOutput) { + op := &request.Operation{ + Name: opDeregisterInstancesFromLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterInstancesFromLoadBalancerInput{} + } + + output = &DeregisterInstancesFromLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeregisterInstancesFromLoadBalancer API operation for Elastic Load Balancing. +// +// Deregisters the specified instances from the specified load balancer. After +// the instance is deregistered, it no longer receives traffic from the load +// balancer. +// +// You can use DescribeLoadBalancers to verify that the instance is deregistered +// from the load balancer. +// +// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation DeregisterInstancesFromLoadBalancer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidEndPointException "InvalidInstance" +// The specified endpoint is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer +func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (*DeregisterInstancesFromLoadBalancerOutput, error) { + req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) + return out, req.Send() +} + +// DeregisterInstancesFromLoadBalancerWithContext is the same as DeregisterInstancesFromLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterInstancesFromLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DeregisterInstancesFromLoadBalancerWithContext(ctx aws.Context, input *DeregisterInstancesFromLoadBalancerInput, opts ...request.Option) (*DeregisterInstancesFromLoadBalancerOutput, error) { + req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeAccountLimits = "DescribeAccountLimits" + +// DescribeAccountLimitsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAccountLimits operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAccountLimits for more information on using the DescribeAccountLimits +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAccountLimitsRequest method. +// req, resp := client.DescribeAccountLimitsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeAccountLimits +func (c *ELB) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *request.Request, output *DescribeAccountLimitsOutput) { + op := &request.Operation{ + Name: opDescribeAccountLimits, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeAccountLimitsInput{} + } + + output = &DescribeAccountLimitsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAccountLimits API operation for Elastic Load Balancing. +// +// Describes the current Elastic Load Balancing resource limits for your AWS +// account. +// +// For more information, see Limits for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation DescribeAccountLimits for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeAccountLimits +func (c *ELB) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { + req, out := c.DescribeAccountLimitsRequest(input) + return out, req.Send() +} + +// DescribeAccountLimitsWithContext is the same as DescribeAccountLimits with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAccountLimits for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DescribeAccountLimitsWithContext(ctx aws.Context, input *DescribeAccountLimitsInput, opts ...request.Option) (*DescribeAccountLimitsOutput, error) { + req, out := c.DescribeAccountLimitsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeInstanceHealth = "DescribeInstanceHealth" + +// DescribeInstanceHealthRequest generates a "aws/request.Request" representing the +// client's request for the DescribeInstanceHealth operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeInstanceHealth for more information on using the DescribeInstanceHealth +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeInstanceHealthRequest method. +// req, resp := client.DescribeInstanceHealthRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth +func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) (req *request.Request, output *DescribeInstanceHealthOutput) { + op := &request.Operation{ + Name: opDescribeInstanceHealth, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeInstanceHealthInput{} + } + + output = &DescribeInstanceHealthOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeInstanceHealth API operation for Elastic Load Balancing. +// +// Describes the state of the specified instances with respect to the specified +// load balancer. If no instances are specified, the call describes the state +// of all instances that are currently registered with the load balancer. If +// instances are specified, their state is returned even if they are no longer +// registered with the load balancer. The state of terminated instances is not +// returned. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DescribeInstanceHealth for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidEndPointException "InvalidInstance" +// The specified endpoint is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth +func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*DescribeInstanceHealthOutput, error) { + req, out := c.DescribeInstanceHealthRequest(input) + return out, req.Send() +} + +// DescribeInstanceHealthWithContext is the same as DescribeInstanceHealth with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceHealth for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DescribeInstanceHealthWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.Option) (*DescribeInstanceHealthOutput, error) { + req, out := c.DescribeInstanceHealthRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" + +// DescribeLoadBalancerAttributesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLoadBalancerAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLoadBalancerAttributes for more information on using the DescribeLoadBalancerAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLoadBalancerAttributesRequest method. +// req, resp := client.DescribeLoadBalancerAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes +func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) (req *request.Request, output *DescribeLoadBalancerAttributesOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancerAttributesInput{} + } + + output = &DescribeLoadBalancerAttributesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLoadBalancerAttributes API operation for Elastic Load Balancing. +// +// Describes the attributes for the specified load balancer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DescribeLoadBalancerAttributes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeLoadBalancerAttributeNotFoundException "LoadBalancerAttributeNotFound" +// The specified load balancer attribute does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes +func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error) { + req, out := c.DescribeLoadBalancerAttributesRequest(input) + return out, req.Send() +} + +// DescribeLoadBalancerAttributesWithContext is the same as DescribeLoadBalancerAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DescribeLoadBalancerAttributesWithContext(ctx aws.Context, input *DescribeLoadBalancerAttributesInput, opts ...request.Option) (*DescribeLoadBalancerAttributesOutput, error) { + req, out := c.DescribeLoadBalancerAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLoadBalancerPolicies = "DescribeLoadBalancerPolicies" + +// DescribeLoadBalancerPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLoadBalancerPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLoadBalancerPolicies for more information on using the DescribeLoadBalancerPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLoadBalancerPoliciesRequest method. +// req, resp := client.DescribeLoadBalancerPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies +func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPoliciesInput) (req *request.Request, output *DescribeLoadBalancerPoliciesOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancerPoliciesInput{} + } + + output = &DescribeLoadBalancerPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLoadBalancerPolicies API operation for Elastic Load Balancing. +// +// Describes the specified policies. +// +// If you specify a load balancer name, the action returns the descriptions +// of all policies created for the load balancer. If you specify a policy name +// associated with your load balancer, the action returns the description of +// that policy. If you don't specify a load balancer name, the action returns +// descriptions of the specified sample policies, or descriptions of all sample +// policies. The names of the sample policies have the ELBSample- prefix. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DescribeLoadBalancerPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodePolicyNotFoundException "PolicyNotFound" +// One or more of the specified policies do not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies +func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesInput) (*DescribeLoadBalancerPoliciesOutput, error) { + req, out := c.DescribeLoadBalancerPoliciesRequest(input) + return out, req.Send() +} + +// DescribeLoadBalancerPoliciesWithContext is the same as DescribeLoadBalancerPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DescribeLoadBalancerPoliciesWithContext(ctx aws.Context, input *DescribeLoadBalancerPoliciesInput, opts ...request.Option) (*DescribeLoadBalancerPoliciesOutput, error) { + req, out := c.DescribeLoadBalancerPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLoadBalancerPolicyTypes = "DescribeLoadBalancerPolicyTypes" + +// DescribeLoadBalancerPolicyTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLoadBalancerPolicyTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLoadBalancerPolicyTypes for more information on using the DescribeLoadBalancerPolicyTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLoadBalancerPolicyTypesRequest method. +// req, resp := client.DescribeLoadBalancerPolicyTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes +func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancerPolicyTypesInput) (req *request.Request, output *DescribeLoadBalancerPolicyTypesOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerPolicyTypes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancerPolicyTypesInput{} + } + + output = &DescribeLoadBalancerPolicyTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLoadBalancerPolicyTypes API operation for Elastic Load Balancing. +// +// Describes the specified load balancer policy types or all load balancer policy +// types. +// +// The description of each type indicates how it can be used. For example, some +// policies can be used only with layer 7 listeners, some policies can be used +// only with layer 4 listeners, and some policies can be used only with your +// EC2 instances. +// +// You can use CreateLoadBalancerPolicy to create a policy configuration for +// any of these policy types. Then, depending on the policy type, use either +// SetLoadBalancerPoliciesOfListener or SetLoadBalancerPoliciesForBackendServer +// to set the policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DescribeLoadBalancerPolicyTypes for usage and error information. +// +// Returned Error Codes: +// * ErrCodePolicyTypeNotFoundException "PolicyTypeNotFound" +// One or more of the specified policy types do not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes +func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (*DescribeLoadBalancerPolicyTypesOutput, error) { + req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) + return out, req.Send() +} + +// DescribeLoadBalancerPolicyTypesWithContext is the same as DescribeLoadBalancerPolicyTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancerPolicyTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DescribeLoadBalancerPolicyTypesWithContext(ctx aws.Context, input *DescribeLoadBalancerPolicyTypesInput, opts ...request.Option) (*DescribeLoadBalancerPolicyTypesOutput, error) { + req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeLoadBalancers = "DescribeLoadBalancers" + +// DescribeLoadBalancersRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLoadBalancers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLoadBalancers for more information on using the DescribeLoadBalancers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLoadBalancersRequest method. +// req, resp := client.DescribeLoadBalancersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers +func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeLoadBalancersInput{} + } + + output = &DescribeLoadBalancersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLoadBalancers API operation for Elastic Load Balancing. +// +// Describes the specified the load balancers. If no load balancers are specified, +// the call describes all of your load balancers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DescribeLoadBalancers for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeDependencyThrottleException "DependencyThrottle" +// A request made by Elastic Load Balancing to another service exceeds the maximum +// request rate permitted for your account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers +func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + return out, req.Send() +} + +// DescribeLoadBalancersWithContext is the same as DescribeLoadBalancers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLoadBalancers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DescribeLoadBalancersWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.Option) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLoadBalancers 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 DescribeLoadBalancers operation. +// pageNum := 0 +// err := client.DescribeLoadBalancersPages(params, +// func(page *DescribeLoadBalancersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool) error { + return c.DescribeLoadBalancersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeLoadBalancersPagesWithContext same as DescribeLoadBalancersPages 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 *ELB) DescribeLoadBalancersPagesWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) + } + return p.Err() +} + +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/elasticloadbalancing-2012-06-01/DescribeTags +func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { + op := &request.Operation{ + Name: opDescribeTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTagsInput{} + } + + output = &DescribeTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTags API operation for Elastic Load Balancing. +// +// Describes the tags associated with the specified load balancers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DescribeTags for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTags +func (c *ELB) 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 *ELB) 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() +} + +const opDetachLoadBalancerFromSubnets = "DetachLoadBalancerFromSubnets" + +// DetachLoadBalancerFromSubnetsRequest generates a "aws/request.Request" representing the +// client's request for the DetachLoadBalancerFromSubnets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachLoadBalancerFromSubnets for more information on using the DetachLoadBalancerFromSubnets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachLoadBalancerFromSubnetsRequest method. +// req, resp := client.DetachLoadBalancerFromSubnetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets +func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFromSubnetsInput) (req *request.Request, output *DetachLoadBalancerFromSubnetsOutput) { + op := &request.Operation{ + Name: opDetachLoadBalancerFromSubnets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachLoadBalancerFromSubnetsInput{} + } + + output = &DetachLoadBalancerFromSubnetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DetachLoadBalancerFromSubnets API operation for Elastic Load Balancing. +// +// Removes the specified subnets from the set of configured subnets for the +// load balancer. +// +// After a subnet is removed, all EC2 instances registered with the load balancer +// in the removed subnet go into the OutOfService state. Then, the load balancer +// balances the traffic among the remaining routable subnets. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation DetachLoadBalancerFromSubnets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets +func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnetsInput) (*DetachLoadBalancerFromSubnetsOutput, error) { + req, out := c.DetachLoadBalancerFromSubnetsRequest(input) + return out, req.Send() +} + +// DetachLoadBalancerFromSubnetsWithContext is the same as DetachLoadBalancerFromSubnets with the addition of +// the ability to pass a context and additional request options. +// +// See DetachLoadBalancerFromSubnets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DetachLoadBalancerFromSubnetsWithContext(ctx aws.Context, input *DetachLoadBalancerFromSubnetsInput, opts ...request.Option) (*DetachLoadBalancerFromSubnetsOutput, error) { + req, out := c.DetachLoadBalancerFromSubnetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisableAvailabilityZonesForLoadBalancer = "DisableAvailabilityZonesForLoadBalancer" + +// DisableAvailabilityZonesForLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the DisableAvailabilityZonesForLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisableAvailabilityZonesForLoadBalancer for more information on using the DisableAvailabilityZonesForLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisableAvailabilityZonesForLoadBalancerRequest method. +// req, resp := client.DisableAvailabilityZonesForLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer +func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *DisableAvailabilityZonesForLoadBalancerOutput) { + op := &request.Operation{ + Name: opDisableAvailabilityZonesForLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableAvailabilityZonesForLoadBalancerInput{} + } + + output = &DisableAvailabilityZonesForLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisableAvailabilityZonesForLoadBalancer API operation for Elastic Load Balancing. +// +// Removes the specified Availability Zones from the set of Availability Zones +// for the specified load balancer in EC2-Classic or a default VPC. +// +// For load balancers in a non-default VPC, use DetachLoadBalancerFromSubnets. +// +// There must be at least one Availability Zone registered with a load balancer +// at all times. After an Availability Zone is removed, all instances registered +// with the load balancer that are in the removed Availability Zone go into +// the OutOfService state. Then, the load balancer attempts to equally balance +// the traffic among its remaining Availability Zones. +// +// For more information, see Add or Remove Availability Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation DisableAvailabilityZonesForLoadBalancer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer +func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { + req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) + return out, req.Send() +} + +// DisableAvailabilityZonesForLoadBalancerWithContext is the same as DisableAvailabilityZonesForLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See DisableAvailabilityZonesForLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) DisableAvailabilityZonesForLoadBalancerWithContext(ctx aws.Context, input *DisableAvailabilityZonesForLoadBalancerInput, opts ...request.Option) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { + req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opEnableAvailabilityZonesForLoadBalancer = "EnableAvailabilityZonesForLoadBalancer" + +// EnableAvailabilityZonesForLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the EnableAvailabilityZonesForLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableAvailabilityZonesForLoadBalancer for more information on using the EnableAvailabilityZonesForLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableAvailabilityZonesForLoadBalancerRequest method. +// req, resp := client.EnableAvailabilityZonesForLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer +func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *EnableAvailabilityZonesForLoadBalancerOutput) { + op := &request.Operation{ + Name: opEnableAvailabilityZonesForLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableAvailabilityZonesForLoadBalancerInput{} + } + + output = &EnableAvailabilityZonesForLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// EnableAvailabilityZonesForLoadBalancer API operation for Elastic Load Balancing. +// +// Adds the specified Availability Zones to the set of Availability Zones for +// the specified load balancer in EC2-Classic or a default VPC. +// +// For load balancers in a non-default VPC, use AttachLoadBalancerToSubnets. +// +// The load balancer evenly distributes requests across all its registered Availability +// Zones that contain instances. For more information, see Add or Remove Availability +// Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation EnableAvailabilityZonesForLoadBalancer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer +func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { + req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) + return out, req.Send() +} + +// EnableAvailabilityZonesForLoadBalancerWithContext is the same as EnableAvailabilityZonesForLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See EnableAvailabilityZonesForLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) EnableAvailabilityZonesForLoadBalancerWithContext(ctx aws.Context, input *EnableAvailabilityZonesForLoadBalancerInput, opts ...request.Option) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { + req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" + +// ModifyLoadBalancerAttributesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyLoadBalancerAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyLoadBalancerAttributes for more information on using the ModifyLoadBalancerAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyLoadBalancerAttributesRequest method. +// req, resp := client.ModifyLoadBalancerAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes +func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) (req *request.Request, output *ModifyLoadBalancerAttributesOutput) { + op := &request.Operation{ + Name: opModifyLoadBalancerAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyLoadBalancerAttributesInput{} + } + + output = &ModifyLoadBalancerAttributesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyLoadBalancerAttributes API operation for Elastic Load Balancing. +// +// Modifies the attributes of the specified load balancer. +// +// You can modify the load balancer attributes, such as AccessLogs, ConnectionDraining, +// and CrossZoneLoadBalancing by either enabling or disabling them. Or, you +// can modify the load balancer attribute ConnectionSettings by specifying an +// idle connection timeout value for your load balancer. +// +// For more information, see the following in the Classic Load Balancers Guide: +// +// * Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) +// +// * Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) +// +// * Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) +// +// * Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.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 Elastic Load Balancing's +// API operation ModifyLoadBalancerAttributes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeLoadBalancerAttributeNotFoundException "LoadBalancerAttributeNotFound" +// The specified load balancer attribute does not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes +func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { + req, out := c.ModifyLoadBalancerAttributesRequest(input) + return out, req.Send() +} + +// ModifyLoadBalancerAttributesWithContext is the same as ModifyLoadBalancerAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyLoadBalancerAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) ModifyLoadBalancerAttributesWithContext(ctx aws.Context, input *ModifyLoadBalancerAttributesInput, opts ...request.Option) (*ModifyLoadBalancerAttributesOutput, error) { + req, out := c.ModifyLoadBalancerAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRegisterInstancesWithLoadBalancer = "RegisterInstancesWithLoadBalancer" + +// RegisterInstancesWithLoadBalancerRequest generates a "aws/request.Request" representing the +// client's request for the RegisterInstancesWithLoadBalancer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RegisterInstancesWithLoadBalancer for more information on using the RegisterInstancesWithLoadBalancer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RegisterInstancesWithLoadBalancerRequest method. +// req, resp := client.RegisterInstancesWithLoadBalancerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer +func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesWithLoadBalancerInput) (req *request.Request, output *RegisterInstancesWithLoadBalancerOutput) { + op := &request.Operation{ + Name: opRegisterInstancesWithLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RegisterInstancesWithLoadBalancerInput{} + } + + output = &RegisterInstancesWithLoadBalancerOutput{} + req = c.newRequest(op, input, output) + return +} + +// RegisterInstancesWithLoadBalancer API operation for Elastic Load Balancing. +// +// Adds the specified instances to the specified load balancer. +// +// The instance must be a running instance in the same network as the load balancer +// (EC2-Classic or the same VPC). If you have EC2-Classic instances and a load +// balancer in a VPC with ClassicLink enabled, you can link the EC2-Classic +// instances to that VPC and then register the linked EC2-Classic instances +// with the load balancer in the VPC. +// +// Note that RegisterInstanceWithLoadBalancer completes when the request has +// been registered. Instance registration takes a little time to complete. To +// check the state of the registered instances, use DescribeLoadBalancers or +// DescribeInstanceHealth. +// +// After the instance is registered, it starts receiving traffic and requests +// from the load balancer. Any instance that is not in one of the Availability +// Zones registered for the load balancer is moved to the OutOfService state. +// If an Availability Zone is added to the load balancer later, any instances +// registered with the load balancer move to the InService state. +// +// To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer. +// +// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation RegisterInstancesWithLoadBalancer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeInvalidEndPointException "InvalidInstance" +// The specified endpoint is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer +func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (*RegisterInstancesWithLoadBalancerOutput, error) { + req, out := c.RegisterInstancesWithLoadBalancerRequest(input) + return out, req.Send() +} + +// RegisterInstancesWithLoadBalancerWithContext is the same as RegisterInstancesWithLoadBalancer with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterInstancesWithLoadBalancer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) RegisterInstancesWithLoadBalancerWithContext(ctx aws.Context, input *RegisterInstancesWithLoadBalancerInput, opts ...request.Option) (*RegisterInstancesWithLoadBalancerOutput, error) { + req, out := c.RegisterInstancesWithLoadBalancerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemoveTags = "RemoveTags" + +// RemoveTagsRequest generates a "aws/request.Request" representing the +// client's request for the RemoveTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveTags for more information on using the RemoveTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveTagsRequest method. +// req, resp := client.RemoveTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags +func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { + op := &request.Operation{ + Name: opRemoveTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveTagsInput{} + } + + output = &RemoveTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// RemoveTags API operation for Elastic Load Balancing. +// +// Removes one or more tags from the specified load balancer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Elastic Load Balancing's +// API operation RemoveTags for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags +func (c *ELB) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetLoadBalancerListenerSSLCertificate = "SetLoadBalancerListenerSSLCertificate" + +// SetLoadBalancerListenerSSLCertificateRequest generates a "aws/request.Request" representing the +// client's request for the SetLoadBalancerListenerSSLCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetLoadBalancerListenerSSLCertificate for more information on using the SetLoadBalancerListenerSSLCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetLoadBalancerListenerSSLCertificateRequest method. +// req, resp := client.SetLoadBalancerListenerSSLCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate +func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalancerListenerSSLCertificateInput) (req *request.Request, output *SetLoadBalancerListenerSSLCertificateOutput) { + op := &request.Operation{ + Name: opSetLoadBalancerListenerSSLCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetLoadBalancerListenerSSLCertificateInput{} + } + + output = &SetLoadBalancerListenerSSLCertificateOutput{} + req = c.newRequest(op, input, output) + return +} + +// SetLoadBalancerListenerSSLCertificate API operation for Elastic Load Balancing. +// +// Sets the certificate that terminates the specified listener's SSL connections. +// The specified certificate replaces any prior certificate that was used on +// the same load balancer and port. +// +// For more information about updating your SSL certificate, see Replace the +// SSL Certificate for Your Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation SetLoadBalancerListenerSSLCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCertificateNotFoundException "CertificateNotFound" +// The specified ARN does not refer to a valid SSL certificate in AWS Identity +// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if +// you recently uploaded the certificate to IAM, this error might indicate that +// the certificate is not fully available yet. +// +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodeListenerNotFoundException "ListenerNotFound" +// The load balancer does not have a listener configured at the specified port. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// * ErrCodeUnsupportedProtocolException "UnsupportedProtocol" +// The specified protocol or signature version is not supported. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate +func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (*SetLoadBalancerListenerSSLCertificateOutput, error) { + req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) + return out, req.Send() +} + +// SetLoadBalancerListenerSSLCertificateWithContext is the same as SetLoadBalancerListenerSSLCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBalancerListenerSSLCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) SetLoadBalancerListenerSSLCertificateWithContext(ctx aws.Context, input *SetLoadBalancerListenerSSLCertificateInput, opts ...request.Option) (*SetLoadBalancerListenerSSLCertificateOutput, error) { + req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetLoadBalancerPoliciesForBackendServer = "SetLoadBalancerPoliciesForBackendServer" + +// SetLoadBalancerPoliciesForBackendServerRequest generates a "aws/request.Request" representing the +// client's request for the SetLoadBalancerPoliciesForBackendServer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetLoadBalancerPoliciesForBackendServer for more information on using the SetLoadBalancerPoliciesForBackendServer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetLoadBalancerPoliciesForBackendServerRequest method. +// req, resp := client.SetLoadBalancerPoliciesForBackendServerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer +func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalancerPoliciesForBackendServerInput) (req *request.Request, output *SetLoadBalancerPoliciesForBackendServerOutput) { + op := &request.Operation{ + Name: opSetLoadBalancerPoliciesForBackendServer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetLoadBalancerPoliciesForBackendServerInput{} + } + + output = &SetLoadBalancerPoliciesForBackendServerOutput{} + req = c.newRequest(op, input, output) + return +} + +// SetLoadBalancerPoliciesForBackendServer API operation for Elastic Load Balancing. +// +// Replaces the set of policies associated with the specified port on which +// the EC2 instance is listening with a new set of policies. At this time, only +// the back-end server authentication policy type can be applied to the instance +// ports; this policy type is composed of multiple public key policies. +// +// Each time you use SetLoadBalancerPoliciesForBackendServer to enable the policies, +// use the PolicyNames parameter to list the policies that you want to enable. +// +// You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify +// that the policy is associated with the EC2 instance. +// +// For more information about enabling back-end instance authentication, see +// Configure Back-end Instance Authentication (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt) +// in the Classic Load Balancers Guide. For more information about Proxy Protocol, +// see Configure Proxy Protocol Support (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation SetLoadBalancerPoliciesForBackendServer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodePolicyNotFoundException "PolicyNotFound" +// One or more of the specified policies do not exist. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer +func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { + req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) + return out, req.Send() +} + +// SetLoadBalancerPoliciesForBackendServerWithContext is the same as SetLoadBalancerPoliciesForBackendServer with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBalancerPoliciesForBackendServer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) SetLoadBalancerPoliciesForBackendServerWithContext(ctx aws.Context, input *SetLoadBalancerPoliciesForBackendServerInput, opts ...request.Option) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { + req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetLoadBalancerPoliciesOfListener = "SetLoadBalancerPoliciesOfListener" + +// SetLoadBalancerPoliciesOfListenerRequest generates a "aws/request.Request" representing the +// client's request for the SetLoadBalancerPoliciesOfListener operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetLoadBalancerPoliciesOfListener for more information on using the SetLoadBalancerPoliciesOfListener +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetLoadBalancerPoliciesOfListenerRequest method. +// req, resp := client.SetLoadBalancerPoliciesOfListenerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener +func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPoliciesOfListenerInput) (req *request.Request, output *SetLoadBalancerPoliciesOfListenerOutput) { + op := &request.Operation{ + Name: opSetLoadBalancerPoliciesOfListener, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetLoadBalancerPoliciesOfListenerInput{} + } + + output = &SetLoadBalancerPoliciesOfListenerOutput{} + req = c.newRequest(op, input, output) + return +} + +// SetLoadBalancerPoliciesOfListener API operation for Elastic Load Balancing. +// +// Replaces the current set of policies for the specified load balancer port +// with the specified set of policies. +// +// To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer. +// +// For more information about setting policies, see Update the SSL Negotiation +// Configuration (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html), +// Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration), +// and Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) +// in the Classic Load Balancers 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 Elastic Load Balancing's +// API operation SetLoadBalancerPoliciesOfListener for usage and error information. +// +// Returned Error Codes: +// * ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" +// The specified load balancer does not exist. +// +// * ErrCodePolicyNotFoundException "PolicyNotFound" +// One or more of the specified policies do not exist. +// +// * ErrCodeListenerNotFoundException "ListenerNotFound" +// The load balancer does not have a listener configured at the specified port. +// +// * ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" +// The requested configuration change is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener +func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (*SetLoadBalancerPoliciesOfListenerOutput, error) { + req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) + return out, req.Send() +} + +// SetLoadBalancerPoliciesOfListenerWithContext is the same as SetLoadBalancerPoliciesOfListener with the addition of +// the ability to pass a context and additional request options. +// +// See SetLoadBalancerPoliciesOfListener for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ELB) SetLoadBalancerPoliciesOfListenerWithContext(ctx aws.Context, input *SetLoadBalancerPoliciesOfListenerInput, opts ...request.Option) (*SetLoadBalancerPoliciesOfListenerOutput, error) { + req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Information about the AccessLog attribute. +type AccessLog struct { + _ struct{} `type:"structure"` + + // The interval for publishing the access logs. You can specify an interval + // of either 5 minutes or 60 minutes. + // + // Default: 60 minutes + EmitInterval *int64 `type:"integer"` + + // Specifies whether access logs are enabled for the load balancer. + // + // Enabled is a required field + Enabled *bool `type:"boolean" required:"true"` + + // The name of the Amazon S3 bucket where the access logs are stored. + S3BucketName *string `type:"string"` + + // The logical hierarchy you created for your Amazon S3 bucket, for example + // my-bucket-prefix/prod. If the prefix is not provided, the log is placed at + // the root level of the bucket. + S3BucketPrefix *string `type:"string"` +} + +// String returns the string representation +func (s AccessLog) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessLog) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AccessLog) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AccessLog"} + if s.Enabled == nil { + invalidParams.Add(request.NewErrParamRequired("Enabled")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEmitInterval sets the EmitInterval field's value. +func (s *AccessLog) SetEmitInterval(v int64) *AccessLog { + s.EmitInterval = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *AccessLog) SetEnabled(v bool) *AccessLog { + s.Enabled = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *AccessLog) SetS3BucketName(v string) *AccessLog { + s.S3BucketName = &v + return s +} + +// SetS3BucketPrefix sets the S3BucketPrefix field's value. +func (s *AccessLog) SetS3BucketPrefix(v string) *AccessLog { + s.S3BucketPrefix = &v + return s +} + +// Contains the parameters for AddTags. +type AddTagsInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. You can specify one load balancer only. + // + // LoadBalancerNames is a required field + LoadBalancerNames []*string `type:"list" required:"true"` + + // The tags. + // + // Tags is a required field + Tags []*Tag `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s AddTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} + if s.LoadBalancerNames == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + 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 +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *AddTagsInput) SetLoadBalancerNames(v []*string) *AddTagsInput { + s.LoadBalancerNames = v + return s +} + +// SetTags sets the Tags field's value. +func (s *AddTagsInput) SetTags(v []*Tag) *AddTagsInput { + s.Tags = v + return s +} + +// Contains the output of AddTags. +type AddTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddTagsOutput) GoString() string { + return s.String() +} + +// This data type is reserved. +type AdditionalAttribute struct { + _ struct{} `type:"structure"` + + // This parameter is reserved. + Key *string `type:"string"` + + // This parameter is reserved. + Value *string `type:"string"` +} + +// String returns the string representation +func (s AdditionalAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdditionalAttribute) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *AdditionalAttribute) SetKey(v string) *AdditionalAttribute { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *AdditionalAttribute) SetValue(v string) *AdditionalAttribute { + s.Value = &v + return s +} + +// Information about a policy for application-controlled session stickiness. +type AppCookieStickinessPolicy struct { + _ struct{} `type:"structure"` + + // The name of the application cookie used for stickiness. + CookieName *string `type:"string"` + + // The mnemonic name for the policy being created. The name must be unique within + // a set of policies for this load balancer. + PolicyName *string `type:"string"` +} + +// String returns the string representation +func (s AppCookieStickinessPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AppCookieStickinessPolicy) GoString() string { + return s.String() +} + +// SetCookieName sets the CookieName field's value. +func (s *AppCookieStickinessPolicy) SetCookieName(v string) *AppCookieStickinessPolicy { + s.CookieName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *AppCookieStickinessPolicy) SetPolicyName(v string) *AppCookieStickinessPolicy { + s.PolicyName = &v + return s +} + +// Contains the parameters for ApplySecurityGroupsToLoadBalancer. +type ApplySecurityGroupsToLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The IDs of the security groups to associate with the load balancer. Note + // that you cannot specify the name of the security group. + // + // SecurityGroups is a required field + SecurityGroups []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ApplySecurityGroupsToLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplySecurityGroupsToLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ApplySecurityGroupsToLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ApplySecurityGroupsToLoadBalancerInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.SecurityGroups == nil { + invalidParams.Add(request.NewErrParamRequired("SecurityGroups")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *ApplySecurityGroupsToLoadBalancerInput) SetLoadBalancerName(v string) *ApplySecurityGroupsToLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *ApplySecurityGroupsToLoadBalancerInput) SetSecurityGroups(v []*string) *ApplySecurityGroupsToLoadBalancerInput { + s.SecurityGroups = v + return s +} + +// Contains the output of ApplySecurityGroupsToLoadBalancer. +type ApplySecurityGroupsToLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // The IDs of the security groups associated with the load balancer. + SecurityGroups []*string `type:"list"` +} + +// String returns the string representation +func (s ApplySecurityGroupsToLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplySecurityGroupsToLoadBalancerOutput) GoString() string { + return s.String() +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *ApplySecurityGroupsToLoadBalancerOutput) SetSecurityGroups(v []*string) *ApplySecurityGroupsToLoadBalancerOutput { + s.SecurityGroups = v + return s +} + +// Contains the parameters for AttachLoaBalancerToSubnets. +type AttachLoadBalancerToSubnetsInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The IDs of the subnets to add. You can add only one subnet per Availability + // Zone. + // + // Subnets is a required field + Subnets []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s AttachLoadBalancerToSubnetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancerToSubnetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachLoadBalancerToSubnetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancerToSubnetsInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.Subnets == nil { + invalidParams.Add(request.NewErrParamRequired("Subnets")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *AttachLoadBalancerToSubnetsInput) SetLoadBalancerName(v string) *AttachLoadBalancerToSubnetsInput { + s.LoadBalancerName = &v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *AttachLoadBalancerToSubnetsInput) SetSubnets(v []*string) *AttachLoadBalancerToSubnetsInput { + s.Subnets = v + return s +} + +// Contains the output of AttachLoadBalancerToSubnets. +type AttachLoadBalancerToSubnetsOutput struct { + _ struct{} `type:"structure"` + + // The IDs of the subnets attached to the load balancer. + Subnets []*string `type:"list"` +} + +// String returns the string representation +func (s AttachLoadBalancerToSubnetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancerToSubnetsOutput) GoString() string { + return s.String() +} + +// SetSubnets sets the Subnets field's value. +func (s *AttachLoadBalancerToSubnetsOutput) SetSubnets(v []*string) *AttachLoadBalancerToSubnetsOutput { + s.Subnets = v + return s +} + +// Information about the configuration of an EC2 instance. +type BackendServerDescription struct { + _ struct{} `type:"structure"` + + // The port on which the EC2 instance is listening. + InstancePort *int64 `min:"1" type:"integer"` + + // The names of the policies enabled for the EC2 instance. + PolicyNames []*string `type:"list"` +} + +// String returns the string representation +func (s BackendServerDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackendServerDescription) GoString() string { + return s.String() +} + +// SetInstancePort sets the InstancePort field's value. +func (s *BackendServerDescription) SetInstancePort(v int64) *BackendServerDescription { + s.InstancePort = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *BackendServerDescription) SetPolicyNames(v []*string) *BackendServerDescription { + s.PolicyNames = v + return s +} + +// Contains the parameters for ConfigureHealthCheck. +type ConfigureHealthCheckInput struct { + _ struct{} `type:"structure"` + + // The configuration information. + // + // HealthCheck is a required field + HealthCheck *HealthCheck `type:"structure" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ConfigureHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigureHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConfigureHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConfigureHealthCheckInput"} + if s.HealthCheck == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheck")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.HealthCheck != nil { + if err := s.HealthCheck.Validate(); err != nil { + invalidParams.AddNested("HealthCheck", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheck sets the HealthCheck field's value. +func (s *ConfigureHealthCheckInput) SetHealthCheck(v *HealthCheck) *ConfigureHealthCheckInput { + s.HealthCheck = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *ConfigureHealthCheckInput) SetLoadBalancerName(v string) *ConfigureHealthCheckInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output of ConfigureHealthCheck. +type ConfigureHealthCheckOutput struct { + _ struct{} `type:"structure"` + + // The updated health check. + HealthCheck *HealthCheck `type:"structure"` +} + +// String returns the string representation +func (s ConfigureHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigureHealthCheckOutput) GoString() string { + return s.String() +} + +// SetHealthCheck sets the HealthCheck field's value. +func (s *ConfigureHealthCheckOutput) SetHealthCheck(v *HealthCheck) *ConfigureHealthCheckOutput { + s.HealthCheck = v + return s +} + +// Information about the ConnectionDraining attribute. +type ConnectionDraining struct { + _ struct{} `type:"structure"` + + // Specifies whether connection draining is enabled for the load balancer. + // + // Enabled is a required field + Enabled *bool `type:"boolean" required:"true"` + + // The maximum time, in seconds, to keep the existing connections open before + // deregistering the instances. + Timeout *int64 `type:"integer"` +} + +// String returns the string representation +func (s ConnectionDraining) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionDraining) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConnectionDraining) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConnectionDraining"} + 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 *ConnectionDraining) SetEnabled(v bool) *ConnectionDraining { + s.Enabled = &v + return s +} + +// SetTimeout sets the Timeout field's value. +func (s *ConnectionDraining) SetTimeout(v int64) *ConnectionDraining { + s.Timeout = &v + return s +} + +// Information about the ConnectionSettings attribute. +type ConnectionSettings struct { + _ struct{} `type:"structure"` + + // The time, in seconds, that the connection is allowed to be idle (no data + // has been sent over the connection) before it is closed by the load balancer. + // + // IdleTimeout is a required field + IdleTimeout *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s ConnectionSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConnectionSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConnectionSettings"} + if s.IdleTimeout == nil { + invalidParams.Add(request.NewErrParamRequired("IdleTimeout")) + } + if s.IdleTimeout != nil && *s.IdleTimeout < 1 { + invalidParams.Add(request.NewErrParamMinValue("IdleTimeout", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIdleTimeout sets the IdleTimeout field's value. +func (s *ConnectionSettings) SetIdleTimeout(v int64) *ConnectionSettings { + s.IdleTimeout = &v + return s +} + +// Contains the parameters for CreateAppCookieStickinessPolicy. +type CreateAppCookieStickinessPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the application cookie used for stickiness. + // + // CookieName is a required field + CookieName *string `type:"string" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The name of the policy being created. Policy names must consist of alphanumeric + // characters and dashes (-). This name must be unique within the set of policies + // for this load balancer. + // + // PolicyName is a required field + PolicyName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateAppCookieStickinessPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAppCookieStickinessPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAppCookieStickinessPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAppCookieStickinessPolicyInput"} + if s.CookieName == nil { + invalidParams.Add(request.NewErrParamRequired("CookieName")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCookieName sets the CookieName field's value. +func (s *CreateAppCookieStickinessPolicyInput) SetCookieName(v string) *CreateAppCookieStickinessPolicyInput { + s.CookieName = &v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *CreateAppCookieStickinessPolicyInput) SetLoadBalancerName(v string) *CreateAppCookieStickinessPolicyInput { + s.LoadBalancerName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *CreateAppCookieStickinessPolicyInput) SetPolicyName(v string) *CreateAppCookieStickinessPolicyInput { + s.PolicyName = &v + return s +} + +// Contains the output for CreateAppCookieStickinessPolicy. +type CreateAppCookieStickinessPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateAppCookieStickinessPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAppCookieStickinessPolicyOutput) GoString() string { + return s.String() +} + +// Contains the parameters for CreateLBCookieStickinessPolicy. +type CreateLBCookieStickinessPolicyInput struct { + _ struct{} `type:"structure"` + + // The time period, in seconds, after which the cookie should be considered + // stale. If you do not specify this parameter, the default value is 0, which + // indicates that the sticky session should last for the duration of the browser + // session. + CookieExpirationPeriod *int64 `type:"long"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The name of the policy being created. Policy names must consist of alphanumeric + // characters and dashes (-). This name must be unique within the set of policies + // for this load balancer. + // + // PolicyName is a required field + PolicyName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLBCookieStickinessPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLBCookieStickinessPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLBCookieStickinessPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLBCookieStickinessPolicyInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCookieExpirationPeriod sets the CookieExpirationPeriod field's value. +func (s *CreateLBCookieStickinessPolicyInput) SetCookieExpirationPeriod(v int64) *CreateLBCookieStickinessPolicyInput { + s.CookieExpirationPeriod = &v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *CreateLBCookieStickinessPolicyInput) SetLoadBalancerName(v string) *CreateLBCookieStickinessPolicyInput { + s.LoadBalancerName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *CreateLBCookieStickinessPolicyInput) SetPolicyName(v string) *CreateLBCookieStickinessPolicyInput { + s.PolicyName = &v + return s +} + +// Contains the output for CreateLBCookieStickinessPolicy. +type CreateLBCookieStickinessPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateLBCookieStickinessPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLBCookieStickinessPolicyOutput) GoString() string { + return s.String() +} + +// Contains the parameters for CreateLoadBalancer. +type CreateLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // One or more Availability Zones from the same region as the load balancer. + // + // You must specify at least one Availability Zone. + // + // You can add more Availability Zones after you create the load balancer using + // EnableAvailabilityZonesForLoadBalancer. + AvailabilityZones []*string `type:"list"` + + // The listeners. + // + // For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) + // in the Classic Load Balancers Guide. + // + // Listeners is a required field + Listeners []*Listener `type:"list" required:"true"` + + // The name of the load balancer. + // + // This name must be unique within your set of load balancers for the region, + // must have a maximum of 32 characters, must contain only alphanumeric characters + // or hyphens, and cannot begin or end with a hyphen. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The type of a load balancer. Valid only for load balancers in a VPC. + // + // By default, Elastic Load Balancing creates an Internet-facing load balancer + // with a DNS name that resolves to public IP addresses. For more information + // about Internet-facing and Internal load balancers, see Load Balancer Scheme + // (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#load-balancer-scheme) + // in the Elastic Load Balancing User Guide. + // + // Specify internal to create a load balancer with a DNS name that resolves + // to private IP addresses. + Scheme *string `type:"string"` + + // The IDs of the security groups to assign to the load balancer. + SecurityGroups []*string `type:"list"` + + // The IDs of the subnets in your VPC to attach to the load balancer. Specify + // one subnet per Availability Zone specified in AvailabilityZones. + Subnets []*string `type:"list"` + + // A list of tags to assign to the load balancer. + // + // For more information about tagging your load balancer, see Tag Your Classic + // Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) + // in the Classic Load Balancers Guide. + Tags []*Tag `min:"1" type:"list"` +} + +// String returns the string representation +func (s CreateLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerInput"} + if s.Listeners == nil { + invalidParams.Add(request.NewErrParamRequired("Listeners")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.Listeners != nil { + for i, v := range s.Listeners { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Listeners", i), err.(request.ErrInvalidParams)) + } + } + } + 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 +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *CreateLoadBalancerInput) SetAvailabilityZones(v []*string) *CreateLoadBalancerInput { + s.AvailabilityZones = v + return s +} + +// SetListeners sets the Listeners field's value. +func (s *CreateLoadBalancerInput) SetListeners(v []*Listener) *CreateLoadBalancerInput { + s.Listeners = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *CreateLoadBalancerInput) SetLoadBalancerName(v string) *CreateLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// SetScheme sets the Scheme field's value. +func (s *CreateLoadBalancerInput) SetScheme(v string) *CreateLoadBalancerInput { + s.Scheme = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *CreateLoadBalancerInput) SetSecurityGroups(v []*string) *CreateLoadBalancerInput { + s.SecurityGroups = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *CreateLoadBalancerInput) SetSubnets(v []*string) *CreateLoadBalancerInput { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateLoadBalancerInput) SetTags(v []*Tag) *CreateLoadBalancerInput { + s.Tags = v + return s +} + +// Contains the parameters for CreateLoadBalancerListeners. +type CreateLoadBalancerListenersInput struct { + _ struct{} `type:"structure"` + + // The listeners. + // + // Listeners is a required field + Listeners []*Listener `type:"list" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLoadBalancerListenersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerListenersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoadBalancerListenersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerListenersInput"} + if s.Listeners == nil { + invalidParams.Add(request.NewErrParamRequired("Listeners")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.Listeners != nil { + for i, v := range s.Listeners { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Listeners", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetListeners sets the Listeners field's value. +func (s *CreateLoadBalancerListenersInput) SetListeners(v []*Listener) *CreateLoadBalancerListenersInput { + s.Listeners = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *CreateLoadBalancerListenersInput) SetLoadBalancerName(v string) *CreateLoadBalancerListenersInput { + s.LoadBalancerName = &v + return s +} + +// Contains the parameters for CreateLoadBalancerListener. +type CreateLoadBalancerListenersOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateLoadBalancerListenersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerListenersOutput) GoString() string { + return s.String() +} + +// Contains the output for CreateLoadBalancer. +type CreateLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // The DNS name of the load balancer. + DNSName *string `type:"string"` +} + +// String returns the string representation +func (s CreateLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerOutput) GoString() string { + return s.String() +} + +// SetDNSName sets the DNSName field's value. +func (s *CreateLoadBalancerOutput) SetDNSName(v string) *CreateLoadBalancerOutput { + s.DNSName = &v + return s +} + +// Contains the parameters for CreateLoadBalancerPolicy. +type CreateLoadBalancerPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The policy attributes. + PolicyAttributes []*PolicyAttribute `type:"list"` + + // The name of the load balancer policy to be created. This name must be unique + // within the set of policies for this load balancer. + // + // PolicyName is a required field + PolicyName *string `type:"string" required:"true"` + + // The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes. + // + // PolicyTypeName is a required field + PolicyTypeName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLoadBalancerPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoadBalancerPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerPolicyInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyTypeName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyTypeName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *CreateLoadBalancerPolicyInput) SetLoadBalancerName(v string) *CreateLoadBalancerPolicyInput { + s.LoadBalancerName = &v + return s +} + +// SetPolicyAttributes sets the PolicyAttributes field's value. +func (s *CreateLoadBalancerPolicyInput) SetPolicyAttributes(v []*PolicyAttribute) *CreateLoadBalancerPolicyInput { + s.PolicyAttributes = v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *CreateLoadBalancerPolicyInput) SetPolicyName(v string) *CreateLoadBalancerPolicyInput { + s.PolicyName = &v + return s +} + +// SetPolicyTypeName sets the PolicyTypeName field's value. +func (s *CreateLoadBalancerPolicyInput) SetPolicyTypeName(v string) *CreateLoadBalancerPolicyInput { + s.PolicyTypeName = &v + return s +} + +// Contains the output of CreateLoadBalancerPolicy. +type CreateLoadBalancerPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateLoadBalancerPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerPolicyOutput) GoString() string { + return s.String() +} + +// Information about the CrossZoneLoadBalancing attribute. +type CrossZoneLoadBalancing struct { + _ struct{} `type:"structure"` + + // Specifies whether cross-zone load balancing is enabled for the load balancer. + // + // Enabled is a required field + Enabled *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s CrossZoneLoadBalancing) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrossZoneLoadBalancing) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CrossZoneLoadBalancing) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CrossZoneLoadBalancing"} + 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 *CrossZoneLoadBalancing) SetEnabled(v bool) *CrossZoneLoadBalancing { + s.Enabled = &v + return s +} + +// Contains the parameters for DeleteLoadBalancer. +type DeleteLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DeleteLoadBalancerInput) SetLoadBalancerName(v string) *DeleteLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// Contains the parameters for DeleteLoadBalancerListeners. +type DeleteLoadBalancerListenersInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The client port numbers of the listeners. + // + // LoadBalancerPorts is a required field + LoadBalancerPorts []*int64 `type:"list" required:"true"` +} + +// String returns the string representation +func (s DeleteLoadBalancerListenersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerListenersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoadBalancerListenersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerListenersInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.LoadBalancerPorts == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerPorts")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DeleteLoadBalancerListenersInput) SetLoadBalancerName(v string) *DeleteLoadBalancerListenersInput { + s.LoadBalancerName = &v + return s +} + +// SetLoadBalancerPorts sets the LoadBalancerPorts field's value. +func (s *DeleteLoadBalancerListenersInput) SetLoadBalancerPorts(v []*int64) *DeleteLoadBalancerListenersInput { + s.LoadBalancerPorts = v + return s +} + +// Contains the output of DeleteLoadBalancerListeners. +type DeleteLoadBalancerListenersOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoadBalancerListenersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerListenersOutput) GoString() string { + return s.String() +} + +// Contains the output of DeleteLoadBalancer. +type DeleteLoadBalancerOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerOutput) GoString() string { + return s.String() +} + +// Contains the parameters for DeleteLoadBalancerPolicy. +type DeleteLoadBalancerPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The name of the policy. + // + // PolicyName is a required field + PolicyName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLoadBalancerPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoadBalancerPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerPolicyInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DeleteLoadBalancerPolicyInput) SetLoadBalancerName(v string) *DeleteLoadBalancerPolicyInput { + s.LoadBalancerName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *DeleteLoadBalancerPolicyInput) SetPolicyName(v string) *DeleteLoadBalancerPolicyInput { + s.PolicyName = &v + return s +} + +// Contains the output of DeleteLoadBalancerPolicy. +type DeleteLoadBalancerPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoadBalancerPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerPolicyOutput) GoString() string { + return s.String() +} + +// Contains the parameters for DeregisterInstancesFromLoadBalancer. +type DeregisterInstancesFromLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The IDs of the instances. + // + // Instances is a required field + Instances []*Instance `type:"list" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeregisterInstancesFromLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterInstancesFromLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeregisterInstancesFromLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterInstancesFromLoadBalancerInput"} + if s.Instances == nil { + invalidParams.Add(request.NewErrParamRequired("Instances")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstances sets the Instances field's value. +func (s *DeregisterInstancesFromLoadBalancerInput) SetInstances(v []*Instance) *DeregisterInstancesFromLoadBalancerInput { + s.Instances = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DeregisterInstancesFromLoadBalancerInput) SetLoadBalancerName(v string) *DeregisterInstancesFromLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output of DeregisterInstancesFromLoadBalancer. +type DeregisterInstancesFromLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // The remaining instances registered with the load balancer. + Instances []*Instance `type:"list"` +} + +// String returns the string representation +func (s DeregisterInstancesFromLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterInstancesFromLoadBalancerOutput) GoString() string { + return s.String() +} + +// SetInstances sets the Instances field's value. +func (s *DeregisterInstancesFromLoadBalancerOutput) SetInstances(v []*Instance) *DeregisterInstancesFromLoadBalancerOutput { + s.Instances = v + return s +} + +type DescribeAccountLimitsInput struct { + _ struct{} `type:"structure"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeAccountLimitsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAccountLimitsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAccountLimitsInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *DescribeAccountLimitsInput) SetMarker(v string) *DescribeAccountLimitsInput { + s.Marker = &v + return s +} + +// SetPageSize sets the PageSize field's value. +func (s *DescribeAccountLimitsInput) SetPageSize(v int64) *DescribeAccountLimitsInput { + s.PageSize = &v + return s +} + +type DescribeAccountLimitsOutput struct { + _ struct{} `type:"structure"` + + // Information about the limits. + Limits []*Limit `type:"list"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAccountLimitsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsOutput) GoString() string { + return s.String() +} + +// SetLimits sets the Limits field's value. +func (s *DescribeAccountLimitsOutput) SetLimits(v []*Limit) *DescribeAccountLimitsOutput { + s.Limits = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *DescribeAccountLimitsOutput) SetNextMarker(v string) *DescribeAccountLimitsOutput { + s.NextMarker = &v + return s +} + +// Contains the parameters for DescribeInstanceHealth. +type DescribeInstanceHealthInput struct { + _ struct{} `type:"structure"` + + // The IDs of the instances. + Instances []*Instance `type:"list"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeInstanceHealthInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceHealthInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInstanceHealthInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceHealthInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstances sets the Instances field's value. +func (s *DescribeInstanceHealthInput) SetInstances(v []*Instance) *DescribeInstanceHealthInput { + s.Instances = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DescribeInstanceHealthInput) SetLoadBalancerName(v string) *DescribeInstanceHealthInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output for DescribeInstanceHealth. +type DescribeInstanceHealthOutput struct { + _ struct{} `type:"structure"` + + // Information about the health of the instances. + InstanceStates []*InstanceState `type:"list"` +} + +// String returns the string representation +func (s DescribeInstanceHealthOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceHealthOutput) GoString() string { + return s.String() +} + +// SetInstanceStates sets the InstanceStates field's value. +func (s *DescribeInstanceHealthOutput) SetInstanceStates(v []*InstanceState) *DescribeInstanceHealthOutput { + s.InstanceStates = v + return s +} + +// Contains the parameters for DescribeLoadBalancerAttributes. +type DescribeLoadBalancerAttributesInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeLoadBalancerAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLoadBalancerAttributesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancerAttributesInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DescribeLoadBalancerAttributesInput) SetLoadBalancerName(v string) *DescribeLoadBalancerAttributesInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output of DescribeLoadBalancerAttributes. +type DescribeLoadBalancerAttributesOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancer attributes. + LoadBalancerAttributes *LoadBalancerAttributes `type:"structure"` +} + +// String returns the string representation +func (s DescribeLoadBalancerAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerAttributesOutput) GoString() string { + return s.String() +} + +// SetLoadBalancerAttributes sets the LoadBalancerAttributes field's value. +func (s *DescribeLoadBalancerAttributesOutput) SetLoadBalancerAttributes(v *LoadBalancerAttributes) *DescribeLoadBalancerAttributesOutput { + s.LoadBalancerAttributes = v + return s +} + +// Contains the parameters for DescribeLoadBalancerPolicies. +type DescribeLoadBalancerPoliciesInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + LoadBalancerName *string `type:"string"` + + // The names of the policies. + PolicyNames []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeLoadBalancerPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPoliciesInput) GoString() string { + return s.String() +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DescribeLoadBalancerPoliciesInput) SetLoadBalancerName(v string) *DescribeLoadBalancerPoliciesInput { + s.LoadBalancerName = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *DescribeLoadBalancerPoliciesInput) SetPolicyNames(v []*string) *DescribeLoadBalancerPoliciesInput { + s.PolicyNames = v + return s +} + +// Contains the output of DescribeLoadBalancerPolicies. +type DescribeLoadBalancerPoliciesOutput struct { + _ struct{} `type:"structure"` + + // Information about the policies. + PolicyDescriptions []*PolicyDescription `type:"list"` +} + +// String returns the string representation +func (s DescribeLoadBalancerPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPoliciesOutput) GoString() string { + return s.String() +} + +// SetPolicyDescriptions sets the PolicyDescriptions field's value. +func (s *DescribeLoadBalancerPoliciesOutput) SetPolicyDescriptions(v []*PolicyDescription) *DescribeLoadBalancerPoliciesOutput { + s.PolicyDescriptions = v + return s +} + +// Contains the parameters for DescribeLoadBalancerPolicyTypes. +type DescribeLoadBalancerPolicyTypesInput struct { + _ struct{} `type:"structure"` + + // The names of the policy types. If no names are specified, describes all policy + // types defined by Elastic Load Balancing. + PolicyTypeNames []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeLoadBalancerPolicyTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPolicyTypesInput) GoString() string { + return s.String() +} + +// SetPolicyTypeNames sets the PolicyTypeNames field's value. +func (s *DescribeLoadBalancerPolicyTypesInput) SetPolicyTypeNames(v []*string) *DescribeLoadBalancerPolicyTypesInput { + s.PolicyTypeNames = v + return s +} + +// Contains the output of DescribeLoadBalancerPolicyTypes. +type DescribeLoadBalancerPolicyTypesOutput struct { + _ struct{} `type:"structure"` + + // Information about the policy types. + PolicyTypeDescriptions []*PolicyTypeDescription `type:"list"` +} + +// String returns the string representation +func (s DescribeLoadBalancerPolicyTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPolicyTypesOutput) GoString() string { + return s.String() +} + +// SetPolicyTypeDescriptions sets the PolicyTypeDescriptions field's value. +func (s *DescribeLoadBalancerPolicyTypesOutput) SetPolicyTypeDescriptions(v []*PolicyTypeDescription) *DescribeLoadBalancerPolicyTypesOutput { + s.PolicyTypeDescriptions = v + return s +} + +// Contains the parameters for DescribeLoadBalancers. +type DescribeLoadBalancersInput struct { + _ struct{} `type:"structure"` + + // The names of the load balancers. + LoadBalancerNames []*string `type:"list"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The maximum number of results to return with this call (a number from 1 to + // 400). The default is 400. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLoadBalancersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancersInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *DescribeLoadBalancersInput) SetLoadBalancerNames(v []*string) *DescribeLoadBalancersInput { + s.LoadBalancerNames = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeLoadBalancersInput) SetMarker(v string) *DescribeLoadBalancersInput { + s.Marker = &v + return s +} + +// SetPageSize sets the PageSize field's value. +func (s *DescribeLoadBalancersInput) SetPageSize(v int64) *DescribeLoadBalancersInput { + s.PageSize = &v + return s +} + +// Contains the parameters for DescribeLoadBalancers. +type DescribeLoadBalancersOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancers. + LoadBalancerDescriptions []*LoadBalancerDescription `type:"list"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s DescribeLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersOutput) GoString() string { + return s.String() +} + +// SetLoadBalancerDescriptions sets the LoadBalancerDescriptions field's value. +func (s *DescribeLoadBalancersOutput) SetLoadBalancerDescriptions(v []*LoadBalancerDescription) *DescribeLoadBalancersOutput { + s.LoadBalancerDescriptions = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *DescribeLoadBalancersOutput) SetNextMarker(v string) *DescribeLoadBalancersOutput { + s.NextMarker = &v + return s +} + +// Contains the parameters for DescribeTags. +type DescribeTagsInput struct { + _ struct{} `type:"structure"` + + // The names of the load balancers. + // + // LoadBalancerNames is a required field + LoadBalancerNames []*string `min:"1" type:"list" required:"true"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"} + if s.LoadBalancerNames == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) + } + if s.LoadBalancerNames != nil && len(s.LoadBalancerNames) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoadBalancerNames", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *DescribeTagsInput) SetLoadBalancerNames(v []*string) *DescribeTagsInput { + s.LoadBalancerNames = v + return s +} + +// Contains the output for DescribeTags. +type DescribeTagsOutput struct { + _ struct{} `type:"structure"` + + // Information about the tags. + TagDescriptions []*TagDescription `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() +} + +// SetTagDescriptions sets the TagDescriptions field's value. +func (s *DescribeTagsOutput) SetTagDescriptions(v []*TagDescription) *DescribeTagsOutput { + s.TagDescriptions = v + return s +} + +// Contains the parameters for DetachLoadBalancerFromSubnets. +type DetachLoadBalancerFromSubnetsInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The IDs of the subnets. + // + // Subnets is a required field + Subnets []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s DetachLoadBalancerFromSubnetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancerFromSubnetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachLoadBalancerFromSubnetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancerFromSubnetsInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.Subnets == nil { + invalidParams.Add(request.NewErrParamRequired("Subnets")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DetachLoadBalancerFromSubnetsInput) SetLoadBalancerName(v string) *DetachLoadBalancerFromSubnetsInput { + s.LoadBalancerName = &v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *DetachLoadBalancerFromSubnetsInput) SetSubnets(v []*string) *DetachLoadBalancerFromSubnetsInput { + s.Subnets = v + return s +} + +// Contains the output of DetachLoadBalancerFromSubnets. +type DetachLoadBalancerFromSubnetsOutput struct { + _ struct{} `type:"structure"` + + // The IDs of the remaining subnets for the load balancer. + Subnets []*string `type:"list"` +} + +// String returns the string representation +func (s DetachLoadBalancerFromSubnetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancerFromSubnetsOutput) GoString() string { + return s.String() +} + +// SetSubnets sets the Subnets field's value. +func (s *DetachLoadBalancerFromSubnetsOutput) SetSubnets(v []*string) *DetachLoadBalancerFromSubnetsOutput { + s.Subnets = v + return s +} + +// Contains the parameters for DisableAvailabilityZonesForLoadBalancer. +type DisableAvailabilityZonesForLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The Availability Zones. + // + // AvailabilityZones is a required field + AvailabilityZones []*string `type:"list" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableAvailabilityZonesForLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableAvailabilityZonesForLoadBalancerInput"} + if s.AvailabilityZones == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *DisableAvailabilityZonesForLoadBalancerInput) SetAvailabilityZones(v []*string) *DisableAvailabilityZonesForLoadBalancerInput { + s.AvailabilityZones = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *DisableAvailabilityZonesForLoadBalancerInput) SetLoadBalancerName(v string) *DisableAvailabilityZonesForLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output for DisableAvailabilityZonesForLoadBalancer. +type DisableAvailabilityZonesForLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // The remaining Availability Zones for the load balancer. + AvailabilityZones []*string `type:"list"` +} + +// String returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerOutput) GoString() string { + return s.String() +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *DisableAvailabilityZonesForLoadBalancerOutput) SetAvailabilityZones(v []*string) *DisableAvailabilityZonesForLoadBalancerOutput { + s.AvailabilityZones = v + return s +} + +// Contains the parameters for EnableAvailabilityZonesForLoadBalancer. +type EnableAvailabilityZonesForLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The Availability Zones. These must be in the same region as the load balancer. + // + // AvailabilityZones is a required field + AvailabilityZones []*string `type:"list" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableAvailabilityZonesForLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableAvailabilityZonesForLoadBalancerInput"} + if s.AvailabilityZones == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *EnableAvailabilityZonesForLoadBalancerInput) SetAvailabilityZones(v []*string) *EnableAvailabilityZonesForLoadBalancerInput { + s.AvailabilityZones = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *EnableAvailabilityZonesForLoadBalancerInput) SetLoadBalancerName(v string) *EnableAvailabilityZonesForLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output of EnableAvailabilityZonesForLoadBalancer. +type EnableAvailabilityZonesForLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // The updated list of Availability Zones for the load balancer. + AvailabilityZones []*string `type:"list"` +} + +// String returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerOutput) GoString() string { + return s.String() +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *EnableAvailabilityZonesForLoadBalancerOutput) SetAvailabilityZones(v []*string) *EnableAvailabilityZonesForLoadBalancerOutput { + s.AvailabilityZones = v + return s +} + +// Information about a health check. +type HealthCheck struct { + _ struct{} `type:"structure"` + + // The number of consecutive health checks successes required before moving + // the instance to the Healthy state. + // + // HealthyThreshold is a required field + HealthyThreshold *int64 `min:"2" type:"integer" required:"true"` + + // The approximate interval, in seconds, between health checks of an individual + // instance. + // + // Interval is a required field + Interval *int64 `min:"5" type:"integer" required:"true"` + + // The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. + // The range of valid ports is one (1) through 65535. + // + // TCP is the default, specified as a TCP: port pair, for example "TCP:5000". + // In this case, a health check simply attempts to open a TCP connection to + // the instance on the specified port. Failure to connect within the configured + // timeout is considered unhealthy. + // + // SSL is also specified as SSL: port pair, for example, SSL:5000. + // + // For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified + // as a HTTP:port;/;PathToPing; grouping, for example "HTTP:80/weather/us/wa/seattle". + // In this case, a HTTP GET request is issued to the instance on the given port + // and path. Any answer other than "200 OK" within the timeout period is considered + // unhealthy. + // + // The total length of the HTTP ping target must be 1024 16-bit Unicode characters + // or less. + // + // Target is a required field + Target *string `type:"string" required:"true"` + + // The amount of time, in seconds, during which no response means a failed health + // check. + // + // This value must be less than the Interval value. + // + // Timeout is a required field + Timeout *int64 `min:"2" type:"integer" required:"true"` + + // The number of consecutive health check failures required before moving the + // instance to the Unhealthy state. + // + // UnhealthyThreshold is a required field + UnhealthyThreshold *int64 `min:"2" type:"integer" required:"true"` +} + +// 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.HealthyThreshold == nil { + invalidParams.Add(request.NewErrParamRequired("HealthyThreshold")) + } + if s.HealthyThreshold != nil && *s.HealthyThreshold < 2 { + invalidParams.Add(request.NewErrParamMinValue("HealthyThreshold", 2)) + } + if s.Interval == nil { + invalidParams.Add(request.NewErrParamRequired("Interval")) + } + if s.Interval != nil && *s.Interval < 5 { + invalidParams.Add(request.NewErrParamMinValue("Interval", 5)) + } + if s.Target == nil { + invalidParams.Add(request.NewErrParamRequired("Target")) + } + if s.Timeout == nil { + invalidParams.Add(request.NewErrParamRequired("Timeout")) + } + if s.Timeout != nil && *s.Timeout < 2 { + invalidParams.Add(request.NewErrParamMinValue("Timeout", 2)) + } + if s.UnhealthyThreshold == nil { + invalidParams.Add(request.NewErrParamRequired("UnhealthyThreshold")) + } + if s.UnhealthyThreshold != nil && *s.UnhealthyThreshold < 2 { + invalidParams.Add(request.NewErrParamMinValue("UnhealthyThreshold", 2)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthyThreshold sets the HealthyThreshold field's value. +func (s *HealthCheck) SetHealthyThreshold(v int64) *HealthCheck { + s.HealthyThreshold = &v + return s +} + +// SetInterval sets the Interval field's value. +func (s *HealthCheck) SetInterval(v int64) *HealthCheck { + s.Interval = &v + return s +} + +// SetTarget sets the Target field's value. +func (s *HealthCheck) SetTarget(v string) *HealthCheck { + s.Target = &v + return s +} + +// SetTimeout sets the Timeout field's value. +func (s *HealthCheck) SetTimeout(v int64) *HealthCheck { + s.Timeout = &v + return s +} + +// SetUnhealthyThreshold sets the UnhealthyThreshold field's value. +func (s *HealthCheck) SetUnhealthyThreshold(v int64) *HealthCheck { + s.UnhealthyThreshold = &v + return s +} + +// The ID of an EC2 instance. +type Instance struct { + _ struct{} `type:"structure"` + + // The instance ID. + InstanceId *string `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() +} + +// SetInstanceId sets the InstanceId field's value. +func (s *Instance) SetInstanceId(v string) *Instance { + s.InstanceId = &v + return s +} + +// Information about the state of an EC2 instance. +type InstanceState struct { + _ struct{} `type:"structure"` + + // A description of the instance state. This string can contain one or more + // of the following messages. + // + // * N/A + // + // * A transient error occurred. Please try again later. + // + // * Instance has failed at least the UnhealthyThreshold number of health + // checks consecutively. + // + // * Instance has not passed the configured HealthyThreshold number of health + // checks consecutively. + // + // * Instance registration is still in progress. + // + // * Instance is in the EC2 Availability Zone for which LoadBalancer is not + // configured to route traffic to. + // + // * Instance is not currently registered with the LoadBalancer. + // + // * Instance deregistration currently in progress. + // + // * Disable Availability Zone is currently in progress. + // + // * Instance is in pending state. + // + // * Instance is in stopped state. + // + // * Instance is in terminated state. + Description *string `type:"string"` + + // The ID of the instance. + InstanceId *string `type:"string"` + + // Information about the cause of OutOfService instances. Specifically, whether + // the cause is Elastic Load Balancing or the instance. + // + // Valid values: ELB | Instance | N/A + ReasonCode *string `type:"string"` + + // The current state of the instance. + // + // Valid values: InService | OutOfService | Unknown + State *string `type:"string"` +} + +// 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() +} + +// SetDescription sets the Description field's value. +func (s *InstanceState) SetDescription(v string) *InstanceState { + s.Description = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *InstanceState) SetInstanceId(v string) *InstanceState { + s.InstanceId = &v + return s +} + +// SetReasonCode sets the ReasonCode field's value. +func (s *InstanceState) SetReasonCode(v string) *InstanceState { + s.ReasonCode = &v + return s +} + +// SetState sets the State field's value. +func (s *InstanceState) SetState(v string) *InstanceState { + s.State = &v + return s +} + +// Information about a policy for duration-based session stickiness. +type LBCookieStickinessPolicy struct { + _ struct{} `type:"structure"` + + // The time period, in seconds, after which the cookie should be considered + // stale. If this parameter is not specified, the stickiness session lasts for + // the duration of the browser session. + CookieExpirationPeriod *int64 `type:"long"` + + // The name of the policy. This name must be unique within the set of policies + // for this load balancer. + PolicyName *string `type:"string"` +} + +// String returns the string representation +func (s LBCookieStickinessPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LBCookieStickinessPolicy) GoString() string { + return s.String() +} + +// SetCookieExpirationPeriod sets the CookieExpirationPeriod field's value. +func (s *LBCookieStickinessPolicy) SetCookieExpirationPeriod(v int64) *LBCookieStickinessPolicy { + s.CookieExpirationPeriod = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *LBCookieStickinessPolicy) SetPolicyName(v string) *LBCookieStickinessPolicy { + s.PolicyName = &v + return s +} + +// Information about an Elastic Load Balancing resource limit for your AWS account. +type Limit struct { + _ struct{} `type:"structure"` + + // The maximum value of the limit. + Max *string `type:"string"` + + // The name of the limit. The possible values are: + // + // * classic-listeners + // + // * classic-load-balancers + // + // * classic-registered-instances + Name *string `type:"string"` +} + +// String returns the string representation +func (s Limit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Limit) GoString() string { + return s.String() +} + +// SetMax sets the Max field's value. +func (s *Limit) SetMax(v string) *Limit { + s.Max = &v + return s +} + +// SetName sets the Name field's value. +func (s *Limit) SetName(v string) *Limit { + s.Name = &v + return s +} + +// Information about a listener. +// +// For information about the protocols and the ports supported by Elastic Load +// Balancing, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +// in the Classic Load Balancers Guide. +type Listener struct { + _ struct{} `type:"structure"` + + // The port on which the instance is listening. + // + // InstancePort is a required field + InstancePort *int64 `min:"1" type:"integer" required:"true"` + + // The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or + // SSL. + // + // If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must + // be at the same protocol. + // + // If there is another listener with the same InstancePort whose InstanceProtocol + // is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure. + // + // If there is another listener with the same InstancePort whose InstanceProtocol + // is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP. + InstanceProtocol *string `type:"string"` + + // The port on which the load balancer is listening. On EC2-VPC, you can specify + // any port from the range 1-65535. On EC2-Classic, you can specify any port + // from the following list: 25, 80, 443, 465, 587, 1024-65535. + // + // LoadBalancerPort is a required field + LoadBalancerPort *int64 `type:"integer" required:"true"` + + // The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, + // or SSL. + // + // Protocol is a required field + Protocol *string `type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the server certificate. + SSLCertificateId *string `type:"string"` +} + +// String returns the string representation +func (s Listener) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Listener) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Listener) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Listener"} + if s.InstancePort == nil { + invalidParams.Add(request.NewErrParamRequired("InstancePort")) + } + if s.InstancePort != nil && *s.InstancePort < 1 { + invalidParams.Add(request.NewErrParamMinValue("InstancePort", 1)) + } + if s.LoadBalancerPort == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort")) + } + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstancePort sets the InstancePort field's value. +func (s *Listener) SetInstancePort(v int64) *Listener { + s.InstancePort = &v + return s +} + +// SetInstanceProtocol sets the InstanceProtocol field's value. +func (s *Listener) SetInstanceProtocol(v string) *Listener { + s.InstanceProtocol = &v + return s +} + +// SetLoadBalancerPort sets the LoadBalancerPort field's value. +func (s *Listener) SetLoadBalancerPort(v int64) *Listener { + s.LoadBalancerPort = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *Listener) SetProtocol(v string) *Listener { + s.Protocol = &v + return s +} + +// SetSSLCertificateId sets the SSLCertificateId field's value. +func (s *Listener) SetSSLCertificateId(v string) *Listener { + s.SSLCertificateId = &v + return s +} + +// The policies enabled for a listener. +type ListenerDescription struct { + _ struct{} `type:"structure"` + + // The listener. + Listener *Listener `type:"structure"` + + // The policies. If there are no policies enabled, the list is empty. + PolicyNames []*string `type:"list"` +} + +// String returns the string representation +func (s ListenerDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListenerDescription) GoString() string { + return s.String() +} + +// SetListener sets the Listener field's value. +func (s *ListenerDescription) SetListener(v *Listener) *ListenerDescription { + s.Listener = v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *ListenerDescription) SetPolicyNames(v []*string) *ListenerDescription { + s.PolicyNames = v + return s +} + +// The attributes for a load balancer. +type LoadBalancerAttributes struct { + _ struct{} `type:"structure"` + + // If enabled, the load balancer captures detailed information of all requests + // and delivers the information to the Amazon S3 bucket that you specify. + // + // For more information, see Enable Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html) + // in the Classic Load Balancers Guide. + AccessLog *AccessLog `type:"structure"` + + // This parameter is reserved. + AdditionalAttributes []*AdditionalAttribute `type:"list"` + + // If enabled, the load balancer allows existing requests to complete before + // the load balancer shifts traffic away from a deregistered or unhealthy instance. + // + // For more information, see Configure Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) + // in the Classic Load Balancers Guide. + ConnectionDraining *ConnectionDraining `type:"structure"` + + // If enabled, the load balancer allows the connections to remain idle (no data + // is sent over the connection) for the specified duration. + // + // By default, Elastic Load Balancing maintains a 60-second idle connection + // timeout for both front-end and back-end connections of your load balancer. + // For more information, see Configure Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) + // in the Classic Load Balancers Guide. + ConnectionSettings *ConnectionSettings `type:"structure"` + + // If enabled, the load balancer routes the request traffic evenly across all + // instances regardless of the Availability Zones. + // + // For more information, see Configure Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) + // in the Classic Load Balancers Guide. + CrossZoneLoadBalancing *CrossZoneLoadBalancing `type:"structure"` +} + +// String returns the string representation +func (s LoadBalancerAttributes) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerAttributes) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoadBalancerAttributes) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoadBalancerAttributes"} + if s.AccessLog != nil { + if err := s.AccessLog.Validate(); err != nil { + invalidParams.AddNested("AccessLog", err.(request.ErrInvalidParams)) + } + } + if s.ConnectionDraining != nil { + if err := s.ConnectionDraining.Validate(); err != nil { + invalidParams.AddNested("ConnectionDraining", err.(request.ErrInvalidParams)) + } + } + if s.ConnectionSettings != nil { + if err := s.ConnectionSettings.Validate(); err != nil { + invalidParams.AddNested("ConnectionSettings", err.(request.ErrInvalidParams)) + } + } + if s.CrossZoneLoadBalancing != nil { + if err := s.CrossZoneLoadBalancing.Validate(); err != nil { + invalidParams.AddNested("CrossZoneLoadBalancing", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessLog sets the AccessLog field's value. +func (s *LoadBalancerAttributes) SetAccessLog(v *AccessLog) *LoadBalancerAttributes { + s.AccessLog = v + return s +} + +// SetAdditionalAttributes sets the AdditionalAttributes field's value. +func (s *LoadBalancerAttributes) SetAdditionalAttributes(v []*AdditionalAttribute) *LoadBalancerAttributes { + s.AdditionalAttributes = v + return s +} + +// SetConnectionDraining sets the ConnectionDraining field's value. +func (s *LoadBalancerAttributes) SetConnectionDraining(v *ConnectionDraining) *LoadBalancerAttributes { + s.ConnectionDraining = v + return s +} + +// SetConnectionSettings sets the ConnectionSettings field's value. +func (s *LoadBalancerAttributes) SetConnectionSettings(v *ConnectionSettings) *LoadBalancerAttributes { + s.ConnectionSettings = v + return s +} + +// SetCrossZoneLoadBalancing sets the CrossZoneLoadBalancing field's value. +func (s *LoadBalancerAttributes) SetCrossZoneLoadBalancing(v *CrossZoneLoadBalancing) *LoadBalancerAttributes { + s.CrossZoneLoadBalancing = v + return s +} + +// Information about a load balancer. +type LoadBalancerDescription struct { + _ struct{} `type:"structure"` + + // The Availability Zones for the load balancer. + AvailabilityZones []*string `type:"list"` + + // Information about your EC2 instances. + BackendServerDescriptions []*BackendServerDescription `type:"list"` + + // The DNS name of the load balancer. + // + // For more information, see Configure a Custom Domain Name (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html) + // in the Classic Load Balancers Guide. + CanonicalHostedZoneName *string `type:"string"` + + // The ID of the Amazon Route 53 hosted zone for the load balancer. + CanonicalHostedZoneNameID *string `type:"string"` + + // The date and time the load balancer was created. + CreatedTime *time.Time `type:"timestamp"` + + // The DNS name of the load balancer. + DNSName *string `type:"string"` + + // Information about the health checks conducted on the load balancer. + HealthCheck *HealthCheck `type:"structure"` + + // The IDs of the instances for the load balancer. + Instances []*Instance `type:"list"` + + // The listeners for the load balancer. + ListenerDescriptions []*ListenerDescription `type:"list"` + + // The name of the load balancer. + LoadBalancerName *string `type:"string"` + + // The policies defined for the load balancer. + Policies *Policies `type:"structure"` + + // The type of load balancer. Valid only for load balancers in a VPC. + // + // If Scheme is internet-facing, the load balancer has a public DNS name that + // resolves to a public IP address. + // + // If Scheme is internal, the load balancer has a public DNS name that resolves + // to a private IP address. + Scheme *string `type:"string"` + + // The security groups for the load balancer. Valid only for load balancers + // in a VPC. + SecurityGroups []*string `type:"list"` + + // The security group for the load balancer, which you can use as part of your + // inbound rules for your registered instances. To only allow traffic from load + // balancers, add a security group rule that specifies this source security + // group as the inbound source. + SourceSecurityGroup *SourceSecurityGroup `type:"structure"` + + // The IDs of the subnets for the load balancer. + Subnets []*string `type:"list"` + + // The ID of the VPC for the load balancer. + VPCId *string `type:"string"` +} + +// String returns the string representation +func (s LoadBalancerDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerDescription) GoString() string { + return s.String() +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *LoadBalancerDescription) SetAvailabilityZones(v []*string) *LoadBalancerDescription { + s.AvailabilityZones = v + return s +} + +// SetBackendServerDescriptions sets the BackendServerDescriptions field's value. +func (s *LoadBalancerDescription) SetBackendServerDescriptions(v []*BackendServerDescription) *LoadBalancerDescription { + s.BackendServerDescriptions = v + return s +} + +// SetCanonicalHostedZoneName sets the CanonicalHostedZoneName field's value. +func (s *LoadBalancerDescription) SetCanonicalHostedZoneName(v string) *LoadBalancerDescription { + s.CanonicalHostedZoneName = &v + return s +} + +// SetCanonicalHostedZoneNameID sets the CanonicalHostedZoneNameID field's value. +func (s *LoadBalancerDescription) SetCanonicalHostedZoneNameID(v string) *LoadBalancerDescription { + s.CanonicalHostedZoneNameID = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *LoadBalancerDescription) SetCreatedTime(v time.Time) *LoadBalancerDescription { + s.CreatedTime = &v + return s +} + +// SetDNSName sets the DNSName field's value. +func (s *LoadBalancerDescription) SetDNSName(v string) *LoadBalancerDescription { + s.DNSName = &v + return s +} + +// SetHealthCheck sets the HealthCheck field's value. +func (s *LoadBalancerDescription) SetHealthCheck(v *HealthCheck) *LoadBalancerDescription { + s.HealthCheck = v + return s +} + +// SetInstances sets the Instances field's value. +func (s *LoadBalancerDescription) SetInstances(v []*Instance) *LoadBalancerDescription { + s.Instances = v + return s +} + +// SetListenerDescriptions sets the ListenerDescriptions field's value. +func (s *LoadBalancerDescription) SetListenerDescriptions(v []*ListenerDescription) *LoadBalancerDescription { + s.ListenerDescriptions = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *LoadBalancerDescription) SetLoadBalancerName(v string) *LoadBalancerDescription { + s.LoadBalancerName = &v + return s +} + +// SetPolicies sets the Policies field's value. +func (s *LoadBalancerDescription) SetPolicies(v *Policies) *LoadBalancerDescription { + s.Policies = v + return s +} + +// SetScheme sets the Scheme field's value. +func (s *LoadBalancerDescription) SetScheme(v string) *LoadBalancerDescription { + s.Scheme = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *LoadBalancerDescription) SetSecurityGroups(v []*string) *LoadBalancerDescription { + s.SecurityGroups = v + return s +} + +// SetSourceSecurityGroup sets the SourceSecurityGroup field's value. +func (s *LoadBalancerDescription) SetSourceSecurityGroup(v *SourceSecurityGroup) *LoadBalancerDescription { + s.SourceSecurityGroup = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *LoadBalancerDescription) SetSubnets(v []*string) *LoadBalancerDescription { + s.Subnets = v + return s +} + +// SetVPCId sets the VPCId field's value. +func (s *LoadBalancerDescription) SetVPCId(v string) *LoadBalancerDescription { + s.VPCId = &v + return s +} + +// Contains the parameters for ModifyLoadBalancerAttributes. +type ModifyLoadBalancerAttributesInput struct { + _ struct{} `type:"structure"` + + // The attributes for the load balancer. + // + // LoadBalancerAttributes is a required field + LoadBalancerAttributes *LoadBalancerAttributes `type:"structure" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyLoadBalancerAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyLoadBalancerAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyLoadBalancerAttributesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyLoadBalancerAttributesInput"} + if s.LoadBalancerAttributes == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerAttributes")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.LoadBalancerAttributes != nil { + if err := s.LoadBalancerAttributes.Validate(); err != nil { + invalidParams.AddNested("LoadBalancerAttributes", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerAttributes sets the LoadBalancerAttributes field's value. +func (s *ModifyLoadBalancerAttributesInput) SetLoadBalancerAttributes(v *LoadBalancerAttributes) *ModifyLoadBalancerAttributesInput { + s.LoadBalancerAttributes = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *ModifyLoadBalancerAttributesInput) SetLoadBalancerName(v string) *ModifyLoadBalancerAttributesInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output of ModifyLoadBalancerAttributes. +type ModifyLoadBalancerAttributesOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancer attributes. + LoadBalancerAttributes *LoadBalancerAttributes `type:"structure"` + + // The name of the load balancer. + LoadBalancerName *string `type:"string"` +} + +// String returns the string representation +func (s ModifyLoadBalancerAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyLoadBalancerAttributesOutput) GoString() string { + return s.String() +} + +// SetLoadBalancerAttributes sets the LoadBalancerAttributes field's value. +func (s *ModifyLoadBalancerAttributesOutput) SetLoadBalancerAttributes(v *LoadBalancerAttributes) *ModifyLoadBalancerAttributesOutput { + s.LoadBalancerAttributes = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *ModifyLoadBalancerAttributesOutput) SetLoadBalancerName(v string) *ModifyLoadBalancerAttributesOutput { + s.LoadBalancerName = &v + return s +} + +// The policies for a load balancer. +type Policies struct { + _ struct{} `type:"structure"` + + // The stickiness policies created using CreateAppCookieStickinessPolicy. + AppCookieStickinessPolicies []*AppCookieStickinessPolicy `type:"list"` + + // The stickiness policies created using CreateLBCookieStickinessPolicy. + LBCookieStickinessPolicies []*LBCookieStickinessPolicy `type:"list"` + + // The policies other than the stickiness policies. + OtherPolicies []*string `type:"list"` +} + +// String returns the string representation +func (s Policies) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Policies) GoString() string { + return s.String() +} + +// SetAppCookieStickinessPolicies sets the AppCookieStickinessPolicies field's value. +func (s *Policies) SetAppCookieStickinessPolicies(v []*AppCookieStickinessPolicy) *Policies { + s.AppCookieStickinessPolicies = v + return s +} + +// SetLBCookieStickinessPolicies sets the LBCookieStickinessPolicies field's value. +func (s *Policies) SetLBCookieStickinessPolicies(v []*LBCookieStickinessPolicy) *Policies { + s.LBCookieStickinessPolicies = v + return s +} + +// SetOtherPolicies sets the OtherPolicies field's value. +func (s *Policies) SetOtherPolicies(v []*string) *Policies { + s.OtherPolicies = v + return s +} + +// Information about a policy attribute. +type PolicyAttribute struct { + _ struct{} `type:"structure"` + + // The name of the attribute. + AttributeName *string `type:"string"` + + // The value of the attribute. + AttributeValue *string `type:"string"` +} + +// String returns the string representation +func (s PolicyAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyAttribute) GoString() string { + return s.String() +} + +// SetAttributeName sets the AttributeName field's value. +func (s *PolicyAttribute) SetAttributeName(v string) *PolicyAttribute { + s.AttributeName = &v + return s +} + +// SetAttributeValue sets the AttributeValue field's value. +func (s *PolicyAttribute) SetAttributeValue(v string) *PolicyAttribute { + s.AttributeValue = &v + return s +} + +// Information about a policy attribute. +type PolicyAttributeDescription struct { + _ struct{} `type:"structure"` + + // The name of the attribute. + AttributeName *string `type:"string"` + + // The value of the attribute. + AttributeValue *string `type:"string"` +} + +// String returns the string representation +func (s PolicyAttributeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyAttributeDescription) GoString() string { + return s.String() +} + +// SetAttributeName sets the AttributeName field's value. +func (s *PolicyAttributeDescription) SetAttributeName(v string) *PolicyAttributeDescription { + s.AttributeName = &v + return s +} + +// SetAttributeValue sets the AttributeValue field's value. +func (s *PolicyAttributeDescription) SetAttributeValue(v string) *PolicyAttributeDescription { + s.AttributeValue = &v + return s +} + +// Information about a policy attribute type. +type PolicyAttributeTypeDescription struct { + _ struct{} `type:"structure"` + + // The name of the attribute. + AttributeName *string `type:"string"` + + // The type of the attribute. For example, Boolean or Integer. + AttributeType *string `type:"string"` + + // The cardinality of the attribute. + // + // Valid values: + // + // * ONE(1) : Single value required + // + // * ZERO_OR_ONE(0..1) : Up to one value is allowed + // + // * ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed + // + // * ONE_OR_MORE(1..*0) : Required. Multiple values are allowed + Cardinality *string `type:"string"` + + // The default value of the attribute, if applicable. + DefaultValue *string `type:"string"` + + // A description of the attribute. + Description *string `type:"string"` +} + +// String returns the string representation +func (s PolicyAttributeTypeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyAttributeTypeDescription) GoString() string { + return s.String() +} + +// SetAttributeName sets the AttributeName field's value. +func (s *PolicyAttributeTypeDescription) SetAttributeName(v string) *PolicyAttributeTypeDescription { + s.AttributeName = &v + return s +} + +// SetAttributeType sets the AttributeType field's value. +func (s *PolicyAttributeTypeDescription) SetAttributeType(v string) *PolicyAttributeTypeDescription { + s.AttributeType = &v + return s +} + +// SetCardinality sets the Cardinality field's value. +func (s *PolicyAttributeTypeDescription) SetCardinality(v string) *PolicyAttributeTypeDescription { + s.Cardinality = &v + return s +} + +// SetDefaultValue sets the DefaultValue field's value. +func (s *PolicyAttributeTypeDescription) SetDefaultValue(v string) *PolicyAttributeTypeDescription { + s.DefaultValue = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *PolicyAttributeTypeDescription) SetDescription(v string) *PolicyAttributeTypeDescription { + s.Description = &v + return s +} + +// Information about a policy. +type PolicyDescription struct { + _ struct{} `type:"structure"` + + // The policy attributes. + PolicyAttributeDescriptions []*PolicyAttributeDescription `type:"list"` + + // The name of the policy. + PolicyName *string `type:"string"` + + // The name of the policy type. + PolicyTypeName *string `type:"string"` +} + +// String returns the string representation +func (s PolicyDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyDescription) GoString() string { + return s.String() +} + +// SetPolicyAttributeDescriptions sets the PolicyAttributeDescriptions field's value. +func (s *PolicyDescription) SetPolicyAttributeDescriptions(v []*PolicyAttributeDescription) *PolicyDescription { + s.PolicyAttributeDescriptions = v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *PolicyDescription) SetPolicyName(v string) *PolicyDescription { + s.PolicyName = &v + return s +} + +// SetPolicyTypeName sets the PolicyTypeName field's value. +func (s *PolicyDescription) SetPolicyTypeName(v string) *PolicyDescription { + s.PolicyTypeName = &v + return s +} + +// Information about a policy type. +type PolicyTypeDescription struct { + _ struct{} `type:"structure"` + + // A description of the policy type. + Description *string `type:"string"` + + // The description of the policy attributes associated with the policies defined + // by Elastic Load Balancing. + PolicyAttributeTypeDescriptions []*PolicyAttributeTypeDescription `type:"list"` + + // The name of the policy type. + PolicyTypeName *string `type:"string"` +} + +// String returns the string representation +func (s PolicyTypeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyTypeDescription) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *PolicyTypeDescription) SetDescription(v string) *PolicyTypeDescription { + s.Description = &v + return s +} + +// SetPolicyAttributeTypeDescriptions sets the PolicyAttributeTypeDescriptions field's value. +func (s *PolicyTypeDescription) SetPolicyAttributeTypeDescriptions(v []*PolicyAttributeTypeDescription) *PolicyTypeDescription { + s.PolicyAttributeTypeDescriptions = v + return s +} + +// SetPolicyTypeName sets the PolicyTypeName field's value. +func (s *PolicyTypeDescription) SetPolicyTypeName(v string) *PolicyTypeDescription { + s.PolicyTypeName = &v + return s +} + +// Contains the parameters for RegisterInstancesWithLoadBalancer. +type RegisterInstancesWithLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The IDs of the instances. + // + // Instances is a required field + Instances []*Instance `type:"list" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RegisterInstancesWithLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterInstancesWithLoadBalancerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterInstancesWithLoadBalancerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterInstancesWithLoadBalancerInput"} + if s.Instances == nil { + invalidParams.Add(request.NewErrParamRequired("Instances")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstances sets the Instances field's value. +func (s *RegisterInstancesWithLoadBalancerInput) SetInstances(v []*Instance) *RegisterInstancesWithLoadBalancerInput { + s.Instances = v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *RegisterInstancesWithLoadBalancerInput) SetLoadBalancerName(v string) *RegisterInstancesWithLoadBalancerInput { + s.LoadBalancerName = &v + return s +} + +// Contains the output of RegisterInstancesWithLoadBalancer. +type RegisterInstancesWithLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // The updated list of instances for the load balancer. + Instances []*Instance `type:"list"` +} + +// String returns the string representation +func (s RegisterInstancesWithLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterInstancesWithLoadBalancerOutput) GoString() string { + return s.String() +} + +// SetInstances sets the Instances field's value. +func (s *RegisterInstancesWithLoadBalancerOutput) SetInstances(v []*Instance) *RegisterInstancesWithLoadBalancerOutput { + s.Instances = v + return s +} + +// Contains the parameters for RemoveTags. +type RemoveTagsInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. You can specify a maximum of one load balancer + // name. + // + // LoadBalancerNames is a required field + LoadBalancerNames []*string `type:"list" required:"true"` + + // The list of tag keys to remove. + // + // Tags is a required field + Tags []*TagKeyOnly `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s RemoveTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} + if s.LoadBalancerNames == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + 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 +} + +// SetLoadBalancerNames sets the LoadBalancerNames field's value. +func (s *RemoveTagsInput) SetLoadBalancerNames(v []*string) *RemoveTagsInput { + s.LoadBalancerNames = v + return s +} + +// SetTags sets the Tags field's value. +func (s *RemoveTagsInput) SetTags(v []*TagKeyOnly) *RemoveTagsInput { + s.Tags = v + return s +} + +// Contains the output of RemoveTags. +type RemoveTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTagsOutput) GoString() string { + return s.String() +} + +// Contains the parameters for SetLoadBalancerListenerSSLCertificate. +type SetLoadBalancerListenerSSLCertificateInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The port that uses the specified SSL certificate. + // + // LoadBalancerPort is a required field + LoadBalancerPort *int64 `type:"integer" required:"true"` + + // The Amazon Resource Name (ARN) of the SSL certificate. + // + // SSLCertificateId is a required field + SSLCertificateId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SetLoadBalancerListenerSSLCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerListenerSSLCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetLoadBalancerListenerSSLCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerListenerSSLCertificateInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.LoadBalancerPort == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort")) + } + if s.SSLCertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("SSLCertificateId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *SetLoadBalancerListenerSSLCertificateInput) SetLoadBalancerName(v string) *SetLoadBalancerListenerSSLCertificateInput { + s.LoadBalancerName = &v + return s +} + +// SetLoadBalancerPort sets the LoadBalancerPort field's value. +func (s *SetLoadBalancerListenerSSLCertificateInput) SetLoadBalancerPort(v int64) *SetLoadBalancerListenerSSLCertificateInput { + s.LoadBalancerPort = &v + return s +} + +// SetSSLCertificateId sets the SSLCertificateId field's value. +func (s *SetLoadBalancerListenerSSLCertificateInput) SetSSLCertificateId(v string) *SetLoadBalancerListenerSSLCertificateInput { + s.SSLCertificateId = &v + return s +} + +// Contains the output of SetLoadBalancerListenerSSLCertificate. +type SetLoadBalancerListenerSSLCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetLoadBalancerListenerSSLCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerListenerSSLCertificateOutput) GoString() string { + return s.String() +} + +// Contains the parameters for SetLoadBalancerPoliciesForBackendServer. +type SetLoadBalancerPoliciesForBackendServerInput struct { + _ struct{} `type:"structure"` + + // The port number associated with the EC2 instance. + // + // InstancePort is a required field + InstancePort *int64 `type:"integer" required:"true"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The names of the policies. If the list is empty, then all current polices + // are removed from the EC2 instance. + // + // PolicyNames is a required field + PolicyNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetLoadBalancerPoliciesForBackendServerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerPoliciesForBackendServerInput"} + if s.InstancePort == nil { + invalidParams.Add(request.NewErrParamRequired("InstancePort")) + } + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.PolicyNames == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstancePort sets the InstancePort field's value. +func (s *SetLoadBalancerPoliciesForBackendServerInput) SetInstancePort(v int64) *SetLoadBalancerPoliciesForBackendServerInput { + s.InstancePort = &v + return s +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *SetLoadBalancerPoliciesForBackendServerInput) SetLoadBalancerName(v string) *SetLoadBalancerPoliciesForBackendServerInput { + s.LoadBalancerName = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *SetLoadBalancerPoliciesForBackendServerInput) SetPolicyNames(v []*string) *SetLoadBalancerPoliciesForBackendServerInput { + s.PolicyNames = v + return s +} + +// Contains the output of SetLoadBalancerPoliciesForBackendServer. +type SetLoadBalancerPoliciesForBackendServerOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerOutput) GoString() string { + return s.String() +} + +// Contains the parameters for SetLoadBalancePoliciesOfListener. +type SetLoadBalancerPoliciesOfListenerInput struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + // + // LoadBalancerName is a required field + LoadBalancerName *string `type:"string" required:"true"` + + // The external port of the load balancer. + // + // LoadBalancerPort is a required field + LoadBalancerPort *int64 `type:"integer" required:"true"` + + // The names of the policies. This list must include all policies to be enabled. + // If you omit a policy that is currently enabled, it is disabled. If the list + // is empty, all current policies are disabled. + // + // PolicyNames is a required field + PolicyNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s SetLoadBalancerPoliciesOfListenerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesOfListenerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetLoadBalancerPoliciesOfListenerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerPoliciesOfListenerInput"} + if s.LoadBalancerName == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerName")) + } + if s.LoadBalancerPort == nil { + invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort")) + } + if s.PolicyNames == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *SetLoadBalancerPoliciesOfListenerInput) SetLoadBalancerName(v string) *SetLoadBalancerPoliciesOfListenerInput { + s.LoadBalancerName = &v + return s +} + +// SetLoadBalancerPort sets the LoadBalancerPort field's value. +func (s *SetLoadBalancerPoliciesOfListenerInput) SetLoadBalancerPort(v int64) *SetLoadBalancerPoliciesOfListenerInput { + s.LoadBalancerPort = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *SetLoadBalancerPoliciesOfListenerInput) SetPolicyNames(v []*string) *SetLoadBalancerPoliciesOfListenerInput { + s.PolicyNames = v + return s +} + +// Contains the output of SetLoadBalancePoliciesOfListener. +type SetLoadBalancerPoliciesOfListenerOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetLoadBalancerPoliciesOfListenerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesOfListenerOutput) GoString() string { + return s.String() +} + +// Information about a source security group. +type SourceSecurityGroup struct { + _ struct{} `type:"structure"` + + // The name of the security group. + GroupName *string `type:"string"` + + // The owner of the security group. + OwnerAlias *string `type:"string"` +} + +// String returns the string representation +func (s SourceSecurityGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SourceSecurityGroup) GoString() string { + return s.String() +} + +// SetGroupName sets the GroupName field's value. +func (s *SourceSecurityGroup) SetGroupName(v string) *SourceSecurityGroup { + s.GroupName = &v + return s +} + +// SetOwnerAlias sets the OwnerAlias field's value. +func (s *SourceSecurityGroup) SetOwnerAlias(v string) *SourceSecurityGroup { + s.OwnerAlias = &v + return s +} + +// Information about a tag. +type Tag struct { + _ struct{} `type:"structure"` + + // The key of the tag. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value of the tag. + Value *string `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() +} + +// 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 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 +} + +// The tags associated with a load balancer. +type TagDescription struct { + _ struct{} `type:"structure"` + + // The name of the load balancer. + LoadBalancerName *string `type:"string"` + + // The tags. + Tags []*Tag `min:"1" type:"list"` +} + +// 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() +} + +// SetLoadBalancerName sets the LoadBalancerName field's value. +func (s *TagDescription) SetLoadBalancerName(v string) *TagDescription { + s.LoadBalancerName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TagDescription) SetTags(v []*Tag) *TagDescription { + s.Tags = v + return s +} + +// The key of a tag. +type TagKeyOnly struct { + _ struct{} `type:"structure"` + + // The name of the key. + Key *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s TagKeyOnly) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagKeyOnly) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagKeyOnly) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagKeyOnly"} + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *TagKeyOnly) SetKey(v string) *TagKeyOnly { + s.Key = &v + return s +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go b/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go new file mode 100644 index 00000000000..0b93ed4740b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go @@ -0,0 +1,50 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package elb provides the client and types for making API +// requests to Elastic Load Balancing. +// +// A load balancer can distribute incoming traffic across your EC2 instances. +// This enables you to increase the availability of your application. The load +// balancer also monitors the health of its registered instances and ensures +// that it routes traffic only to healthy instances. You configure your load +// balancer to accept incoming traffic by specifying one or more listeners, +// which are configured with a protocol and port number for connections from +// clients to the load balancer and a protocol and port number for connections +// from the load balancer to the instances. +// +// Elastic Load Balancing supports three types of load balancers: Application +// Load Balancers, Network Load Balancers, and Classic Load Balancers. You can +// select a load balancer based on your application needs. For more information, +// see the Elastic Load Balancing User Guide (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). +// +// This reference covers the 2012-06-01 API, which supports Classic Load Balancers. +// The 2015-12-01 API supports Application Load Balancers and Network Load Balancers. +// +// To get started, create a load balancer with one or more listeners using CreateLoadBalancer. +// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer. +// +// All Elastic Load Balancing operations are idempotent, which means that they +// complete at most one time. If you repeat an operation, it succeeds with a +// 200 OK response code. +// +// See https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01 for more information on this service. +// +// See elb package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/elb/ +// +// Using the Client +// +// To contact Elastic Load Balancing 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 Elastic Load Balancing client ELB for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/elb/#New +package elb diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go new file mode 100644 index 00000000000..14f1e6717e4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/errors.go @@ -0,0 +1,145 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elb + +const ( + + // ErrCodeAccessPointNotFoundException for service response error code + // "LoadBalancerNotFound". + // + // The specified load balancer does not exist. + ErrCodeAccessPointNotFoundException = "LoadBalancerNotFound" + + // ErrCodeCertificateNotFoundException for service response error code + // "CertificateNotFound". + // + // The specified ARN does not refer to a valid SSL certificate in AWS Identity + // and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if + // you recently uploaded the certificate to IAM, this error might indicate that + // the certificate is not fully available yet. + ErrCodeCertificateNotFoundException = "CertificateNotFound" + + // ErrCodeDependencyThrottleException for service response error code + // "DependencyThrottle". + // + // A request made by Elastic Load Balancing to another service exceeds the maximum + // request rate permitted for your account. + ErrCodeDependencyThrottleException = "DependencyThrottle" + + // ErrCodeDuplicateAccessPointNameException for service response error code + // "DuplicateLoadBalancerName". + // + // The specified load balancer name already exists for this account. + ErrCodeDuplicateAccessPointNameException = "DuplicateLoadBalancerName" + + // ErrCodeDuplicateListenerException for service response error code + // "DuplicateListener". + // + // A listener already exists for the specified load balancer name and port, + // but with a different instance port, protocol, or SSL certificate. + ErrCodeDuplicateListenerException = "DuplicateListener" + + // ErrCodeDuplicatePolicyNameException for service response error code + // "DuplicatePolicyName". + // + // A policy with the specified name already exists for this load balancer. + ErrCodeDuplicatePolicyNameException = "DuplicatePolicyName" + + // ErrCodeDuplicateTagKeysException for service response error code + // "DuplicateTagKeys". + // + // A tag key was specified more than once. + ErrCodeDuplicateTagKeysException = "DuplicateTagKeys" + + // ErrCodeInvalidConfigurationRequestException for service response error code + // "InvalidConfigurationRequest". + // + // The requested configuration change is not valid. + ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest" + + // ErrCodeInvalidEndPointException for service response error code + // "InvalidInstance". + // + // The specified endpoint is not valid. + ErrCodeInvalidEndPointException = "InvalidInstance" + + // ErrCodeInvalidSchemeException for service response error code + // "InvalidScheme". + // + // The specified value for the schema is not valid. You can only specify a scheme + // for load balancers in a VPC. + ErrCodeInvalidSchemeException = "InvalidScheme" + + // ErrCodeInvalidSecurityGroupException for service response error code + // "InvalidSecurityGroup". + // + // One or more of the specified security groups do not exist. + ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup" + + // ErrCodeInvalidSubnetException for service response error code + // "InvalidSubnet". + // + // The specified VPC has no associated Internet gateway. + ErrCodeInvalidSubnetException = "InvalidSubnet" + + // ErrCodeListenerNotFoundException for service response error code + // "ListenerNotFound". + // + // The load balancer does not have a listener configured at the specified port. + ErrCodeListenerNotFoundException = "ListenerNotFound" + + // ErrCodeLoadBalancerAttributeNotFoundException for service response error code + // "LoadBalancerAttributeNotFound". + // + // The specified load balancer attribute does not exist. + ErrCodeLoadBalancerAttributeNotFoundException = "LoadBalancerAttributeNotFound" + + // ErrCodeOperationNotPermittedException for service response error code + // "OperationNotPermitted". + // + // This operation is not allowed. + ErrCodeOperationNotPermittedException = "OperationNotPermitted" + + // ErrCodePolicyNotFoundException for service response error code + // "PolicyNotFound". + // + // One or more of the specified policies do not exist. + ErrCodePolicyNotFoundException = "PolicyNotFound" + + // ErrCodePolicyTypeNotFoundException for service response error code + // "PolicyTypeNotFound". + // + // One or more of the specified policy types do not exist. + ErrCodePolicyTypeNotFoundException = "PolicyTypeNotFound" + + // ErrCodeSubnetNotFoundException for service response error code + // "SubnetNotFound". + // + // One or more of the specified subnets do not exist. + ErrCodeSubnetNotFoundException = "SubnetNotFound" + + // ErrCodeTooManyAccessPointsException for service response error code + // "TooManyLoadBalancers". + // + // The quota for the number of load balancers has been reached. + ErrCodeTooManyAccessPointsException = "TooManyLoadBalancers" + + // ErrCodeTooManyPoliciesException for service response error code + // "TooManyPolicies". + // + // The quota for the number of policies for this load balancer has been reached. + ErrCodeTooManyPoliciesException = "TooManyPolicies" + + // ErrCodeTooManyTagsException for service response error code + // "TooManyTags". + // + // The quota for the number of tags that can be assigned to a load balancer + // has been reached. + ErrCodeTooManyTagsException = "TooManyTags" + + // ErrCodeUnsupportedProtocolException for service response error code + // "UnsupportedProtocol". + // + // The specified protocol or signature version is not supported. + ErrCodeUnsupportedProtocolException = "UnsupportedProtocol" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go new file mode 100644 index 00000000000..5dfdd322c9b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go @@ -0,0 +1,95 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elb + +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/query" +) + +// ELB provides the API operation methods for making requests to +// Elastic Load Balancing. See this package's package overview docs +// for details on the service. +// +// ELB methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type ELB 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 = "elasticloadbalancing" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "Elastic Load Balancing" // ServiceID is a unique identifer of a specific service. +) + +// New creates a new instance of the ELB 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 ELB client from just a session. +// svc := elb.New(mySession) +// +// // Create a ELB client with additional configuration +// svc := elb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELB { + 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) *ELB { + svc := &ELB{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2012-06-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(query.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a ELB operation and runs any +// custom request initialization. +func (c *ELB) 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/elb/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go new file mode 100644 index 00000000000..bdf449d36b1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go @@ -0,0 +1,158 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elb + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation +// DescribeInstanceHealth 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 *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error { + return c.WaitUntilAnyInstanceInServiceWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilAnyInstanceInServiceWithContext is an extended version of WaitUntilAnyInstanceInService. +// 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 *ELB) WaitUntilAnyInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilAnyInstanceInService", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "InstanceStates[].State", + Expected: "InService", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation +// DescribeInstanceHealth 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 *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error { + return c.WaitUntilInstanceDeregisteredWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceDeregisteredWithContext is an extended version of WaitUntilInstanceDeregistered. +// 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 *ELB) WaitUntilInstanceDeregisteredWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceDeregistered", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State", + Expected: "OutOfService", + }, + { + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "InvalidInstance", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilInstanceInService uses the Elastic Load Balancing API operation +// DescribeInstanceHealth 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 *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error { + return c.WaitUntilInstanceInServiceWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceInServiceWithContext is an extended version of WaitUntilInstanceInService. +// 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 *ELB) WaitUntilInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceInService", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(15 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State", + Expected: "InService", + }, + { + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "InvalidInstance", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeInstanceHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceHealthRequest(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/iam/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/iam/BUILD.bazel new file mode 100644 index 00000000000..19cb2c4ffb4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "doc.go", + "errors.go", + "service.go", + "waiters.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/iam", + importpath = "github.com/aws/aws-sdk-go/service/iam", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/query:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go new file mode 100644 index 00000000000..875df512f41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go @@ -0,0 +1,29394 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +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/query" +) + +const opAddClientIDToOpenIDConnectProvider = "AddClientIDToOpenIDConnectProvider" + +// AddClientIDToOpenIDConnectProviderRequest generates a "aws/request.Request" representing the +// client's request for the AddClientIDToOpenIDConnectProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AddClientIDToOpenIDConnectProvider for more information on using the AddClientIDToOpenIDConnectProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AddClientIDToOpenIDConnectProviderRequest method. +// req, resp := client.AddClientIDToOpenIDConnectProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider +func (c *IAM) AddClientIDToOpenIDConnectProviderRequest(input *AddClientIDToOpenIDConnectProviderInput) (req *request.Request, output *AddClientIDToOpenIDConnectProviderOutput) { + op := &request.Operation{ + Name: opAddClientIDToOpenIDConnectProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddClientIDToOpenIDConnectProviderInput{} + } + + output = &AddClientIDToOpenIDConnectProviderOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AddClientIDToOpenIDConnectProvider API operation for AWS Identity and Access Management. +// +// Adds a new client ID (also known as audience) to the list of client IDs already +// registered for the specified IAM OpenID Connect (OIDC) provider resource. +// +// This operation is idempotent; it does not fail or return an error if you +// add an existing client ID to the provider. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation AddClientIDToOpenIDConnectProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider +func (c *IAM) AddClientIDToOpenIDConnectProvider(input *AddClientIDToOpenIDConnectProviderInput) (*AddClientIDToOpenIDConnectProviderOutput, error) { + req, out := c.AddClientIDToOpenIDConnectProviderRequest(input) + return out, req.Send() +} + +// AddClientIDToOpenIDConnectProviderWithContext is the same as AddClientIDToOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See AddClientIDToOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AddClientIDToOpenIDConnectProviderWithContext(ctx aws.Context, input *AddClientIDToOpenIDConnectProviderInput, opts ...request.Option) (*AddClientIDToOpenIDConnectProviderOutput, error) { + req, out := c.AddClientIDToOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAddRoleToInstanceProfile = "AddRoleToInstanceProfile" + +// AddRoleToInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the AddRoleToInstanceProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AddRoleToInstanceProfile for more information on using the AddRoleToInstanceProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AddRoleToInstanceProfileRequest method. +// req, resp := client.AddRoleToInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile +func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInput) (req *request.Request, output *AddRoleToInstanceProfileOutput) { + op := &request.Operation{ + Name: opAddRoleToInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddRoleToInstanceProfileInput{} + } + + output = &AddRoleToInstanceProfileOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AddRoleToInstanceProfile API operation for AWS Identity and Access Management. +// +// Adds the specified IAM role to the specified instance profile. An instance +// profile can contain only one role, and this limit cannot be increased. You +// can remove the existing role and then add a different role to an instance +// profile. You must then wait for the change to appear across all of AWS because +// of eventual consistency (https://en.wikipedia.org/wiki/Eventual_consistency). +// To force the change, you must disassociate the instance profile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DisassociateIamInstanceProfile.html) +// and then associate the instance profile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateIamInstanceProfile.html), +// or you can stop your instance and then restart it. +// +// The caller of this API must be granted the PassRole permission on the IAM +// role by a permission policy. +// +// For more information about roles, go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). +// For more information about instance profiles, go to About Instance Profiles +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.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 AWS Identity and Access Management's +// API operation AddRoleToInstanceProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile +func (c *IAM) AddRoleToInstanceProfile(input *AddRoleToInstanceProfileInput) (*AddRoleToInstanceProfileOutput, error) { + req, out := c.AddRoleToInstanceProfileRequest(input) + return out, req.Send() +} + +// AddRoleToInstanceProfileWithContext is the same as AddRoleToInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See AddRoleToInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AddRoleToInstanceProfileWithContext(ctx aws.Context, input *AddRoleToInstanceProfileInput, opts ...request.Option) (*AddRoleToInstanceProfileOutput, error) { + req, out := c.AddRoleToInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAddUserToGroup = "AddUserToGroup" + +// AddUserToGroupRequest generates a "aws/request.Request" representing the +// client's request for the AddUserToGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AddUserToGroup for more information on using the AddUserToGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AddUserToGroupRequest method. +// req, resp := client.AddUserToGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup +func (c *IAM) AddUserToGroupRequest(input *AddUserToGroupInput) (req *request.Request, output *AddUserToGroupOutput) { + op := &request.Operation{ + Name: opAddUserToGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddUserToGroupInput{} + } + + output = &AddUserToGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AddUserToGroup API operation for AWS Identity and Access Management. +// +// Adds the specified user to the specified group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation AddUserToGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup +func (c *IAM) AddUserToGroup(input *AddUserToGroupInput) (*AddUserToGroupOutput, error) { + req, out := c.AddUserToGroupRequest(input) + return out, req.Send() +} + +// AddUserToGroupWithContext is the same as AddUserToGroup with the addition of +// the ability to pass a context and additional request options. +// +// See AddUserToGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AddUserToGroupWithContext(ctx aws.Context, input *AddUserToGroupInput, opts ...request.Option) (*AddUserToGroupOutput, error) { + req, out := c.AddUserToGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAttachGroupPolicy = "AttachGroupPolicy" + +// AttachGroupPolicyRequest generates a "aws/request.Request" representing the +// client's request for the AttachGroupPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachGroupPolicy for more information on using the AttachGroupPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachGroupPolicyRequest method. +// req, resp := client.AttachGroupPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy +func (c *IAM) AttachGroupPolicyRequest(input *AttachGroupPolicyInput) (req *request.Request, output *AttachGroupPolicyOutput) { + op := &request.Operation{ + Name: opAttachGroupPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachGroupPolicyInput{} + } + + output = &AttachGroupPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AttachGroupPolicy API operation for AWS Identity and Access Management. +// +// Attaches the specified managed policy to the specified IAM group. +// +// You use this API to attach a managed policy to a group. To embed an inline +// policy in a group, use PutGroupPolicy. +// +// For more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation AttachGroupPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodePolicyNotAttachableException "PolicyNotAttachable" +// The request failed because AWS service role policies can only be attached +// to the service-linked role for that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy +func (c *IAM) AttachGroupPolicy(input *AttachGroupPolicyInput) (*AttachGroupPolicyOutput, error) { + req, out := c.AttachGroupPolicyRequest(input) + return out, req.Send() +} + +// AttachGroupPolicyWithContext is the same as AttachGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See AttachGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AttachGroupPolicyWithContext(ctx aws.Context, input *AttachGroupPolicyInput, opts ...request.Option) (*AttachGroupPolicyOutput, error) { + req, out := c.AttachGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAttachRolePolicy = "AttachRolePolicy" + +// AttachRolePolicyRequest generates a "aws/request.Request" representing the +// client's request for the AttachRolePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachRolePolicy for more information on using the AttachRolePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachRolePolicyRequest method. +// req, resp := client.AttachRolePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy +func (c *IAM) AttachRolePolicyRequest(input *AttachRolePolicyInput) (req *request.Request, output *AttachRolePolicyOutput) { + op := &request.Operation{ + Name: opAttachRolePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachRolePolicyInput{} + } + + output = &AttachRolePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AttachRolePolicy API operation for AWS Identity and Access Management. +// +// Attaches the specified managed policy to the specified IAM role. When you +// attach a managed policy to a role, the managed policy becomes part of the +// role's permission (access) policy. +// +// You cannot use a managed policy as the role's trust policy. The role's trust +// policy is created at the same time as the role, using CreateRole. You can +// update a role's trust policy using UpdateAssumeRolePolicy. +// +// Use this API to attach a managed policy to a role. To embed an inline policy +// in a role, use PutRolePolicy. For more information about policies, see Managed +// Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation AttachRolePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodePolicyNotAttachableException "PolicyNotAttachable" +// The request failed because AWS service role policies can only be attached +// to the service-linked role for that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy +func (c *IAM) AttachRolePolicy(input *AttachRolePolicyInput) (*AttachRolePolicyOutput, error) { + req, out := c.AttachRolePolicyRequest(input) + return out, req.Send() +} + +// AttachRolePolicyWithContext is the same as AttachRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See AttachRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AttachRolePolicyWithContext(ctx aws.Context, input *AttachRolePolicyInput, opts ...request.Option) (*AttachRolePolicyOutput, error) { + req, out := c.AttachRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAttachUserPolicy = "AttachUserPolicy" + +// AttachUserPolicyRequest generates a "aws/request.Request" representing the +// client's request for the AttachUserPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AttachUserPolicy for more information on using the AttachUserPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AttachUserPolicyRequest method. +// req, resp := client.AttachUserPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy +func (c *IAM) AttachUserPolicyRequest(input *AttachUserPolicyInput) (req *request.Request, output *AttachUserPolicyOutput) { + op := &request.Operation{ + Name: opAttachUserPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachUserPolicyInput{} + } + + output = &AttachUserPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// AttachUserPolicy API operation for AWS Identity and Access Management. +// +// Attaches the specified managed policy to the specified user. +// +// You use this API to attach a managed policy to a user. To embed an inline +// policy in a user, use PutUserPolicy. +// +// For more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation AttachUserPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodePolicyNotAttachableException "PolicyNotAttachable" +// The request failed because AWS service role policies can only be attached +// to the service-linked role for that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy +func (c *IAM) AttachUserPolicy(input *AttachUserPolicyInput) (*AttachUserPolicyOutput, error) { + req, out := c.AttachUserPolicyRequest(input) + return out, req.Send() +} + +// AttachUserPolicyWithContext is the same as AttachUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See AttachUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AttachUserPolicyWithContext(ctx aws.Context, input *AttachUserPolicyInput, opts ...request.Option) (*AttachUserPolicyOutput, error) { + req, out := c.AttachUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opChangePassword = "ChangePassword" + +// ChangePasswordRequest generates a "aws/request.Request" representing the +// client's request for the ChangePassword operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ChangePassword for more information on using the ChangePassword +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ChangePasswordRequest method. +// req, resp := client.ChangePasswordRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword +func (c *IAM) ChangePasswordRequest(input *ChangePasswordInput) (req *request.Request, output *ChangePasswordOutput) { + op := &request.Operation{ + Name: opChangePassword, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ChangePasswordInput{} + } + + output = &ChangePasswordOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// ChangePassword API operation for AWS Identity and Access Management. +// +// Changes the password of the IAM user who is calling this operation. The AWS +// account root user password is not affected by this operation. +// +// To change the password for a different user, see UpdateLoginProfile. For +// more information about modifying passwords, see Managing Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation ChangePassword for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidUserTypeException "InvalidUserType" +// The request was rejected because the type of user for the transaction was +// incorrect. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" +// The request was rejected because it referenced an entity that is temporarily +// unmodifiable, such as a user name that was deleted and then recreated. The +// error indicates that the request is likely to succeed if you try again after +// waiting several minutes. The error message describes the entity. +// +// * ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" +// The request was rejected because the provided password did not meet the requirements +// imposed by the account password policy. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword +func (c *IAM) ChangePassword(input *ChangePasswordInput) (*ChangePasswordOutput, error) { + req, out := c.ChangePasswordRequest(input) + return out, req.Send() +} + +// ChangePasswordWithContext is the same as ChangePassword with the addition of +// the ability to pass a context and additional request options. +// +// See ChangePassword for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ChangePasswordWithContext(ctx aws.Context, input *ChangePasswordInput, opts ...request.Option) (*ChangePasswordOutput, error) { + req, out := c.ChangePasswordRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateAccessKey = "CreateAccessKey" + +// CreateAccessKeyRequest generates a "aws/request.Request" representing the +// client's request for the CreateAccessKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAccessKey for more information on using the CreateAccessKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAccessKeyRequest method. +// req, resp := client.CreateAccessKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey +func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) (req *request.Request, output *CreateAccessKeyOutput) { + op := &request.Operation{ + Name: opCreateAccessKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateAccessKeyInput{} + } + + output = &CreateAccessKeyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateAccessKey API operation for AWS Identity and Access Management. +// +// Creates a new AWS secret access key and corresponding AWS access key ID for +// the specified user. The default status for new keys is Active. +// +// If you do not specify a user name, IAM determines the user name implicitly +// based on the AWS access key ID signing the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials. This is true even if the AWS account +// has no associated users. +// +// For information about limits on the number of keys you can create, see Limitations +// on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM User Guide. +// +// To ensure the security of your AWS account, the secret access key is accessible +// only during key and user creation. You must save the key (for example, in +// a text file) if you want to be able to access it again. If a secret key is +// lost, you can delete the access keys for the associated user and then create +// new keys. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation CreateAccessKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey +func (c *IAM) CreateAccessKey(input *CreateAccessKeyInput) (*CreateAccessKeyOutput, error) { + req, out := c.CreateAccessKeyRequest(input) + return out, req.Send() +} + +// CreateAccessKeyWithContext is the same as CreateAccessKey with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAccessKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateAccessKeyWithContext(ctx aws.Context, input *CreateAccessKeyInput, opts ...request.Option) (*CreateAccessKeyOutput, error) { + req, out := c.CreateAccessKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateAccountAlias = "CreateAccountAlias" + +// CreateAccountAliasRequest generates a "aws/request.Request" representing the +// client's request for the CreateAccountAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAccountAlias for more information on using the CreateAccountAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAccountAliasRequest method. +// req, resp := client.CreateAccountAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias +func (c *IAM) CreateAccountAliasRequest(input *CreateAccountAliasInput) (req *request.Request, output *CreateAccountAliasOutput) { + op := &request.Operation{ + Name: opCreateAccountAlias, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateAccountAliasInput{} + } + + output = &CreateAccountAliasOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateAccountAlias API operation for AWS Identity and Access Management. +// +// Creates an alias for your AWS account. For information about using an AWS +// account alias, see Using an Alias for Your AWS Account ID (http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateAccountAlias for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias +func (c *IAM) CreateAccountAlias(input *CreateAccountAliasInput) (*CreateAccountAliasOutput, error) { + req, out := c.CreateAccountAliasRequest(input) + return out, req.Send() +} + +// CreateAccountAliasWithContext is the same as CreateAccountAlias with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAccountAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateAccountAliasWithContext(ctx aws.Context, input *CreateAccountAliasInput, opts ...request.Option) (*CreateAccountAliasOutput, error) { + req, out := c.CreateAccountAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateGroup = "CreateGroup" + +// CreateGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateGroup for more information on using the CreateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateGroupRequest method. +// req, resp := client.CreateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup +func (c *IAM) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { + op := &request.Operation{ + Name: opCreateGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateGroupInput{} + } + + output = &CreateGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateGroup API operation for AWS Identity and Access Management. +// +// Creates a new group. +// +// For information about the number of groups you can create, see Limitations +// on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup +func (c *IAM) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + return out, req.Send() +} + +// CreateGroupWithContext is the same as CreateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateInstanceProfile = "CreateInstanceProfile" + +// CreateInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the CreateInstanceProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateInstanceProfile for more information on using the CreateInstanceProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateInstanceProfileRequest method. +// req, resp := client.CreateInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile +func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) (req *request.Request, output *CreateInstanceProfileOutput) { + op := &request.Operation{ + Name: opCreateInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateInstanceProfileInput{} + } + + output = &CreateInstanceProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateInstanceProfile API operation for AWS Identity and Access Management. +// +// Creates a new instance profile. For information about instance profiles, +// go to About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). +// +// For information about the number of instance profiles you can create, see +// Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateInstanceProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile +func (c *IAM) CreateInstanceProfile(input *CreateInstanceProfileInput) (*CreateInstanceProfileOutput, error) { + req, out := c.CreateInstanceProfileRequest(input) + return out, req.Send() +} + +// CreateInstanceProfileWithContext is the same as CreateInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateInstanceProfileWithContext(ctx aws.Context, input *CreateInstanceProfileInput, opts ...request.Option) (*CreateInstanceProfileOutput, error) { + req, out := c.CreateInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLoginProfile = "CreateLoginProfile" + +// CreateLoginProfileRequest generates a "aws/request.Request" representing the +// client's request for the CreateLoginProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLoginProfile for more information on using the CreateLoginProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLoginProfileRequest method. +// req, resp := client.CreateLoginProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile +func (c *IAM) CreateLoginProfileRequest(input *CreateLoginProfileInput) (req *request.Request, output *CreateLoginProfileOutput) { + op := &request.Operation{ + Name: opCreateLoginProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLoginProfileInput{} + } + + output = &CreateLoginProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLoginProfile API operation for AWS Identity and Access Management. +// +// Creates a password for the specified user, giving the user the ability to +// access AWS services through the AWS Management Console. For more information +// about managing passwords, see Managing Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateLoginProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" +// The request was rejected because the provided password did not meet the requirements +// imposed by the account password policy. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile +func (c *IAM) CreateLoginProfile(input *CreateLoginProfileInput) (*CreateLoginProfileOutput, error) { + req, out := c.CreateLoginProfileRequest(input) + return out, req.Send() +} + +// CreateLoginProfileWithContext is the same as CreateLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateLoginProfileWithContext(ctx aws.Context, input *CreateLoginProfileInput, opts ...request.Option) (*CreateLoginProfileOutput, error) { + req, out := c.CreateLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateOpenIDConnectProvider = "CreateOpenIDConnectProvider" + +// CreateOpenIDConnectProviderRequest generates a "aws/request.Request" representing the +// client's request for the CreateOpenIDConnectProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateOpenIDConnectProvider for more information on using the CreateOpenIDConnectProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateOpenIDConnectProviderRequest method. +// req, resp := client.CreateOpenIDConnectProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider +func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProviderInput) (req *request.Request, output *CreateOpenIDConnectProviderOutput) { + op := &request.Operation{ + Name: opCreateOpenIDConnectProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateOpenIDConnectProviderInput{} + } + + output = &CreateOpenIDConnectProviderOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateOpenIDConnectProvider API operation for AWS Identity and Access Management. +// +// Creates an IAM entity to describe an identity provider (IdP) that supports +// OpenID Connect (OIDC) (http://openid.net/connect/). +// +// The OIDC provider that you create with this operation can be used as a principal +// in a role's trust policy. Such a policy establishes a trust relationship +// between AWS and the OIDC provider. +// +// When you create the IAM OIDC provider, you specify the following: +// +// * The URL of the OIDC identity provider (IdP) to trust +// +// * A list of client IDs (also known as audiences) that identify the application +// or applications that are allowed to authenticate using the OIDC provider +// +// * A list of thumbprints of the server certificate(s) that the IdP uses. +// +// You get all of this information from the OIDC IdP that you want to use to +// access AWS. +// +// Because trust for the OIDC provider is derived from the IAM provider that +// this operation creates, it is best to limit access to the CreateOpenIDConnectProvider +// operation to highly privileged users. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation CreateOpenIDConnectProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider +func (c *IAM) CreateOpenIDConnectProvider(input *CreateOpenIDConnectProviderInput) (*CreateOpenIDConnectProviderOutput, error) { + req, out := c.CreateOpenIDConnectProviderRequest(input) + return out, req.Send() +} + +// CreateOpenIDConnectProviderWithContext is the same as CreateOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See CreateOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateOpenIDConnectProviderWithContext(ctx aws.Context, input *CreateOpenIDConnectProviderInput, opts ...request.Option) (*CreateOpenIDConnectProviderOutput, error) { + req, out := c.CreateOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreatePolicy = "CreatePolicy" + +// CreatePolicyRequest generates a "aws/request.Request" representing the +// client's request for the CreatePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreatePolicy for more information on using the CreatePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreatePolicyRequest method. +// req, resp := client.CreatePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy +func (c *IAM) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) { + op := &request.Operation{ + Name: opCreatePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreatePolicyInput{} + } + + output = &CreatePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreatePolicy API operation for AWS Identity and Access Management. +// +// Creates a new managed policy for your AWS account. +// +// This operation creates a policy version with a version identifier of v1 and +// sets v1 as the policy's default version. For more information about policy +// versions, see Versioning for Managed Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) +// in the IAM User Guide. +// +// For more information about managed policies in general, see Managed Policies +// and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreatePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy +func (c *IAM) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { + req, out := c.CreatePolicyRequest(input) + return out, req.Send() +} + +// CreatePolicyWithContext is the same as CreatePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreatePolicyWithContext(ctx aws.Context, input *CreatePolicyInput, opts ...request.Option) (*CreatePolicyOutput, error) { + req, out := c.CreatePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreatePolicyVersion = "CreatePolicyVersion" + +// CreatePolicyVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreatePolicyVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreatePolicyVersion for more information on using the CreatePolicyVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreatePolicyVersionRequest method. +// req, resp := client.CreatePolicyVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion +func (c *IAM) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req *request.Request, output *CreatePolicyVersionOutput) { + op := &request.Operation{ + Name: opCreatePolicyVersion, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreatePolicyVersionInput{} + } + + output = &CreatePolicyVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreatePolicyVersion API operation for AWS Identity and Access Management. +// +// Creates a new version of the specified managed policy. To update a managed +// policy, you create a new policy version. A managed policy can have up to +// five versions. If the policy has five versions, you must delete an existing +// version using DeletePolicyVersion before you create a new version. +// +// Optionally, you can set the new version as the policy's default version. +// The default version is the version that is in effect for the IAM users, groups, +// and roles to which the policy is attached. +// +// For more information about managed policy versions, see Versioning for Managed +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreatePolicyVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion +func (c *IAM) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error) { + req, out := c.CreatePolicyVersionRequest(input) + return out, req.Send() +} + +// CreatePolicyVersionWithContext is the same as CreatePolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreatePolicyVersionWithContext(ctx aws.Context, input *CreatePolicyVersionInput, opts ...request.Option) (*CreatePolicyVersionOutput, error) { + req, out := c.CreatePolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateRole = "CreateRole" + +// CreateRoleRequest generates a "aws/request.Request" representing the +// client's request for the CreateRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateRole for more information on using the CreateRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateRoleRequest method. +// req, resp := client.CreateRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole +func (c *IAM) CreateRoleRequest(input *CreateRoleInput) (req *request.Request, output *CreateRoleOutput) { + op := &request.Operation{ + Name: opCreateRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateRoleInput{} + } + + output = &CreateRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateRole API operation for AWS Identity and Access Management. +// +// Creates a new role for your AWS account. For more information about roles, +// go to IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). +// For information about limitations on role names and the number of roles you +// can create, go to Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole +func (c *IAM) CreateRole(input *CreateRoleInput) (*CreateRoleOutput, error) { + req, out := c.CreateRoleRequest(input) + return out, req.Send() +} + +// CreateRoleWithContext is the same as CreateRole with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateRoleWithContext(ctx aws.Context, input *CreateRoleInput, opts ...request.Option) (*CreateRoleOutput, error) { + req, out := c.CreateRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateSAMLProvider = "CreateSAMLProvider" + +// CreateSAMLProviderRequest generates a "aws/request.Request" representing the +// client's request for the CreateSAMLProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateSAMLProvider for more information on using the CreateSAMLProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateSAMLProviderRequest method. +// req, resp := client.CreateSAMLProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider +func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) (req *request.Request, output *CreateSAMLProviderOutput) { + op := &request.Operation{ + Name: opCreateSAMLProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateSAMLProviderInput{} + } + + output = &CreateSAMLProviderOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateSAMLProvider API operation for AWS Identity and Access Management. +// +// Creates an IAM resource that describes an identity provider (IdP) that supports +// SAML 2.0. +// +// The SAML provider resource that you create with this operation can be used +// as a principal in an IAM role's trust policy. Such a policy can enable federated +// users who sign-in using the SAML IdP to assume the role. You can create an +// IAM role that supports Web-based single sign-on (SSO) to the AWS Management +// Console or one that supports API access to AWS. +// +// When you create the SAML provider resource, you upload a SAML metadata document +// that you get from your IdP. That document includes the issuer's name, expiration +// information, and keys that can be used to validate the SAML authentication +// response (assertions) that the IdP sends. You must generate the metadata +// document using the identity management software that is used as your organization's +// IdP. +// +// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). +// +// For more information, see Enabling SAML 2.0 Federated Users to Access the +// AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html) +// and About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateSAMLProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider +func (c *IAM) CreateSAMLProvider(input *CreateSAMLProviderInput) (*CreateSAMLProviderOutput, error) { + req, out := c.CreateSAMLProviderRequest(input) + return out, req.Send() +} + +// CreateSAMLProviderWithContext is the same as CreateSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateSAMLProviderWithContext(ctx aws.Context, input *CreateSAMLProviderInput, opts ...request.Option) (*CreateSAMLProviderOutput, error) { + req, out := c.CreateSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateServiceLinkedRole = "CreateServiceLinkedRole" + +// CreateServiceLinkedRoleRequest generates a "aws/request.Request" representing the +// client's request for the CreateServiceLinkedRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateServiceLinkedRole for more information on using the CreateServiceLinkedRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateServiceLinkedRoleRequest method. +// req, resp := client.CreateServiceLinkedRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceLinkedRole +func (c *IAM) CreateServiceLinkedRoleRequest(input *CreateServiceLinkedRoleInput) (req *request.Request, output *CreateServiceLinkedRoleOutput) { + op := &request.Operation{ + Name: opCreateServiceLinkedRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateServiceLinkedRoleInput{} + } + + output = &CreateServiceLinkedRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateServiceLinkedRole API operation for AWS Identity and Access Management. +// +// Creates an IAM role that is linked to a specific AWS service. The service +// controls the attached policies and when the role can be deleted. This helps +// ensure that the service is not broken by an unexpectedly changed or deleted +// role, which could put your AWS resources into an unknown state. Allowing +// the service to control the role helps improve service stability and proper +// cleanup when a service and its role are no longer needed. +// +// The name of the role is generated by combining the string that you specify +// for the AWSServiceName parameter with the string that you specify for the +// CustomSuffix parameter. The resulting name must be unique in your account +// or the request fails. +// +// To attach a policy to this service-linked role, you must make the request +// using the AWS service that depends on this role. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation CreateServiceLinkedRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceLinkedRole +func (c *IAM) CreateServiceLinkedRole(input *CreateServiceLinkedRoleInput) (*CreateServiceLinkedRoleOutput, error) { + req, out := c.CreateServiceLinkedRoleRequest(input) + return out, req.Send() +} + +// CreateServiceLinkedRoleWithContext is the same as CreateServiceLinkedRole with the addition of +// the ability to pass a context and additional request options. +// +// See CreateServiceLinkedRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateServiceLinkedRoleWithContext(ctx aws.Context, input *CreateServiceLinkedRoleInput, opts ...request.Option) (*CreateServiceLinkedRoleOutput, error) { + req, out := c.CreateServiceLinkedRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateServiceSpecificCredential = "CreateServiceSpecificCredential" + +// CreateServiceSpecificCredentialRequest generates a "aws/request.Request" representing the +// client's request for the CreateServiceSpecificCredential operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateServiceSpecificCredential for more information on using the CreateServiceSpecificCredential +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateServiceSpecificCredentialRequest method. +// req, resp := client.CreateServiceSpecificCredentialRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential +func (c *IAM) CreateServiceSpecificCredentialRequest(input *CreateServiceSpecificCredentialInput) (req *request.Request, output *CreateServiceSpecificCredentialOutput) { + op := &request.Operation{ + Name: opCreateServiceSpecificCredential, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateServiceSpecificCredentialInput{} + } + + output = &CreateServiceSpecificCredentialOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateServiceSpecificCredential API operation for AWS Identity and Access Management. +// +// Generates a set of credentials consisting of a user name and password that +// can be used to access the service specified in the request. These credentials +// are generated by IAM, and can be used only for the specified service. +// +// You can have a maximum of two sets of service-specific credentials for each +// supported service per user. +// +// The only supported service at this time is AWS CodeCommit. +// +// You can reset the password to a new service-generated value by calling ResetServiceSpecificCredential. +// +// For more information about service-specific credentials, see Using IAM with +// AWS CodeCommit: Git Credentials, SSH Keys, and AWS Access Keys (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateServiceSpecificCredential for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceNotSupportedException "NotSupportedService" +// The specified service does not support service-specific credentials. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential +func (c *IAM) CreateServiceSpecificCredential(input *CreateServiceSpecificCredentialInput) (*CreateServiceSpecificCredentialOutput, error) { + req, out := c.CreateServiceSpecificCredentialRequest(input) + return out, req.Send() +} + +// CreateServiceSpecificCredentialWithContext is the same as CreateServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See CreateServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateServiceSpecificCredentialWithContext(ctx aws.Context, input *CreateServiceSpecificCredentialInput, opts ...request.Option) (*CreateServiceSpecificCredentialOutput, error) { + req, out := c.CreateServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateUser = "CreateUser" + +// CreateUserRequest generates a "aws/request.Request" representing the +// client's request for the CreateUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateUser for more information on using the CreateUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateUserRequest method. +// req, resp := client.CreateUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser +func (c *IAM) CreateUserRequest(input *CreateUserInput) (req *request.Request, output *CreateUserOutput) { + op := &request.Operation{ + Name: opCreateUser, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateUserInput{} + } + + output = &CreateUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateUser API operation for AWS Identity and Access Management. +// +// Creates a new IAM user for your AWS account. +// +// For information about limitations on the number of IAM users you can create, +// see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation CreateUser for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser +func (c *IAM) CreateUser(input *CreateUserInput) (*CreateUserOutput, error) { + req, out := c.CreateUserRequest(input) + return out, req.Send() +} + +// CreateUserWithContext is the same as CreateUser with the addition of +// the ability to pass a context and additional request options. +// +// See CreateUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateUserWithContext(ctx aws.Context, input *CreateUserInput, opts ...request.Option) (*CreateUserOutput, error) { + req, out := c.CreateUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateVirtualMFADevice = "CreateVirtualMFADevice" + +// CreateVirtualMFADeviceRequest generates a "aws/request.Request" representing the +// client's request for the CreateVirtualMFADevice operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateVirtualMFADevice for more information on using the CreateVirtualMFADevice +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateVirtualMFADeviceRequest method. +// req, resp := client.CreateVirtualMFADeviceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice +func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) (req *request.Request, output *CreateVirtualMFADeviceOutput) { + op := &request.Operation{ + Name: opCreateVirtualMFADevice, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVirtualMFADeviceInput{} + } + + output = &CreateVirtualMFADeviceOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateVirtualMFADevice API operation for AWS Identity and Access Management. +// +// Creates a new virtual MFA device for the AWS account. After creating the +// virtual MFA, use EnableMFADevice to attach the MFA device to an IAM user. +// For more information about creating and working with virtual MFA devices, +// go to Using a Virtual MFA Device (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) +// in the IAM User Guide. +// +// For information about limits on the number of MFA devices you can create, +// see Limitations on Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM User Guide. +// +// The seed information contained in the QR code and the Base32 string should +// be treated like any other secret access information, such as your AWS access +// keys or your passwords. After you provision your virtual device, you should +// ensure that the information is destroyed following secure procedures. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation CreateVirtualMFADevice for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice +func (c *IAM) CreateVirtualMFADevice(input *CreateVirtualMFADeviceInput) (*CreateVirtualMFADeviceOutput, error) { + req, out := c.CreateVirtualMFADeviceRequest(input) + return out, req.Send() +} + +// CreateVirtualMFADeviceWithContext is the same as CreateVirtualMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVirtualMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateVirtualMFADeviceWithContext(ctx aws.Context, input *CreateVirtualMFADeviceInput, opts ...request.Option) (*CreateVirtualMFADeviceOutput, error) { + req, out := c.CreateVirtualMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeactivateMFADevice = "DeactivateMFADevice" + +// DeactivateMFADeviceRequest generates a "aws/request.Request" representing the +// client's request for the DeactivateMFADevice operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeactivateMFADevice for more information on using the DeactivateMFADevice +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeactivateMFADeviceRequest method. +// req, resp := client.DeactivateMFADeviceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice +func (c *IAM) DeactivateMFADeviceRequest(input *DeactivateMFADeviceInput) (req *request.Request, output *DeactivateMFADeviceOutput) { + op := &request.Operation{ + Name: opDeactivateMFADevice, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeactivateMFADeviceInput{} + } + + output = &DeactivateMFADeviceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeactivateMFADevice API operation for AWS Identity and Access Management. +// +// Deactivates the specified MFA device and removes it from association with +// the user name for which it was originally enabled. +// +// For more information about creating and working with virtual MFA devices, +// go to Using a Virtual MFA Device (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeactivateMFADevice for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" +// The request was rejected because it referenced an entity that is temporarily +// unmodifiable, such as a user name that was deleted and then recreated. The +// error indicates that the request is likely to succeed if you try again after +// waiting several minutes. The error message describes the entity. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice +func (c *IAM) DeactivateMFADevice(input *DeactivateMFADeviceInput) (*DeactivateMFADeviceOutput, error) { + req, out := c.DeactivateMFADeviceRequest(input) + return out, req.Send() +} + +// DeactivateMFADeviceWithContext is the same as DeactivateMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See DeactivateMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeactivateMFADeviceWithContext(ctx aws.Context, input *DeactivateMFADeviceInput, opts ...request.Option) (*DeactivateMFADeviceOutput, error) { + req, out := c.DeactivateMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAccessKey = "DeleteAccessKey" + +// DeleteAccessKeyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccessKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccessKey for more information on using the DeleteAccessKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccessKeyRequest method. +// req, resp := client.DeleteAccessKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey +func (c *IAM) DeleteAccessKeyRequest(input *DeleteAccessKeyInput) (req *request.Request, output *DeleteAccessKeyOutput) { + op := &request.Operation{ + Name: opDeleteAccessKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteAccessKeyInput{} + } + + output = &DeleteAccessKeyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAccessKey API operation for AWS Identity and Access Management. +// +// Deletes the access key pair associated with the specified IAM user. +// +// If you do not specify a user name, IAM determines the user name implicitly +// based on the AWS access key ID signing the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials even if the AWS account has no associated +// users. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteAccessKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey +func (c *IAM) DeleteAccessKey(input *DeleteAccessKeyInput) (*DeleteAccessKeyOutput, error) { + req, out := c.DeleteAccessKeyRequest(input) + return out, req.Send() +} + +// DeleteAccessKeyWithContext is the same as DeleteAccessKey with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccessKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteAccessKeyWithContext(ctx aws.Context, input *DeleteAccessKeyInput, opts ...request.Option) (*DeleteAccessKeyOutput, error) { + req, out := c.DeleteAccessKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAccountAlias = "DeleteAccountAlias" + +// DeleteAccountAliasRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccountAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccountAlias for more information on using the DeleteAccountAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccountAliasRequest method. +// req, resp := client.DeleteAccountAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias +func (c *IAM) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) (req *request.Request, output *DeleteAccountAliasOutput) { + op := &request.Operation{ + Name: opDeleteAccountAlias, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteAccountAliasInput{} + } + + output = &DeleteAccountAliasOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAccountAlias API operation for AWS Identity and Access Management. +// +// Deletes the specified AWS account alias. For information about using an AWS +// account alias, see Using an Alias for Your AWS Account ID (http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeleteAccountAlias for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias +func (c *IAM) DeleteAccountAlias(input *DeleteAccountAliasInput) (*DeleteAccountAliasOutput, error) { + req, out := c.DeleteAccountAliasRequest(input) + return out, req.Send() +} + +// DeleteAccountAliasWithContext is the same as DeleteAccountAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccountAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteAccountAliasWithContext(ctx aws.Context, input *DeleteAccountAliasInput, opts ...request.Option) (*DeleteAccountAliasOutput, error) { + req, out := c.DeleteAccountAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAccountPasswordPolicy = "DeleteAccountPasswordPolicy" + +// DeleteAccountPasswordPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccountPasswordPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccountPasswordPolicy for more information on using the DeleteAccountPasswordPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccountPasswordPolicyRequest method. +// req, resp := client.DeleteAccountPasswordPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy +func (c *IAM) DeleteAccountPasswordPolicyRequest(input *DeleteAccountPasswordPolicyInput) (req *request.Request, output *DeleteAccountPasswordPolicyOutput) { + op := &request.Operation{ + Name: opDeleteAccountPasswordPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteAccountPasswordPolicyInput{} + } + + output = &DeleteAccountPasswordPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAccountPasswordPolicy API operation for AWS Identity and Access Management. +// +// Deletes the password policy for the AWS account. There are no parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteAccountPasswordPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy +func (c *IAM) DeleteAccountPasswordPolicy(input *DeleteAccountPasswordPolicyInput) (*DeleteAccountPasswordPolicyOutput, error) { + req, out := c.DeleteAccountPasswordPolicyRequest(input) + return out, req.Send() +} + +// DeleteAccountPasswordPolicyWithContext is the same as DeleteAccountPasswordPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccountPasswordPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteAccountPasswordPolicyWithContext(ctx aws.Context, input *DeleteAccountPasswordPolicyInput, opts ...request.Option) (*DeleteAccountPasswordPolicyOutput, error) { + req, out := c.DeleteAccountPasswordPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteGroup = "DeleteGroup" + +// DeleteGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteGroup for more information on using the DeleteGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteGroupRequest method. +// req, resp := client.DeleteGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup +func (c *IAM) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { + op := &request.Operation{ + Name: opDeleteGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteGroupInput{} + } + + output = &DeleteGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteGroup API operation for AWS Identity and Access Management. +// +// Deletes the specified IAM group. The group must not contain any users or +// have any attached policies. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup +func (c *IAM) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + return out, req.Send() +} + +// DeleteGroupWithContext is the same as DeleteGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteGroupPolicy = "DeleteGroupPolicy" + +// DeleteGroupPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroupPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteGroupPolicy for more information on using the DeleteGroupPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteGroupPolicyRequest method. +// req, resp := client.DeleteGroupPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy +func (c *IAM) DeleteGroupPolicyRequest(input *DeleteGroupPolicyInput) (req *request.Request, output *DeleteGroupPolicyOutput) { + op := &request.Operation{ + Name: opDeleteGroupPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteGroupPolicyInput{} + } + + output = &DeleteGroupPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteGroupPolicy API operation for AWS Identity and Access Management. +// +// Deletes the specified inline policy that is embedded in the specified IAM +// group. +// +// A group can also have managed policies attached to it. To detach a managed +// policy from a group, use DetachGroupPolicy. For more information about policies, +// refer to Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeleteGroupPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy +func (c *IAM) DeleteGroupPolicy(input *DeleteGroupPolicyInput) (*DeleteGroupPolicyOutput, error) { + req, out := c.DeleteGroupPolicyRequest(input) + return out, req.Send() +} + +// DeleteGroupPolicyWithContext is the same as DeleteGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteGroupPolicyWithContext(ctx aws.Context, input *DeleteGroupPolicyInput, opts ...request.Option) (*DeleteGroupPolicyOutput, error) { + req, out := c.DeleteGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteInstanceProfile = "DeleteInstanceProfile" + +// DeleteInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the DeleteInstanceProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteInstanceProfile for more information on using the DeleteInstanceProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteInstanceProfileRequest method. +// req, resp := client.DeleteInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile +func (c *IAM) DeleteInstanceProfileRequest(input *DeleteInstanceProfileInput) (req *request.Request, output *DeleteInstanceProfileOutput) { + op := &request.Operation{ + Name: opDeleteInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteInstanceProfileInput{} + } + + output = &DeleteInstanceProfileOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteInstanceProfile API operation for AWS Identity and Access Management. +// +// Deletes the specified instance profile. The instance profile must not have +// an associated role. +// +// Make sure that you do not have any Amazon EC2 instances running with the +// instance profile you are about to delete. Deleting a role or instance profile +// that is associated with a running instance will break any applications running +// on the instance. +// +// For more information about instance profiles, go to About Instance Profiles +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.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 AWS Identity and Access Management's +// API operation DeleteInstanceProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile +func (c *IAM) DeleteInstanceProfile(input *DeleteInstanceProfileInput) (*DeleteInstanceProfileOutput, error) { + req, out := c.DeleteInstanceProfileRequest(input) + return out, req.Send() +} + +// DeleteInstanceProfileWithContext is the same as DeleteInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteInstanceProfileWithContext(ctx aws.Context, input *DeleteInstanceProfileInput, opts ...request.Option) (*DeleteInstanceProfileOutput, error) { + req, out := c.DeleteInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLoginProfile = "DeleteLoginProfile" + +// DeleteLoginProfileRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLoginProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLoginProfile for more information on using the DeleteLoginProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLoginProfileRequest method. +// req, resp := client.DeleteLoginProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile +func (c *IAM) DeleteLoginProfileRequest(input *DeleteLoginProfileInput) (req *request.Request, output *DeleteLoginProfileOutput) { + op := &request.Operation{ + Name: opDeleteLoginProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLoginProfileInput{} + } + + output = &DeleteLoginProfileOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteLoginProfile API operation for AWS Identity and Access Management. +// +// Deletes the password for the specified IAM user, which terminates the user's +// ability to access AWS services through the AWS Management Console. +// +// Deleting a user's password does not prevent a user from accessing AWS through +// the command line interface or the API. To prevent all user access you must +// also either make any access keys inactive or delete them. For more information +// about making keys inactive or deleting them, see UpdateAccessKey and DeleteAccessKey. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteLoginProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" +// The request was rejected because it referenced an entity that is temporarily +// unmodifiable, such as a user name that was deleted and then recreated. The +// error indicates that the request is likely to succeed if you try again after +// waiting several minutes. The error message describes the entity. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile +func (c *IAM) DeleteLoginProfile(input *DeleteLoginProfileInput) (*DeleteLoginProfileOutput, error) { + req, out := c.DeleteLoginProfileRequest(input) + return out, req.Send() +} + +// DeleteLoginProfileWithContext is the same as DeleteLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteLoginProfileWithContext(ctx aws.Context, input *DeleteLoginProfileInput, opts ...request.Option) (*DeleteLoginProfileOutput, error) { + req, out := c.DeleteLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteOpenIDConnectProvider = "DeleteOpenIDConnectProvider" + +// DeleteOpenIDConnectProviderRequest generates a "aws/request.Request" representing the +// client's request for the DeleteOpenIDConnectProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteOpenIDConnectProvider for more information on using the DeleteOpenIDConnectProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteOpenIDConnectProviderRequest method. +// req, resp := client.DeleteOpenIDConnectProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider +func (c *IAM) DeleteOpenIDConnectProviderRequest(input *DeleteOpenIDConnectProviderInput) (req *request.Request, output *DeleteOpenIDConnectProviderOutput) { + op := &request.Operation{ + Name: opDeleteOpenIDConnectProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteOpenIDConnectProviderInput{} + } + + output = &DeleteOpenIDConnectProviderOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteOpenIDConnectProvider API operation for AWS Identity and Access Management. +// +// Deletes an OpenID Connect identity provider (IdP) resource object in IAM. +// +// Deleting an IAM OIDC provider resource does not update any roles that reference +// the provider as a principal in their trust policies. Any attempt to assume +// a role that references a deleted provider fails. +// +// This operation is idempotent; it does not fail or return an error if you +// call the operation for a provider that does not exist. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteOpenIDConnectProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider +func (c *IAM) DeleteOpenIDConnectProvider(input *DeleteOpenIDConnectProviderInput) (*DeleteOpenIDConnectProviderOutput, error) { + req, out := c.DeleteOpenIDConnectProviderRequest(input) + return out, req.Send() +} + +// DeleteOpenIDConnectProviderWithContext is the same as DeleteOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteOpenIDConnectProviderWithContext(ctx aws.Context, input *DeleteOpenIDConnectProviderInput, opts ...request.Option) (*DeleteOpenIDConnectProviderOutput, error) { + req, out := c.DeleteOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeletePolicy = "DeletePolicy" + +// DeletePolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeletePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeletePolicy for more information on using the DeletePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeletePolicyRequest method. +// req, resp := client.DeletePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy +func (c *IAM) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { + op := &request.Operation{ + Name: opDeletePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeletePolicyInput{} + } + + output = &DeletePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeletePolicy API operation for AWS Identity and Access Management. +// +// Deletes the specified managed policy. +// +// Before you can delete a managed policy, you must first detach the policy +// from all users, groups, and roles that it is attached to. In addition you +// must delete all the policy's versions. The following steps describe the process +// for deleting a managed policy: +// +// * Detach the policy from all users, groups, and roles that the policy +// is attached to, using the DetachUserPolicy, DetachGroupPolicy, or DetachRolePolicy +// API operations. To list all the users, groups, and roles that a policy +// is attached to, use ListEntitiesForPolicy. +// +// * Delete all versions of the policy using DeletePolicyVersion. To list +// the policy's versions, use ListPolicyVersions. You cannot use DeletePolicyVersion +// to delete the version that is marked as the default version. You delete +// the policy's default version in the next step of the process. +// +// * Delete the policy (this automatically deletes the policy's default version) +// using this API. +// +// For information about managed policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeletePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy +func (c *IAM) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + return out, req.Send() +} + +// DeletePolicyWithContext is the same as DeletePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeletePolicyVersion = "DeletePolicyVersion" + +// DeletePolicyVersionRequest generates a "aws/request.Request" representing the +// client's request for the DeletePolicyVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeletePolicyVersion for more information on using the DeletePolicyVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeletePolicyVersionRequest method. +// req, resp := client.DeletePolicyVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion +func (c *IAM) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req *request.Request, output *DeletePolicyVersionOutput) { + op := &request.Operation{ + Name: opDeletePolicyVersion, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeletePolicyVersionInput{} + } + + output = &DeletePolicyVersionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeletePolicyVersion API operation for AWS Identity and Access Management. +// +// Deletes the specified version from the specified managed policy. +// +// You cannot delete the default version from a policy using this API. To delete +// the default version from a policy, use DeletePolicy. To find out which version +// of a policy is marked as the default version, use ListPolicyVersions. +// +// For information about versions for managed policies, see Versioning for Managed +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeletePolicyVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion +func (c *IAM) DeletePolicyVersion(input *DeletePolicyVersionInput) (*DeletePolicyVersionOutput, error) { + req, out := c.DeletePolicyVersionRequest(input) + return out, req.Send() +} + +// DeletePolicyVersionWithContext is the same as DeletePolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeletePolicyVersionWithContext(ctx aws.Context, input *DeletePolicyVersionInput, opts ...request.Option) (*DeletePolicyVersionOutput, error) { + req, out := c.DeletePolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRole = "DeleteRole" + +// DeleteRoleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRole for more information on using the DeleteRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRoleRequest method. +// req, resp := client.DeleteRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole +func (c *IAM) DeleteRoleRequest(input *DeleteRoleInput) (req *request.Request, output *DeleteRoleOutput) { + op := &request.Operation{ + Name: opDeleteRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRoleInput{} + } + + output = &DeleteRoleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRole API operation for AWS Identity and Access Management. +// +// Deletes the specified role. The role must not have any policies attached. +// For more information about roles, go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). +// +// Make sure that you do not have any Amazon EC2 instances running with the +// role you are about to delete. Deleting a role or instance profile that is +// associated with a running instance will break any applications running on +// 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 AWS Identity and Access Management's +// API operation DeleteRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole +func (c *IAM) DeleteRole(input *DeleteRoleInput) (*DeleteRoleOutput, error) { + req, out := c.DeleteRoleRequest(input) + return out, req.Send() +} + +// DeleteRoleWithContext is the same as DeleteRole with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteRoleWithContext(ctx aws.Context, input *DeleteRoleInput, opts ...request.Option) (*DeleteRoleOutput, error) { + req, out := c.DeleteRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRolePermissionsBoundary = "DeleteRolePermissionsBoundary" + +// DeleteRolePermissionsBoundaryRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRolePermissionsBoundary operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRolePermissionsBoundary for more information on using the DeleteRolePermissionsBoundary +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRolePermissionsBoundaryRequest method. +// req, resp := client.DeleteRolePermissionsBoundaryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePermissionsBoundary +func (c *IAM) DeleteRolePermissionsBoundaryRequest(input *DeleteRolePermissionsBoundaryInput) (req *request.Request, output *DeleteRolePermissionsBoundaryOutput) { + op := &request.Operation{ + Name: opDeleteRolePermissionsBoundary, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRolePermissionsBoundaryInput{} + } + + output = &DeleteRolePermissionsBoundaryOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRolePermissionsBoundary API operation for AWS Identity and Access Management. +// +// Deletes the permissions boundary for the specified IAM role. +// +// Deleting the permissions boundary for a role might increase its permissions +// by allowing anyone who assumes the role to perform all the actions granted +// in its permissions policies. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteRolePermissionsBoundary for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePermissionsBoundary +func (c *IAM) DeleteRolePermissionsBoundary(input *DeleteRolePermissionsBoundaryInput) (*DeleteRolePermissionsBoundaryOutput, error) { + req, out := c.DeleteRolePermissionsBoundaryRequest(input) + return out, req.Send() +} + +// DeleteRolePermissionsBoundaryWithContext is the same as DeleteRolePermissionsBoundary with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRolePermissionsBoundary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteRolePermissionsBoundaryWithContext(ctx aws.Context, input *DeleteRolePermissionsBoundaryInput, opts ...request.Option) (*DeleteRolePermissionsBoundaryOutput, error) { + req, out := c.DeleteRolePermissionsBoundaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRolePolicy = "DeleteRolePolicy" + +// DeleteRolePolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRolePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRolePolicy for more information on using the DeleteRolePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRolePolicyRequest method. +// req, resp := client.DeleteRolePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy +func (c *IAM) DeleteRolePolicyRequest(input *DeleteRolePolicyInput) (req *request.Request, output *DeleteRolePolicyOutput) { + op := &request.Operation{ + Name: opDeleteRolePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRolePolicyInput{} + } + + output = &DeleteRolePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRolePolicy API operation for AWS Identity and Access Management. +// +// Deletes the specified inline policy that is embedded in the specified IAM +// role. +// +// A role can also have managed policies attached to it. To detach a managed +// policy from a role, use DetachRolePolicy. For more information about policies, +// refer to Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeleteRolePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy +func (c *IAM) DeleteRolePolicy(input *DeleteRolePolicyInput) (*DeleteRolePolicyOutput, error) { + req, out := c.DeleteRolePolicyRequest(input) + return out, req.Send() +} + +// DeleteRolePolicyWithContext is the same as DeleteRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteRolePolicyWithContext(ctx aws.Context, input *DeleteRolePolicyInput, opts ...request.Option) (*DeleteRolePolicyOutput, error) { + req, out := c.DeleteRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteSAMLProvider = "DeleteSAMLProvider" + +// DeleteSAMLProviderRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSAMLProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteSAMLProvider for more information on using the DeleteSAMLProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteSAMLProviderRequest method. +// req, resp := client.DeleteSAMLProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider +func (c *IAM) DeleteSAMLProviderRequest(input *DeleteSAMLProviderInput) (req *request.Request, output *DeleteSAMLProviderOutput) { + op := &request.Operation{ + Name: opDeleteSAMLProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteSAMLProviderInput{} + } + + output = &DeleteSAMLProviderOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteSAMLProvider API operation for AWS Identity and Access Management. +// +// Deletes a SAML provider resource in IAM. +// +// Deleting the provider resource from IAM does not update any roles that reference +// the SAML provider resource's ARN as a principal in their trust policies. +// Any attempt to assume a role that references a non-existent provider resource +// ARN fails. +// +// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's +// API operation DeleteSAMLProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider +func (c *IAM) DeleteSAMLProvider(input *DeleteSAMLProviderInput) (*DeleteSAMLProviderOutput, error) { + req, out := c.DeleteSAMLProviderRequest(input) + return out, req.Send() +} + +// DeleteSAMLProviderWithContext is the same as DeleteSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteSAMLProviderWithContext(ctx aws.Context, input *DeleteSAMLProviderInput, opts ...request.Option) (*DeleteSAMLProviderOutput, error) { + req, out := c.DeleteSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteSSHPublicKey = "DeleteSSHPublicKey" + +// DeleteSSHPublicKeyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSSHPublicKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteSSHPublicKey for more information on using the DeleteSSHPublicKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteSSHPublicKeyRequest method. +// req, resp := client.DeleteSSHPublicKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey +func (c *IAM) DeleteSSHPublicKeyRequest(input *DeleteSSHPublicKeyInput) (req *request.Request, output *DeleteSSHPublicKeyOutput) { + op := &request.Operation{ + Name: opDeleteSSHPublicKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteSSHPublicKeyInput{} + } + + output = &DeleteSSHPublicKeyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteSSHPublicKey API operation for AWS Identity and Access Management. +// +// Deletes the specified SSH public key. +// +// The SSH public key deleted by this operation is used only for authenticating +// the associated IAM user to an AWS CodeCommit repository. For more information +// about using SSH keys to authenticate to an AWS CodeCommit repository, see +// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) +// in the AWS CodeCommit 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 AWS Identity and Access Management's +// API operation DeleteSSHPublicKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey +func (c *IAM) DeleteSSHPublicKey(input *DeleteSSHPublicKeyInput) (*DeleteSSHPublicKeyOutput, error) { + req, out := c.DeleteSSHPublicKeyRequest(input) + return out, req.Send() +} + +// DeleteSSHPublicKeyWithContext is the same as DeleteSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteSSHPublicKeyWithContext(ctx aws.Context, input *DeleteSSHPublicKeyInput, opts ...request.Option) (*DeleteSSHPublicKeyOutput, error) { + req, out := c.DeleteSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteServerCertificate = "DeleteServerCertificate" + +// DeleteServerCertificateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteServerCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteServerCertificate for more information on using the DeleteServerCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteServerCertificateRequest method. +// req, resp := client.DeleteServerCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate +func (c *IAM) DeleteServerCertificateRequest(input *DeleteServerCertificateInput) (req *request.Request, output *DeleteServerCertificateOutput) { + op := &request.Operation{ + Name: opDeleteServerCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteServerCertificateInput{} + } + + output = &DeleteServerCertificateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteServerCertificate API operation for AWS Identity and Access Management. +// +// Deletes the specified server certificate. +// +// For more information about working with server certificates, see Working +// with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) +// in the IAM User Guide. This topic also includes a list of AWS services that +// can use the server certificates that you manage with IAM. +// +// If you are using a server certificate with Elastic Load Balancing, deleting +// the certificate could have implications for your application. If Elastic +// Load Balancing doesn't detect the deletion of bound certificates, it may +// continue to use the certificates. This could cause Elastic Load Balancing +// to stop accepting traffic. We recommend that you remove the reference to +// the certificate from Elastic Load Balancing before using this command to +// delete the certificate. For more information, go to DeleteLoadBalancerListeners +// (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_DeleteLoadBalancerListeners.html) +// in the Elastic Load Balancing API Reference. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteServerCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate +func (c *IAM) DeleteServerCertificate(input *DeleteServerCertificateInput) (*DeleteServerCertificateOutput, error) { + req, out := c.DeleteServerCertificateRequest(input) + return out, req.Send() +} + +// DeleteServerCertificateWithContext is the same as DeleteServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteServerCertificateWithContext(ctx aws.Context, input *DeleteServerCertificateInput, opts ...request.Option) (*DeleteServerCertificateOutput, error) { + req, out := c.DeleteServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteServiceLinkedRole = "DeleteServiceLinkedRole" + +// DeleteServiceLinkedRoleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteServiceLinkedRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteServiceLinkedRole for more information on using the DeleteServiceLinkedRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteServiceLinkedRoleRequest method. +// req, resp := client.DeleteServiceLinkedRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceLinkedRole +func (c *IAM) DeleteServiceLinkedRoleRequest(input *DeleteServiceLinkedRoleInput) (req *request.Request, output *DeleteServiceLinkedRoleOutput) { + op := &request.Operation{ + Name: opDeleteServiceLinkedRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteServiceLinkedRoleInput{} + } + + output = &DeleteServiceLinkedRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteServiceLinkedRole API operation for AWS Identity and Access Management. +// +// Submits a service-linked role deletion request and returns a DeletionTaskId, +// which you can use to check the status of the deletion. Before you call this +// operation, confirm that the role has no active sessions and that any resources +// used by the role in the linked service are deleted. If you call this operation +// more than once for the same service-linked role and an earlier deletion task +// is not complete, then the DeletionTaskId of the earlier request is returned. +// +// If you submit a deletion request for a service-linked role whose linked service +// is still accessing a resource, then the deletion task fails. If it fails, +// the GetServiceLinkedRoleDeletionStatus API operation returns the reason for +// the failure, usually including the resources that must be deleted. To delete +// the service-linked role, you must first remove those resources from the linked +// service and then submit the deletion request again. Resources are specific +// to the service that is linked to the role. For more information about removing +// resources from a service, see the AWS documentation (http://docs.aws.amazon.com/) +// for your service. +// +// For more information about service-linked roles, see Roles Terms and Concepts: +// AWS Service-Linked Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeleteServiceLinkedRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceLinkedRole +func (c *IAM) DeleteServiceLinkedRole(input *DeleteServiceLinkedRoleInput) (*DeleteServiceLinkedRoleOutput, error) { + req, out := c.DeleteServiceLinkedRoleRequest(input) + return out, req.Send() +} + +// DeleteServiceLinkedRoleWithContext is the same as DeleteServiceLinkedRole with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteServiceLinkedRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteServiceLinkedRoleWithContext(ctx aws.Context, input *DeleteServiceLinkedRoleInput, opts ...request.Option) (*DeleteServiceLinkedRoleOutput, error) { + req, out := c.DeleteServiceLinkedRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteServiceSpecificCredential = "DeleteServiceSpecificCredential" + +// DeleteServiceSpecificCredentialRequest generates a "aws/request.Request" representing the +// client's request for the DeleteServiceSpecificCredential operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteServiceSpecificCredential for more information on using the DeleteServiceSpecificCredential +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteServiceSpecificCredentialRequest method. +// req, resp := client.DeleteServiceSpecificCredentialRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential +func (c *IAM) DeleteServiceSpecificCredentialRequest(input *DeleteServiceSpecificCredentialInput) (req *request.Request, output *DeleteServiceSpecificCredentialOutput) { + op := &request.Operation{ + Name: opDeleteServiceSpecificCredential, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteServiceSpecificCredentialInput{} + } + + output = &DeleteServiceSpecificCredentialOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteServiceSpecificCredential API operation for AWS Identity and Access Management. +// +// Deletes the specified service-specific credential. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteServiceSpecificCredential for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential +func (c *IAM) DeleteServiceSpecificCredential(input *DeleteServiceSpecificCredentialInput) (*DeleteServiceSpecificCredentialOutput, error) { + req, out := c.DeleteServiceSpecificCredentialRequest(input) + return out, req.Send() +} + +// DeleteServiceSpecificCredentialWithContext is the same as DeleteServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteServiceSpecificCredentialWithContext(ctx aws.Context, input *DeleteServiceSpecificCredentialInput, opts ...request.Option) (*DeleteServiceSpecificCredentialOutput, error) { + req, out := c.DeleteServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteSigningCertificate = "DeleteSigningCertificate" + +// DeleteSigningCertificateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSigningCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteSigningCertificate for more information on using the DeleteSigningCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteSigningCertificateRequest method. +// req, resp := client.DeleteSigningCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate +func (c *IAM) DeleteSigningCertificateRequest(input *DeleteSigningCertificateInput) (req *request.Request, output *DeleteSigningCertificateOutput) { + op := &request.Operation{ + Name: opDeleteSigningCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteSigningCertificateInput{} + } + + output = &DeleteSigningCertificateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteSigningCertificate API operation for AWS Identity and Access Management. +// +// Deletes a signing certificate associated with the specified IAM user. +// +// If you do not specify a user name, IAM determines the user name implicitly +// based on the AWS access key ID signing the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials even if the AWS account has no associated +// IAM users. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteSigningCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate +func (c *IAM) DeleteSigningCertificate(input *DeleteSigningCertificateInput) (*DeleteSigningCertificateOutput, error) { + req, out := c.DeleteSigningCertificateRequest(input) + return out, req.Send() +} + +// DeleteSigningCertificateWithContext is the same as DeleteSigningCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSigningCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteSigningCertificateWithContext(ctx aws.Context, input *DeleteSigningCertificateInput, opts ...request.Option) (*DeleteSigningCertificateOutput, error) { + req, out := c.DeleteSigningCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteUser = "DeleteUser" + +// DeleteUserRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteUser for more information on using the DeleteUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteUserRequest method. +// req, resp := client.DeleteUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser +func (c *IAM) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, output *DeleteUserOutput) { + op := &request.Operation{ + Name: opDeleteUser, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteUserInput{} + } + + output = &DeleteUserOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteUser API operation for AWS Identity and Access Management. +// +// Deletes the specified IAM user. The user must not belong to any groups or +// have any access keys, signing certificates, or attached policies. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteUser for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser +func (c *IAM) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + return out, req.Send() +} + +// DeleteUserWithContext is the same as DeleteUser with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteUserPermissionsBoundary = "DeleteUserPermissionsBoundary" + +// DeleteUserPermissionsBoundaryRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUserPermissionsBoundary operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteUserPermissionsBoundary for more information on using the DeleteUserPermissionsBoundary +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteUserPermissionsBoundaryRequest method. +// req, resp := client.DeleteUserPermissionsBoundaryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPermissionsBoundary +func (c *IAM) DeleteUserPermissionsBoundaryRequest(input *DeleteUserPermissionsBoundaryInput) (req *request.Request, output *DeleteUserPermissionsBoundaryOutput) { + op := &request.Operation{ + Name: opDeleteUserPermissionsBoundary, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteUserPermissionsBoundaryInput{} + } + + output = &DeleteUserPermissionsBoundaryOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteUserPermissionsBoundary API operation for AWS Identity and Access Management. +// +// Deletes the permissions boundary for the specified IAM user. +// +// Deleting the permissions boundary for a user might increase its permissions +// by allowing the user to perform all the actions granted in its permissions +// policies. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteUserPermissionsBoundary for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPermissionsBoundary +func (c *IAM) DeleteUserPermissionsBoundary(input *DeleteUserPermissionsBoundaryInput) (*DeleteUserPermissionsBoundaryOutput, error) { + req, out := c.DeleteUserPermissionsBoundaryRequest(input) + return out, req.Send() +} + +// DeleteUserPermissionsBoundaryWithContext is the same as DeleteUserPermissionsBoundary with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUserPermissionsBoundary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteUserPermissionsBoundaryWithContext(ctx aws.Context, input *DeleteUserPermissionsBoundaryInput, opts ...request.Option) (*DeleteUserPermissionsBoundaryOutput, error) { + req, out := c.DeleteUserPermissionsBoundaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteUserPolicy = "DeleteUserPolicy" + +// DeleteUserPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUserPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteUserPolicy for more information on using the DeleteUserPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteUserPolicyRequest method. +// req, resp := client.DeleteUserPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy +func (c *IAM) DeleteUserPolicyRequest(input *DeleteUserPolicyInput) (req *request.Request, output *DeleteUserPolicyOutput) { + op := &request.Operation{ + Name: opDeleteUserPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteUserPolicyInput{} + } + + output = &DeleteUserPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteUserPolicy API operation for AWS Identity and Access Management. +// +// Deletes the specified inline policy that is embedded in the specified IAM +// user. +// +// A user can also have managed policies attached to it. To detach a managed +// policy from a user, use DetachUserPolicy. For more information about policies, +// refer to Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DeleteUserPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy +func (c *IAM) DeleteUserPolicy(input *DeleteUserPolicyInput) (*DeleteUserPolicyOutput, error) { + req, out := c.DeleteUserPolicyRequest(input) + return out, req.Send() +} + +// DeleteUserPolicyWithContext is the same as DeleteUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteUserPolicyWithContext(ctx aws.Context, input *DeleteUserPolicyInput, opts ...request.Option) (*DeleteUserPolicyOutput, error) { + req, out := c.DeleteUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteVirtualMFADevice = "DeleteVirtualMFADevice" + +// DeleteVirtualMFADeviceRequest generates a "aws/request.Request" representing the +// client's request for the DeleteVirtualMFADevice operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteVirtualMFADevice for more information on using the DeleteVirtualMFADevice +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteVirtualMFADeviceRequest method. +// req, resp := client.DeleteVirtualMFADeviceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice +func (c *IAM) DeleteVirtualMFADeviceRequest(input *DeleteVirtualMFADeviceInput) (req *request.Request, output *DeleteVirtualMFADeviceOutput) { + op := &request.Operation{ + Name: opDeleteVirtualMFADevice, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVirtualMFADeviceInput{} + } + + output = &DeleteVirtualMFADeviceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteVirtualMFADevice API operation for AWS Identity and Access Management. +// +// Deletes a virtual MFA device. +// +// You must deactivate a user's virtual MFA device before you can delete it. +// For information about deactivating MFA devices, see DeactivateMFADevice. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation DeleteVirtualMFADevice for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeDeleteConflictException "DeleteConflict" +// The request was rejected because it attempted to delete a resource that has +// attached subordinate entities. The error message describes these entities. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice +func (c *IAM) DeleteVirtualMFADevice(input *DeleteVirtualMFADeviceInput) (*DeleteVirtualMFADeviceOutput, error) { + req, out := c.DeleteVirtualMFADeviceRequest(input) + return out, req.Send() +} + +// DeleteVirtualMFADeviceWithContext is the same as DeleteVirtualMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVirtualMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DeleteVirtualMFADeviceWithContext(ctx aws.Context, input *DeleteVirtualMFADeviceInput, opts ...request.Option) (*DeleteVirtualMFADeviceOutput, error) { + req, out := c.DeleteVirtualMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDetachGroupPolicy = "DetachGroupPolicy" + +// DetachGroupPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DetachGroupPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachGroupPolicy for more information on using the DetachGroupPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachGroupPolicyRequest method. +// req, resp := client.DetachGroupPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy +func (c *IAM) DetachGroupPolicyRequest(input *DetachGroupPolicyInput) (req *request.Request, output *DetachGroupPolicyOutput) { + op := &request.Operation{ + Name: opDetachGroupPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachGroupPolicyInput{} + } + + output = &DetachGroupPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DetachGroupPolicy API operation for AWS Identity and Access Management. +// +// Removes the specified managed policy from the specified IAM group. +// +// A group can also have inline policies embedded with it. To delete an inline +// policy, use the DeleteGroupPolicy API. For information about policies, see +// Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DetachGroupPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy +func (c *IAM) DetachGroupPolicy(input *DetachGroupPolicyInput) (*DetachGroupPolicyOutput, error) { + req, out := c.DetachGroupPolicyRequest(input) + return out, req.Send() +} + +// DetachGroupPolicyWithContext is the same as DetachGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DetachGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DetachGroupPolicyWithContext(ctx aws.Context, input *DetachGroupPolicyInput, opts ...request.Option) (*DetachGroupPolicyOutput, error) { + req, out := c.DetachGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDetachRolePolicy = "DetachRolePolicy" + +// DetachRolePolicyRequest generates a "aws/request.Request" representing the +// client's request for the DetachRolePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachRolePolicy for more information on using the DetachRolePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachRolePolicyRequest method. +// req, resp := client.DetachRolePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy +func (c *IAM) DetachRolePolicyRequest(input *DetachRolePolicyInput) (req *request.Request, output *DetachRolePolicyOutput) { + op := &request.Operation{ + Name: opDetachRolePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachRolePolicyInput{} + } + + output = &DetachRolePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DetachRolePolicy API operation for AWS Identity and Access Management. +// +// Removes the specified managed policy from the specified role. +// +// A role can also have inline policies embedded with it. To delete an inline +// policy, use the DeleteRolePolicy API. For information about policies, see +// Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DetachRolePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy +func (c *IAM) DetachRolePolicy(input *DetachRolePolicyInput) (*DetachRolePolicyOutput, error) { + req, out := c.DetachRolePolicyRequest(input) + return out, req.Send() +} + +// DetachRolePolicyWithContext is the same as DetachRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DetachRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DetachRolePolicyWithContext(ctx aws.Context, input *DetachRolePolicyInput, opts ...request.Option) (*DetachRolePolicyOutput, error) { + req, out := c.DetachRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDetachUserPolicy = "DetachUserPolicy" + +// DetachUserPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DetachUserPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetachUserPolicy for more information on using the DetachUserPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetachUserPolicyRequest method. +// req, resp := client.DetachUserPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy +func (c *IAM) DetachUserPolicyRequest(input *DetachUserPolicyInput) (req *request.Request, output *DetachUserPolicyOutput) { + op := &request.Operation{ + Name: opDetachUserPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachUserPolicyInput{} + } + + output = &DetachUserPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DetachUserPolicy API operation for AWS Identity and Access Management. +// +// Removes the specified managed policy from the specified user. +// +// A user can also have inline policies embedded with it. To delete an inline +// policy, use the DeleteUserPolicy API. For information about policies, see +// Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation DetachUserPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy +func (c *IAM) DetachUserPolicy(input *DetachUserPolicyInput) (*DetachUserPolicyOutput, error) { + req, out := c.DetachUserPolicyRequest(input) + return out, req.Send() +} + +// DetachUserPolicyWithContext is the same as DetachUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DetachUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) DetachUserPolicyWithContext(ctx aws.Context, input *DetachUserPolicyInput, opts ...request.Option) (*DetachUserPolicyOutput, error) { + req, out := c.DetachUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opEnableMFADevice = "EnableMFADevice" + +// EnableMFADeviceRequest generates a "aws/request.Request" representing the +// client's request for the EnableMFADevice operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableMFADevice for more information on using the EnableMFADevice +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableMFADeviceRequest method. +// req, resp := client.EnableMFADeviceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice +func (c *IAM) EnableMFADeviceRequest(input *EnableMFADeviceInput) (req *request.Request, output *EnableMFADeviceOutput) { + op := &request.Operation{ + Name: opEnableMFADevice, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableMFADeviceInput{} + } + + output = &EnableMFADeviceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// EnableMFADevice API operation for AWS Identity and Access Management. +// +// Enables the specified MFA device and associates it with the specified IAM +// user. When enabled, the MFA device is required for every subsequent login +// by the IAM user associated with the device. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation EnableMFADevice for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" +// The request was rejected because it referenced an entity that is temporarily +// unmodifiable, such as a user name that was deleted and then recreated. The +// error indicates that the request is likely to succeed if you try again after +// waiting several minutes. The error message describes the entity. +// +// * ErrCodeInvalidAuthenticationCodeException "InvalidAuthenticationCode" +// The request was rejected because the authentication code was not recognized. +// The error message describes the specific error. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice +func (c *IAM) EnableMFADevice(input *EnableMFADeviceInput) (*EnableMFADeviceOutput, error) { + req, out := c.EnableMFADeviceRequest(input) + return out, req.Send() +} + +// EnableMFADeviceWithContext is the same as EnableMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See EnableMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) EnableMFADeviceWithContext(ctx aws.Context, input *EnableMFADeviceInput, opts ...request.Option) (*EnableMFADeviceOutput, error) { + req, out := c.EnableMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGenerateCredentialReport = "GenerateCredentialReport" + +// GenerateCredentialReportRequest generates a "aws/request.Request" representing the +// client's request for the GenerateCredentialReport operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GenerateCredentialReport for more information on using the GenerateCredentialReport +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GenerateCredentialReportRequest method. +// req, resp := client.GenerateCredentialReportRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport +func (c *IAM) GenerateCredentialReportRequest(input *GenerateCredentialReportInput) (req *request.Request, output *GenerateCredentialReportOutput) { + op := &request.Operation{ + Name: opGenerateCredentialReport, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GenerateCredentialReportInput{} + } + + output = &GenerateCredentialReportOutput{} + req = c.newRequest(op, input, output) + return +} + +// GenerateCredentialReport API operation for AWS Identity and Access Management. +// +// Generates a credential report for the AWS account. For more information about +// the credential report, see Getting Credential Reports (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GenerateCredentialReport for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport +func (c *IAM) GenerateCredentialReport(input *GenerateCredentialReportInput) (*GenerateCredentialReportOutput, error) { + req, out := c.GenerateCredentialReportRequest(input) + return out, req.Send() +} + +// GenerateCredentialReportWithContext is the same as GenerateCredentialReport with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateCredentialReport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GenerateCredentialReportWithContext(ctx aws.Context, input *GenerateCredentialReportInput, opts ...request.Option) (*GenerateCredentialReportOutput, error) { + req, out := c.GenerateCredentialReportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAccessKeyLastUsed = "GetAccessKeyLastUsed" + +// GetAccessKeyLastUsedRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessKeyLastUsed operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccessKeyLastUsed for more information on using the GetAccessKeyLastUsed +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccessKeyLastUsedRequest method. +// req, resp := client.GetAccessKeyLastUsedRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed +func (c *IAM) GetAccessKeyLastUsedRequest(input *GetAccessKeyLastUsedInput) (req *request.Request, output *GetAccessKeyLastUsedOutput) { + op := &request.Operation{ + Name: opGetAccessKeyLastUsed, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccessKeyLastUsedInput{} + } + + output = &GetAccessKeyLastUsedOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccessKeyLastUsed API operation for AWS Identity and Access Management. +// +// Retrieves information about when the specified access key was last used. +// The information includes the date and time of last use, along with the AWS +// service and region that were specified in the last request made with that +// key. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetAccessKeyLastUsed for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed +func (c *IAM) GetAccessKeyLastUsed(input *GetAccessKeyLastUsedInput) (*GetAccessKeyLastUsedOutput, error) { + req, out := c.GetAccessKeyLastUsedRequest(input) + return out, req.Send() +} + +// GetAccessKeyLastUsedWithContext is the same as GetAccessKeyLastUsed with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessKeyLastUsed for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetAccessKeyLastUsedWithContext(ctx aws.Context, input *GetAccessKeyLastUsedInput, opts ...request.Option) (*GetAccessKeyLastUsedOutput, error) { + req, out := c.GetAccessKeyLastUsedRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAccountAuthorizationDetails = "GetAccountAuthorizationDetails" + +// GetAccountAuthorizationDetailsRequest generates a "aws/request.Request" representing the +// client's request for the GetAccountAuthorizationDetails operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccountAuthorizationDetails for more information on using the GetAccountAuthorizationDetails +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccountAuthorizationDetailsRequest method. +// req, resp := client.GetAccountAuthorizationDetailsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails +func (c *IAM) GetAccountAuthorizationDetailsRequest(input *GetAccountAuthorizationDetailsInput) (req *request.Request, output *GetAccountAuthorizationDetailsOutput) { + op := &request.Operation{ + Name: opGetAccountAuthorizationDetails, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &GetAccountAuthorizationDetailsInput{} + } + + output = &GetAccountAuthorizationDetailsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccountAuthorizationDetails API operation for AWS Identity and Access Management. +// +// Retrieves information about all IAM users, groups, roles, and policies in +// your AWS account, including their relationships to one another. Use this +// API to obtain a snapshot of the configuration of IAM permissions (users, +// groups, roles, and policies) in your account. +// +// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). +// You can use a URL decoding method to convert the policy back to plain JSON +// text. For example, if you use Java, you can use the decode method of the +// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs +// provide similar functionality. +// +// You can optionally filter the results using the Filter parameter. You can +// paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetAccountAuthorizationDetails for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails +func (c *IAM) GetAccountAuthorizationDetails(input *GetAccountAuthorizationDetailsInput) (*GetAccountAuthorizationDetailsOutput, error) { + req, out := c.GetAccountAuthorizationDetailsRequest(input) + return out, req.Send() +} + +// GetAccountAuthorizationDetailsWithContext is the same as GetAccountAuthorizationDetails with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountAuthorizationDetails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetAccountAuthorizationDetailsWithContext(ctx aws.Context, input *GetAccountAuthorizationDetailsInput, opts ...request.Option) (*GetAccountAuthorizationDetailsOutput, error) { + req, out := c.GetAccountAuthorizationDetailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetAccountAuthorizationDetailsPages iterates over the pages of a GetAccountAuthorizationDetails operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetAccountAuthorizationDetails 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 GetAccountAuthorizationDetails operation. +// pageNum := 0 +// err := client.GetAccountAuthorizationDetailsPages(params, +// func(page *GetAccountAuthorizationDetailsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) GetAccountAuthorizationDetailsPages(input *GetAccountAuthorizationDetailsInput, fn func(*GetAccountAuthorizationDetailsOutput, bool) bool) error { + return c.GetAccountAuthorizationDetailsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetAccountAuthorizationDetailsPagesWithContext same as GetAccountAuthorizationDetailsPages 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 *IAM) GetAccountAuthorizationDetailsPagesWithContext(ctx aws.Context, input *GetAccountAuthorizationDetailsInput, fn func(*GetAccountAuthorizationDetailsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetAccountAuthorizationDetailsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetAccountAuthorizationDetailsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetAccountAuthorizationDetailsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opGetAccountPasswordPolicy = "GetAccountPasswordPolicy" + +// GetAccountPasswordPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetAccountPasswordPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccountPasswordPolicy for more information on using the GetAccountPasswordPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccountPasswordPolicyRequest method. +// req, resp := client.GetAccountPasswordPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy +func (c *IAM) GetAccountPasswordPolicyRequest(input *GetAccountPasswordPolicyInput) (req *request.Request, output *GetAccountPasswordPolicyOutput) { + op := &request.Operation{ + Name: opGetAccountPasswordPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccountPasswordPolicyInput{} + } + + output = &GetAccountPasswordPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccountPasswordPolicy API operation for AWS Identity and Access Management. +// +// Retrieves the password policy for the AWS account. For more information about +// using a password policy, go to Managing an IAM Password Policy (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.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 AWS Identity and Access Management's +// API operation GetAccountPasswordPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy +func (c *IAM) GetAccountPasswordPolicy(input *GetAccountPasswordPolicyInput) (*GetAccountPasswordPolicyOutput, error) { + req, out := c.GetAccountPasswordPolicyRequest(input) + return out, req.Send() +} + +// GetAccountPasswordPolicyWithContext is the same as GetAccountPasswordPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountPasswordPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetAccountPasswordPolicyWithContext(ctx aws.Context, input *GetAccountPasswordPolicyInput, opts ...request.Option) (*GetAccountPasswordPolicyOutput, error) { + req, out := c.GetAccountPasswordPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAccountSummary = "GetAccountSummary" + +// GetAccountSummaryRequest generates a "aws/request.Request" representing the +// client's request for the GetAccountSummary operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccountSummary for more information on using the GetAccountSummary +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccountSummaryRequest method. +// req, resp := client.GetAccountSummaryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary +func (c *IAM) GetAccountSummaryRequest(input *GetAccountSummaryInput) (req *request.Request, output *GetAccountSummaryOutput) { + op := &request.Operation{ + Name: opGetAccountSummary, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccountSummaryInput{} + } + + output = &GetAccountSummaryOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccountSummary API operation for AWS Identity and Access Management. +// +// Retrieves information about IAM entity usage and IAM quotas in the AWS account. +// +// For information about limitations on IAM entities, see Limitations on IAM +// Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetAccountSummary for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary +func (c *IAM) GetAccountSummary(input *GetAccountSummaryInput) (*GetAccountSummaryOutput, error) { + req, out := c.GetAccountSummaryRequest(input) + return out, req.Send() +} + +// GetAccountSummaryWithContext is the same as GetAccountSummary with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountSummary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetAccountSummaryWithContext(ctx aws.Context, input *GetAccountSummaryInput, opts ...request.Option) (*GetAccountSummaryOutput, error) { + req, out := c.GetAccountSummaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetContextKeysForCustomPolicy = "GetContextKeysForCustomPolicy" + +// GetContextKeysForCustomPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetContextKeysForCustomPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetContextKeysForCustomPolicy for more information on using the GetContextKeysForCustomPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetContextKeysForCustomPolicyRequest method. +// req, resp := client.GetContextKeysForCustomPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy +func (c *IAM) GetContextKeysForCustomPolicyRequest(input *GetContextKeysForCustomPolicyInput) (req *request.Request, output *GetContextKeysForPolicyResponse) { + op := &request.Operation{ + Name: opGetContextKeysForCustomPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetContextKeysForCustomPolicyInput{} + } + + output = &GetContextKeysForPolicyResponse{} + req = c.newRequest(op, input, output) + return +} + +// GetContextKeysForCustomPolicy API operation for AWS Identity and Access Management. +// +// Gets a list of all of the context keys referenced in the input policies. +// The policies are supplied as a list of one or more strings. To get the context +// keys from policies associated with an IAM user, group, or role, use GetContextKeysForPrincipalPolicy. +// +// Context keys are variables maintained by AWS and its services that provide +// details about the context of an API query request. Context keys can be evaluated +// by testing against a value specified in an IAM policy. Use GetContextKeysForCustomPolicy +// to understand what key names and values you must supply when you call SimulateCustomPolicy. +// Note that all parameters are shown in unencoded form here for clarity but +// must be URL encoded to be included as a part of a real HTML 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 AWS Identity and Access Management's +// API operation GetContextKeysForCustomPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy +func (c *IAM) GetContextKeysForCustomPolicy(input *GetContextKeysForCustomPolicyInput) (*GetContextKeysForPolicyResponse, error) { + req, out := c.GetContextKeysForCustomPolicyRequest(input) + return out, req.Send() +} + +// GetContextKeysForCustomPolicyWithContext is the same as GetContextKeysForCustomPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetContextKeysForCustomPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetContextKeysForCustomPolicyWithContext(ctx aws.Context, input *GetContextKeysForCustomPolicyInput, opts ...request.Option) (*GetContextKeysForPolicyResponse, error) { + req, out := c.GetContextKeysForCustomPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetContextKeysForPrincipalPolicy = "GetContextKeysForPrincipalPolicy" + +// GetContextKeysForPrincipalPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetContextKeysForPrincipalPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetContextKeysForPrincipalPolicy for more information on using the GetContextKeysForPrincipalPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetContextKeysForPrincipalPolicyRequest method. +// req, resp := client.GetContextKeysForPrincipalPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy +func (c *IAM) GetContextKeysForPrincipalPolicyRequest(input *GetContextKeysForPrincipalPolicyInput) (req *request.Request, output *GetContextKeysForPolicyResponse) { + op := &request.Operation{ + Name: opGetContextKeysForPrincipalPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetContextKeysForPrincipalPolicyInput{} + } + + output = &GetContextKeysForPolicyResponse{} + req = c.newRequest(op, input, output) + return +} + +// GetContextKeysForPrincipalPolicy API operation for AWS Identity and Access Management. +// +// Gets a list of all of the context keys referenced in all the IAM policies +// that are attached to the specified IAM entity. The entity can be an IAM user, +// group, or role. If you specify a user, then the request also includes all +// of the policies attached to groups that the user is a member of. +// +// You can optionally include a list of one or more additional policies, specified +// as strings. If you want to include only a list of policies by string, use +// GetContextKeysForCustomPolicy instead. +// +// Note: This API discloses information about the permissions granted to other +// users. If you do not want users to see other user's permissions, then consider +// allowing them to use GetContextKeysForCustomPolicy instead. +// +// Context keys are variables maintained by AWS and its services that provide +// details about the context of an API query request. Context keys can be evaluated +// by testing against a value in an IAM policy. Use GetContextKeysForPrincipalPolicy +// to understand what key names and values you must supply when you call SimulatePrincipalPolicy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetContextKeysForPrincipalPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy +func (c *IAM) GetContextKeysForPrincipalPolicy(input *GetContextKeysForPrincipalPolicyInput) (*GetContextKeysForPolicyResponse, error) { + req, out := c.GetContextKeysForPrincipalPolicyRequest(input) + return out, req.Send() +} + +// GetContextKeysForPrincipalPolicyWithContext is the same as GetContextKeysForPrincipalPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetContextKeysForPrincipalPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetContextKeysForPrincipalPolicyWithContext(ctx aws.Context, input *GetContextKeysForPrincipalPolicyInput, opts ...request.Option) (*GetContextKeysForPolicyResponse, error) { + req, out := c.GetContextKeysForPrincipalPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetCredentialReport = "GetCredentialReport" + +// GetCredentialReportRequest generates a "aws/request.Request" representing the +// client's request for the GetCredentialReport operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetCredentialReport for more information on using the GetCredentialReport +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetCredentialReportRequest method. +// req, resp := client.GetCredentialReportRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport +func (c *IAM) GetCredentialReportRequest(input *GetCredentialReportInput) (req *request.Request, output *GetCredentialReportOutput) { + op := &request.Operation{ + Name: opGetCredentialReport, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetCredentialReportInput{} + } + + output = &GetCredentialReportOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetCredentialReport API operation for AWS Identity and Access Management. +// +// Retrieves a credential report for the AWS account. For more information about +// the credential report, see Getting Credential Reports (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetCredentialReport for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCredentialReportNotPresentException "ReportNotPresent" +// The request was rejected because the credential report does not exist. To +// generate a credential report, use GenerateCredentialReport. +// +// * ErrCodeCredentialReportExpiredException "ReportExpired" +// The request was rejected because the most recent credential report has expired. +// To generate a new credential report, use GenerateCredentialReport. For more +// information about credential report expiration, see Getting Credential Reports +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) +// in the IAM User Guide. +// +// * ErrCodeCredentialReportNotReadyException "ReportInProgress" +// The request was rejected because the credential report is still being generated. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport +func (c *IAM) GetCredentialReport(input *GetCredentialReportInput) (*GetCredentialReportOutput, error) { + req, out := c.GetCredentialReportRequest(input) + return out, req.Send() +} + +// GetCredentialReportWithContext is the same as GetCredentialReport with the addition of +// the ability to pass a context and additional request options. +// +// See GetCredentialReport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetCredentialReportWithContext(ctx aws.Context, input *GetCredentialReportInput, opts ...request.Option) (*GetCredentialReportOutput, error) { + req, out := c.GetCredentialReportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGroup = "GetGroup" + +// GetGroupRequest generates a "aws/request.Request" representing the +// client's request for the GetGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroup for more information on using the GetGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupRequest method. +// req, resp := client.GetGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup +func (c *IAM) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) { + op := &request.Operation{ + Name: opGetGroup, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &GetGroupInput{} + } + + output = &GetGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroup API operation for AWS Identity and Access Management. +// +// Returns a list of IAM users that are in the specified IAM group. You can +// paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup +func (c *IAM) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { + req, out := c.GetGroupRequest(input) + return out, req.Send() +} + +// GetGroupWithContext is the same as GetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetGroupWithContext(ctx aws.Context, input *GetGroupInput, opts ...request.Option) (*GetGroupOutput, error) { + req, out := c.GetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetGroupPages iterates over the pages of a GetGroup operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetGroup 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 GetGroup operation. +// pageNum := 0 +// err := client.GetGroupPages(params, +// func(page *GetGroupOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) GetGroupPages(input *GetGroupInput, fn func(*GetGroupOutput, bool) bool) error { + return c.GetGroupPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetGroupPagesWithContext same as GetGroupPages 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 *IAM) GetGroupPagesWithContext(ctx aws.Context, input *GetGroupInput, fn func(*GetGroupOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetGroupInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetGroupRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetGroupOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opGetGroupPolicy = "GetGroupPolicy" + +// GetGroupPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetGroupPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroupPolicy for more information on using the GetGroupPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupPolicyRequest method. +// req, resp := client.GetGroupPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy +func (c *IAM) GetGroupPolicyRequest(input *GetGroupPolicyInput) (req *request.Request, output *GetGroupPolicyOutput) { + op := &request.Operation{ + Name: opGetGroupPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetGroupPolicyInput{} + } + + output = &GetGroupPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroupPolicy API operation for AWS Identity and Access Management. +// +// Retrieves the specified inline policy document that is embedded in the specified +// IAM group. +// +// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). +// You can use a URL decoding method to convert the policy back to plain JSON +// text. For example, if you use Java, you can use the decode method of the +// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs +// provide similar functionality. +// +// An IAM group can also have managed policies attached to it. To retrieve a +// managed policy document that is attached to a group, use GetPolicy to determine +// the policy's default version, then use GetPolicyVersion to retrieve the policy +// document. +// +// For more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetGroupPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy +func (c *IAM) GetGroupPolicy(input *GetGroupPolicyInput) (*GetGroupPolicyOutput, error) { + req, out := c.GetGroupPolicyRequest(input) + return out, req.Send() +} + +// GetGroupPolicyWithContext is the same as GetGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetGroupPolicyWithContext(ctx aws.Context, input *GetGroupPolicyInput, opts ...request.Option) (*GetGroupPolicyOutput, error) { + req, out := c.GetGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetInstanceProfile = "GetInstanceProfile" + +// GetInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the GetInstanceProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetInstanceProfile for more information on using the GetInstanceProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetInstanceProfileRequest method. +// req, resp := client.GetInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile +func (c *IAM) GetInstanceProfileRequest(input *GetInstanceProfileInput) (req *request.Request, output *GetInstanceProfileOutput) { + op := &request.Operation{ + Name: opGetInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetInstanceProfileInput{} + } + + output = &GetInstanceProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetInstanceProfile API operation for AWS Identity and Access Management. +// +// Retrieves information about the specified instance profile, including the +// instance profile's path, GUID, ARN, and role. For more information about +// instance profiles, see About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetInstanceProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile +func (c *IAM) GetInstanceProfile(input *GetInstanceProfileInput) (*GetInstanceProfileOutput, error) { + req, out := c.GetInstanceProfileRequest(input) + return out, req.Send() +} + +// GetInstanceProfileWithContext is the same as GetInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See GetInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetInstanceProfileWithContext(ctx aws.Context, input *GetInstanceProfileInput, opts ...request.Option) (*GetInstanceProfileOutput, error) { + req, out := c.GetInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetLoginProfile = "GetLoginProfile" + +// GetLoginProfileRequest generates a "aws/request.Request" representing the +// client's request for the GetLoginProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetLoginProfile for more information on using the GetLoginProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetLoginProfileRequest method. +// req, resp := client.GetLoginProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile +func (c *IAM) GetLoginProfileRequest(input *GetLoginProfileInput) (req *request.Request, output *GetLoginProfileOutput) { + op := &request.Operation{ + Name: opGetLoginProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetLoginProfileInput{} + } + + output = &GetLoginProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetLoginProfile API operation for AWS Identity and Access Management. +// +// Retrieves the user name and password-creation date for the specified IAM +// user. If the user has not been assigned a password, the operation returns +// a 404 (NoSuchEntity) 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 AWS Identity and Access Management's +// API operation GetLoginProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile +func (c *IAM) GetLoginProfile(input *GetLoginProfileInput) (*GetLoginProfileOutput, error) { + req, out := c.GetLoginProfileRequest(input) + return out, req.Send() +} + +// GetLoginProfileWithContext is the same as GetLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See GetLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetLoginProfileWithContext(ctx aws.Context, input *GetLoginProfileInput, opts ...request.Option) (*GetLoginProfileOutput, error) { + req, out := c.GetLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetOpenIDConnectProvider = "GetOpenIDConnectProvider" + +// GetOpenIDConnectProviderRequest generates a "aws/request.Request" representing the +// client's request for the GetOpenIDConnectProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetOpenIDConnectProvider for more information on using the GetOpenIDConnectProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetOpenIDConnectProviderRequest method. +// req, resp := client.GetOpenIDConnectProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider +func (c *IAM) GetOpenIDConnectProviderRequest(input *GetOpenIDConnectProviderInput) (req *request.Request, output *GetOpenIDConnectProviderOutput) { + op := &request.Operation{ + Name: opGetOpenIDConnectProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetOpenIDConnectProviderInput{} + } + + output = &GetOpenIDConnectProviderOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetOpenIDConnectProvider API operation for AWS Identity and Access Management. +// +// Returns information about the specified OpenID Connect (OIDC) provider resource +// object in IAM. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetOpenIDConnectProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider +func (c *IAM) GetOpenIDConnectProvider(input *GetOpenIDConnectProviderInput) (*GetOpenIDConnectProviderOutput, error) { + req, out := c.GetOpenIDConnectProviderRequest(input) + return out, req.Send() +} + +// GetOpenIDConnectProviderWithContext is the same as GetOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See GetOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetOpenIDConnectProviderWithContext(ctx aws.Context, input *GetOpenIDConnectProviderInput, opts ...request.Option) (*GetOpenIDConnectProviderOutput, error) { + req, out := c.GetOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetPolicy = "GetPolicy" + +// GetPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetPolicy for more information on using the GetPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetPolicyRequest method. +// req, resp := client.GetPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy +func (c *IAM) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) { + op := &request.Operation{ + Name: opGetPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetPolicyInput{} + } + + output = &GetPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetPolicy API operation for AWS Identity and Access Management. +// +// Retrieves information about the specified managed policy, including the policy's +// default version and the total number of IAM users, groups, and roles to which +// the policy is attached. To retrieve the list of the specific users, groups, +// and roles that the policy is attached to, use the ListEntitiesForPolicy API. +// This API returns metadata about the policy. To retrieve the actual policy +// document for a specific version of the policy, use GetPolicyVersion. +// +// This API retrieves information about managed policies. To retrieve information +// about an inline policy that is embedded with an IAM user, group, or role, +// use the GetUserPolicy, GetGroupPolicy, or GetRolePolicy API. +// +// For more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy +func (c *IAM) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { + req, out := c.GetPolicyRequest(input) + return out, req.Send() +} + +// GetPolicyWithContext is the same as GetPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, opts ...request.Option) (*GetPolicyOutput, error) { + req, out := c.GetPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetPolicyVersion = "GetPolicyVersion" + +// GetPolicyVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetPolicyVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetPolicyVersion for more information on using the GetPolicyVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetPolicyVersionRequest method. +// req, resp := client.GetPolicyVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion +func (c *IAM) GetPolicyVersionRequest(input *GetPolicyVersionInput) (req *request.Request, output *GetPolicyVersionOutput) { + op := &request.Operation{ + Name: opGetPolicyVersion, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetPolicyVersionInput{} + } + + output = &GetPolicyVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetPolicyVersion API operation for AWS Identity and Access Management. +// +// Retrieves information about the specified version of the specified managed +// policy, including the policy document. +// +// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). +// You can use a URL decoding method to convert the policy back to plain JSON +// text. For example, if you use Java, you can use the decode method of the +// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs +// provide similar functionality. +// +// To list the available versions for a policy, use ListPolicyVersions. +// +// This API retrieves information about managed policies. To retrieve information +// about an inline policy that is embedded in a user, group, or role, use the +// GetUserPolicy, GetGroupPolicy, or GetRolePolicy API. +// +// For more information about the types of policies, see Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// For more information about managed policy versions, see Versioning for Managed +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetPolicyVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion +func (c *IAM) GetPolicyVersion(input *GetPolicyVersionInput) (*GetPolicyVersionOutput, error) { + req, out := c.GetPolicyVersionRequest(input) + return out, req.Send() +} + +// GetPolicyVersionWithContext is the same as GetPolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetPolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetPolicyVersionWithContext(ctx aws.Context, input *GetPolicyVersionInput, opts ...request.Option) (*GetPolicyVersionOutput, error) { + req, out := c.GetPolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetRole = "GetRole" + +// GetRoleRequest generates a "aws/request.Request" representing the +// client's request for the GetRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRole for more information on using the GetRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRoleRequest method. +// req, resp := client.GetRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole +func (c *IAM) GetRoleRequest(input *GetRoleInput) (req *request.Request, output *GetRoleOutput) { + op := &request.Operation{ + Name: opGetRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetRoleInput{} + } + + output = &GetRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRole API operation for AWS Identity and Access Management. +// +// Retrieves information about the specified role, including the role's path, +// GUID, ARN, and the role's trust policy that grants permission to assume the +// role. For more information about roles, see Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). +// +// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). +// You can use a URL decoding method to convert the policy back to plain JSON +// text. For example, if you use Java, you can use the decode method of the +// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs +// provide similar functionality. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole +func (c *IAM) GetRole(input *GetRoleInput) (*GetRoleOutput, error) { + req, out := c.GetRoleRequest(input) + return out, req.Send() +} + +// GetRoleWithContext is the same as GetRole with the addition of +// the ability to pass a context and additional request options. +// +// See GetRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetRoleWithContext(ctx aws.Context, input *GetRoleInput, opts ...request.Option) (*GetRoleOutput, error) { + req, out := c.GetRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetRolePolicy = "GetRolePolicy" + +// GetRolePolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetRolePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRolePolicy for more information on using the GetRolePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRolePolicyRequest method. +// req, resp := client.GetRolePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy +func (c *IAM) GetRolePolicyRequest(input *GetRolePolicyInput) (req *request.Request, output *GetRolePolicyOutput) { + op := &request.Operation{ + Name: opGetRolePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetRolePolicyInput{} + } + + output = &GetRolePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRolePolicy API operation for AWS Identity and Access Management. +// +// Retrieves the specified inline policy document that is embedded with the +// specified IAM role. +// +// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). +// You can use a URL decoding method to convert the policy back to plain JSON +// text. For example, if you use Java, you can use the decode method of the +// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs +// provide similar functionality. +// +// An IAM role can also have managed policies attached to it. To retrieve a +// managed policy document that is attached to a role, use GetPolicy to determine +// the policy's default version, then use GetPolicyVersion to retrieve the policy +// document. +// +// For more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// For more information about roles, see Using Roles to Delegate Permissions +// and Federate Identities (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.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 AWS Identity and Access Management's +// API operation GetRolePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy +func (c *IAM) GetRolePolicy(input *GetRolePolicyInput) (*GetRolePolicyOutput, error) { + req, out := c.GetRolePolicyRequest(input) + return out, req.Send() +} + +// GetRolePolicyWithContext is the same as GetRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetRolePolicyWithContext(ctx aws.Context, input *GetRolePolicyInput, opts ...request.Option) (*GetRolePolicyOutput, error) { + req, out := c.GetRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSAMLProvider = "GetSAMLProvider" + +// GetSAMLProviderRequest generates a "aws/request.Request" representing the +// client's request for the GetSAMLProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSAMLProvider for more information on using the GetSAMLProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSAMLProviderRequest method. +// req, resp := client.GetSAMLProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider +func (c *IAM) GetSAMLProviderRequest(input *GetSAMLProviderInput) (req *request.Request, output *GetSAMLProviderOutput) { + op := &request.Operation{ + Name: opGetSAMLProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetSAMLProviderInput{} + } + + output = &GetSAMLProviderOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSAMLProvider API operation for AWS Identity and Access Management. +// +// Returns the SAML provider metadocument that was uploaded when the IAM SAML +// provider resource object was created or updated. +// +// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's +// API operation GetSAMLProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider +func (c *IAM) GetSAMLProvider(input *GetSAMLProviderInput) (*GetSAMLProviderOutput, error) { + req, out := c.GetSAMLProviderRequest(input) + return out, req.Send() +} + +// GetSAMLProviderWithContext is the same as GetSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See GetSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetSAMLProviderWithContext(ctx aws.Context, input *GetSAMLProviderInput, opts ...request.Option) (*GetSAMLProviderOutput, error) { + req, out := c.GetSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSSHPublicKey = "GetSSHPublicKey" + +// GetSSHPublicKeyRequest generates a "aws/request.Request" representing the +// client's request for the GetSSHPublicKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSSHPublicKey for more information on using the GetSSHPublicKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSSHPublicKeyRequest method. +// req, resp := client.GetSSHPublicKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey +func (c *IAM) GetSSHPublicKeyRequest(input *GetSSHPublicKeyInput) (req *request.Request, output *GetSSHPublicKeyOutput) { + op := &request.Operation{ + Name: opGetSSHPublicKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetSSHPublicKeyInput{} + } + + output = &GetSSHPublicKeyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSSHPublicKey API operation for AWS Identity and Access Management. +// +// Retrieves the specified SSH public key, including metadata about the key. +// +// The SSH public key retrieved by this operation is used only for authenticating +// the associated IAM user to an AWS CodeCommit repository. For more information +// about using SSH keys to authenticate to an AWS CodeCommit repository, see +// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) +// in the AWS CodeCommit 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 AWS Identity and Access Management's +// API operation GetSSHPublicKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeUnrecognizedPublicKeyEncodingException "UnrecognizedPublicKeyEncoding" +// The request was rejected because the public key encoding format is unsupported +// or unrecognized. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey +func (c *IAM) GetSSHPublicKey(input *GetSSHPublicKeyInput) (*GetSSHPublicKeyOutput, error) { + req, out := c.GetSSHPublicKeyRequest(input) + return out, req.Send() +} + +// GetSSHPublicKeyWithContext is the same as GetSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See GetSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetSSHPublicKeyWithContext(ctx aws.Context, input *GetSSHPublicKeyInput, opts ...request.Option) (*GetSSHPublicKeyOutput, error) { + req, out := c.GetSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetServerCertificate = "GetServerCertificate" + +// GetServerCertificateRequest generates a "aws/request.Request" representing the +// client's request for the GetServerCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetServerCertificate for more information on using the GetServerCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetServerCertificateRequest method. +// req, resp := client.GetServerCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate +func (c *IAM) GetServerCertificateRequest(input *GetServerCertificateInput) (req *request.Request, output *GetServerCertificateOutput) { + op := &request.Operation{ + Name: opGetServerCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetServerCertificateInput{} + } + + output = &GetServerCertificateOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetServerCertificate API operation for AWS Identity and Access Management. +// +// Retrieves information about the specified server certificate stored in IAM. +// +// For more information about working with server certificates, see Working +// with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) +// in the IAM User Guide. This topic includes a list of AWS services that can +// use the server certificates that you manage with IAM. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation GetServerCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate +func (c *IAM) GetServerCertificate(input *GetServerCertificateInput) (*GetServerCertificateOutput, error) { + req, out := c.GetServerCertificateRequest(input) + return out, req.Send() +} + +// GetServerCertificateWithContext is the same as GetServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See GetServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetServerCertificateWithContext(ctx aws.Context, input *GetServerCertificateInput, opts ...request.Option) (*GetServerCertificateOutput, error) { + req, out := c.GetServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetServiceLinkedRoleDeletionStatus = "GetServiceLinkedRoleDeletionStatus" + +// GetServiceLinkedRoleDeletionStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetServiceLinkedRoleDeletionStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetServiceLinkedRoleDeletionStatus for more information on using the GetServiceLinkedRoleDeletionStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetServiceLinkedRoleDeletionStatusRequest method. +// req, resp := client.GetServiceLinkedRoleDeletionStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLinkedRoleDeletionStatus +func (c *IAM) GetServiceLinkedRoleDeletionStatusRequest(input *GetServiceLinkedRoleDeletionStatusInput) (req *request.Request, output *GetServiceLinkedRoleDeletionStatusOutput) { + op := &request.Operation{ + Name: opGetServiceLinkedRoleDeletionStatus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetServiceLinkedRoleDeletionStatusInput{} + } + + output = &GetServiceLinkedRoleDeletionStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetServiceLinkedRoleDeletionStatus API operation for AWS Identity and Access Management. +// +// Retrieves the status of your service-linked role deletion. After you use +// the DeleteServiceLinkedRole API operation to submit a service-linked role +// for deletion, you can use the DeletionTaskId parameter in GetServiceLinkedRoleDeletionStatus +// to check the status of the deletion. If the deletion fails, this operation +// returns the reason that it failed, if that information is returned by 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 AWS Identity and Access Management's +// API operation GetServiceLinkedRoleDeletionStatus for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLinkedRoleDeletionStatus +func (c *IAM) GetServiceLinkedRoleDeletionStatus(input *GetServiceLinkedRoleDeletionStatusInput) (*GetServiceLinkedRoleDeletionStatusOutput, error) { + req, out := c.GetServiceLinkedRoleDeletionStatusRequest(input) + return out, req.Send() +} + +// GetServiceLinkedRoleDeletionStatusWithContext is the same as GetServiceLinkedRoleDeletionStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetServiceLinkedRoleDeletionStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetServiceLinkedRoleDeletionStatusWithContext(ctx aws.Context, input *GetServiceLinkedRoleDeletionStatusInput, opts ...request.Option) (*GetServiceLinkedRoleDeletionStatusOutput, error) { + req, out := c.GetServiceLinkedRoleDeletionStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetUser = "GetUser" + +// GetUserRequest generates a "aws/request.Request" representing the +// client's request for the GetUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetUser for more information on using the GetUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetUserRequest method. +// req, resp := client.GetUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser +func (c *IAM) GetUserRequest(input *GetUserInput) (req *request.Request, output *GetUserOutput) { + op := &request.Operation{ + Name: opGetUser, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetUserInput{} + } + + output = &GetUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetUser API operation for AWS Identity and Access Management. +// +// Retrieves information about the specified IAM user, including the user's +// creation date, path, unique ID, and ARN. +// +// If you do not specify a user name, IAM determines the user name implicitly +// based on the AWS access key ID used to sign the request to this 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 AWS Identity and Access Management's +// API operation GetUser for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser +func (c *IAM) GetUser(input *GetUserInput) (*GetUserOutput, error) { + req, out := c.GetUserRequest(input) + return out, req.Send() +} + +// GetUserWithContext is the same as GetUser with the addition of +// the ability to pass a context and additional request options. +// +// See GetUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetUserWithContext(ctx aws.Context, input *GetUserInput, opts ...request.Option) (*GetUserOutput, error) { + req, out := c.GetUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetUserPolicy = "GetUserPolicy" + +// GetUserPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetUserPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetUserPolicy for more information on using the GetUserPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetUserPolicyRequest method. +// req, resp := client.GetUserPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy +func (c *IAM) GetUserPolicyRequest(input *GetUserPolicyInput) (req *request.Request, output *GetUserPolicyOutput) { + op := &request.Operation{ + Name: opGetUserPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetUserPolicyInput{} + } + + output = &GetUserPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetUserPolicy API operation for AWS Identity and Access Management. +// +// Retrieves the specified inline policy document that is embedded in the specified +// IAM user. +// +// Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). +// You can use a URL decoding method to convert the policy back to plain JSON +// text. For example, if you use Java, you can use the decode method of the +// java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs +// provide similar functionality. +// +// An IAM user can also have managed policies attached to it. To retrieve a +// managed policy document that is attached to a user, use GetPolicy to determine +// the policy's default version, then use GetPolicyVersion to retrieve the policy +// document. +// +// For more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation GetUserPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy +func (c *IAM) GetUserPolicy(input *GetUserPolicyInput) (*GetUserPolicyOutput, error) { + req, out := c.GetUserPolicyRequest(input) + return out, req.Send() +} + +// GetUserPolicyWithContext is the same as GetUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) GetUserPolicyWithContext(ctx aws.Context, input *GetUserPolicyInput, opts ...request.Option) (*GetUserPolicyOutput, error) { + req, out := c.GetUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListAccessKeys = "ListAccessKeys" + +// ListAccessKeysRequest generates a "aws/request.Request" representing the +// client's request for the ListAccessKeys operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAccessKeys for more information on using the ListAccessKeys +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAccessKeysRequest method. +// req, resp := client.ListAccessKeysRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys +func (c *IAM) ListAccessKeysRequest(input *ListAccessKeysInput) (req *request.Request, output *ListAccessKeysOutput) { + op := &request.Operation{ + Name: opListAccessKeys, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListAccessKeysInput{} + } + + output = &ListAccessKeysOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAccessKeys API operation for AWS Identity and Access Management. +// +// Returns information about the access key IDs associated with the specified +// IAM user. If there are none, the operation returns an empty list. +// +// Although each user is limited to a small number of keys, you can still paginate +// the results using the MaxItems and Marker parameters. +// +// If the UserName field is not specified, the user name is determined implicitly +// based on the AWS access key ID used to sign the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials even if the AWS account has no associated +// users. +// +// To ensure the security of your AWS account, the secret access key is accessible +// only during key and user creation. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListAccessKeys for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys +func (c *IAM) ListAccessKeys(input *ListAccessKeysInput) (*ListAccessKeysOutput, error) { + req, out := c.ListAccessKeysRequest(input) + return out, req.Send() +} + +// ListAccessKeysWithContext is the same as ListAccessKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccessKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListAccessKeysWithContext(ctx aws.Context, input *ListAccessKeysInput, opts ...request.Option) (*ListAccessKeysOutput, error) { + req, out := c.ListAccessKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAccessKeysPages iterates over the pages of a ListAccessKeys operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAccessKeys 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 ListAccessKeys operation. +// pageNum := 0 +// err := client.ListAccessKeysPages(params, +// func(page *ListAccessKeysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListAccessKeysPages(input *ListAccessKeysInput, fn func(*ListAccessKeysOutput, bool) bool) error { + return c.ListAccessKeysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAccessKeysPagesWithContext same as ListAccessKeysPages 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 *IAM) ListAccessKeysPagesWithContext(ctx aws.Context, input *ListAccessKeysInput, fn func(*ListAccessKeysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccessKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccessKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAccessKeysOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListAccountAliases = "ListAccountAliases" + +// ListAccountAliasesRequest generates a "aws/request.Request" representing the +// client's request for the ListAccountAliases operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAccountAliases for more information on using the ListAccountAliases +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAccountAliasesRequest method. +// req, resp := client.ListAccountAliasesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases +func (c *IAM) ListAccountAliasesRequest(input *ListAccountAliasesInput) (req *request.Request, output *ListAccountAliasesOutput) { + op := &request.Operation{ + Name: opListAccountAliases, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListAccountAliasesInput{} + } + + output = &ListAccountAliasesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAccountAliases API operation for AWS Identity and Access Management. +// +// Lists the account alias associated with the AWS account (Note: you can have +// only one). For information about using an AWS account alias, see Using an +// Alias for Your AWS Account ID (http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation ListAccountAliases for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases +func (c *IAM) ListAccountAliases(input *ListAccountAliasesInput) (*ListAccountAliasesOutput, error) { + req, out := c.ListAccountAliasesRequest(input) + return out, req.Send() +} + +// ListAccountAliasesWithContext is the same as ListAccountAliases with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccountAliases for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListAccountAliasesWithContext(ctx aws.Context, input *ListAccountAliasesInput, opts ...request.Option) (*ListAccountAliasesOutput, error) { + req, out := c.ListAccountAliasesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAccountAliasesPages iterates over the pages of a ListAccountAliases operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAccountAliases 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 ListAccountAliases operation. +// pageNum := 0 +// err := client.ListAccountAliasesPages(params, +// func(page *ListAccountAliasesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListAccountAliasesPages(input *ListAccountAliasesInput, fn func(*ListAccountAliasesOutput, bool) bool) error { + return c.ListAccountAliasesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAccountAliasesPagesWithContext same as ListAccountAliasesPages 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 *IAM) ListAccountAliasesPagesWithContext(ctx aws.Context, input *ListAccountAliasesInput, fn func(*ListAccountAliasesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccountAliasesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccountAliasesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAccountAliasesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListAttachedGroupPolicies = "ListAttachedGroupPolicies" + +// ListAttachedGroupPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListAttachedGroupPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAttachedGroupPolicies for more information on using the ListAttachedGroupPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAttachedGroupPoliciesRequest method. +// req, resp := client.ListAttachedGroupPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies +func (c *IAM) ListAttachedGroupPoliciesRequest(input *ListAttachedGroupPoliciesInput) (req *request.Request, output *ListAttachedGroupPoliciesOutput) { + op := &request.Operation{ + Name: opListAttachedGroupPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListAttachedGroupPoliciesInput{} + } + + output = &ListAttachedGroupPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAttachedGroupPolicies API operation for AWS Identity and Access Management. +// +// Lists all managed policies that are attached to the specified IAM group. +// +// An IAM group can also have inline policies embedded with it. To list the +// inline policies for a group, use the ListGroupPolicies API. For information +// about policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// You can paginate the results using the MaxItems and Marker parameters. You +// can use the PathPrefix parameter to limit the list of policies to only those +// matching the specified path prefix. If there are no policies attached to +// the specified group (or none that match the specified path prefix), the operation +// returns an empty list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListAttachedGroupPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies +func (c *IAM) ListAttachedGroupPolicies(input *ListAttachedGroupPoliciesInput) (*ListAttachedGroupPoliciesOutput, error) { + req, out := c.ListAttachedGroupPoliciesRequest(input) + return out, req.Send() +} + +// ListAttachedGroupPoliciesWithContext is the same as ListAttachedGroupPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttachedGroupPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListAttachedGroupPoliciesWithContext(ctx aws.Context, input *ListAttachedGroupPoliciesInput, opts ...request.Option) (*ListAttachedGroupPoliciesOutput, error) { + req, out := c.ListAttachedGroupPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAttachedGroupPoliciesPages iterates over the pages of a ListAttachedGroupPolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAttachedGroupPolicies 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 ListAttachedGroupPolicies operation. +// pageNum := 0 +// err := client.ListAttachedGroupPoliciesPages(params, +// func(page *ListAttachedGroupPoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListAttachedGroupPoliciesPages(input *ListAttachedGroupPoliciesInput, fn func(*ListAttachedGroupPoliciesOutput, bool) bool) error { + return c.ListAttachedGroupPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAttachedGroupPoliciesPagesWithContext same as ListAttachedGroupPoliciesPages 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 *IAM) ListAttachedGroupPoliciesPagesWithContext(ctx aws.Context, input *ListAttachedGroupPoliciesInput, fn func(*ListAttachedGroupPoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttachedGroupPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttachedGroupPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAttachedGroupPoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListAttachedRolePolicies = "ListAttachedRolePolicies" + +// ListAttachedRolePoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListAttachedRolePolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAttachedRolePolicies for more information on using the ListAttachedRolePolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAttachedRolePoliciesRequest method. +// req, resp := client.ListAttachedRolePoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies +func (c *IAM) ListAttachedRolePoliciesRequest(input *ListAttachedRolePoliciesInput) (req *request.Request, output *ListAttachedRolePoliciesOutput) { + op := &request.Operation{ + Name: opListAttachedRolePolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListAttachedRolePoliciesInput{} + } + + output = &ListAttachedRolePoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAttachedRolePolicies API operation for AWS Identity and Access Management. +// +// Lists all managed policies that are attached to the specified IAM role. +// +// An IAM role can also have inline policies embedded with it. To list the inline +// policies for a role, use the ListRolePolicies API. For information about +// policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// You can paginate the results using the MaxItems and Marker parameters. You +// can use the PathPrefix parameter to limit the list of policies to only those +// matching the specified path prefix. If there are no policies attached to +// the specified role (or none that match the specified path prefix), the operation +// returns an empty list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListAttachedRolePolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies +func (c *IAM) ListAttachedRolePolicies(input *ListAttachedRolePoliciesInput) (*ListAttachedRolePoliciesOutput, error) { + req, out := c.ListAttachedRolePoliciesRequest(input) + return out, req.Send() +} + +// ListAttachedRolePoliciesWithContext is the same as ListAttachedRolePolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttachedRolePolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListAttachedRolePoliciesWithContext(ctx aws.Context, input *ListAttachedRolePoliciesInput, opts ...request.Option) (*ListAttachedRolePoliciesOutput, error) { + req, out := c.ListAttachedRolePoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAttachedRolePoliciesPages iterates over the pages of a ListAttachedRolePolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAttachedRolePolicies 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 ListAttachedRolePolicies operation. +// pageNum := 0 +// err := client.ListAttachedRolePoliciesPages(params, +// func(page *ListAttachedRolePoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListAttachedRolePoliciesPages(input *ListAttachedRolePoliciesInput, fn func(*ListAttachedRolePoliciesOutput, bool) bool) error { + return c.ListAttachedRolePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAttachedRolePoliciesPagesWithContext same as ListAttachedRolePoliciesPages 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 *IAM) ListAttachedRolePoliciesPagesWithContext(ctx aws.Context, input *ListAttachedRolePoliciesInput, fn func(*ListAttachedRolePoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttachedRolePoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttachedRolePoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAttachedRolePoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListAttachedUserPolicies = "ListAttachedUserPolicies" + +// ListAttachedUserPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListAttachedUserPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAttachedUserPolicies for more information on using the ListAttachedUserPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAttachedUserPoliciesRequest method. +// req, resp := client.ListAttachedUserPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies +func (c *IAM) ListAttachedUserPoliciesRequest(input *ListAttachedUserPoliciesInput) (req *request.Request, output *ListAttachedUserPoliciesOutput) { + op := &request.Operation{ + Name: opListAttachedUserPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListAttachedUserPoliciesInput{} + } + + output = &ListAttachedUserPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAttachedUserPolicies API operation for AWS Identity and Access Management. +// +// Lists all managed policies that are attached to the specified IAM user. +// +// An IAM user can also have inline policies embedded with it. To list the inline +// policies for a user, use the ListUserPolicies API. For information about +// policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// You can paginate the results using the MaxItems and Marker parameters. You +// can use the PathPrefix parameter to limit the list of policies to only those +// matching the specified path prefix. If there are no policies attached to +// the specified group (or none that match the specified path prefix), the operation +// returns an empty list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListAttachedUserPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies +func (c *IAM) ListAttachedUserPolicies(input *ListAttachedUserPoliciesInput) (*ListAttachedUserPoliciesOutput, error) { + req, out := c.ListAttachedUserPoliciesRequest(input) + return out, req.Send() +} + +// ListAttachedUserPoliciesWithContext is the same as ListAttachedUserPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListAttachedUserPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListAttachedUserPoliciesWithContext(ctx aws.Context, input *ListAttachedUserPoliciesInput, opts ...request.Option) (*ListAttachedUserPoliciesOutput, error) { + req, out := c.ListAttachedUserPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAttachedUserPoliciesPages iterates over the pages of a ListAttachedUserPolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAttachedUserPolicies 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 ListAttachedUserPolicies operation. +// pageNum := 0 +// err := client.ListAttachedUserPoliciesPages(params, +// func(page *ListAttachedUserPoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListAttachedUserPoliciesPages(input *ListAttachedUserPoliciesInput, fn func(*ListAttachedUserPoliciesOutput, bool) bool) error { + return c.ListAttachedUserPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAttachedUserPoliciesPagesWithContext same as ListAttachedUserPoliciesPages 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 *IAM) ListAttachedUserPoliciesPagesWithContext(ctx aws.Context, input *ListAttachedUserPoliciesInput, fn func(*ListAttachedUserPoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttachedUserPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttachedUserPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListAttachedUserPoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListEntitiesForPolicy = "ListEntitiesForPolicy" + +// ListEntitiesForPolicyRequest generates a "aws/request.Request" representing the +// client's request for the ListEntitiesForPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListEntitiesForPolicy for more information on using the ListEntitiesForPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListEntitiesForPolicyRequest method. +// req, resp := client.ListEntitiesForPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy +func (c *IAM) ListEntitiesForPolicyRequest(input *ListEntitiesForPolicyInput) (req *request.Request, output *ListEntitiesForPolicyOutput) { + op := &request.Operation{ + Name: opListEntitiesForPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListEntitiesForPolicyInput{} + } + + output = &ListEntitiesForPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListEntitiesForPolicy API operation for AWS Identity and Access Management. +// +// Lists all IAM users, groups, and roles that the specified managed policy +// is attached to. +// +// You can use the optional EntityFilter parameter to limit the results to a +// particular type of entity (users, groups, or roles). For example, to list +// only the roles that are attached to the specified policy, set EntityFilter +// to Role. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListEntitiesForPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy +func (c *IAM) ListEntitiesForPolicy(input *ListEntitiesForPolicyInput) (*ListEntitiesForPolicyOutput, error) { + req, out := c.ListEntitiesForPolicyRequest(input) + return out, req.Send() +} + +// ListEntitiesForPolicyWithContext is the same as ListEntitiesForPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See ListEntitiesForPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListEntitiesForPolicyWithContext(ctx aws.Context, input *ListEntitiesForPolicyInput, opts ...request.Option) (*ListEntitiesForPolicyOutput, error) { + req, out := c.ListEntitiesForPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListEntitiesForPolicyPages iterates over the pages of a ListEntitiesForPolicy operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListEntitiesForPolicy 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 ListEntitiesForPolicy operation. +// pageNum := 0 +// err := client.ListEntitiesForPolicyPages(params, +// func(page *ListEntitiesForPolicyOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListEntitiesForPolicyPages(input *ListEntitiesForPolicyInput, fn func(*ListEntitiesForPolicyOutput, bool) bool) error { + return c.ListEntitiesForPolicyPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListEntitiesForPolicyPagesWithContext same as ListEntitiesForPolicyPages 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 *IAM) ListEntitiesForPolicyPagesWithContext(ctx aws.Context, input *ListEntitiesForPolicyInput, fn func(*ListEntitiesForPolicyOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEntitiesForPolicyInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEntitiesForPolicyRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListEntitiesForPolicyOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListGroupPolicies = "ListGroupPolicies" + +// ListGroupPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListGroupPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroupPolicies for more information on using the ListGroupPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupPoliciesRequest method. +// req, resp := client.ListGroupPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies +func (c *IAM) ListGroupPoliciesRequest(input *ListGroupPoliciesInput) (req *request.Request, output *ListGroupPoliciesOutput) { + op := &request.Operation{ + Name: opListGroupPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListGroupPoliciesInput{} + } + + output = &ListGroupPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroupPolicies API operation for AWS Identity and Access Management. +// +// Lists the names of the inline policies that are embedded in the specified +// IAM group. +// +// An IAM group can also have managed policies attached to it. To list the managed +// policies that are attached to a group, use ListAttachedGroupPolicies. For +// more information about policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// You can paginate the results using the MaxItems and Marker parameters. If +// there are no inline policies embedded with the specified group, the operation +// returns an empty list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListGroupPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies +func (c *IAM) ListGroupPolicies(input *ListGroupPoliciesInput) (*ListGroupPoliciesOutput, error) { + req, out := c.ListGroupPoliciesRequest(input) + return out, req.Send() +} + +// ListGroupPoliciesWithContext is the same as ListGroupPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListGroupPoliciesWithContext(ctx aws.Context, input *ListGroupPoliciesInput, opts ...request.Option) (*ListGroupPoliciesOutput, error) { + req, out := c.ListGroupPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListGroupPoliciesPages iterates over the pages of a ListGroupPolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListGroupPolicies 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 ListGroupPolicies operation. +// pageNum := 0 +// err := client.ListGroupPoliciesPages(params, +// func(page *ListGroupPoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListGroupPoliciesPages(input *ListGroupPoliciesInput, fn func(*ListGroupPoliciesOutput, bool) bool) error { + return c.ListGroupPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListGroupPoliciesPagesWithContext same as ListGroupPoliciesPages 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 *IAM) ListGroupPoliciesPagesWithContext(ctx aws.Context, input *ListGroupPoliciesInput, fn func(*ListGroupPoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGroupPoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListGroups = "ListGroups" + +// ListGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroups for more information on using the ListGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupsRequest method. +// req, resp := client.ListGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups +func (c *IAM) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { + op := &request.Operation{ + Name: opListGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListGroupsInput{} + } + + output = &ListGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroups API operation for AWS Identity and Access Management. +// +// Lists the IAM groups that have the specified path prefix. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups +func (c *IAM) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + return out, req.Send() +} + +// ListGroupsWithContext is the same as ListGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListGroupsPages iterates over the pages of a ListGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListGroups 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 ListGroups operation. +// pageNum := 0 +// err := client.ListGroupsPages(params, +// func(page *ListGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error { + return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListGroupsPagesWithContext same as ListGroupsPages 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 *IAM) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListGroupsForUser = "ListGroupsForUser" + +// ListGroupsForUserRequest generates a "aws/request.Request" representing the +// client's request for the ListGroupsForUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroupsForUser for more information on using the ListGroupsForUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupsForUserRequest method. +// req, resp := client.ListGroupsForUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser +func (c *IAM) ListGroupsForUserRequest(input *ListGroupsForUserInput) (req *request.Request, output *ListGroupsForUserOutput) { + op := &request.Operation{ + Name: opListGroupsForUser, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListGroupsForUserInput{} + } + + output = &ListGroupsForUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroupsForUser API operation for AWS Identity and Access Management. +// +// Lists the IAM groups that the specified IAM user belongs to. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListGroupsForUser for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser +func (c *IAM) ListGroupsForUser(input *ListGroupsForUserInput) (*ListGroupsForUserOutput, error) { + req, out := c.ListGroupsForUserRequest(input) + return out, req.Send() +} + +// ListGroupsForUserWithContext is the same as ListGroupsForUser with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupsForUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListGroupsForUserWithContext(ctx aws.Context, input *ListGroupsForUserInput, opts ...request.Option) (*ListGroupsForUserOutput, error) { + req, out := c.ListGroupsForUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListGroupsForUserPages iterates over the pages of a ListGroupsForUser operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListGroupsForUser 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 ListGroupsForUser operation. +// pageNum := 0 +// err := client.ListGroupsForUserPages(params, +// func(page *ListGroupsForUserOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListGroupsForUserPages(input *ListGroupsForUserInput, fn func(*ListGroupsForUserOutput, bool) bool) error { + return c.ListGroupsForUserPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListGroupsForUserPagesWithContext same as ListGroupsForUserPages 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 *IAM) ListGroupsForUserPagesWithContext(ctx aws.Context, input *ListGroupsForUserInput, fn func(*ListGroupsForUserOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupsForUserInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupsForUserRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListGroupsForUserOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListInstanceProfiles = "ListInstanceProfiles" + +// ListInstanceProfilesRequest generates a "aws/request.Request" representing the +// client's request for the ListInstanceProfiles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListInstanceProfiles for more information on using the ListInstanceProfiles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListInstanceProfilesRequest method. +// req, resp := client.ListInstanceProfilesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles +func (c *IAM) ListInstanceProfilesRequest(input *ListInstanceProfilesInput) (req *request.Request, output *ListInstanceProfilesOutput) { + op := &request.Operation{ + Name: opListInstanceProfiles, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListInstanceProfilesInput{} + } + + output = &ListInstanceProfilesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListInstanceProfiles API operation for AWS Identity and Access Management. +// +// Lists the instance profiles that have the specified path prefix. If there +// are none, the operation returns an empty list. For more information about +// instance profiles, go to About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListInstanceProfiles for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles +func (c *IAM) ListInstanceProfiles(input *ListInstanceProfilesInput) (*ListInstanceProfilesOutput, error) { + req, out := c.ListInstanceProfilesRequest(input) + return out, req.Send() +} + +// ListInstanceProfilesWithContext is the same as ListInstanceProfiles with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstanceProfiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListInstanceProfilesWithContext(ctx aws.Context, input *ListInstanceProfilesInput, opts ...request.Option) (*ListInstanceProfilesOutput, error) { + req, out := c.ListInstanceProfilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListInstanceProfilesPages iterates over the pages of a ListInstanceProfiles operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListInstanceProfiles 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 ListInstanceProfiles operation. +// pageNum := 0 +// err := client.ListInstanceProfilesPages(params, +// func(page *ListInstanceProfilesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListInstanceProfilesPages(input *ListInstanceProfilesInput, fn func(*ListInstanceProfilesOutput, bool) bool) error { + return c.ListInstanceProfilesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListInstanceProfilesPagesWithContext same as ListInstanceProfilesPages 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 *IAM) ListInstanceProfilesPagesWithContext(ctx aws.Context, input *ListInstanceProfilesInput, fn func(*ListInstanceProfilesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstanceProfilesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstanceProfilesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstanceProfilesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListInstanceProfilesForRole = "ListInstanceProfilesForRole" + +// ListInstanceProfilesForRoleRequest generates a "aws/request.Request" representing the +// client's request for the ListInstanceProfilesForRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListInstanceProfilesForRole for more information on using the ListInstanceProfilesForRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListInstanceProfilesForRoleRequest method. +// req, resp := client.ListInstanceProfilesForRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole +func (c *IAM) ListInstanceProfilesForRoleRequest(input *ListInstanceProfilesForRoleInput) (req *request.Request, output *ListInstanceProfilesForRoleOutput) { + op := &request.Operation{ + Name: opListInstanceProfilesForRole, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListInstanceProfilesForRoleInput{} + } + + output = &ListInstanceProfilesForRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListInstanceProfilesForRole API operation for AWS Identity and Access Management. +// +// Lists the instance profiles that have the specified associated IAM role. +// If there are none, the operation returns an empty list. For more information +// about instance profiles, go to About Instance Profiles (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListInstanceProfilesForRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole +func (c *IAM) ListInstanceProfilesForRole(input *ListInstanceProfilesForRoleInput) (*ListInstanceProfilesForRoleOutput, error) { + req, out := c.ListInstanceProfilesForRoleRequest(input) + return out, req.Send() +} + +// ListInstanceProfilesForRoleWithContext is the same as ListInstanceProfilesForRole with the addition of +// the ability to pass a context and additional request options. +// +// See ListInstanceProfilesForRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListInstanceProfilesForRoleWithContext(ctx aws.Context, input *ListInstanceProfilesForRoleInput, opts ...request.Option) (*ListInstanceProfilesForRoleOutput, error) { + req, out := c.ListInstanceProfilesForRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListInstanceProfilesForRolePages iterates over the pages of a ListInstanceProfilesForRole operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListInstanceProfilesForRole 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 ListInstanceProfilesForRole operation. +// pageNum := 0 +// err := client.ListInstanceProfilesForRolePages(params, +// func(page *ListInstanceProfilesForRoleOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListInstanceProfilesForRolePages(input *ListInstanceProfilesForRoleInput, fn func(*ListInstanceProfilesForRoleOutput, bool) bool) error { + return c.ListInstanceProfilesForRolePagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListInstanceProfilesForRolePagesWithContext same as ListInstanceProfilesForRolePages 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 *IAM) ListInstanceProfilesForRolePagesWithContext(ctx aws.Context, input *ListInstanceProfilesForRoleInput, fn func(*ListInstanceProfilesForRoleOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInstanceProfilesForRoleInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInstanceProfilesForRoleRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListInstanceProfilesForRoleOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListMFADevices = "ListMFADevices" + +// ListMFADevicesRequest generates a "aws/request.Request" representing the +// client's request for the ListMFADevices operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListMFADevices for more information on using the ListMFADevices +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListMFADevicesRequest method. +// req, resp := client.ListMFADevicesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices +func (c *IAM) ListMFADevicesRequest(input *ListMFADevicesInput) (req *request.Request, output *ListMFADevicesOutput) { + op := &request.Operation{ + Name: opListMFADevices, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListMFADevicesInput{} + } + + output = &ListMFADevicesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListMFADevices API operation for AWS Identity and Access Management. +// +// Lists the MFA devices for an IAM user. If the request includes a IAM user +// name, then this operation lists all the MFA devices associated with the specified +// user. If you do not specify a user name, IAM determines the user name implicitly +// based on the AWS access key ID signing the request for this API. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListMFADevices for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices +func (c *IAM) ListMFADevices(input *ListMFADevicesInput) (*ListMFADevicesOutput, error) { + req, out := c.ListMFADevicesRequest(input) + return out, req.Send() +} + +// ListMFADevicesWithContext is the same as ListMFADevices with the addition of +// the ability to pass a context and additional request options. +// +// See ListMFADevices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListMFADevicesWithContext(ctx aws.Context, input *ListMFADevicesInput, opts ...request.Option) (*ListMFADevicesOutput, error) { + req, out := c.ListMFADevicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListMFADevicesPages iterates over the pages of a ListMFADevices operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMFADevices 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 ListMFADevices operation. +// pageNum := 0 +// err := client.ListMFADevicesPages(params, +// func(page *ListMFADevicesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListMFADevicesPages(input *ListMFADevicesInput, fn func(*ListMFADevicesOutput, bool) bool) error { + return c.ListMFADevicesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMFADevicesPagesWithContext same as ListMFADevicesPages 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 *IAM) ListMFADevicesPagesWithContext(ctx aws.Context, input *ListMFADevicesInput, fn func(*ListMFADevicesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMFADevicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMFADevicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListMFADevicesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListOpenIDConnectProviders = "ListOpenIDConnectProviders" + +// ListOpenIDConnectProvidersRequest generates a "aws/request.Request" representing the +// client's request for the ListOpenIDConnectProviders operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListOpenIDConnectProviders for more information on using the ListOpenIDConnectProviders +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListOpenIDConnectProvidersRequest method. +// req, resp := client.ListOpenIDConnectProvidersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders +func (c *IAM) ListOpenIDConnectProvidersRequest(input *ListOpenIDConnectProvidersInput) (req *request.Request, output *ListOpenIDConnectProvidersOutput) { + op := &request.Operation{ + Name: opListOpenIDConnectProviders, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListOpenIDConnectProvidersInput{} + } + + output = &ListOpenIDConnectProvidersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListOpenIDConnectProviders API operation for AWS Identity and Access Management. +// +// Lists information about the IAM OpenID Connect (OIDC) provider resource objects +// defined in the AWS 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 AWS Identity and Access Management's +// API operation ListOpenIDConnectProviders for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders +func (c *IAM) ListOpenIDConnectProviders(input *ListOpenIDConnectProvidersInput) (*ListOpenIDConnectProvidersOutput, error) { + req, out := c.ListOpenIDConnectProvidersRequest(input) + return out, req.Send() +} + +// ListOpenIDConnectProvidersWithContext is the same as ListOpenIDConnectProviders with the addition of +// the ability to pass a context and additional request options. +// +// See ListOpenIDConnectProviders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListOpenIDConnectProvidersWithContext(ctx aws.Context, input *ListOpenIDConnectProvidersInput, opts ...request.Option) (*ListOpenIDConnectProvidersOutput, error) { + req, out := c.ListOpenIDConnectProvidersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListPolicies = "ListPolicies" + +// ListPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListPolicies for more information on using the ListPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListPoliciesRequest method. +// req, resp := client.ListPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies +func (c *IAM) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Request, output *ListPoliciesOutput) { + op := &request.Operation{ + Name: opListPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListPoliciesInput{} + } + + output = &ListPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListPolicies API operation for AWS Identity and Access Management. +// +// Lists all the managed policies that are available in your AWS account, including +// your own customer-defined managed policies and all AWS managed policies. +// +// You can filter the list of policies that is returned using the optional OnlyAttached, +// Scope, and PathPrefix parameters. For example, to list only the customer +// managed policies in your AWS account, set Scope to Local. To list only AWS +// managed policies, set Scope to AWS. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// For more information about managed policies, see Managed Policies and Inline +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation ListPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies +func (c *IAM) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { + req, out := c.ListPoliciesRequest(input) + return out, req.Send() +} + +// ListPoliciesWithContext is the same as ListPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListPoliciesWithContext(ctx aws.Context, input *ListPoliciesInput, opts ...request.Option) (*ListPoliciesOutput, error) { + req, out := c.ListPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListPoliciesPages iterates over the pages of a ListPolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListPolicies 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 ListPolicies operation. +// pageNum := 0 +// err := client.ListPoliciesPages(params, +// func(page *ListPoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListPoliciesPages(input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool) error { + return c.ListPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPoliciesPagesWithContext same as ListPoliciesPages 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 *IAM) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListPolicyVersions = "ListPolicyVersions" + +// ListPolicyVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListPolicyVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListPolicyVersions for more information on using the ListPolicyVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListPolicyVersionsRequest method. +// req, resp := client.ListPolicyVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions +func (c *IAM) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) (req *request.Request, output *ListPolicyVersionsOutput) { + op := &request.Operation{ + Name: opListPolicyVersions, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListPolicyVersionsInput{} + } + + output = &ListPolicyVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListPolicyVersions API operation for AWS Identity and Access Management. +// +// Lists information about the versions of the specified managed policy, including +// the version that is currently set as the policy's default version. +// +// For more information about managed policies, see Managed Policies and Inline +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation ListPolicyVersions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions +func (c *IAM) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVersionsOutput, error) { + req, out := c.ListPolicyVersionsRequest(input) + return out, req.Send() +} + +// ListPolicyVersionsWithContext is the same as ListPolicyVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListPolicyVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListPolicyVersionsWithContext(ctx aws.Context, input *ListPolicyVersionsInput, opts ...request.Option) (*ListPolicyVersionsOutput, error) { + req, out := c.ListPolicyVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListPolicyVersionsPages iterates over the pages of a ListPolicyVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListPolicyVersions 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 ListPolicyVersions operation. +// pageNum := 0 +// err := client.ListPolicyVersionsPages(params, +// func(page *ListPolicyVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListPolicyVersionsPages(input *ListPolicyVersionsInput, fn func(*ListPolicyVersionsOutput, bool) bool) error { + return c.ListPolicyVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPolicyVersionsPagesWithContext same as ListPolicyVersionsPages 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 *IAM) ListPolicyVersionsPagesWithContext(ctx aws.Context, input *ListPolicyVersionsInput, fn func(*ListPolicyVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPolicyVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPolicyVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPolicyVersionsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListRolePolicies = "ListRolePolicies" + +// ListRolePoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListRolePolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRolePolicies for more information on using the ListRolePolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRolePoliciesRequest method. +// req, resp := client.ListRolePoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies +func (c *IAM) ListRolePoliciesRequest(input *ListRolePoliciesInput) (req *request.Request, output *ListRolePoliciesOutput) { + op := &request.Operation{ + Name: opListRolePolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListRolePoliciesInput{} + } + + output = &ListRolePoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRolePolicies API operation for AWS Identity and Access Management. +// +// Lists the names of the inline policies that are embedded in the specified +// IAM role. +// +// An IAM role can also have managed policies attached to it. To list the managed +// policies that are attached to a role, use ListAttachedRolePolicies. For more +// information about policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// You can paginate the results using the MaxItems and Marker parameters. If +// there are no inline policies embedded with the specified role, the operation +// returns an empty list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListRolePolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies +func (c *IAM) ListRolePolicies(input *ListRolePoliciesInput) (*ListRolePoliciesOutput, error) { + req, out := c.ListRolePoliciesRequest(input) + return out, req.Send() +} + +// ListRolePoliciesWithContext is the same as ListRolePolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListRolePolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListRolePoliciesWithContext(ctx aws.Context, input *ListRolePoliciesInput, opts ...request.Option) (*ListRolePoliciesOutput, error) { + req, out := c.ListRolePoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListRolePoliciesPages iterates over the pages of a ListRolePolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListRolePolicies 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 ListRolePolicies operation. +// pageNum := 0 +// err := client.ListRolePoliciesPages(params, +// func(page *ListRolePoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListRolePoliciesPages(input *ListRolePoliciesInput, fn func(*ListRolePoliciesOutput, bool) bool) error { + return c.ListRolePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListRolePoliciesPagesWithContext same as ListRolePoliciesPages 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 *IAM) ListRolePoliciesPagesWithContext(ctx aws.Context, input *ListRolePoliciesInput, fn func(*ListRolePoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRolePoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRolePoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListRolePoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListRoles = "ListRoles" + +// ListRolesRequest generates a "aws/request.Request" representing the +// client's request for the ListRoles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRoles for more information on using the ListRoles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRolesRequest method. +// req, resp := client.ListRolesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles +func (c *IAM) ListRolesRequest(input *ListRolesInput) (req *request.Request, output *ListRolesOutput) { + op := &request.Operation{ + Name: opListRoles, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListRolesInput{} + } + + output = &ListRolesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRoles API operation for AWS Identity and Access Management. +// +// Lists the IAM roles that have the specified path prefix. If there are none, +// the operation returns an empty list. For more information about roles, go +// to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListRoles for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles +func (c *IAM) ListRoles(input *ListRolesInput) (*ListRolesOutput, error) { + req, out := c.ListRolesRequest(input) + return out, req.Send() +} + +// ListRolesWithContext is the same as ListRoles with the addition of +// the ability to pass a context and additional request options. +// +// See ListRoles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListRolesWithContext(ctx aws.Context, input *ListRolesInput, opts ...request.Option) (*ListRolesOutput, error) { + req, out := c.ListRolesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListRolesPages iterates over the pages of a ListRoles operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListRoles 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 ListRoles operation. +// pageNum := 0 +// err := client.ListRolesPages(params, +// func(page *ListRolesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListRolesPages(input *ListRolesInput, fn func(*ListRolesOutput, bool) bool) error { + return c.ListRolesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListRolesPagesWithContext same as ListRolesPages 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 *IAM) ListRolesPagesWithContext(ctx aws.Context, input *ListRolesInput, fn func(*ListRolesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRolesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRolesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListRolesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListSAMLProviders = "ListSAMLProviders" + +// ListSAMLProvidersRequest generates a "aws/request.Request" representing the +// client's request for the ListSAMLProviders operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSAMLProviders for more information on using the ListSAMLProviders +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSAMLProvidersRequest method. +// req, resp := client.ListSAMLProvidersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders +func (c *IAM) ListSAMLProvidersRequest(input *ListSAMLProvidersInput) (req *request.Request, output *ListSAMLProvidersOutput) { + op := &request.Operation{ + Name: opListSAMLProviders, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListSAMLProvidersInput{} + } + + output = &ListSAMLProvidersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSAMLProviders API operation for AWS Identity and Access Management. +// +// Lists the SAML provider resource objects defined in IAM in the account. +// +// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's +// API operation ListSAMLProviders for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders +func (c *IAM) ListSAMLProviders(input *ListSAMLProvidersInput) (*ListSAMLProvidersOutput, error) { + req, out := c.ListSAMLProvidersRequest(input) + return out, req.Send() +} + +// ListSAMLProvidersWithContext is the same as ListSAMLProviders with the addition of +// the ability to pass a context and additional request options. +// +// See ListSAMLProviders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListSAMLProvidersWithContext(ctx aws.Context, input *ListSAMLProvidersInput, opts ...request.Option) (*ListSAMLProvidersOutput, error) { + req, out := c.ListSAMLProvidersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSSHPublicKeys = "ListSSHPublicKeys" + +// ListSSHPublicKeysRequest generates a "aws/request.Request" representing the +// client's request for the ListSSHPublicKeys operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSSHPublicKeys for more information on using the ListSSHPublicKeys +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSSHPublicKeysRequest method. +// req, resp := client.ListSSHPublicKeysRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeys +func (c *IAM) ListSSHPublicKeysRequest(input *ListSSHPublicKeysInput) (req *request.Request, output *ListSSHPublicKeysOutput) { + op := &request.Operation{ + Name: opListSSHPublicKeys, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListSSHPublicKeysInput{} + } + + output = &ListSSHPublicKeysOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSSHPublicKeys API operation for AWS Identity and Access Management. +// +// Returns information about the SSH public keys associated with the specified +// IAM user. If there are none, the operation returns an empty list. +// +// The SSH public keys returned by this operation are used only for authenticating +// the IAM user to an AWS CodeCommit repository. For more information about +// using SSH keys to authenticate to an AWS CodeCommit repository, see Set up +// AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) +// in the AWS CodeCommit User Guide. +// +// Although each user is limited to a small number of keys, you can still paginate +// the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListSSHPublicKeys for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeys +func (c *IAM) ListSSHPublicKeys(input *ListSSHPublicKeysInput) (*ListSSHPublicKeysOutput, error) { + req, out := c.ListSSHPublicKeysRequest(input) + return out, req.Send() +} + +// ListSSHPublicKeysWithContext is the same as ListSSHPublicKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListSSHPublicKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListSSHPublicKeysWithContext(ctx aws.Context, input *ListSSHPublicKeysInput, opts ...request.Option) (*ListSSHPublicKeysOutput, error) { + req, out := c.ListSSHPublicKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListSSHPublicKeysPages iterates over the pages of a ListSSHPublicKeys operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListSSHPublicKeys 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 ListSSHPublicKeys operation. +// pageNum := 0 +// err := client.ListSSHPublicKeysPages(params, +// func(page *ListSSHPublicKeysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListSSHPublicKeysPages(input *ListSSHPublicKeysInput, fn func(*ListSSHPublicKeysOutput, bool) bool) error { + return c.ListSSHPublicKeysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListSSHPublicKeysPagesWithContext same as ListSSHPublicKeysPages 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 *IAM) ListSSHPublicKeysPagesWithContext(ctx aws.Context, input *ListSSHPublicKeysInput, fn func(*ListSSHPublicKeysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSSHPublicKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSSHPublicKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListSSHPublicKeysOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListServerCertificates = "ListServerCertificates" + +// ListServerCertificatesRequest generates a "aws/request.Request" representing the +// client's request for the ListServerCertificates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListServerCertificates for more information on using the ListServerCertificates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListServerCertificatesRequest method. +// req, resp := client.ListServerCertificatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificates +func (c *IAM) ListServerCertificatesRequest(input *ListServerCertificatesInput) (req *request.Request, output *ListServerCertificatesOutput) { + op := &request.Operation{ + Name: opListServerCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListServerCertificatesInput{} + } + + output = &ListServerCertificatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListServerCertificates API operation for AWS Identity and Access Management. +// +// Lists the server certificates stored in IAM that have the specified path +// prefix. If none exist, the operation returns an empty list. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// For more information about working with server certificates, see Working +// with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) +// in the IAM User Guide. This topic also includes a list of AWS services that +// can use the server certificates that you manage with IAM. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListServerCertificates for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServerCertificates +func (c *IAM) ListServerCertificates(input *ListServerCertificatesInput) (*ListServerCertificatesOutput, error) { + req, out := c.ListServerCertificatesRequest(input) + return out, req.Send() +} + +// ListServerCertificatesWithContext is the same as ListServerCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ListServerCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListServerCertificatesWithContext(ctx aws.Context, input *ListServerCertificatesInput, opts ...request.Option) (*ListServerCertificatesOutput, error) { + req, out := c.ListServerCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListServerCertificatesPages iterates over the pages of a ListServerCertificates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListServerCertificates 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 ListServerCertificates operation. +// pageNum := 0 +// err := client.ListServerCertificatesPages(params, +// func(page *ListServerCertificatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListServerCertificatesPages(input *ListServerCertificatesInput, fn func(*ListServerCertificatesOutput, bool) bool) error { + return c.ListServerCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListServerCertificatesPagesWithContext same as ListServerCertificatesPages 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 *IAM) ListServerCertificatesPagesWithContext(ctx aws.Context, input *ListServerCertificatesInput, fn func(*ListServerCertificatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListServerCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListServerCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListServerCertificatesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListServiceSpecificCredentials = "ListServiceSpecificCredentials" + +// ListServiceSpecificCredentialsRequest generates a "aws/request.Request" representing the +// client's request for the ListServiceSpecificCredentials operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListServiceSpecificCredentials for more information on using the ListServiceSpecificCredentials +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListServiceSpecificCredentialsRequest method. +// req, resp := client.ListServiceSpecificCredentialsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentials +func (c *IAM) ListServiceSpecificCredentialsRequest(input *ListServiceSpecificCredentialsInput) (req *request.Request, output *ListServiceSpecificCredentialsOutput) { + op := &request.Operation{ + Name: opListServiceSpecificCredentials, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListServiceSpecificCredentialsInput{} + } + + output = &ListServiceSpecificCredentialsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListServiceSpecificCredentials API operation for AWS Identity and Access Management. +// +// Returns information about the service-specific credentials associated with +// the specified IAM user. If there are none, the operation returns an empty +// list. The service-specific credentials returned by this operation are used +// only for authenticating the IAM user to a specific service. For more information +// about using service-specific credentials to authenticate to an AWS service, +// see Set Up service-specific credentials (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html) +// in the AWS CodeCommit 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 AWS Identity and Access Management's +// API operation ListServiceSpecificCredentials for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceNotSupportedException "NotSupportedService" +// The specified service does not support service-specific credentials. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListServiceSpecificCredentials +func (c *IAM) ListServiceSpecificCredentials(input *ListServiceSpecificCredentialsInput) (*ListServiceSpecificCredentialsOutput, error) { + req, out := c.ListServiceSpecificCredentialsRequest(input) + return out, req.Send() +} + +// ListServiceSpecificCredentialsWithContext is the same as ListServiceSpecificCredentials with the addition of +// the ability to pass a context and additional request options. +// +// See ListServiceSpecificCredentials for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListServiceSpecificCredentialsWithContext(ctx aws.Context, input *ListServiceSpecificCredentialsInput, opts ...request.Option) (*ListServiceSpecificCredentialsOutput, error) { + req, out := c.ListServiceSpecificCredentialsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSigningCertificates = "ListSigningCertificates" + +// ListSigningCertificatesRequest generates a "aws/request.Request" representing the +// client's request for the ListSigningCertificates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSigningCertificates for more information on using the ListSigningCertificates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSigningCertificatesRequest method. +// req, resp := client.ListSigningCertificatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificates +func (c *IAM) ListSigningCertificatesRequest(input *ListSigningCertificatesInput) (req *request.Request, output *ListSigningCertificatesOutput) { + op := &request.Operation{ + Name: opListSigningCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListSigningCertificatesInput{} + } + + output = &ListSigningCertificatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSigningCertificates API operation for AWS Identity and Access Management. +// +// Returns information about the signing certificates associated with the specified +// IAM user. If there are none, the operation returns an empty list. +// +// Although each user is limited to a small number of signing certificates, +// you can still paginate the results using the MaxItems and Marker parameters. +// +// If the UserName field is not specified, the user name is determined implicitly +// based on the AWS access key ID used to sign the request for this API. Because +// this operation works for access keys under the AWS account, you can use this +// operation to manage AWS account root user credentials even if the AWS account +// has no associated users. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListSigningCertificates for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSigningCertificates +func (c *IAM) ListSigningCertificates(input *ListSigningCertificatesInput) (*ListSigningCertificatesOutput, error) { + req, out := c.ListSigningCertificatesRequest(input) + return out, req.Send() +} + +// ListSigningCertificatesWithContext is the same as ListSigningCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ListSigningCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListSigningCertificatesWithContext(ctx aws.Context, input *ListSigningCertificatesInput, opts ...request.Option) (*ListSigningCertificatesOutput, error) { + req, out := c.ListSigningCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListSigningCertificatesPages iterates over the pages of a ListSigningCertificates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListSigningCertificates 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 ListSigningCertificates operation. +// pageNum := 0 +// err := client.ListSigningCertificatesPages(params, +// func(page *ListSigningCertificatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListSigningCertificatesPages(input *ListSigningCertificatesInput, fn func(*ListSigningCertificatesOutput, bool) bool) error { + return c.ListSigningCertificatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListSigningCertificatesPagesWithContext same as ListSigningCertificatesPages 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 *IAM) ListSigningCertificatesPagesWithContext(ctx aws.Context, input *ListSigningCertificatesInput, fn func(*ListSigningCertificatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSigningCertificatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSigningCertificatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListSigningCertificatesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListUserPolicies = "ListUserPolicies" + +// ListUserPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListUserPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUserPolicies for more information on using the ListUserPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUserPoliciesRequest method. +// req, resp := client.ListUserPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPolicies +func (c *IAM) ListUserPoliciesRequest(input *ListUserPoliciesInput) (req *request.Request, output *ListUserPoliciesOutput) { + op := &request.Operation{ + Name: opListUserPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListUserPoliciesInput{} + } + + output = &ListUserPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUserPolicies API operation for AWS Identity and Access Management. +// +// Lists the names of the inline policies embedded in the specified IAM user. +// +// An IAM user can also have managed policies attached to it. To list the managed +// policies that are attached to a user, use ListAttachedUserPolicies. For more +// information about policies, see Managed Policies and Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// You can paginate the results using the MaxItems and Marker parameters. If +// there are no inline policies embedded with the specified user, the operation +// returns an empty list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListUserPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUserPolicies +func (c *IAM) ListUserPolicies(input *ListUserPoliciesInput) (*ListUserPoliciesOutput, error) { + req, out := c.ListUserPoliciesRequest(input) + return out, req.Send() +} + +// ListUserPoliciesWithContext is the same as ListUserPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListUserPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListUserPoliciesWithContext(ctx aws.Context, input *ListUserPoliciesInput, opts ...request.Option) (*ListUserPoliciesOutput, error) { + req, out := c.ListUserPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListUserPoliciesPages iterates over the pages of a ListUserPolicies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUserPolicies 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 ListUserPolicies operation. +// pageNum := 0 +// err := client.ListUserPoliciesPages(params, +// func(page *ListUserPoliciesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListUserPoliciesPages(input *ListUserPoliciesInput, fn func(*ListUserPoliciesOutput, bool) bool) error { + return c.ListUserPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUserPoliciesPagesWithContext same as ListUserPoliciesPages 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 *IAM) ListUserPoliciesPagesWithContext(ctx aws.Context, input *ListUserPoliciesInput, fn func(*ListUserPoliciesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUserPoliciesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUserPoliciesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListUserPoliciesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListUsers = "ListUsers" + +// ListUsersRequest generates a "aws/request.Request" representing the +// client's request for the ListUsers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUsers for more information on using the ListUsers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUsersRequest method. +// req, resp := client.ListUsersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsers +func (c *IAM) ListUsersRequest(input *ListUsersInput) (req *request.Request, output *ListUsersOutput) { + op := &request.Operation{ + Name: opListUsers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListUsersInput{} + } + + output = &ListUsersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUsers API operation for AWS Identity and Access Management. +// +// Lists the IAM users that have the specified path prefix. If no path prefix +// is specified, the operation returns all users in the AWS account. If there +// are none, the operation returns an empty list. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListUsers for usage and error information. +// +// Returned Error Codes: +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListUsers +func (c *IAM) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + return out, req.Send() +} + +// ListUsersWithContext is the same as ListUsers with the addition of +// the ability to pass a context and additional request options. +// +// See ListUsers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListUsersWithContext(ctx aws.Context, input *ListUsersInput, opts ...request.Option) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListUsersPages iterates over the pages of a ListUsers operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUsers 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 ListUsers operation. +// pageNum := 0 +// err := client.ListUsersPages(params, +// func(page *ListUsersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListUsersPages(input *ListUsersInput, fn func(*ListUsersOutput, bool) bool) error { + return c.ListUsersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUsersPagesWithContext same as ListUsersPages 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 *IAM) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersInput, fn func(*ListUsersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUsersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUsersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListVirtualMFADevices = "ListVirtualMFADevices" + +// ListVirtualMFADevicesRequest generates a "aws/request.Request" representing the +// client's request for the ListVirtualMFADevices operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListVirtualMFADevices for more information on using the ListVirtualMFADevices +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListVirtualMFADevicesRequest method. +// req, resp := client.ListVirtualMFADevicesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevices +func (c *IAM) ListVirtualMFADevicesRequest(input *ListVirtualMFADevicesInput) (req *request.Request, output *ListVirtualMFADevicesOutput) { + op := &request.Operation{ + Name: opListVirtualMFADevices, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListVirtualMFADevicesInput{} + } + + output = &ListVirtualMFADevicesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListVirtualMFADevices API operation for AWS Identity and Access Management. +// +// Lists the virtual MFA devices defined in the AWS account by assignment status. +// If you do not specify an assignment status, the operation returns a list +// of all virtual MFA devices. Assignment status can be Assigned, Unassigned, +// or Any. +// +// You can paginate the results using the MaxItems and Marker parameters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ListVirtualMFADevices for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListVirtualMFADevices +func (c *IAM) ListVirtualMFADevices(input *ListVirtualMFADevicesInput) (*ListVirtualMFADevicesOutput, error) { + req, out := c.ListVirtualMFADevicesRequest(input) + return out, req.Send() +} + +// ListVirtualMFADevicesWithContext is the same as ListVirtualMFADevices with the addition of +// the ability to pass a context and additional request options. +// +// See ListVirtualMFADevices for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ListVirtualMFADevicesWithContext(ctx aws.Context, input *ListVirtualMFADevicesInput, opts ...request.Option) (*ListVirtualMFADevicesOutput, error) { + req, out := c.ListVirtualMFADevicesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListVirtualMFADevicesPages iterates over the pages of a ListVirtualMFADevices operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListVirtualMFADevices 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 ListVirtualMFADevices operation. +// pageNum := 0 +// err := client.ListVirtualMFADevicesPages(params, +// func(page *ListVirtualMFADevicesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) ListVirtualMFADevicesPages(input *ListVirtualMFADevicesInput, fn func(*ListVirtualMFADevicesOutput, bool) bool) error { + return c.ListVirtualMFADevicesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListVirtualMFADevicesPagesWithContext same as ListVirtualMFADevicesPages 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 *IAM) ListVirtualMFADevicesPagesWithContext(ctx aws.Context, input *ListVirtualMFADevicesInput, fn func(*ListVirtualMFADevicesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListVirtualMFADevicesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListVirtualMFADevicesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListVirtualMFADevicesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opPutGroupPolicy = "PutGroupPolicy" + +// PutGroupPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutGroupPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutGroupPolicy for more information on using the PutGroupPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutGroupPolicyRequest method. +// req, resp := client.PutGroupPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicy +func (c *IAM) PutGroupPolicyRequest(input *PutGroupPolicyInput) (req *request.Request, output *PutGroupPolicyOutput) { + op := &request.Operation{ + Name: opPutGroupPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutGroupPolicyInput{} + } + + output = &PutGroupPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutGroupPolicy API operation for AWS Identity and Access Management. +// +// Adds or updates an inline policy document that is embedded in the specified +// IAM group. +// +// A user can also have managed policies attached to it. To attach a managed +// policy to a group, use AttachGroupPolicy. To create a new managed policy, +// use CreatePolicy. For information about policies, see Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// For information about limits on the number of inline policies that you can +// embed in a group, see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM User Guide. +// +// Because policy documents can be large, you should use POST rather than GET +// when calling PutGroupPolicy. For general information about using the Query +// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation PutGroupPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutGroupPolicy +func (c *IAM) PutGroupPolicy(input *PutGroupPolicyInput) (*PutGroupPolicyOutput, error) { + req, out := c.PutGroupPolicyRequest(input) + return out, req.Send() +} + +// PutGroupPolicyWithContext is the same as PutGroupPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutGroupPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) PutGroupPolicyWithContext(ctx aws.Context, input *PutGroupPolicyInput, opts ...request.Option) (*PutGroupPolicyOutput, error) { + req, out := c.PutGroupPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutRolePermissionsBoundary = "PutRolePermissionsBoundary" + +// PutRolePermissionsBoundaryRequest generates a "aws/request.Request" representing the +// client's request for the PutRolePermissionsBoundary operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutRolePermissionsBoundary for more information on using the PutRolePermissionsBoundary +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutRolePermissionsBoundaryRequest method. +// req, resp := client.PutRolePermissionsBoundaryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePermissionsBoundary +func (c *IAM) PutRolePermissionsBoundaryRequest(input *PutRolePermissionsBoundaryInput) (req *request.Request, output *PutRolePermissionsBoundaryOutput) { + op := &request.Operation{ + Name: opPutRolePermissionsBoundary, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutRolePermissionsBoundaryInput{} + } + + output = &PutRolePermissionsBoundaryOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutRolePermissionsBoundary API operation for AWS Identity and Access Management. +// +// Adds or updates the policy that is specified as the IAM role's permissions +// boundary. You can use an AWS managed policy or a customer managed policy +// to set the boundary for a role. Use the boundary to control the maximum permissions +// that the role can have. Setting a permissions boundary is an advanced feature +// that can affect the permissions for the role. +// +// You cannot set the boundary for a service-linked role. +// +// Policies used as permissions boundaries do not provide permissions. You must +// also attach a permissions policy to the role. To learn how the effective +// permissions for a role are evaluated, see IAM JSON Policy Evaluation Logic +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation PutRolePermissionsBoundary for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodePolicyNotAttachableException "PolicyNotAttachable" +// The request failed because AWS service role policies can only be attached +// to the service-linked role for that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePermissionsBoundary +func (c *IAM) PutRolePermissionsBoundary(input *PutRolePermissionsBoundaryInput) (*PutRolePermissionsBoundaryOutput, error) { + req, out := c.PutRolePermissionsBoundaryRequest(input) + return out, req.Send() +} + +// PutRolePermissionsBoundaryWithContext is the same as PutRolePermissionsBoundary with the addition of +// the ability to pass a context and additional request options. +// +// See PutRolePermissionsBoundary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) PutRolePermissionsBoundaryWithContext(ctx aws.Context, input *PutRolePermissionsBoundaryInput, opts ...request.Option) (*PutRolePermissionsBoundaryOutput, error) { + req, out := c.PutRolePermissionsBoundaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutRolePolicy = "PutRolePolicy" + +// PutRolePolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutRolePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutRolePolicy for more information on using the PutRolePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutRolePolicyRequest method. +// req, resp := client.PutRolePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicy +func (c *IAM) PutRolePolicyRequest(input *PutRolePolicyInput) (req *request.Request, output *PutRolePolicyOutput) { + op := &request.Operation{ + Name: opPutRolePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutRolePolicyInput{} + } + + output = &PutRolePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutRolePolicy API operation for AWS Identity and Access Management. +// +// Adds or updates an inline policy document that is embedded in the specified +// IAM role. +// +// When you embed an inline policy in a role, the inline policy is used as part +// of the role's access (permissions) policy. The role's trust policy is created +// at the same time as the role, using CreateRole. You can update a role's trust +// policy using UpdateAssumeRolePolicy. For more information about IAM roles, +// go to Using Roles to Delegate Permissions and Federate Identities (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html). +// +// A role can also have a managed policy attached to it. To attach a managed +// policy to a role, use AttachRolePolicy. To create a new managed policy, use +// CreatePolicy. For information about policies, see Managed Policies and Inline +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// For information about limits on the number of inline policies that you can +// embed with a role, see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM User Guide. +// +// Because policy documents can be large, you should use POST rather than GET +// when calling PutRolePolicy. For general information about using the Query +// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation PutRolePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutRolePolicy +func (c *IAM) PutRolePolicy(input *PutRolePolicyInput) (*PutRolePolicyOutput, error) { + req, out := c.PutRolePolicyRequest(input) + return out, req.Send() +} + +// PutRolePolicyWithContext is the same as PutRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) PutRolePolicyWithContext(ctx aws.Context, input *PutRolePolicyInput, opts ...request.Option) (*PutRolePolicyOutput, error) { + req, out := c.PutRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutUserPermissionsBoundary = "PutUserPermissionsBoundary" + +// PutUserPermissionsBoundaryRequest generates a "aws/request.Request" representing the +// client's request for the PutUserPermissionsBoundary operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutUserPermissionsBoundary for more information on using the PutUserPermissionsBoundary +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutUserPermissionsBoundaryRequest method. +// req, resp := client.PutUserPermissionsBoundaryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPermissionsBoundary +func (c *IAM) PutUserPermissionsBoundaryRequest(input *PutUserPermissionsBoundaryInput) (req *request.Request, output *PutUserPermissionsBoundaryOutput) { + op := &request.Operation{ + Name: opPutUserPermissionsBoundary, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutUserPermissionsBoundaryInput{} + } + + output = &PutUserPermissionsBoundaryOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutUserPermissionsBoundary API operation for AWS Identity and Access Management. +// +// Adds or updates the policy that is specified as the IAM user's permissions +// boundary. You can use an AWS managed policy or a customer managed policy +// to set the boundary for a user. Use the boundary to control the maximum permissions +// that the user can have. Setting a permissions boundary is an advanced feature +// that can affect the permissions for the user. +// +// Policies that are used as permissions boundaries do not provide permissions. +// You must also attach a permissions policy to the user. To learn how the effective +// permissions for a user are evaluated, see IAM JSON Policy Evaluation Logic +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation PutUserPermissionsBoundary for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodePolicyNotAttachableException "PolicyNotAttachable" +// The request failed because AWS service role policies can only be attached +// to the service-linked role for that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPermissionsBoundary +func (c *IAM) PutUserPermissionsBoundary(input *PutUserPermissionsBoundaryInput) (*PutUserPermissionsBoundaryOutput, error) { + req, out := c.PutUserPermissionsBoundaryRequest(input) + return out, req.Send() +} + +// PutUserPermissionsBoundaryWithContext is the same as PutUserPermissionsBoundary with the addition of +// the ability to pass a context and additional request options. +// +// See PutUserPermissionsBoundary for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) PutUserPermissionsBoundaryWithContext(ctx aws.Context, input *PutUserPermissionsBoundaryInput, opts ...request.Option) (*PutUserPermissionsBoundaryOutput, error) { + req, out := c.PutUserPermissionsBoundaryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutUserPolicy = "PutUserPolicy" + +// PutUserPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutUserPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutUserPolicy for more information on using the PutUserPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutUserPolicyRequest method. +// req, resp := client.PutUserPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicy +func (c *IAM) PutUserPolicyRequest(input *PutUserPolicyInput) (req *request.Request, output *PutUserPolicyOutput) { + op := &request.Operation{ + Name: opPutUserPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutUserPolicyInput{} + } + + output = &PutUserPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutUserPolicy API operation for AWS Identity and Access Management. +// +// Adds or updates an inline policy document that is embedded in the specified +// IAM user. +// +// An IAM user can also have a managed policy attached to it. To attach a managed +// policy to a user, use AttachUserPolicy. To create a new managed policy, use +// CreatePolicy. For information about policies, see Managed Policies and Inline +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM User Guide. +// +// For information about limits on the number of inline policies that you can +// embed in a user, see Limitations on IAM Entities (http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// in the IAM User Guide. +// +// Because policy documents can be large, you should use POST rather than GET +// when calling PutUserPolicy. For general information about using the Query +// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation PutUserPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/PutUserPolicy +func (c *IAM) PutUserPolicy(input *PutUserPolicyInput) (*PutUserPolicyOutput, error) { + req, out := c.PutUserPolicyRequest(input) + return out, req.Send() +} + +// PutUserPolicyWithContext is the same as PutUserPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutUserPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) PutUserPolicyWithContext(ctx aws.Context, input *PutUserPolicyInput, opts ...request.Option) (*PutUserPolicyOutput, error) { + req, out := c.PutUserPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemoveClientIDFromOpenIDConnectProvider = "RemoveClientIDFromOpenIDConnectProvider" + +// RemoveClientIDFromOpenIDConnectProviderRequest generates a "aws/request.Request" representing the +// client's request for the RemoveClientIDFromOpenIDConnectProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveClientIDFromOpenIDConnectProvider for more information on using the RemoveClientIDFromOpenIDConnectProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveClientIDFromOpenIDConnectProviderRequest method. +// req, resp := client.RemoveClientIDFromOpenIDConnectProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProvider +func (c *IAM) RemoveClientIDFromOpenIDConnectProviderRequest(input *RemoveClientIDFromOpenIDConnectProviderInput) (req *request.Request, output *RemoveClientIDFromOpenIDConnectProviderOutput) { + op := &request.Operation{ + Name: opRemoveClientIDFromOpenIDConnectProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveClientIDFromOpenIDConnectProviderInput{} + } + + output = &RemoveClientIDFromOpenIDConnectProviderOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemoveClientIDFromOpenIDConnectProvider API operation for AWS Identity and Access Management. +// +// Removes the specified client ID (also known as audience) from the list of +// client IDs registered for the specified IAM OpenID Connect (OIDC) provider +// resource object. +// +// This operation is idempotent; it does not fail or return an error if you +// try to remove a client ID that does not exist. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation RemoveClientIDFromOpenIDConnectProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveClientIDFromOpenIDConnectProvider +func (c *IAM) RemoveClientIDFromOpenIDConnectProvider(input *RemoveClientIDFromOpenIDConnectProviderInput) (*RemoveClientIDFromOpenIDConnectProviderOutput, error) { + req, out := c.RemoveClientIDFromOpenIDConnectProviderRequest(input) + return out, req.Send() +} + +// RemoveClientIDFromOpenIDConnectProviderWithContext is the same as RemoveClientIDFromOpenIDConnectProvider with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveClientIDFromOpenIDConnectProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) RemoveClientIDFromOpenIDConnectProviderWithContext(ctx aws.Context, input *RemoveClientIDFromOpenIDConnectProviderInput, opts ...request.Option) (*RemoveClientIDFromOpenIDConnectProviderOutput, error) { + req, out := c.RemoveClientIDFromOpenIDConnectProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemoveRoleFromInstanceProfile = "RemoveRoleFromInstanceProfile" + +// RemoveRoleFromInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the RemoveRoleFromInstanceProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveRoleFromInstanceProfile for more information on using the RemoveRoleFromInstanceProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveRoleFromInstanceProfileRequest method. +// req, resp := client.RemoveRoleFromInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfile +func (c *IAM) RemoveRoleFromInstanceProfileRequest(input *RemoveRoleFromInstanceProfileInput) (req *request.Request, output *RemoveRoleFromInstanceProfileOutput) { + op := &request.Operation{ + Name: opRemoveRoleFromInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveRoleFromInstanceProfileInput{} + } + + output = &RemoveRoleFromInstanceProfileOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemoveRoleFromInstanceProfile API operation for AWS Identity and Access Management. +// +// Removes the specified IAM role from the specified EC2 instance profile. +// +// Make sure that you do not have any Amazon EC2 instances running with the +// role you are about to remove from the instance profile. Removing a role from +// an instance profile that is associated with a running instance might break +// any applications running on the instance. +// +// For more information about IAM roles, go to Working with Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). +// For more information about instance profiles, go to About Instance Profiles +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.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 AWS Identity and Access Management's +// API operation RemoveRoleFromInstanceProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveRoleFromInstanceProfile +func (c *IAM) RemoveRoleFromInstanceProfile(input *RemoveRoleFromInstanceProfileInput) (*RemoveRoleFromInstanceProfileOutput, error) { + req, out := c.RemoveRoleFromInstanceProfileRequest(input) + return out, req.Send() +} + +// RemoveRoleFromInstanceProfileWithContext is the same as RemoveRoleFromInstanceProfile with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveRoleFromInstanceProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) RemoveRoleFromInstanceProfileWithContext(ctx aws.Context, input *RemoveRoleFromInstanceProfileInput, opts ...request.Option) (*RemoveRoleFromInstanceProfileOutput, error) { + req, out := c.RemoveRoleFromInstanceProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemoveUserFromGroup = "RemoveUserFromGroup" + +// RemoveUserFromGroupRequest generates a "aws/request.Request" representing the +// client's request for the RemoveUserFromGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveUserFromGroup for more information on using the RemoveUserFromGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveUserFromGroupRequest method. +// req, resp := client.RemoveUserFromGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroup +func (c *IAM) RemoveUserFromGroupRequest(input *RemoveUserFromGroupInput) (req *request.Request, output *RemoveUserFromGroupOutput) { + op := &request.Operation{ + Name: opRemoveUserFromGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveUserFromGroupInput{} + } + + output = &RemoveUserFromGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemoveUserFromGroup API operation for AWS Identity and Access Management. +// +// Removes the specified user from the specified group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation RemoveUserFromGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RemoveUserFromGroup +func (c *IAM) RemoveUserFromGroup(input *RemoveUserFromGroupInput) (*RemoveUserFromGroupOutput, error) { + req, out := c.RemoveUserFromGroupRequest(input) + return out, req.Send() +} + +// RemoveUserFromGroupWithContext is the same as RemoveUserFromGroup with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveUserFromGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) RemoveUserFromGroupWithContext(ctx aws.Context, input *RemoveUserFromGroupInput, opts ...request.Option) (*RemoveUserFromGroupOutput, error) { + req, out := c.RemoveUserFromGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResetServiceSpecificCredential = "ResetServiceSpecificCredential" + +// ResetServiceSpecificCredentialRequest generates a "aws/request.Request" representing the +// client's request for the ResetServiceSpecificCredential operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetServiceSpecificCredential for more information on using the ResetServiceSpecificCredential +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetServiceSpecificCredentialRequest method. +// req, resp := client.ResetServiceSpecificCredentialRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredential +func (c *IAM) ResetServiceSpecificCredentialRequest(input *ResetServiceSpecificCredentialInput) (req *request.Request, output *ResetServiceSpecificCredentialOutput) { + op := &request.Operation{ + Name: opResetServiceSpecificCredential, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ResetServiceSpecificCredentialInput{} + } + + output = &ResetServiceSpecificCredentialOutput{} + req = c.newRequest(op, input, output) + return +} + +// ResetServiceSpecificCredential API operation for AWS Identity and Access Management. +// +// Resets the password for a service-specific credential. The new password is +// AWS generated and cryptographically strong. It cannot be configured by the +// user. Resetting the password immediately invalidates the previous password +// associated with this user. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation ResetServiceSpecificCredential for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResetServiceSpecificCredential +func (c *IAM) ResetServiceSpecificCredential(input *ResetServiceSpecificCredentialInput) (*ResetServiceSpecificCredentialOutput, error) { + req, out := c.ResetServiceSpecificCredentialRequest(input) + return out, req.Send() +} + +// ResetServiceSpecificCredentialWithContext is the same as ResetServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See ResetServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ResetServiceSpecificCredentialWithContext(ctx aws.Context, input *ResetServiceSpecificCredentialInput, opts ...request.Option) (*ResetServiceSpecificCredentialOutput, error) { + req, out := c.ResetServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResyncMFADevice = "ResyncMFADevice" + +// ResyncMFADeviceRequest generates a "aws/request.Request" representing the +// client's request for the ResyncMFADevice operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResyncMFADevice for more information on using the ResyncMFADevice +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResyncMFADeviceRequest method. +// req, resp := client.ResyncMFADeviceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADevice +func (c *IAM) ResyncMFADeviceRequest(input *ResyncMFADeviceInput) (req *request.Request, output *ResyncMFADeviceOutput) { + op := &request.Operation{ + Name: opResyncMFADevice, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ResyncMFADeviceInput{} + } + + output = &ResyncMFADeviceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// ResyncMFADevice API operation for AWS Identity and Access Management. +// +// Synchronizes the specified MFA device with its IAM resource object on the +// AWS servers. +// +// For more information about creating and working with virtual MFA devices, +// go to Using a Virtual MFA Device (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation ResyncMFADevice for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidAuthenticationCodeException "InvalidAuthenticationCode" +// The request was rejected because the authentication code was not recognized. +// The error message describes the specific error. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ResyncMFADevice +func (c *IAM) ResyncMFADevice(input *ResyncMFADeviceInput) (*ResyncMFADeviceOutput, error) { + req, out := c.ResyncMFADeviceRequest(input) + return out, req.Send() +} + +// ResyncMFADeviceWithContext is the same as ResyncMFADevice with the addition of +// the ability to pass a context and additional request options. +// +// See ResyncMFADevice for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) ResyncMFADeviceWithContext(ctx aws.Context, input *ResyncMFADeviceInput, opts ...request.Option) (*ResyncMFADeviceOutput, error) { + req, out := c.ResyncMFADeviceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" + +// SetDefaultPolicyVersionRequest generates a "aws/request.Request" representing the +// client's request for the SetDefaultPolicyVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetDefaultPolicyVersion for more information on using the SetDefaultPolicyVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetDefaultPolicyVersionRequest method. +// req, resp := client.SetDefaultPolicyVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersion +func (c *IAM) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput) (req *request.Request, output *SetDefaultPolicyVersionOutput) { + op := &request.Operation{ + Name: opSetDefaultPolicyVersion, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetDefaultPolicyVersionInput{} + } + + output = &SetDefaultPolicyVersionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// SetDefaultPolicyVersion API operation for AWS Identity and Access Management. +// +// Sets the specified version of the specified policy as the policy's default +// (operative) version. +// +// This operation affects all users, groups, and roles that the policy is attached +// to. To list the users, groups, and roles that the policy is attached to, +// use the ListEntitiesForPolicy API. +// +// For information about managed policies, see Managed Policies and Inline Policies +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation SetDefaultPolicyVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SetDefaultPolicyVersion +func (c *IAM) SetDefaultPolicyVersion(input *SetDefaultPolicyVersionInput) (*SetDefaultPolicyVersionOutput, error) { + req, out := c.SetDefaultPolicyVersionRequest(input) + return out, req.Send() +} + +// SetDefaultPolicyVersionWithContext is the same as SetDefaultPolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See SetDefaultPolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) SetDefaultPolicyVersionWithContext(ctx aws.Context, input *SetDefaultPolicyVersionInput, opts ...request.Option) (*SetDefaultPolicyVersionOutput, error) { + req, out := c.SetDefaultPolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSimulateCustomPolicy = "SimulateCustomPolicy" + +// SimulateCustomPolicyRequest generates a "aws/request.Request" representing the +// client's request for the SimulateCustomPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SimulateCustomPolicy for more information on using the SimulateCustomPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SimulateCustomPolicyRequest method. +// req, resp := client.SimulateCustomPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulateCustomPolicy +func (c *IAM) SimulateCustomPolicyRequest(input *SimulateCustomPolicyInput) (req *request.Request, output *SimulatePolicyResponse) { + op := &request.Operation{ + Name: opSimulateCustomPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &SimulateCustomPolicyInput{} + } + + output = &SimulatePolicyResponse{} + req = c.newRequest(op, input, output) + return +} + +// SimulateCustomPolicy API operation for AWS Identity and Access Management. +// +// Simulate how a set of IAM policies and optionally a resource-based policy +// works with a list of API operations and AWS resources to determine the policies' +// effective permissions. The policies are provided as strings. +// +// The simulation does not perform the API operations; it only checks the authorization +// to determine if the simulated policies allow or deny the operations. +// +// If you want to simulate existing policies attached to an IAM user, group, +// or role, use SimulatePrincipalPolicy instead. +// +// Context keys are variables maintained by AWS and its services that provide +// details about the context of an API query request. You can use the Condition +// element of an IAM policy to evaluate context keys. To get the list of context +// keys that the policies require for correct simulation, use GetContextKeysForCustomPolicy. +// +// If the output is long, you can use MaxItems and Marker parameters to paginate +// the results. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation SimulateCustomPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodePolicyEvaluationException "PolicyEvaluation" +// The request failed because a provided policy could not be successfully evaluated. +// An additional detailed message indicates the source of the failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulateCustomPolicy +func (c *IAM) SimulateCustomPolicy(input *SimulateCustomPolicyInput) (*SimulatePolicyResponse, error) { + req, out := c.SimulateCustomPolicyRequest(input) + return out, req.Send() +} + +// SimulateCustomPolicyWithContext is the same as SimulateCustomPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SimulateCustomPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) SimulateCustomPolicyWithContext(ctx aws.Context, input *SimulateCustomPolicyInput, opts ...request.Option) (*SimulatePolicyResponse, error) { + req, out := c.SimulateCustomPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// SimulateCustomPolicyPages iterates over the pages of a SimulateCustomPolicy operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See SimulateCustomPolicy 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 SimulateCustomPolicy operation. +// pageNum := 0 +// err := client.SimulateCustomPolicyPages(params, +// func(page *SimulatePolicyResponse, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) SimulateCustomPolicyPages(input *SimulateCustomPolicyInput, fn func(*SimulatePolicyResponse, bool) bool) error { + return c.SimulateCustomPolicyPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SimulateCustomPolicyPagesWithContext same as SimulateCustomPolicyPages 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 *IAM) SimulateCustomPolicyPagesWithContext(ctx aws.Context, input *SimulateCustomPolicyInput, fn func(*SimulatePolicyResponse, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SimulateCustomPolicyInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SimulateCustomPolicyRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) + } + return p.Err() +} + +const opSimulatePrincipalPolicy = "SimulatePrincipalPolicy" + +// SimulatePrincipalPolicyRequest generates a "aws/request.Request" representing the +// client's request for the SimulatePrincipalPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SimulatePrincipalPolicy for more information on using the SimulatePrincipalPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SimulatePrincipalPolicyRequest method. +// req, resp := client.SimulatePrincipalPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePrincipalPolicy +func (c *IAM) SimulatePrincipalPolicyRequest(input *SimulatePrincipalPolicyInput) (req *request.Request, output *SimulatePolicyResponse) { + op := &request.Operation{ + Name: opSimulatePrincipalPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &SimulatePrincipalPolicyInput{} + } + + output = &SimulatePolicyResponse{} + req = c.newRequest(op, input, output) + return +} + +// SimulatePrincipalPolicy API operation for AWS Identity and Access Management. +// +// Simulate how a set of IAM policies attached to an IAM entity works with a +// list of API operations and AWS resources to determine the policies' effective +// permissions. The entity can be an IAM user, group, or role. If you specify +// a user, then the simulation also includes all of the policies that are attached +// to groups that the user belongs to. +// +// You can optionally include a list of one or more additional policies specified +// as strings to include in the simulation. If you want to simulate only policies +// specified as strings, use SimulateCustomPolicy instead. +// +// You can also optionally include one resource-based policy to be evaluated +// with each of the resources included in the simulation. +// +// The simulation does not perform the API operations, it only checks the authorization +// to determine if the simulated policies allow or deny the operations. +// +// Note: This API discloses information about the permissions granted to other +// users. If you do not want users to see other user's permissions, then consider +// allowing them to use SimulateCustomPolicy instead. +// +// Context keys are variables maintained by AWS and its services that provide +// details about the context of an API query request. You can use the Condition +// element of an IAM policy to evaluate context keys. To get the list of context +// keys that the policies require for correct simulation, use GetContextKeysForPrincipalPolicy. +// +// If the output is long, you can use the MaxItems and Marker parameters to +// paginate the results. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation SimulatePrincipalPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodePolicyEvaluationException "PolicyEvaluation" +// The request failed because a provided policy could not be successfully evaluated. +// An additional detailed message indicates the source of the failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/SimulatePrincipalPolicy +func (c *IAM) SimulatePrincipalPolicy(input *SimulatePrincipalPolicyInput) (*SimulatePolicyResponse, error) { + req, out := c.SimulatePrincipalPolicyRequest(input) + return out, req.Send() +} + +// SimulatePrincipalPolicyWithContext is the same as SimulatePrincipalPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SimulatePrincipalPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) SimulatePrincipalPolicyWithContext(ctx aws.Context, input *SimulatePrincipalPolicyInput, opts ...request.Option) (*SimulatePolicyResponse, error) { + req, out := c.SimulatePrincipalPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// SimulatePrincipalPolicyPages iterates over the pages of a SimulatePrincipalPolicy operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See SimulatePrincipalPolicy 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 SimulatePrincipalPolicy operation. +// pageNum := 0 +// err := client.SimulatePrincipalPolicyPages(params, +// func(page *SimulatePolicyResponse, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *IAM) SimulatePrincipalPolicyPages(input *SimulatePrincipalPolicyInput, fn func(*SimulatePolicyResponse, bool) bool) error { + return c.SimulatePrincipalPolicyPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SimulatePrincipalPolicyPagesWithContext same as SimulatePrincipalPolicyPages 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 *IAM) SimulatePrincipalPolicyPagesWithContext(ctx aws.Context, input *SimulatePrincipalPolicyInput, fn func(*SimulatePolicyResponse, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SimulatePrincipalPolicyInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SimulatePrincipalPolicyRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) + } + return p.Err() +} + +const opUpdateAccessKey = "UpdateAccessKey" + +// UpdateAccessKeyRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAccessKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAccessKey for more information on using the UpdateAccessKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAccessKeyRequest method. +// req, resp := client.UpdateAccessKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKey +func (c *IAM) UpdateAccessKeyRequest(input *UpdateAccessKeyInput) (req *request.Request, output *UpdateAccessKeyOutput) { + op := &request.Operation{ + Name: opUpdateAccessKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateAccessKeyInput{} + } + + output = &UpdateAccessKeyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateAccessKey API operation for AWS Identity and Access Management. +// +// Changes the status of the specified access key from Active to Inactive, or +// vice versa. This operation can be used to disable a user's key as part of +// a key rotation workflow. +// +// If the UserName field is not specified, the user name is determined implicitly +// based on the AWS access key ID used to sign the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials even if the AWS account has no associated +// users. +// +// For information about rotating keys, see Managing Keys and Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation UpdateAccessKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccessKey +func (c *IAM) UpdateAccessKey(input *UpdateAccessKeyInput) (*UpdateAccessKeyOutput, error) { + req, out := c.UpdateAccessKeyRequest(input) + return out, req.Send() +} + +// UpdateAccessKeyWithContext is the same as UpdateAccessKey with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAccessKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateAccessKeyWithContext(ctx aws.Context, input *UpdateAccessKeyInput, opts ...request.Option) (*UpdateAccessKeyOutput, error) { + req, out := c.UpdateAccessKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateAccountPasswordPolicy = "UpdateAccountPasswordPolicy" + +// UpdateAccountPasswordPolicyRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAccountPasswordPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAccountPasswordPolicy for more information on using the UpdateAccountPasswordPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAccountPasswordPolicyRequest method. +// req, resp := client.UpdateAccountPasswordPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicy +func (c *IAM) UpdateAccountPasswordPolicyRequest(input *UpdateAccountPasswordPolicyInput) (req *request.Request, output *UpdateAccountPasswordPolicyOutput) { + op := &request.Operation{ + Name: opUpdateAccountPasswordPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateAccountPasswordPolicyInput{} + } + + output = &UpdateAccountPasswordPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateAccountPasswordPolicy API operation for AWS Identity and Access Management. +// +// Updates the password policy settings for the AWS account. +// +// This operation does not support partial updates. No parameters are required, +// but if you do not specify a parameter, that parameter's value reverts to +// its default value. See the Request Parameters section for each parameter's +// default value. Also note that some parameters do not allow the default parameter +// to be explicitly set. Instead, to invoke the default value, do not include +// that parameter when you invoke the operation. +// +// For more information about using a password policy, see Managing an IAM Password +// Policy (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation UpdateAccountPasswordPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAccountPasswordPolicy +func (c *IAM) UpdateAccountPasswordPolicy(input *UpdateAccountPasswordPolicyInput) (*UpdateAccountPasswordPolicyOutput, error) { + req, out := c.UpdateAccountPasswordPolicyRequest(input) + return out, req.Send() +} + +// UpdateAccountPasswordPolicyWithContext is the same as UpdateAccountPasswordPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAccountPasswordPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateAccountPasswordPolicyWithContext(ctx aws.Context, input *UpdateAccountPasswordPolicyInput, opts ...request.Option) (*UpdateAccountPasswordPolicyOutput, error) { + req, out := c.UpdateAccountPasswordPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateAssumeRolePolicy = "UpdateAssumeRolePolicy" + +// UpdateAssumeRolePolicyRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAssumeRolePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAssumeRolePolicy for more information on using the UpdateAssumeRolePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAssumeRolePolicyRequest method. +// req, resp := client.UpdateAssumeRolePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicy +func (c *IAM) UpdateAssumeRolePolicyRequest(input *UpdateAssumeRolePolicyInput) (req *request.Request, output *UpdateAssumeRolePolicyOutput) { + op := &request.Operation{ + Name: opUpdateAssumeRolePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateAssumeRolePolicyInput{} + } + + output = &UpdateAssumeRolePolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateAssumeRolePolicy API operation for AWS Identity and Access Management. +// +// Updates the policy that grants an IAM entity permission to assume a role. +// This is typically referred to as the "role trust policy". For more information +// about roles, go to Using Roles to Delegate Permissions and Federate Identities +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.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 AWS Identity and Access Management's +// API operation UpdateAssumeRolePolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateAssumeRolePolicy +func (c *IAM) UpdateAssumeRolePolicy(input *UpdateAssumeRolePolicyInput) (*UpdateAssumeRolePolicyOutput, error) { + req, out := c.UpdateAssumeRolePolicyRequest(input) + return out, req.Send() +} + +// UpdateAssumeRolePolicyWithContext is the same as UpdateAssumeRolePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAssumeRolePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateAssumeRolePolicyWithContext(ctx aws.Context, input *UpdateAssumeRolePolicyInput, opts ...request.Option) (*UpdateAssumeRolePolicyOutput, error) { + req, out := c.UpdateAssumeRolePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateGroup = "UpdateGroup" + +// UpdateGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateGroup for more information on using the UpdateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateGroupRequest method. +// req, resp := client.UpdateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroup +func (c *IAM) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { + op := &request.Operation{ + Name: opUpdateGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateGroupInput{} + } + + output = &UpdateGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateGroup API operation for AWS Identity and Access Management. +// +// Updates the name and/or the path of the specified IAM group. +// +// You should understand the implications of changing a group's path or name. +// For more information, see Renaming Users and Groups (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_WorkingWithGroupsAndUsers.html) +// in the IAM User Guide. +// +// The person making the request (the principal), must have permission to change +// the role group with the old name and the new name. For example, to change +// the group named Managers to MGRs, the principal must have a policy that allows +// them to update both groups. If the principal has permission to update the +// Managers group, but not the MGRs group, then the update fails. For more information +// about permissions, see Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.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 AWS Identity and Access Management's +// API operation UpdateGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateGroup +func (c *IAM) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + return out, req.Send() +} + +// UpdateGroupWithContext is the same as UpdateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateGroupWithContext(ctx aws.Context, input *UpdateGroupInput, opts ...request.Option) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateLoginProfile = "UpdateLoginProfile" + +// UpdateLoginProfileRequest generates a "aws/request.Request" representing the +// client's request for the UpdateLoginProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateLoginProfile for more information on using the UpdateLoginProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateLoginProfileRequest method. +// req, resp := client.UpdateLoginProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfile +func (c *IAM) UpdateLoginProfileRequest(input *UpdateLoginProfileInput) (req *request.Request, output *UpdateLoginProfileOutput) { + op := &request.Operation{ + Name: opUpdateLoginProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateLoginProfileInput{} + } + + output = &UpdateLoginProfileOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateLoginProfile API operation for AWS Identity and Access Management. +// +// Changes the password for the specified IAM user. +// +// IAM users can change their own passwords by calling ChangePassword. For more +// information about modifying passwords, see Managing Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation UpdateLoginProfile for usage and error information. +// +// Returned Error Codes: +// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" +// The request was rejected because it referenced an entity that is temporarily +// unmodifiable, such as a user name that was deleted and then recreated. The +// error indicates that the request is likely to succeed if you try again after +// waiting several minutes. The error message describes the entity. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" +// The request was rejected because the provided password did not meet the requirements +// imposed by the account password policy. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateLoginProfile +func (c *IAM) UpdateLoginProfile(input *UpdateLoginProfileInput) (*UpdateLoginProfileOutput, error) { + req, out := c.UpdateLoginProfileRequest(input) + return out, req.Send() +} + +// UpdateLoginProfileWithContext is the same as UpdateLoginProfile with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateLoginProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateLoginProfileWithContext(ctx aws.Context, input *UpdateLoginProfileInput, opts ...request.Option) (*UpdateLoginProfileOutput, error) { + req, out := c.UpdateLoginProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateOpenIDConnectProviderThumbprint = "UpdateOpenIDConnectProviderThumbprint" + +// UpdateOpenIDConnectProviderThumbprintRequest generates a "aws/request.Request" representing the +// client's request for the UpdateOpenIDConnectProviderThumbprint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateOpenIDConnectProviderThumbprint for more information on using the UpdateOpenIDConnectProviderThumbprint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateOpenIDConnectProviderThumbprintRequest method. +// req, resp := client.UpdateOpenIDConnectProviderThumbprintRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprint +func (c *IAM) UpdateOpenIDConnectProviderThumbprintRequest(input *UpdateOpenIDConnectProviderThumbprintInput) (req *request.Request, output *UpdateOpenIDConnectProviderThumbprintOutput) { + op := &request.Operation{ + Name: opUpdateOpenIDConnectProviderThumbprint, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateOpenIDConnectProviderThumbprintInput{} + } + + output = &UpdateOpenIDConnectProviderThumbprintOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateOpenIDConnectProviderThumbprint API operation for AWS Identity and Access Management. +// +// Replaces the existing list of server certificate thumbprints associated with +// an OpenID Connect (OIDC) provider resource object with a new list of thumbprints. +// +// The list that you pass with this operation completely replaces the existing +// list of thumbprints. (The lists are not merged.) +// +// Typically, you need to update a thumbprint only when the identity provider's +// certificate changes, which occurs rarely. However, if the provider's certificate +// does change, any attempt to assume an IAM role that specifies the OIDC provider +// as a principal fails until the certificate thumbprint is updated. +// +// Because trust for the OIDC provider is derived from the provider's certificate +// and is validated by the thumbprint, it is best to limit access to the UpdateOpenIDConnectProviderThumbprint +// operation to highly privileged users. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation UpdateOpenIDConnectProviderThumbprint for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateOpenIDConnectProviderThumbprint +func (c *IAM) UpdateOpenIDConnectProviderThumbprint(input *UpdateOpenIDConnectProviderThumbprintInput) (*UpdateOpenIDConnectProviderThumbprintOutput, error) { + req, out := c.UpdateOpenIDConnectProviderThumbprintRequest(input) + return out, req.Send() +} + +// UpdateOpenIDConnectProviderThumbprintWithContext is the same as UpdateOpenIDConnectProviderThumbprint with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateOpenIDConnectProviderThumbprint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateOpenIDConnectProviderThumbprintWithContext(ctx aws.Context, input *UpdateOpenIDConnectProviderThumbprintInput, opts ...request.Option) (*UpdateOpenIDConnectProviderThumbprintOutput, error) { + req, out := c.UpdateOpenIDConnectProviderThumbprintRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRole = "UpdateRole" + +// UpdateRoleRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRole for more information on using the UpdateRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRoleRequest method. +// req, resp := client.UpdateRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateRole +func (c *IAM) UpdateRoleRequest(input *UpdateRoleInput) (req *request.Request, output *UpdateRoleOutput) { + op := &request.Operation{ + Name: opUpdateRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateRoleInput{} + } + + output = &UpdateRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateRole API operation for AWS Identity and Access Management. +// +// Updates the description or maximum session duration setting of a role. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation UpdateRole for usage and error information. +// +// Returned Error Codes: +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateRole +func (c *IAM) UpdateRole(input *UpdateRoleInput) (*UpdateRoleOutput, error) { + req, out := c.UpdateRoleRequest(input) + return out, req.Send() +} + +// UpdateRoleWithContext is the same as UpdateRole with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateRoleWithContext(ctx aws.Context, input *UpdateRoleInput, opts ...request.Option) (*UpdateRoleOutput, error) { + req, out := c.UpdateRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRoleDescription = "UpdateRoleDescription" + +// UpdateRoleDescriptionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRoleDescription operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRoleDescription for more information on using the UpdateRoleDescription +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRoleDescriptionRequest method. +// req, resp := client.UpdateRoleDescriptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateRoleDescription +func (c *IAM) UpdateRoleDescriptionRequest(input *UpdateRoleDescriptionInput) (req *request.Request, output *UpdateRoleDescriptionOutput) { + op := &request.Operation{ + Name: opUpdateRoleDescription, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateRoleDescriptionInput{} + } + + output = &UpdateRoleDescriptionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateRoleDescription API operation for AWS Identity and Access Management. +// +// Use instead. +// +// Modifies only the description of a role. This operation performs the same +// function as the Description parameter in the UpdateRole 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 AWS Identity and Access Management's +// API operation UpdateRoleDescription for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" +// The request was rejected because only the service that depends on the service-linked +// role can modify or delete the role on your behalf. The error message includes +// the name of the service that depends on this service-linked role. You must +// request the change through that service. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateRoleDescription +func (c *IAM) UpdateRoleDescription(input *UpdateRoleDescriptionInput) (*UpdateRoleDescriptionOutput, error) { + req, out := c.UpdateRoleDescriptionRequest(input) + return out, req.Send() +} + +// UpdateRoleDescriptionWithContext is the same as UpdateRoleDescription with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRoleDescription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateRoleDescriptionWithContext(ctx aws.Context, input *UpdateRoleDescriptionInput, opts ...request.Option) (*UpdateRoleDescriptionOutput, error) { + req, out := c.UpdateRoleDescriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSAMLProvider = "UpdateSAMLProvider" + +// UpdateSAMLProviderRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSAMLProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSAMLProvider for more information on using the UpdateSAMLProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSAMLProviderRequest method. +// req, resp := client.UpdateSAMLProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProvider +func (c *IAM) UpdateSAMLProviderRequest(input *UpdateSAMLProviderInput) (req *request.Request, output *UpdateSAMLProviderOutput) { + op := &request.Operation{ + Name: opUpdateSAMLProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateSAMLProviderInput{} + } + + output = &UpdateSAMLProviderOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSAMLProvider API operation for AWS Identity and Access Management. +// +// Updates the metadata document for an existing SAML provider resource object. +// +// This operation requires Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.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 AWS Identity and Access Management's +// API operation UpdateSAMLProvider for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidInputException "InvalidInput" +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSAMLProvider +func (c *IAM) UpdateSAMLProvider(input *UpdateSAMLProviderInput) (*UpdateSAMLProviderOutput, error) { + req, out := c.UpdateSAMLProviderRequest(input) + return out, req.Send() +} + +// UpdateSAMLProviderWithContext is the same as UpdateSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateSAMLProviderWithContext(ctx aws.Context, input *UpdateSAMLProviderInput, opts ...request.Option) (*UpdateSAMLProviderOutput, error) { + req, out := c.UpdateSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSSHPublicKey = "UpdateSSHPublicKey" + +// UpdateSSHPublicKeyRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSSHPublicKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSSHPublicKey for more information on using the UpdateSSHPublicKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSSHPublicKeyRequest method. +// req, resp := client.UpdateSSHPublicKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKey +func (c *IAM) UpdateSSHPublicKeyRequest(input *UpdateSSHPublicKeyInput) (req *request.Request, output *UpdateSSHPublicKeyOutput) { + op := &request.Operation{ + Name: opUpdateSSHPublicKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateSSHPublicKeyInput{} + } + + output = &UpdateSSHPublicKeyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateSSHPublicKey API operation for AWS Identity and Access Management. +// +// Sets the status of an IAM user's SSH public key to active or inactive. SSH +// public keys that are inactive cannot be used for authentication. This operation +// can be used to disable a user's SSH public key as part of a key rotation +// work flow. +// +// The SSH public key affected by this operation is used only for authenticating +// the associated IAM user to an AWS CodeCommit repository. For more information +// about using SSH keys to authenticate to an AWS CodeCommit repository, see +// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) +// in the AWS CodeCommit 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 AWS Identity and Access Management's +// API operation UpdateSSHPublicKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSSHPublicKey +func (c *IAM) UpdateSSHPublicKey(input *UpdateSSHPublicKeyInput) (*UpdateSSHPublicKeyOutput, error) { + req, out := c.UpdateSSHPublicKeyRequest(input) + return out, req.Send() +} + +// UpdateSSHPublicKeyWithContext is the same as UpdateSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateSSHPublicKeyWithContext(ctx aws.Context, input *UpdateSSHPublicKeyInput, opts ...request.Option) (*UpdateSSHPublicKeyOutput, error) { + req, out := c.UpdateSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateServerCertificate = "UpdateServerCertificate" + +// UpdateServerCertificateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateServerCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateServerCertificate for more information on using the UpdateServerCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateServerCertificateRequest method. +// req, resp := client.UpdateServerCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificate +func (c *IAM) UpdateServerCertificateRequest(input *UpdateServerCertificateInput) (req *request.Request, output *UpdateServerCertificateOutput) { + op := &request.Operation{ + Name: opUpdateServerCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateServerCertificateInput{} + } + + output = &UpdateServerCertificateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateServerCertificate API operation for AWS Identity and Access Management. +// +// Updates the name and/or the path of the specified server certificate stored +// in IAM. +// +// For more information about working with server certificates, see Working +// with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) +// in the IAM User Guide. This topic also includes a list of AWS services that +// can use the server certificates that you manage with IAM. +// +// You should understand the implications of changing a server certificate's +// path or name. For more information, see Renaming a Server Certificate (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs_manage.html#RenamingServerCerts) +// in the IAM User Guide. +// +// The person making the request (the principal), must have permission to change +// the server certificate with the old name and the new name. For example, to +// change the certificate named ProductionCert to ProdCert, the principal must +// have a policy that allows them to update both certificates. If the principal +// has permission to update the ProductionCert group, but not the ProdCert certificate, +// then the update fails. For more information about permissions, see Access +// Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation UpdateServerCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServerCertificate +func (c *IAM) UpdateServerCertificate(input *UpdateServerCertificateInput) (*UpdateServerCertificateOutput, error) { + req, out := c.UpdateServerCertificateRequest(input) + return out, req.Send() +} + +// UpdateServerCertificateWithContext is the same as UpdateServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateServerCertificateWithContext(ctx aws.Context, input *UpdateServerCertificateInput, opts ...request.Option) (*UpdateServerCertificateOutput, error) { + req, out := c.UpdateServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateServiceSpecificCredential = "UpdateServiceSpecificCredential" + +// UpdateServiceSpecificCredentialRequest generates a "aws/request.Request" representing the +// client's request for the UpdateServiceSpecificCredential operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateServiceSpecificCredential for more information on using the UpdateServiceSpecificCredential +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateServiceSpecificCredentialRequest method. +// req, resp := client.UpdateServiceSpecificCredentialRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredential +func (c *IAM) UpdateServiceSpecificCredentialRequest(input *UpdateServiceSpecificCredentialInput) (req *request.Request, output *UpdateServiceSpecificCredentialOutput) { + op := &request.Operation{ + Name: opUpdateServiceSpecificCredential, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateServiceSpecificCredentialInput{} + } + + output = &UpdateServiceSpecificCredentialOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateServiceSpecificCredential API operation for AWS Identity and Access Management. +// +// Sets the status of a service-specific credential to Active or Inactive. Service-specific +// credentials that are inactive cannot be used for authentication to the service. +// This operation can be used to disable a user's service-specific credential +// as part of a credential rotation work flow. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation UpdateServiceSpecificCredential for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateServiceSpecificCredential +func (c *IAM) UpdateServiceSpecificCredential(input *UpdateServiceSpecificCredentialInput) (*UpdateServiceSpecificCredentialOutput, error) { + req, out := c.UpdateServiceSpecificCredentialRequest(input) + return out, req.Send() +} + +// UpdateServiceSpecificCredentialWithContext is the same as UpdateServiceSpecificCredential with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateServiceSpecificCredential for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateServiceSpecificCredentialWithContext(ctx aws.Context, input *UpdateServiceSpecificCredentialInput, opts ...request.Option) (*UpdateServiceSpecificCredentialOutput, error) { + req, out := c.UpdateServiceSpecificCredentialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSigningCertificate = "UpdateSigningCertificate" + +// UpdateSigningCertificateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSigningCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSigningCertificate for more information on using the UpdateSigningCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSigningCertificateRequest method. +// req, resp := client.UpdateSigningCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificate +func (c *IAM) UpdateSigningCertificateRequest(input *UpdateSigningCertificateInput) (req *request.Request, output *UpdateSigningCertificateOutput) { + op := &request.Operation{ + Name: opUpdateSigningCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateSigningCertificateInput{} + } + + output = &UpdateSigningCertificateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateSigningCertificate API operation for AWS Identity and Access Management. +// +// Changes the status of the specified user signing certificate from active +// to disabled, or vice versa. This operation can be used to disable an IAM +// user's signing certificate as part of a certificate rotation work flow. +// +// If the UserName field is not specified, the user name is determined implicitly +// based on the AWS access key ID used to sign the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials even if the AWS account has no associated +// users. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Identity and Access Management's +// API operation UpdateSigningCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateSigningCertificate +func (c *IAM) UpdateSigningCertificate(input *UpdateSigningCertificateInput) (*UpdateSigningCertificateOutput, error) { + req, out := c.UpdateSigningCertificateRequest(input) + return out, req.Send() +} + +// UpdateSigningCertificateWithContext is the same as UpdateSigningCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSigningCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateSigningCertificateWithContext(ctx aws.Context, input *UpdateSigningCertificateInput, opts ...request.Option) (*UpdateSigningCertificateOutput, error) { + req, out := c.UpdateSigningCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateUser = "UpdateUser" + +// UpdateUserRequest generates a "aws/request.Request" representing the +// client's request for the UpdateUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateUser for more information on using the UpdateUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateUserRequest method. +// req, resp := client.UpdateUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUser +func (c *IAM) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, output *UpdateUserOutput) { + op := &request.Operation{ + Name: opUpdateUser, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateUserInput{} + } + + output = &UpdateUserOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateUser API operation for AWS Identity and Access Management. +// +// Updates the name and/or the path of the specified IAM user. +// +// You should understand the implications of changing an IAM user's path or +// name. For more information, see Renaming an IAM User (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_manage.html#id_users_renaming) +// and Renaming an IAM Group (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups_manage_rename.html) +// in the IAM User Guide. +// +// To change a user name, the requester must have appropriate permissions on +// both the source object and the target object. For example, to change Bob +// to Robert, the entity making the request must have permission on Bob and +// Robert, or must have permission on all (*). For more information about permissions, +// see Permissions and Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PermissionsAndPolicies.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 AWS Identity and Access Management's +// API operation UpdateUser for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" +// The request was rejected because it referenced an entity that is temporarily +// unmodifiable, such as a user name that was deleted and then recreated. The +// error indicates that the request is likely to succeed if you try again after +// waiting several minutes. The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UpdateUser +func (c *IAM) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { + req, out := c.UpdateUserRequest(input) + return out, req.Send() +} + +// UpdateUserWithContext is the same as UpdateUser with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateUserWithContext(ctx aws.Context, input *UpdateUserInput, opts ...request.Option) (*UpdateUserOutput, error) { + req, out := c.UpdateUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUploadSSHPublicKey = "UploadSSHPublicKey" + +// UploadSSHPublicKeyRequest generates a "aws/request.Request" representing the +// client's request for the UploadSSHPublicKey operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UploadSSHPublicKey for more information on using the UploadSSHPublicKey +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UploadSSHPublicKeyRequest method. +// req, resp := client.UploadSSHPublicKeyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKey +func (c *IAM) UploadSSHPublicKeyRequest(input *UploadSSHPublicKeyInput) (req *request.Request, output *UploadSSHPublicKeyOutput) { + op := &request.Operation{ + Name: opUploadSSHPublicKey, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UploadSSHPublicKeyInput{} + } + + output = &UploadSSHPublicKeyOutput{} + req = c.newRequest(op, input, output) + return +} + +// UploadSSHPublicKey API operation for AWS Identity and Access Management. +// +// Uploads an SSH public key and associates it with the specified IAM user. +// +// The SSH public key uploaded by this operation can be used only for authenticating +// the associated IAM user to an AWS CodeCommit repository. For more information +// about using SSH keys to authenticate to an AWS CodeCommit repository, see +// Set up AWS CodeCommit for SSH Connections (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) +// in the AWS CodeCommit 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 AWS Identity and Access Management's +// API operation UploadSSHPublicKey for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeInvalidPublicKeyException "InvalidPublicKey" +// The request was rejected because the public key is malformed or otherwise +// invalid. +// +// * ErrCodeDuplicateSSHPublicKeyException "DuplicateSSHPublicKey" +// The request was rejected because the SSH public key is already associated +// with the specified IAM user. +// +// * ErrCodeUnrecognizedPublicKeyEncodingException "UnrecognizedPublicKeyEncoding" +// The request was rejected because the public key encoding format is unsupported +// or unrecognized. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSSHPublicKey +func (c *IAM) UploadSSHPublicKey(input *UploadSSHPublicKeyInput) (*UploadSSHPublicKeyOutput, error) { + req, out := c.UploadSSHPublicKeyRequest(input) + return out, req.Send() +} + +// UploadSSHPublicKeyWithContext is the same as UploadSSHPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See UploadSSHPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UploadSSHPublicKeyWithContext(ctx aws.Context, input *UploadSSHPublicKeyInput, opts ...request.Option) (*UploadSSHPublicKeyOutput, error) { + req, out := c.UploadSSHPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUploadServerCertificate = "UploadServerCertificate" + +// UploadServerCertificateRequest generates a "aws/request.Request" representing the +// client's request for the UploadServerCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UploadServerCertificate for more information on using the UploadServerCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UploadServerCertificateRequest method. +// req, resp := client.UploadServerCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificate +func (c *IAM) UploadServerCertificateRequest(input *UploadServerCertificateInput) (req *request.Request, output *UploadServerCertificateOutput) { + op := &request.Operation{ + Name: opUploadServerCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UploadServerCertificateInput{} + } + + output = &UploadServerCertificateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UploadServerCertificate API operation for AWS Identity and Access Management. +// +// Uploads a server certificate entity for the AWS account. The server certificate +// entity includes a public key certificate, a private key, and an optional +// certificate chain, which should all be PEM-encoded. +// +// We recommend that you use AWS Certificate Manager (https://aws.amazon.com/certificate-manager/) +// to provision, manage, and deploy your server certificates. With ACM you can +// request a certificate, deploy it to AWS resources, and let ACM handle certificate +// renewals for you. Certificates provided by ACM are free. For more information +// about using ACM, see the AWS Certificate Manager User Guide (http://docs.aws.amazon.com/acm/latest/userguide/). +// +// For more information about working with server certificates, see Working +// with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) +// in the IAM User Guide. This topic includes a list of AWS services that can +// use the server certificates that you manage with IAM. +// +// For information about the number of server certificates you can upload, see +// Limitations on IAM Entities and Objects (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html) +// in the IAM User Guide. +// +// Because the body of the public key certificate, private key, and the certificate +// chain can be large, you should use POST rather than GET when calling UploadServerCertificate. +// For information about setting up signatures and authorization through the +// API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) +// in the AWS General Reference. For general information about using the Query +// API with IAM, go to Calling the API by Making HTTP Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/programming.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation UploadServerCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeMalformedCertificateException "MalformedCertificate" +// The request was rejected because the certificate was malformed or expired. +// The error message describes the specific error. +// +// * ErrCodeKeyPairMismatchException "KeyPairMismatch" +// The request was rejected because the public key certificate and the private +// key do not match. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadServerCertificate +func (c *IAM) UploadServerCertificate(input *UploadServerCertificateInput) (*UploadServerCertificateOutput, error) { + req, out := c.UploadServerCertificateRequest(input) + return out, req.Send() +} + +// UploadServerCertificateWithContext is the same as UploadServerCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UploadServerCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UploadServerCertificateWithContext(ctx aws.Context, input *UploadServerCertificateInput, opts ...request.Option) (*UploadServerCertificateOutput, error) { + req, out := c.UploadServerCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUploadSigningCertificate = "UploadSigningCertificate" + +// UploadSigningCertificateRequest generates a "aws/request.Request" representing the +// client's request for the UploadSigningCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UploadSigningCertificate for more information on using the UploadSigningCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UploadSigningCertificateRequest method. +// req, resp := client.UploadSigningCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificate +func (c *IAM) UploadSigningCertificateRequest(input *UploadSigningCertificateInput) (req *request.Request, output *UploadSigningCertificateOutput) { + op := &request.Operation{ + Name: opUploadSigningCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UploadSigningCertificateInput{} + } + + output = &UploadSigningCertificateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UploadSigningCertificate API operation for AWS Identity and Access Management. +// +// Uploads an X.509 signing certificate and associates it with the specified +// IAM user. Some AWS services use X.509 signing certificates to validate requests +// that are signed with a corresponding private key. When you upload the certificate, +// its default status is Active. +// +// If the UserName field is not specified, the IAM user name is determined implicitly +// based on the AWS access key ID used to sign the request. Because this operation +// works for access keys under the AWS account, you can use this operation to +// manage AWS account root user credentials even if the AWS account has no associated +// users. +// +// Because the body of an X.509 certificate can be large, you should use POST +// rather than GET when calling UploadSigningCertificate. For information about +// setting up signatures and authorization through the API, go to Signing AWS +// API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) +// in the AWS General Reference. For general information about using the Query +// API with IAM, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in the IAM 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 AWS Identity and Access Management's +// API operation UploadSigningCertificate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error message describes the limit exceeded. +// +// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" +// The request was rejected because it attempted to create a resource that already +// exists. +// +// * ErrCodeMalformedCertificateException "MalformedCertificate" +// The request was rejected because the certificate was malformed or expired. +// The error message describes the specific error. +// +// * ErrCodeInvalidCertificateException "InvalidCertificate" +// The request was rejected because the certificate is invalid. +// +// * ErrCodeDuplicateCertificateException "DuplicateCertificate" +// The request was rejected because the same certificate is associated with +// an IAM user in the account. +// +// * ErrCodeNoSuchEntityException "NoSuchEntity" +// The request was rejected because it referenced an entity that does not exist. +// The error message describes the entity. +// +// * ErrCodeServiceFailureException "ServiceFailure" +// The request processing has failed because of an unknown error, exception +// or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/UploadSigningCertificate +func (c *IAM) UploadSigningCertificate(input *UploadSigningCertificateInput) (*UploadSigningCertificateOutput, error) { + req, out := c.UploadSigningCertificateRequest(input) + return out, req.Send() +} + +// UploadSigningCertificateWithContext is the same as UploadSigningCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See UploadSigningCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UploadSigningCertificateWithContext(ctx aws.Context, input *UploadSigningCertificateInput, opts ...request.Option) (*UploadSigningCertificateOutput, error) { + req, out := c.UploadSigningCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Contains information about an AWS access key. +// +// This data type is used as a response element in the CreateAccessKey and ListAccessKeys +// operations. +// +// The SecretAccessKey value is returned only in response to CreateAccessKey. +// You can get a secret access key only when you first create an access key; +// you cannot recover the secret access key later. If you lose a secret access +// key, you must create a new access key. +type AccessKey struct { + _ struct{} `type:"structure"` + + // The ID for this access key. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` + + // The date when the access key was created. + CreateDate *time.Time `type:"timestamp"` + + // The secret key used to sign requests. + // + // SecretAccessKey is a required field + SecretAccessKey *string `type:"string" required:"true"` + + // The status of the access key. Active means that the key is valid for API + // calls, while Inactive means it is not. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the IAM user that the access key is associated with. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AccessKey) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessKey) GoString() string { + return s.String() +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *AccessKey) SetAccessKeyId(v string) *AccessKey { + s.AccessKeyId = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *AccessKey) SetCreateDate(v time.Time) *AccessKey { + s.CreateDate = &v + return s +} + +// SetSecretAccessKey sets the SecretAccessKey field's value. +func (s *AccessKey) SetSecretAccessKey(v string) *AccessKey { + s.SecretAccessKey = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AccessKey) SetStatus(v string) *AccessKey { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *AccessKey) SetUserName(v string) *AccessKey { + s.UserName = &v + return s +} + +// Contains information about the last time an AWS access key was used. +// +// This data type is used as a response element in the GetAccessKeyLastUsed +// operation. +type AccessKeyLastUsed struct { + _ struct{} `type:"structure"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the access key was most recently used. This field is null in the following + // situations: + // + // * The user does not have an access key. + // + // * An access key exists but has never been used, at least not since IAM + // started tracking this information on April 22nd, 2015. + // + // * There is no sign-in data associated with the user + // + // LastUsedDate is a required field + LastUsedDate *time.Time `type:"timestamp" required:"true"` + + // The AWS region where this access key was most recently used. This field is + // displays "N/A" in the following situations: + // + // * The user does not have an access key. + // + // * An access key exists but has never been used, at least not since IAM + // started tracking this information on April 22nd, 2015. + // + // * There is no sign-in data associated with the user + // + // For more information about AWS regions, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html) + // in the Amazon Web Services General Reference. + // + // Region is a required field + Region *string `type:"string" required:"true"` + + // The name of the AWS service with which this access key was most recently + // used. This field displays "N/A" in the following situations: + // + // * The user does not have an access key. + // + // * An access key exists but has never been used, at least not since IAM + // started tracking this information on April 22nd, 2015. + // + // * There is no sign-in data associated with the user + // + // ServiceName is a required field + ServiceName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AccessKeyLastUsed) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessKeyLastUsed) GoString() string { + return s.String() +} + +// SetLastUsedDate sets the LastUsedDate field's value. +func (s *AccessKeyLastUsed) SetLastUsedDate(v time.Time) *AccessKeyLastUsed { + s.LastUsedDate = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *AccessKeyLastUsed) SetRegion(v string) *AccessKeyLastUsed { + s.Region = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *AccessKeyLastUsed) SetServiceName(v string) *AccessKeyLastUsed { + s.ServiceName = &v + return s +} + +// Contains information about an AWS access key, without its secret key. +// +// This data type is used as a response element in the ListAccessKeys operation. +type AccessKeyMetadata struct { + _ struct{} `type:"structure"` + + // The ID for this access key. + AccessKeyId *string `min:"16" type:"string"` + + // The date when the access key was created. + CreateDate *time.Time `type:"timestamp"` + + // The status of the access key. Active means the key is valid for API calls; + // Inactive means it is not. + Status *string `type:"string" enum:"statusType"` + + // The name of the IAM user that the key is associated with. + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AccessKeyMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessKeyMetadata) GoString() string { + return s.String() +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *AccessKeyMetadata) SetAccessKeyId(v string) *AccessKeyMetadata { + s.AccessKeyId = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *AccessKeyMetadata) SetCreateDate(v time.Time) *AccessKeyMetadata { + s.CreateDate = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AccessKeyMetadata) SetStatus(v string) *AccessKeyMetadata { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *AccessKeyMetadata) SetUserName(v string) *AccessKeyMetadata { + s.UserName = &v + return s +} + +type AddClientIDToOpenIDConnectProviderInput struct { + _ struct{} `type:"structure"` + + // The client ID (also known as audience) to add to the IAM OpenID Connect provider + // resource. + // + // ClientID is a required field + ClientID *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM OpenID Connect (OIDC) provider + // resource to add the client ID to. You can get a list of OIDC provider ARNs + // by using the ListOpenIDConnectProviders operation. + // + // OpenIDConnectProviderArn is a required field + OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s AddClientIDToOpenIDConnectProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddClientIDToOpenIDConnectProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddClientIDToOpenIDConnectProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddClientIDToOpenIDConnectProviderInput"} + if s.ClientID == nil { + invalidParams.Add(request.NewErrParamRequired("ClientID")) + } + if s.ClientID != nil && len(*s.ClientID) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientID", 1)) + } + if s.OpenIDConnectProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) + } + if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientID sets the ClientID field's value. +func (s *AddClientIDToOpenIDConnectProviderInput) SetClientID(v string) *AddClientIDToOpenIDConnectProviderInput { + s.ClientID = &v + return s +} + +// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. +func (s *AddClientIDToOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *AddClientIDToOpenIDConnectProviderInput { + s.OpenIDConnectProviderArn = &v + return s +} + +type AddClientIDToOpenIDConnectProviderOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddClientIDToOpenIDConnectProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddClientIDToOpenIDConnectProviderOutput) GoString() string { + return s.String() +} + +type AddRoleToInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the instance profile to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // InstanceProfileName is a required field + InstanceProfileName *string `min:"1" type:"string" required:"true"` + + // The name of the role to add. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AddRoleToInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddRoleToInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddRoleToInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddRoleToInstanceProfileInput"} + if s.InstanceProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) + } + if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *AddRoleToInstanceProfileInput) SetInstanceProfileName(v string) *AddRoleToInstanceProfileInput { + s.InstanceProfileName = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *AddRoleToInstanceProfileInput) SetRoleName(v string) *AddRoleToInstanceProfileInput { + s.RoleName = &v + return s +} + +type AddRoleToInstanceProfileOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddRoleToInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddRoleToInstanceProfileOutput) GoString() string { + return s.String() +} + +type AddUserToGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the group to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The name of the user to add. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AddUserToGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddUserToGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddUserToGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddUserToGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *AddUserToGroupInput) SetGroupName(v string) *AddUserToGroupInput { + s.GroupName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *AddUserToGroupInput) SetUserName(v string) *AddUserToGroupInput { + s.UserName = &v + return s +} + +type AddUserToGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddUserToGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddUserToGroupOutput) GoString() string { + return s.String() +} + +type AttachGroupPolicyInput struct { + _ struct{} `type:"structure"` + + // The name (friendly name, not ARN) of the group to attach the policy to. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to attach. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s AttachGroupPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachGroupPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachGroupPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachGroupPolicyInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *AttachGroupPolicyInput) SetGroupName(v string) *AttachGroupPolicyInput { + s.GroupName = &v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *AttachGroupPolicyInput) SetPolicyArn(v string) *AttachGroupPolicyInput { + s.PolicyArn = &v + return s +} + +type AttachGroupPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachGroupPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachGroupPolicyOutput) GoString() string { + return s.String() +} + +type AttachRolePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to attach. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The name (friendly name, not ARN) of the role to attach the policy to. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AttachRolePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachRolePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachRolePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachRolePolicyInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *AttachRolePolicyInput) SetPolicyArn(v string) *AttachRolePolicyInput { + s.PolicyArn = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *AttachRolePolicyInput) SetRoleName(v string) *AttachRolePolicyInput { + s.RoleName = &v + return s +} + +type AttachRolePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachRolePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachRolePolicyOutput) GoString() string { + return s.String() +} + +type AttachUserPolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to attach. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The name (friendly name, not ARN) of the IAM user to attach the policy to. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AttachUserPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachUserPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachUserPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachUserPolicyInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *AttachUserPolicyInput) SetPolicyArn(v string) *AttachUserPolicyInput { + s.PolicyArn = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *AttachUserPolicyInput) SetUserName(v string) *AttachUserPolicyInput { + s.UserName = &v + return s +} + +type AttachUserPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachUserPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachUserPolicyOutput) GoString() string { + return s.String() +} + +// Contains information about an attached permissions boundary. +// +// An attached permissions boundary is a managed policy that has been attached +// to a user or role to set the permissions boundary. +// +// For more information about permissions boundaries, see Permissions Boundaries +// for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) +// in the IAM User Guide. +type AttachedPermissionsBoundary struct { + _ struct{} `type:"structure"` + + // The ARN of the policy used to set the permissions boundary for the user or + // role. + PermissionsBoundaryArn *string `min:"20" type:"string"` + + // The permissions boundary usage type that indicates what type of IAM resource + // is used as the permissions boundary for an entity. This data type can only + // have a value of Policy. + PermissionsBoundaryType *string `type:"string" enum:"PermissionsBoundaryAttachmentType"` +} + +// String returns the string representation +func (s AttachedPermissionsBoundary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachedPermissionsBoundary) GoString() string { + return s.String() +} + +// SetPermissionsBoundaryArn sets the PermissionsBoundaryArn field's value. +func (s *AttachedPermissionsBoundary) SetPermissionsBoundaryArn(v string) *AttachedPermissionsBoundary { + s.PermissionsBoundaryArn = &v + return s +} + +// SetPermissionsBoundaryType sets the PermissionsBoundaryType field's value. +func (s *AttachedPermissionsBoundary) SetPermissionsBoundaryType(v string) *AttachedPermissionsBoundary { + s.PermissionsBoundaryType = &v + return s +} + +// Contains information about an attached policy. +// +// An attached policy is a managed policy that has been attached to a user, +// group, or role. This data type is used as a response element in the ListAttachedGroupPolicies, +// ListAttachedRolePolicies, ListAttachedUserPolicies, and GetAccountAuthorizationDetails +// operations. +// +// For more information about managed policies, refer to Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type AttachedPolicy struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + PolicyArn *string `min:"20" type:"string"` + + // The friendly name of the attached policy. + PolicyName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AttachedPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachedPolicy) GoString() string { + return s.String() +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *AttachedPolicy) SetPolicyArn(v string) *AttachedPolicy { + s.PolicyArn = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *AttachedPolicy) SetPolicyName(v string) *AttachedPolicy { + s.PolicyName = &v + return s +} + +type ChangePasswordInput struct { + _ struct{} `type:"structure"` + + // The new password. The new password must conform to the AWS account's password + // policy, if one exists. + // + // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate + // this parameter is a string of characters. That string can include almost + // any printable ASCII character from the space (\u0020) through the end of + // the ASCII character range (\u00FF). You can also include the tab (\u0009), + // line feed (\u000A), and carriage return (\u000D) characters. Any of these + // characters are valid in a password. However, many tools, such as the AWS + // Management Console, might restrict the ability to type certain characters + // because they have special meaning within that tool. + // + // NewPassword is a required field + NewPassword *string `min:"1" type:"string" required:"true"` + + // The IAM user's current password. + // + // OldPassword is a required field + OldPassword *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ChangePasswordInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangePasswordInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangePasswordInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangePasswordInput"} + if s.NewPassword == nil { + invalidParams.Add(request.NewErrParamRequired("NewPassword")) + } + if s.NewPassword != nil && len(*s.NewPassword) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewPassword", 1)) + } + if s.OldPassword == nil { + invalidParams.Add(request.NewErrParamRequired("OldPassword")) + } + if s.OldPassword != nil && len(*s.OldPassword) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OldPassword", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNewPassword sets the NewPassword field's value. +func (s *ChangePasswordInput) SetNewPassword(v string) *ChangePasswordInput { + s.NewPassword = &v + return s +} + +// SetOldPassword sets the OldPassword field's value. +func (s *ChangePasswordInput) SetOldPassword(v string) *ChangePasswordInput { + s.OldPassword = &v + return s +} + +type ChangePasswordOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ChangePasswordOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangePasswordOutput) GoString() string { + return s.String() +} + +// Contains information about a condition context key. It includes the name +// of the key and specifies the value (or values, if the context key supports +// multiple values) to use in the simulation. This information is used when +// evaluating the Condition elements of the input policies. +// +// This data type is used as an input parameter to SimulateCustomPolicy and +// SimulateCustomPolicy. +type ContextEntry struct { + _ struct{} `type:"structure"` + + // The full name of a condition context key, including the service prefix. For + // example, aws:SourceIp or s3:VersionId. + ContextKeyName *string `min:"5" type:"string"` + + // The data type of the value (or values) specified in the ContextKeyValues + // parameter. + ContextKeyType *string `type:"string" enum:"ContextKeyTypeEnum"` + + // The value (or values, if the condition context key supports multiple values) + // to provide to the simulation when the key is referenced by a Condition element + // in an input policy. + ContextKeyValues []*string `type:"list"` +} + +// String returns the string representation +func (s ContextEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContextEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ContextEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ContextEntry"} + if s.ContextKeyName != nil && len(*s.ContextKeyName) < 5 { + invalidParams.Add(request.NewErrParamMinLen("ContextKeyName", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContextKeyName sets the ContextKeyName field's value. +func (s *ContextEntry) SetContextKeyName(v string) *ContextEntry { + s.ContextKeyName = &v + return s +} + +// SetContextKeyType sets the ContextKeyType field's value. +func (s *ContextEntry) SetContextKeyType(v string) *ContextEntry { + s.ContextKeyType = &v + return s +} + +// SetContextKeyValues sets the ContextKeyValues field's value. +func (s *ContextEntry) SetContextKeyValues(v []*string) *ContextEntry { + s.ContextKeyValues = v + return s +} + +type CreateAccessKeyInput struct { + _ struct{} `type:"structure"` + + // The name of the IAM user that the new key will belong to. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateAccessKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccessKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAccessKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAccessKeyInput"} + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetUserName sets the UserName field's value. +func (s *CreateAccessKeyInput) SetUserName(v string) *CreateAccessKeyInput { + s.UserName = &v + return s +} + +// Contains the response to a successful CreateAccessKey request. +type CreateAccessKeyOutput struct { + _ struct{} `type:"structure"` + + // A structure with details about the access key. + // + // AccessKey is a required field + AccessKey *AccessKey `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateAccessKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccessKeyOutput) GoString() string { + return s.String() +} + +// SetAccessKey sets the AccessKey field's value. +func (s *CreateAccessKeyOutput) SetAccessKey(v *AccessKey) *CreateAccessKeyOutput { + s.AccessKey = v + return s +} + +type CreateAccountAliasInput struct { + _ struct{} `type:"structure"` + + // The account alias to create. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of lowercase letters, digits, and dashes. + // You cannot start or finish with a dash, nor can you have two dashes in a + // row. + // + // AccountAlias is a required field + AccountAlias *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateAccountAliasInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccountAliasInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAccountAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAccountAliasInput"} + if s.AccountAlias == nil { + invalidParams.Add(request.NewErrParamRequired("AccountAlias")) + } + if s.AccountAlias != nil && len(*s.AccountAlias) < 3 { + invalidParams.Add(request.NewErrParamMinLen("AccountAlias", 3)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountAlias sets the AccountAlias field's value. +func (s *CreateAccountAliasInput) SetAccountAlias(v string) *CreateAccountAliasInput { + s.AccountAlias = &v + return s +} + +type CreateAccountAliasOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateAccountAliasOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccountAliasOutput) GoString() string { + return s.String() +} + +type CreateGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the group to create. Do not include the path in this value. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@-. + // The group name must be unique within the account. Group names are not distinguished + // by case. For example, you cannot create groups named both "ADMINS" and "admins". + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The path to the group. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + Path *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *CreateGroupInput) SetGroupName(v string) *CreateGroupInput { + s.GroupName = &v + return s +} + +// SetPath sets the Path field's value. +func (s *CreateGroupInput) SetPath(v string) *CreateGroupInput { + s.Path = &v + return s +} + +// Contains the response to a successful CreateGroup request. +type CreateGroupOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the new group. + // + // Group is a required field + Group *Group `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupOutput) GoString() string { + return s.String() +} + +// SetGroup sets the Group field's value. +func (s *CreateGroupOutput) SetGroup(v *Group) *CreateGroupOutput { + s.Group = v + return s +} + +type CreateInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the instance profile to create. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // InstanceProfileName is a required field + InstanceProfileName *string `min:"1" type:"string" required:"true"` + + // The path to the instance profile. For more information about paths, see IAM + // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + Path *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateInstanceProfileInput"} + if s.InstanceProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) + } + if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) + } + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *CreateInstanceProfileInput) SetInstanceProfileName(v string) *CreateInstanceProfileInput { + s.InstanceProfileName = &v + return s +} + +// SetPath sets the Path field's value. +func (s *CreateInstanceProfileInput) SetPath(v string) *CreateInstanceProfileInput { + s.Path = &v + return s +} + +// Contains the response to a successful CreateInstanceProfile request. +type CreateInstanceProfileOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the new instance profile. + // + // InstanceProfile is a required field + InstanceProfile *InstanceProfile `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInstanceProfileOutput) GoString() string { + return s.String() +} + +// SetInstanceProfile sets the InstanceProfile field's value. +func (s *CreateInstanceProfileOutput) SetInstanceProfile(v *InstanceProfile) *CreateInstanceProfileOutput { + s.InstanceProfile = v + return s +} + +type CreateLoginProfileInput struct { + _ struct{} `type:"structure"` + + // The new password for the user. + // + // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate + // this parameter is a string of characters. That string can include almost + // any printable ASCII character from the space (\u0020) through the end of + // the ASCII character range (\u00FF). You can also include the tab (\u0009), + // line feed (\u000A), and carriage return (\u000D) characters. Any of these + // characters are valid in a password. However, many tools, such as the AWS + // Management Console, might restrict the ability to type certain characters + // because they have special meaning within that tool. + // + // Password is a required field + Password *string `min:"1" type:"string" required:"true"` + + // Specifies whether the user is required to set a new password on next sign-in. + PasswordResetRequired *bool `type:"boolean"` + + // The name of the IAM user to create a password for. The user must already + // exist. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLoginProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoginProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoginProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLoginProfileInput"} + if s.Password == nil { + invalidParams.Add(request.NewErrParamRequired("Password")) + } + if s.Password != nil && len(*s.Password) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Password", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPassword sets the Password field's value. +func (s *CreateLoginProfileInput) SetPassword(v string) *CreateLoginProfileInput { + s.Password = &v + return s +} + +// SetPasswordResetRequired sets the PasswordResetRequired field's value. +func (s *CreateLoginProfileInput) SetPasswordResetRequired(v bool) *CreateLoginProfileInput { + s.PasswordResetRequired = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *CreateLoginProfileInput) SetUserName(v string) *CreateLoginProfileInput { + s.UserName = &v + return s +} + +// Contains the response to a successful CreateLoginProfile request. +type CreateLoginProfileOutput struct { + _ struct{} `type:"structure"` + + // A structure containing the user name and password create date. + // + // LoginProfile is a required field + LoginProfile *LoginProfile `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateLoginProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoginProfileOutput) GoString() string { + return s.String() +} + +// SetLoginProfile sets the LoginProfile field's value. +func (s *CreateLoginProfileOutput) SetLoginProfile(v *LoginProfile) *CreateLoginProfileOutput { + s.LoginProfile = v + return s +} + +type CreateOpenIDConnectProviderInput struct { + _ struct{} `type:"structure"` + + // A list of client IDs (also known as audiences). When a mobile or web app + // registers with an OpenID Connect provider, they establish a value that identifies + // the application. (This is the value that's sent as the client_id parameter + // on OAuth requests.) + // + // You can register multiple client IDs with the same provider. For example, + // you might have multiple applications that use the same OIDC provider. You + // cannot register more than 100 client IDs with a single IAM OIDC provider. + // + // There is no defined format for a client ID. The CreateOpenIDConnectProviderRequest + // operation accepts client IDs up to 255 characters long. + ClientIDList []*string `type:"list"` + + // A list of server certificate thumbprints for the OpenID Connect (OIDC) identity + // provider's server certificates. Typically this list includes only one entry. + // However, IAM lets you have up to five thumbprints for an OIDC provider. This + // lets you maintain multiple thumbprints if the identity provider is rotating + // certificates. + // + // The server certificate thumbprint is the hex-encoded SHA-1 hash value of + // the X.509 certificate used by the domain where the OpenID Connect provider + // makes its keys available. It is always a 40-character string. + // + // You must provide at least one thumbprint when creating an IAM OIDC provider. + // For example, assume that the OIDC provider is server.example.com and the + // provider stores its keys at https://keys.server.example.com/openid-connect. + // In that case, the thumbprint string would be the hex-encoded SHA-1 hash value + // of the certificate used by https://keys.server.example.com. + // + // For more information about obtaining the OIDC provider's thumbprint, see + // Obtaining the Thumbprint for an OpenID Connect Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc-obtain-thumbprint.html) + // in the IAM User Guide. + // + // ThumbprintList is a required field + ThumbprintList []*string `type:"list" required:"true"` + + // The URL of the identity provider. The URL must begin with https:// and should + // correspond to the iss claim in the provider's OpenID Connect ID tokens. Per + // the OIDC standard, path components are allowed but query parameters are not. + // Typically the URL consists of only a hostname, like https://server.example.org + // or https://example.com. + // + // You cannot register the same provider multiple times in a single AWS account. + // If you try to submit a URL that has already been used for an OpenID Connect + // provider in the AWS account, you will get an error. + // + // Url is a required field + Url *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateOpenIDConnectProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateOpenIDConnectProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateOpenIDConnectProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateOpenIDConnectProviderInput"} + if s.ThumbprintList == nil { + invalidParams.Add(request.NewErrParamRequired("ThumbprintList")) + } + if s.Url == nil { + invalidParams.Add(request.NewErrParamRequired("Url")) + } + if s.Url != nil && len(*s.Url) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Url", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientIDList sets the ClientIDList field's value. +func (s *CreateOpenIDConnectProviderInput) SetClientIDList(v []*string) *CreateOpenIDConnectProviderInput { + s.ClientIDList = v + return s +} + +// SetThumbprintList sets the ThumbprintList field's value. +func (s *CreateOpenIDConnectProviderInput) SetThumbprintList(v []*string) *CreateOpenIDConnectProviderInput { + s.ThumbprintList = v + return s +} + +// SetUrl sets the Url field's value. +func (s *CreateOpenIDConnectProviderInput) SetUrl(v string) *CreateOpenIDConnectProviderInput { + s.Url = &v + return s +} + +// Contains the response to a successful CreateOpenIDConnectProvider request. +type CreateOpenIDConnectProviderOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the new IAM OpenID Connect provider that + // is created. For more information, see OpenIDConnectProviderListEntry. + OpenIDConnectProviderArn *string `min:"20" type:"string"` +} + +// String returns the string representation +func (s CreateOpenIDConnectProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateOpenIDConnectProviderOutput) GoString() string { + return s.String() +} + +// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. +func (s *CreateOpenIDConnectProviderOutput) SetOpenIDConnectProviderArn(v string) *CreateOpenIDConnectProviderOutput { + s.OpenIDConnectProviderArn = &v + return s +} + +type CreatePolicyInput struct { + _ struct{} `type:"structure"` + + // A friendly description of the policy. + // + // Typically used to store information about the permissions defined in the + // policy. For example, "Grants access to production DynamoDB tables." + // + // The policy description is immutable. After a value is assigned, it cannot + // be changed. + Description *string `type:"string"` + + // The path for the policy. + // + // For more information about paths, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + Path *string `type:"string"` + + // The JSON policy document that you want to use as the content for the new + // policy. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The friendly name of the policy. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePolicyInput"} + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *CreatePolicyInput) SetDescription(v string) *CreatePolicyInput { + s.Description = &v + return s +} + +// SetPath sets the Path field's value. +func (s *CreatePolicyInput) SetPath(v string) *CreatePolicyInput { + s.Path = &v + return s +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *CreatePolicyInput) SetPolicyDocument(v string) *CreatePolicyInput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *CreatePolicyInput) SetPolicyName(v string) *CreatePolicyInput { + s.PolicyName = &v + return s +} + +// Contains the response to a successful CreatePolicy request. +type CreatePolicyOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the new policy. + Policy *Policy `type:"structure"` +} + +// String returns the string representation +func (s CreatePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *CreatePolicyOutput) SetPolicy(v *Policy) *CreatePolicyOutput { + s.Policy = v + return s +} + +type CreatePolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy to which you want to add + // a new version. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The JSON policy document that you want to use as the content for this new + // version of the policy. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // Specifies whether to set this version as the policy's default version. + // + // When this parameter is true, the new policy version becomes the operative + // version. That is, it becomes the version that is in effect for the IAM users, + // groups, and roles that the policy is attached to. + // + // For more information about managed policy versions, see Versioning for Managed + // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) + // in the IAM User Guide. + SetAsDefault *bool `type:"boolean"` +} + +// String returns the string representation +func (s CreatePolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePolicyVersionInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *CreatePolicyVersionInput) SetPolicyArn(v string) *CreatePolicyVersionInput { + s.PolicyArn = &v + return s +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *CreatePolicyVersionInput) SetPolicyDocument(v string) *CreatePolicyVersionInput { + s.PolicyDocument = &v + return s +} + +// SetSetAsDefault sets the SetAsDefault field's value. +func (s *CreatePolicyVersionInput) SetSetAsDefault(v bool) *CreatePolicyVersionInput { + s.SetAsDefault = &v + return s +} + +// Contains the response to a successful CreatePolicyVersion request. +type CreatePolicyVersionOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the new policy version. + PolicyVersion *PolicyVersion `type:"structure"` +} + +// String returns the string representation +func (s CreatePolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyVersionOutput) GoString() string { + return s.String() +} + +// SetPolicyVersion sets the PolicyVersion field's value. +func (s *CreatePolicyVersionOutput) SetPolicyVersion(v *PolicyVersion) *CreatePolicyVersionOutput { + s.PolicyVersion = v + return s +} + +type CreateRoleInput struct { + _ struct{} `type:"structure"` + + // The trust relationship policy document that grants an entity permission to + // assume the role. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // AssumeRolePolicyDocument is a required field + AssumeRolePolicyDocument *string `min:"1" type:"string" required:"true"` + + // A description of the role. + Description *string `type:"string"` + + // The maximum session duration (in seconds) that you want to set for the specified + // role. If you do not specify a value for this setting, the default maximum + // of one hour is applied. This setting can have a value from 1 hour to 12 hours. + // + // Anyone who assumes the role from the AWS CLI or API can use the DurationSeconds + // API parameter or the duration-seconds CLI parameter to request a longer session. + // The MaxSessionDuration setting determines the maximum duration that can be + // requested using the DurationSeconds parameter. If users don't specify a value + // for the DurationSeconds parameter, their security credentials are valid for + // one hour by default. This applies when you use the AssumeRole* API operations + // or the assume-role* CLI operations but does not apply when you use those + // operations to create a console URL. For more information, see Using IAM Roles + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the + // IAM User Guide. + MaxSessionDuration *int64 `min:"3600" type:"integer"` + + // The path to the role. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + Path *string `min:"1" type:"string"` + + // The ARN of the policy that is used to set the permissions boundary for the + // role. + PermissionsBoundary *string `min:"20" type:"string"` + + // The name of the role to create. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // Role names are not distinguished by case. For example, you cannot create + // roles named both "PRODROLE" and "prodrole". + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRoleInput"} + if s.AssumeRolePolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("AssumeRolePolicyDocument")) + } + if s.AssumeRolePolicyDocument != nil && len(*s.AssumeRolePolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssumeRolePolicyDocument", 1)) + } + if s.MaxSessionDuration != nil && *s.MaxSessionDuration < 3600 { + invalidParams.Add(request.NewErrParamMinValue("MaxSessionDuration", 3600)) + } + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + if s.PermissionsBoundary != nil && len(*s.PermissionsBoundary) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PermissionsBoundary", 20)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. +func (s *CreateRoleInput) SetAssumeRolePolicyDocument(v string) *CreateRoleInput { + s.AssumeRolePolicyDocument = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateRoleInput) SetDescription(v string) *CreateRoleInput { + s.Description = &v + return s +} + +// SetMaxSessionDuration sets the MaxSessionDuration field's value. +func (s *CreateRoleInput) SetMaxSessionDuration(v int64) *CreateRoleInput { + s.MaxSessionDuration = &v + return s +} + +// SetPath sets the Path field's value. +func (s *CreateRoleInput) SetPath(v string) *CreateRoleInput { + s.Path = &v + return s +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *CreateRoleInput) SetPermissionsBoundary(v string) *CreateRoleInput { + s.PermissionsBoundary = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *CreateRoleInput) SetRoleName(v string) *CreateRoleInput { + s.RoleName = &v + return s +} + +// Contains the response to a successful CreateRole request. +type CreateRoleOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the new role. + // + // Role is a required field + Role *Role `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRoleOutput) GoString() string { + return s.String() +} + +// SetRole sets the Role field's value. +func (s *CreateRoleOutput) SetRole(v *Role) *CreateRoleOutput { + s.Role = v + return s +} + +type CreateSAMLProviderInput struct { + _ struct{} `type:"structure"` + + // The name of the provider to create. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // An XML document generated by an identity provider (IdP) that supports SAML + // 2.0. The document includes the issuer's name, expiration information, and + // keys that can be used to validate the SAML authentication response (assertions) + // that are received from the IdP. You must generate the metadata document using + // the identity management software that is used as your organization's IdP. + // + // For more information, see About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) + // in the IAM User Guide + // + // SAMLMetadataDocument is a required field + SAMLMetadataDocument *string `min:"1000" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateSAMLProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSAMLProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSAMLProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSAMLProviderInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.SAMLMetadataDocument == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLMetadataDocument")) + } + if s.SAMLMetadataDocument != nil && len(*s.SAMLMetadataDocument) < 1000 { + invalidParams.Add(request.NewErrParamMinLen("SAMLMetadataDocument", 1000)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *CreateSAMLProviderInput) SetName(v string) *CreateSAMLProviderInput { + s.Name = &v + return s +} + +// SetSAMLMetadataDocument sets the SAMLMetadataDocument field's value. +func (s *CreateSAMLProviderInput) SetSAMLMetadataDocument(v string) *CreateSAMLProviderInput { + s.SAMLMetadataDocument = &v + return s +} + +// Contains the response to a successful CreateSAMLProvider request. +type CreateSAMLProviderOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the new SAML provider resource in IAM. + SAMLProviderArn *string `min:"20" type:"string"` +} + +// String returns the string representation +func (s CreateSAMLProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSAMLProviderOutput) GoString() string { + return s.String() +} + +// SetSAMLProviderArn sets the SAMLProviderArn field's value. +func (s *CreateSAMLProviderOutput) SetSAMLProviderArn(v string) *CreateSAMLProviderOutput { + s.SAMLProviderArn = &v + return s +} + +type CreateServiceLinkedRoleInput struct { + _ struct{} `type:"structure"` + + // The AWS service to which this role is attached. You use a string similar + // to a URL but without the http:// in front. For example: elasticbeanstalk.amazonaws.com + // + // AWSServiceName is a required field + AWSServiceName *string `min:"1" type:"string" required:"true"` + + // A string that you provide, which is combined with the service name to form + // the complete role name. If you make multiple requests for the same service, + // then you must supply a different CustomSuffix for each request. Otherwise + // the request fails with a duplicate role name error. For example, you could + // add -1 or -debug to the suffix. + CustomSuffix *string `min:"1" type:"string"` + + // The description of the role. + Description *string `type:"string"` +} + +// String returns the string representation +func (s CreateServiceLinkedRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateServiceLinkedRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateServiceLinkedRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateServiceLinkedRoleInput"} + if s.AWSServiceName == nil { + invalidParams.Add(request.NewErrParamRequired("AWSServiceName")) + } + if s.AWSServiceName != nil && len(*s.AWSServiceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AWSServiceName", 1)) + } + if s.CustomSuffix != nil && len(*s.CustomSuffix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CustomSuffix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAWSServiceName sets the AWSServiceName field's value. +func (s *CreateServiceLinkedRoleInput) SetAWSServiceName(v string) *CreateServiceLinkedRoleInput { + s.AWSServiceName = &v + return s +} + +// SetCustomSuffix sets the CustomSuffix field's value. +func (s *CreateServiceLinkedRoleInput) SetCustomSuffix(v string) *CreateServiceLinkedRoleInput { + s.CustomSuffix = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateServiceLinkedRoleInput) SetDescription(v string) *CreateServiceLinkedRoleInput { + s.Description = &v + return s +} + +type CreateServiceLinkedRoleOutput struct { + _ struct{} `type:"structure"` + + // A Role object that contains details about the newly created role. + Role *Role `type:"structure"` +} + +// String returns the string representation +func (s CreateServiceLinkedRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateServiceLinkedRoleOutput) GoString() string { + return s.String() +} + +// SetRole sets the Role field's value. +func (s *CreateServiceLinkedRoleOutput) SetRole(v *Role) *CreateServiceLinkedRoleOutput { + s.Role = v + return s +} + +type CreateServiceSpecificCredentialInput struct { + _ struct{} `type:"structure"` + + // The name of the AWS service that is to be associated with the credentials. + // The service you specify here is the only service that can be accessed using + // these credentials. + // + // ServiceName is a required field + ServiceName *string `type:"string" required:"true"` + + // The name of the IAM user that is to be associated with the credentials. The + // new service-specific credentials have the same permissions as the associated + // user except that they can be used only to access the specified service. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateServiceSpecificCredentialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateServiceSpecificCredentialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateServiceSpecificCredentialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateServiceSpecificCredentialInput"} + if s.ServiceName == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceName")) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServiceName sets the ServiceName field's value. +func (s *CreateServiceSpecificCredentialInput) SetServiceName(v string) *CreateServiceSpecificCredentialInput { + s.ServiceName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *CreateServiceSpecificCredentialInput) SetUserName(v string) *CreateServiceSpecificCredentialInput { + s.UserName = &v + return s +} + +type CreateServiceSpecificCredentialOutput struct { + _ struct{} `type:"structure"` + + // A structure that contains information about the newly created service-specific + // credential. + // + // This is the only time that the password for this credential set is available. + // It cannot be recovered later. Instead, you will have to reset the password + // with ResetServiceSpecificCredential. + ServiceSpecificCredential *ServiceSpecificCredential `type:"structure"` +} + +// String returns the string representation +func (s CreateServiceSpecificCredentialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateServiceSpecificCredentialOutput) GoString() string { + return s.String() +} + +// SetServiceSpecificCredential sets the ServiceSpecificCredential field's value. +func (s *CreateServiceSpecificCredentialOutput) SetServiceSpecificCredential(v *ServiceSpecificCredential) *CreateServiceSpecificCredentialOutput { + s.ServiceSpecificCredential = v + return s +} + +type CreateUserInput struct { + _ struct{} `type:"structure"` + + // The path for the user name. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + Path *string `min:"1" type:"string"` + + // The ARN of the policy that is used to set the permissions boundary for the + // user. + PermissionsBoundary *string `min:"20" type:"string"` + + // The name of the user to create. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@-. + // User names are not distinguished by case. For example, you cannot create + // users named both "TESTUSER" and "testuser". + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateUserInput"} + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + if s.PermissionsBoundary != nil && len(*s.PermissionsBoundary) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PermissionsBoundary", 20)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPath sets the Path field's value. +func (s *CreateUserInput) SetPath(v string) *CreateUserInput { + s.Path = &v + return s +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *CreateUserInput) SetPermissionsBoundary(v string) *CreateUserInput { + s.PermissionsBoundary = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *CreateUserInput) SetUserName(v string) *CreateUserInput { + s.UserName = &v + return s +} + +// Contains the response to a successful CreateUser request. +type CreateUserOutput struct { + _ struct{} `type:"structure"` + + // A structure with details about the new IAM user. + User *User `type:"structure"` +} + +// String returns the string representation +func (s CreateUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateUserOutput) GoString() string { + return s.String() +} + +// SetUser sets the User field's value. +func (s *CreateUserOutput) SetUser(v *User) *CreateUserOutput { + s.User = v + return s +} + +type CreateVirtualMFADeviceInput struct { + _ struct{} `type:"structure"` + + // The path for the virtual MFA device. For more information about paths, see + // IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + Path *string `min:"1" type:"string"` + + // The name of the virtual MFA device. Use with path to uniquely identify a + // virtual MFA device. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // VirtualMFADeviceName is a required field + VirtualMFADeviceName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateVirtualMFADeviceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVirtualMFADeviceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateVirtualMFADeviceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVirtualMFADeviceInput"} + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + if s.VirtualMFADeviceName == nil { + invalidParams.Add(request.NewErrParamRequired("VirtualMFADeviceName")) + } + if s.VirtualMFADeviceName != nil && len(*s.VirtualMFADeviceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VirtualMFADeviceName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPath sets the Path field's value. +func (s *CreateVirtualMFADeviceInput) SetPath(v string) *CreateVirtualMFADeviceInput { + s.Path = &v + return s +} + +// SetVirtualMFADeviceName sets the VirtualMFADeviceName field's value. +func (s *CreateVirtualMFADeviceInput) SetVirtualMFADeviceName(v string) *CreateVirtualMFADeviceInput { + s.VirtualMFADeviceName = &v + return s +} + +// Contains the response to a successful CreateVirtualMFADevice request. +type CreateVirtualMFADeviceOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the new virtual MFA device. + // + // VirtualMFADevice is a required field + VirtualMFADevice *VirtualMFADevice `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateVirtualMFADeviceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVirtualMFADeviceOutput) GoString() string { + return s.String() +} + +// SetVirtualMFADevice sets the VirtualMFADevice field's value. +func (s *CreateVirtualMFADeviceOutput) SetVirtualMFADevice(v *VirtualMFADevice) *CreateVirtualMFADeviceOutput { + s.VirtualMFADevice = v + return s +} + +type DeactivateMFADeviceInput struct { + _ struct{} `type:"structure"` + + // The serial number that uniquely identifies the MFA device. For virtual MFA + // devices, the serial number is the device ARN. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: =,.@:/- + // + // SerialNumber is a required field + SerialNumber *string `min:"9" type:"string" required:"true"` + + // The name of the user whose MFA device you want to deactivate. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeactivateMFADeviceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeactivateMFADeviceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeactivateMFADeviceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeactivateMFADeviceInput"} + if s.SerialNumber == nil { + invalidParams.Add(request.NewErrParamRequired("SerialNumber")) + } + if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { + invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSerialNumber sets the SerialNumber field's value. +func (s *DeactivateMFADeviceInput) SetSerialNumber(v string) *DeactivateMFADeviceInput { + s.SerialNumber = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeactivateMFADeviceInput) SetUserName(v string) *DeactivateMFADeviceInput { + s.UserName = &v + return s +} + +type DeactivateMFADeviceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeactivateMFADeviceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeactivateMFADeviceOutput) GoString() string { + return s.String() +} + +type DeleteAccessKeyInput struct { + _ struct{} `type:"structure"` + + // The access key ID for the access key ID and secret access key you want to + // delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` + + // The name of the user whose access key pair you want to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteAccessKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAccessKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAccessKeyInput"} + if s.AccessKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) + } + if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { + invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *DeleteAccessKeyInput) SetAccessKeyId(v string) *DeleteAccessKeyInput { + s.AccessKeyId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeleteAccessKeyInput) SetUserName(v string) *DeleteAccessKeyInput { + s.UserName = &v + return s +} + +type DeleteAccessKeyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccessKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessKeyOutput) GoString() string { + return s.String() +} + +type DeleteAccountAliasInput struct { + _ struct{} `type:"structure"` + + // The name of the account alias to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of lowercase letters, digits, and dashes. + // You cannot start or finish with a dash, nor can you have two dashes in a + // row. + // + // AccountAlias is a required field + AccountAlias *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAccountAliasInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccountAliasInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAccountAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAccountAliasInput"} + if s.AccountAlias == nil { + invalidParams.Add(request.NewErrParamRequired("AccountAlias")) + } + if s.AccountAlias != nil && len(*s.AccountAlias) < 3 { + invalidParams.Add(request.NewErrParamMinLen("AccountAlias", 3)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountAlias sets the AccountAlias field's value. +func (s *DeleteAccountAliasInput) SetAccountAlias(v string) *DeleteAccountAliasInput { + s.AccountAlias = &v + return s +} + +type DeleteAccountAliasOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccountAliasOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccountAliasOutput) GoString() string { + return s.String() +} + +type DeleteAccountPasswordPolicyInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccountPasswordPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccountPasswordPolicyInput) GoString() string { + return s.String() +} + +type DeleteAccountPasswordPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccountPasswordPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccountPasswordPolicyOutput) GoString() string { + return s.String() +} + +type DeleteGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the IAM group to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { + s.GroupName = &v + return s +} + +type DeleteGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupOutput) GoString() string { + return s.String() +} + +type DeleteGroupPolicyInput struct { + _ struct{} `type:"structure"` + + // The name (friendly name, not ARN) identifying the group that the policy is + // embedded in. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The name identifying the policy document to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteGroupPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteGroupPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteGroupPolicyInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *DeleteGroupPolicyInput) SetGroupName(v string) *DeleteGroupPolicyInput { + s.GroupName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *DeleteGroupPolicyInput) SetPolicyName(v string) *DeleteGroupPolicyInput { + s.PolicyName = &v + return s +} + +type DeleteGroupPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteGroupPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupPolicyOutput) GoString() string { + return s.String() +} + +type DeleteInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the instance profile to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // InstanceProfileName is a required field + InstanceProfileName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteInstanceProfileInput"} + if s.InstanceProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) + } + if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *DeleteInstanceProfileInput) SetInstanceProfileName(v string) *DeleteInstanceProfileInput { + s.InstanceProfileName = &v + return s +} + +type DeleteInstanceProfileOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInstanceProfileOutput) GoString() string { + return s.String() +} + +type DeleteLoginProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the user whose password you want to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLoginProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoginProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoginProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLoginProfileInput"} + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetUserName sets the UserName field's value. +func (s *DeleteLoginProfileInput) SetUserName(v string) *DeleteLoginProfileInput { + s.UserName = &v + return s +} + +type DeleteLoginProfileOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoginProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoginProfileOutput) GoString() string { + return s.String() +} + +type DeleteOpenIDConnectProviderInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM OpenID Connect provider resource + // object to delete. You can get a list of OpenID Connect provider resource + // ARNs by using the ListOpenIDConnectProviders operation. + // + // OpenIDConnectProviderArn is a required field + OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteOpenIDConnectProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteOpenIDConnectProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteOpenIDConnectProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteOpenIDConnectProviderInput"} + if s.OpenIDConnectProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) + } + if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. +func (s *DeleteOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *DeleteOpenIDConnectProviderInput { + s.OpenIDConnectProviderArn = &v + return s +} + +type DeleteOpenIDConnectProviderOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteOpenIDConnectProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteOpenIDConnectProviderOutput) GoString() string { + return s.String() +} + +type DeletePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to delete. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *DeletePolicyInput) SetPolicyArn(v string) *DeletePolicyInput { + s.PolicyArn = &v + return s +} + +type DeletePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyOutput) GoString() string { + return s.String() +} + +type DeletePolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy from which you want to delete + // a version. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The policy version to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that consists of the lowercase letter 'v' followed + // by one or two digits, and optionally followed by a period '.' and a string + // of letters and digits. + // + // For more information about managed policy versions, see Versioning for Managed + // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) + // in the IAM User Guide. + // + // VersionId is a required field + VersionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePolicyVersionInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.VersionId == nil { + invalidParams.Add(request.NewErrParamRequired("VersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *DeletePolicyVersionInput) SetPolicyArn(v string) *DeletePolicyVersionInput { + s.PolicyArn = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeletePolicyVersionInput) SetVersionId(v string) *DeletePolicyVersionInput { + s.VersionId = &v + return s +} + +type DeletePolicyVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyVersionOutput) GoString() string { + return s.String() +} + +type DeleteRoleInput struct { + _ struct{} `type:"structure"` + + // The name of the role to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRoleInput"} + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRoleName sets the RoleName field's value. +func (s *DeleteRoleInput) SetRoleName(v string) *DeleteRoleInput { + s.RoleName = &v + return s +} + +type DeleteRoleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRoleOutput) GoString() string { + return s.String() +} + +type DeleteRolePermissionsBoundaryInput struct { + _ struct{} `type:"structure"` + + // The name (friendly name, not ARN) of the IAM role from which you want to + // remove the permissions boundary. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRolePermissionsBoundaryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRolePermissionsBoundaryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRolePermissionsBoundaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRolePermissionsBoundaryInput"} + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRoleName sets the RoleName field's value. +func (s *DeleteRolePermissionsBoundaryInput) SetRoleName(v string) *DeleteRolePermissionsBoundaryInput { + s.RoleName = &v + return s +} + +type DeleteRolePermissionsBoundaryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRolePermissionsBoundaryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRolePermissionsBoundaryOutput) GoString() string { + return s.String() +} + +type DeleteRolePolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the inline policy to delete from the specified IAM role. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The name (friendly name, not ARN) identifying the role that the policy is + // embedded in. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRolePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRolePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRolePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRolePolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyName sets the PolicyName field's value. +func (s *DeleteRolePolicyInput) SetPolicyName(v string) *DeleteRolePolicyInput { + s.PolicyName = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *DeleteRolePolicyInput) SetRoleName(v string) *DeleteRolePolicyInput { + s.RoleName = &v + return s +} + +type DeleteRolePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRolePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRolePolicyOutput) GoString() string { + return s.String() +} + +type DeleteSAMLProviderInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the SAML provider to delete. + // + // SAMLProviderArn is a required field + SAMLProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteSAMLProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSAMLProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSAMLProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSAMLProviderInput"} + if s.SAMLProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLProviderArn")) + } + if s.SAMLProviderArn != nil && len(*s.SAMLProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("SAMLProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSAMLProviderArn sets the SAMLProviderArn field's value. +func (s *DeleteSAMLProviderInput) SetSAMLProviderArn(v string) *DeleteSAMLProviderInput { + s.SAMLProviderArn = &v + return s +} + +type DeleteSAMLProviderOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteSAMLProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSAMLProviderOutput) GoString() string { + return s.String() +} + +type DeleteSSHPublicKeyInput struct { + _ struct{} `type:"structure"` + + // The unique identifier for the SSH public key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // SSHPublicKeyId is a required field + SSHPublicKeyId *string `min:"20" type:"string" required:"true"` + + // The name of the IAM user associated with the SSH public key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteSSHPublicKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSSHPublicKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSSHPublicKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSSHPublicKeyInput"} + if s.SSHPublicKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyId")) + } + if s.SSHPublicKeyId != nil && len(*s.SSHPublicKeyId) < 20 { + invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyId", 20)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. +func (s *DeleteSSHPublicKeyInput) SetSSHPublicKeyId(v string) *DeleteSSHPublicKeyInput { + s.SSHPublicKeyId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeleteSSHPublicKeyInput) SetUserName(v string) *DeleteSSHPublicKeyInput { + s.UserName = &v + return s +} + +type DeleteSSHPublicKeyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteSSHPublicKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSSHPublicKeyOutput) GoString() string { + return s.String() +} + +type DeleteServerCertificateInput struct { + _ struct{} `type:"structure"` + + // The name of the server certificate you want to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // ServerCertificateName is a required field + ServerCertificateName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteServerCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteServerCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteServerCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteServerCertificateInput"} + if s.ServerCertificateName == nil { + invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) + } + if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServerCertificateName sets the ServerCertificateName field's value. +func (s *DeleteServerCertificateInput) SetServerCertificateName(v string) *DeleteServerCertificateInput { + s.ServerCertificateName = &v + return s +} + +type DeleteServerCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteServerCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteServerCertificateOutput) GoString() string { + return s.String() +} + +type DeleteServiceLinkedRoleInput struct { + _ struct{} `type:"structure"` + + // The name of the service-linked role to be deleted. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteServiceLinkedRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteServiceLinkedRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteServiceLinkedRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteServiceLinkedRoleInput"} + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRoleName sets the RoleName field's value. +func (s *DeleteServiceLinkedRoleInput) SetRoleName(v string) *DeleteServiceLinkedRoleInput { + s.RoleName = &v + return s +} + +type DeleteServiceLinkedRoleOutput struct { + _ struct{} `type:"structure"` + + // The deletion task identifier that you can use to check the status of the + // deletion. This identifier is returned in the format task/aws-service-role///. + // + // DeletionTaskId is a required field + DeletionTaskId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteServiceLinkedRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteServiceLinkedRoleOutput) GoString() string { + return s.String() +} + +// SetDeletionTaskId sets the DeletionTaskId field's value. +func (s *DeleteServiceLinkedRoleOutput) SetDeletionTaskId(v string) *DeleteServiceLinkedRoleOutput { + s.DeletionTaskId = &v + return s +} + +type DeleteServiceSpecificCredentialInput struct { + _ struct{} `type:"structure"` + + // The unique identifier of the service-specific credential. You can get this + // value by calling ListServiceSpecificCredentials. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // ServiceSpecificCredentialId is a required field + ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` + + // The name of the IAM user associated with the service-specific credential. + // If this value is not specified, then the operation assumes the user whose + // credentials are used to call the operation. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteServiceSpecificCredentialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteServiceSpecificCredentialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteServiceSpecificCredentialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteServiceSpecificCredentialInput"} + if s.ServiceSpecificCredentialId == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceSpecificCredentialId")) + } + if s.ServiceSpecificCredentialId != nil && len(*s.ServiceSpecificCredentialId) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ServiceSpecificCredentialId", 20)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. +func (s *DeleteServiceSpecificCredentialInput) SetServiceSpecificCredentialId(v string) *DeleteServiceSpecificCredentialInput { + s.ServiceSpecificCredentialId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeleteServiceSpecificCredentialInput) SetUserName(v string) *DeleteServiceSpecificCredentialInput { + s.UserName = &v + return s +} + +type DeleteServiceSpecificCredentialOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteServiceSpecificCredentialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteServiceSpecificCredentialOutput) GoString() string { + return s.String() +} + +type DeleteSigningCertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the signing certificate to delete. + // + // The format of this parameter, as described by its regex (http://wikipedia.org/wiki/regex) + // pattern, is a string of characters that can be upper- or lower-cased letters + // or digits. + // + // CertificateId is a required field + CertificateId *string `min:"24" type:"string" required:"true"` + + // The name of the user the signing certificate belongs to. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteSigningCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSigningCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSigningCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSigningCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 24 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 24)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateId sets the CertificateId field's value. +func (s *DeleteSigningCertificateInput) SetCertificateId(v string) *DeleteSigningCertificateInput { + s.CertificateId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeleteSigningCertificateInput) SetUserName(v string) *DeleteSigningCertificateInput { + s.UserName = &v + return s +} + +type DeleteSigningCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteSigningCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSigningCertificateOutput) GoString() string { + return s.String() +} + +type DeleteUserInput struct { + _ struct{} `type:"structure"` + + // The name of the user to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteUserInput"} + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetUserName sets the UserName field's value. +func (s *DeleteUserInput) SetUserName(v string) *DeleteUserInput { + s.UserName = &v + return s +} + +type DeleteUserOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserOutput) GoString() string { + return s.String() +} + +type DeleteUserPermissionsBoundaryInput struct { + _ struct{} `type:"structure"` + + // The name (friendly name, not ARN) of the IAM user from which you want to + // remove the permissions boundary. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteUserPermissionsBoundaryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserPermissionsBoundaryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteUserPermissionsBoundaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteUserPermissionsBoundaryInput"} + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetUserName sets the UserName field's value. +func (s *DeleteUserPermissionsBoundaryInput) SetUserName(v string) *DeleteUserPermissionsBoundaryInput { + s.UserName = &v + return s +} + +type DeleteUserPermissionsBoundaryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteUserPermissionsBoundaryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserPermissionsBoundaryOutput) GoString() string { + return s.String() +} + +type DeleteUserPolicyInput struct { + _ struct{} `type:"structure"` + + // The name identifying the policy document to delete. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The name (friendly name, not ARN) identifying the user that the policy is + // embedded in. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteUserPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteUserPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteUserPolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyName sets the PolicyName field's value. +func (s *DeleteUserPolicyInput) SetPolicyName(v string) *DeleteUserPolicyInput { + s.PolicyName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeleteUserPolicyInput) SetUserName(v string) *DeleteUserPolicyInput { + s.UserName = &v + return s +} + +type DeleteUserPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteUserPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserPolicyOutput) GoString() string { + return s.String() +} + +type DeleteVirtualMFADeviceInput struct { + _ struct{} `type:"structure"` + + // The serial number that uniquely identifies the MFA device. For virtual MFA + // devices, the serial number is the same as the ARN. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: =,.@:/- + // + // SerialNumber is a required field + SerialNumber *string `min:"9" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteVirtualMFADeviceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVirtualMFADeviceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteVirtualMFADeviceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVirtualMFADeviceInput"} + if s.SerialNumber == nil { + invalidParams.Add(request.NewErrParamRequired("SerialNumber")) + } + if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { + invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSerialNumber sets the SerialNumber field's value. +func (s *DeleteVirtualMFADeviceInput) SetSerialNumber(v string) *DeleteVirtualMFADeviceInput { + s.SerialNumber = &v + return s +} + +type DeleteVirtualMFADeviceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteVirtualMFADeviceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVirtualMFADeviceOutput) GoString() string { + return s.String() +} + +// The reason that the service-linked role deletion failed. +// +// This data type is used as a response element in the GetServiceLinkedRoleDeletionStatus +// operation. +type DeletionTaskFailureReasonType struct { + _ struct{} `type:"structure"` + + // A short description of the reason that the service-linked role deletion failed. + Reason *string `type:"string"` + + // A list of objects that contains details about the service-linked role deletion + // failure, if that information is returned by the service. If the service-linked + // role has active sessions or if any resources that were used by the role have + // not been deleted from the linked service, the role can't be deleted. This + // parameter includes a list of the resources that are associated with the role + // and the region in which the resources are being used. + RoleUsageList []*RoleUsageType `type:"list"` +} + +// String returns the string representation +func (s DeletionTaskFailureReasonType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletionTaskFailureReasonType) GoString() string { + return s.String() +} + +// SetReason sets the Reason field's value. +func (s *DeletionTaskFailureReasonType) SetReason(v string) *DeletionTaskFailureReasonType { + s.Reason = &v + return s +} + +// SetRoleUsageList sets the RoleUsageList field's value. +func (s *DeletionTaskFailureReasonType) SetRoleUsageList(v []*RoleUsageType) *DeletionTaskFailureReasonType { + s.RoleUsageList = v + return s +} + +type DetachGroupPolicyInput struct { + _ struct{} `type:"structure"` + + // The name (friendly name, not ARN) of the IAM group to detach the policy from. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to detach. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DetachGroupPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachGroupPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachGroupPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachGroupPolicyInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *DetachGroupPolicyInput) SetGroupName(v string) *DetachGroupPolicyInput { + s.GroupName = &v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *DetachGroupPolicyInput) SetPolicyArn(v string) *DetachGroupPolicyInput { + s.PolicyArn = &v + return s +} + +type DetachGroupPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachGroupPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachGroupPolicyOutput) GoString() string { + return s.String() +} + +type DetachRolePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to detach. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The name (friendly name, not ARN) of the IAM role to detach the policy from. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DetachRolePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachRolePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachRolePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachRolePolicyInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *DetachRolePolicyInput) SetPolicyArn(v string) *DetachRolePolicyInput { + s.PolicyArn = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *DetachRolePolicyInput) SetRoleName(v string) *DetachRolePolicyInput { + s.RoleName = &v + return s +} + +type DetachRolePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachRolePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachRolePolicyOutput) GoString() string { + return s.String() +} + +type DetachUserPolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy you want to detach. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The name (friendly name, not ARN) of the IAM user to detach the policy from. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DetachUserPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachUserPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachUserPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachUserPolicyInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *DetachUserPolicyInput) SetPolicyArn(v string) *DetachUserPolicyInput { + s.PolicyArn = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DetachUserPolicyInput) SetUserName(v string) *DetachUserPolicyInput { + s.UserName = &v + return s +} + +type DetachUserPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachUserPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachUserPolicyOutput) GoString() string { + return s.String() +} + +type EnableMFADeviceInput struct { + _ struct{} `type:"structure"` + + // An authentication code emitted by the device. + // + // The format for this parameter is a string of six digits. + // + // Submit your request immediately after generating the authentication codes. + // If you generate the codes and then wait too long to submit the request, the + // MFA device successfully associates with the user but the MFA device becomes + // out of sync. This happens because time-based one-time passwords (TOTP) expire + // after a short period of time. If this happens, you can resync the device + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_sync.html). + // + // AuthenticationCode1 is a required field + AuthenticationCode1 *string `min:"6" type:"string" required:"true"` + + // A subsequent authentication code emitted by the device. + // + // The format for this parameter is a string of six digits. + // + // Submit your request immediately after generating the authentication codes. + // If you generate the codes and then wait too long to submit the request, the + // MFA device successfully associates with the user but the MFA device becomes + // out of sync. This happens because time-based one-time passwords (TOTP) expire + // after a short period of time. If this happens, you can resync the device + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_sync.html). + // + // AuthenticationCode2 is a required field + AuthenticationCode2 *string `min:"6" type:"string" required:"true"` + + // The serial number that uniquely identifies the MFA device. For virtual MFA + // devices, the serial number is the device ARN. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: =,.@:/- + // + // SerialNumber is a required field + SerialNumber *string `min:"9" type:"string" required:"true"` + + // The name of the IAM user for whom you want to enable the MFA device. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s EnableMFADeviceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableMFADeviceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableMFADeviceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableMFADeviceInput"} + if s.AuthenticationCode1 == nil { + invalidParams.Add(request.NewErrParamRequired("AuthenticationCode1")) + } + if s.AuthenticationCode1 != nil && len(*s.AuthenticationCode1) < 6 { + invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode1", 6)) + } + if s.AuthenticationCode2 == nil { + invalidParams.Add(request.NewErrParamRequired("AuthenticationCode2")) + } + if s.AuthenticationCode2 != nil && len(*s.AuthenticationCode2) < 6 { + invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode2", 6)) + } + if s.SerialNumber == nil { + invalidParams.Add(request.NewErrParamRequired("SerialNumber")) + } + if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { + invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthenticationCode1 sets the AuthenticationCode1 field's value. +func (s *EnableMFADeviceInput) SetAuthenticationCode1(v string) *EnableMFADeviceInput { + s.AuthenticationCode1 = &v + return s +} + +// SetAuthenticationCode2 sets the AuthenticationCode2 field's value. +func (s *EnableMFADeviceInput) SetAuthenticationCode2(v string) *EnableMFADeviceInput { + s.AuthenticationCode2 = &v + return s +} + +// SetSerialNumber sets the SerialNumber field's value. +func (s *EnableMFADeviceInput) SetSerialNumber(v string) *EnableMFADeviceInput { + s.SerialNumber = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *EnableMFADeviceInput) SetUserName(v string) *EnableMFADeviceInput { + s.UserName = &v + return s +} + +type EnableMFADeviceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s EnableMFADeviceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableMFADeviceOutput) GoString() string { + return s.String() +} + +// Contains the results of a simulation. +// +// This data type is used by the return parameter of SimulateCustomPolicy and +// SimulatePrincipalPolicy. +type EvaluationResult struct { + _ struct{} `type:"structure"` + + // The name of the API operation tested on the indicated resource. + // + // EvalActionName is a required field + EvalActionName *string `min:"3" type:"string" required:"true"` + + // The result of the simulation. + // + // EvalDecision is a required field + EvalDecision *string `type:"string" required:"true" enum:"PolicyEvaluationDecisionType"` + + // Additional details about the results of the evaluation decision. When there + // are both IAM policies and resource policies, this parameter explains how + // each set of policies contributes to the final evaluation decision. When simulating + // cross-account access to a resource, both the resource-based policy and the + // caller's IAM policy must grant access. See How IAM Roles Differ from Resource-based + // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) + EvalDecisionDetails map[string]*string `type:"map"` + + // The ARN of the resource that the indicated API operation was tested on. + EvalResourceName *string `min:"1" type:"string"` + + // A list of the statements in the input policies that determine the result + // for this scenario. Remember that even if multiple statements allow the operation + // on the resource, if only one statement denies that operation, then the explicit + // deny overrides any allow, and the deny statement is the only entry included + // in the result. + MatchedStatements []*Statement `type:"list"` + + // A list of context keys that are required by the included input policies but + // that were not provided by one of the input parameters. This list is used + // when the resource in a simulation is "*", either explicitly, or when the + // ResourceArns parameter blank. If you include a list of resources, then any + // missing context values are instead included under the ResourceSpecificResults + // section. To discover the context keys used by a set of policies, you can + // call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy. + MissingContextValues []*string `type:"list"` + + // A structure that details how AWS Organizations and its service control policies + // affect the results of the simulation. Only applies if the simulated user's + // account is part of an organization. + OrganizationsDecisionDetail *OrganizationsDecisionDetail `type:"structure"` + + // The individual results of the simulation of the API operation specified in + // EvalActionName on each resource. + ResourceSpecificResults []*ResourceSpecificResult `type:"list"` +} + +// String returns the string representation +func (s EvaluationResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EvaluationResult) GoString() string { + return s.String() +} + +// SetEvalActionName sets the EvalActionName field's value. +func (s *EvaluationResult) SetEvalActionName(v string) *EvaluationResult { + s.EvalActionName = &v + return s +} + +// SetEvalDecision sets the EvalDecision field's value. +func (s *EvaluationResult) SetEvalDecision(v string) *EvaluationResult { + s.EvalDecision = &v + return s +} + +// SetEvalDecisionDetails sets the EvalDecisionDetails field's value. +func (s *EvaluationResult) SetEvalDecisionDetails(v map[string]*string) *EvaluationResult { + s.EvalDecisionDetails = v + return s +} + +// SetEvalResourceName sets the EvalResourceName field's value. +func (s *EvaluationResult) SetEvalResourceName(v string) *EvaluationResult { + s.EvalResourceName = &v + return s +} + +// SetMatchedStatements sets the MatchedStatements field's value. +func (s *EvaluationResult) SetMatchedStatements(v []*Statement) *EvaluationResult { + s.MatchedStatements = v + return s +} + +// SetMissingContextValues sets the MissingContextValues field's value. +func (s *EvaluationResult) SetMissingContextValues(v []*string) *EvaluationResult { + s.MissingContextValues = v + return s +} + +// SetOrganizationsDecisionDetail sets the OrganizationsDecisionDetail field's value. +func (s *EvaluationResult) SetOrganizationsDecisionDetail(v *OrganizationsDecisionDetail) *EvaluationResult { + s.OrganizationsDecisionDetail = v + return s +} + +// SetResourceSpecificResults sets the ResourceSpecificResults field's value. +func (s *EvaluationResult) SetResourceSpecificResults(v []*ResourceSpecificResult) *EvaluationResult { + s.ResourceSpecificResults = v + return s +} + +type GenerateCredentialReportInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GenerateCredentialReportInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GenerateCredentialReportInput) GoString() string { + return s.String() +} + +// Contains the response to a successful GenerateCredentialReport request. +type GenerateCredentialReportOutput struct { + _ struct{} `type:"structure"` + + // Information about the credential report. + Description *string `type:"string"` + + // Information about the state of the credential report. + State *string `type:"string" enum:"ReportStateType"` +} + +// String returns the string representation +func (s GenerateCredentialReportOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GenerateCredentialReportOutput) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *GenerateCredentialReportOutput) SetDescription(v string) *GenerateCredentialReportOutput { + s.Description = &v + return s +} + +// SetState sets the State field's value. +func (s *GenerateCredentialReportOutput) SetState(v string) *GenerateCredentialReportOutput { + s.State = &v + return s +} + +type GetAccessKeyLastUsedInput struct { + _ struct{} `type:"structure"` + + // The identifier of an access key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAccessKeyLastUsedInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyLastUsedInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccessKeyLastUsedInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyLastUsedInput"} + if s.AccessKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) + } + if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { + invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *GetAccessKeyLastUsedInput) SetAccessKeyId(v string) *GetAccessKeyLastUsedInput { + s.AccessKeyId = &v + return s +} + +// Contains the response to a successful GetAccessKeyLastUsed request. It is +// also returned as a member of the AccessKeyMetaData structure returned by +// the ListAccessKeys action. +type GetAccessKeyLastUsedOutput struct { + _ struct{} `type:"structure"` + + // Contains information about the last time the access key was used. + AccessKeyLastUsed *AccessKeyLastUsed `type:"structure"` + + // The name of the AWS IAM user that owns this access key. + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GetAccessKeyLastUsedOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyLastUsedOutput) GoString() string { + return s.String() +} + +// SetAccessKeyLastUsed sets the AccessKeyLastUsed field's value. +func (s *GetAccessKeyLastUsedOutput) SetAccessKeyLastUsed(v *AccessKeyLastUsed) *GetAccessKeyLastUsedOutput { + s.AccessKeyLastUsed = v + return s +} + +// SetUserName sets the UserName field's value. +func (s *GetAccessKeyLastUsedOutput) SetUserName(v string) *GetAccessKeyLastUsedOutput { + s.UserName = &v + return s +} + +type GetAccountAuthorizationDetailsInput struct { + _ struct{} `type:"structure"` + + // A list of entity types used to filter the results. Only the entities that + // match the types you specify are included in the output. Use the value LocalManagedPolicy + // to include customer managed policies. + // + // The format for this parameter is a comma-separated (if more than one) list + // of strings. Each string value in the list must be one of the valid values + // listed below. + Filter []*string `type:"list"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s GetAccountAuthorizationDetailsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountAuthorizationDetailsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccountAuthorizationDetailsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccountAuthorizationDetailsInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilter sets the Filter field's value. +func (s *GetAccountAuthorizationDetailsInput) SetFilter(v []*string) *GetAccountAuthorizationDetailsInput { + s.Filter = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *GetAccountAuthorizationDetailsInput) SetMarker(v string) *GetAccountAuthorizationDetailsInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *GetAccountAuthorizationDetailsInput) SetMaxItems(v int64) *GetAccountAuthorizationDetailsInput { + s.MaxItems = &v + return s +} + +// Contains the response to a successful GetAccountAuthorizationDetails request. +type GetAccountAuthorizationDetailsOutput struct { + _ struct{} `type:"structure"` + + // A list containing information about IAM groups. + GroupDetailList []*GroupDetail `type:"list"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list containing information about managed policies. + Policies []*ManagedPolicyDetail `type:"list"` + + // A list containing information about IAM roles. + RoleDetailList []*RoleDetail `type:"list"` + + // A list containing information about IAM users. + UserDetailList []*UserDetail `type:"list"` +} + +// String returns the string representation +func (s GetAccountAuthorizationDetailsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountAuthorizationDetailsOutput) GoString() string { + return s.String() +} + +// SetGroupDetailList sets the GroupDetailList field's value. +func (s *GetAccountAuthorizationDetailsOutput) SetGroupDetailList(v []*GroupDetail) *GetAccountAuthorizationDetailsOutput { + s.GroupDetailList = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *GetAccountAuthorizationDetailsOutput) SetIsTruncated(v bool) *GetAccountAuthorizationDetailsOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *GetAccountAuthorizationDetailsOutput) SetMarker(v string) *GetAccountAuthorizationDetailsOutput { + s.Marker = &v + return s +} + +// SetPolicies sets the Policies field's value. +func (s *GetAccountAuthorizationDetailsOutput) SetPolicies(v []*ManagedPolicyDetail) *GetAccountAuthorizationDetailsOutput { + s.Policies = v + return s +} + +// SetRoleDetailList sets the RoleDetailList field's value. +func (s *GetAccountAuthorizationDetailsOutput) SetRoleDetailList(v []*RoleDetail) *GetAccountAuthorizationDetailsOutput { + s.RoleDetailList = v + return s +} + +// SetUserDetailList sets the UserDetailList field's value. +func (s *GetAccountAuthorizationDetailsOutput) SetUserDetailList(v []*UserDetail) *GetAccountAuthorizationDetailsOutput { + s.UserDetailList = v + return s +} + +type GetAccountPasswordPolicyInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetAccountPasswordPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountPasswordPolicyInput) GoString() string { + return s.String() +} + +// Contains the response to a successful GetAccountPasswordPolicy request. +type GetAccountPasswordPolicyOutput struct { + _ struct{} `type:"structure"` + + // A structure that contains details about the account's password policy. + // + // PasswordPolicy is a required field + PasswordPolicy *PasswordPolicy `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetAccountPasswordPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountPasswordPolicyOutput) GoString() string { + return s.String() +} + +// SetPasswordPolicy sets the PasswordPolicy field's value. +func (s *GetAccountPasswordPolicyOutput) SetPasswordPolicy(v *PasswordPolicy) *GetAccountPasswordPolicyOutput { + s.PasswordPolicy = v + return s +} + +type GetAccountSummaryInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetAccountSummaryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountSummaryInput) GoString() string { + return s.String() +} + +// Contains the response to a successful GetAccountSummary request. +type GetAccountSummaryOutput struct { + _ struct{} `type:"structure"` + + // A set of key value pairs containing information about IAM entity usage and + // IAM quotas. + SummaryMap map[string]*int64 `type:"map"` +} + +// String returns the string representation +func (s GetAccountSummaryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountSummaryOutput) GoString() string { + return s.String() +} + +// SetSummaryMap sets the SummaryMap field's value. +func (s *GetAccountSummaryOutput) SetSummaryMap(v map[string]*int64) *GetAccountSummaryOutput { + s.SummaryMap = v + return s +} + +type GetContextKeysForCustomPolicyInput struct { + _ struct{} `type:"structure"` + + // A list of policies for which you want the list of context keys referenced + // in those policies. Each document is specified as a string containing the + // complete, valid JSON text of an IAM policy. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyInputList is a required field + PolicyInputList []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s GetContextKeysForCustomPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetContextKeysForCustomPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetContextKeysForCustomPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetContextKeysForCustomPolicyInput"} + if s.PolicyInputList == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyInputList")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyInputList sets the PolicyInputList field's value. +func (s *GetContextKeysForCustomPolicyInput) SetPolicyInputList(v []*string) *GetContextKeysForCustomPolicyInput { + s.PolicyInputList = v + return s +} + +// Contains the response to a successful GetContextKeysForPrincipalPolicy or +// GetContextKeysForCustomPolicy request. +type GetContextKeysForPolicyResponse struct { + _ struct{} `type:"structure"` + + // The list of context keys that are referenced in the input policies. + ContextKeyNames []*string `type:"list"` +} + +// String returns the string representation +func (s GetContextKeysForPolicyResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetContextKeysForPolicyResponse) GoString() string { + return s.String() +} + +// SetContextKeyNames sets the ContextKeyNames field's value. +func (s *GetContextKeysForPolicyResponse) SetContextKeyNames(v []*string) *GetContextKeysForPolicyResponse { + s.ContextKeyNames = v + return s +} + +type GetContextKeysForPrincipalPolicyInput struct { + _ struct{} `type:"structure"` + + // An optional list of additional policies for which you want the list of context + // keys that are referenced. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + PolicyInputList []*string `type:"list"` + + // The ARN of a user, group, or role whose policies contain the context keys + // that you want listed. If you specify a user, the list includes context keys + // that are found in all policies that are attached to the user. The list also + // includes all groups that the user is a member of. If you pick a group or + // a role, then it includes only those context keys that are found in policies + // attached to that entity. Note that all parameters are shown in unencoded + // form here for clarity, but must be URL encoded to be included as a part of + // a real HTML request. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicySourceArn is a required field + PolicySourceArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetContextKeysForPrincipalPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetContextKeysForPrincipalPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetContextKeysForPrincipalPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetContextKeysForPrincipalPolicyInput"} + if s.PolicySourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicySourceArn")) + } + if s.PolicySourceArn != nil && len(*s.PolicySourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicySourceArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyInputList sets the PolicyInputList field's value. +func (s *GetContextKeysForPrincipalPolicyInput) SetPolicyInputList(v []*string) *GetContextKeysForPrincipalPolicyInput { + s.PolicyInputList = v + return s +} + +// SetPolicySourceArn sets the PolicySourceArn field's value. +func (s *GetContextKeysForPrincipalPolicyInput) SetPolicySourceArn(v string) *GetContextKeysForPrincipalPolicyInput { + s.PolicySourceArn = &v + return s +} + +type GetCredentialReportInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetCredentialReportInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCredentialReportInput) GoString() string { + return s.String() +} + +// Contains the response to a successful GetCredentialReport request. +type GetCredentialReportOutput struct { + _ struct{} `type:"structure"` + + // Contains the credential report. The report is Base64-encoded. + // + // Content is automatically base64 encoded/decoded by the SDK. + Content []byte `type:"blob"` + + // The date and time when the credential report was created, in ISO 8601 date-time + // format (http://www.iso.org/iso/iso8601). + GeneratedTime *time.Time `type:"timestamp"` + + // The format (MIME type) of the credential report. + ReportFormat *string `type:"string" enum:"ReportFormatType"` +} + +// String returns the string representation +func (s GetCredentialReportOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCredentialReportOutput) GoString() string { + return s.String() +} + +// SetContent sets the Content field's value. +func (s *GetCredentialReportOutput) SetContent(v []byte) *GetCredentialReportOutput { + s.Content = v + return s +} + +// SetGeneratedTime sets the GeneratedTime field's value. +func (s *GetCredentialReportOutput) SetGeneratedTime(v time.Time) *GetCredentialReportOutput { + s.GeneratedTime = &v + return s +} + +// SetReportFormat sets the ReportFormat field's value. +func (s *GetCredentialReportOutput) SetReportFormat(v string) *GetCredentialReportOutput { + s.ReportFormat = &v + return s +} + +type GetGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the group. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s GetGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *GetGroupInput) SetGroupName(v string) *GetGroupInput { + s.GroupName = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *GetGroupInput) SetMarker(v string) *GetGroupInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *GetGroupInput) SetMaxItems(v int64) *GetGroupInput { + s.MaxItems = &v + return s +} + +// Contains the response to a successful GetGroup request. +type GetGroupOutput struct { + _ struct{} `type:"structure"` + + // A structure that contains details about the group. + // + // Group is a required field + Group *Group `type:"structure" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of users in the group. + // + // Users is a required field + Users []*User `type:"list" required:"true"` +} + +// String returns the string representation +func (s GetGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupOutput) GoString() string { + return s.String() +} + +// SetGroup sets the Group field's value. +func (s *GetGroupOutput) SetGroup(v *Group) *GetGroupOutput { + s.Group = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *GetGroupOutput) SetIsTruncated(v bool) *GetGroupOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *GetGroupOutput) SetMarker(v string) *GetGroupOutput { + s.Marker = &v + return s +} + +// SetUsers sets the Users field's value. +func (s *GetGroupOutput) SetUsers(v []*User) *GetGroupOutput { + s.Users = v + return s +} + +type GetGroupPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the group the policy is associated with. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The name of the policy document to get. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetGroupPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupPolicyInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *GetGroupPolicyInput) SetGroupName(v string) *GetGroupPolicyInput { + s.GroupName = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetGroupPolicyInput) SetPolicyName(v string) *GetGroupPolicyInput { + s.PolicyName = &v + return s +} + +// Contains the response to a successful GetGroupPolicy request. +type GetGroupPolicyOutput struct { + _ struct{} `type:"structure"` + + // The group the policy is associated with. + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The policy document. + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetGroupPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupPolicyOutput) GoString() string { + return s.String() +} + +// SetGroupName sets the GroupName field's value. +func (s *GetGroupPolicyOutput) SetGroupName(v string) *GetGroupPolicyOutput { + s.GroupName = &v + return s +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *GetGroupPolicyOutput) SetPolicyDocument(v string) *GetGroupPolicyOutput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetGroupPolicyOutput) SetPolicyName(v string) *GetGroupPolicyOutput { + s.PolicyName = &v + return s +} + +type GetInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the instance profile to get information about. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // InstanceProfileName is a required field + InstanceProfileName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetInstanceProfileInput"} + if s.InstanceProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) + } + if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *GetInstanceProfileInput) SetInstanceProfileName(v string) *GetInstanceProfileInput { + s.InstanceProfileName = &v + return s +} + +// Contains the response to a successful GetInstanceProfile request. +type GetInstanceProfileOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the instance profile. + // + // InstanceProfile is a required field + InstanceProfile *InstanceProfile `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInstanceProfileOutput) GoString() string { + return s.String() +} + +// SetInstanceProfile sets the InstanceProfile field's value. +func (s *GetInstanceProfileOutput) SetInstanceProfile(v *InstanceProfile) *GetInstanceProfileOutput { + s.InstanceProfile = v + return s +} + +type GetLoginProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the user whose login profile you want to retrieve. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetLoginProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoginProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetLoginProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetLoginProfileInput"} + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetUserName sets the UserName field's value. +func (s *GetLoginProfileInput) SetUserName(v string) *GetLoginProfileInput { + s.UserName = &v + return s +} + +// Contains the response to a successful GetLoginProfile request. +type GetLoginProfileOutput struct { + _ struct{} `type:"structure"` + + // A structure containing the user name and password create date for the user. + // + // LoginProfile is a required field + LoginProfile *LoginProfile `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetLoginProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoginProfileOutput) GoString() string { + return s.String() +} + +// SetLoginProfile sets the LoginProfile field's value. +func (s *GetLoginProfileOutput) SetLoginProfile(v *LoginProfile) *GetLoginProfileOutput { + s.LoginProfile = v + return s +} + +type GetOpenIDConnectProviderInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the OIDC provider resource object in IAM + // to get information for. You can get a list of OIDC provider resource ARNs + // by using the ListOpenIDConnectProviders operation. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // OpenIDConnectProviderArn is a required field + OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetOpenIDConnectProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetOpenIDConnectProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetOpenIDConnectProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetOpenIDConnectProviderInput"} + if s.OpenIDConnectProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) + } + if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. +func (s *GetOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *GetOpenIDConnectProviderInput { + s.OpenIDConnectProviderArn = &v + return s +} + +// Contains the response to a successful GetOpenIDConnectProvider request. +type GetOpenIDConnectProviderOutput struct { + _ struct{} `type:"structure"` + + // A list of client IDs (also known as audiences) that are associated with the + // specified IAM OIDC provider resource object. For more information, see CreateOpenIDConnectProvider. + ClientIDList []*string `type:"list"` + + // The date and time when the IAM OIDC provider resource object was created + // in the AWS account. + CreateDate *time.Time `type:"timestamp"` + + // A list of certificate thumbprints that are associated with the specified + // IAM OIDC provider resource object. For more information, see CreateOpenIDConnectProvider. + ThumbprintList []*string `type:"list"` + + // The URL that the IAM OIDC provider resource object is associated with. For + // more information, see CreateOpenIDConnectProvider. + Url *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GetOpenIDConnectProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetOpenIDConnectProviderOutput) GoString() string { + return s.String() +} + +// SetClientIDList sets the ClientIDList field's value. +func (s *GetOpenIDConnectProviderOutput) SetClientIDList(v []*string) *GetOpenIDConnectProviderOutput { + s.ClientIDList = v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *GetOpenIDConnectProviderOutput) SetCreateDate(v time.Time) *GetOpenIDConnectProviderOutput { + s.CreateDate = &v + return s +} + +// SetThumbprintList sets the ThumbprintList field's value. +func (s *GetOpenIDConnectProviderOutput) SetThumbprintList(v []*string) *GetOpenIDConnectProviderOutput { + s.ThumbprintList = v + return s +} + +// SetUrl sets the Url field's value. +func (s *GetOpenIDConnectProviderOutput) SetUrl(v string) *GetOpenIDConnectProviderOutput { + s.Url = &v + return s +} + +type GetPolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the managed policy that you want information + // about. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *GetPolicyInput) SetPolicyArn(v string) *GetPolicyInput { + s.PolicyArn = &v + return s +} + +// Contains the response to a successful GetPolicy request. +type GetPolicyOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the policy. + Policy *Policy `type:"structure"` +} + +// String returns the string representation +func (s GetPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetPolicyOutput) SetPolicy(v *Policy) *GetPolicyOutput { + s.Policy = v + return s +} + +type GetPolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the managed policy that you want information + // about. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // Identifies the policy version to retrieve. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that consists of the lowercase letter 'v' followed + // by one or two digits, and optionally followed by a period '.' and a string + // of letters and digits. + // + // VersionId is a required field + VersionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPolicyVersionInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.VersionId == nil { + invalidParams.Add(request.NewErrParamRequired("VersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *GetPolicyVersionInput) SetPolicyArn(v string) *GetPolicyVersionInput { + s.PolicyArn = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *GetPolicyVersionInput) SetVersionId(v string) *GetPolicyVersionInput { + s.VersionId = &v + return s +} + +// Contains the response to a successful GetPolicyVersion request. +type GetPolicyVersionOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the policy version. + PolicyVersion *PolicyVersion `type:"structure"` +} + +// String returns the string representation +func (s GetPolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyVersionOutput) GoString() string { + return s.String() +} + +// SetPolicyVersion sets the PolicyVersion field's value. +func (s *GetPolicyVersionOutput) SetPolicyVersion(v *PolicyVersion) *GetPolicyVersionOutput { + s.PolicyVersion = v + return s +} + +type GetRoleInput struct { + _ struct{} `type:"structure"` + + // The name of the IAM role to get information about. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRoleInput"} + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRoleName sets the RoleName field's value. +func (s *GetRoleInput) SetRoleName(v string) *GetRoleInput { + s.RoleName = &v + return s +} + +// Contains the response to a successful GetRole request. +type GetRoleOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the IAM role. + // + // Role is a required field + Role *Role `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRoleOutput) GoString() string { + return s.String() +} + +// SetRole sets the Role field's value. +func (s *GetRoleOutput) SetRole(v *Role) *GetRoleOutput { + s.Role = v + return s +} + +type GetRolePolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the policy document to get. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The name of the role associated with the policy. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetRolePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRolePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRolePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRolePolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetRolePolicyInput) SetPolicyName(v string) *GetRolePolicyInput { + s.PolicyName = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *GetRolePolicyInput) SetRoleName(v string) *GetRolePolicyInput { + s.RoleName = &v + return s +} + +// Contains the response to a successful GetRolePolicy request. +type GetRolePolicyOutput struct { + _ struct{} `type:"structure"` + + // The policy document. + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The role the policy is associated with. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetRolePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRolePolicyOutput) GoString() string { + return s.String() +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *GetRolePolicyOutput) SetPolicyDocument(v string) *GetRolePolicyOutput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetRolePolicyOutput) SetPolicyName(v string) *GetRolePolicyOutput { + s.PolicyName = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *GetRolePolicyOutput) SetRoleName(v string) *GetRolePolicyOutput { + s.RoleName = &v + return s +} + +type GetSAMLProviderInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the SAML provider resource object in IAM + // to get information about. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // SAMLProviderArn is a required field + SAMLProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetSAMLProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSAMLProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSAMLProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSAMLProviderInput"} + if s.SAMLProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLProviderArn")) + } + if s.SAMLProviderArn != nil && len(*s.SAMLProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("SAMLProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSAMLProviderArn sets the SAMLProviderArn field's value. +func (s *GetSAMLProviderInput) SetSAMLProviderArn(v string) *GetSAMLProviderInput { + s.SAMLProviderArn = &v + return s +} + +// Contains the response to a successful GetSAMLProvider request. +type GetSAMLProviderOutput struct { + _ struct{} `type:"structure"` + + // The date and time when the SAML provider was created. + CreateDate *time.Time `type:"timestamp"` + + // The XML metadata document that includes information about an identity provider. + SAMLMetadataDocument *string `min:"1000" type:"string"` + + // The expiration date and time for the SAML provider. + ValidUntil *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s GetSAMLProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSAMLProviderOutput) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *GetSAMLProviderOutput) SetCreateDate(v time.Time) *GetSAMLProviderOutput { + s.CreateDate = &v + return s +} + +// SetSAMLMetadataDocument sets the SAMLMetadataDocument field's value. +func (s *GetSAMLProviderOutput) SetSAMLMetadataDocument(v string) *GetSAMLProviderOutput { + s.SAMLMetadataDocument = &v + return s +} + +// SetValidUntil sets the ValidUntil field's value. +func (s *GetSAMLProviderOutput) SetValidUntil(v time.Time) *GetSAMLProviderOutput { + s.ValidUntil = &v + return s +} + +type GetSSHPublicKeyInput struct { + _ struct{} `type:"structure"` + + // Specifies the public key encoding format to use in the response. To retrieve + // the public key in ssh-rsa format, use SSH. To retrieve the public key in + // PEM format, use PEM. + // + // Encoding is a required field + Encoding *string `type:"string" required:"true" enum:"encodingType"` + + // The unique identifier for the SSH public key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // SSHPublicKeyId is a required field + SSHPublicKeyId *string `min:"20" type:"string" required:"true"` + + // The name of the IAM user associated with the SSH public key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetSSHPublicKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSSHPublicKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSSHPublicKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSSHPublicKeyInput"} + if s.Encoding == nil { + invalidParams.Add(request.NewErrParamRequired("Encoding")) + } + if s.SSHPublicKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyId")) + } + if s.SSHPublicKeyId != nil && len(*s.SSHPublicKeyId) < 20 { + invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyId", 20)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEncoding sets the Encoding field's value. +func (s *GetSSHPublicKeyInput) SetEncoding(v string) *GetSSHPublicKeyInput { + s.Encoding = &v + return s +} + +// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. +func (s *GetSSHPublicKeyInput) SetSSHPublicKeyId(v string) *GetSSHPublicKeyInput { + s.SSHPublicKeyId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *GetSSHPublicKeyInput) SetUserName(v string) *GetSSHPublicKeyInput { + s.UserName = &v + return s +} + +// Contains the response to a successful GetSSHPublicKey request. +type GetSSHPublicKeyOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the SSH public key. + SSHPublicKey *SSHPublicKey `type:"structure"` +} + +// String returns the string representation +func (s GetSSHPublicKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSSHPublicKeyOutput) GoString() string { + return s.String() +} + +// SetSSHPublicKey sets the SSHPublicKey field's value. +func (s *GetSSHPublicKeyOutput) SetSSHPublicKey(v *SSHPublicKey) *GetSSHPublicKeyOutput { + s.SSHPublicKey = v + return s +} + +type GetServerCertificateInput struct { + _ struct{} `type:"structure"` + + // The name of the server certificate you want to retrieve information about. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // ServerCertificateName is a required field + ServerCertificateName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetServerCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServerCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetServerCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetServerCertificateInput"} + if s.ServerCertificateName == nil { + invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) + } + if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServerCertificateName sets the ServerCertificateName field's value. +func (s *GetServerCertificateInput) SetServerCertificateName(v string) *GetServerCertificateInput { + s.ServerCertificateName = &v + return s +} + +// Contains the response to a successful GetServerCertificate request. +type GetServerCertificateOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the server certificate. + // + // ServerCertificate is a required field + ServerCertificate *ServerCertificate `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetServerCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServerCertificateOutput) GoString() string { + return s.String() +} + +// SetServerCertificate sets the ServerCertificate field's value. +func (s *GetServerCertificateOutput) SetServerCertificate(v *ServerCertificate) *GetServerCertificateOutput { + s.ServerCertificate = v + return s +} + +type GetServiceLinkedRoleDeletionStatusInput struct { + _ struct{} `type:"structure"` + + // The deletion task identifier. This identifier is returned by the DeleteServiceLinkedRole + // operation in the format task/aws-service-role///. + // + // DeletionTaskId is a required field + DeletionTaskId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetServiceLinkedRoleDeletionStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceLinkedRoleDeletionStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetServiceLinkedRoleDeletionStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetServiceLinkedRoleDeletionStatusInput"} + if s.DeletionTaskId == nil { + invalidParams.Add(request.NewErrParamRequired("DeletionTaskId")) + } + if s.DeletionTaskId != nil && len(*s.DeletionTaskId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeletionTaskId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeletionTaskId sets the DeletionTaskId field's value. +func (s *GetServiceLinkedRoleDeletionStatusInput) SetDeletionTaskId(v string) *GetServiceLinkedRoleDeletionStatusInput { + s.DeletionTaskId = &v + return s +} + +type GetServiceLinkedRoleDeletionStatusOutput struct { + _ struct{} `type:"structure"` + + // An object that contains details about the reason the deletion failed. + Reason *DeletionTaskFailureReasonType `type:"structure"` + + // The status of the deletion. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"DeletionTaskStatusType"` +} + +// String returns the string representation +func (s GetServiceLinkedRoleDeletionStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceLinkedRoleDeletionStatusOutput) GoString() string { + return s.String() +} + +// SetReason sets the Reason field's value. +func (s *GetServiceLinkedRoleDeletionStatusOutput) SetReason(v *DeletionTaskFailureReasonType) *GetServiceLinkedRoleDeletionStatusOutput { + s.Reason = v + return s +} + +// SetStatus sets the Status field's value. +func (s *GetServiceLinkedRoleDeletionStatusOutput) SetStatus(v string) *GetServiceLinkedRoleDeletionStatusOutput { + s.Status = &v + return s +} + +type GetUserInput struct { + _ struct{} `type:"structure"` + + // The name of the user to get information about. + // + // This parameter is optional. If it is not included, it defaults to the user + // making the request. This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GetUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetUserInput"} + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetUserName sets the UserName field's value. +func (s *GetUserInput) SetUserName(v string) *GetUserInput { + s.UserName = &v + return s +} + +// Contains the response to a successful GetUser request. +type GetUserOutput struct { + _ struct{} `type:"structure"` + + // A structure containing details about the IAM user. + // + // Due to a service issue, password last used data does not include password + // use from May 3rd 2018 22:50 PDT to May 23rd 2018 14:08 PDT. This affects + // last sign-in (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_finding-unused.html) + // dates shown in the IAM console and password last used dates in the IAM credential + // report (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html), + // and returned by this GetUser API. If users signed in during the affected + // time, the password last used date that is returned is the date the user last + // signed in before May 3rd 2018. For users that signed in after May 23rd 2018 + // 14:08 PDT, the returned password last used date is accurate. + // + // If you use password last used information to identify unused credentials + // for deletion, such as deleting users who did not sign in to AWS in the last + // 90 days, we recommend that you adjust your evaluation window to include dates + // after May 23rd 2018. Alternatively, if your users use access keys to access + // AWS programmatically you can refer to access key last used information because + // it is accurate for all dates. + // + // User is a required field + User *User `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetUserOutput) GoString() string { + return s.String() +} + +// SetUser sets the User field's value. +func (s *GetUserOutput) SetUser(v *User) *GetUserOutput { + s.User = v + return s +} + +type GetUserPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the policy document to get. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The name of the user who the policy is associated with. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetUserPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetUserPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetUserPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetUserPolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetUserPolicyInput) SetPolicyName(v string) *GetUserPolicyInput { + s.PolicyName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *GetUserPolicyInput) SetUserName(v string) *GetUserPolicyInput { + s.UserName = &v + return s +} + +// Contains the response to a successful GetUserPolicy request. +type GetUserPolicyOutput struct { + _ struct{} `type:"structure"` + + // The policy document. + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The user the policy is associated with. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetUserPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetUserPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *GetUserPolicyOutput) SetPolicyDocument(v string) *GetUserPolicyOutput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetUserPolicyOutput) SetPolicyName(v string) *GetUserPolicyOutput { + s.PolicyName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *GetUserPolicyOutput) SetUserName(v string) *GetUserPolicyOutput { + s.UserName = &v + return s +} + +// Contains information about an IAM group entity. +// +// This data type is used as a response element in the following operations: +// +// * CreateGroup +// +// * GetGroup +// +// * ListGroups +type Group struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) specifying the group. For more information + // about ARNs and how to use them in policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Arn is a required field + Arn *string `min:"20" type:"string" required:"true"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the group was created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // The stable and unique string identifying the group. For more information + // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // GroupId is a required field + GroupId *string `min:"16" type:"string" required:"true"` + + // The friendly name that identifies the group. + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The path to the group. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Path is a required field + Path *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s Group) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Group) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Group) SetArn(v string) *Group { + s.Arn = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *Group) SetCreateDate(v time.Time) *Group { + s.CreateDate = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *Group) SetGroupId(v string) *Group { + s.GroupId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *Group) SetGroupName(v string) *Group { + s.GroupName = &v + return s +} + +// SetPath sets the Path field's value. +func (s *Group) SetPath(v string) *Group { + s.Path = &v + return s +} + +// Contains information about an IAM group, including all of the group's policies. +// +// This data type is used as a response element in the GetAccountAuthorizationDetails +// operation. +type GroupDetail struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `min:"20" type:"string"` + + // A list of the managed policies attached to the group. + AttachedManagedPolicies []*AttachedPolicy `type:"list"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the group was created. + CreateDate *time.Time `type:"timestamp"` + + // The stable and unique string identifying the group. For more information + // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + GroupId *string `min:"16" type:"string"` + + // The friendly name that identifies the group. + GroupName *string `min:"1" type:"string"` + + // A list of the inline policies embedded in the group. + GroupPolicyList []*PolicyDetail `type:"list"` + + // The path to the group. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + Path *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GroupDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupDetail) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GroupDetail) SetArn(v string) *GroupDetail { + s.Arn = &v + return s +} + +// SetAttachedManagedPolicies sets the AttachedManagedPolicies field's value. +func (s *GroupDetail) SetAttachedManagedPolicies(v []*AttachedPolicy) *GroupDetail { + s.AttachedManagedPolicies = v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *GroupDetail) SetCreateDate(v time.Time) *GroupDetail { + s.CreateDate = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *GroupDetail) SetGroupId(v string) *GroupDetail { + s.GroupId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *GroupDetail) SetGroupName(v string) *GroupDetail { + s.GroupName = &v + return s +} + +// SetGroupPolicyList sets the GroupPolicyList field's value. +func (s *GroupDetail) SetGroupPolicyList(v []*PolicyDetail) *GroupDetail { + s.GroupPolicyList = v + return s +} + +// SetPath sets the Path field's value. +func (s *GroupDetail) SetPath(v string) *GroupDetail { + s.Path = &v + return s +} + +// Contains information about an instance profile. +// +// This data type is used as a response element in the following operations: +// +// * CreateInstanceProfile +// +// * GetInstanceProfile +// +// * ListInstanceProfiles +// +// * ListInstanceProfilesForRole +type InstanceProfile struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) specifying the instance profile. For more + // information about ARNs and how to use them in policies, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Arn is a required field + Arn *string `min:"20" type:"string" required:"true"` + + // The date when the instance profile was created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // The stable and unique string identifying the instance profile. For more information + // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // InstanceProfileId is a required field + InstanceProfileId *string `min:"16" type:"string" required:"true"` + + // The name identifying the instance profile. + // + // InstanceProfileName is a required field + InstanceProfileName *string `min:"1" type:"string" required:"true"` + + // The path to the instance profile. For more information about paths, see IAM + // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Path is a required field + Path *string `min:"1" type:"string" required:"true"` + + // The role associated with the instance profile. + // + // Roles is a required field + Roles []*Role `type:"list" required:"true"` +} + +// String returns the string representation +func (s InstanceProfile) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceProfile) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *InstanceProfile) SetArn(v string) *InstanceProfile { + s.Arn = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *InstanceProfile) SetCreateDate(v time.Time) *InstanceProfile { + s.CreateDate = &v + return s +} + +// SetInstanceProfileId sets the InstanceProfileId field's value. +func (s *InstanceProfile) SetInstanceProfileId(v string) *InstanceProfile { + s.InstanceProfileId = &v + return s +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *InstanceProfile) SetInstanceProfileName(v string) *InstanceProfile { + s.InstanceProfileName = &v + return s +} + +// SetPath sets the Path field's value. +func (s *InstanceProfile) SetPath(v string) *InstanceProfile { + s.Path = &v + return s +} + +// SetRoles sets the Roles field's value. +func (s *InstanceProfile) SetRoles(v []*Role) *InstanceProfile { + s.Roles = v + return s +} + +type ListAccessKeysInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the user. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAccessKeysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccessKeysInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAccessKeysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAccessKeysInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListAccessKeysInput) SetMarker(v string) *ListAccessKeysInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListAccessKeysInput) SetMaxItems(v int64) *ListAccessKeysInput { + s.MaxItems = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListAccessKeysInput) SetUserName(v string) *ListAccessKeysInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListAccessKeys request. +type ListAccessKeysOutput struct { + _ struct{} `type:"structure"` + + // A list of objects containing metadata about the access keys. + // + // AccessKeyMetadata is a required field + AccessKeyMetadata []*AccessKeyMetadata `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAccessKeysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccessKeysOutput) GoString() string { + return s.String() +} + +// SetAccessKeyMetadata sets the AccessKeyMetadata field's value. +func (s *ListAccessKeysOutput) SetAccessKeyMetadata(v []*AccessKeyMetadata) *ListAccessKeysOutput { + s.AccessKeyMetadata = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListAccessKeysOutput) SetIsTruncated(v bool) *ListAccessKeysOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListAccessKeysOutput) SetMarker(v string) *ListAccessKeysOutput { + s.Marker = &v + return s +} + +type ListAccountAliasesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListAccountAliasesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccountAliasesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAccountAliasesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAccountAliasesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListAccountAliasesInput) SetMarker(v string) *ListAccountAliasesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListAccountAliasesInput) SetMaxItems(v int64) *ListAccountAliasesInput { + s.MaxItems = &v + return s +} + +// Contains the response to a successful ListAccountAliases request. +type ListAccountAliasesOutput struct { + _ struct{} `type:"structure"` + + // A list of aliases associated with the account. AWS supports only one alias + // per account. + // + // AccountAliases is a required field + AccountAliases []*string `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAccountAliasesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccountAliasesOutput) GoString() string { + return s.String() +} + +// SetAccountAliases sets the AccountAliases field's value. +func (s *ListAccountAliasesOutput) SetAccountAliases(v []*string) *ListAccountAliasesOutput { + s.AccountAliases = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListAccountAliasesOutput) SetIsTruncated(v bool) *ListAccountAliasesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListAccountAliasesOutput) SetMarker(v string) *ListAccountAliasesOutput { + s.Marker = &v + return s +} + +type ListAttachedGroupPoliciesInput struct { + _ struct{} `type:"structure"` + + // The name (friendly name, not ARN) of the group to list attached policies + // for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. This parameter is optional. If + // it is not included, it defaults to a slash (/), listing all policies. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `type:"string"` +} + +// String returns the string representation +func (s ListAttachedGroupPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAttachedGroupPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAttachedGroupPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAttachedGroupPoliciesInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *ListAttachedGroupPoliciesInput) SetGroupName(v string) *ListAttachedGroupPoliciesInput { + s.GroupName = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListAttachedGroupPoliciesInput) SetMarker(v string) *ListAttachedGroupPoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListAttachedGroupPoliciesInput) SetMaxItems(v int64) *ListAttachedGroupPoliciesInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListAttachedGroupPoliciesInput) SetPathPrefix(v string) *ListAttachedGroupPoliciesInput { + s.PathPrefix = &v + return s +} + +// Contains the response to a successful ListAttachedGroupPolicies request. +type ListAttachedGroupPoliciesOutput struct { + _ struct{} `type:"structure"` + + // A list of the attached policies. + AttachedPolicies []*AttachedPolicy `type:"list"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAttachedGroupPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAttachedGroupPoliciesOutput) GoString() string { + return s.String() +} + +// SetAttachedPolicies sets the AttachedPolicies field's value. +func (s *ListAttachedGroupPoliciesOutput) SetAttachedPolicies(v []*AttachedPolicy) *ListAttachedGroupPoliciesOutput { + s.AttachedPolicies = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListAttachedGroupPoliciesOutput) SetIsTruncated(v bool) *ListAttachedGroupPoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListAttachedGroupPoliciesOutput) SetMarker(v string) *ListAttachedGroupPoliciesOutput { + s.Marker = &v + return s +} + +type ListAttachedRolePoliciesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. This parameter is optional. If + // it is not included, it defaults to a slash (/), listing all policies. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `type:"string"` + + // The name (friendly name, not ARN) of the role to list attached policies for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListAttachedRolePoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAttachedRolePoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAttachedRolePoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAttachedRolePoliciesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListAttachedRolePoliciesInput) SetMarker(v string) *ListAttachedRolePoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListAttachedRolePoliciesInput) SetMaxItems(v int64) *ListAttachedRolePoliciesInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListAttachedRolePoliciesInput) SetPathPrefix(v string) *ListAttachedRolePoliciesInput { + s.PathPrefix = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *ListAttachedRolePoliciesInput) SetRoleName(v string) *ListAttachedRolePoliciesInput { + s.RoleName = &v + return s +} + +// Contains the response to a successful ListAttachedRolePolicies request. +type ListAttachedRolePoliciesOutput struct { + _ struct{} `type:"structure"` + + // A list of the attached policies. + AttachedPolicies []*AttachedPolicy `type:"list"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAttachedRolePoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAttachedRolePoliciesOutput) GoString() string { + return s.String() +} + +// SetAttachedPolicies sets the AttachedPolicies field's value. +func (s *ListAttachedRolePoliciesOutput) SetAttachedPolicies(v []*AttachedPolicy) *ListAttachedRolePoliciesOutput { + s.AttachedPolicies = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListAttachedRolePoliciesOutput) SetIsTruncated(v bool) *ListAttachedRolePoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListAttachedRolePoliciesOutput) SetMarker(v string) *ListAttachedRolePoliciesOutput { + s.Marker = &v + return s +} + +type ListAttachedUserPoliciesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. This parameter is optional. If + // it is not included, it defaults to a slash (/), listing all policies. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `type:"string"` + + // The name (friendly name, not ARN) of the user to list attached policies for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListAttachedUserPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAttachedUserPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAttachedUserPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAttachedUserPoliciesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListAttachedUserPoliciesInput) SetMarker(v string) *ListAttachedUserPoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListAttachedUserPoliciesInput) SetMaxItems(v int64) *ListAttachedUserPoliciesInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListAttachedUserPoliciesInput) SetPathPrefix(v string) *ListAttachedUserPoliciesInput { + s.PathPrefix = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListAttachedUserPoliciesInput) SetUserName(v string) *ListAttachedUserPoliciesInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListAttachedUserPolicies request. +type ListAttachedUserPoliciesOutput struct { + _ struct{} `type:"structure"` + + // A list of the attached policies. + AttachedPolicies []*AttachedPolicy `type:"list"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAttachedUserPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAttachedUserPoliciesOutput) GoString() string { + return s.String() +} + +// SetAttachedPolicies sets the AttachedPolicies field's value. +func (s *ListAttachedUserPoliciesOutput) SetAttachedPolicies(v []*AttachedPolicy) *ListAttachedUserPoliciesOutput { + s.AttachedPolicies = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListAttachedUserPoliciesOutput) SetIsTruncated(v bool) *ListAttachedUserPoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListAttachedUserPoliciesOutput) SetMarker(v string) *ListAttachedUserPoliciesOutput { + s.Marker = &v + return s +} + +type ListEntitiesForPolicyInput struct { + _ struct{} `type:"structure"` + + // The entity type to use for filtering the results. + // + // For example, when EntityFilter is Role, only the roles that are attached + // to the specified policy are returned. This parameter is optional. If it is + // not included, all attached entities (users, groups, and roles) are returned. + // The argument for this parameter must be one of the valid values listed below. + EntityFilter *string `type:"string" enum:"EntityType"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. This parameter is optional. If + // it is not included, it defaults to a slash (/), listing all entities. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the IAM policy for which you want the versions. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The policy usage method to use for filtering the results. + // + // To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy. + // To list only the policies used to set permissions boundaries, set the value + // to PermissionsBoundary. + // + // This parameter is optional. If it is not included, all policies are returned. + PolicyUsageFilter *string `type:"string" enum:"PolicyUsageType"` +} + +// String returns the string representation +func (s ListEntitiesForPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEntitiesForPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEntitiesForPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEntitiesForPolicyInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) + } + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityFilter sets the EntityFilter field's value. +func (s *ListEntitiesForPolicyInput) SetEntityFilter(v string) *ListEntitiesForPolicyInput { + s.EntityFilter = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListEntitiesForPolicyInput) SetMarker(v string) *ListEntitiesForPolicyInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListEntitiesForPolicyInput) SetMaxItems(v int64) *ListEntitiesForPolicyInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListEntitiesForPolicyInput) SetPathPrefix(v string) *ListEntitiesForPolicyInput { + s.PathPrefix = &v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *ListEntitiesForPolicyInput) SetPolicyArn(v string) *ListEntitiesForPolicyInput { + s.PolicyArn = &v + return s +} + +// SetPolicyUsageFilter sets the PolicyUsageFilter field's value. +func (s *ListEntitiesForPolicyInput) SetPolicyUsageFilter(v string) *ListEntitiesForPolicyInput { + s.PolicyUsageFilter = &v + return s +} + +// Contains the response to a successful ListEntitiesForPolicy request. +type ListEntitiesForPolicyOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of IAM groups that the policy is attached to. + PolicyGroups []*PolicyGroup `type:"list"` + + // A list of IAM roles that the policy is attached to. + PolicyRoles []*PolicyRole `type:"list"` + + // A list of IAM users that the policy is attached to. + PolicyUsers []*PolicyUser `type:"list"` +} + +// String returns the string representation +func (s ListEntitiesForPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEntitiesForPolicyOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListEntitiesForPolicyOutput) SetIsTruncated(v bool) *ListEntitiesForPolicyOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListEntitiesForPolicyOutput) SetMarker(v string) *ListEntitiesForPolicyOutput { + s.Marker = &v + return s +} + +// SetPolicyGroups sets the PolicyGroups field's value. +func (s *ListEntitiesForPolicyOutput) SetPolicyGroups(v []*PolicyGroup) *ListEntitiesForPolicyOutput { + s.PolicyGroups = v + return s +} + +// SetPolicyRoles sets the PolicyRoles field's value. +func (s *ListEntitiesForPolicyOutput) SetPolicyRoles(v []*PolicyRole) *ListEntitiesForPolicyOutput { + s.PolicyRoles = v + return s +} + +// SetPolicyUsers sets the PolicyUsers field's value. +func (s *ListEntitiesForPolicyOutput) SetPolicyUsers(v []*PolicyUser) *ListEntitiesForPolicyOutput { + s.PolicyUsers = v + return s +} + +type ListGroupPoliciesInput struct { + _ struct{} `type:"structure"` + + // The name of the group to list policies for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListGroupPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupPoliciesInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *ListGroupPoliciesInput) SetGroupName(v string) *ListGroupPoliciesInput { + s.GroupName = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListGroupPoliciesInput) SetMarker(v string) *ListGroupPoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListGroupPoliciesInput) SetMaxItems(v int64) *ListGroupPoliciesInput { + s.MaxItems = &v + return s +} + +// Contains the response to a successful ListGroupPolicies request. +type ListGroupPoliciesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of policy names. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyNames is a required field + PolicyNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListGroupPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupPoliciesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListGroupPoliciesOutput) SetIsTruncated(v bool) *ListGroupPoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListGroupPoliciesOutput) SetMarker(v string) *ListGroupPoliciesOutput { + s.Marker = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *ListGroupPoliciesOutput) SetPolicyNames(v []*string) *ListGroupPoliciesOutput { + s.PolicyNames = v + return s +} + +type ListGroupsForUserInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the user to list groups for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListGroupsForUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupsForUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupsForUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupsForUserInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListGroupsForUserInput) SetMarker(v string) *ListGroupsForUserInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListGroupsForUserInput) SetMaxItems(v int64) *ListGroupsForUserInput { + s.MaxItems = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListGroupsForUserInput) SetUserName(v string) *ListGroupsForUserInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListGroupsForUser request. +type ListGroupsForUserOutput struct { + _ struct{} `type:"structure"` + + // A list of groups. + // + // Groups is a required field + Groups []*Group `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGroupsForUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupsForUserOutput) GoString() string { + return s.String() +} + +// SetGroups sets the Groups field's value. +func (s *ListGroupsForUserOutput) SetGroups(v []*Group) *ListGroupsForUserOutput { + s.Groups = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListGroupsForUserOutput) SetIsTruncated(v bool) *ListGroupsForUserOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListGroupsForUserOutput) SetMarker(v string) *ListGroupsForUserOutput { + s.Marker = &v + return s +} + +type ListGroupsInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. For example, the prefix /division_abc/subdivision_xyz/ + // gets all groups whose path starts with /division_abc/subdivision_xyz/. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/), listing all groups. This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupsInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListGroupsInput) SetMarker(v string) *ListGroupsInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListGroupsInput) SetMaxItems(v int64) *ListGroupsInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListGroupsInput) SetPathPrefix(v string) *ListGroupsInput { + s.PathPrefix = &v + return s +} + +// Contains the response to a successful ListGroups request. +type ListGroupsOutput struct { + _ struct{} `type:"structure"` + + // A list of groups. + // + // Groups is a required field + Groups []*Group `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupsOutput) GoString() string { + return s.String() +} + +// SetGroups sets the Groups field's value. +func (s *ListGroupsOutput) SetGroups(v []*Group) *ListGroupsOutput { + s.Groups = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListGroupsOutput) SetIsTruncated(v bool) *ListGroupsOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListGroupsOutput) SetMarker(v string) *ListGroupsOutput { + s.Marker = &v + return s +} + +type ListInstanceProfilesForRoleInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the role to list instance profiles for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListInstanceProfilesForRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListInstanceProfilesForRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListInstanceProfilesForRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListInstanceProfilesForRoleInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListInstanceProfilesForRoleInput) SetMarker(v string) *ListInstanceProfilesForRoleInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListInstanceProfilesForRoleInput) SetMaxItems(v int64) *ListInstanceProfilesForRoleInput { + s.MaxItems = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *ListInstanceProfilesForRoleInput) SetRoleName(v string) *ListInstanceProfilesForRoleInput { + s.RoleName = &v + return s +} + +// Contains the response to a successful ListInstanceProfilesForRole request. +type ListInstanceProfilesForRoleOutput struct { + _ struct{} `type:"structure"` + + // A list of instance profiles. + // + // InstanceProfiles is a required field + InstanceProfiles []*InstanceProfile `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListInstanceProfilesForRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListInstanceProfilesForRoleOutput) GoString() string { + return s.String() +} + +// SetInstanceProfiles sets the InstanceProfiles field's value. +func (s *ListInstanceProfilesForRoleOutput) SetInstanceProfiles(v []*InstanceProfile) *ListInstanceProfilesForRoleOutput { + s.InstanceProfiles = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListInstanceProfilesForRoleOutput) SetIsTruncated(v bool) *ListInstanceProfilesForRoleOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListInstanceProfilesForRoleOutput) SetMarker(v string) *ListInstanceProfilesForRoleOutput { + s.Marker = &v + return s +} + +type ListInstanceProfilesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ + // gets all instance profiles whose path starts with /application_abc/component_xyz/. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/), listing all instance profiles. This parameter allows (per its regex + // pattern (http://wikipedia.org/wiki/regex)) a string of characters consisting + // of either a forward slash (/) by itself or a string that must begin and end + // with forward slashes. In addition, it can contain any ASCII character from + // the ! (\u0021) through the DEL character (\u007F), including most punctuation + // characters, digits, and upper and lowercased letters. + PathPrefix *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListInstanceProfilesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListInstanceProfilesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListInstanceProfilesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListInstanceProfilesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListInstanceProfilesInput) SetMarker(v string) *ListInstanceProfilesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListInstanceProfilesInput) SetMaxItems(v int64) *ListInstanceProfilesInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListInstanceProfilesInput) SetPathPrefix(v string) *ListInstanceProfilesInput { + s.PathPrefix = &v + return s +} + +// Contains the response to a successful ListInstanceProfiles request. +type ListInstanceProfilesOutput struct { + _ struct{} `type:"structure"` + + // A list of instance profiles. + // + // InstanceProfiles is a required field + InstanceProfiles []*InstanceProfile `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListInstanceProfilesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListInstanceProfilesOutput) GoString() string { + return s.String() +} + +// SetInstanceProfiles sets the InstanceProfiles field's value. +func (s *ListInstanceProfilesOutput) SetInstanceProfiles(v []*InstanceProfile) *ListInstanceProfilesOutput { + s.InstanceProfiles = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListInstanceProfilesOutput) SetIsTruncated(v bool) *ListInstanceProfilesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListInstanceProfilesOutput) SetMarker(v string) *ListInstanceProfilesOutput { + s.Marker = &v + return s +} + +type ListMFADevicesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the user whose MFA devices you want to list. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListMFADevicesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMFADevicesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListMFADevicesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMFADevicesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListMFADevicesInput) SetMarker(v string) *ListMFADevicesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListMFADevicesInput) SetMaxItems(v int64) *ListMFADevicesInput { + s.MaxItems = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListMFADevicesInput) SetUserName(v string) *ListMFADevicesInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListMFADevices request. +type ListMFADevicesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // A list of MFA devices. + // + // MFADevices is a required field + MFADevices []*MFADevice `type:"list" required:"true"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListMFADevicesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMFADevicesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListMFADevicesOutput) SetIsTruncated(v bool) *ListMFADevicesOutput { + s.IsTruncated = &v + return s +} + +// SetMFADevices sets the MFADevices field's value. +func (s *ListMFADevicesOutput) SetMFADevices(v []*MFADevice) *ListMFADevicesOutput { + s.MFADevices = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListMFADevicesOutput) SetMarker(v string) *ListMFADevicesOutput { + s.Marker = &v + return s +} + +type ListOpenIDConnectProvidersInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ListOpenIDConnectProvidersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOpenIDConnectProvidersInput) GoString() string { + return s.String() +} + +// Contains the response to a successful ListOpenIDConnectProviders request. +type ListOpenIDConnectProvidersOutput struct { + _ struct{} `type:"structure"` + + // The list of IAM OIDC provider resource objects defined in the AWS account. + OpenIDConnectProviderList []*OpenIDConnectProviderListEntry `type:"list"` +} + +// String returns the string representation +func (s ListOpenIDConnectProvidersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOpenIDConnectProvidersOutput) GoString() string { + return s.String() +} + +// SetOpenIDConnectProviderList sets the OpenIDConnectProviderList field's value. +func (s *ListOpenIDConnectProvidersOutput) SetOpenIDConnectProviderList(v []*OpenIDConnectProviderListEntry) *ListOpenIDConnectProvidersOutput { + s.OpenIDConnectProviderList = v + return s +} + +type ListPoliciesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // A flag to filter the results to only the attached policies. + // + // When OnlyAttached is true, the returned list contains only the policies that + // are attached to an IAM user, group, or role. When OnlyAttached is false, + // or when the parameter is not included, all policies are returned. + OnlyAttached *bool `type:"boolean"` + + // The path prefix for filtering the results. This parameter is optional. If + // it is not included, it defaults to a slash (/), listing all policies. This + // parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `type:"string"` + + // The policy usage method to use for filtering the results. + // + // To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy. + // To list only the policies used to set permissions boundaries, set the value + // to PermissionsBoundary. + // + // This parameter is optional. If it is not included, all policies are returned. + PolicyUsageFilter *string `type:"string" enum:"PolicyUsageType"` + + // The scope to use for filtering the results. + // + // To list only AWS managed policies, set Scope to AWS. To list only the customer + // managed policies in your AWS account, set Scope to Local. + // + // This parameter is optional. If it is not included, or if it is set to All, + // all policies are returned. + Scope *string `type:"string" enum:"policyScopeType"` +} + +// String returns the string representation +func (s ListPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPoliciesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListPoliciesInput) SetMarker(v string) *ListPoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListPoliciesInput) SetMaxItems(v int64) *ListPoliciesInput { + s.MaxItems = &v + return s +} + +// SetOnlyAttached sets the OnlyAttached field's value. +func (s *ListPoliciesInput) SetOnlyAttached(v bool) *ListPoliciesInput { + s.OnlyAttached = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListPoliciesInput) SetPathPrefix(v string) *ListPoliciesInput { + s.PathPrefix = &v + return s +} + +// SetPolicyUsageFilter sets the PolicyUsageFilter field's value. +func (s *ListPoliciesInput) SetPolicyUsageFilter(v string) *ListPoliciesInput { + s.PolicyUsageFilter = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *ListPoliciesInput) SetScope(v string) *ListPoliciesInput { + s.Scope = &v + return s +} + +// Contains the response to a successful ListPolicies request. +type ListPoliciesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of policies. + Policies []*Policy `type:"list"` +} + +// String returns the string representation +func (s ListPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPoliciesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListPoliciesOutput) SetIsTruncated(v bool) *ListPoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListPoliciesOutput) SetMarker(v string) *ListPoliciesOutput { + s.Marker = &v + return s +} + +// SetPolicies sets the Policies field's value. +func (s *ListPoliciesOutput) SetPolicies(v []*Policy) *ListPoliciesOutput { + s.Policies = v + return s +} + +type ListPolicyVersionsInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The Amazon Resource Name (ARN) of the IAM policy for which you want the versions. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListPolicyVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPolicyVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPolicyVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPolicyVersionsInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListPolicyVersionsInput) SetMarker(v string) *ListPolicyVersionsInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListPolicyVersionsInput) SetMaxItems(v int64) *ListPolicyVersionsInput { + s.MaxItems = &v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *ListPolicyVersionsInput) SetPolicyArn(v string) *ListPolicyVersionsInput { + s.PolicyArn = &v + return s +} + +// Contains the response to a successful ListPolicyVersions request. +type ListPolicyVersionsOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of policy versions. + // + // For more information about managed policy versions, see Versioning for Managed + // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) + // in the IAM User Guide. + Versions []*PolicyVersion `type:"list"` +} + +// String returns the string representation +func (s ListPolicyVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPolicyVersionsOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListPolicyVersionsOutput) SetIsTruncated(v bool) *ListPolicyVersionsOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListPolicyVersionsOutput) SetMarker(v string) *ListPolicyVersionsOutput { + s.Marker = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListPolicyVersionsOutput) SetVersions(v []*PolicyVersion) *ListPolicyVersionsOutput { + s.Versions = v + return s +} + +type ListRolePoliciesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the role to list policies for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListRolePoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRolePoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRolePoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRolePoliciesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListRolePoliciesInput) SetMarker(v string) *ListRolePoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListRolePoliciesInput) SetMaxItems(v int64) *ListRolePoliciesInput { + s.MaxItems = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *ListRolePoliciesInput) SetRoleName(v string) *ListRolePoliciesInput { + s.RoleName = &v + return s +} + +// Contains the response to a successful ListRolePolicies request. +type ListRolePoliciesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of policy names. + // + // PolicyNames is a required field + PolicyNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListRolePoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRolePoliciesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListRolePoliciesOutput) SetIsTruncated(v bool) *ListRolePoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListRolePoliciesOutput) SetMarker(v string) *ListRolePoliciesOutput { + s.Marker = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *ListRolePoliciesOutput) SetPolicyNames(v []*string) *ListRolePoliciesOutput { + s.PolicyNames = v + return s +} + +type ListRolesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ + // gets all roles whose path starts with /application_abc/component_xyz/. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/), listing all roles. This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + PathPrefix *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListRolesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRolesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRolesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRolesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListRolesInput) SetMarker(v string) *ListRolesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListRolesInput) SetMaxItems(v int64) *ListRolesInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListRolesInput) SetPathPrefix(v string) *ListRolesInput { + s.PathPrefix = &v + return s +} + +// Contains the response to a successful ListRoles request. +type ListRolesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of roles. + // + // Roles is a required field + Roles []*Role `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListRolesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRolesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListRolesOutput) SetIsTruncated(v bool) *ListRolesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListRolesOutput) SetMarker(v string) *ListRolesOutput { + s.Marker = &v + return s +} + +// SetRoles sets the Roles field's value. +func (s *ListRolesOutput) SetRoles(v []*Role) *ListRolesOutput { + s.Roles = v + return s +} + +type ListSAMLProvidersInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ListSAMLProvidersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSAMLProvidersInput) GoString() string { + return s.String() +} + +// Contains the response to a successful ListSAMLProviders request. +type ListSAMLProvidersOutput struct { + _ struct{} `type:"structure"` + + // The list of SAML provider resource objects defined in IAM for this AWS account. + SAMLProviderList []*SAMLProviderListEntry `type:"list"` +} + +// String returns the string representation +func (s ListSAMLProvidersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSAMLProvidersOutput) GoString() string { + return s.String() +} + +// SetSAMLProviderList sets the SAMLProviderList field's value. +func (s *ListSAMLProvidersOutput) SetSAMLProviderList(v []*SAMLProviderListEntry) *ListSAMLProvidersOutput { + s.SAMLProviderList = v + return s +} + +type ListSSHPublicKeysInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the IAM user to list SSH public keys for. If none is specified, + // the UserName field is determined implicitly based on the AWS access key used + // to sign the request. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListSSHPublicKeysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSSHPublicKeysInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListSSHPublicKeysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSSHPublicKeysInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListSSHPublicKeysInput) SetMarker(v string) *ListSSHPublicKeysInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListSSHPublicKeysInput) SetMaxItems(v int64) *ListSSHPublicKeysInput { + s.MaxItems = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListSSHPublicKeysInput) SetUserName(v string) *ListSSHPublicKeysInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListSSHPublicKeys request. +type ListSSHPublicKeysOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of the SSH public keys assigned to IAM user. + SSHPublicKeys []*SSHPublicKeyMetadata `type:"list"` +} + +// String returns the string representation +func (s ListSSHPublicKeysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSSHPublicKeysOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListSSHPublicKeysOutput) SetIsTruncated(v bool) *ListSSHPublicKeysOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListSSHPublicKeysOutput) SetMarker(v string) *ListSSHPublicKeysOutput { + s.Marker = &v + return s +} + +// SetSSHPublicKeys sets the SSHPublicKeys field's value. +func (s *ListSSHPublicKeysOutput) SetSSHPublicKeys(v []*SSHPublicKeyMetadata) *ListSSHPublicKeysOutput { + s.SSHPublicKeys = v + return s +} + +type ListServerCertificatesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. For example: /company/servercerts + // would get all server certificates for which the path starts with /company/servercerts. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/), listing all server certificates. This parameter allows (per its regex + // pattern (http://wikipedia.org/wiki/regex)) a string of characters consisting + // of either a forward slash (/) by itself or a string that must begin and end + // with forward slashes. In addition, it can contain any ASCII character from + // the ! (\u0021) through the DEL character (\u007F), including most punctuation + // characters, digits, and upper and lowercased letters. + PathPrefix *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListServerCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListServerCertificatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListServerCertificatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListServerCertificatesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListServerCertificatesInput) SetMarker(v string) *ListServerCertificatesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListServerCertificatesInput) SetMaxItems(v int64) *ListServerCertificatesInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListServerCertificatesInput) SetPathPrefix(v string) *ListServerCertificatesInput { + s.PathPrefix = &v + return s +} + +// Contains the response to a successful ListServerCertificates request. +type ListServerCertificatesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of server certificates. + // + // ServerCertificateMetadataList is a required field + ServerCertificateMetadataList []*ServerCertificateMetadata `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListServerCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListServerCertificatesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListServerCertificatesOutput) SetIsTruncated(v bool) *ListServerCertificatesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListServerCertificatesOutput) SetMarker(v string) *ListServerCertificatesOutput { + s.Marker = &v + return s +} + +// SetServerCertificateMetadataList sets the ServerCertificateMetadataList field's value. +func (s *ListServerCertificatesOutput) SetServerCertificateMetadataList(v []*ServerCertificateMetadata) *ListServerCertificatesOutput { + s.ServerCertificateMetadataList = v + return s +} + +type ListServiceSpecificCredentialsInput struct { + _ struct{} `type:"structure"` + + // Filters the returned results to only those for the specified AWS service. + // If not specified, then AWS returns service-specific credentials for all services. + ServiceName *string `type:"string"` + + // The name of the user whose service-specific credentials you want information + // about. If this value is not specified, then the operation assumes the user + // whose credentials are used to call the operation. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListServiceSpecificCredentialsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListServiceSpecificCredentialsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListServiceSpecificCredentialsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListServiceSpecificCredentialsInput"} + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServiceName sets the ServiceName field's value. +func (s *ListServiceSpecificCredentialsInput) SetServiceName(v string) *ListServiceSpecificCredentialsInput { + s.ServiceName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListServiceSpecificCredentialsInput) SetUserName(v string) *ListServiceSpecificCredentialsInput { + s.UserName = &v + return s +} + +type ListServiceSpecificCredentialsOutput struct { + _ struct{} `type:"structure"` + + // A list of structures that each contain details about a service-specific credential. + ServiceSpecificCredentials []*ServiceSpecificCredentialMetadata `type:"list"` +} + +// String returns the string representation +func (s ListServiceSpecificCredentialsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListServiceSpecificCredentialsOutput) GoString() string { + return s.String() +} + +// SetServiceSpecificCredentials sets the ServiceSpecificCredentials field's value. +func (s *ListServiceSpecificCredentialsOutput) SetServiceSpecificCredentials(v []*ServiceSpecificCredentialMetadata) *ListServiceSpecificCredentialsOutput { + s.ServiceSpecificCredentials = v + return s +} + +type ListSigningCertificatesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the IAM user whose signing certificates you want to examine. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListSigningCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSigningCertificatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListSigningCertificatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSigningCertificatesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListSigningCertificatesInput) SetMarker(v string) *ListSigningCertificatesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListSigningCertificatesInput) SetMaxItems(v int64) *ListSigningCertificatesInput { + s.MaxItems = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListSigningCertificatesInput) SetUserName(v string) *ListSigningCertificatesInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListSigningCertificates request. +type ListSigningCertificatesOutput struct { + _ struct{} `type:"structure"` + + // A list of the user's signing certificate information. + // + // Certificates is a required field + Certificates []*SigningCertificate `type:"list" required:"true"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListSigningCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSigningCertificatesOutput) GoString() string { + return s.String() +} + +// SetCertificates sets the Certificates field's value. +func (s *ListSigningCertificatesOutput) SetCertificates(v []*SigningCertificate) *ListSigningCertificatesOutput { + s.Certificates = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListSigningCertificatesOutput) SetIsTruncated(v bool) *ListSigningCertificatesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListSigningCertificatesOutput) SetMarker(v string) *ListSigningCertificatesOutput { + s.Marker = &v + return s +} + +type ListUserPoliciesInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The name of the user to list policies for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListUserPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUserPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListUserPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListUserPoliciesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListUserPoliciesInput) SetMarker(v string) *ListUserPoliciesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListUserPoliciesInput) SetMaxItems(v int64) *ListUserPoliciesInput { + s.MaxItems = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListUserPoliciesInput) SetUserName(v string) *ListUserPoliciesInput { + s.UserName = &v + return s +} + +// Contains the response to a successful ListUserPolicies request. +type ListUserPoliciesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of policy names. + // + // PolicyNames is a required field + PolicyNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListUserPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUserPoliciesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListUserPoliciesOutput) SetIsTruncated(v bool) *ListUserPoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListUserPoliciesOutput) SetMarker(v string) *ListUserPoliciesOutput { + s.Marker = &v + return s +} + +// SetPolicyNames sets the PolicyNames field's value. +func (s *ListUserPoliciesOutput) SetPolicyNames(v []*string) *ListUserPoliciesOutput { + s.PolicyNames = v + return s +} + +type ListUsersInput struct { + _ struct{} `type:"structure"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/, + // which would get all user names whose path starts with /division_abc/subdivision_xyz/. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/), listing all user names. This parameter allows (per its regex pattern + // (http://wikipedia.org/wiki/regex)) a string of characters consisting of either + // a forward slash (/) by itself or a string that must begin and end with forward + // slashes. In addition, it can contain any ASCII character from the ! (\u0021) + // through the DEL character (\u007F), including most punctuation characters, + // digits, and upper and lowercased letters. + PathPrefix *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListUsersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUsersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListUsersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListUsersInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PathPrefix != nil && len(*s.PathPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PathPrefix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMarker sets the Marker field's value. +func (s *ListUsersInput) SetMarker(v string) *ListUsersInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListUsersInput) SetMaxItems(v int64) *ListUsersInput { + s.MaxItems = &v + return s +} + +// SetPathPrefix sets the PathPrefix field's value. +func (s *ListUsersInput) SetPathPrefix(v string) *ListUsersInput { + s.PathPrefix = &v + return s +} + +// Contains the response to a successful ListUsers request. +type ListUsersOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // A list of users. + // + // Users is a required field + Users []*User `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListUsersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUsersOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListUsersOutput) SetIsTruncated(v bool) *ListUsersOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListUsersOutput) SetMarker(v string) *ListUsersOutput { + s.Marker = &v + return s +} + +// SetUsers sets the Users field's value. +func (s *ListUsersOutput) SetUsers(v []*User) *ListUsersOutput { + s.Users = v + return s +} + +type ListVirtualMFADevicesInput struct { + _ struct{} `type:"structure"` + + // The status (Unassigned or Assigned) of the devices to list. If you do not + // specify an AssignmentStatus, the operation defaults to Any which lists both + // assigned and unassigned virtual MFA devices. + AssignmentStatus *string `type:"string" enum:"assignmentStatusType"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListVirtualMFADevicesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListVirtualMFADevicesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListVirtualMFADevicesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListVirtualMFADevicesInput"} + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *ListVirtualMFADevicesInput) SetAssignmentStatus(v string) *ListVirtualMFADevicesInput { + s.AssignmentStatus = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListVirtualMFADevicesInput) SetMarker(v string) *ListVirtualMFADevicesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListVirtualMFADevicesInput) SetMaxItems(v int64) *ListVirtualMFADevicesInput { + s.MaxItems = &v + return s +} + +// Contains the response to a successful ListVirtualMFADevices request. +type ListVirtualMFADevicesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` + + // The list of virtual MFA devices in the current account that match the AssignmentStatus + // value that was passed in the request. + // + // VirtualMFADevices is a required field + VirtualMFADevices []*VirtualMFADevice `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListVirtualMFADevicesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListVirtualMFADevicesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListVirtualMFADevicesOutput) SetIsTruncated(v bool) *ListVirtualMFADevicesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListVirtualMFADevicesOutput) SetMarker(v string) *ListVirtualMFADevicesOutput { + s.Marker = &v + return s +} + +// SetVirtualMFADevices sets the VirtualMFADevices field's value. +func (s *ListVirtualMFADevicesOutput) SetVirtualMFADevices(v []*VirtualMFADevice) *ListVirtualMFADevicesOutput { + s.VirtualMFADevices = v + return s +} + +// Contains the user name and password create date for a user. +// +// This data type is used as a response element in the CreateLoginProfile and +// GetLoginProfile operations. +type LoginProfile struct { + _ struct{} `type:"structure"` + + // The date when the password for the user was created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // Specifies whether the user is required to set a new password on next sign-in. + PasswordResetRequired *bool `type:"boolean"` + + // The name of the user, which can be used for signing in to the AWS Management + // Console. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s LoginProfile) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoginProfile) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *LoginProfile) SetCreateDate(v time.Time) *LoginProfile { + s.CreateDate = &v + return s +} + +// SetPasswordResetRequired sets the PasswordResetRequired field's value. +func (s *LoginProfile) SetPasswordResetRequired(v bool) *LoginProfile { + s.PasswordResetRequired = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *LoginProfile) SetUserName(v string) *LoginProfile { + s.UserName = &v + return s +} + +// Contains information about an MFA device. +// +// This data type is used as a response element in the ListMFADevices operation. +type MFADevice struct { + _ struct{} `type:"structure"` + + // The date when the MFA device was enabled for the user. + // + // EnableDate is a required field + EnableDate *time.Time `type:"timestamp" required:"true"` + + // The serial number that uniquely identifies the MFA device. For virtual MFA + // devices, the serial number is the device ARN. + // + // SerialNumber is a required field + SerialNumber *string `min:"9" type:"string" required:"true"` + + // The user with whom the MFA device is associated. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s MFADevice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MFADevice) GoString() string { + return s.String() +} + +// SetEnableDate sets the EnableDate field's value. +func (s *MFADevice) SetEnableDate(v time.Time) *MFADevice { + s.EnableDate = &v + return s +} + +// SetSerialNumber sets the SerialNumber field's value. +func (s *MFADevice) SetSerialNumber(v string) *MFADevice { + s.SerialNumber = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *MFADevice) SetUserName(v string) *MFADevice { + s.UserName = &v + return s +} + +// Contains information about a managed policy, including the policy's ARN, +// versions, and the number of principal entities (users, groups, and roles) +// that the policy is attached to. +// +// This data type is used as a response element in the GetAccountAuthorizationDetails +// operation. +// +// For more information about managed policies, see Managed Policies and Inline +// Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type ManagedPolicyDetail struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `min:"20" type:"string"` + + // The number of principal entities (users, groups, and roles) that the policy + // is attached to. + AttachmentCount *int64 `type:"integer"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the policy was created. + CreateDate *time.Time `type:"timestamp"` + + // The identifier for the version of the policy that is set as the default (operative) + // version. + // + // For more information about policy versions, see Versioning for Managed Policies + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) + // in the Using IAM guide. + DefaultVersionId *string `type:"string"` + + // A friendly description of the policy. + Description *string `type:"string"` + + // Specifies whether the policy can be attached to an IAM user, group, or role. + IsAttachable *bool `type:"boolean"` + + // The path to the policy. + // + // For more information about paths, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + Path *string `type:"string"` + + // The number of entities (users and roles) for which the policy is used as + // the permissions boundary. + // + // For more information about permissions boundaries, see Permissions Boundaries + // for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. + PermissionsBoundaryUsageCount *int64 `type:"integer"` + + // The stable and unique string identifying the policy. + // + // For more information about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + PolicyId *string `min:"16" type:"string"` + + // The friendly name (not ARN) identifying the policy. + PolicyName *string `min:"1" type:"string"` + + // A list containing information about the versions of the policy. + PolicyVersionList []*PolicyVersion `type:"list"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the policy was last updated. + // + // When a policy has only one version, this field contains the date and time + // when the policy was created. When a policy has more than one version, this + // field contains the date and time when the most recent policy version was + // created. + UpdateDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s ManagedPolicyDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedPolicyDetail) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ManagedPolicyDetail) SetArn(v string) *ManagedPolicyDetail { + s.Arn = &v + return s +} + +// SetAttachmentCount sets the AttachmentCount field's value. +func (s *ManagedPolicyDetail) SetAttachmentCount(v int64) *ManagedPolicyDetail { + s.AttachmentCount = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *ManagedPolicyDetail) SetCreateDate(v time.Time) *ManagedPolicyDetail { + s.CreateDate = &v + return s +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *ManagedPolicyDetail) SetDefaultVersionId(v string) *ManagedPolicyDetail { + s.DefaultVersionId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ManagedPolicyDetail) SetDescription(v string) *ManagedPolicyDetail { + s.Description = &v + return s +} + +// SetIsAttachable sets the IsAttachable field's value. +func (s *ManagedPolicyDetail) SetIsAttachable(v bool) *ManagedPolicyDetail { + s.IsAttachable = &v + return s +} + +// SetPath sets the Path field's value. +func (s *ManagedPolicyDetail) SetPath(v string) *ManagedPolicyDetail { + s.Path = &v + return s +} + +// SetPermissionsBoundaryUsageCount sets the PermissionsBoundaryUsageCount field's value. +func (s *ManagedPolicyDetail) SetPermissionsBoundaryUsageCount(v int64) *ManagedPolicyDetail { + s.PermissionsBoundaryUsageCount = &v + return s +} + +// SetPolicyId sets the PolicyId field's value. +func (s *ManagedPolicyDetail) SetPolicyId(v string) *ManagedPolicyDetail { + s.PolicyId = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *ManagedPolicyDetail) SetPolicyName(v string) *ManagedPolicyDetail { + s.PolicyName = &v + return s +} + +// SetPolicyVersionList sets the PolicyVersionList field's value. +func (s *ManagedPolicyDetail) SetPolicyVersionList(v []*PolicyVersion) *ManagedPolicyDetail { + s.PolicyVersionList = v + return s +} + +// SetUpdateDate sets the UpdateDate field's value. +func (s *ManagedPolicyDetail) SetUpdateDate(v time.Time) *ManagedPolicyDetail { + s.UpdateDate = &v + return s +} + +// Contains the Amazon Resource Name (ARN) for an IAM OpenID Connect provider. +type OpenIDConnectProviderListEntry struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `min:"20" type:"string"` +} + +// String returns the string representation +func (s OpenIDConnectProviderListEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpenIDConnectProviderListEntry) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *OpenIDConnectProviderListEntry) SetArn(v string) *OpenIDConnectProviderListEntry { + s.Arn = &v + return s +} + +// Contains information about AWS Organizations's effect on a policy simulation. +type OrganizationsDecisionDetail struct { + _ struct{} `type:"structure"` + + // Specifies whether the simulated operation is allowed by the AWS Organizations + // service control policies that impact the simulated user's account. + AllowedByOrganizations *bool `type:"boolean"` +} + +// String returns the string representation +func (s OrganizationsDecisionDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationsDecisionDetail) GoString() string { + return s.String() +} + +// SetAllowedByOrganizations sets the AllowedByOrganizations field's value. +func (s *OrganizationsDecisionDetail) SetAllowedByOrganizations(v bool) *OrganizationsDecisionDetail { + s.AllowedByOrganizations = &v + return s +} + +// Contains information about the account password policy. +// +// This data type is used as a response element in the GetAccountPasswordPolicy +// operation. +type PasswordPolicy struct { + _ struct{} `type:"structure"` + + // Specifies whether IAM users are allowed to change their own password. + AllowUsersToChangePassword *bool `type:"boolean"` + + // Indicates whether passwords in the account expire. Returns true if MaxPasswordAge + // contains a value greater than 0. Returns false if MaxPasswordAge is 0 or + // not present. + ExpirePasswords *bool `type:"boolean"` + + // Specifies whether IAM users are prevented from setting a new password after + // their password has expired. + HardExpiry *bool `type:"boolean"` + + // The number of days that an IAM user password is valid. + MaxPasswordAge *int64 `min:"1" type:"integer"` + + // Minimum length to require for IAM user passwords. + MinimumPasswordLength *int64 `min:"6" type:"integer"` + + // Specifies the number of previous passwords that IAM users are prevented from + // reusing. + PasswordReusePrevention *int64 `min:"1" type:"integer"` + + // Specifies whether to require lowercase characters for IAM user passwords. + RequireLowercaseCharacters *bool `type:"boolean"` + + // Specifies whether to require numbers for IAM user passwords. + RequireNumbers *bool `type:"boolean"` + + // Specifies whether to require symbols for IAM user passwords. + RequireSymbols *bool `type:"boolean"` + + // Specifies whether to require uppercase characters for IAM user passwords. + RequireUppercaseCharacters *bool `type:"boolean"` +} + +// String returns the string representation +func (s PasswordPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PasswordPolicy) GoString() string { + return s.String() +} + +// SetAllowUsersToChangePassword sets the AllowUsersToChangePassword field's value. +func (s *PasswordPolicy) SetAllowUsersToChangePassword(v bool) *PasswordPolicy { + s.AllowUsersToChangePassword = &v + return s +} + +// SetExpirePasswords sets the ExpirePasswords field's value. +func (s *PasswordPolicy) SetExpirePasswords(v bool) *PasswordPolicy { + s.ExpirePasswords = &v + return s +} + +// SetHardExpiry sets the HardExpiry field's value. +func (s *PasswordPolicy) SetHardExpiry(v bool) *PasswordPolicy { + s.HardExpiry = &v + return s +} + +// SetMaxPasswordAge sets the MaxPasswordAge field's value. +func (s *PasswordPolicy) SetMaxPasswordAge(v int64) *PasswordPolicy { + s.MaxPasswordAge = &v + return s +} + +// SetMinimumPasswordLength sets the MinimumPasswordLength field's value. +func (s *PasswordPolicy) SetMinimumPasswordLength(v int64) *PasswordPolicy { + s.MinimumPasswordLength = &v + return s +} + +// SetPasswordReusePrevention sets the PasswordReusePrevention field's value. +func (s *PasswordPolicy) SetPasswordReusePrevention(v int64) *PasswordPolicy { + s.PasswordReusePrevention = &v + return s +} + +// SetRequireLowercaseCharacters sets the RequireLowercaseCharacters field's value. +func (s *PasswordPolicy) SetRequireLowercaseCharacters(v bool) *PasswordPolicy { + s.RequireLowercaseCharacters = &v + return s +} + +// SetRequireNumbers sets the RequireNumbers field's value. +func (s *PasswordPolicy) SetRequireNumbers(v bool) *PasswordPolicy { + s.RequireNumbers = &v + return s +} + +// SetRequireSymbols sets the RequireSymbols field's value. +func (s *PasswordPolicy) SetRequireSymbols(v bool) *PasswordPolicy { + s.RequireSymbols = &v + return s +} + +// SetRequireUppercaseCharacters sets the RequireUppercaseCharacters field's value. +func (s *PasswordPolicy) SetRequireUppercaseCharacters(v bool) *PasswordPolicy { + s.RequireUppercaseCharacters = &v + return s +} + +// Contains information about a managed policy. +// +// This data type is used as a response element in the CreatePolicy, GetPolicy, +// and ListPolicies operations. +// +// For more information about managed policies, refer to Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type Policy struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `min:"20" type:"string"` + + // The number of entities (users, groups, and roles) that the policy is attached + // to. + AttachmentCount *int64 `type:"integer"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the policy was created. + CreateDate *time.Time `type:"timestamp"` + + // The identifier for the version of the policy that is set as the default version. + DefaultVersionId *string `type:"string"` + + // A friendly description of the policy. + // + // This element is included in the response to the GetPolicy operation. It is + // not included in the response to the ListPolicies operation. + Description *string `type:"string"` + + // Specifies whether the policy can be attached to an IAM user, group, or role. + IsAttachable *bool `type:"boolean"` + + // The path to the policy. + // + // For more information about paths, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + Path *string `type:"string"` + + // The number of entities (users and roles) for which the policy is used to + // set the permissions boundary. + // + // For more information about permissions boundaries, see Permissions Boundaries + // for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. + PermissionsBoundaryUsageCount *int64 `type:"integer"` + + // The stable and unique string identifying the policy. + // + // For more information about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + PolicyId *string `min:"16" type:"string"` + + // The friendly name (not ARN) identifying the policy. + PolicyName *string `min:"1" type:"string"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the policy was last updated. + // + // When a policy has only one version, this field contains the date and time + // when the policy was created. When a policy has more than one version, this + // field contains the date and time when the most recent policy version was + // created. + UpdateDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s Policy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Policy) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Policy) SetArn(v string) *Policy { + s.Arn = &v + return s +} + +// SetAttachmentCount sets the AttachmentCount field's value. +func (s *Policy) SetAttachmentCount(v int64) *Policy { + s.AttachmentCount = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *Policy) SetCreateDate(v time.Time) *Policy { + s.CreateDate = &v + return s +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *Policy) SetDefaultVersionId(v string) *Policy { + s.DefaultVersionId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *Policy) SetDescription(v string) *Policy { + s.Description = &v + return s +} + +// SetIsAttachable sets the IsAttachable field's value. +func (s *Policy) SetIsAttachable(v bool) *Policy { + s.IsAttachable = &v + return s +} + +// SetPath sets the Path field's value. +func (s *Policy) SetPath(v string) *Policy { + s.Path = &v + return s +} + +// SetPermissionsBoundaryUsageCount sets the PermissionsBoundaryUsageCount field's value. +func (s *Policy) SetPermissionsBoundaryUsageCount(v int64) *Policy { + s.PermissionsBoundaryUsageCount = &v + return s +} + +// SetPolicyId sets the PolicyId field's value. +func (s *Policy) SetPolicyId(v string) *Policy { + s.PolicyId = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *Policy) SetPolicyName(v string) *Policy { + s.PolicyName = &v + return s +} + +// SetUpdateDate sets the UpdateDate field's value. +func (s *Policy) SetUpdateDate(v time.Time) *Policy { + s.UpdateDate = &v + return s +} + +// Contains information about an IAM policy, including the policy document. +// +// This data type is used as a response element in the GetAccountAuthorizationDetails +// operation. +type PolicyDetail struct { + _ struct{} `type:"structure"` + + // The policy document. + PolicyDocument *string `min:"1" type:"string"` + + // The name of the policy. + PolicyName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PolicyDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyDetail) GoString() string { + return s.String() +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *PolicyDetail) SetPolicyDocument(v string) *PolicyDetail { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *PolicyDetail) SetPolicyName(v string) *PolicyDetail { + s.PolicyName = &v + return s +} + +// Contains information about a group that a managed policy is attached to. +// +// This data type is used as a response element in the ListEntitiesForPolicy +// operation. +// +// For more information about managed policies, refer to Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type PolicyGroup struct { + _ struct{} `type:"structure"` + + // The stable and unique string identifying the group. For more information + // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. + GroupId *string `min:"16" type:"string"` + + // The name (friendly name, not ARN) identifying the group. + GroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PolicyGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyGroup) GoString() string { + return s.String() +} + +// SetGroupId sets the GroupId field's value. +func (s *PolicyGroup) SetGroupId(v string) *PolicyGroup { + s.GroupId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *PolicyGroup) SetGroupName(v string) *PolicyGroup { + s.GroupName = &v + return s +} + +// Contains information about a role that a managed policy is attached to. +// +// This data type is used as a response element in the ListEntitiesForPolicy +// operation. +// +// For more information about managed policies, refer to Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type PolicyRole struct { + _ struct{} `type:"structure"` + + // The stable and unique string identifying the role. For more information about + // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. + RoleId *string `min:"16" type:"string"` + + // The name (friendly name, not ARN) identifying the role. + RoleName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PolicyRole) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyRole) GoString() string { + return s.String() +} + +// SetRoleId sets the RoleId field's value. +func (s *PolicyRole) SetRoleId(v string) *PolicyRole { + s.RoleId = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *PolicyRole) SetRoleName(v string) *PolicyRole { + s.RoleName = &v + return s +} + +// Contains information about a user that a managed policy is attached to. +// +// This data type is used as a response element in the ListEntitiesForPolicy +// operation. +// +// For more information about managed policies, refer to Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type PolicyUser struct { + _ struct{} `type:"structure"` + + // The stable and unique string identifying the user. For more information about + // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. + UserId *string `min:"16" type:"string"` + + // The name (friendly name, not ARN) identifying the user. + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PolicyUser) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyUser) GoString() string { + return s.String() +} + +// SetUserId sets the UserId field's value. +func (s *PolicyUser) SetUserId(v string) *PolicyUser { + s.UserId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *PolicyUser) SetUserName(v string) *PolicyUser { + s.UserName = &v + return s +} + +// Contains information about a version of a managed policy. +// +// This data type is used as a response element in the CreatePolicyVersion, +// GetPolicyVersion, ListPolicyVersions, and GetAccountAuthorizationDetails +// operations. +// +// For more information about managed policies, refer to Managed Policies and +// Inline Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// in the Using IAM guide. +type PolicyVersion struct { + _ struct{} `type:"structure"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the policy version was created. + CreateDate *time.Time `type:"timestamp"` + + // The policy document. + // + // The policy document is returned in the response to the GetPolicyVersion and + // GetAccountAuthorizationDetails operations. It is not returned in the response + // to the CreatePolicyVersion or ListPolicyVersions operations. + // + // The policy document returned in this structure is URL-encoded compliant with + // RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding + // method to convert the policy back to plain JSON text. For example, if you + // use Java, you can use the decode method of the java.net.URLDecoder utility + // class in the Java SDK. Other languages and SDKs provide similar functionality. + Document *string `min:"1" type:"string"` + + // Specifies whether the policy version is set as the policy's default version. + IsDefaultVersion *bool `type:"boolean"` + + // The identifier for the policy version. + // + // Policy version identifiers always begin with v (always lowercase). When a + // policy is created, the first policy version is v1. + VersionId *string `type:"string"` +} + +// String returns the string representation +func (s PolicyVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyVersion) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *PolicyVersion) SetCreateDate(v time.Time) *PolicyVersion { + s.CreateDate = &v + return s +} + +// SetDocument sets the Document field's value. +func (s *PolicyVersion) SetDocument(v string) *PolicyVersion { + s.Document = &v + return s +} + +// SetIsDefaultVersion sets the IsDefaultVersion field's value. +func (s *PolicyVersion) SetIsDefaultVersion(v bool) *PolicyVersion { + s.IsDefaultVersion = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *PolicyVersion) SetVersionId(v string) *PolicyVersion { + s.VersionId = &v + return s +} + +// Contains the row and column of a location of a Statement element in a policy +// document. +// +// This data type is used as a member of the Statement type. +type Position struct { + _ struct{} `type:"structure"` + + // The column in the line containing the specified position in the document. + Column *int64 `type:"integer"` + + // The line containing the specified position in the document. + Line *int64 `type:"integer"` +} + +// String returns the string representation +func (s Position) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Position) GoString() string { + return s.String() +} + +// SetColumn sets the Column field's value. +func (s *Position) SetColumn(v int64) *Position { + s.Column = &v + return s +} + +// SetLine sets the Line field's value. +func (s *Position) SetLine(v int64) *Position { + s.Line = &v + return s +} + +type PutGroupPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the group to associate the policy with. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The policy document. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the policy document. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutGroupPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutGroupPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutGroupPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutGroupPolicyInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *PutGroupPolicyInput) SetGroupName(v string) *PutGroupPolicyInput { + s.GroupName = &v + return s +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *PutGroupPolicyInput) SetPolicyDocument(v string) *PutGroupPolicyInput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *PutGroupPolicyInput) SetPolicyName(v string) *PutGroupPolicyInput { + s.PolicyName = &v + return s +} + +type PutGroupPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutGroupPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutGroupPolicyOutput) GoString() string { + return s.String() +} + +type PutRolePermissionsBoundaryInput struct { + _ struct{} `type:"structure"` + + // The ARN of the policy that is used to set the permissions boundary for the + // role. + // + // PermissionsBoundary is a required field + PermissionsBoundary *string `min:"20" type:"string" required:"true"` + + // The name (friendly name, not ARN) of the IAM role for which you want to set + // the permissions boundary. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutRolePermissionsBoundaryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRolePermissionsBoundaryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutRolePermissionsBoundaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutRolePermissionsBoundaryInput"} + if s.PermissionsBoundary == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionsBoundary")) + } + if s.PermissionsBoundary != nil && len(*s.PermissionsBoundary) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PermissionsBoundary", 20)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *PutRolePermissionsBoundaryInput) SetPermissionsBoundary(v string) *PutRolePermissionsBoundaryInput { + s.PermissionsBoundary = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *PutRolePermissionsBoundaryInput) SetRoleName(v string) *PutRolePermissionsBoundaryInput { + s.RoleName = &v + return s +} + +type PutRolePermissionsBoundaryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutRolePermissionsBoundaryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRolePermissionsBoundaryOutput) GoString() string { + return s.String() +} + +type PutRolePolicyInput struct { + _ struct{} `type:"structure"` + + // The policy document. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the policy document. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The name of the role to associate the policy with. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutRolePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRolePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutRolePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutRolePolicyInput"} + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *PutRolePolicyInput) SetPolicyDocument(v string) *PutRolePolicyInput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *PutRolePolicyInput) SetPolicyName(v string) *PutRolePolicyInput { + s.PolicyName = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *PutRolePolicyInput) SetRoleName(v string) *PutRolePolicyInput { + s.RoleName = &v + return s +} + +type PutRolePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutRolePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRolePolicyOutput) GoString() string { + return s.String() +} + +type PutUserPermissionsBoundaryInput struct { + _ struct{} `type:"structure"` + + // The ARN of the policy that is used to set the permissions boundary for the + // user. + // + // PermissionsBoundary is a required field + PermissionsBoundary *string `min:"20" type:"string" required:"true"` + + // The name (friendly name, not ARN) of the IAM user for which you want to set + // the permissions boundary. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutUserPermissionsBoundaryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutUserPermissionsBoundaryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutUserPermissionsBoundaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutUserPermissionsBoundaryInput"} + if s.PermissionsBoundary == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionsBoundary")) + } + if s.PermissionsBoundary != nil && len(*s.PermissionsBoundary) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PermissionsBoundary", 20)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *PutUserPermissionsBoundaryInput) SetPermissionsBoundary(v string) *PutUserPermissionsBoundaryInput { + s.PermissionsBoundary = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *PutUserPermissionsBoundaryInput) SetUserName(v string) *PutUserPermissionsBoundaryInput { + s.UserName = &v + return s +} + +type PutUserPermissionsBoundaryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutUserPermissionsBoundaryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutUserPermissionsBoundaryOutput) GoString() string { + return s.String() +} + +type PutUserPolicyInput struct { + _ struct{} `type:"structure"` + + // The policy document. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the policy document. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The name of the user to associate the policy with. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutUserPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutUserPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutUserPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutUserPolicyInput"} + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *PutUserPolicyInput) SetPolicyDocument(v string) *PutUserPolicyInput { + s.PolicyDocument = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *PutUserPolicyInput) SetPolicyName(v string) *PutUserPolicyInput { + s.PolicyName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *PutUserPolicyInput) SetUserName(v string) *PutUserPolicyInput { + s.UserName = &v + return s +} + +type PutUserPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutUserPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutUserPolicyOutput) GoString() string { + return s.String() +} + +type RemoveClientIDFromOpenIDConnectProviderInput struct { + _ struct{} `type:"structure"` + + // The client ID (also known as audience) to remove from the IAM OIDC provider + // resource. For more information about client IDs, see CreateOpenIDConnectProvider. + // + // ClientID is a required field + ClientID *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM OIDC provider resource to remove + // the client ID from. You can get a list of OIDC provider ARNs by using the + // ListOpenIDConnectProviders operation. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // OpenIDConnectProviderArn is a required field + OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s RemoveClientIDFromOpenIDConnectProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveClientIDFromOpenIDConnectProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveClientIDFromOpenIDConnectProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveClientIDFromOpenIDConnectProviderInput"} + if s.ClientID == nil { + invalidParams.Add(request.NewErrParamRequired("ClientID")) + } + if s.ClientID != nil && len(*s.ClientID) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientID", 1)) + } + if s.OpenIDConnectProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) + } + if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientID sets the ClientID field's value. +func (s *RemoveClientIDFromOpenIDConnectProviderInput) SetClientID(v string) *RemoveClientIDFromOpenIDConnectProviderInput { + s.ClientID = &v + return s +} + +// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. +func (s *RemoveClientIDFromOpenIDConnectProviderInput) SetOpenIDConnectProviderArn(v string) *RemoveClientIDFromOpenIDConnectProviderInput { + s.OpenIDConnectProviderArn = &v + return s +} + +type RemoveClientIDFromOpenIDConnectProviderOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveClientIDFromOpenIDConnectProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveClientIDFromOpenIDConnectProviderOutput) GoString() string { + return s.String() +} + +type RemoveRoleFromInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the instance profile to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // InstanceProfileName is a required field + InstanceProfileName *string `min:"1" type:"string" required:"true"` + + // The name of the role to remove. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RemoveRoleFromInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveRoleFromInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveRoleFromInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveRoleFromInstanceProfileInput"} + if s.InstanceProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) + } + if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *RemoveRoleFromInstanceProfileInput) SetInstanceProfileName(v string) *RemoveRoleFromInstanceProfileInput { + s.InstanceProfileName = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *RemoveRoleFromInstanceProfileInput) SetRoleName(v string) *RemoveRoleFromInstanceProfileInput { + s.RoleName = &v + return s +} + +type RemoveRoleFromInstanceProfileOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveRoleFromInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveRoleFromInstanceProfileOutput) GoString() string { + return s.String() +} + +type RemoveUserFromGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the group to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The name of the user to remove. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RemoveUserFromGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveUserFromGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveUserFromGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveUserFromGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *RemoveUserFromGroupInput) SetGroupName(v string) *RemoveUserFromGroupInput { + s.GroupName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *RemoveUserFromGroupInput) SetUserName(v string) *RemoveUserFromGroupInput { + s.UserName = &v + return s +} + +type RemoveUserFromGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveUserFromGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveUserFromGroupOutput) GoString() string { + return s.String() +} + +type ResetServiceSpecificCredentialInput struct { + _ struct{} `type:"structure"` + + // The unique identifier of the service-specific credential. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // ServiceSpecificCredentialId is a required field + ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` + + // The name of the IAM user associated with the service-specific credential. + // If this value is not specified, then the operation assumes the user whose + // credentials are used to call the operation. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResetServiceSpecificCredentialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetServiceSpecificCredentialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResetServiceSpecificCredentialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResetServiceSpecificCredentialInput"} + if s.ServiceSpecificCredentialId == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceSpecificCredentialId")) + } + if s.ServiceSpecificCredentialId != nil && len(*s.ServiceSpecificCredentialId) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ServiceSpecificCredentialId", 20)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. +func (s *ResetServiceSpecificCredentialInput) SetServiceSpecificCredentialId(v string) *ResetServiceSpecificCredentialInput { + s.ServiceSpecificCredentialId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ResetServiceSpecificCredentialInput) SetUserName(v string) *ResetServiceSpecificCredentialInput { + s.UserName = &v + return s +} + +type ResetServiceSpecificCredentialOutput struct { + _ struct{} `type:"structure"` + + // A structure with details about the updated service-specific credential, including + // the new password. + // + // This is the only time that you can access the password. You cannot recover + // the password later, but you can reset it again. + ServiceSpecificCredential *ServiceSpecificCredential `type:"structure"` +} + +// String returns the string representation +func (s ResetServiceSpecificCredentialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetServiceSpecificCredentialOutput) GoString() string { + return s.String() +} + +// SetServiceSpecificCredential sets the ServiceSpecificCredential field's value. +func (s *ResetServiceSpecificCredentialOutput) SetServiceSpecificCredential(v *ServiceSpecificCredential) *ResetServiceSpecificCredentialOutput { + s.ServiceSpecificCredential = v + return s +} + +// Contains the result of the simulation of a single API operation call on a +// single resource. +// +// This data type is used by a member of the EvaluationResult data type. +type ResourceSpecificResult struct { + _ struct{} `type:"structure"` + + // Additional details about the results of the evaluation decision. When there + // are both IAM policies and resource policies, this parameter explains how + // each set of policies contributes to the final evaluation decision. When simulating + // cross-account access to a resource, both the resource-based policy and the + // caller's IAM policy must grant access. + EvalDecisionDetails map[string]*string `type:"map"` + + // The result of the simulation of the simulated API operation on the resource + // specified in EvalResourceName. + // + // EvalResourceDecision is a required field + EvalResourceDecision *string `type:"string" required:"true" enum:"PolicyEvaluationDecisionType"` + + // The name of the simulated resource, in Amazon Resource Name (ARN) format. + // + // EvalResourceName is a required field + EvalResourceName *string `min:"1" type:"string" required:"true"` + + // A list of the statements in the input policies that determine the result + // for this part of the simulation. Remember that even if multiple statements + // allow the operation on the resource, if any statement denies that operation, + // then the explicit deny overrides any allow, and the deny statement is the + // only entry included in the result. + MatchedStatements []*Statement `type:"list"` + + // A list of context keys that are required by the included input policies but + // that were not provided by one of the input parameters. This list is used + // when a list of ARNs is included in the ResourceArns parameter instead of + // "*". If you do not specify individual resources, by setting ResourceArns + // to "*" or by not including the ResourceArns parameter, then any missing context + // values are instead included under the EvaluationResults section. To discover + // the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy + // or GetContextKeysForPrincipalPolicy. + MissingContextValues []*string `type:"list"` +} + +// String returns the string representation +func (s ResourceSpecificResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceSpecificResult) GoString() string { + return s.String() +} + +// SetEvalDecisionDetails sets the EvalDecisionDetails field's value. +func (s *ResourceSpecificResult) SetEvalDecisionDetails(v map[string]*string) *ResourceSpecificResult { + s.EvalDecisionDetails = v + return s +} + +// SetEvalResourceDecision sets the EvalResourceDecision field's value. +func (s *ResourceSpecificResult) SetEvalResourceDecision(v string) *ResourceSpecificResult { + s.EvalResourceDecision = &v + return s +} + +// SetEvalResourceName sets the EvalResourceName field's value. +func (s *ResourceSpecificResult) SetEvalResourceName(v string) *ResourceSpecificResult { + s.EvalResourceName = &v + return s +} + +// SetMatchedStatements sets the MatchedStatements field's value. +func (s *ResourceSpecificResult) SetMatchedStatements(v []*Statement) *ResourceSpecificResult { + s.MatchedStatements = v + return s +} + +// SetMissingContextValues sets the MissingContextValues field's value. +func (s *ResourceSpecificResult) SetMissingContextValues(v []*string) *ResourceSpecificResult { + s.MissingContextValues = v + return s +} + +type ResyncMFADeviceInput struct { + _ struct{} `type:"structure"` + + // An authentication code emitted by the device. + // + // The format for this parameter is a sequence of six digits. + // + // AuthenticationCode1 is a required field + AuthenticationCode1 *string `min:"6" type:"string" required:"true"` + + // A subsequent authentication code emitted by the device. + // + // The format for this parameter is a sequence of six digits. + // + // AuthenticationCode2 is a required field + AuthenticationCode2 *string `min:"6" type:"string" required:"true"` + + // Serial number that uniquely identifies the MFA device. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // SerialNumber is a required field + SerialNumber *string `min:"9" type:"string" required:"true"` + + // The name of the user whose MFA device you want to resynchronize. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResyncMFADeviceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResyncMFADeviceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResyncMFADeviceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResyncMFADeviceInput"} + if s.AuthenticationCode1 == nil { + invalidParams.Add(request.NewErrParamRequired("AuthenticationCode1")) + } + if s.AuthenticationCode1 != nil && len(*s.AuthenticationCode1) < 6 { + invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode1", 6)) + } + if s.AuthenticationCode2 == nil { + invalidParams.Add(request.NewErrParamRequired("AuthenticationCode2")) + } + if s.AuthenticationCode2 != nil && len(*s.AuthenticationCode2) < 6 { + invalidParams.Add(request.NewErrParamMinLen("AuthenticationCode2", 6)) + } + if s.SerialNumber == nil { + invalidParams.Add(request.NewErrParamRequired("SerialNumber")) + } + if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { + invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthenticationCode1 sets the AuthenticationCode1 field's value. +func (s *ResyncMFADeviceInput) SetAuthenticationCode1(v string) *ResyncMFADeviceInput { + s.AuthenticationCode1 = &v + return s +} + +// SetAuthenticationCode2 sets the AuthenticationCode2 field's value. +func (s *ResyncMFADeviceInput) SetAuthenticationCode2(v string) *ResyncMFADeviceInput { + s.AuthenticationCode2 = &v + return s +} + +// SetSerialNumber sets the SerialNumber field's value. +func (s *ResyncMFADeviceInput) SetSerialNumber(v string) *ResyncMFADeviceInput { + s.SerialNumber = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ResyncMFADeviceInput) SetUserName(v string) *ResyncMFADeviceInput { + s.UserName = &v + return s +} + +type ResyncMFADeviceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ResyncMFADeviceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResyncMFADeviceOutput) GoString() string { + return s.String() +} + +// Contains information about an IAM role. This structure is returned as a response +// element in several API operations that interact with roles. +type Role struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) specifying the role. For more information + // about ARNs and how to use them in policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide guide. + // + // Arn is a required field + Arn *string `min:"20" type:"string" required:"true"` + + // The policy that grants an entity permission to assume the role. + AssumeRolePolicyDocument *string `min:"1" type:"string"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the role was created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // A description of the role that you provide. + Description *string `type:"string"` + + // The maximum session duration (in seconds) for the specified role. Anyone + // who uses the AWS CLI or API to assume the role can specify the duration using + // the optional DurationSeconds API parameter or duration-seconds CLI parameter. + MaxSessionDuration *int64 `min:"3600" type:"integer"` + + // The path to the role. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Path is a required field + Path *string `min:"1" type:"string" required:"true"` + + // The ARN of the policy used to set the permissions boundary for the role. + // + // For more information about permissions boundaries, see Permissions Boundaries + // for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. + PermissionsBoundary *AttachedPermissionsBoundary `type:"structure"` + + // The stable and unique string identifying the role. For more information about + // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // RoleId is a required field + RoleId *string `min:"16" type:"string" required:"true"` + + // The friendly name that identifies the role. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s Role) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Role) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Role) SetArn(v string) *Role { + s.Arn = &v + return s +} + +// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. +func (s *Role) SetAssumeRolePolicyDocument(v string) *Role { + s.AssumeRolePolicyDocument = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *Role) SetCreateDate(v time.Time) *Role { + s.CreateDate = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *Role) SetDescription(v string) *Role { + s.Description = &v + return s +} + +// SetMaxSessionDuration sets the MaxSessionDuration field's value. +func (s *Role) SetMaxSessionDuration(v int64) *Role { + s.MaxSessionDuration = &v + return s +} + +// SetPath sets the Path field's value. +func (s *Role) SetPath(v string) *Role { + s.Path = &v + return s +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *Role) SetPermissionsBoundary(v *AttachedPermissionsBoundary) *Role { + s.PermissionsBoundary = v + return s +} + +// SetRoleId sets the RoleId field's value. +func (s *Role) SetRoleId(v string) *Role { + s.RoleId = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *Role) SetRoleName(v string) *Role { + s.RoleName = &v + return s +} + +// Contains information about an IAM role, including all of the role's policies. +// +// This data type is used as a response element in the GetAccountAuthorizationDetails +// operation. +type RoleDetail struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `min:"20" type:"string"` + + // The trust policy that grants permission to assume the role. + AssumeRolePolicyDocument *string `min:"1" type:"string"` + + // A list of managed policies attached to the role. These policies are the role's + // access (permissions) policies. + AttachedManagedPolicies []*AttachedPolicy `type:"list"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the role was created. + CreateDate *time.Time `type:"timestamp"` + + // A list of instance profiles that contain this role. + InstanceProfileList []*InstanceProfile `type:"list"` + + // The path to the role. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + Path *string `min:"1" type:"string"` + + // The ARN of the policy used to set the permissions boundary for the role. + // + // For more information about permissions boundaries, see Permissions Boundaries + // for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. + PermissionsBoundary *AttachedPermissionsBoundary `type:"structure"` + + // The stable and unique string identifying the role. For more information about + // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + RoleId *string `min:"16" type:"string"` + + // The friendly name that identifies the role. + RoleName *string `min:"1" type:"string"` + + // A list of inline policies embedded in the role. These policies are the role's + // access (permissions) policies. + RolePolicyList []*PolicyDetail `type:"list"` +} + +// String returns the string representation +func (s RoleDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoleDetail) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *RoleDetail) SetArn(v string) *RoleDetail { + s.Arn = &v + return s +} + +// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. +func (s *RoleDetail) SetAssumeRolePolicyDocument(v string) *RoleDetail { + s.AssumeRolePolicyDocument = &v + return s +} + +// SetAttachedManagedPolicies sets the AttachedManagedPolicies field's value. +func (s *RoleDetail) SetAttachedManagedPolicies(v []*AttachedPolicy) *RoleDetail { + s.AttachedManagedPolicies = v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *RoleDetail) SetCreateDate(v time.Time) *RoleDetail { + s.CreateDate = &v + return s +} + +// SetInstanceProfileList sets the InstanceProfileList field's value. +func (s *RoleDetail) SetInstanceProfileList(v []*InstanceProfile) *RoleDetail { + s.InstanceProfileList = v + return s +} + +// SetPath sets the Path field's value. +func (s *RoleDetail) SetPath(v string) *RoleDetail { + s.Path = &v + return s +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *RoleDetail) SetPermissionsBoundary(v *AttachedPermissionsBoundary) *RoleDetail { + s.PermissionsBoundary = v + return s +} + +// SetRoleId sets the RoleId field's value. +func (s *RoleDetail) SetRoleId(v string) *RoleDetail { + s.RoleId = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *RoleDetail) SetRoleName(v string) *RoleDetail { + s.RoleName = &v + return s +} + +// SetRolePolicyList sets the RolePolicyList field's value. +func (s *RoleDetail) SetRolePolicyList(v []*PolicyDetail) *RoleDetail { + s.RolePolicyList = v + return s +} + +// An object that contains details about how a service-linked role is used, +// if that information is returned by the service. +// +// This data type is used as a response element in the GetServiceLinkedRoleDeletionStatus +// operation. +type RoleUsageType struct { + _ struct{} `type:"structure"` + + // The name of the region where the service-linked role is being used. + Region *string `min:"1" type:"string"` + + // The name of the resource that is using the service-linked role. + Resources []*string `type:"list"` +} + +// String returns the string representation +func (s RoleUsageType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoleUsageType) GoString() string { + return s.String() +} + +// SetRegion sets the Region field's value. +func (s *RoleUsageType) SetRegion(v string) *RoleUsageType { + s.Region = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *RoleUsageType) SetResources(v []*string) *RoleUsageType { + s.Resources = v + return s +} + +// Contains the list of SAML providers for this account. +type SAMLProviderListEntry struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the SAML provider. + Arn *string `min:"20" type:"string"` + + // The date and time when the SAML provider was created. + CreateDate *time.Time `type:"timestamp"` + + // The expiration date and time for the SAML provider. + ValidUntil *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s SAMLProviderListEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SAMLProviderListEntry) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *SAMLProviderListEntry) SetArn(v string) *SAMLProviderListEntry { + s.Arn = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *SAMLProviderListEntry) SetCreateDate(v time.Time) *SAMLProviderListEntry { + s.CreateDate = &v + return s +} + +// SetValidUntil sets the ValidUntil field's value. +func (s *SAMLProviderListEntry) SetValidUntil(v time.Time) *SAMLProviderListEntry { + s.ValidUntil = &v + return s +} + +// Contains information about an SSH public key. +// +// This data type is used as a response element in the GetSSHPublicKey and UploadSSHPublicKey +// operations. +type SSHPublicKey struct { + _ struct{} `type:"structure"` + + // The MD5 message digest of the SSH public key. + // + // Fingerprint is a required field + Fingerprint *string `min:"48" type:"string" required:"true"` + + // The SSH public key. + // + // SSHPublicKeyBody is a required field + SSHPublicKeyBody *string `min:"1" type:"string" required:"true"` + + // The unique identifier for the SSH public key. + // + // SSHPublicKeyId is a required field + SSHPublicKeyId *string `min:"20" type:"string" required:"true"` + + // The status of the SSH public key. Active means that the key can be used for + // authentication with an AWS CodeCommit repository. Inactive means that the + // key cannot be used. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the SSH public key was uploaded. + UploadDate *time.Time `type:"timestamp"` + + // The name of the IAM user associated with the SSH public key. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s SSHPublicKey) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SSHPublicKey) GoString() string { + return s.String() +} + +// SetFingerprint sets the Fingerprint field's value. +func (s *SSHPublicKey) SetFingerprint(v string) *SSHPublicKey { + s.Fingerprint = &v + return s +} + +// SetSSHPublicKeyBody sets the SSHPublicKeyBody field's value. +func (s *SSHPublicKey) SetSSHPublicKeyBody(v string) *SSHPublicKey { + s.SSHPublicKeyBody = &v + return s +} + +// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. +func (s *SSHPublicKey) SetSSHPublicKeyId(v string) *SSHPublicKey { + s.SSHPublicKeyId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *SSHPublicKey) SetStatus(v string) *SSHPublicKey { + s.Status = &v + return s +} + +// SetUploadDate sets the UploadDate field's value. +func (s *SSHPublicKey) SetUploadDate(v time.Time) *SSHPublicKey { + s.UploadDate = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *SSHPublicKey) SetUserName(v string) *SSHPublicKey { + s.UserName = &v + return s +} + +// Contains information about an SSH public key, without the key's body or fingerprint. +// +// This data type is used as a response element in the ListSSHPublicKeys operation. +type SSHPublicKeyMetadata struct { + _ struct{} `type:"structure"` + + // The unique identifier for the SSH public key. + // + // SSHPublicKeyId is a required field + SSHPublicKeyId *string `min:"20" type:"string" required:"true"` + + // The status of the SSH public key. Active means that the key can be used for + // authentication with an AWS CodeCommit repository. Inactive means that the + // key cannot be used. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the SSH public key was uploaded. + // + // UploadDate is a required field + UploadDate *time.Time `type:"timestamp" required:"true"` + + // The name of the IAM user associated with the SSH public key. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s SSHPublicKeyMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SSHPublicKeyMetadata) GoString() string { + return s.String() +} + +// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. +func (s *SSHPublicKeyMetadata) SetSSHPublicKeyId(v string) *SSHPublicKeyMetadata { + s.SSHPublicKeyId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *SSHPublicKeyMetadata) SetStatus(v string) *SSHPublicKeyMetadata { + s.Status = &v + return s +} + +// SetUploadDate sets the UploadDate field's value. +func (s *SSHPublicKeyMetadata) SetUploadDate(v time.Time) *SSHPublicKeyMetadata { + s.UploadDate = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *SSHPublicKeyMetadata) SetUserName(v string) *SSHPublicKeyMetadata { + s.UserName = &v + return s +} + +// Contains information about a server certificate. +// +// This data type is used as a response element in the GetServerCertificate +// operation. +type ServerCertificate struct { + _ struct{} `type:"structure"` + + // The contents of the public key certificate. + // + // CertificateBody is a required field + CertificateBody *string `min:"1" type:"string" required:"true"` + + // The contents of the public key certificate chain. + CertificateChain *string `min:"1" type:"string"` + + // The meta information of the server certificate, such as its name, path, ID, + // and ARN. + // + // ServerCertificateMetadata is a required field + ServerCertificateMetadata *ServerCertificateMetadata `type:"structure" required:"true"` +} + +// String returns the string representation +func (s ServerCertificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerCertificate) GoString() string { + return s.String() +} + +// SetCertificateBody sets the CertificateBody field's value. +func (s *ServerCertificate) SetCertificateBody(v string) *ServerCertificate { + s.CertificateBody = &v + return s +} + +// SetCertificateChain sets the CertificateChain field's value. +func (s *ServerCertificate) SetCertificateChain(v string) *ServerCertificate { + s.CertificateChain = &v + return s +} + +// SetServerCertificateMetadata sets the ServerCertificateMetadata field's value. +func (s *ServerCertificate) SetServerCertificateMetadata(v *ServerCertificateMetadata) *ServerCertificate { + s.ServerCertificateMetadata = v + return s +} + +// Contains information about a server certificate without its certificate body, +// certificate chain, and private key. +// +// This data type is used as a response element in the UploadServerCertificate +// and ListServerCertificates operations. +type ServerCertificateMetadata struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) specifying the server certificate. For more + // information about ARNs and how to use them in policies, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Arn is a required field + Arn *string `min:"20" type:"string" required:"true"` + + // The date on which the certificate is set to expire. + Expiration *time.Time `type:"timestamp"` + + // The path to the server certificate. For more information about paths, see + // IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Path is a required field + Path *string `min:"1" type:"string" required:"true"` + + // The stable and unique string identifying the server certificate. For more + // information about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // ServerCertificateId is a required field + ServerCertificateId *string `min:"16" type:"string" required:"true"` + + // The name that identifies the server certificate. + // + // ServerCertificateName is a required field + ServerCertificateName *string `min:"1" type:"string" required:"true"` + + // The date when the server certificate was uploaded. + UploadDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s ServerCertificateMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerCertificateMetadata) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ServerCertificateMetadata) SetArn(v string) *ServerCertificateMetadata { + s.Arn = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *ServerCertificateMetadata) SetExpiration(v time.Time) *ServerCertificateMetadata { + s.Expiration = &v + return s +} + +// SetPath sets the Path field's value. +func (s *ServerCertificateMetadata) SetPath(v string) *ServerCertificateMetadata { + s.Path = &v + return s +} + +// SetServerCertificateId sets the ServerCertificateId field's value. +func (s *ServerCertificateMetadata) SetServerCertificateId(v string) *ServerCertificateMetadata { + s.ServerCertificateId = &v + return s +} + +// SetServerCertificateName sets the ServerCertificateName field's value. +func (s *ServerCertificateMetadata) SetServerCertificateName(v string) *ServerCertificateMetadata { + s.ServerCertificateName = &v + return s +} + +// SetUploadDate sets the UploadDate field's value. +func (s *ServerCertificateMetadata) SetUploadDate(v time.Time) *ServerCertificateMetadata { + s.UploadDate = &v + return s +} + +// Contains the details of a service-specific credential. +type ServiceSpecificCredential struct { + _ struct{} `type:"structure"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the service-specific credential were created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // The name of the service associated with the service-specific credential. + // + // ServiceName is a required field + ServiceName *string `type:"string" required:"true"` + + // The generated password for the service-specific credential. + // + // ServicePassword is a required field + ServicePassword *string `type:"string" required:"true"` + + // The unique identifier for the service-specific credential. + // + // ServiceSpecificCredentialId is a required field + ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` + + // The generated user name for the service-specific credential. This value is + // generated by combining the IAM user's name combined with the ID number of + // the AWS account, as in jane-at-123456789012, for example. This value cannot + // be configured by the user. + // + // ServiceUserName is a required field + ServiceUserName *string `min:"17" type:"string" required:"true"` + + // The status of the service-specific credential. Active means that the key + // is valid for API calls, while Inactive means it is not. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the IAM user associated with the service-specific credential. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ServiceSpecificCredential) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceSpecificCredential) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *ServiceSpecificCredential) SetCreateDate(v time.Time) *ServiceSpecificCredential { + s.CreateDate = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *ServiceSpecificCredential) SetServiceName(v string) *ServiceSpecificCredential { + s.ServiceName = &v + return s +} + +// SetServicePassword sets the ServicePassword field's value. +func (s *ServiceSpecificCredential) SetServicePassword(v string) *ServiceSpecificCredential { + s.ServicePassword = &v + return s +} + +// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. +func (s *ServiceSpecificCredential) SetServiceSpecificCredentialId(v string) *ServiceSpecificCredential { + s.ServiceSpecificCredentialId = &v + return s +} + +// SetServiceUserName sets the ServiceUserName field's value. +func (s *ServiceSpecificCredential) SetServiceUserName(v string) *ServiceSpecificCredential { + s.ServiceUserName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ServiceSpecificCredential) SetStatus(v string) *ServiceSpecificCredential { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ServiceSpecificCredential) SetUserName(v string) *ServiceSpecificCredential { + s.UserName = &v + return s +} + +// Contains additional details about a service-specific credential. +type ServiceSpecificCredentialMetadata struct { + _ struct{} `type:"structure"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the service-specific credential were created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // The name of the service associated with the service-specific credential. + // + // ServiceName is a required field + ServiceName *string `type:"string" required:"true"` + + // The unique identifier for the service-specific credential. + // + // ServiceSpecificCredentialId is a required field + ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` + + // The generated user name for the service-specific credential. + // + // ServiceUserName is a required field + ServiceUserName *string `min:"17" type:"string" required:"true"` + + // The status of the service-specific credential. Active means that the key + // is valid for API calls, while Inactive means it is not. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the IAM user associated with the service-specific credential. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ServiceSpecificCredentialMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceSpecificCredentialMetadata) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *ServiceSpecificCredentialMetadata) SetCreateDate(v time.Time) *ServiceSpecificCredentialMetadata { + s.CreateDate = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *ServiceSpecificCredentialMetadata) SetServiceName(v string) *ServiceSpecificCredentialMetadata { + s.ServiceName = &v + return s +} + +// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. +func (s *ServiceSpecificCredentialMetadata) SetServiceSpecificCredentialId(v string) *ServiceSpecificCredentialMetadata { + s.ServiceSpecificCredentialId = &v + return s +} + +// SetServiceUserName sets the ServiceUserName field's value. +func (s *ServiceSpecificCredentialMetadata) SetServiceUserName(v string) *ServiceSpecificCredentialMetadata { + s.ServiceUserName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ServiceSpecificCredentialMetadata) SetStatus(v string) *ServiceSpecificCredentialMetadata { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ServiceSpecificCredentialMetadata) SetUserName(v string) *ServiceSpecificCredentialMetadata { + s.UserName = &v + return s +} + +type SetDefaultPolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM policy whose default version you + // want to set. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicyArn is a required field + PolicyArn *string `min:"20" type:"string" required:"true"` + + // The version of the policy to set as the default (operative) version. + // + // For more information about managed policy versions, see Versioning for Managed + // Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) + // in the IAM User Guide. + // + // VersionId is a required field + VersionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SetDefaultPolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDefaultPolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetDefaultPolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetDefaultPolicyVersionInput"} + if s.PolicyArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyArn")) + } + if s.PolicyArn != nil && len(*s.PolicyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicyArn", 20)) + } + if s.VersionId == nil { + invalidParams.Add(request.NewErrParamRequired("VersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *SetDefaultPolicyVersionInput) SetPolicyArn(v string) *SetDefaultPolicyVersionInput { + s.PolicyArn = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *SetDefaultPolicyVersionInput) SetVersionId(v string) *SetDefaultPolicyVersionInput { + s.VersionId = &v + return s +} + +type SetDefaultPolicyVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetDefaultPolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDefaultPolicyVersionOutput) GoString() string { + return s.String() +} + +// Contains information about an X.509 signing certificate. +// +// This data type is used as a response element in the UploadSigningCertificate +// and ListSigningCertificates operations. +type SigningCertificate struct { + _ struct{} `type:"structure"` + + // The contents of the signing certificate. + // + // CertificateBody is a required field + CertificateBody *string `min:"1" type:"string" required:"true"` + + // The ID for the signing certificate. + // + // CertificateId is a required field + CertificateId *string `min:"24" type:"string" required:"true"` + + // The status of the signing certificate. Active means that the key is valid + // for API calls, while Inactive means it is not. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The date when the signing certificate was uploaded. + UploadDate *time.Time `type:"timestamp"` + + // The name of the user the signing certificate is associated with. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s SigningCertificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SigningCertificate) GoString() string { + return s.String() +} + +// SetCertificateBody sets the CertificateBody field's value. +func (s *SigningCertificate) SetCertificateBody(v string) *SigningCertificate { + s.CertificateBody = &v + return s +} + +// SetCertificateId sets the CertificateId field's value. +func (s *SigningCertificate) SetCertificateId(v string) *SigningCertificate { + s.CertificateId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *SigningCertificate) SetStatus(v string) *SigningCertificate { + s.Status = &v + return s +} + +// SetUploadDate sets the UploadDate field's value. +func (s *SigningCertificate) SetUploadDate(v time.Time) *SigningCertificate { + s.UploadDate = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *SigningCertificate) SetUserName(v string) *SigningCertificate { + s.UserName = &v + return s +} + +type SimulateCustomPolicyInput struct { + _ struct{} `type:"structure"` + + // A list of names of API operations to evaluate in the simulation. Each operation + // is evaluated against each resource. Each operation must include the service + // identifier, such as iam:CreateUser. + // + // ActionNames is a required field + ActionNames []*string `type:"list" required:"true"` + + // The ARN of the IAM user that you want to use as the simulated caller of the + // API operations. CallerArn is required if you include a ResourcePolicy so + // that the policy's Principal element has a value to use in evaluating the + // policy. + // + // You can specify only the ARN of an IAM user. You cannot specify the ARN of + // an assumed role, federated user, or a service principal. + CallerArn *string `min:"1" type:"string"` + + // A list of context keys and corresponding values for the simulation to use. + // Whenever a context key is evaluated in one of the simulated IAM permission + // policies, the corresponding value is supplied. + ContextEntries []*ContextEntry `type:"list"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // A list of policy documents to include in the simulation. Each document is + // specified as a string containing the complete, valid JSON text of an IAM + // policy. Do not include any resource-based policies in this parameter. Any + // resource-based policy must be submitted with the ResourcePolicy parameter. + // The policies cannot be "scope-down" policies, such as you could include in + // a call to GetFederationToken (http://docs.aws.amazon.com/IAM/latest/APIReference/API_GetFederationToken.html) + // or one of the AssumeRole (http://docs.aws.amazon.com/IAM/latest/APIReference/API_AssumeRole.html) + // API operations. In other words, do not use policies designed to restrict + // what a user can do while using the temporary credentials. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyInputList is a required field + PolicyInputList []*string `type:"list" required:"true"` + + // A list of ARNs of AWS resources to include in the simulation. If this parameter + // is not provided then the value defaults to * (all resources). Each API in + // the ActionNames parameter is evaluated for each resource in this list. The + // simulation determines the access result (allowed or denied) of each combination + // and reports it in the response. + // + // The simulation does not automatically retrieve policies for the specified + // resources. If you want to include a resource policy in the simulation, then + // you must include the policy as a string in the ResourcePolicy parameter. + // + // If you include a ResourcePolicy, then it must be applicable to all of the + // resources included in the simulation or you receive an invalid input error. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + ResourceArns []*string `type:"list"` + + // Specifies the type of simulation to run. Different API operations that support + // resource-based policies require different combinations of resources. By specifying + // the type of simulation to run, you enable the policy simulator to enforce + // the presence of the required resources to ensure reliable simulation results. + // If your simulation does not match one of the following scenarios, then you + // can omit this parameter. The following list shows each of the supported scenario + // values and the resources that you must define to run the simulation. + // + // Each of the EC2 scenarios requires that you specify instance, image, and + // security-group resources. If your scenario includes an EBS volume, then you + // must specify that volume as a resource. If the EC2 scenario includes VPC, + // then you must supply the network-interface resource. If it includes an IP + // subnet, then you must specify the subnet resource. For more information on + // the EC2 scenario options, see Supported Platforms (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) + // in the Amazon EC2 User Guide. + // + // * EC2-Classic-InstanceStore + // + // instance, image, security-group + // + // * EC2-Classic-EBS + // + // instance, image, security-group, volume + // + // * EC2-VPC-InstanceStore + // + // instance, image, security-group, network-interface + // + // * EC2-VPC-InstanceStore-Subnet + // + // instance, image, security-group, network-interface, subnet + // + // * EC2-VPC-EBS + // + // instance, image, security-group, network-interface, volume + // + // * EC2-VPC-EBS-Subnet + // + // instance, image, security-group, network-interface, subnet, volume + ResourceHandlingOption *string `min:"1" type:"string"` + + // An ARN representing the AWS account ID that specifies the owner of any simulated + // resource that does not identify its owner in the resource ARN, such as an + // S3 bucket or object. If ResourceOwner is specified, it is also used as the + // account owner of any ResourcePolicy included in the simulation. If the ResourceOwner + // parameter is not specified, then the owner of the resources and the resource + // policy defaults to the account of the identity provided in CallerArn. This + // parameter is required only if you specify a resource-based policy and account + // that owns the resource is different from the account that owns the simulated + // calling user CallerArn. + // + // The ARN for an account uses the following syntax: arn:aws:iam::AWS-account-ID:root. + // For example, to represent the account with the 112233445566 ID, use the following + // ARN: arn:aws:iam::112233445566-ID:root. + ResourceOwner *string `min:"1" type:"string"` + + // A resource-based policy to include in the simulation provided as a string. + // Each resource in the simulation is treated as if it had this policy attached. + // You can include only one resource-based policy in a simulation. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + ResourcePolicy *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s SimulateCustomPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SimulateCustomPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SimulateCustomPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SimulateCustomPolicyInput"} + if s.ActionNames == nil { + invalidParams.Add(request.NewErrParamRequired("ActionNames")) + } + if s.CallerArn != nil && len(*s.CallerArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CallerArn", 1)) + } + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PolicyInputList == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyInputList")) + } + if s.ResourceHandlingOption != nil && len(*s.ResourceHandlingOption) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceHandlingOption", 1)) + } + if s.ResourceOwner != nil && len(*s.ResourceOwner) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceOwner", 1)) + } + if s.ResourcePolicy != nil && len(*s.ResourcePolicy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourcePolicy", 1)) + } + if s.ContextEntries != nil { + for i, v := range s.ContextEntries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContextEntries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActionNames sets the ActionNames field's value. +func (s *SimulateCustomPolicyInput) SetActionNames(v []*string) *SimulateCustomPolicyInput { + s.ActionNames = v + return s +} + +// SetCallerArn sets the CallerArn field's value. +func (s *SimulateCustomPolicyInput) SetCallerArn(v string) *SimulateCustomPolicyInput { + s.CallerArn = &v + return s +} + +// SetContextEntries sets the ContextEntries field's value. +func (s *SimulateCustomPolicyInput) SetContextEntries(v []*ContextEntry) *SimulateCustomPolicyInput { + s.ContextEntries = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *SimulateCustomPolicyInput) SetMarker(v string) *SimulateCustomPolicyInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *SimulateCustomPolicyInput) SetMaxItems(v int64) *SimulateCustomPolicyInput { + s.MaxItems = &v + return s +} + +// SetPolicyInputList sets the PolicyInputList field's value. +func (s *SimulateCustomPolicyInput) SetPolicyInputList(v []*string) *SimulateCustomPolicyInput { + s.PolicyInputList = v + return s +} + +// SetResourceArns sets the ResourceArns field's value. +func (s *SimulateCustomPolicyInput) SetResourceArns(v []*string) *SimulateCustomPolicyInput { + s.ResourceArns = v + return s +} + +// SetResourceHandlingOption sets the ResourceHandlingOption field's value. +func (s *SimulateCustomPolicyInput) SetResourceHandlingOption(v string) *SimulateCustomPolicyInput { + s.ResourceHandlingOption = &v + return s +} + +// SetResourceOwner sets the ResourceOwner field's value. +func (s *SimulateCustomPolicyInput) SetResourceOwner(v string) *SimulateCustomPolicyInput { + s.ResourceOwner = &v + return s +} + +// SetResourcePolicy sets the ResourcePolicy field's value. +func (s *SimulateCustomPolicyInput) SetResourcePolicy(v string) *SimulateCustomPolicyInput { + s.ResourcePolicy = &v + return s +} + +// Contains the response to a successful SimulatePrincipalPolicy or SimulateCustomPolicy +// request. +type SimulatePolicyResponse struct { + _ struct{} `type:"structure"` + + // The results of the simulation. + EvaluationResults []*EvaluationResult `type:"list"` + + // A flag that indicates whether there are more items to return. If your results + // were truncated, you can make a subsequent pagination request using the Marker + // request parameter to retrieve more items. Note that IAM might return fewer + // than the MaxItems number of results even when there are more results available. + // We recommend that you check IsTruncated after every call to ensure that you + // receive all of your results. + IsTruncated *bool `type:"boolean"` + + // When IsTruncated is true, this element is present and contains the value + // to use for the Marker parameter in a subsequent pagination request. + Marker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s SimulatePolicyResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SimulatePolicyResponse) GoString() string { + return s.String() +} + +// SetEvaluationResults sets the EvaluationResults field's value. +func (s *SimulatePolicyResponse) SetEvaluationResults(v []*EvaluationResult) *SimulatePolicyResponse { + s.EvaluationResults = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *SimulatePolicyResponse) SetIsTruncated(v bool) *SimulatePolicyResponse { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *SimulatePolicyResponse) SetMarker(v string) *SimulatePolicyResponse { + s.Marker = &v + return s +} + +type SimulatePrincipalPolicyInput struct { + _ struct{} `type:"structure"` + + // A list of names of API operations to evaluate in the simulation. Each operation + // is evaluated for each resource. Each operation must include the service identifier, + // such as iam:CreateUser. + // + // ActionNames is a required field + ActionNames []*string `type:"list" required:"true"` + + // The ARN of the IAM user that you want to specify as the simulated caller + // of the API operations. If you do not specify a CallerArn, it defaults to + // the ARN of the user that you specify in PolicySourceArn, if you specified + // a user. If you include both a PolicySourceArn (for example, arn:aws:iam::123456789012:user/David) + // and a CallerArn (for example, arn:aws:iam::123456789012:user/Bob), the result + // is that you simulate calling the API operations as Bob, as if Bob had David's + // policies. + // + // You can specify only the ARN of an IAM user. You cannot specify the ARN of + // an assumed role, federated user, or a service principal. + // + // CallerArn is required if you include a ResourcePolicy and the PolicySourceArn + // is not the ARN for an IAM user. This is required so that the resource-based + // policy's Principal element has a value to use in evaluating the policy. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + CallerArn *string `min:"1" type:"string"` + + // A list of context keys and corresponding values for the simulation to use. + // Whenever a context key is evaluated in one of the simulated IAM permission + // policies, the corresponding value is supplied. + ContextEntries []*ContextEntry `type:"list"` + + // Use this parameter only when paginating results and only after you receive + // a response indicating that the results are truncated. Set it to the value + // of the Marker element in the response that you received to indicate where + // the next call should start. + Marker *string `min:"1" type:"string"` + + // (Optional) Use this only when paginating results to indicate the maximum + // number of items you want in the response. If additional items exist beyond + // the maximum you specify, the IsTruncated response element is true. + // + // If you do not include this parameter, it defaults to 100. Note that IAM might + // return fewer results, even when there are more results available. In that + // case, the IsTruncated response element returns true and Marker contains a + // value to include in the subsequent call that tells the service where to continue + // from. + MaxItems *int64 `min:"1" type:"integer"` + + // An optional list of additional policy documents to include in the simulation. + // Each document is specified as a string containing the complete, valid JSON + // text of an IAM policy. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + PolicyInputList []*string `type:"list"` + + // The Amazon Resource Name (ARN) of a user, group, or role whose policies you + // want to include in the simulation. If you specify a user, group, or role, + // the simulation includes all policies that are associated with that entity. + // If you specify a user, the simulation also includes all policies that are + // attached to any groups the user belongs to. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // PolicySourceArn is a required field + PolicySourceArn *string `min:"20" type:"string" required:"true"` + + // A list of ARNs of AWS resources to include in the simulation. If this parameter + // is not provided, then the value defaults to * (all resources). Each API in + // the ActionNames parameter is evaluated for each resource in this list. The + // simulation determines the access result (allowed or denied) of each combination + // and reports it in the response. + // + // The simulation does not automatically retrieve policies for the specified + // resources. If you want to include a resource policy in the simulation, then + // you must include the policy as a string in the ResourcePolicy parameter. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + ResourceArns []*string `type:"list"` + + // Specifies the type of simulation to run. Different API operations that support + // resource-based policies require different combinations of resources. By specifying + // the type of simulation to run, you enable the policy simulator to enforce + // the presence of the required resources to ensure reliable simulation results. + // If your simulation does not match one of the following scenarios, then you + // can omit this parameter. The following list shows each of the supported scenario + // values and the resources that you must define to run the simulation. + // + // Each of the EC2 scenarios requires that you specify instance, image, and + // security-group resources. If your scenario includes an EBS volume, then you + // must specify that volume as a resource. If the EC2 scenario includes VPC, + // then you must supply the network-interface resource. If it includes an IP + // subnet, then you must specify the subnet resource. For more information on + // the EC2 scenario options, see Supported Platforms (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) + // in the Amazon EC2 User Guide. + // + // * EC2-Classic-InstanceStore + // + // instance, image, security-group + // + // * EC2-Classic-EBS + // + // instance, image, security-group, volume + // + // * EC2-VPC-InstanceStore + // + // instance, image, security-group, network-interface + // + // * EC2-VPC-InstanceStore-Subnet + // + // instance, image, security-group, network-interface, subnet + // + // * EC2-VPC-EBS + // + // instance, image, security-group, network-interface, volume + // + // * EC2-VPC-EBS-Subnet + // + // instance, image, security-group, network-interface, subnet, volume + ResourceHandlingOption *string `min:"1" type:"string"` + + // An AWS account ID that specifies the owner of any simulated resource that + // does not identify its owner in the resource ARN, such as an S3 bucket or + // object. If ResourceOwner is specified, it is also used as the account owner + // of any ResourcePolicy included in the simulation. If the ResourceOwner parameter + // is not specified, then the owner of the resources and the resource policy + // defaults to the account of the identity provided in CallerArn. This parameter + // is required only if you specify a resource-based policy and account that + // owns the resource is different from the account that owns the simulated calling + // user CallerArn. + ResourceOwner *string `min:"1" type:"string"` + + // A resource-based policy to include in the simulation provided as a string. + // Each resource in the simulation is treated as if it had this policy attached. + // You can include only one resource-based policy in a simulation. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + ResourcePolicy *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s SimulatePrincipalPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SimulatePrincipalPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SimulatePrincipalPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SimulatePrincipalPolicyInput"} + if s.ActionNames == nil { + invalidParams.Add(request.NewErrParamRequired("ActionNames")) + } + if s.CallerArn != nil && len(*s.CallerArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CallerArn", 1)) + } + if s.Marker != nil && len(*s.Marker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) + } + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + if s.PolicySourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("PolicySourceArn")) + } + if s.PolicySourceArn != nil && len(*s.PolicySourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PolicySourceArn", 20)) + } + if s.ResourceHandlingOption != nil && len(*s.ResourceHandlingOption) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceHandlingOption", 1)) + } + if s.ResourceOwner != nil && len(*s.ResourceOwner) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceOwner", 1)) + } + if s.ResourcePolicy != nil && len(*s.ResourcePolicy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourcePolicy", 1)) + } + if s.ContextEntries != nil { + for i, v := range s.ContextEntries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContextEntries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActionNames sets the ActionNames field's value. +func (s *SimulatePrincipalPolicyInput) SetActionNames(v []*string) *SimulatePrincipalPolicyInput { + s.ActionNames = v + return s +} + +// SetCallerArn sets the CallerArn field's value. +func (s *SimulatePrincipalPolicyInput) SetCallerArn(v string) *SimulatePrincipalPolicyInput { + s.CallerArn = &v + return s +} + +// SetContextEntries sets the ContextEntries field's value. +func (s *SimulatePrincipalPolicyInput) SetContextEntries(v []*ContextEntry) *SimulatePrincipalPolicyInput { + s.ContextEntries = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *SimulatePrincipalPolicyInput) SetMarker(v string) *SimulatePrincipalPolicyInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *SimulatePrincipalPolicyInput) SetMaxItems(v int64) *SimulatePrincipalPolicyInput { + s.MaxItems = &v + return s +} + +// SetPolicyInputList sets the PolicyInputList field's value. +func (s *SimulatePrincipalPolicyInput) SetPolicyInputList(v []*string) *SimulatePrincipalPolicyInput { + s.PolicyInputList = v + return s +} + +// SetPolicySourceArn sets the PolicySourceArn field's value. +func (s *SimulatePrincipalPolicyInput) SetPolicySourceArn(v string) *SimulatePrincipalPolicyInput { + s.PolicySourceArn = &v + return s +} + +// SetResourceArns sets the ResourceArns field's value. +func (s *SimulatePrincipalPolicyInput) SetResourceArns(v []*string) *SimulatePrincipalPolicyInput { + s.ResourceArns = v + return s +} + +// SetResourceHandlingOption sets the ResourceHandlingOption field's value. +func (s *SimulatePrincipalPolicyInput) SetResourceHandlingOption(v string) *SimulatePrincipalPolicyInput { + s.ResourceHandlingOption = &v + return s +} + +// SetResourceOwner sets the ResourceOwner field's value. +func (s *SimulatePrincipalPolicyInput) SetResourceOwner(v string) *SimulatePrincipalPolicyInput { + s.ResourceOwner = &v + return s +} + +// SetResourcePolicy sets the ResourcePolicy field's value. +func (s *SimulatePrincipalPolicyInput) SetResourcePolicy(v string) *SimulatePrincipalPolicyInput { + s.ResourcePolicy = &v + return s +} + +// Contains a reference to a Statement element in a policy document that determines +// the result of the simulation. +// +// This data type is used by the MatchedStatements member of the EvaluationResult +// type. +type Statement struct { + _ struct{} `type:"structure"` + + // The row and column of the end of a Statement in an IAM policy. + EndPosition *Position `type:"structure"` + + // The identifier of the policy that was provided as an input. + SourcePolicyId *string `type:"string"` + + // The type of the policy. + SourcePolicyType *string `type:"string" enum:"PolicySourceType"` + + // The row and column of the beginning of the Statement in an IAM policy. + StartPosition *Position `type:"structure"` +} + +// String returns the string representation +func (s Statement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Statement) GoString() string { + return s.String() +} + +// SetEndPosition sets the EndPosition field's value. +func (s *Statement) SetEndPosition(v *Position) *Statement { + s.EndPosition = v + return s +} + +// SetSourcePolicyId sets the SourcePolicyId field's value. +func (s *Statement) SetSourcePolicyId(v string) *Statement { + s.SourcePolicyId = &v + return s +} + +// SetSourcePolicyType sets the SourcePolicyType field's value. +func (s *Statement) SetSourcePolicyType(v string) *Statement { + s.SourcePolicyType = &v + return s +} + +// SetStartPosition sets the StartPosition field's value. +func (s *Statement) SetStartPosition(v *Position) *Statement { + s.StartPosition = v + return s +} + +type UpdateAccessKeyInput struct { + _ struct{} `type:"structure"` + + // The access key ID of the secret access key you want to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` + + // The status you want to assign to the secret access key. Active means that + // the key can be used for API calls to AWS, while Inactive means that the key + // cannot be used. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the user whose key you want to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateAccessKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAccessKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateAccessKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateAccessKeyInput"} + if s.AccessKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) + } + if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { + invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *UpdateAccessKeyInput) SetAccessKeyId(v string) *UpdateAccessKeyInput { + s.AccessKeyId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateAccessKeyInput) SetStatus(v string) *UpdateAccessKeyInput { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UpdateAccessKeyInput) SetUserName(v string) *UpdateAccessKeyInput { + s.UserName = &v + return s +} + +type UpdateAccessKeyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateAccessKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAccessKeyOutput) GoString() string { + return s.String() +} + +type UpdateAccountPasswordPolicyInput struct { + _ struct{} `type:"structure"` + + // Allows all IAM users in your account to use the AWS Management Console to + // change their own passwords. For more information, see Letting IAM Users Change + // Their Own Passwords (http://docs.aws.amazon.com/IAM/latest/UserGuide/HowToPwdIAMUser.html) + // in the IAM User Guide. + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of false. The result is that IAM users in the account do + // not automatically have permissions to change their own password. + AllowUsersToChangePassword *bool `type:"boolean"` + + // Prevents IAM users from setting a new password after their password has expired. + // The IAM user cannot be accessed until an administrator resets the password. + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of false. The result is that IAM users can change their + // passwords after they expire and continue to sign in as the user. + HardExpiry *bool `type:"boolean"` + + // The number of days that an IAM user password is valid. + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of 0. The result is that IAM user passwords never expire. + MaxPasswordAge *int64 `min:"1" type:"integer"` + + // The minimum number of characters allowed in an IAM user password. + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of 6. + MinimumPasswordLength *int64 `min:"6" type:"integer"` + + // Specifies the number of previous passwords that IAM users are prevented from + // reusing. + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of 0. The result is that IAM users are not prevented from + // reusing previous passwords. + PasswordReusePrevention *int64 `min:"1" type:"integer"` + + // Specifies whether IAM user passwords must contain at least one lowercase + // character from the ISO basic Latin alphabet (a to z). + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of false. The result is that passwords do not require at + // least one lowercase character. + RequireLowercaseCharacters *bool `type:"boolean"` + + // Specifies whether IAM user passwords must contain at least one numeric character + // (0 to 9). + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of false. The result is that passwords do not require at + // least one numeric character. + RequireNumbers *bool `type:"boolean"` + + // Specifies whether IAM user passwords must contain at least one of the following + // non-alphanumeric characters: + // + // ! @ # $ % ^ & * ( ) _ + - = [ ] { } | ' + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of false. The result is that passwords do not require at + // least one symbol character. + RequireSymbols *bool `type:"boolean"` + + // Specifies whether IAM user passwords must contain at least one uppercase + // character from the ISO basic Latin alphabet (A to Z). + // + // If you do not specify a value for this parameter, then the operation uses + // the default value of false. The result is that passwords do not require at + // least one uppercase character. + RequireUppercaseCharacters *bool `type:"boolean"` +} + +// String returns the string representation +func (s UpdateAccountPasswordPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAccountPasswordPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateAccountPasswordPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateAccountPasswordPolicyInput"} + if s.MaxPasswordAge != nil && *s.MaxPasswordAge < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxPasswordAge", 1)) + } + if s.MinimumPasswordLength != nil && *s.MinimumPasswordLength < 6 { + invalidParams.Add(request.NewErrParamMinValue("MinimumPasswordLength", 6)) + } + if s.PasswordReusePrevention != nil && *s.PasswordReusePrevention < 1 { + invalidParams.Add(request.NewErrParamMinValue("PasswordReusePrevention", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllowUsersToChangePassword sets the AllowUsersToChangePassword field's value. +func (s *UpdateAccountPasswordPolicyInput) SetAllowUsersToChangePassword(v bool) *UpdateAccountPasswordPolicyInput { + s.AllowUsersToChangePassword = &v + return s +} + +// SetHardExpiry sets the HardExpiry field's value. +func (s *UpdateAccountPasswordPolicyInput) SetHardExpiry(v bool) *UpdateAccountPasswordPolicyInput { + s.HardExpiry = &v + return s +} + +// SetMaxPasswordAge sets the MaxPasswordAge field's value. +func (s *UpdateAccountPasswordPolicyInput) SetMaxPasswordAge(v int64) *UpdateAccountPasswordPolicyInput { + s.MaxPasswordAge = &v + return s +} + +// SetMinimumPasswordLength sets the MinimumPasswordLength field's value. +func (s *UpdateAccountPasswordPolicyInput) SetMinimumPasswordLength(v int64) *UpdateAccountPasswordPolicyInput { + s.MinimumPasswordLength = &v + return s +} + +// SetPasswordReusePrevention sets the PasswordReusePrevention field's value. +func (s *UpdateAccountPasswordPolicyInput) SetPasswordReusePrevention(v int64) *UpdateAccountPasswordPolicyInput { + s.PasswordReusePrevention = &v + return s +} + +// SetRequireLowercaseCharacters sets the RequireLowercaseCharacters field's value. +func (s *UpdateAccountPasswordPolicyInput) SetRequireLowercaseCharacters(v bool) *UpdateAccountPasswordPolicyInput { + s.RequireLowercaseCharacters = &v + return s +} + +// SetRequireNumbers sets the RequireNumbers field's value. +func (s *UpdateAccountPasswordPolicyInput) SetRequireNumbers(v bool) *UpdateAccountPasswordPolicyInput { + s.RequireNumbers = &v + return s +} + +// SetRequireSymbols sets the RequireSymbols field's value. +func (s *UpdateAccountPasswordPolicyInput) SetRequireSymbols(v bool) *UpdateAccountPasswordPolicyInput { + s.RequireSymbols = &v + return s +} + +// SetRequireUppercaseCharacters sets the RequireUppercaseCharacters field's value. +func (s *UpdateAccountPasswordPolicyInput) SetRequireUppercaseCharacters(v bool) *UpdateAccountPasswordPolicyInput { + s.RequireUppercaseCharacters = &v + return s +} + +type UpdateAccountPasswordPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateAccountPasswordPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAccountPasswordPolicyOutput) GoString() string { + return s.String() +} + +type UpdateAssumeRolePolicyInput struct { + _ struct{} `type:"structure"` + + // The policy that grants an entity permission to assume the role. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PolicyDocument is a required field + PolicyDocument *string `min:"1" type:"string" required:"true"` + + // The name of the role to update with the new policy. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateAssumeRolePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAssumeRolePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateAssumeRolePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateAssumeRolePolicyInput"} + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyDocument != nil && len(*s.PolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyDocument", 1)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *UpdateAssumeRolePolicyInput) SetPolicyDocument(v string) *UpdateAssumeRolePolicyInput { + s.PolicyDocument = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *UpdateAssumeRolePolicyInput) SetRoleName(v string) *UpdateAssumeRolePolicyInput { + s.RoleName = &v + return s +} + +type UpdateAssumeRolePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateAssumeRolePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAssumeRolePolicyOutput) GoString() string { + return s.String() +} + +type UpdateGroupInput struct { + _ struct{} `type:"structure"` + + // Name of the IAM group to update. If you're changing the name of the group, + // this is the original name. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // New name for the IAM group. Only include this if changing the group's name. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + NewGroupName *string `min:"1" type:"string"` + + // New path for the IAM group. Only include this if changing the group's path. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + NewPath *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + if s.GroupName != nil && len(*s.GroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + } + if s.NewGroupName != nil && len(*s.NewGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewGroupName", 1)) + } + if s.NewPath != nil && len(*s.NewPath) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewPath", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput { + s.GroupName = &v + return s +} + +// SetNewGroupName sets the NewGroupName field's value. +func (s *UpdateGroupInput) SetNewGroupName(v string) *UpdateGroupInput { + s.NewGroupName = &v + return s +} + +// SetNewPath sets the NewPath field's value. +func (s *UpdateGroupInput) SetNewPath(v string) *UpdateGroupInput { + s.NewPath = &v + return s +} + +type UpdateGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateGroupOutput) GoString() string { + return s.String() +} + +type UpdateLoginProfileInput struct { + _ struct{} `type:"structure"` + + // The new password for the specified IAM user. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // However, the format can be further restricted by the account administrator + // by setting a password policy on the AWS account. For more information, see + // UpdateAccountPasswordPolicy. + Password *string `min:"1" type:"string"` + + // Allows this new password to be used only once by requiring the specified + // IAM user to set a new password on next sign-in. + PasswordResetRequired *bool `type:"boolean"` + + // The name of the user whose password you want to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateLoginProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLoginProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateLoginProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateLoginProfileInput"} + if s.Password != nil && len(*s.Password) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Password", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPassword sets the Password field's value. +func (s *UpdateLoginProfileInput) SetPassword(v string) *UpdateLoginProfileInput { + s.Password = &v + return s +} + +// SetPasswordResetRequired sets the PasswordResetRequired field's value. +func (s *UpdateLoginProfileInput) SetPasswordResetRequired(v bool) *UpdateLoginProfileInput { + s.PasswordResetRequired = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UpdateLoginProfileInput) SetUserName(v string) *UpdateLoginProfileInput { + s.UserName = &v + return s +} + +type UpdateLoginProfileOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateLoginProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLoginProfileOutput) GoString() string { + return s.String() +} + +type UpdateOpenIDConnectProviderThumbprintInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM OIDC provider resource object for + // which you want to update the thumbprint. You can get a list of OIDC provider + // ARNs by using the ListOpenIDConnectProviders operation. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // OpenIDConnectProviderArn is a required field + OpenIDConnectProviderArn *string `min:"20" type:"string" required:"true"` + + // A list of certificate thumbprints that are associated with the specified + // IAM OpenID Connect provider. For more information, see CreateOpenIDConnectProvider. + // + // ThumbprintList is a required field + ThumbprintList []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s UpdateOpenIDConnectProviderThumbprintInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateOpenIDConnectProviderThumbprintInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateOpenIDConnectProviderThumbprintInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateOpenIDConnectProviderThumbprintInput"} + if s.OpenIDConnectProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("OpenIDConnectProviderArn")) + } + if s.OpenIDConnectProviderArn != nil && len(*s.OpenIDConnectProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpenIDConnectProviderArn", 20)) + } + if s.ThumbprintList == nil { + invalidParams.Add(request.NewErrParamRequired("ThumbprintList")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOpenIDConnectProviderArn sets the OpenIDConnectProviderArn field's value. +func (s *UpdateOpenIDConnectProviderThumbprintInput) SetOpenIDConnectProviderArn(v string) *UpdateOpenIDConnectProviderThumbprintInput { + s.OpenIDConnectProviderArn = &v + return s +} + +// SetThumbprintList sets the ThumbprintList field's value. +func (s *UpdateOpenIDConnectProviderThumbprintInput) SetThumbprintList(v []*string) *UpdateOpenIDConnectProviderThumbprintInput { + s.ThumbprintList = v + return s +} + +type UpdateOpenIDConnectProviderThumbprintOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateOpenIDConnectProviderThumbprintOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateOpenIDConnectProviderThumbprintOutput) GoString() string { + return s.String() +} + +type UpdateRoleDescriptionInput struct { + _ struct{} `type:"structure"` + + // The new description that you want to apply to the specified role. + // + // Description is a required field + Description *string `type:"string" required:"true"` + + // The name of the role that you want to modify. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateRoleDescriptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRoleDescriptionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateRoleDescriptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateRoleDescriptionInput"} + if s.Description == nil { + invalidParams.Add(request.NewErrParamRequired("Description")) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *UpdateRoleDescriptionInput) SetDescription(v string) *UpdateRoleDescriptionInput { + s.Description = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *UpdateRoleDescriptionInput) SetRoleName(v string) *UpdateRoleDescriptionInput { + s.RoleName = &v + return s +} + +type UpdateRoleDescriptionOutput struct { + _ struct{} `type:"structure"` + + // A structure that contains details about the modified role. + Role *Role `type:"structure"` +} + +// String returns the string representation +func (s UpdateRoleDescriptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRoleDescriptionOutput) GoString() string { + return s.String() +} + +// SetRole sets the Role field's value. +func (s *UpdateRoleDescriptionOutput) SetRole(v *Role) *UpdateRoleDescriptionOutput { + s.Role = v + return s +} + +type UpdateRoleInput struct { + _ struct{} `type:"structure"` + + // The new description that you want to apply to the specified role. + Description *string `type:"string"` + + // The maximum session duration (in seconds) that you want to set for the specified + // role. If you do not specify a value for this setting, the default maximum + // of one hour is applied. This setting can have a value from 1 hour to 12 hours. + // + // Anyone who assumes the role from the AWS CLI or API can use the DurationSeconds + // API parameter or the duration-seconds CLI parameter to request a longer session. + // The MaxSessionDuration setting determines the maximum duration that can be + // requested using the DurationSeconds parameter. If users don't specify a value + // for the DurationSeconds parameter, their security credentials are valid for + // one hour by default. This applies when you use the AssumeRole* API operations + // or the assume-role* CLI operations but does not apply when you use those + // operations to create a console URL. For more information, see Using IAM Roles + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the + // IAM User Guide. + MaxSessionDuration *int64 `min:"3600" type:"integer"` + + // The name of the role that you want to modify. + // + // RoleName is a required field + RoleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateRoleInput"} + if s.MaxSessionDuration != nil && *s.MaxSessionDuration < 3600 { + invalidParams.Add(request.NewErrParamMinValue("MaxSessionDuration", 3600)) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + if s.RoleName != nil && len(*s.RoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *UpdateRoleInput) SetDescription(v string) *UpdateRoleInput { + s.Description = &v + return s +} + +// SetMaxSessionDuration sets the MaxSessionDuration field's value. +func (s *UpdateRoleInput) SetMaxSessionDuration(v int64) *UpdateRoleInput { + s.MaxSessionDuration = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *UpdateRoleInput) SetRoleName(v string) *UpdateRoleInput { + s.RoleName = &v + return s +} + +type UpdateRoleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRoleOutput) GoString() string { + return s.String() +} + +type UpdateSAMLProviderInput struct { + _ struct{} `type:"structure"` + + // An XML document generated by an identity provider (IdP) that supports SAML + // 2.0. The document includes the issuer's name, expiration information, and + // keys that can be used to validate the SAML authentication response (assertions) + // that are received from the IdP. You must generate the metadata document using + // the identity management software that is used as your organization's IdP. + // + // SAMLMetadataDocument is a required field + SAMLMetadataDocument *string `min:"1000" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the SAML provider to update. + // + // For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // SAMLProviderArn is a required field + SAMLProviderArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateSAMLProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSAMLProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSAMLProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSAMLProviderInput"} + if s.SAMLMetadataDocument == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLMetadataDocument")) + } + if s.SAMLMetadataDocument != nil && len(*s.SAMLMetadataDocument) < 1000 { + invalidParams.Add(request.NewErrParamMinLen("SAMLMetadataDocument", 1000)) + } + if s.SAMLProviderArn == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLProviderArn")) + } + if s.SAMLProviderArn != nil && len(*s.SAMLProviderArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("SAMLProviderArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSAMLMetadataDocument sets the SAMLMetadataDocument field's value. +func (s *UpdateSAMLProviderInput) SetSAMLMetadataDocument(v string) *UpdateSAMLProviderInput { + s.SAMLMetadataDocument = &v + return s +} + +// SetSAMLProviderArn sets the SAMLProviderArn field's value. +func (s *UpdateSAMLProviderInput) SetSAMLProviderArn(v string) *UpdateSAMLProviderInput { + s.SAMLProviderArn = &v + return s +} + +// Contains the response to a successful UpdateSAMLProvider request. +type UpdateSAMLProviderOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the SAML provider that was updated. + SAMLProviderArn *string `min:"20" type:"string"` +} + +// String returns the string representation +func (s UpdateSAMLProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSAMLProviderOutput) GoString() string { + return s.String() +} + +// SetSAMLProviderArn sets the SAMLProviderArn field's value. +func (s *UpdateSAMLProviderOutput) SetSAMLProviderArn(v string) *UpdateSAMLProviderOutput { + s.SAMLProviderArn = &v + return s +} + +type UpdateSSHPublicKeyInput struct { + _ struct{} `type:"structure"` + + // The unique identifier for the SSH public key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // SSHPublicKeyId is a required field + SSHPublicKeyId *string `min:"20" type:"string" required:"true"` + + // The status to assign to the SSH public key. Active means that the key can + // be used for authentication with an AWS CodeCommit repository. Inactive means + // that the key cannot be used. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the IAM user associated with the SSH public key. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateSSHPublicKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSSHPublicKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSSHPublicKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSSHPublicKeyInput"} + if s.SSHPublicKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyId")) + } + if s.SSHPublicKeyId != nil && len(*s.SSHPublicKeyId) < 20 { + invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyId", 20)) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSSHPublicKeyId sets the SSHPublicKeyId field's value. +func (s *UpdateSSHPublicKeyInput) SetSSHPublicKeyId(v string) *UpdateSSHPublicKeyInput { + s.SSHPublicKeyId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateSSHPublicKeyInput) SetStatus(v string) *UpdateSSHPublicKeyInput { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UpdateSSHPublicKeyInput) SetUserName(v string) *UpdateSSHPublicKeyInput { + s.UserName = &v + return s +} + +type UpdateSSHPublicKeyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateSSHPublicKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSSHPublicKeyOutput) GoString() string { + return s.String() +} + +type UpdateServerCertificateInput struct { + _ struct{} `type:"structure"` + + // The new path for the server certificate. Include this only if you are updating + // the server certificate's path. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + NewPath *string `min:"1" type:"string"` + + // The new name for the server certificate. Include this only if you are updating + // the server certificate's name. The name of the certificate cannot contain + // any spaces. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + NewServerCertificateName *string `min:"1" type:"string"` + + // The name of the server certificate that you want to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // ServerCertificateName is a required field + ServerCertificateName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateServerCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateServerCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateServerCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateServerCertificateInput"} + if s.NewPath != nil && len(*s.NewPath) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewPath", 1)) + } + if s.NewServerCertificateName != nil && len(*s.NewServerCertificateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewServerCertificateName", 1)) + } + if s.ServerCertificateName == nil { + invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) + } + if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNewPath sets the NewPath field's value. +func (s *UpdateServerCertificateInput) SetNewPath(v string) *UpdateServerCertificateInput { + s.NewPath = &v + return s +} + +// SetNewServerCertificateName sets the NewServerCertificateName field's value. +func (s *UpdateServerCertificateInput) SetNewServerCertificateName(v string) *UpdateServerCertificateInput { + s.NewServerCertificateName = &v + return s +} + +// SetServerCertificateName sets the ServerCertificateName field's value. +func (s *UpdateServerCertificateInput) SetServerCertificateName(v string) *UpdateServerCertificateInput { + s.ServerCertificateName = &v + return s +} + +type UpdateServerCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateServerCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateServerCertificateOutput) GoString() string { + return s.String() +} + +type UpdateServiceSpecificCredentialInput struct { + _ struct{} `type:"structure"` + + // The unique identifier of the service-specific credential. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // ServiceSpecificCredentialId is a required field + ServiceSpecificCredentialId *string `min:"20" type:"string" required:"true"` + + // The status to be assigned to the service-specific credential. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the IAM user associated with the service-specific credential. + // If you do not specify this value, then the operation assumes the user whose + // credentials are used to call the operation. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateServiceSpecificCredentialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateServiceSpecificCredentialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateServiceSpecificCredentialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateServiceSpecificCredentialInput"} + if s.ServiceSpecificCredentialId == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceSpecificCredentialId")) + } + if s.ServiceSpecificCredentialId != nil && len(*s.ServiceSpecificCredentialId) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ServiceSpecificCredentialId", 20)) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServiceSpecificCredentialId sets the ServiceSpecificCredentialId field's value. +func (s *UpdateServiceSpecificCredentialInput) SetServiceSpecificCredentialId(v string) *UpdateServiceSpecificCredentialInput { + s.ServiceSpecificCredentialId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateServiceSpecificCredentialInput) SetStatus(v string) *UpdateServiceSpecificCredentialInput { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UpdateServiceSpecificCredentialInput) SetUserName(v string) *UpdateServiceSpecificCredentialInput { + s.UserName = &v + return s +} + +type UpdateServiceSpecificCredentialOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateServiceSpecificCredentialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateServiceSpecificCredentialOutput) GoString() string { + return s.String() +} + +type UpdateSigningCertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the signing certificate you want to update. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters that can consist of any upper or lowercased letter + // or digit. + // + // CertificateId is a required field + CertificateId *string `min:"24" type:"string" required:"true"` + + // The status you want to assign to the certificate. Active means that the certificate + // can be used for API calls to AWS Inactive means that the certificate cannot + // be used. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"statusType"` + + // The name of the IAM user the signing certificate belongs to. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateSigningCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSigningCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSigningCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSigningCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 24 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 24)) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateId sets the CertificateId field's value. +func (s *UpdateSigningCertificateInput) SetCertificateId(v string) *UpdateSigningCertificateInput { + s.CertificateId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateSigningCertificateInput) SetStatus(v string) *UpdateSigningCertificateInput { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UpdateSigningCertificateInput) SetUserName(v string) *UpdateSigningCertificateInput { + s.UserName = &v + return s +} + +type UpdateSigningCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateSigningCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSigningCertificateOutput) GoString() string { + return s.String() +} + +type UpdateUserInput struct { + _ struct{} `type:"structure"` + + // New path for the IAM user. Include this parameter only if you're changing + // the user's path. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + NewPath *string `min:"1" type:"string"` + + // New name for the user. Include this parameter only if you're changing the + // user's name. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + NewUserName *string `min:"1" type:"string"` + + // Name of the user to update. If you're changing the name of the user, this + // is the original user name. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateUserInput"} + if s.NewPath != nil && len(*s.NewPath) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewPath", 1)) + } + if s.NewUserName != nil && len(*s.NewUserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewUserName", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNewPath sets the NewPath field's value. +func (s *UpdateUserInput) SetNewPath(v string) *UpdateUserInput { + s.NewPath = &v + return s +} + +// SetNewUserName sets the NewUserName field's value. +func (s *UpdateUserInput) SetNewUserName(v string) *UpdateUserInput { + s.NewUserName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UpdateUserInput) SetUserName(v string) *UpdateUserInput { + s.UserName = &v + return s +} + +type UpdateUserOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateUserOutput) GoString() string { + return s.String() +} + +type UploadSSHPublicKeyInput struct { + _ struct{} `type:"structure"` + + // The SSH public key. The public key must be encoded in ssh-rsa format or PEM + // format. The miminum bit-length of the public key is 2048 bits. For example, + // you can generate a 2048-bit key, and the resulting PEM file is 1679 bytes + // long. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // SSHPublicKeyBody is a required field + SSHPublicKeyBody *string `min:"1" type:"string" required:"true"` + + // The name of the IAM user to associate the SSH public key with. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UploadSSHPublicKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadSSHPublicKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UploadSSHPublicKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UploadSSHPublicKeyInput"} + if s.SSHPublicKeyBody == nil { + invalidParams.Add(request.NewErrParamRequired("SSHPublicKeyBody")) + } + if s.SSHPublicKeyBody != nil && len(*s.SSHPublicKeyBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SSHPublicKeyBody", 1)) + } + if s.UserName == nil { + invalidParams.Add(request.NewErrParamRequired("UserName")) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSSHPublicKeyBody sets the SSHPublicKeyBody field's value. +func (s *UploadSSHPublicKeyInput) SetSSHPublicKeyBody(v string) *UploadSSHPublicKeyInput { + s.SSHPublicKeyBody = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UploadSSHPublicKeyInput) SetUserName(v string) *UploadSSHPublicKeyInput { + s.UserName = &v + return s +} + +// Contains the response to a successful UploadSSHPublicKey request. +type UploadSSHPublicKeyOutput struct { + _ struct{} `type:"structure"` + + // Contains information about the SSH public key. + SSHPublicKey *SSHPublicKey `type:"structure"` +} + +// String returns the string representation +func (s UploadSSHPublicKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadSSHPublicKeyOutput) GoString() string { + return s.String() +} + +// SetSSHPublicKey sets the SSHPublicKey field's value. +func (s *UploadSSHPublicKeyOutput) SetSSHPublicKey(v *SSHPublicKey) *UploadSSHPublicKeyOutput { + s.SSHPublicKey = v + return s +} + +type UploadServerCertificateInput struct { + _ struct{} `type:"structure"` + + // The contents of the public key certificate in PEM-encoded format. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // CertificateBody is a required field + CertificateBody *string `min:"1" type:"string" required:"true"` + + // The contents of the certificate chain. This is typically a concatenation + // of the PEM-encoded public key certificates of the chain. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + CertificateChain *string `min:"1" type:"string"` + + // The path for the server certificate. For more information about paths, see + // IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the IAM User Guide. + // + // This parameter is optional. If it is not included, it defaults to a slash + // (/). This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of either a forward slash (/) by itself + // or a string that must begin and end with forward slashes. In addition, it + // can contain any ASCII character from the ! (\u0021) through the DEL character + // (\u007F), including most punctuation characters, digits, and upper and lowercased + // letters. + // + // If you are uploading a server certificate specifically for use with Amazon + // CloudFront distributions, you must specify a path using the path parameter. + // The path must begin with /cloudfront and must include a trailing slash (for + // example, /cloudfront/test/). + Path *string `min:"1" type:"string"` + + // The contents of the private key in PEM-encoded format. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // PrivateKey is a required field + PrivateKey *string `min:"1" type:"string" required:"true"` + + // The name for the server certificate. Do not include the path in this value. + // The name of the certificate cannot contain any spaces. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + // + // ServerCertificateName is a required field + ServerCertificateName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UploadServerCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadServerCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UploadServerCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UploadServerCertificateInput"} + if s.CertificateBody == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateBody")) + } + if s.CertificateBody != nil && len(*s.CertificateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateBody", 1)) + } + if s.CertificateChain != nil && len(*s.CertificateChain) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateChain", 1)) + } + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + if s.PrivateKey == nil { + invalidParams.Add(request.NewErrParamRequired("PrivateKey")) + } + if s.PrivateKey != nil && len(*s.PrivateKey) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PrivateKey", 1)) + } + if s.ServerCertificateName == nil { + invalidParams.Add(request.NewErrParamRequired("ServerCertificateName")) + } + if s.ServerCertificateName != nil && len(*s.ServerCertificateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServerCertificateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateBody sets the CertificateBody field's value. +func (s *UploadServerCertificateInput) SetCertificateBody(v string) *UploadServerCertificateInput { + s.CertificateBody = &v + return s +} + +// SetCertificateChain sets the CertificateChain field's value. +func (s *UploadServerCertificateInput) SetCertificateChain(v string) *UploadServerCertificateInput { + s.CertificateChain = &v + return s +} + +// SetPath sets the Path field's value. +func (s *UploadServerCertificateInput) SetPath(v string) *UploadServerCertificateInput { + s.Path = &v + return s +} + +// SetPrivateKey sets the PrivateKey field's value. +func (s *UploadServerCertificateInput) SetPrivateKey(v string) *UploadServerCertificateInput { + s.PrivateKey = &v + return s +} + +// SetServerCertificateName sets the ServerCertificateName field's value. +func (s *UploadServerCertificateInput) SetServerCertificateName(v string) *UploadServerCertificateInput { + s.ServerCertificateName = &v + return s +} + +// Contains the response to a successful UploadServerCertificate request. +type UploadServerCertificateOutput struct { + _ struct{} `type:"structure"` + + // The meta information of the uploaded server certificate without its certificate + // body, certificate chain, and private key. + ServerCertificateMetadata *ServerCertificateMetadata `type:"structure"` +} + +// String returns the string representation +func (s UploadServerCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadServerCertificateOutput) GoString() string { + return s.String() +} + +// SetServerCertificateMetadata sets the ServerCertificateMetadata field's value. +func (s *UploadServerCertificateOutput) SetServerCertificateMetadata(v *ServerCertificateMetadata) *UploadServerCertificateOutput { + s.ServerCertificateMetadata = v + return s +} + +type UploadSigningCertificateInput struct { + _ struct{} `type:"structure"` + + // The contents of the signing certificate. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + // + // CertificateBody is a required field + CertificateBody *string `min:"1" type:"string" required:"true"` + + // The name of the user the signing certificate is for. + // + // This parameter allows (per its regex pattern (http://wikipedia.org/wiki/regex)) + // a string of characters consisting of upper and lowercase alphanumeric characters + // with no spaces. You can also include any of the following characters: _+=,.@- + UserName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UploadSigningCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadSigningCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UploadSigningCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UploadSigningCertificateInput"} + if s.CertificateBody == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateBody")) + } + if s.CertificateBody != nil && len(*s.CertificateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateBody", 1)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateBody sets the CertificateBody field's value. +func (s *UploadSigningCertificateInput) SetCertificateBody(v string) *UploadSigningCertificateInput { + s.CertificateBody = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UploadSigningCertificateInput) SetUserName(v string) *UploadSigningCertificateInput { + s.UserName = &v + return s +} + +// Contains the response to a successful UploadSigningCertificate request. +type UploadSigningCertificateOutput struct { + _ struct{} `type:"structure"` + + // Information about the certificate. + // + // Certificate is a required field + Certificate *SigningCertificate `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UploadSigningCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadSigningCertificateOutput) GoString() string { + return s.String() +} + +// SetCertificate sets the Certificate field's value. +func (s *UploadSigningCertificateOutput) SetCertificate(v *SigningCertificate) *UploadSigningCertificateOutput { + s.Certificate = v + return s +} + +// Contains information about an IAM user entity. +// +// This data type is used as a response element in the following operations: +// +// * CreateUser +// +// * GetUser +// +// * ListUsers +type User struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) that identifies the user. For more information + // about ARNs and how to use ARNs in policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Arn is a required field + Arn *string `min:"20" type:"string" required:"true"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the user was created. + // + // CreateDate is a required field + CreateDate *time.Time `type:"timestamp" required:"true"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the user's password was last used to sign in to an AWS website. For + // a list of AWS websites that capture a user's last sign-in time, see the Credential + // Reports (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) + // topic in the Using IAM guide. If a password is used more than once in a five-minute + // span, only the first use is returned in this field. If the field is null + // (no value) then it indicates that they never signed in with a password. This + // can be because: + // + // * The user never had a password. + // + // * A password exists but has not been used since IAM started tracking this + // information on October 20th, 2014. + // + // A null does not mean that the user never had a password. Also, if the user + // does not currently have a password, but had one in the past, then this field + // contains the date and time the most recent password was used. + // + // This value is returned only in the GetUser and ListUsers operations. + PasswordLastUsed *time.Time `type:"timestamp"` + + // The path to the user. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // Path is a required field + Path *string `min:"1" type:"string" required:"true"` + + // The ARN of the policy used to set the permissions boundary for the user. + // + // For more information about permissions boundaries, see Permissions Boundaries + // for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. + PermissionsBoundary *AttachedPermissionsBoundary `type:"structure"` + + // The stable and unique string identifying the user. For more information about + // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + // + // UserId is a required field + UserId *string `min:"16" type:"string" required:"true"` + + // The friendly name identifying the user. + // + // UserName is a required field + UserName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s User) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s User) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *User) SetArn(v string) *User { + s.Arn = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *User) SetCreateDate(v time.Time) *User { + s.CreateDate = &v + return s +} + +// SetPasswordLastUsed sets the PasswordLastUsed field's value. +func (s *User) SetPasswordLastUsed(v time.Time) *User { + s.PasswordLastUsed = &v + return s +} + +// SetPath sets the Path field's value. +func (s *User) SetPath(v string) *User { + s.Path = &v + return s +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *User) SetPermissionsBoundary(v *AttachedPermissionsBoundary) *User { + s.PermissionsBoundary = v + return s +} + +// SetUserId sets the UserId field's value. +func (s *User) SetUserId(v string) *User { + s.UserId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *User) SetUserName(v string) *User { + s.UserName = &v + return s +} + +// Contains information about an IAM user, including all the user's policies +// and all the IAM groups the user is in. +// +// This data type is used as a response element in the GetAccountAuthorizationDetails +// operation. +type UserDetail struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. + // + // For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS + // Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `min:"20" type:"string"` + + // A list of the managed policies attached to the user. + AttachedManagedPolicies []*AttachedPolicy `type:"list"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601), + // when the user was created. + CreateDate *time.Time `type:"timestamp"` + + // A list of IAM groups that the user is in. + GroupList []*string `type:"list"` + + // The path to the user. For more information about paths, see IAM Identifiers + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + Path *string `min:"1" type:"string"` + + // The ARN of the policy used to set the permissions boundary for the user. + // + // For more information about permissions boundaries, see Permissions Boundaries + // for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. + PermissionsBoundary *AttachedPermissionsBoundary `type:"structure"` + + // The stable and unique string identifying the user. For more information about + // IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) + // in the Using IAM guide. + UserId *string `min:"16" type:"string"` + + // The friendly name identifying the user. + UserName *string `min:"1" type:"string"` + + // A list of the inline policies embedded in the user. + UserPolicyList []*PolicyDetail `type:"list"` +} + +// String returns the string representation +func (s UserDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserDetail) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *UserDetail) SetArn(v string) *UserDetail { + s.Arn = &v + return s +} + +// SetAttachedManagedPolicies sets the AttachedManagedPolicies field's value. +func (s *UserDetail) SetAttachedManagedPolicies(v []*AttachedPolicy) *UserDetail { + s.AttachedManagedPolicies = v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *UserDetail) SetCreateDate(v time.Time) *UserDetail { + s.CreateDate = &v + return s +} + +// SetGroupList sets the GroupList field's value. +func (s *UserDetail) SetGroupList(v []*string) *UserDetail { + s.GroupList = v + return s +} + +// SetPath sets the Path field's value. +func (s *UserDetail) SetPath(v string) *UserDetail { + s.Path = &v + return s +} + +// SetPermissionsBoundary sets the PermissionsBoundary field's value. +func (s *UserDetail) SetPermissionsBoundary(v *AttachedPermissionsBoundary) *UserDetail { + s.PermissionsBoundary = v + return s +} + +// SetUserId sets the UserId field's value. +func (s *UserDetail) SetUserId(v string) *UserDetail { + s.UserId = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UserDetail) SetUserName(v string) *UserDetail { + s.UserName = &v + return s +} + +// SetUserPolicyList sets the UserPolicyList field's value. +func (s *UserDetail) SetUserPolicyList(v []*PolicyDetail) *UserDetail { + s.UserPolicyList = v + return s +} + +// Contains information about a virtual MFA device. +type VirtualMFADevice struct { + _ struct{} `type:"structure"` + + // The Base32 seed defined as specified in RFC3548 (https://tools.ietf.org/html/rfc3548.txt). + // The Base32StringSeed is Base64-encoded. + // + // Base32StringSeed is automatically base64 encoded/decoded by the SDK. + Base32StringSeed []byte `type:"blob"` + + // The date and time on which the virtual MFA device was enabled. + EnableDate *time.Time `type:"timestamp"` + + // A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String + // where $virtualMFADeviceName is one of the create call arguments, AccountName + // is the user name if set (otherwise, the account ID otherwise), and Base32String + // is the seed in Base32 format. The Base32String value is Base64-encoded. + // + // QRCodePNG is automatically base64 encoded/decoded by the SDK. + QRCodePNG []byte `type:"blob"` + + // The serial number associated with VirtualMFADevice. + // + // SerialNumber is a required field + SerialNumber *string `min:"9" type:"string" required:"true"` + + // The IAM user associated with this virtual MFA device. + User *User `type:"structure"` +} + +// String returns the string representation +func (s VirtualMFADevice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VirtualMFADevice) GoString() string { + return s.String() +} + +// SetBase32StringSeed sets the Base32StringSeed field's value. +func (s *VirtualMFADevice) SetBase32StringSeed(v []byte) *VirtualMFADevice { + s.Base32StringSeed = v + return s +} + +// SetEnableDate sets the EnableDate field's value. +func (s *VirtualMFADevice) SetEnableDate(v time.Time) *VirtualMFADevice { + s.EnableDate = &v + return s +} + +// SetQRCodePNG sets the QRCodePNG field's value. +func (s *VirtualMFADevice) SetQRCodePNG(v []byte) *VirtualMFADevice { + s.QRCodePNG = v + return s +} + +// SetSerialNumber sets the SerialNumber field's value. +func (s *VirtualMFADevice) SetSerialNumber(v string) *VirtualMFADevice { + s.SerialNumber = &v + return s +} + +// SetUser sets the User field's value. +func (s *VirtualMFADevice) SetUser(v *User) *VirtualMFADevice { + s.User = v + return s +} + +const ( + // ContextKeyTypeEnumString is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumString = "string" + + // ContextKeyTypeEnumStringList is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumStringList = "stringList" + + // ContextKeyTypeEnumNumeric is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumNumeric = "numeric" + + // ContextKeyTypeEnumNumericList is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumNumericList = "numericList" + + // ContextKeyTypeEnumBoolean is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumBoolean = "boolean" + + // ContextKeyTypeEnumBooleanList is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumBooleanList = "booleanList" + + // ContextKeyTypeEnumIp is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumIp = "ip" + + // ContextKeyTypeEnumIpList is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumIpList = "ipList" + + // ContextKeyTypeEnumBinary is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumBinary = "binary" + + // ContextKeyTypeEnumBinaryList is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumBinaryList = "binaryList" + + // ContextKeyTypeEnumDate is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumDate = "date" + + // ContextKeyTypeEnumDateList is a ContextKeyTypeEnum enum value + ContextKeyTypeEnumDateList = "dateList" +) + +const ( + // DeletionTaskStatusTypeSucceeded is a DeletionTaskStatusType enum value + DeletionTaskStatusTypeSucceeded = "SUCCEEDED" + + // DeletionTaskStatusTypeInProgress is a DeletionTaskStatusType enum value + DeletionTaskStatusTypeInProgress = "IN_PROGRESS" + + // DeletionTaskStatusTypeFailed is a DeletionTaskStatusType enum value + DeletionTaskStatusTypeFailed = "FAILED" + + // DeletionTaskStatusTypeNotStarted is a DeletionTaskStatusType enum value + DeletionTaskStatusTypeNotStarted = "NOT_STARTED" +) + +const ( + // EntityTypeUser is a EntityType enum value + EntityTypeUser = "User" + + // EntityTypeRole is a EntityType enum value + EntityTypeRole = "Role" + + // EntityTypeGroup is a EntityType enum value + EntityTypeGroup = "Group" + + // EntityTypeLocalManagedPolicy is a EntityType enum value + EntityTypeLocalManagedPolicy = "LocalManagedPolicy" + + // EntityTypeAwsmanagedPolicy is a EntityType enum value + EntityTypeAwsmanagedPolicy = "AWSManagedPolicy" +) + +const ( + // PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy is a PermissionsBoundaryAttachmentType enum value + PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy = "PermissionsBoundaryPolicy" +) + +const ( + // PolicyEvaluationDecisionTypeAllowed is a PolicyEvaluationDecisionType enum value + PolicyEvaluationDecisionTypeAllowed = "allowed" + + // PolicyEvaluationDecisionTypeExplicitDeny is a PolicyEvaluationDecisionType enum value + PolicyEvaluationDecisionTypeExplicitDeny = "explicitDeny" + + // PolicyEvaluationDecisionTypeImplicitDeny is a PolicyEvaluationDecisionType enum value + PolicyEvaluationDecisionTypeImplicitDeny = "implicitDeny" +) + +const ( + // PolicySourceTypeUser is a PolicySourceType enum value + PolicySourceTypeUser = "user" + + // PolicySourceTypeGroup is a PolicySourceType enum value + PolicySourceTypeGroup = "group" + + // PolicySourceTypeRole is a PolicySourceType enum value + PolicySourceTypeRole = "role" + + // PolicySourceTypeAwsManaged is a PolicySourceType enum value + PolicySourceTypeAwsManaged = "aws-managed" + + // PolicySourceTypeUserManaged is a PolicySourceType enum value + PolicySourceTypeUserManaged = "user-managed" + + // PolicySourceTypeResource is a PolicySourceType enum value + PolicySourceTypeResource = "resource" + + // PolicySourceTypeNone is a PolicySourceType enum value + PolicySourceTypeNone = "none" +) + +// The policy usage type that indicates whether the policy is used as a permissions +// policy or as the permissions boundary for an entity. +// +// For more information about permissions boundaries, see Permissions Boundaries +// for IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) +// in the IAM User Guide. +const ( + // PolicyUsageTypePermissionsPolicy is a PolicyUsageType enum value + PolicyUsageTypePermissionsPolicy = "PermissionsPolicy" + + // PolicyUsageTypePermissionsBoundary is a PolicyUsageType enum value + PolicyUsageTypePermissionsBoundary = "PermissionsBoundary" +) + +const ( + // ReportFormatTypeTextCsv is a ReportFormatType enum value + ReportFormatTypeTextCsv = "text/csv" +) + +const ( + // ReportStateTypeStarted is a ReportStateType enum value + ReportStateTypeStarted = "STARTED" + + // ReportStateTypeInprogress is a ReportStateType enum value + ReportStateTypeInprogress = "INPROGRESS" + + // ReportStateTypeComplete is a ReportStateType enum value + ReportStateTypeComplete = "COMPLETE" +) + +const ( + // AssignmentStatusTypeAssigned is a assignmentStatusType enum value + AssignmentStatusTypeAssigned = "Assigned" + + // AssignmentStatusTypeUnassigned is a assignmentStatusType enum value + AssignmentStatusTypeUnassigned = "Unassigned" + + // AssignmentStatusTypeAny is a assignmentStatusType enum value + AssignmentStatusTypeAny = "Any" +) + +const ( + // EncodingTypeSsh is a encodingType enum value + EncodingTypeSsh = "SSH" + + // EncodingTypePem is a encodingType enum value + EncodingTypePem = "PEM" +) + +const ( + // PolicyScopeTypeAll is a policyScopeType enum value + PolicyScopeTypeAll = "All" + + // PolicyScopeTypeAws is a policyScopeType enum value + PolicyScopeTypeAws = "AWS" + + // PolicyScopeTypeLocal is a policyScopeType enum value + PolicyScopeTypeLocal = "Local" +) + +const ( + // StatusTypeActive is a statusType enum value + StatusTypeActive = "Active" + + // StatusTypeInactive is a statusType enum value + StatusTypeInactive = "Inactive" +) + +const ( + // SummaryKeyTypeUsers is a summaryKeyType enum value + SummaryKeyTypeUsers = "Users" + + // SummaryKeyTypeUsersQuota is a summaryKeyType enum value + SummaryKeyTypeUsersQuota = "UsersQuota" + + // SummaryKeyTypeGroups is a summaryKeyType enum value + SummaryKeyTypeGroups = "Groups" + + // SummaryKeyTypeGroupsQuota is a summaryKeyType enum value + SummaryKeyTypeGroupsQuota = "GroupsQuota" + + // SummaryKeyTypeServerCertificates is a summaryKeyType enum value + SummaryKeyTypeServerCertificates = "ServerCertificates" + + // SummaryKeyTypeServerCertificatesQuota is a summaryKeyType enum value + SummaryKeyTypeServerCertificatesQuota = "ServerCertificatesQuota" + + // SummaryKeyTypeUserPolicySizeQuota is a summaryKeyType enum value + SummaryKeyTypeUserPolicySizeQuota = "UserPolicySizeQuota" + + // SummaryKeyTypeGroupPolicySizeQuota is a summaryKeyType enum value + SummaryKeyTypeGroupPolicySizeQuota = "GroupPolicySizeQuota" + + // SummaryKeyTypeGroupsPerUserQuota is a summaryKeyType enum value + SummaryKeyTypeGroupsPerUserQuota = "GroupsPerUserQuota" + + // SummaryKeyTypeSigningCertificatesPerUserQuota is a summaryKeyType enum value + SummaryKeyTypeSigningCertificatesPerUserQuota = "SigningCertificatesPerUserQuota" + + // SummaryKeyTypeAccessKeysPerUserQuota is a summaryKeyType enum value + SummaryKeyTypeAccessKeysPerUserQuota = "AccessKeysPerUserQuota" + + // SummaryKeyTypeMfadevices is a summaryKeyType enum value + SummaryKeyTypeMfadevices = "MFADevices" + + // SummaryKeyTypeMfadevicesInUse is a summaryKeyType enum value + SummaryKeyTypeMfadevicesInUse = "MFADevicesInUse" + + // SummaryKeyTypeAccountMfaenabled is a summaryKeyType enum value + SummaryKeyTypeAccountMfaenabled = "AccountMFAEnabled" + + // SummaryKeyTypeAccountAccessKeysPresent is a summaryKeyType enum value + SummaryKeyTypeAccountAccessKeysPresent = "AccountAccessKeysPresent" + + // SummaryKeyTypeAccountSigningCertificatesPresent is a summaryKeyType enum value + SummaryKeyTypeAccountSigningCertificatesPresent = "AccountSigningCertificatesPresent" + + // SummaryKeyTypeAttachedPoliciesPerGroupQuota is a summaryKeyType enum value + SummaryKeyTypeAttachedPoliciesPerGroupQuota = "AttachedPoliciesPerGroupQuota" + + // SummaryKeyTypeAttachedPoliciesPerRoleQuota is a summaryKeyType enum value + SummaryKeyTypeAttachedPoliciesPerRoleQuota = "AttachedPoliciesPerRoleQuota" + + // SummaryKeyTypeAttachedPoliciesPerUserQuota is a summaryKeyType enum value + SummaryKeyTypeAttachedPoliciesPerUserQuota = "AttachedPoliciesPerUserQuota" + + // SummaryKeyTypePolicies is a summaryKeyType enum value + SummaryKeyTypePolicies = "Policies" + + // SummaryKeyTypePoliciesQuota is a summaryKeyType enum value + SummaryKeyTypePoliciesQuota = "PoliciesQuota" + + // SummaryKeyTypePolicySizeQuota is a summaryKeyType enum value + SummaryKeyTypePolicySizeQuota = "PolicySizeQuota" + + // SummaryKeyTypePolicyVersionsInUse is a summaryKeyType enum value + SummaryKeyTypePolicyVersionsInUse = "PolicyVersionsInUse" + + // SummaryKeyTypePolicyVersionsInUseQuota is a summaryKeyType enum value + SummaryKeyTypePolicyVersionsInUseQuota = "PolicyVersionsInUseQuota" + + // SummaryKeyTypeVersionsPerPolicyQuota is a summaryKeyType enum value + SummaryKeyTypeVersionsPerPolicyQuota = "VersionsPerPolicyQuota" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/doc.go b/vendor/github.com/aws/aws-sdk-go/service/iam/doc.go new file mode 100644 index 00000000000..d8766fbf663 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/doc.go @@ -0,0 +1,80 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package iam provides the client and types for making API +// requests to AWS Identity and Access Management. +// +// AWS Identity and Access Management (IAM) is a web service that you can use +// to manage users and user permissions under your AWS account. This guide provides +// descriptions of IAM actions that you can call programmatically. For general +// information about IAM, see AWS Identity and Access Management (IAM) (http://aws.amazon.com/iam/). +// For the user guide for IAM, see Using IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/). +// +// AWS provides SDKs that consist of libraries and sample code for various programming +// languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs +// provide a convenient way to create programmatic access to IAM and AWS. For +// example, the SDKs take care of tasks such as cryptographically signing requests +// (see below), managing errors, and retrying requests automatically. For information +// about the AWS SDKs, including how to download and install them, see the Tools +// for Amazon Web Services (http://aws.amazon.com/tools/) page. +// +// We recommend that you use the AWS SDKs to make programmatic API calls to +// IAM. However, you can also use the IAM Query API to make direct calls to +// the IAM web service. To learn more about the IAM Query API, see Making Query +// Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in the Using IAM guide. IAM supports GET and POST requests for all actions. +// That is, the API does not require you to use GET for some actions and POST +// for others. However, GET requests are subject to the limitation size of a +// URL. Therefore, for operations that require larger sizes, use a POST request. +// +// Signing Requests +// +// Requests must be signed using an access key ID and a secret access key. We +// strongly recommend that you do not use your AWS account access key ID and +// secret access key for everyday work with IAM. You can use the access key +// ID and secret access key for an IAM user or you can use the AWS Security +// Token Service to generate temporary security credentials and use those to +// sign requests. +// +// To sign requests, we recommend that you use Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). +// If you have an existing application that uses Signature Version 2, you do +// not have to update it to use Signature Version 4. However, some operations +// now require Signature Version 4. The documentation for operations that require +// version 4 indicate this requirement. +// +// Additional Resources +// +// For more information, see the following: +// +// * AWS Security Credentials (http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html). +// This topic provides general information about the types of credentials +// used for accessing AWS. +// +// * IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAMBestPractices.html). +// This topic presents a list of suggestions for using the IAM service to +// help secure your AWS resources. +// +// * Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html). +// This set of topics walk you through the process of signing a request using +// an access key ID and secret access key. +// +// See https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08 for more information on this service. +// +// See iam package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/iam/ +// +// Using the Client +// +// To contact AWS Identity and Access Management 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 AWS Identity and Access Management client IAM for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/iam/#New +package iam diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go new file mode 100644 index 00000000000..470e19b37f4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go @@ -0,0 +1,185 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +const ( + + // ErrCodeCredentialReportExpiredException for service response error code + // "ReportExpired". + // + // The request was rejected because the most recent credential report has expired. + // To generate a new credential report, use GenerateCredentialReport. For more + // information about credential report expiration, see Getting Credential Reports + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) + // in the IAM User Guide. + ErrCodeCredentialReportExpiredException = "ReportExpired" + + // ErrCodeCredentialReportNotPresentException for service response error code + // "ReportNotPresent". + // + // The request was rejected because the credential report does not exist. To + // generate a credential report, use GenerateCredentialReport. + ErrCodeCredentialReportNotPresentException = "ReportNotPresent" + + // ErrCodeCredentialReportNotReadyException for service response error code + // "ReportInProgress". + // + // The request was rejected because the credential report is still being generated. + ErrCodeCredentialReportNotReadyException = "ReportInProgress" + + // ErrCodeDeleteConflictException for service response error code + // "DeleteConflict". + // + // The request was rejected because it attempted to delete a resource that has + // attached subordinate entities. The error message describes these entities. + ErrCodeDeleteConflictException = "DeleteConflict" + + // ErrCodeDuplicateCertificateException for service response error code + // "DuplicateCertificate". + // + // The request was rejected because the same certificate is associated with + // an IAM user in the account. + ErrCodeDuplicateCertificateException = "DuplicateCertificate" + + // ErrCodeDuplicateSSHPublicKeyException for service response error code + // "DuplicateSSHPublicKey". + // + // The request was rejected because the SSH public key is already associated + // with the specified IAM user. + ErrCodeDuplicateSSHPublicKeyException = "DuplicateSSHPublicKey" + + // ErrCodeEntityAlreadyExistsException for service response error code + // "EntityAlreadyExists". + // + // The request was rejected because it attempted to create a resource that already + // exists. + ErrCodeEntityAlreadyExistsException = "EntityAlreadyExists" + + // ErrCodeEntityTemporarilyUnmodifiableException for service response error code + // "EntityTemporarilyUnmodifiable". + // + // The request was rejected because it referenced an entity that is temporarily + // unmodifiable, such as a user name that was deleted and then recreated. The + // error indicates that the request is likely to succeed if you try again after + // waiting several minutes. The error message describes the entity. + ErrCodeEntityTemporarilyUnmodifiableException = "EntityTemporarilyUnmodifiable" + + // ErrCodeInvalidAuthenticationCodeException for service response error code + // "InvalidAuthenticationCode". + // + // The request was rejected because the authentication code was not recognized. + // The error message describes the specific error. + ErrCodeInvalidAuthenticationCodeException = "InvalidAuthenticationCode" + + // ErrCodeInvalidCertificateException for service response error code + // "InvalidCertificate". + // + // The request was rejected because the certificate is invalid. + ErrCodeInvalidCertificateException = "InvalidCertificate" + + // ErrCodeInvalidInputException for service response error code + // "InvalidInput". + // + // The request was rejected because an invalid or out-of-range value was supplied + // for an input parameter. + ErrCodeInvalidInputException = "InvalidInput" + + // ErrCodeInvalidPublicKeyException for service response error code + // "InvalidPublicKey". + // + // The request was rejected because the public key is malformed or otherwise + // invalid. + ErrCodeInvalidPublicKeyException = "InvalidPublicKey" + + // ErrCodeInvalidUserTypeException for service response error code + // "InvalidUserType". + // + // The request was rejected because the type of user for the transaction was + // incorrect. + ErrCodeInvalidUserTypeException = "InvalidUserType" + + // ErrCodeKeyPairMismatchException for service response error code + // "KeyPairMismatch". + // + // The request was rejected because the public key certificate and the private + // key do not match. + ErrCodeKeyPairMismatchException = "KeyPairMismatch" + + // ErrCodeLimitExceededException for service response error code + // "LimitExceeded". + // + // The request was rejected because it attempted to create resources beyond + // the current AWS account limits. The error message describes the limit exceeded. + ErrCodeLimitExceededException = "LimitExceeded" + + // ErrCodeMalformedCertificateException for service response error code + // "MalformedCertificate". + // + // The request was rejected because the certificate was malformed or expired. + // The error message describes the specific error. + ErrCodeMalformedCertificateException = "MalformedCertificate" + + // ErrCodeMalformedPolicyDocumentException for service response error code + // "MalformedPolicyDocument". + // + // The request was rejected because the policy document was malformed. The error + // message describes the specific error. + ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocument" + + // ErrCodeNoSuchEntityException for service response error code + // "NoSuchEntity". + // + // The request was rejected because it referenced an entity that does not exist. + // The error message describes the entity. + ErrCodeNoSuchEntityException = "NoSuchEntity" + + // ErrCodePasswordPolicyViolationException for service response error code + // "PasswordPolicyViolation". + // + // The request was rejected because the provided password did not meet the requirements + // imposed by the account password policy. + ErrCodePasswordPolicyViolationException = "PasswordPolicyViolation" + + // ErrCodePolicyEvaluationException for service response error code + // "PolicyEvaluation". + // + // The request failed because a provided policy could not be successfully evaluated. + // An additional detailed message indicates the source of the failure. + ErrCodePolicyEvaluationException = "PolicyEvaluation" + + // ErrCodePolicyNotAttachableException for service response error code + // "PolicyNotAttachable". + // + // The request failed because AWS service role policies can only be attached + // to the service-linked role for that service. + ErrCodePolicyNotAttachableException = "PolicyNotAttachable" + + // ErrCodeServiceFailureException for service response error code + // "ServiceFailure". + // + // The request processing has failed because of an unknown error, exception + // or failure. + ErrCodeServiceFailureException = "ServiceFailure" + + // ErrCodeServiceNotSupportedException for service response error code + // "NotSupportedService". + // + // The specified service does not support service-specific credentials. + ErrCodeServiceNotSupportedException = "NotSupportedService" + + // ErrCodeUnmodifiableEntityException for service response error code + // "UnmodifiableEntity". + // + // The request was rejected because only the service that depends on the service-linked + // role can modify or delete the role on your behalf. The error message includes + // the name of the service that depends on this service-linked role. You must + // request the change through that service. + ErrCodeUnmodifiableEntityException = "UnmodifiableEntity" + + // ErrCodeUnrecognizedPublicKeyEncodingException for service response error code + // "UnrecognizedPublicKeyEncoding". + // + // The request was rejected because the public key encoding format is unsupported + // or unrecognized. + ErrCodeUnrecognizedPublicKeyEncodingException = "UnrecognizedPublicKeyEncoding" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/service.go b/vendor/github.com/aws/aws-sdk-go/service/iam/service.go new file mode 100644 index 00000000000..940b4ce3283 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/service.go @@ -0,0 +1,95 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +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/query" +) + +// IAM provides the API operation methods for making requests to +// AWS Identity and Access Management. See this package's package overview docs +// for details on the service. +// +// IAM methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type IAM 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 = "iam" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "IAM" // ServiceID is a unique identifer of a specific service. +) + +// New creates a new instance of the IAM 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 IAM client from just a session. +// svc := iam.New(mySession) +// +// // Create a IAM client with additional configuration +// svc := iam.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *IAM { + 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) *IAM { + svc := &IAM{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2010-05-08", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(query.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a IAM operation and runs any +// custom request initialization. +func (c *IAM) 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/iam/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go new file mode 100644 index 00000000000..7a35d9e3179 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/waiters.go @@ -0,0 +1,112 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilInstanceProfileExists uses the IAM API operation +// GetInstanceProfile 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 *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) error { + return c.WaitUntilInstanceProfileExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilInstanceProfileExistsWithContext is an extended version of WaitUntilInstanceProfileExists. +// 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 *IAM) WaitUntilInstanceProfileExistsWithContext(ctx aws.Context, input *GetInstanceProfileInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilInstanceProfileExists", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(1 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 200, + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 404, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetInstanceProfileInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetInstanceProfileRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilUserExists uses the IAM API operation +// GetUser 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 *IAM) WaitUntilUserExists(input *GetUserInput) error { + return c.WaitUntilUserExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilUserExistsWithContext is an extended version of WaitUntilUserExists. +// 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 *IAM) WaitUntilUserExistsWithContext(ctx aws.Context, input *GetUserInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilUserExists", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(1 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 200, + }, + { + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "NoSuchEntity", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetUserInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetUserRequest(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/route53/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/route53/BUILD.bazel new file mode 100644 index 00000000000..af39075624f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "customizations.go", + "doc.go", + "errors.go", + "service.go", + "unmarshal_error.go", + "waiters.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/route53", + importpath = "github.com/aws/aws-sdk-go/service/route53", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/restxml:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go new file mode 100644 index 00000000000..97351a76f05 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go @@ -0,0 +1,14969 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package route53 + +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 opAssociateVPCWithHostedZone = "AssociateVPCWithHostedZone" + +// AssociateVPCWithHostedZoneRequest generates a "aws/request.Request" representing the +// client's request for the AssociateVPCWithHostedZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateVPCWithHostedZone for more information on using the AssociateVPCWithHostedZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateVPCWithHostedZoneRequest method. +// req, resp := client.AssociateVPCWithHostedZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZone +func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHostedZoneInput) (req *request.Request, output *AssociateVPCWithHostedZoneOutput) { + op := &request.Operation{ + Name: opAssociateVPCWithHostedZone, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone/{Id}/associatevpc", + } + + if input == nil { + input = &AssociateVPCWithHostedZoneInput{} + } + + output = &AssociateVPCWithHostedZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateVPCWithHostedZone API operation for Amazon Route 53. +// +// Associates an Amazon VPC with a private hosted zone. +// +// To perform the association, the VPC and the private hosted zone must already +// exist. You can't convert a public hosted zone into a private hosted zone. +// +// If you want to associate a VPC that was created by using one AWS account +// with a private hosted zone that was created by using a different account, +// the AWS account that created the private hosted zone must first submit a +// CreateVPCAssociationAuthorization request. Then the account that created +// the VPC must submit an AssociateVPCWithHostedZone 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 Route 53's +// API operation AssociateVPCWithHostedZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// Associating the specified VPC with the specified hosted zone has not been +// authorized. +// +// * ErrCodeInvalidVPCId "InvalidVPCId" +// The VPC ID that you specified either isn't a valid ID or the current account +// is not authorized to access this VPC. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodePublicZoneVPCAssociation "PublicZoneVPCAssociation" +// You're trying to associate a VPC with a public hosted zone. Amazon Route +// 53 doesn't support associating a VPC with a public hosted zone. +// +// * ErrCodeConflictingDomainExists "ConflictingDomainExists" +// The cause of this error depends on whether you're trying to create a public +// or a private hosted zone: +// +// * Public hosted zone: Two hosted zones that have the same name or that +// have a parent/child relationship (example.com and test.example.com) can't +// have any common name servers. You tried to create a hosted zone that has +// the same name as an existing hosted zone or that's the parent or child +// of an existing hosted zone, and you specified a delegation set that shares +// one or more name servers with the existing hosted zone. For more information, +// see CreateReusableDelegationSet. +// +// * Private hosted zone: You specified an Amazon VPC that you're already +// using for another hosted zone, and the domain that you specified for one +// of the hosted zones is a subdomain of the domain that you specified for +// the other hosted zone. For example, you can't use the same Amazon VPC +// for the hosted zones for example.com and test.example.com. +// +// * ErrCodeLimitsExceeded "LimitsExceeded" +// This operation can't be completed either because the current account has +// reached the limit on reusable delegation sets that it can create or because +// you've reached the limit on the number of Amazon VPCs that you can associate +// with a private hosted zone. To get the current limit on the number of reusable +// delegation sets, see GetAccountLimit. To get the current limit on the number +// of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit. +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZone +func (c *Route53) AssociateVPCWithHostedZone(input *AssociateVPCWithHostedZoneInput) (*AssociateVPCWithHostedZoneOutput, error) { + req, out := c.AssociateVPCWithHostedZoneRequest(input) + return out, req.Send() +} + +// AssociateVPCWithHostedZoneWithContext is the same as AssociateVPCWithHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateVPCWithHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) AssociateVPCWithHostedZoneWithContext(ctx aws.Context, input *AssociateVPCWithHostedZoneInput, opts ...request.Option) (*AssociateVPCWithHostedZoneOutput, error) { + req, out := c.AssociateVPCWithHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opChangeResourceRecordSets = "ChangeResourceRecordSets" + +// ChangeResourceRecordSetsRequest generates a "aws/request.Request" representing the +// client's request for the ChangeResourceRecordSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ChangeResourceRecordSets for more information on using the ChangeResourceRecordSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ChangeResourceRecordSetsRequest method. +// req, resp := client.ChangeResourceRecordSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSets +func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSetsInput) (req *request.Request, output *ChangeResourceRecordSetsOutput) { + op := &request.Operation{ + Name: opChangeResourceRecordSets, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone/{Id}/rrset/", + } + + if input == nil { + input = &ChangeResourceRecordSetsInput{} + } + + output = &ChangeResourceRecordSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ChangeResourceRecordSets API operation for Amazon Route 53. +// +// Creates, changes, or deletes a resource record set, which contains authoritative +// DNS information for a specified domain name or subdomain name. For example, +// you can use ChangeResourceRecordSets to create a resource record set that +// routes traffic for test.example.com to a web server that has an IP address +// of 192.0.2.44. +// +// Change Batches and Transactional Changes +// +// The request body must include a document with a ChangeResourceRecordSetsRequest +// element. The request body contains a list of change items, known as a change +// batch. Change batches are considered transactional changes. When using the +// Amazon Route 53 API to change resource record sets, Amazon Route 53 either +// makes all or none of the changes in a change batch request. This ensures +// that Amazon Route 53 never partially implements the intended changes to the +// resource record sets in a hosted zone. +// +// For example, a change batch request that deletes the CNAME record for www.example.com +// and creates an alias resource record set for www.example.com. Amazon Route +// 53 deletes the first resource record set and creates the second resource +// record set in a single operation. If either the DELETE or the CREATE action +// fails, then both changes (plus any other changes in the batch) fail, and +// the original CNAME record continues to exist. +// +// Due to the nature of transactional changes, you can't delete the same resource +// record set more than once in a single change batch. If you attempt to delete +// the same change batch more than once, Amazon Route 53 returns an InvalidChangeBatch +// error. +// +// Traffic Flow +// +// To create resource record sets for complex routing configurations, use either +// the traffic flow visual editor in the Amazon Route 53 console or the API +// actions for traffic policies and traffic policy instances. Save the configuration +// as a traffic policy, then associate the traffic policy with one or more domain +// names (such as example.com) or subdomain names (such as www.example.com), +// in the same hosted zone or in multiple hosted zones. You can roll back the +// updates if the new configuration isn't performing as expected. For more information, +// see Using Traffic Flow to Route DNS Traffic (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/traffic-flow.html) +// in the Amazon Route 53 Developer Guide. +// +// Create, Delete, and Upsert +// +// Use ChangeResourceRecordsSetsRequest to perform the following actions: +// +// * CREATE: Creates a resource record set that has the specified values. +// +// * DELETE: Deletes an existing resource record set that has the specified +// values. +// +// * UPSERT: If a resource record set does not already exist, AWS creates +// it. If a resource set does exist, Amazon Route 53 updates it with the +// values in the request. +// +// Syntaxes for Creating, Updating, and Deleting Resource Record Sets +// +// The syntax for a request depends on the type of resource record set that +// you want to create, delete, or update, such as weighted, alias, or failover. +// The XML elements in your request must appear in the order listed in the syntax. +// +// For an example for each type of resource record set, see "Examples." +// +// Don't refer to the syntax in the "Parameter Syntax" section, which includes +// all of the elements for every kind of resource record set that you can create, +// delete, or update by using ChangeResourceRecordSets. +// +// Change Propagation to Amazon Route 53 DNS Servers +// +// When you submit a ChangeResourceRecordSets request, Amazon Route 53 propagates +// your changes to all of the Amazon Route 53 authoritative DNS servers. While +// your changes are propagating, GetChange returns a status of PENDING. When +// propagation is complete, GetChange returns a status of INSYNC. Changes generally +// propagate to all Amazon Route 53 name servers within 60 seconds. For more +// information, see GetChange. +// +// Limits on ChangeResourceRecordSets Requests +// +// For information about the limits on a ChangeResourceRecordSets request, see +// Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 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 Route 53's +// API operation ChangeResourceRecordSets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeInvalidChangeBatch "InvalidChangeBatch" +// This exception contains a list of messages that might contain one or more +// error messages. Each error message indicates one error in the change batch. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSets +func (c *Route53) ChangeResourceRecordSets(input *ChangeResourceRecordSetsInput) (*ChangeResourceRecordSetsOutput, error) { + req, out := c.ChangeResourceRecordSetsRequest(input) + return out, req.Send() +} + +// ChangeResourceRecordSetsWithContext is the same as ChangeResourceRecordSets with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeResourceRecordSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ChangeResourceRecordSetsWithContext(ctx aws.Context, input *ChangeResourceRecordSetsInput, opts ...request.Option) (*ChangeResourceRecordSetsOutput, error) { + req, out := c.ChangeResourceRecordSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opChangeTagsForResource = "ChangeTagsForResource" + +// ChangeTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ChangeTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ChangeTagsForResource for more information on using the ChangeTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ChangeTagsForResourceRequest method. +// req, resp := client.ChangeTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource +func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput) (req *request.Request, output *ChangeTagsForResourceOutput) { + op := &request.Operation{ + Name: opChangeTagsForResource, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/tags/{ResourceType}/{ResourceId}", + } + + if input == nil { + input = &ChangeTagsForResourceInput{} + } + + output = &ChangeTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ChangeTagsForResource API operation for Amazon Route 53. +// +// Adds, edits, or deletes tags for a health check or a hosted zone. +// +// For information about using tags for cost allocation, see Using Cost Allocation +// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) +// in the AWS Billing and Cost Management 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 Route 53's +// API operation ChangeTagsForResource for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// * ErrCodeThrottlingException "ThrottlingException" +// The limit on the number of requests per second was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource +func (c *Route53) ChangeTagsForResource(input *ChangeTagsForResourceInput) (*ChangeTagsForResourceOutput, error) { + req, out := c.ChangeTagsForResourceRequest(input) + return out, req.Send() +} + +// ChangeTagsForResourceWithContext is the same as ChangeTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ChangeTagsForResourceWithContext(ctx aws.Context, input *ChangeTagsForResourceInput, opts ...request.Option) (*ChangeTagsForResourceOutput, error) { + req, out := c.ChangeTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateHealthCheck = "CreateHealthCheck" + +// CreateHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the CreateHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateHealthCheck for more information on using the CreateHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateHealthCheckRequest method. +// req, resp := client.CreateHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheck +func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req *request.Request, output *CreateHealthCheckOutput) { + op := &request.Operation{ + Name: opCreateHealthCheck, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/healthcheck", + } + + if input == nil { + input = &CreateHealthCheckInput{} + } + + output = &CreateHealthCheckOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateHealthCheck API operation for Amazon Route 53. +// +// Creates a new health check. +// +// For information about adding health checks to resource record sets, see ResourceRecordSet$HealthCheckId +// in ChangeResourceRecordSets. +// +// ELB Load Balancers +// +// If you're registering EC2 instances with an Elastic Load Balancing (ELB) +// load balancer, do not create Amazon Route 53 health checks for the EC2 instances. +// When you register an EC2 instance with a load balancer, you configure settings +// for an ELB health check, which performs a similar function to an Amazon Route +// 53 health check. +// +// Private Hosted Zones +// +// You can associate health checks with failover resource record sets in a private +// hosted zone. Note the following: +// +// * Amazon Route 53 health checkers are outside the VPC. To check the health +// of an endpoint within a VPC by IP address, you must assign a public IP +// address to the instance in the VPC. +// +// * You can configure a health checker to check the health of an external +// resource that the instance relies on, such as a database server. +// +// * You can create a CloudWatch metric, associate an alarm with the metric, +// and then create a health check that is based on the state of the alarm. +// For example, you might create a CloudWatch metric that checks the status +// of the Amazon EC2 StatusCheckFailed metric, add an alarm to the metric, +// and then create a health check that is based on the state of the alarm. +// For information about creating CloudWatch metrics and alarms by using +// the CloudWatch console, see the Amazon CloudWatch User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatch.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 Route 53's +// API operation CreateHealthCheck for usage and error information. +// +// Returned Error Codes: +// * ErrCodeTooManyHealthChecks "TooManyHealthChecks" +// This health check can't be created because the current account has reached +// the limit on the number of active health checks. +// +// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. +// +// For information about how to get the current limit for an account, see GetAccountLimit. +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// You have reached the maximum number of active health checks for an AWS account. +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// * ErrCodeHealthCheckAlreadyExists "HealthCheckAlreadyExists" +// The health check you're attempting to create already exists. Amazon Route +// 53 returns this error when you submit a request that has the following values: +// +// * The same value for CallerReference as an existing health check, and +// one or more values that differ from the existing health check that has +// the same caller reference. +// +// * The same value for CallerReference as a health check that you created +// and later deleted, regardless of the other settings in the request. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheck +func (c *Route53) CreateHealthCheck(input *CreateHealthCheckInput) (*CreateHealthCheckOutput, error) { + req, out := c.CreateHealthCheckRequest(input) + return out, req.Send() +} + +// CreateHealthCheckWithContext is the same as CreateHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateHealthCheckWithContext(ctx aws.Context, input *CreateHealthCheckInput, opts ...request.Option) (*CreateHealthCheckOutput, error) { + req, out := c.CreateHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateHostedZone = "CreateHostedZone" + +// CreateHostedZoneRequest generates a "aws/request.Request" representing the +// client's request for the CreateHostedZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateHostedZone for more information on using the CreateHostedZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateHostedZoneRequest method. +// req, resp := client.CreateHostedZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZone +func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *request.Request, output *CreateHostedZoneOutput) { + op := &request.Operation{ + Name: opCreateHostedZone, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone", + } + + if input == nil { + input = &CreateHostedZoneInput{} + } + + output = &CreateHostedZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateHostedZone API operation for Amazon Route 53. +// +// Creates a new public hosted zone, which you use to specify how the Domain +// Name System (DNS) routes traffic on the Internet for a domain, such as example.com, +// and its subdomains. +// +// You can't convert a public hosted zones to a private hosted zone or vice +// versa. Instead, you must create a new hosted zone with the same name and +// create new resource record sets. +// +// For more information about charges for hosted zones, see Amazon Route 53 +// Pricing (http://aws.amazon.com/route53/pricing/). +// +// Note the following: +// +// * You can't create a hosted zone for a top-level domain (TLD). +// +// * Amazon Route 53 automatically creates a default SOA record and four +// NS records for the zone. For more information about SOA and NS records, +// see NS and SOA Records that Amazon Route 53 Creates for a Hosted Zone +// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html) +// in the Amazon Route 53 Developer Guide. +// +// If you want to use the same name servers for multiple hosted zones, you can +// optionally associate a reusable delegation set with the hosted zone. See +// the DelegationSetId element. +// +// * If your domain is registered with a registrar other than Amazon Route +// 53, you must update the name servers with your registrar to make Amazon +// Route 53 your DNS service. For more information, see Configuring Amazon +// Route 53 as your DNS Service (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.html) +// in the Amazon Route 53 Developer Guide. +// +// When you submit a CreateHostedZone request, the initial status of the hosted +// zone is PENDING. This means that the NS and SOA records are not yet available +// on all Amazon Route 53 DNS servers. When the NS and SOA records are available, +// the status of the zone changes to INSYNC. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation CreateHostedZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidDomainName "InvalidDomainName" +// The specified domain name is not valid. +// +// * ErrCodeHostedZoneAlreadyExists "HostedZoneAlreadyExists" +// The hosted zone you're trying to create already exists. Amazon Route 53 returns +// this error when a hosted zone has already been created with the specified +// CallerReference. +// +// * ErrCodeTooManyHostedZones "TooManyHostedZones" +// This operation can't be completed either because the current account has +// reached the limit on the number of hosted zones or because you've reached +// the limit on the number of hosted zones that can be associated with a reusable +// delegation set. +// +// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. +// +// To get the current limit on hosted zones that can be created by an account, +// see GetAccountLimit. +// +// To get the current limit on hosted zones that can be associated with a reusable +// delegation set, see GetReusableDelegationSetLimit. +// +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// * ErrCodeInvalidVPCId "InvalidVPCId" +// The VPC ID that you specified either isn't a valid ID or the current account +// is not authorized to access this VPC. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeDelegationSetNotAvailable "DelegationSetNotAvailable" +// You can create a hosted zone that has the same name as an existing hosted +// zone (example.com is common), but there is a limit to the number of hosted +// zones that have the same name. If you get this error, Amazon Route 53 has +// reached that limit. If you own the domain name and Amazon Route 53 generates +// this error, contact Customer Support. +// +// * ErrCodeConflictingDomainExists "ConflictingDomainExists" +// The cause of this error depends on whether you're trying to create a public +// or a private hosted zone: +// +// * Public hosted zone: Two hosted zones that have the same name or that +// have a parent/child relationship (example.com and test.example.com) can't +// have any common name servers. You tried to create a hosted zone that has +// the same name as an existing hosted zone or that's the parent or child +// of an existing hosted zone, and you specified a delegation set that shares +// one or more name servers with the existing hosted zone. For more information, +// see CreateReusableDelegationSet. +// +// * Private hosted zone: You specified an Amazon VPC that you're already +// using for another hosted zone, and the domain that you specified for one +// of the hosted zones is a subdomain of the domain that you specified for +// the other hosted zone. For example, you can't use the same Amazon VPC +// for the hosted zones for example.com and test.example.com. +// +// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" +// A reusable delegation set with the specified ID does not exist. +// +// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" +// A reusable delegation set with the specified ID does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZone +func (c *Route53) CreateHostedZone(input *CreateHostedZoneInput) (*CreateHostedZoneOutput, error) { + req, out := c.CreateHostedZoneRequest(input) + return out, req.Send() +} + +// CreateHostedZoneWithContext is the same as CreateHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateHostedZoneWithContext(ctx aws.Context, input *CreateHostedZoneInput, opts ...request.Option) (*CreateHostedZoneOutput, error) { + req, out := c.CreateHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateQueryLoggingConfig = "CreateQueryLoggingConfig" + +// CreateQueryLoggingConfigRequest generates a "aws/request.Request" representing the +// client's request for the CreateQueryLoggingConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateQueryLoggingConfig for more information on using the CreateQueryLoggingConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateQueryLoggingConfigRequest method. +// req, resp := client.CreateQueryLoggingConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateQueryLoggingConfig +func (c *Route53) CreateQueryLoggingConfigRequest(input *CreateQueryLoggingConfigInput) (req *request.Request, output *CreateQueryLoggingConfigOutput) { + op := &request.Operation{ + Name: opCreateQueryLoggingConfig, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/queryloggingconfig", + } + + if input == nil { + input = &CreateQueryLoggingConfigInput{} + } + + output = &CreateQueryLoggingConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateQueryLoggingConfig API operation for Amazon Route 53. +// +// Creates a configuration for DNS query logging. After you create a query logging +// configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch +// Logs log group. +// +// DNS query logs contain information about the queries that Amazon Route 53 +// receives for a specified public hosted zone, such as the following: +// +// * Amazon Route 53 edge location that responded to the DNS query +// +// * Domain or subdomain that was requested +// +// * DNS record type, such as A or AAAA +// +// * DNS response code, such as NoError or ServFail +// +// Log Group and Resource PolicyBefore you create a query logging configuration, +// perform the following operations. +// +// If you create a query logging configuration using the Amazon Route 53 console, +// Amazon Route 53 performs these operations automatically. +// +// Create a CloudWatch Logs log group, and make note of the ARN, which you specify +// when you create a query logging configuration. Note the following: +// +// You must create the log group in the us-east-1 region. +// +// You must use the same AWS account to create the log group and the hosted +// zone that you want to configure query logging for. +// +// When you create log groups for query logging, we recommend that you use a +// consistent prefix, for example: +// +// /aws/route53/hosted zone name +// +// In the next step, you'll create a resource policy, which controls access +// to one or more log groups and the associated AWS resources, such as Amazon +// Route 53 hosted zones. There's a limit on the number of resource policies +// that you can create, so we recommend that you use a consistent prefix so +// you can use the same resource policy for all the log groups that you create +// for query logging. +// +// Create a CloudWatch Logs resource policy, and give it the permissions that +// Amazon Route 53 needs to create log streams and to send query logs to log +// streams. For the value of Resource, specify the ARN for the log group that +// you created in the previous step. To use the same resource policy for all +// the CloudWatch Logs log groups that you created for query logging configurations, +// replace the hosted zone name with *, for example: +// +// arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* +// +// You can't use the CloudWatch console to create or edit a resource policy. +// You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI. +// +// Log Streams and Edge LocationsWhen Amazon Route 53 finishes creating the +// configuration for DNS query logging, it does the following: +// +// Creates a log stream for an edge location the first time that the edge location +// responds to DNS queries for the specified hosted zone. That log stream is +// used to log all queries that Amazon Route 53 responds to for that edge location. +// +// Begins to send query logs to the applicable log stream. +// +// The name of each log stream is in the following format: +// +// hosted zone ID/edge location code +// +// The edge location code is a three-letter code and an arbitrarily assigned +// number, for example, DFW3. The three-letter code typically corresponds with +// the International Air Transport Association airport code for an airport near +// the edge location. (These abbreviations might change in the future.) For +// a list of edge locations, see "The Amazon Route 53 Global Network" on the +// Amazon Route 53 Product Details (http://aws.amazon.com/route53/details/) +// page. +// +// Queries That Are LoggedQuery logs contain only the queries that DNS resolvers +// forward to Amazon Route 53. If a DNS resolver has already cached the response +// to a query (such as the IP address for a load balancer for example.com), +// the resolver will continue to return the cached response. It doesn't forward +// another query to Amazon Route 53 until the TTL for the corresponding resource +// record set expires. Depending on how many DNS queries are submitted for a +// resource record set, and depending on the TTL for that resource record set, +// query logs might contain information about only one query out of every several +// thousand queries that are submitted to DNS. For more information about how +// DNS works, see Routing Internet Traffic to Your Website or Web Application +// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html) +// in the Amazon Route 53 Developer Guide. +// +// Log File FormatFor a list of the values in each query log and the format +// of each value, see Logging DNS Queries (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html) +// in the Amazon Route 53 Developer Guide. +// +// PricingFor information about charges for query logs, see Amazon CloudWatch +// Pricing (http://aws.amazon.com/cloudwatch/pricing/). +// +// How to Stop LoggingIf you want Amazon Route 53 to stop sending query logs +// to CloudWatch Logs, delete the query logging configuration. For more information, +// see DeleteQueryLoggingConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation CreateQueryLoggingConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeNoSuchCloudWatchLogsLogGroup "NoSuchCloudWatchLogsLogGroup" +// There is no CloudWatch Logs log group with the specified ARN. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeQueryLoggingConfigAlreadyExists "QueryLoggingConfigAlreadyExists" +// You can create only one query logging configuration for a hosted zone, and +// a query logging configuration already exists for this hosted zone. +// +// * ErrCodeInsufficientCloudWatchLogsResourcePolicy "InsufficientCloudWatchLogsResourcePolicy" +// Amazon Route 53 doesn't have the permissions required to create log streams +// and send query logs to log streams. Possible causes include the following: +// +// * There is no resource policy that specifies the log group ARN in the +// value for Resource. +// +// * The resource policy that includes the log group ARN in the value for +// Resource doesn't have the necessary permissions. +// +// * The resource policy hasn't finished propagating yet. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateQueryLoggingConfig +func (c *Route53) CreateQueryLoggingConfig(input *CreateQueryLoggingConfigInput) (*CreateQueryLoggingConfigOutput, error) { + req, out := c.CreateQueryLoggingConfigRequest(input) + return out, req.Send() +} + +// CreateQueryLoggingConfigWithContext is the same as CreateQueryLoggingConfig with the addition of +// the ability to pass a context and additional request options. +// +// See CreateQueryLoggingConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateQueryLoggingConfigWithContext(ctx aws.Context, input *CreateQueryLoggingConfigInput, opts ...request.Option) (*CreateQueryLoggingConfigOutput, error) { + req, out := c.CreateQueryLoggingConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateReusableDelegationSet = "CreateReusableDelegationSet" + +// CreateReusableDelegationSetRequest generates a "aws/request.Request" representing the +// client's request for the CreateReusableDelegationSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateReusableDelegationSet for more information on using the CreateReusableDelegationSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateReusableDelegationSetRequest method. +// req, resp := client.CreateReusableDelegationSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSet +func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelegationSetInput) (req *request.Request, output *CreateReusableDelegationSetOutput) { + op := &request.Operation{ + Name: opCreateReusableDelegationSet, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/delegationset", + } + + if input == nil { + input = &CreateReusableDelegationSetInput{} + } + + output = &CreateReusableDelegationSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateReusableDelegationSet API operation for Amazon Route 53. +// +// Creates a delegation set (a group of four name servers) that can be reused +// by multiple hosted zones. If a hosted zoned ID is specified, CreateReusableDelegationSet +// marks the delegation set associated with that zone as reusable. +// +// You can't associate a reusable delegation set with a private hosted zone. +// +// For information about using a reusable delegation set to configure white +// label name servers, see Configuring White Label Name Servers (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/white-label-name-servers.html). +// +// The process for migrating existing hosted zones to use a reusable delegation +// set is comparable to the process for configuring white label name servers. +// You need to perform the following steps: +// +// Create a reusable delegation set. +// +// Recreate hosted zones, and reduce the TTL to 60 seconds or less. +// +// Recreate resource record sets in the new hosted zones. +// +// Change the registrar's name servers to use the name servers for the new hosted +// zones. +// +// Monitor traffic for the website or application. +// +// Change TTLs back to their original values. +// +// If you want to migrate existing hosted zones to use a reusable delegation +// set, the existing hosted zones can't use any of the name servers that are +// assigned to the reusable delegation set. If one or more hosted zones do use +// one or more name servers that are assigned to the reusable delegation set, +// you can do one of the following: +// +// * For small numbers of hosted zones—up to a few hundred—it's relatively +// easy to create reusable delegation sets until you get one that has four +// name servers that don't overlap with any of the name servers in your hosted +// zones. +// +// * For larger numbers of hosted zones, the easiest solution is to use more +// than one reusable delegation set. +// +// * For larger numbers of hosted zones, you can also migrate hosted zones +// that have overlapping name servers to hosted zones that don't have overlapping +// name servers, then migrate the hosted zones again to use the reusable +// delegation set. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation CreateReusableDelegationSet for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDelegationSetAlreadyCreated "DelegationSetAlreadyCreated" +// A delegation set with the same owner and caller reference combination has +// already been created. +// +// * ErrCodeLimitsExceeded "LimitsExceeded" +// This operation can't be completed either because the current account has +// reached the limit on reusable delegation sets that it can create or because +// you've reached the limit on the number of Amazon VPCs that you can associate +// with a private hosted zone. To get the current limit on the number of reusable +// delegation sets, see GetAccountLimit. To get the current limit on the number +// of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit. +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// * ErrCodeHostedZoneNotFound "HostedZoneNotFound" +// The specified HostedZone can't be found. +// +// * ErrCodeInvalidArgument "InvalidArgument" +// Parameter name is invalid. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeDelegationSetNotAvailable "DelegationSetNotAvailable" +// You can create a hosted zone that has the same name as an existing hosted +// zone (example.com is common), but there is a limit to the number of hosted +// zones that have the same name. If you get this error, Amazon Route 53 has +// reached that limit. If you own the domain name and Amazon Route 53 generates +// this error, contact Customer Support. +// +// * ErrCodeDelegationSetAlreadyReusable "DelegationSetAlreadyReusable" +// The specified delegation set has already been marked as reusable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSet +func (c *Route53) CreateReusableDelegationSet(input *CreateReusableDelegationSetInput) (*CreateReusableDelegationSetOutput, error) { + req, out := c.CreateReusableDelegationSetRequest(input) + return out, req.Send() +} + +// CreateReusableDelegationSetWithContext is the same as CreateReusableDelegationSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReusableDelegationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateReusableDelegationSetWithContext(ctx aws.Context, input *CreateReusableDelegationSetInput, opts ...request.Option) (*CreateReusableDelegationSetOutput, error) { + req, out := c.CreateReusableDelegationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTrafficPolicy = "CreateTrafficPolicy" + +// CreateTrafficPolicyRequest generates a "aws/request.Request" representing the +// client's request for the CreateTrafficPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTrafficPolicy for more information on using the CreateTrafficPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTrafficPolicyRequest method. +// req, resp := client.CreateTrafficPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicy +func (c *Route53) CreateTrafficPolicyRequest(input *CreateTrafficPolicyInput) (req *request.Request, output *CreateTrafficPolicyOutput) { + op := &request.Operation{ + Name: opCreateTrafficPolicy, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/trafficpolicy", + } + + if input == nil { + input = &CreateTrafficPolicyInput{} + } + + output = &CreateTrafficPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTrafficPolicy API operation for Amazon Route 53. +// +// Creates a traffic policy, which you use to create multiple DNS resource record +// sets for one domain name (such as example.com) or one subdomain name (such +// as www.example.com). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation CreateTrafficPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeTooManyTrafficPolicies "TooManyTrafficPolicies" +// This traffic policy can't be created because the current account has reached +// the limit on the number of traffic policies. +// +// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. +// +// To get the current limit for an account, see GetAccountLimit. +// +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// * ErrCodeTrafficPolicyAlreadyExists "TrafficPolicyAlreadyExists" +// A traffic policy that has the same value for Name already exists. +// +// * ErrCodeInvalidTrafficPolicyDocument "InvalidTrafficPolicyDocument" +// The format of the traffic policy document that you specified in the Document +// element is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicy +func (c *Route53) CreateTrafficPolicy(input *CreateTrafficPolicyInput) (*CreateTrafficPolicyOutput, error) { + req, out := c.CreateTrafficPolicyRequest(input) + return out, req.Send() +} + +// CreateTrafficPolicyWithContext is the same as CreateTrafficPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrafficPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateTrafficPolicyWithContext(ctx aws.Context, input *CreateTrafficPolicyInput, opts ...request.Option) (*CreateTrafficPolicyOutput, error) { + req, out := c.CreateTrafficPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTrafficPolicyInstance = "CreateTrafficPolicyInstance" + +// CreateTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the +// client's request for the CreateTrafficPolicyInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTrafficPolicyInstance for more information on using the CreateTrafficPolicyInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTrafficPolicyInstanceRequest method. +// req, resp := client.CreateTrafficPolicyInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstance +func (c *Route53) CreateTrafficPolicyInstanceRequest(input *CreateTrafficPolicyInstanceInput) (req *request.Request, output *CreateTrafficPolicyInstanceOutput) { + op := &request.Operation{ + Name: opCreateTrafficPolicyInstance, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/trafficpolicyinstance", + } + + if input == nil { + input = &CreateTrafficPolicyInstanceInput{} + } + + output = &CreateTrafficPolicyInstanceOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTrafficPolicyInstance API operation for Amazon Route 53. +// +// Creates resource record sets in a specified hosted zone based on the settings +// in a specified traffic policy version. In addition, CreateTrafficPolicyInstance +// associates the resource record sets with a specified domain name (such as +// example.com) or subdomain name (such as www.example.com). Amazon Route 53 +// responds to DNS queries for the domain or subdomain name by using the resource +// record sets that CreateTrafficPolicyInstance 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 Route 53's +// API operation CreateTrafficPolicyInstance for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeTooManyTrafficPolicyInstances "TooManyTrafficPolicyInstances" +// This traffic policy instance can't be created because the current account +// has reached the limit on the number of traffic policy instances. +// +// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. +// +// For information about how to get the current limit for an account, see GetAccountLimit. +// +// To request a higher limit, create a case (http://aws.amazon.com/route53-request) +// with the AWS Support Center. +// +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// * ErrCodeTrafficPolicyInstanceAlreadyExists "TrafficPolicyInstanceAlreadyExists" +// There is already a traffic policy instance with the specified ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstance +func (c *Route53) CreateTrafficPolicyInstance(input *CreateTrafficPolicyInstanceInput) (*CreateTrafficPolicyInstanceOutput, error) { + req, out := c.CreateTrafficPolicyInstanceRequest(input) + return out, req.Send() +} + +// CreateTrafficPolicyInstanceWithContext is the same as CreateTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateTrafficPolicyInstanceWithContext(ctx aws.Context, input *CreateTrafficPolicyInstanceInput, opts ...request.Option) (*CreateTrafficPolicyInstanceOutput, error) { + req, out := c.CreateTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTrafficPolicyVersion = "CreateTrafficPolicyVersion" + +// CreateTrafficPolicyVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateTrafficPolicyVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTrafficPolicyVersion for more information on using the CreateTrafficPolicyVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTrafficPolicyVersionRequest method. +// req, resp := client.CreateTrafficPolicyVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersion +func (c *Route53) CreateTrafficPolicyVersionRequest(input *CreateTrafficPolicyVersionInput) (req *request.Request, output *CreateTrafficPolicyVersionOutput) { + op := &request.Operation{ + Name: opCreateTrafficPolicyVersion, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/trafficpolicy/{Id}", + } + + if input == nil { + input = &CreateTrafficPolicyVersionInput{} + } + + output = &CreateTrafficPolicyVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTrafficPolicyVersion API operation for Amazon Route 53. +// +// Creates a new version of an existing traffic policy. When you create a new +// version of a traffic policy, you specify the ID of the traffic policy that +// you want to update and a JSON-formatted document that describes the new version. +// You use traffic policies to create multiple DNS resource record sets for +// one domain name (such as example.com) or one subdomain name (such as www.example.com). +// You can create a maximum of 1000 versions of a traffic policy. If you reach +// the limit and need to create another version, you'll need to start a new +// traffic policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation CreateTrafficPolicyVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeTooManyTrafficPolicyVersionsForCurrentPolicy "TooManyTrafficPolicyVersionsForCurrentPolicy" +// This traffic policy version can't be created because you've reached the limit +// of 1000 on the number of versions that you can create for the current traffic +// policy. +// +// To create more traffic policy versions, you can use GetTrafficPolicy to get +// the traffic policy document for a specified traffic policy version, and then +// use CreateTrafficPolicy to create a new traffic policy using the traffic +// policy document. +// +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// * ErrCodeInvalidTrafficPolicyDocument "InvalidTrafficPolicyDocument" +// The format of the traffic policy document that you specified in the Document +// element is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersion +func (c *Route53) CreateTrafficPolicyVersion(input *CreateTrafficPolicyVersionInput) (*CreateTrafficPolicyVersionOutput, error) { + req, out := c.CreateTrafficPolicyVersionRequest(input) + return out, req.Send() +} + +// CreateTrafficPolicyVersionWithContext is the same as CreateTrafficPolicyVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrafficPolicyVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateTrafficPolicyVersionWithContext(ctx aws.Context, input *CreateTrafficPolicyVersionInput, opts ...request.Option) (*CreateTrafficPolicyVersionOutput, error) { + req, out := c.CreateTrafficPolicyVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateVPCAssociationAuthorization = "CreateVPCAssociationAuthorization" + +// CreateVPCAssociationAuthorizationRequest generates a "aws/request.Request" representing the +// client's request for the CreateVPCAssociationAuthorization operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateVPCAssociationAuthorization for more information on using the CreateVPCAssociationAuthorization +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateVPCAssociationAuthorizationRequest method. +// req, resp := client.CreateVPCAssociationAuthorizationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorization +func (c *Route53) CreateVPCAssociationAuthorizationRequest(input *CreateVPCAssociationAuthorizationInput) (req *request.Request, output *CreateVPCAssociationAuthorizationOutput) { + op := &request.Operation{ + Name: opCreateVPCAssociationAuthorization, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone/{Id}/authorizevpcassociation", + } + + if input == nil { + input = &CreateVPCAssociationAuthorizationInput{} + } + + output = &CreateVPCAssociationAuthorizationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateVPCAssociationAuthorization API operation for Amazon Route 53. +// +// Authorizes the AWS account that created a specified VPC to submit an AssociateVPCWithHostedZone +// request to associate the VPC with a specified hosted zone that was created +// by a different account. To submit a CreateVPCAssociationAuthorization request, +// you must use the account that created the hosted zone. After you authorize +// the association, use the account that created the VPC to submit an AssociateVPCWithHostedZone +// request. +// +// If you want to associate multiple VPCs that you created by using one account +// with a hosted zone that you created by using a different account, you must +// submit one authorization request for each 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 Route 53's +// API operation CreateVPCAssociationAuthorization for usage and error information. +// +// Returned Error Codes: +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// * ErrCodeTooManyVPCAssociationAuthorizations "TooManyVPCAssociationAuthorizations" +// You've created the maximum number of authorizations that can be created for +// the specified hosted zone. To authorize another VPC to be associated with +// the hosted zone, submit a DeleteVPCAssociationAuthorization request to remove +// an existing authorization. To get a list of existing authorizations, submit +// a ListVPCAssociationAuthorizations request. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidVPCId "InvalidVPCId" +// The VPC ID that you specified either isn't a valid ID or the current account +// is not authorized to access this VPC. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorization +func (c *Route53) CreateVPCAssociationAuthorization(input *CreateVPCAssociationAuthorizationInput) (*CreateVPCAssociationAuthorizationOutput, error) { + req, out := c.CreateVPCAssociationAuthorizationRequest(input) + return out, req.Send() +} + +// CreateVPCAssociationAuthorizationWithContext is the same as CreateVPCAssociationAuthorization with the addition of +// the ability to pass a context and additional request options. +// +// See CreateVPCAssociationAuthorization for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) CreateVPCAssociationAuthorizationWithContext(ctx aws.Context, input *CreateVPCAssociationAuthorizationInput, opts ...request.Option) (*CreateVPCAssociationAuthorizationOutput, error) { + req, out := c.CreateVPCAssociationAuthorizationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteHealthCheck = "DeleteHealthCheck" + +// DeleteHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the DeleteHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteHealthCheck for more information on using the DeleteHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteHealthCheckRequest method. +// req, resp := client.DeleteHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheck +func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) (req *request.Request, output *DeleteHealthCheckOutput) { + op := &request.Operation{ + Name: opDeleteHealthCheck, + HTTPMethod: "DELETE", + HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}", + } + + if input == nil { + input = &DeleteHealthCheckInput{} + } + + output = &DeleteHealthCheckOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteHealthCheck API operation for Amazon Route 53. +// +// Deletes a health check. +// +// Amazon Route 53 does not prevent you from deleting a health check even if +// the health check is associated with one or more resource record sets. If +// you delete a health check and you don't update the associated resource record +// sets, the future status of the health check can't be predicted and may change. +// This will affect the routing of DNS queries for your DNS failover configuration. +// For more information, see Replacing and Deleting Health Checks (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating-deleting.html#health-checks-deleting.html) +// in the Amazon Route 53 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 Route 53's +// API operation DeleteHealthCheck for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeHealthCheckInUse "HealthCheckInUse" +// This error code is not in use. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheck +func (c *Route53) DeleteHealthCheck(input *DeleteHealthCheckInput) (*DeleteHealthCheckOutput, error) { + req, out := c.DeleteHealthCheckRequest(input) + return out, req.Send() +} + +// DeleteHealthCheckWithContext is the same as DeleteHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteHealthCheckWithContext(ctx aws.Context, input *DeleteHealthCheckInput, opts ...request.Option) (*DeleteHealthCheckOutput, error) { + req, out := c.DeleteHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteHostedZone = "DeleteHostedZone" + +// DeleteHostedZoneRequest generates a "aws/request.Request" representing the +// client's request for the DeleteHostedZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteHostedZone for more information on using the DeleteHostedZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteHostedZoneRequest method. +// req, resp := client.DeleteHostedZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZone +func (c *Route53) DeleteHostedZoneRequest(input *DeleteHostedZoneInput) (req *request.Request, output *DeleteHostedZoneOutput) { + op := &request.Operation{ + Name: opDeleteHostedZone, + HTTPMethod: "DELETE", + HTTPPath: "/2013-04-01/hostedzone/{Id}", + } + + if input == nil { + input = &DeleteHostedZoneInput{} + } + + output = &DeleteHostedZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteHostedZone API operation for Amazon Route 53. +// +// Deletes a hosted zone. +// +// If the name servers for the hosted zone are associated with a domain and +// if you want to make the domain unavailable on the Internet, we recommend +// that you delete the name servers from the domain to prevent future DNS queries +// from possibly being misrouted. If the domain is registered with Amazon Route +// 53, see UpdateDomainNameservers. If the domain is registered with another +// registrar, use the method provided by the registrar to delete name servers +// for the domain. +// +// Some domain registries don't allow you to remove all of the name servers +// for a domain. If the registry for your domain requires one or more name servers, +// we recommend that you delete the hosted zone only if you transfer DNS service +// to another service provider, and you replace the name servers for the domain +// with name servers from the new provider. +// +// You can delete a hosted zone only if it contains only the default SOA record +// and NS resource record sets. If the hosted zone contains other resource record +// sets, you must delete them before you can delete the hosted zone. If you +// try to delete a hosted zone that contains other resource record sets, the +// request fails, and Amazon Route 53 returns a HostedZoneNotEmpty error. For +// information about deleting records from your hosted zone, see ChangeResourceRecordSets. +// +// To verify that the hosted zone has been deleted, do one of the following: +// +// * Use the GetHostedZone action to request information about the hosted +// zone. +// +// * Use the ListHostedZones action to get a list of the hosted zones associated +// with the current AWS 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 Route 53's +// API operation DeleteHostedZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeHostedZoneNotEmpty "HostedZoneNotEmpty" +// The hosted zone contains resource records that are not SOA or NS records. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeInvalidDomainName "InvalidDomainName" +// The specified domain name is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZone +func (c *Route53) DeleteHostedZone(input *DeleteHostedZoneInput) (*DeleteHostedZoneOutput, error) { + req, out := c.DeleteHostedZoneRequest(input) + return out, req.Send() +} + +// DeleteHostedZoneWithContext is the same as DeleteHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteHostedZoneWithContext(ctx aws.Context, input *DeleteHostedZoneInput, opts ...request.Option) (*DeleteHostedZoneOutput, error) { + req, out := c.DeleteHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteQueryLoggingConfig = "DeleteQueryLoggingConfig" + +// DeleteQueryLoggingConfigRequest generates a "aws/request.Request" representing the +// client's request for the DeleteQueryLoggingConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteQueryLoggingConfig for more information on using the DeleteQueryLoggingConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteQueryLoggingConfigRequest method. +// req, resp := client.DeleteQueryLoggingConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteQueryLoggingConfig +func (c *Route53) DeleteQueryLoggingConfigRequest(input *DeleteQueryLoggingConfigInput) (req *request.Request, output *DeleteQueryLoggingConfigOutput) { + op := &request.Operation{ + Name: opDeleteQueryLoggingConfig, + HTTPMethod: "DELETE", + HTTPPath: "/2013-04-01/queryloggingconfig/{Id}", + } + + if input == nil { + input = &DeleteQueryLoggingConfigInput{} + } + + output = &DeleteQueryLoggingConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteQueryLoggingConfig API operation for Amazon Route 53. +// +// Deletes a configuration for DNS query logging. If you delete a configuration, +// Amazon Route 53 stops sending query logs to CloudWatch Logs. Amazon Route +// 53 doesn't delete any logs that are already in CloudWatch Logs. +// +// For more information about DNS query logs, see CreateQueryLoggingConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation DeleteQueryLoggingConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// * ErrCodeNoSuchQueryLoggingConfig "NoSuchQueryLoggingConfig" +// There is no DNS query logging configuration with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteQueryLoggingConfig +func (c *Route53) DeleteQueryLoggingConfig(input *DeleteQueryLoggingConfigInput) (*DeleteQueryLoggingConfigOutput, error) { + req, out := c.DeleteQueryLoggingConfigRequest(input) + return out, req.Send() +} + +// DeleteQueryLoggingConfigWithContext is the same as DeleteQueryLoggingConfig with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteQueryLoggingConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteQueryLoggingConfigWithContext(ctx aws.Context, input *DeleteQueryLoggingConfigInput, opts ...request.Option) (*DeleteQueryLoggingConfigOutput, error) { + req, out := c.DeleteQueryLoggingConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteReusableDelegationSet = "DeleteReusableDelegationSet" + +// DeleteReusableDelegationSetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteReusableDelegationSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteReusableDelegationSet for more information on using the DeleteReusableDelegationSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteReusableDelegationSetRequest method. +// req, resp := client.DeleteReusableDelegationSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSet +func (c *Route53) DeleteReusableDelegationSetRequest(input *DeleteReusableDelegationSetInput) (req *request.Request, output *DeleteReusableDelegationSetOutput) { + op := &request.Operation{ + Name: opDeleteReusableDelegationSet, + HTTPMethod: "DELETE", + HTTPPath: "/2013-04-01/delegationset/{Id}", + } + + if input == nil { + input = &DeleteReusableDelegationSetInput{} + } + + output = &DeleteReusableDelegationSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteReusableDelegationSet API operation for Amazon Route 53. +// +// Deletes a reusable delegation set. +// +// You can delete a reusable delegation set only if it isn't associated with +// any hosted zones. +// +// To verify that the reusable delegation set is not associated with any hosted +// zones, submit a GetReusableDelegationSet request and specify the ID of the +// reusable delegation set that you want to delete. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation DeleteReusableDelegationSet for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" +// A reusable delegation set with the specified ID does not exist. +// +// * ErrCodeDelegationSetInUse "DelegationSetInUse" +// The specified delegation contains associated hosted zones which must be deleted +// before the reusable delegation set can be deleted. +// +// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" +// A reusable delegation set with the specified ID does not exist. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSet +func (c *Route53) DeleteReusableDelegationSet(input *DeleteReusableDelegationSetInput) (*DeleteReusableDelegationSetOutput, error) { + req, out := c.DeleteReusableDelegationSetRequest(input) + return out, req.Send() +} + +// DeleteReusableDelegationSetWithContext is the same as DeleteReusableDelegationSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteReusableDelegationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteReusableDelegationSetWithContext(ctx aws.Context, input *DeleteReusableDelegationSetInput, opts ...request.Option) (*DeleteReusableDelegationSetOutput, error) { + req, out := c.DeleteReusableDelegationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteTrafficPolicy = "DeleteTrafficPolicy" + +// DeleteTrafficPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTrafficPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTrafficPolicy for more information on using the DeleteTrafficPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTrafficPolicyRequest method. +// req, resp := client.DeleteTrafficPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicy +func (c *Route53) DeleteTrafficPolicyRequest(input *DeleteTrafficPolicyInput) (req *request.Request, output *DeleteTrafficPolicyOutput) { + op := &request.Operation{ + Name: opDeleteTrafficPolicy, + HTTPMethod: "DELETE", + HTTPPath: "/2013-04-01/trafficpolicy/{Id}/{Version}", + } + + if input == nil { + input = &DeleteTrafficPolicyInput{} + } + + output = &DeleteTrafficPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTrafficPolicy API operation for Amazon Route 53. +// +// Deletes a traffic policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation DeleteTrafficPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeTrafficPolicyInUse "TrafficPolicyInUse" +// One or more traffic policy instances were created by using the specified +// traffic policy. +// +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicy +func (c *Route53) DeleteTrafficPolicy(input *DeleteTrafficPolicyInput) (*DeleteTrafficPolicyOutput, error) { + req, out := c.DeleteTrafficPolicyRequest(input) + return out, req.Send() +} + +// DeleteTrafficPolicyWithContext is the same as DeleteTrafficPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrafficPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteTrafficPolicyWithContext(ctx aws.Context, input *DeleteTrafficPolicyInput, opts ...request.Option) (*DeleteTrafficPolicyOutput, error) { + req, out := c.DeleteTrafficPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteTrafficPolicyInstance = "DeleteTrafficPolicyInstance" + +// DeleteTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTrafficPolicyInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTrafficPolicyInstance for more information on using the DeleteTrafficPolicyInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTrafficPolicyInstanceRequest method. +// req, resp := client.DeleteTrafficPolicyInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstance +func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyInstanceInput) (req *request.Request, output *DeleteTrafficPolicyInstanceOutput) { + op := &request.Operation{ + Name: opDeleteTrafficPolicyInstance, + HTTPMethod: "DELETE", + HTTPPath: "/2013-04-01/trafficpolicyinstance/{Id}", + } + + if input == nil { + input = &DeleteTrafficPolicyInstanceInput{} + } + + output = &DeleteTrafficPolicyInstanceOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTrafficPolicyInstance API operation for Amazon Route 53. +// +// Deletes a traffic policy instance and all of the resource record sets that +// Amazon Route 53 created when you created the instance. +// +// In the Amazon Route 53 console, traffic policy instances are known as policy +// records. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation DeleteTrafficPolicyInstance for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" +// No traffic policy instance exists with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstance +func (c *Route53) DeleteTrafficPolicyInstance(input *DeleteTrafficPolicyInstanceInput) (*DeleteTrafficPolicyInstanceOutput, error) { + req, out := c.DeleteTrafficPolicyInstanceRequest(input) + return out, req.Send() +} + +// DeleteTrafficPolicyInstanceWithContext is the same as DeleteTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteTrafficPolicyInstanceWithContext(ctx aws.Context, input *DeleteTrafficPolicyInstanceInput, opts ...request.Option) (*DeleteTrafficPolicyInstanceOutput, error) { + req, out := c.DeleteTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteVPCAssociationAuthorization = "DeleteVPCAssociationAuthorization" + +// DeleteVPCAssociationAuthorizationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteVPCAssociationAuthorization operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteVPCAssociationAuthorization for more information on using the DeleteVPCAssociationAuthorization +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteVPCAssociationAuthorizationRequest method. +// req, resp := client.DeleteVPCAssociationAuthorizationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorization +func (c *Route53) DeleteVPCAssociationAuthorizationRequest(input *DeleteVPCAssociationAuthorizationInput) (req *request.Request, output *DeleteVPCAssociationAuthorizationOutput) { + op := &request.Operation{ + Name: opDeleteVPCAssociationAuthorization, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone/{Id}/deauthorizevpcassociation", + } + + if input == nil { + input = &DeleteVPCAssociationAuthorizationInput{} + } + + output = &DeleteVPCAssociationAuthorizationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteVPCAssociationAuthorization API operation for Amazon Route 53. +// +// Removes authorization to submit an AssociateVPCWithHostedZone request to +// associate a specified VPC with a hosted zone that was created by a different +// account. You must use the account that created the hosted zone to submit +// a DeleteVPCAssociationAuthorization request. +// +// Sending this request only prevents the AWS account that created the VPC from +// associating the VPC with the Amazon Route 53 hosted zone in the future. If +// the VPC is already associated with the hosted zone, DeleteVPCAssociationAuthorization +// won't disassociate the VPC from the hosted zone. If you want to delete an +// existing association, use DisassociateVPCFromHostedZone. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation DeleteVPCAssociationAuthorization for usage and error information. +// +// Returned Error Codes: +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// * ErrCodeVPCAssociationAuthorizationNotFound "VPCAssociationAuthorizationNotFound" +// The VPC that you specified is not authorized to be associated with the hosted +// zone. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidVPCId "InvalidVPCId" +// The VPC ID that you specified either isn't a valid ID or the current account +// is not authorized to access this VPC. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorization +func (c *Route53) DeleteVPCAssociationAuthorization(input *DeleteVPCAssociationAuthorizationInput) (*DeleteVPCAssociationAuthorizationOutput, error) { + req, out := c.DeleteVPCAssociationAuthorizationRequest(input) + return out, req.Send() +} + +// DeleteVPCAssociationAuthorizationWithContext is the same as DeleteVPCAssociationAuthorization with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteVPCAssociationAuthorization for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DeleteVPCAssociationAuthorizationWithContext(ctx aws.Context, input *DeleteVPCAssociationAuthorizationInput, opts ...request.Option) (*DeleteVPCAssociationAuthorizationOutput, error) { + req, out := c.DeleteVPCAssociationAuthorizationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisassociateVPCFromHostedZone = "DisassociateVPCFromHostedZone" + +// DisassociateVPCFromHostedZoneRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateVPCFromHostedZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateVPCFromHostedZone for more information on using the DisassociateVPCFromHostedZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateVPCFromHostedZoneRequest method. +// req, resp := client.DisassociateVPCFromHostedZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZone +func (c *Route53) DisassociateVPCFromHostedZoneRequest(input *DisassociateVPCFromHostedZoneInput) (req *request.Request, output *DisassociateVPCFromHostedZoneOutput) { + op := &request.Operation{ + Name: opDisassociateVPCFromHostedZone, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone/{Id}/disassociatevpc", + } + + if input == nil { + input = &DisassociateVPCFromHostedZoneInput{} + } + + output = &DisassociateVPCFromHostedZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisassociateVPCFromHostedZone API operation for Amazon Route 53. +// +// Disassociates a VPC from a Amazon Route 53 private hosted zone. +// +// You can't disassociate the last VPC from a private hosted zone. +// +// You can't disassociate a VPC from a private hosted zone when only one VPC +// is associated with the hosted zone. You also can't convert a private hosted +// zone into a public hosted zone. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation DisassociateVPCFromHostedZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidVPCId "InvalidVPCId" +// The VPC ID that you specified either isn't a valid ID or the current account +// is not authorized to access this VPC. +// +// * ErrCodeVPCAssociationNotFound "VPCAssociationNotFound" +// The specified VPC and hosted zone are not currently associated. +// +// * ErrCodeLastVPCAssociation "LastVPCAssociation" +// The VPC that you're trying to disassociate from the private hosted zone is +// the last VPC that is associated with the hosted zone. Amazon Route 53 doesn't +// support disassociating the last VPC from a hosted zone. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZone +func (c *Route53) DisassociateVPCFromHostedZone(input *DisassociateVPCFromHostedZoneInput) (*DisassociateVPCFromHostedZoneOutput, error) { + req, out := c.DisassociateVPCFromHostedZoneRequest(input) + return out, req.Send() +} + +// DisassociateVPCFromHostedZoneWithContext is the same as DisassociateVPCFromHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateVPCFromHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) DisassociateVPCFromHostedZoneWithContext(ctx aws.Context, input *DisassociateVPCFromHostedZoneInput, opts ...request.Option) (*DisassociateVPCFromHostedZoneOutput, error) { + req, out := c.DisassociateVPCFromHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAccountLimit = "GetAccountLimit" + +// GetAccountLimitRequest generates a "aws/request.Request" representing the +// client's request for the GetAccountLimit operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccountLimit for more information on using the GetAccountLimit +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccountLimitRequest method. +// req, resp := client.GetAccountLimitRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetAccountLimit +func (c *Route53) GetAccountLimitRequest(input *GetAccountLimitInput) (req *request.Request, output *GetAccountLimitOutput) { + op := &request.Operation{ + Name: opGetAccountLimit, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/accountlimit/{Type}", + } + + if input == nil { + input = &GetAccountLimitInput{} + } + + output = &GetAccountLimitOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccountLimit API operation for Amazon Route 53. +// +// Gets the specified limit for the current account, for example, the maximum +// number of health checks that you can create using the account. +// +// For the default limit, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. To request a higher limit, open a +// case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetAccountLimit for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetAccountLimit +func (c *Route53) GetAccountLimit(input *GetAccountLimitInput) (*GetAccountLimitOutput, error) { + req, out := c.GetAccountLimitRequest(input) + return out, req.Send() +} + +// GetAccountLimitWithContext is the same as GetAccountLimit with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccountLimit for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetAccountLimitWithContext(ctx aws.Context, input *GetAccountLimitInput, opts ...request.Option) (*GetAccountLimitOutput, error) { + req, out := c.GetAccountLimitRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetChange = "GetChange" + +// GetChangeRequest generates a "aws/request.Request" representing the +// client's request for the GetChange operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetChange for more information on using the GetChange +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetChangeRequest method. +// req, resp := client.GetChangeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChange +func (c *Route53) GetChangeRequest(input *GetChangeInput) (req *request.Request, output *GetChangeOutput) { + op := &request.Operation{ + Name: opGetChange, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/change/{Id}", + } + + if input == nil { + input = &GetChangeInput{} + } + + output = &GetChangeOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetChange API operation for Amazon Route 53. +// +// Returns the current status of a change batch request. The status is one of +// the following values: +// +// * PENDING indicates that the changes in this request have not propagated +// to all Amazon Route 53 DNS servers. This is the initial status of all +// change batch requests. +// +// * INSYNC indicates that the changes have propagated to all Amazon Route +// 53 DNS servers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetChange for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchChange "NoSuchChange" +// A change with the specified change ID does not exist. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChange +func (c *Route53) GetChange(input *GetChangeInput) (*GetChangeOutput, error) { + req, out := c.GetChangeRequest(input) + return out, req.Send() +} + +// GetChangeWithContext is the same as GetChange with the addition of +// the ability to pass a context and additional request options. +// +// See GetChange for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetChangeWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.Option) (*GetChangeOutput, error) { + req, out := c.GetChangeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetCheckerIpRanges = "GetCheckerIpRanges" + +// GetCheckerIpRangesRequest generates a "aws/request.Request" representing the +// client's request for the GetCheckerIpRanges operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetCheckerIpRanges for more information on using the GetCheckerIpRanges +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetCheckerIpRangesRequest method. +// req, resp := client.GetCheckerIpRangesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRanges +func (c *Route53) GetCheckerIpRangesRequest(input *GetCheckerIpRangesInput) (req *request.Request, output *GetCheckerIpRangesOutput) { + op := &request.Operation{ + Name: opGetCheckerIpRanges, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/checkeripranges", + } + + if input == nil { + input = &GetCheckerIpRangesInput{} + } + + output = &GetCheckerIpRangesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetCheckerIpRanges API operation for Amazon Route 53. +// +// GetCheckerIpRanges still works, but we recommend that you download ip-ranges.json, +// which includes IP address ranges for all AWS services. For more information, +// see IP Address Ranges of Amazon Route 53 Servers (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/route-53-ip-addresses.html) +// in the Amazon Route 53 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 Route 53's +// API operation GetCheckerIpRanges for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRanges +func (c *Route53) GetCheckerIpRanges(input *GetCheckerIpRangesInput) (*GetCheckerIpRangesOutput, error) { + req, out := c.GetCheckerIpRangesRequest(input) + return out, req.Send() +} + +// GetCheckerIpRangesWithContext is the same as GetCheckerIpRanges with the addition of +// the ability to pass a context and additional request options. +// +// See GetCheckerIpRanges for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetCheckerIpRangesWithContext(ctx aws.Context, input *GetCheckerIpRangesInput, opts ...request.Option) (*GetCheckerIpRangesOutput, error) { + req, out := c.GetCheckerIpRangesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGeoLocation = "GetGeoLocation" + +// GetGeoLocationRequest generates a "aws/request.Request" representing the +// client's request for the GetGeoLocation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGeoLocation for more information on using the GetGeoLocation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGeoLocationRequest method. +// req, resp := client.GetGeoLocationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocation +func (c *Route53) GetGeoLocationRequest(input *GetGeoLocationInput) (req *request.Request, output *GetGeoLocationOutput) { + op := &request.Operation{ + Name: opGetGeoLocation, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/geolocation", + } + + if input == nil { + input = &GetGeoLocationInput{} + } + + output = &GetGeoLocationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGeoLocation API operation for Amazon Route 53. +// +// Gets information about whether a specified geographic location is supported +// for Amazon Route 53 geolocation resource record sets. +// +// Use the following syntax to determine whether a continent is supported for +// geolocation: +// +// GET /2013-04-01/geolocation?ContinentCode=two-letter abbreviation for a continent +// +// Use the following syntax to determine whether a country is supported for +// geolocation: +// +// GET /2013-04-01/geolocation?CountryCode=two-character country code +// +// Use the following syntax to determine whether a subdivision of a country +// is supported for geolocation: +// +// GET /2013-04-01/geolocation?CountryCode=two-character country code&SubdivisionCode=subdivision +// code +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetGeoLocation for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchGeoLocation "NoSuchGeoLocation" +// Amazon Route 53 doesn't support the specified geolocation. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocation +func (c *Route53) GetGeoLocation(input *GetGeoLocationInput) (*GetGeoLocationOutput, error) { + req, out := c.GetGeoLocationRequest(input) + return out, req.Send() +} + +// GetGeoLocationWithContext is the same as GetGeoLocation with the addition of +// the ability to pass a context and additional request options. +// +// See GetGeoLocation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetGeoLocationWithContext(ctx aws.Context, input *GetGeoLocationInput, opts ...request.Option) (*GetGeoLocationOutput, error) { + req, out := c.GetGeoLocationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHealthCheck = "GetHealthCheck" + +// GetHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the GetHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHealthCheck for more information on using the GetHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHealthCheckRequest method. +// req, resp := client.GetHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheck +func (c *Route53) GetHealthCheckRequest(input *GetHealthCheckInput) (req *request.Request, output *GetHealthCheckOutput) { + op := &request.Operation{ + Name: opGetHealthCheck, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}", + } + + if input == nil { + input = &GetHealthCheckInput{} + } + + output = &GetHealthCheckOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHealthCheck API operation for Amazon Route 53. +// +// Gets information about a specified health check. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetHealthCheck for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeIncompatibleVersion "IncompatibleVersion" +// The resource you're trying to access is unsupported on this Amazon Route +// 53 endpoint. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheck +func (c *Route53) GetHealthCheck(input *GetHealthCheckInput) (*GetHealthCheckOutput, error) { + req, out := c.GetHealthCheckRequest(input) + return out, req.Send() +} + +// GetHealthCheckWithContext is the same as GetHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHealthCheckWithContext(ctx aws.Context, input *GetHealthCheckInput, opts ...request.Option) (*GetHealthCheckOutput, error) { + req, out := c.GetHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHealthCheckCount = "GetHealthCheckCount" + +// GetHealthCheckCountRequest generates a "aws/request.Request" representing the +// client's request for the GetHealthCheckCount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHealthCheckCount for more information on using the GetHealthCheckCount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHealthCheckCountRequest method. +// req, resp := client.GetHealthCheckCountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCount +func (c *Route53) GetHealthCheckCountRequest(input *GetHealthCheckCountInput) (req *request.Request, output *GetHealthCheckCountOutput) { + op := &request.Operation{ + Name: opGetHealthCheckCount, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/healthcheckcount", + } + + if input == nil { + input = &GetHealthCheckCountInput{} + } + + output = &GetHealthCheckCountOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHealthCheckCount API operation for Amazon Route 53. +// +// Retrieves the number of health checks that are associated with the current +// AWS 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 Route 53's +// API operation GetHealthCheckCount for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCount +func (c *Route53) GetHealthCheckCount(input *GetHealthCheckCountInput) (*GetHealthCheckCountOutput, error) { + req, out := c.GetHealthCheckCountRequest(input) + return out, req.Send() +} + +// GetHealthCheckCountWithContext is the same as GetHealthCheckCount with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheckCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHealthCheckCountWithContext(ctx aws.Context, input *GetHealthCheckCountInput, opts ...request.Option) (*GetHealthCheckCountOutput, error) { + req, out := c.GetHealthCheckCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHealthCheckLastFailureReason = "GetHealthCheckLastFailureReason" + +// GetHealthCheckLastFailureReasonRequest generates a "aws/request.Request" representing the +// client's request for the GetHealthCheckLastFailureReason operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHealthCheckLastFailureReason for more information on using the GetHealthCheckLastFailureReason +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHealthCheckLastFailureReasonRequest method. +// req, resp := client.GetHealthCheckLastFailureReasonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReason +func (c *Route53) GetHealthCheckLastFailureReasonRequest(input *GetHealthCheckLastFailureReasonInput) (req *request.Request, output *GetHealthCheckLastFailureReasonOutput) { + op := &request.Operation{ + Name: opGetHealthCheckLastFailureReason, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}/lastfailurereason", + } + + if input == nil { + input = &GetHealthCheckLastFailureReasonInput{} + } + + output = &GetHealthCheckLastFailureReasonOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHealthCheckLastFailureReason API operation for Amazon Route 53. +// +// Gets the reason that a specified health check failed most recently. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetHealthCheckLastFailureReason for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReason +func (c *Route53) GetHealthCheckLastFailureReason(input *GetHealthCheckLastFailureReasonInput) (*GetHealthCheckLastFailureReasonOutput, error) { + req, out := c.GetHealthCheckLastFailureReasonRequest(input) + return out, req.Send() +} + +// GetHealthCheckLastFailureReasonWithContext is the same as GetHealthCheckLastFailureReason with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheckLastFailureReason for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHealthCheckLastFailureReasonWithContext(ctx aws.Context, input *GetHealthCheckLastFailureReasonInput, opts ...request.Option) (*GetHealthCheckLastFailureReasonOutput, error) { + req, out := c.GetHealthCheckLastFailureReasonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHealthCheckStatus = "GetHealthCheckStatus" + +// GetHealthCheckStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetHealthCheckStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHealthCheckStatus for more information on using the GetHealthCheckStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHealthCheckStatusRequest method. +// req, resp := client.GetHealthCheckStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatus +func (c *Route53) GetHealthCheckStatusRequest(input *GetHealthCheckStatusInput) (req *request.Request, output *GetHealthCheckStatusOutput) { + op := &request.Operation{ + Name: opGetHealthCheckStatus, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}/status", + } + + if input == nil { + input = &GetHealthCheckStatusInput{} + } + + output = &GetHealthCheckStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHealthCheckStatus API operation for Amazon Route 53. +// +// Gets status of a specified health check. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetHealthCheckStatus for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatus +func (c *Route53) GetHealthCheckStatus(input *GetHealthCheckStatusInput) (*GetHealthCheckStatusOutput, error) { + req, out := c.GetHealthCheckStatusRequest(input) + return out, req.Send() +} + +// GetHealthCheckStatusWithContext is the same as GetHealthCheckStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetHealthCheckStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHealthCheckStatusWithContext(ctx aws.Context, input *GetHealthCheckStatusInput, opts ...request.Option) (*GetHealthCheckStatusOutput, error) { + req, out := c.GetHealthCheckStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHostedZone = "GetHostedZone" + +// GetHostedZoneRequest generates a "aws/request.Request" representing the +// client's request for the GetHostedZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHostedZone for more information on using the GetHostedZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHostedZoneRequest method. +// req, resp := client.GetHostedZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZone +func (c *Route53) GetHostedZoneRequest(input *GetHostedZoneInput) (req *request.Request, output *GetHostedZoneOutput) { + op := &request.Operation{ + Name: opGetHostedZone, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzone/{Id}", + } + + if input == nil { + input = &GetHostedZoneInput{} + } + + output = &GetHostedZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHostedZone API operation for Amazon Route 53. +// +// Gets information about a specified hosted zone including the four name servers +// assigned to the hosted zone. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetHostedZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZone +func (c *Route53) GetHostedZone(input *GetHostedZoneInput) (*GetHostedZoneOutput, error) { + req, out := c.GetHostedZoneRequest(input) + return out, req.Send() +} + +// GetHostedZoneWithContext is the same as GetHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHostedZoneWithContext(ctx aws.Context, input *GetHostedZoneInput, opts ...request.Option) (*GetHostedZoneOutput, error) { + req, out := c.GetHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHostedZoneCount = "GetHostedZoneCount" + +// GetHostedZoneCountRequest generates a "aws/request.Request" representing the +// client's request for the GetHostedZoneCount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHostedZoneCount for more information on using the GetHostedZoneCount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHostedZoneCountRequest method. +// req, resp := client.GetHostedZoneCountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCount +func (c *Route53) GetHostedZoneCountRequest(input *GetHostedZoneCountInput) (req *request.Request, output *GetHostedZoneCountOutput) { + op := &request.Operation{ + Name: opGetHostedZoneCount, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzonecount", + } + + if input == nil { + input = &GetHostedZoneCountInput{} + } + + output = &GetHostedZoneCountOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHostedZoneCount API operation for Amazon Route 53. +// +// Retrieves the number of hosted zones that are associated with the current +// AWS 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 Route 53's +// API operation GetHostedZoneCount for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCount +func (c *Route53) GetHostedZoneCount(input *GetHostedZoneCountInput) (*GetHostedZoneCountOutput, error) { + req, out := c.GetHostedZoneCountRequest(input) + return out, req.Send() +} + +// GetHostedZoneCountWithContext is the same as GetHostedZoneCount with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostedZoneCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHostedZoneCountWithContext(ctx aws.Context, input *GetHostedZoneCountInput, opts ...request.Option) (*GetHostedZoneCountOutput, error) { + req, out := c.GetHostedZoneCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetHostedZoneLimit = "GetHostedZoneLimit" + +// GetHostedZoneLimitRequest generates a "aws/request.Request" representing the +// client's request for the GetHostedZoneLimit operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetHostedZoneLimit for more information on using the GetHostedZoneLimit +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetHostedZoneLimitRequest method. +// req, resp := client.GetHostedZoneLimitRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneLimit +func (c *Route53) GetHostedZoneLimitRequest(input *GetHostedZoneLimitInput) (req *request.Request, output *GetHostedZoneLimitOutput) { + op := &request.Operation{ + Name: opGetHostedZoneLimit, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzonelimit/{Id}/{Type}", + } + + if input == nil { + input = &GetHostedZoneLimitInput{} + } + + output = &GetHostedZoneLimitOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetHostedZoneLimit API operation for Amazon Route 53. +// +// Gets the specified limit for a specified hosted zone, for example, the maximum +// number of records that you can create in the hosted zone. +// +// For the default limit, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. To request a higher limit, open a +// case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetHostedZoneLimit for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeHostedZoneNotPrivate "HostedZoneNotPrivate" +// The specified hosted zone is a public hosted zone, not a private hosted zone. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneLimit +func (c *Route53) GetHostedZoneLimit(input *GetHostedZoneLimitInput) (*GetHostedZoneLimitOutput, error) { + req, out := c.GetHostedZoneLimitRequest(input) + return out, req.Send() +} + +// GetHostedZoneLimitWithContext is the same as GetHostedZoneLimit with the addition of +// the ability to pass a context and additional request options. +// +// See GetHostedZoneLimit for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetHostedZoneLimitWithContext(ctx aws.Context, input *GetHostedZoneLimitInput, opts ...request.Option) (*GetHostedZoneLimitOutput, error) { + req, out := c.GetHostedZoneLimitRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetQueryLoggingConfig = "GetQueryLoggingConfig" + +// GetQueryLoggingConfigRequest generates a "aws/request.Request" representing the +// client's request for the GetQueryLoggingConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetQueryLoggingConfig for more information on using the GetQueryLoggingConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetQueryLoggingConfigRequest method. +// req, resp := client.GetQueryLoggingConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetQueryLoggingConfig +func (c *Route53) GetQueryLoggingConfigRequest(input *GetQueryLoggingConfigInput) (req *request.Request, output *GetQueryLoggingConfigOutput) { + op := &request.Operation{ + Name: opGetQueryLoggingConfig, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/queryloggingconfig/{Id}", + } + + if input == nil { + input = &GetQueryLoggingConfigInput{} + } + + output = &GetQueryLoggingConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetQueryLoggingConfig API operation for Amazon Route 53. +// +// Gets information about a specified configuration for DNS query logging. +// +// For more information about DNS query logs, see CreateQueryLoggingConfig and +// Logging DNS Queries (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.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 Route 53's +// API operation GetQueryLoggingConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchQueryLoggingConfig "NoSuchQueryLoggingConfig" +// There is no DNS query logging configuration with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetQueryLoggingConfig +func (c *Route53) GetQueryLoggingConfig(input *GetQueryLoggingConfigInput) (*GetQueryLoggingConfigOutput, error) { + req, out := c.GetQueryLoggingConfigRequest(input) + return out, req.Send() +} + +// GetQueryLoggingConfigWithContext is the same as GetQueryLoggingConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetQueryLoggingConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetQueryLoggingConfigWithContext(ctx aws.Context, input *GetQueryLoggingConfigInput, opts ...request.Option) (*GetQueryLoggingConfigOutput, error) { + req, out := c.GetQueryLoggingConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetReusableDelegationSet = "GetReusableDelegationSet" + +// GetReusableDelegationSetRequest generates a "aws/request.Request" representing the +// client's request for the GetReusableDelegationSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetReusableDelegationSet for more information on using the GetReusableDelegationSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetReusableDelegationSetRequest method. +// req, resp := client.GetReusableDelegationSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSet +func (c *Route53) GetReusableDelegationSetRequest(input *GetReusableDelegationSetInput) (req *request.Request, output *GetReusableDelegationSetOutput) { + op := &request.Operation{ + Name: opGetReusableDelegationSet, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/delegationset/{Id}", + } + + if input == nil { + input = &GetReusableDelegationSetInput{} + } + + output = &GetReusableDelegationSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetReusableDelegationSet API operation for Amazon Route 53. +// +// Retrieves information about a specified reusable delegation set, including +// the four name servers that are assigned to the delegation set. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetReusableDelegationSet for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" +// A reusable delegation set with the specified ID does not exist. +// +// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" +// A reusable delegation set with the specified ID does not exist. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSet +func (c *Route53) GetReusableDelegationSet(input *GetReusableDelegationSetInput) (*GetReusableDelegationSetOutput, error) { + req, out := c.GetReusableDelegationSetRequest(input) + return out, req.Send() +} + +// GetReusableDelegationSetWithContext is the same as GetReusableDelegationSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetReusableDelegationSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetReusableDelegationSetWithContext(ctx aws.Context, input *GetReusableDelegationSetInput, opts ...request.Option) (*GetReusableDelegationSetOutput, error) { + req, out := c.GetReusableDelegationSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetReusableDelegationSetLimit = "GetReusableDelegationSetLimit" + +// GetReusableDelegationSetLimitRequest generates a "aws/request.Request" representing the +// client's request for the GetReusableDelegationSetLimit operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetReusableDelegationSetLimit for more information on using the GetReusableDelegationSetLimit +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetReusableDelegationSetLimitRequest method. +// req, resp := client.GetReusableDelegationSetLimitRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSetLimit +func (c *Route53) GetReusableDelegationSetLimitRequest(input *GetReusableDelegationSetLimitInput) (req *request.Request, output *GetReusableDelegationSetLimitOutput) { + op := &request.Operation{ + Name: opGetReusableDelegationSetLimit, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/reusabledelegationsetlimit/{Id}/{Type}", + } + + if input == nil { + input = &GetReusableDelegationSetLimitInput{} + } + + output = &GetReusableDelegationSetLimitOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetReusableDelegationSetLimit API operation for Amazon Route 53. +// +// Gets the maximum number of hosted zones that you can associate with the specified +// reusable delegation set. +// +// For the default limit, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) +// in the Amazon Route 53 Developer Guide. To request a higher limit, open a +// case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetReusableDelegationSetLimit for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" +// A reusable delegation set with the specified ID does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSetLimit +func (c *Route53) GetReusableDelegationSetLimit(input *GetReusableDelegationSetLimitInput) (*GetReusableDelegationSetLimitOutput, error) { + req, out := c.GetReusableDelegationSetLimitRequest(input) + return out, req.Send() +} + +// GetReusableDelegationSetLimitWithContext is the same as GetReusableDelegationSetLimit with the addition of +// the ability to pass a context and additional request options. +// +// See GetReusableDelegationSetLimit for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetReusableDelegationSetLimitWithContext(ctx aws.Context, input *GetReusableDelegationSetLimitInput, opts ...request.Option) (*GetReusableDelegationSetLimitOutput, error) { + req, out := c.GetReusableDelegationSetLimitRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetTrafficPolicy = "GetTrafficPolicy" + +// GetTrafficPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetTrafficPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTrafficPolicy for more information on using the GetTrafficPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTrafficPolicyRequest method. +// req, resp := client.GetTrafficPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicy +func (c *Route53) GetTrafficPolicyRequest(input *GetTrafficPolicyInput) (req *request.Request, output *GetTrafficPolicyOutput) { + op := &request.Operation{ + Name: opGetTrafficPolicy, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicy/{Id}/{Version}", + } + + if input == nil { + input = &GetTrafficPolicyInput{} + } + + output = &GetTrafficPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTrafficPolicy API operation for Amazon Route 53. +// +// Gets information about a specific traffic policy version. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetTrafficPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicy +func (c *Route53) GetTrafficPolicy(input *GetTrafficPolicyInput) (*GetTrafficPolicyOutput, error) { + req, out := c.GetTrafficPolicyRequest(input) + return out, req.Send() +} + +// GetTrafficPolicyWithContext is the same as GetTrafficPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrafficPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetTrafficPolicyWithContext(ctx aws.Context, input *GetTrafficPolicyInput, opts ...request.Option) (*GetTrafficPolicyOutput, error) { + req, out := c.GetTrafficPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetTrafficPolicyInstance = "GetTrafficPolicyInstance" + +// GetTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the +// client's request for the GetTrafficPolicyInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTrafficPolicyInstance for more information on using the GetTrafficPolicyInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTrafficPolicyInstanceRequest method. +// req, resp := client.GetTrafficPolicyInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstance +func (c *Route53) GetTrafficPolicyInstanceRequest(input *GetTrafficPolicyInstanceInput) (req *request.Request, output *GetTrafficPolicyInstanceOutput) { + op := &request.Operation{ + Name: opGetTrafficPolicyInstance, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicyinstance/{Id}", + } + + if input == nil { + input = &GetTrafficPolicyInstanceInput{} + } + + output = &GetTrafficPolicyInstanceOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTrafficPolicyInstance API operation for Amazon Route 53. +// +// Gets information about a specified traffic policy instance. +// +// After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance +// request, there's a brief delay while Amazon Route 53 creates the resource +// record sets that are specified in the traffic policy definition. For more +// information, see the State response element. +// +// In the Amazon Route 53 console, traffic policy instances are known as policy +// records. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation GetTrafficPolicyInstance for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" +// No traffic policy instance exists with the specified ID. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstance +func (c *Route53) GetTrafficPolicyInstance(input *GetTrafficPolicyInstanceInput) (*GetTrafficPolicyInstanceOutput, error) { + req, out := c.GetTrafficPolicyInstanceRequest(input) + return out, req.Send() +} + +// GetTrafficPolicyInstanceWithContext is the same as GetTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetTrafficPolicyInstanceWithContext(ctx aws.Context, input *GetTrafficPolicyInstanceInput, opts ...request.Option) (*GetTrafficPolicyInstanceOutput, error) { + req, out := c.GetTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetTrafficPolicyInstanceCount = "GetTrafficPolicyInstanceCount" + +// GetTrafficPolicyInstanceCountRequest generates a "aws/request.Request" representing the +// client's request for the GetTrafficPolicyInstanceCount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTrafficPolicyInstanceCount for more information on using the GetTrafficPolicyInstanceCount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTrafficPolicyInstanceCountRequest method. +// req, resp := client.GetTrafficPolicyInstanceCountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCount +func (c *Route53) GetTrafficPolicyInstanceCountRequest(input *GetTrafficPolicyInstanceCountInput) (req *request.Request, output *GetTrafficPolicyInstanceCountOutput) { + op := &request.Operation{ + Name: opGetTrafficPolicyInstanceCount, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicyinstancecount", + } + + if input == nil { + input = &GetTrafficPolicyInstanceCountInput{} + } + + output = &GetTrafficPolicyInstanceCountOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTrafficPolicyInstanceCount API operation for Amazon Route 53. +// +// Gets the number of traffic policy instances that are associated with the +// current AWS 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 Route 53's +// API operation GetTrafficPolicyInstanceCount for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCount +func (c *Route53) GetTrafficPolicyInstanceCount(input *GetTrafficPolicyInstanceCountInput) (*GetTrafficPolicyInstanceCountOutput, error) { + req, out := c.GetTrafficPolicyInstanceCountRequest(input) + return out, req.Send() +} + +// GetTrafficPolicyInstanceCountWithContext is the same as GetTrafficPolicyInstanceCount with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrafficPolicyInstanceCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) GetTrafficPolicyInstanceCountWithContext(ctx aws.Context, input *GetTrafficPolicyInstanceCountInput, opts ...request.Option) (*GetTrafficPolicyInstanceCountOutput, error) { + req, out := c.GetTrafficPolicyInstanceCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListGeoLocations = "ListGeoLocations" + +// ListGeoLocationsRequest generates a "aws/request.Request" representing the +// client's request for the ListGeoLocations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGeoLocations for more information on using the ListGeoLocations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGeoLocationsRequest method. +// req, resp := client.ListGeoLocationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocations +func (c *Route53) ListGeoLocationsRequest(input *ListGeoLocationsInput) (req *request.Request, output *ListGeoLocationsOutput) { + op := &request.Operation{ + Name: opListGeoLocations, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/geolocations", + } + + if input == nil { + input = &ListGeoLocationsInput{} + } + + output = &ListGeoLocationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGeoLocations API operation for Amazon Route 53. +// +// Retrieves a list of supported geo locations. +// +// Countries are listed first, and continents are listed last. If Amazon Route +// 53 supports subdivisions for a country (for example, states or provinces), +// the subdivisions for that country are listed in alphabetical order immediately +// after the corresponding country. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListGeoLocations for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocations +func (c *Route53) ListGeoLocations(input *ListGeoLocationsInput) (*ListGeoLocationsOutput, error) { + req, out := c.ListGeoLocationsRequest(input) + return out, req.Send() +} + +// ListGeoLocationsWithContext is the same as ListGeoLocations with the addition of +// the ability to pass a context and additional request options. +// +// See ListGeoLocations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListGeoLocationsWithContext(ctx aws.Context, input *ListGeoLocationsInput, opts ...request.Option) (*ListGeoLocationsOutput, error) { + req, out := c.ListGeoLocationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListHealthChecks = "ListHealthChecks" + +// ListHealthChecksRequest generates a "aws/request.Request" representing the +// client's request for the ListHealthChecks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListHealthChecks for more information on using the ListHealthChecks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListHealthChecksRequest method. +// req, resp := client.ListHealthChecksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecks +func (c *Route53) ListHealthChecksRequest(input *ListHealthChecksInput) (req *request.Request, output *ListHealthChecksOutput) { + op := &request.Operation{ + Name: opListHealthChecks, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/healthcheck", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListHealthChecksInput{} + } + + output = &ListHealthChecksOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListHealthChecks API operation for Amazon Route 53. +// +// Retrieve a list of the health checks that are associated with the current +// AWS 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 Route 53's +// API operation ListHealthChecks for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeIncompatibleVersion "IncompatibleVersion" +// The resource you're trying to access is unsupported on this Amazon Route +// 53 endpoint. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecks +func (c *Route53) ListHealthChecks(input *ListHealthChecksInput) (*ListHealthChecksOutput, error) { + req, out := c.ListHealthChecksRequest(input) + return out, req.Send() +} + +// ListHealthChecksWithContext is the same as ListHealthChecks with the addition of +// the ability to pass a context and additional request options. +// +// See ListHealthChecks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListHealthChecksWithContext(ctx aws.Context, input *ListHealthChecksInput, opts ...request.Option) (*ListHealthChecksOutput, error) { + req, out := c.ListHealthChecksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListHealthChecksPages iterates over the pages of a ListHealthChecks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListHealthChecks 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 ListHealthChecks operation. +// pageNum := 0 +// err := client.ListHealthChecksPages(params, +// func(page *ListHealthChecksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Route53) ListHealthChecksPages(input *ListHealthChecksInput, fn func(*ListHealthChecksOutput, bool) bool) error { + return c.ListHealthChecksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListHealthChecksPagesWithContext same as ListHealthChecksPages 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 *Route53) ListHealthChecksPagesWithContext(ctx aws.Context, input *ListHealthChecksInput, fn func(*ListHealthChecksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHealthChecksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListHealthChecksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListHealthChecksOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListHostedZones = "ListHostedZones" + +// ListHostedZonesRequest generates a "aws/request.Request" representing the +// client's request for the ListHostedZones operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListHostedZones for more information on using the ListHostedZones +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListHostedZonesRequest method. +// req, resp := client.ListHostedZonesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZones +func (c *Route53) ListHostedZonesRequest(input *ListHostedZonesInput) (req *request.Request, output *ListHostedZonesOutput) { + op := &request.Operation{ + Name: opListHostedZones, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzone", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListHostedZonesInput{} + } + + output = &ListHostedZonesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListHostedZones API operation for Amazon Route 53. +// +// Retrieves a list of the public and private hosted zones that are associated +// with the current AWS account. The response includes a HostedZones child element +// for each hosted zone. +// +// Amazon Route 53 returns a maximum of 100 items in each response. If you have +// a lot of hosted zones, you can use the maxitems parameter to list them in +// groups of up to 100. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListHostedZones for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" +// A reusable delegation set with the specified ID does not exist. +// +// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" +// A reusable delegation set with the specified ID does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZones +func (c *Route53) ListHostedZones(input *ListHostedZonesInput) (*ListHostedZonesOutput, error) { + req, out := c.ListHostedZonesRequest(input) + return out, req.Send() +} + +// ListHostedZonesWithContext is the same as ListHostedZones with the addition of +// the ability to pass a context and additional request options. +// +// See ListHostedZones for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListHostedZonesWithContext(ctx aws.Context, input *ListHostedZonesInput, opts ...request.Option) (*ListHostedZonesOutput, error) { + req, out := c.ListHostedZonesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListHostedZonesPages iterates over the pages of a ListHostedZones operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListHostedZones 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 ListHostedZones operation. +// pageNum := 0 +// err := client.ListHostedZonesPages(params, +// func(page *ListHostedZonesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Route53) ListHostedZonesPages(input *ListHostedZonesInput, fn func(*ListHostedZonesOutput, bool) bool) error { + return c.ListHostedZonesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListHostedZonesPagesWithContext same as ListHostedZonesPages 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 *Route53) ListHostedZonesPagesWithContext(ctx aws.Context, input *ListHostedZonesInput, fn func(*ListHostedZonesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHostedZonesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListHostedZonesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListHostedZonesOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListHostedZonesByName = "ListHostedZonesByName" + +// ListHostedZonesByNameRequest generates a "aws/request.Request" representing the +// client's request for the ListHostedZonesByName operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListHostedZonesByName for more information on using the ListHostedZonesByName +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListHostedZonesByNameRequest method. +// req, resp := client.ListHostedZonesByNameRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByName +func (c *Route53) ListHostedZonesByNameRequest(input *ListHostedZonesByNameInput) (req *request.Request, output *ListHostedZonesByNameOutput) { + op := &request.Operation{ + Name: opListHostedZonesByName, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzonesbyname", + } + + if input == nil { + input = &ListHostedZonesByNameInput{} + } + + output = &ListHostedZonesByNameOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListHostedZonesByName API operation for Amazon Route 53. +// +// Retrieves a list of your hosted zones in lexicographic order. The response +// includes a HostedZones child element for each hosted zone created by the +// current AWS account. +// +// ListHostedZonesByName sorts hosted zones by name with the labels reversed. +// For example: +// +// com.example.www. +// +// Note the trailing dot, which can change the sort order in some circumstances. +// +// If the domain name includes escape characters or Punycode, ListHostedZonesByName +// alphabetizes the domain name using the escaped or Punycoded value, which +// is the format that Amazon Route 53 saves in its database. For example, to +// create a hosted zone for exämple.com, you specify ex\344mple.com for the +// domain name. ListHostedZonesByName alphabetizes it as: +// +// com.ex\344mple. +// +// The labels are reversed and alphabetized using the escaped value. For more +// information about valid domain name formats, including internationalized +// domain names, see DNS Domain Name Format (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html) +// in the Amazon Route 53 Developer Guide. +// +// Amazon Route 53 returns up to 100 items in each response. If you have a lot +// of hosted zones, use the MaxItems parameter to list them in groups of up +// to 100. The response includes values that help navigate from one group of +// MaxItems hosted zones to the next: +// +// * The DNSName and HostedZoneId elements in the response contain the values, +// if any, specified for the dnsname and hostedzoneid parameters in the request +// that produced the current response. +// +// * The MaxItems element in the response contains the value, if any, that +// you specified for the maxitems parameter in the request that produced +// the current response. +// +// * If the value of IsTruncated in the response is true, there are more +// hosted zones associated with the current AWS account. +// +// If IsTruncated is false, this response includes the last hosted zone that +// is associated with the current account. The NextDNSName element and NextHostedZoneId +// elements are omitted from the response. +// +// * The NextDNSName and NextHostedZoneId elements in the response contain +// the domain name and the hosted zone ID of the next hosted zone that is +// associated with the current AWS account. If you want to list more hosted +// zones, make another call to ListHostedZonesByName, and specify the value +// of NextDNSName and NextHostedZoneId in the dnsname and hostedzoneid parameters, +// respectively. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListHostedZonesByName for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeInvalidDomainName "InvalidDomainName" +// The specified domain name is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByName +func (c *Route53) ListHostedZonesByName(input *ListHostedZonesByNameInput) (*ListHostedZonesByNameOutput, error) { + req, out := c.ListHostedZonesByNameRequest(input) + return out, req.Send() +} + +// ListHostedZonesByNameWithContext is the same as ListHostedZonesByName with the addition of +// the ability to pass a context and additional request options. +// +// See ListHostedZonesByName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListHostedZonesByNameWithContext(ctx aws.Context, input *ListHostedZonesByNameInput, opts ...request.Option) (*ListHostedZonesByNameOutput, error) { + req, out := c.ListHostedZonesByNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListQueryLoggingConfigs = "ListQueryLoggingConfigs" + +// ListQueryLoggingConfigsRequest generates a "aws/request.Request" representing the +// client's request for the ListQueryLoggingConfigs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListQueryLoggingConfigs for more information on using the ListQueryLoggingConfigs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListQueryLoggingConfigsRequest method. +// req, resp := client.ListQueryLoggingConfigsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListQueryLoggingConfigs +func (c *Route53) ListQueryLoggingConfigsRequest(input *ListQueryLoggingConfigsInput) (req *request.Request, output *ListQueryLoggingConfigsOutput) { + op := &request.Operation{ + Name: opListQueryLoggingConfigs, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/queryloggingconfig", + } + + if input == nil { + input = &ListQueryLoggingConfigsInput{} + } + + output = &ListQueryLoggingConfigsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListQueryLoggingConfigs API operation for Amazon Route 53. +// +// Lists the configurations for DNS query logging that are associated with the +// current AWS account or the configuration that is associated with a specified +// hosted zone. +// +// For more information about DNS query logs, see CreateQueryLoggingConfig. +// Additional information, including the format of DNS query logs, appears in +// Logging DNS Queries (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html) +// in the Amazon Route 53 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 Route 53's +// API operation ListQueryLoggingConfigs for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeInvalidPaginationToken "InvalidPaginationToken" +// The value that you specified to get the second or subsequent page of results +// is invalid. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListQueryLoggingConfigs +func (c *Route53) ListQueryLoggingConfigs(input *ListQueryLoggingConfigsInput) (*ListQueryLoggingConfigsOutput, error) { + req, out := c.ListQueryLoggingConfigsRequest(input) + return out, req.Send() +} + +// ListQueryLoggingConfigsWithContext is the same as ListQueryLoggingConfigs with the addition of +// the ability to pass a context and additional request options. +// +// See ListQueryLoggingConfigs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListQueryLoggingConfigsWithContext(ctx aws.Context, input *ListQueryLoggingConfigsInput, opts ...request.Option) (*ListQueryLoggingConfigsOutput, error) { + req, out := c.ListQueryLoggingConfigsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListResourceRecordSets = "ListResourceRecordSets" + +// ListResourceRecordSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListResourceRecordSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResourceRecordSets for more information on using the ListResourceRecordSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourceRecordSetsRequest method. +// req, resp := client.ListResourceRecordSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSets +func (c *Route53) ListResourceRecordSetsRequest(input *ListResourceRecordSetsInput) (req *request.Request, output *ListResourceRecordSetsOutput) { + op := &request.Operation{ + Name: opListResourceRecordSets, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzone/{Id}/rrset", + Paginator: &request.Paginator{ + InputTokens: []string{"StartRecordName", "StartRecordType", "StartRecordIdentifier"}, + OutputTokens: []string{"NextRecordName", "NextRecordType", "NextRecordIdentifier"}, + LimitToken: "MaxItems", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListResourceRecordSetsInput{} + } + + output = &ListResourceRecordSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResourceRecordSets API operation for Amazon Route 53. +// +// Lists the resource record sets in a specified hosted zone. +// +// ListResourceRecordSets returns up to 100 resource record sets at a time in +// ASCII order, beginning at a position specified by the name and type elements. +// The action sorts results first by DNS name with the labels reversed, for +// example: +// +// com.example.www. +// +// Note the trailing dot, which can change the sort order in some circumstances. +// +// When multiple records have the same DNS name, the action sorts results by +// the record type. +// +// You can use the name and type elements to adjust the beginning position of +// the list of resource record sets returned: +// +// If you do not specify Name or TypeThe results begin with the first resource +// record set that the hosted zone contains. +// +// If you specify Name but not TypeThe results begin with the first resource +// record set in the list whose name is greater than or equal to Name. +// +// If you specify Type but not NameAmazon Route 53 returns the InvalidInput +// error. +// +// If you specify both Name and TypeThe results begin with the first resource +// record set in the list whose name is greater than or equal to Name, and whose +// type is greater than or equal to Type. +// +// This action returns the most current version of the records. This includes +// records that are PENDING, and that are not yet available on all Amazon Route +// 53 DNS servers. +// +// To ensure that you get an accurate listing of the resource record sets for +// a hosted zone at a point in time, do not submit a ChangeResourceRecordSets +// request while you're paging through the results of a ListResourceRecordSets +// request. If you do, some pages may display results without the latest changes +// while other pages display results with the latest changes. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListResourceRecordSets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSets +func (c *Route53) ListResourceRecordSets(input *ListResourceRecordSetsInput) (*ListResourceRecordSetsOutput, error) { + req, out := c.ListResourceRecordSetsRequest(input) + return out, req.Send() +} + +// ListResourceRecordSetsWithContext is the same as ListResourceRecordSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceRecordSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListResourceRecordSetsWithContext(ctx aws.Context, input *ListResourceRecordSetsInput, opts ...request.Option) (*ListResourceRecordSetsOutput, error) { + req, out := c.ListResourceRecordSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListResourceRecordSetsPages iterates over the pages of a ListResourceRecordSets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListResourceRecordSets 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 ListResourceRecordSets operation. +// pageNum := 0 +// err := client.ListResourceRecordSetsPages(params, +// func(page *ListResourceRecordSetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Route53) ListResourceRecordSetsPages(input *ListResourceRecordSetsInput, fn func(*ListResourceRecordSetsOutput, bool) bool) error { + return c.ListResourceRecordSetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListResourceRecordSetsPagesWithContext same as ListResourceRecordSetsPages 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 *Route53) ListResourceRecordSetsPagesWithContext(ctx aws.Context, input *ListResourceRecordSetsInput, fn func(*ListResourceRecordSetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListResourceRecordSetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListResourceRecordSetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListResourceRecordSetsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListReusableDelegationSets = "ListReusableDelegationSets" + +// ListReusableDelegationSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListReusableDelegationSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListReusableDelegationSets for more information on using the ListReusableDelegationSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListReusableDelegationSetsRequest method. +// req, resp := client.ListReusableDelegationSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSets +func (c *Route53) ListReusableDelegationSetsRequest(input *ListReusableDelegationSetsInput) (req *request.Request, output *ListReusableDelegationSetsOutput) { + op := &request.Operation{ + Name: opListReusableDelegationSets, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/delegationset", + } + + if input == nil { + input = &ListReusableDelegationSetsInput{} + } + + output = &ListReusableDelegationSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListReusableDelegationSets API operation for Amazon Route 53. +// +// Retrieves a list of the reusable delegation sets that are associated with +// the current AWS 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 Route 53's +// API operation ListReusableDelegationSets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSets +func (c *Route53) ListReusableDelegationSets(input *ListReusableDelegationSetsInput) (*ListReusableDelegationSetsOutput, error) { + req, out := c.ListReusableDelegationSetsRequest(input) + return out, req.Send() +} + +// ListReusableDelegationSetsWithContext is the same as ListReusableDelegationSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListReusableDelegationSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListReusableDelegationSetsWithContext(ctx aws.Context, input *ListReusableDelegationSetsInput, opts ...request.Option) (*ListReusableDelegationSetsOutput, error) { + req, out := c.ListReusableDelegationSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResource +func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/tags/{ResourceType}/{ResourceId}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon Route 53. +// +// Lists tags for one health check or hosted zone. +// +// For information about using tags for cost allocation, see Using Cost Allocation +// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) +// in the AWS Billing and Cost Management 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 Route 53's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// * ErrCodeThrottlingException "ThrottlingException" +// The limit on the number of requests per second was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResource +func (c *Route53) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTagsForResources = "ListTagsForResources" + +// ListTagsForResourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResources for more information on using the ListTagsForResources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourcesRequest method. +// req, resp := client.ListTagsForResourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResources +func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput) (req *request.Request, output *ListTagsForResourcesOutput) { + op := &request.Operation{ + Name: opListTagsForResources, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/tags/{ResourceType}", + } + + if input == nil { + input = &ListTagsForResourcesInput{} + } + + output = &ListTagsForResourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResources API operation for Amazon Route 53. +// +// Lists tags for up to 10 health checks or hosted zones. +// +// For information about using tags for cost allocation, see Using Cost Allocation +// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) +// in the AWS Billing and Cost Management 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 Route 53's +// API operation ListTagsForResources for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// * ErrCodeThrottlingException "ThrottlingException" +// The limit on the number of requests per second was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResources +func (c *Route53) ListTagsForResources(input *ListTagsForResourcesInput) (*ListTagsForResourcesOutput, error) { + req, out := c.ListTagsForResourcesRequest(input) + return out, req.Send() +} + +// ListTagsForResourcesWithContext is the same as ListTagsForResources with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTagsForResourcesWithContext(ctx aws.Context, input *ListTagsForResourcesInput, opts ...request.Option) (*ListTagsForResourcesOutput, error) { + req, out := c.ListTagsForResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTrafficPolicies = "ListTrafficPolicies" + +// ListTrafficPoliciesRequest generates a "aws/request.Request" representing the +// client's request for the ListTrafficPolicies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrafficPolicies for more information on using the ListTrafficPolicies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrafficPoliciesRequest method. +// req, resp := client.ListTrafficPoliciesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicies +func (c *Route53) ListTrafficPoliciesRequest(input *ListTrafficPoliciesInput) (req *request.Request, output *ListTrafficPoliciesOutput) { + op := &request.Operation{ + Name: opListTrafficPolicies, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicies", + } + + if input == nil { + input = &ListTrafficPoliciesInput{} + } + + output = &ListTrafficPoliciesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrafficPolicies API operation for Amazon Route 53. +// +// Gets information about the latest version for every traffic policy that is +// associated with the current AWS account. Policies are listed in the order +// in which they were 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 Route 53's +// API operation ListTrafficPolicies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicies +func (c *Route53) ListTrafficPolicies(input *ListTrafficPoliciesInput) (*ListTrafficPoliciesOutput, error) { + req, out := c.ListTrafficPoliciesRequest(input) + return out, req.Send() +} + +// ListTrafficPoliciesWithContext is the same as ListTrafficPolicies with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTrafficPoliciesWithContext(ctx aws.Context, input *ListTrafficPoliciesInput, opts ...request.Option) (*ListTrafficPoliciesOutput, error) { + req, out := c.ListTrafficPoliciesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTrafficPolicyInstances = "ListTrafficPolicyInstances" + +// ListTrafficPolicyInstancesRequest generates a "aws/request.Request" representing the +// client's request for the ListTrafficPolicyInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrafficPolicyInstances for more information on using the ListTrafficPolicyInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrafficPolicyInstancesRequest method. +// req, resp := client.ListTrafficPolicyInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstances +func (c *Route53) ListTrafficPolicyInstancesRequest(input *ListTrafficPolicyInstancesInput) (req *request.Request, output *ListTrafficPolicyInstancesOutput) { + op := &request.Operation{ + Name: opListTrafficPolicyInstances, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicyinstances", + } + + if input == nil { + input = &ListTrafficPolicyInstancesInput{} + } + + output = &ListTrafficPolicyInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrafficPolicyInstances API operation for Amazon Route 53. +// +// Gets information about the traffic policy instances that you created by using +// the current AWS account. +// +// After you submit an UpdateTrafficPolicyInstance request, there's a brief +// delay while Amazon Route 53 creates the resource record sets that are specified +// in the traffic policy definition. For more information, see the State response +// element. +// +// Amazon Route 53 returns a maximum of 100 items in each response. If you have +// a lot of traffic policy instances, you can use the MaxItems parameter to +// list them in groups of up to 100. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListTrafficPolicyInstances for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" +// No traffic policy instance exists with the specified ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstances +func (c *Route53) ListTrafficPolicyInstances(input *ListTrafficPolicyInstancesInput) (*ListTrafficPolicyInstancesOutput, error) { + req, out := c.ListTrafficPolicyInstancesRequest(input) + return out, req.Send() +} + +// ListTrafficPolicyInstancesWithContext is the same as ListTrafficPolicyInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTrafficPolicyInstancesWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesInput, opts ...request.Option) (*ListTrafficPolicyInstancesOutput, error) { + req, out := c.ListTrafficPolicyInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTrafficPolicyInstancesByHostedZone = "ListTrafficPolicyInstancesByHostedZone" + +// ListTrafficPolicyInstancesByHostedZoneRequest generates a "aws/request.Request" representing the +// client's request for the ListTrafficPolicyInstancesByHostedZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrafficPolicyInstancesByHostedZone for more information on using the ListTrafficPolicyInstancesByHostedZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrafficPolicyInstancesByHostedZoneRequest method. +// req, resp := client.ListTrafficPolicyInstancesByHostedZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZone +func (c *Route53) ListTrafficPolicyInstancesByHostedZoneRequest(input *ListTrafficPolicyInstancesByHostedZoneInput) (req *request.Request, output *ListTrafficPolicyInstancesByHostedZoneOutput) { + op := &request.Operation{ + Name: opListTrafficPolicyInstancesByHostedZone, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicyinstances/hostedzone", + } + + if input == nil { + input = &ListTrafficPolicyInstancesByHostedZoneInput{} + } + + output = &ListTrafficPolicyInstancesByHostedZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrafficPolicyInstancesByHostedZone API operation for Amazon Route 53. +// +// Gets information about the traffic policy instances that you created in a +// specified hosted zone. +// +// After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance +// request, there's a brief delay while Amazon Route 53 creates the resource +// record sets that are specified in the traffic policy definition. For more +// information, see the State response element. +// +// Amazon Route 53 returns a maximum of 100 items in each response. If you have +// a lot of traffic policy instances, you can use the MaxItems parameter to +// list them in groups of up to 100. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListTrafficPolicyInstancesByHostedZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" +// No traffic policy instance exists with the specified ID. +// +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZone +func (c *Route53) ListTrafficPolicyInstancesByHostedZone(input *ListTrafficPolicyInstancesByHostedZoneInput) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) { + req, out := c.ListTrafficPolicyInstancesByHostedZoneRequest(input) + return out, req.Send() +} + +// ListTrafficPolicyInstancesByHostedZoneWithContext is the same as ListTrafficPolicyInstancesByHostedZone with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyInstancesByHostedZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTrafficPolicyInstancesByHostedZoneWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesByHostedZoneInput, opts ...request.Option) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) { + req, out := c.ListTrafficPolicyInstancesByHostedZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTrafficPolicyInstancesByPolicy = "ListTrafficPolicyInstancesByPolicy" + +// ListTrafficPolicyInstancesByPolicyRequest generates a "aws/request.Request" representing the +// client's request for the ListTrafficPolicyInstancesByPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrafficPolicyInstancesByPolicy for more information on using the ListTrafficPolicyInstancesByPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrafficPolicyInstancesByPolicyRequest method. +// req, resp := client.ListTrafficPolicyInstancesByPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicy +func (c *Route53) ListTrafficPolicyInstancesByPolicyRequest(input *ListTrafficPolicyInstancesByPolicyInput) (req *request.Request, output *ListTrafficPolicyInstancesByPolicyOutput) { + op := &request.Operation{ + Name: opListTrafficPolicyInstancesByPolicy, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicyinstances/trafficpolicy", + } + + if input == nil { + input = &ListTrafficPolicyInstancesByPolicyInput{} + } + + output = &ListTrafficPolicyInstancesByPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrafficPolicyInstancesByPolicy API operation for Amazon Route 53. +// +// Gets information about the traffic policy instances that you created by using +// a specify traffic policy version. +// +// After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance +// request, there's a brief delay while Amazon Route 53 creates the resource +// record sets that are specified in the traffic policy definition. For more +// information, see the State response element. +// +// Amazon Route 53 returns a maximum of 100 items in each response. If you have +// a lot of traffic policy instances, you can use the MaxItems parameter to +// list them in groups of up to 100. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListTrafficPolicyInstancesByPolicy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" +// No traffic policy instance exists with the specified ID. +// +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicy +func (c *Route53) ListTrafficPolicyInstancesByPolicy(input *ListTrafficPolicyInstancesByPolicyInput) (*ListTrafficPolicyInstancesByPolicyOutput, error) { + req, out := c.ListTrafficPolicyInstancesByPolicyRequest(input) + return out, req.Send() +} + +// ListTrafficPolicyInstancesByPolicyWithContext is the same as ListTrafficPolicyInstancesByPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyInstancesByPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTrafficPolicyInstancesByPolicyWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesByPolicyInput, opts ...request.Option) (*ListTrafficPolicyInstancesByPolicyOutput, error) { + req, out := c.ListTrafficPolicyInstancesByPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTrafficPolicyVersions = "ListTrafficPolicyVersions" + +// ListTrafficPolicyVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTrafficPolicyVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrafficPolicyVersions for more information on using the ListTrafficPolicyVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrafficPolicyVersionsRequest method. +// req, resp := client.ListTrafficPolicyVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersions +func (c *Route53) ListTrafficPolicyVersionsRequest(input *ListTrafficPolicyVersionsInput) (req *request.Request, output *ListTrafficPolicyVersionsOutput) { + op := &request.Operation{ + Name: opListTrafficPolicyVersions, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/trafficpolicies/{Id}/versions", + } + + if input == nil { + input = &ListTrafficPolicyVersionsInput{} + } + + output = &ListTrafficPolicyVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrafficPolicyVersions API operation for Amazon Route 53. +// +// Gets information about all of the versions for a specified traffic policy. +// +// Traffic policy versions are listed in numerical order by VersionNumber. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListTrafficPolicyVersions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersions +func (c *Route53) ListTrafficPolicyVersions(input *ListTrafficPolicyVersionsInput) (*ListTrafficPolicyVersionsOutput, error) { + req, out := c.ListTrafficPolicyVersionsRequest(input) + return out, req.Send() +} + +// ListTrafficPolicyVersionsWithContext is the same as ListTrafficPolicyVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrafficPolicyVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListTrafficPolicyVersionsWithContext(ctx aws.Context, input *ListTrafficPolicyVersionsInput, opts ...request.Option) (*ListTrafficPolicyVersionsOutput, error) { + req, out := c.ListTrafficPolicyVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListVPCAssociationAuthorizations = "ListVPCAssociationAuthorizations" + +// ListVPCAssociationAuthorizationsRequest generates a "aws/request.Request" representing the +// client's request for the ListVPCAssociationAuthorizations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListVPCAssociationAuthorizations for more information on using the ListVPCAssociationAuthorizations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListVPCAssociationAuthorizationsRequest method. +// req, resp := client.ListVPCAssociationAuthorizationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizations +func (c *Route53) ListVPCAssociationAuthorizationsRequest(input *ListVPCAssociationAuthorizationsInput) (req *request.Request, output *ListVPCAssociationAuthorizationsOutput) { + op := &request.Operation{ + Name: opListVPCAssociationAuthorizations, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzone/{Id}/authorizevpcassociation", + } + + if input == nil { + input = &ListVPCAssociationAuthorizationsInput{} + } + + output = &ListVPCAssociationAuthorizationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListVPCAssociationAuthorizations API operation for Amazon Route 53. +// +// Gets a list of the VPCs that were created by other accounts and that can +// be associated with a specified hosted zone because you've submitted one or +// more CreateVPCAssociationAuthorization requests. +// +// The response includes a VPCs element with a VPC child element for each VPC +// that can be associated with the hosted zone. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListVPCAssociationAuthorizations for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeInvalidPaginationToken "InvalidPaginationToken" +// The value that you specified to get the second or subsequent page of results +// is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizations +func (c *Route53) ListVPCAssociationAuthorizations(input *ListVPCAssociationAuthorizationsInput) (*ListVPCAssociationAuthorizationsOutput, error) { + req, out := c.ListVPCAssociationAuthorizationsRequest(input) + return out, req.Send() +} + +// ListVPCAssociationAuthorizationsWithContext is the same as ListVPCAssociationAuthorizations with the addition of +// the ability to pass a context and additional request options. +// +// See ListVPCAssociationAuthorizations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListVPCAssociationAuthorizationsWithContext(ctx aws.Context, input *ListVPCAssociationAuthorizationsInput, opts ...request.Option) (*ListVPCAssociationAuthorizationsOutput, error) { + req, out := c.ListVPCAssociationAuthorizationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTestDNSAnswer = "TestDNSAnswer" + +// TestDNSAnswerRequest generates a "aws/request.Request" representing the +// client's request for the TestDNSAnswer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TestDNSAnswer for more information on using the TestDNSAnswer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TestDNSAnswerRequest method. +// req, resp := client.TestDNSAnswerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswer +func (c *Route53) TestDNSAnswerRequest(input *TestDNSAnswerInput) (req *request.Request, output *TestDNSAnswerOutput) { + op := &request.Operation{ + Name: opTestDNSAnswer, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/testdnsanswer", + } + + if input == nil { + input = &TestDNSAnswerInput{} + } + + output = &TestDNSAnswerOutput{} + req = c.newRequest(op, input, output) + return +} + +// TestDNSAnswer API operation for Amazon Route 53. +// +// Gets the value that Amazon Route 53 returns in response to a DNS request +// for a specified record name and type. You can optionally specify the IP address +// of a DNS resolver, an EDNS0 client subnet IP address, and a subnet mask. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation TestDNSAnswer for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswer +func (c *Route53) TestDNSAnswer(input *TestDNSAnswerInput) (*TestDNSAnswerOutput, error) { + req, out := c.TestDNSAnswerRequest(input) + return out, req.Send() +} + +// TestDNSAnswerWithContext is the same as TestDNSAnswer with the addition of +// the ability to pass a context and additional request options. +// +// See TestDNSAnswer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) TestDNSAnswerWithContext(ctx aws.Context, input *TestDNSAnswerInput, opts ...request.Option) (*TestDNSAnswerOutput, error) { + req, out := c.TestDNSAnswerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateHealthCheck = "UpdateHealthCheck" + +// UpdateHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the UpdateHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateHealthCheck for more information on using the UpdateHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateHealthCheckRequest method. +// req, resp := client.UpdateHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheck +func (c *Route53) UpdateHealthCheckRequest(input *UpdateHealthCheckInput) (req *request.Request, output *UpdateHealthCheckOutput) { + op := &request.Operation{ + Name: opUpdateHealthCheck, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}", + } + + if input == nil { + input = &UpdateHealthCheckInput{} + } + + output = &UpdateHealthCheckOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateHealthCheck API operation for Amazon Route 53. +// +// Updates an existing health check. Note that some values can't be updated. +// +// For more information about updating health checks, see Creating, Updating, +// and Deleting Health Checks (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating-deleting.html) +// in the Amazon Route 53 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 Route 53's +// API operation UpdateHealthCheck for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" +// No health check exists with the ID that you specified in the DeleteHealthCheck +// request. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeHealthCheckVersionMismatch "HealthCheckVersionMismatch" +// The value of HealthCheckVersion in the request doesn't match the value of +// HealthCheckVersion in the health check. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheck +func (c *Route53) UpdateHealthCheck(input *UpdateHealthCheckInput) (*UpdateHealthCheckOutput, error) { + req, out := c.UpdateHealthCheckRequest(input) + return out, req.Send() +} + +// UpdateHealthCheckWithContext is the same as UpdateHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) UpdateHealthCheckWithContext(ctx aws.Context, input *UpdateHealthCheckInput, opts ...request.Option) (*UpdateHealthCheckOutput, error) { + req, out := c.UpdateHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateHostedZoneComment = "UpdateHostedZoneComment" + +// UpdateHostedZoneCommentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateHostedZoneComment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateHostedZoneComment for more information on using the UpdateHostedZoneComment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateHostedZoneCommentRequest method. +// req, resp := client.UpdateHostedZoneCommentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneComment +func (c *Route53) UpdateHostedZoneCommentRequest(input *UpdateHostedZoneCommentInput) (req *request.Request, output *UpdateHostedZoneCommentOutput) { + op := &request.Operation{ + Name: opUpdateHostedZoneComment, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/hostedzone/{Id}", + } + + if input == nil { + input = &UpdateHostedZoneCommentInput{} + } + + output = &UpdateHostedZoneCommentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateHostedZoneComment API operation for Amazon Route 53. +// +// Updates the comment for a specified hosted zone. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation UpdateHostedZoneComment for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" +// No hosted zone exists with the ID that you specified. +// +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneComment +func (c *Route53) UpdateHostedZoneComment(input *UpdateHostedZoneCommentInput) (*UpdateHostedZoneCommentOutput, error) { + req, out := c.UpdateHostedZoneCommentRequest(input) + return out, req.Send() +} + +// UpdateHostedZoneCommentWithContext is the same as UpdateHostedZoneComment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateHostedZoneComment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) UpdateHostedZoneCommentWithContext(ctx aws.Context, input *UpdateHostedZoneCommentInput, opts ...request.Option) (*UpdateHostedZoneCommentOutput, error) { + req, out := c.UpdateHostedZoneCommentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTrafficPolicyComment = "UpdateTrafficPolicyComment" + +// UpdateTrafficPolicyCommentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTrafficPolicyComment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTrafficPolicyComment for more information on using the UpdateTrafficPolicyComment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTrafficPolicyCommentRequest method. +// req, resp := client.UpdateTrafficPolicyCommentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyComment +func (c *Route53) UpdateTrafficPolicyCommentRequest(input *UpdateTrafficPolicyCommentInput) (req *request.Request, output *UpdateTrafficPolicyCommentOutput) { + op := &request.Operation{ + Name: opUpdateTrafficPolicyComment, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/trafficpolicy/{Id}/{Version}", + } + + if input == nil { + input = &UpdateTrafficPolicyCommentInput{} + } + + output = &UpdateTrafficPolicyCommentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTrafficPolicyComment API operation for Amazon Route 53. +// +// Updates the comment for a specified traffic policy version. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation UpdateTrafficPolicyComment for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// * ErrCodeConcurrentModification "ConcurrentModification" +// Another user submitted a request to create, update, or delete the object +// at the same time that you did. Retry the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyComment +func (c *Route53) UpdateTrafficPolicyComment(input *UpdateTrafficPolicyCommentInput) (*UpdateTrafficPolicyCommentOutput, error) { + req, out := c.UpdateTrafficPolicyCommentRequest(input) + return out, req.Send() +} + +// UpdateTrafficPolicyCommentWithContext is the same as UpdateTrafficPolicyComment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrafficPolicyComment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) UpdateTrafficPolicyCommentWithContext(ctx aws.Context, input *UpdateTrafficPolicyCommentInput, opts ...request.Option) (*UpdateTrafficPolicyCommentOutput, error) { + req, out := c.UpdateTrafficPolicyCommentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTrafficPolicyInstance = "UpdateTrafficPolicyInstance" + +// UpdateTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTrafficPolicyInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTrafficPolicyInstance for more information on using the UpdateTrafficPolicyInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTrafficPolicyInstanceRequest method. +// req, resp := client.UpdateTrafficPolicyInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstance +func (c *Route53) UpdateTrafficPolicyInstanceRequest(input *UpdateTrafficPolicyInstanceInput) (req *request.Request, output *UpdateTrafficPolicyInstanceOutput) { + op := &request.Operation{ + Name: opUpdateTrafficPolicyInstance, + HTTPMethod: "POST", + HTTPPath: "/2013-04-01/trafficpolicyinstance/{Id}", + } + + if input == nil { + input = &UpdateTrafficPolicyInstanceInput{} + } + + output = &UpdateTrafficPolicyInstanceOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTrafficPolicyInstance API operation for Amazon Route 53. +// +// Updates the resource record sets in a specified hosted zone that were created +// based on the settings in a specified traffic policy version. +// +// When you update a traffic policy instance, Amazon Route 53 continues to respond +// to DNS queries for the root resource record set name (such as example.com) +// while it replaces one group of resource record sets with another. Amazon +// Route 53 performs the following operations: +// +// Amazon Route 53 creates a new group of resource record sets based on the +// specified traffic policy. This is true regardless of how significant the +// differences are between the existing resource record sets and the new resource +// record sets. +// +// When all of the new resource record sets have been created, Amazon Route +// 53 starts to respond to DNS queries for the root resource record set name +// (such as example.com) by using the new resource record sets. +// +// Amazon Route 53 deletes the old group of resource record sets that are associated +// with the root resource record set name. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation UpdateTrafficPolicyInstance for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" +// No traffic policy exists with the specified ID. +// +// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" +// No traffic policy instance exists with the specified ID. +// +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly +// for the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// +// * ErrCodeConflictingTypes "ConflictingTypes" +// You tried to update a traffic policy instance by using a traffic policy version +// that has a different DNS type than the current type for the instance. You +// specified the type in the JSON document in the CreateTrafficPolicy or CreateTrafficPolicyVersionrequest. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstance +func (c *Route53) UpdateTrafficPolicyInstance(input *UpdateTrafficPolicyInstanceInput) (*UpdateTrafficPolicyInstanceOutput, error) { + req, out := c.UpdateTrafficPolicyInstanceRequest(input) + return out, req.Send() +} + +// UpdateTrafficPolicyInstanceWithContext is the same as UpdateTrafficPolicyInstance with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrafficPolicyInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) UpdateTrafficPolicyInstanceWithContext(ctx aws.Context, input *UpdateTrafficPolicyInstanceInput, opts ...request.Option) (*UpdateTrafficPolicyInstanceOutput, error) { + req, out := c.UpdateTrafficPolicyInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// A complex type that contains the type of limit that you specified in the +// request and the current value for that limit. +type AccountLimit struct { + _ struct{} `type:"structure"` + + // The limit that you requested. Valid values include the following: + // + // * MAX_HEALTH_CHECKS_BY_OWNER: The maximum number of health checks that + // you can create using the current account. + // + // * MAX_HOSTED_ZONES_BY_OWNER: The maximum number of hosted zones that you + // can create using the current account. + // + // * MAX_REUSABLE_DELEGATION_SETS_BY_OWNER: The maximum number of reusable + // delegation sets that you can create using the current account. + // + // * MAX_TRAFFIC_POLICIES_BY_OWNER: The maximum number of traffic policies + // that you can create using the current account. + // + // * MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER: The maximum number of traffic + // policy instances that you can create using the current account. (Traffic + // policy instances are referred to as traffic flow policy records in the + // Amazon Route 53 console.) + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"AccountLimitType"` + + // The current value for the limit that is specified by AccountLimit$Type. + // + // Value is a required field + Value *int64 `min:"1" type:"long" required:"true"` +} + +// String returns the string representation +func (s AccountLimit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountLimit) GoString() string { + return s.String() +} + +// SetType sets the Type field's value. +func (s *AccountLimit) SetType(v string) *AccountLimit { + s.Type = &v + return s +} + +// SetValue sets the Value field's value. +func (s *AccountLimit) SetValue(v int64) *AccountLimit { + s.Value = &v + return s +} + +// A complex type that identifies the CloudWatch alarm that you want Amazon +// Route 53 health checkers to use to determine whether this health check is +// healthy. +type AlarmIdentifier struct { + _ struct{} `type:"structure"` + + // The name of the CloudWatch alarm that you want Amazon Route 53 health checkers + // to use to determine whether this health check is healthy. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // A complex type that identifies the CloudWatch alarm that you want Amazon + // Route 53 health checkers to use to determine whether this health check is + // healthy. + // + // For the current list of CloudWatch regions, see Amazon CloudWatch (http://docs.aws.amazon.com/general/latest/gr/rande.html#cw_region) + // in the AWS Regions and Endpoints chapter of the Amazon Web Services General + // Reference. + // + // Region is a required field + Region *string `min:"1" type:"string" required:"true" enum:"CloudWatchRegion"` +} + +// String returns the string representation +func (s AlarmIdentifier) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlarmIdentifier) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AlarmIdentifier) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AlarmIdentifier"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Region == nil { + invalidParams.Add(request.NewErrParamRequired("Region")) + } + if s.Region != nil && len(*s.Region) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Region", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *AlarmIdentifier) SetName(v string) *AlarmIdentifier { + s.Name = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *AlarmIdentifier) SetRegion(v string) *AlarmIdentifier { + s.Region = &v + return s +} + +// Alias resource record sets only: Information about the CloudFront distribution, +// Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or Amazon +// Route 53 resource record set that you're redirecting queries to. An Elastic +// Beanstalk environment must have a regionalized subdomain. +// +// When creating resource record sets for a private hosted zone, note the following: +// +// * Resource record sets can't be created for CloudFront distributions in +// a private hosted zone. +// +// * Creating geolocation alias resource record sets or latency alias resource +// record sets in a private hosted zone is unsupported. +// +// * For information about creating failover resource record sets in a private +// hosted zone, see Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html). +type AliasTarget struct { + _ struct{} `type:"structure"` + + // Alias resource record sets only: The value that you specify depends on where + // you want to route queries: + // + // CloudFront distributionSpecify the domain name that CloudFront assigned when + // you created your distribution. + // + // Your CloudFront distribution must include an alternate domain name that matches + // the name of the resource record set. For example, if the name of the resource + // record set is acme.example.com, your CloudFront distribution must include + // acme.example.com as one of the alternate domain names. For more information, + // see Using Alternate Domain Names (CNAMEs) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html) + // in the Amazon CloudFront Developer Guide. + // + // Elastic Beanstalk environmentSpecify the CNAME attribute for the environment. + // (The environment must have a regionalized domain name.) You can use the following + // methods to get the value of the CNAME attribute: + // + // AWS Management Console: For information about how to get the value by using + // the console, see Using Custom Domains with AWS Elastic Beanstalk (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html) + // in the AWS Elastic Beanstalk Developer Guide. + // + // Elastic Beanstalk API: Use the DescribeEnvironments action to get the value + // of the CNAME attribute. For more information, see DescribeEnvironments (http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html) + // in the AWS Elastic Beanstalk API Reference. + // + // AWS CLI: Use the describe-environments command to get the value of the CNAME + // attribute. For more information, see describe-environments (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html) + // in the AWS Command Line Interface Reference. + // + // ELB load balancerSpecify the DNS name that is associated with the load balancer. + // Get the DNS name by using the AWS Management Console, the ELB API, or the + // AWS CLI. + // + // AWS Management Console: Go to the EC2 page, choose Load Balancers in the + // navigation pane, choose the load balancer, choose the Description tab, and + // get the value of the DNS name field. (If you're routing traffic to a Classic + // Load Balancer, get the value that begins with dualstack.) + // + // Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of + // DNSName. For more information, see the applicable guide: + // + // Classic Load Balancers: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html) + // + // Application and Network Load Balancers: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) + // + // AWS CLI: Use describe-load-balancers to get the value of DNSName. For more + // information, see the applicable guide: + // + // Classic Load Balancers: describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html) + // + // Application and Network Load Balancers: describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html) + // + // Amazon S3 bucket that is configured as a static websiteSpecify the domain + // name of the Amazon S3 website endpoint in which you created the bucket, for + // example, s3-website-us-east-2.amazonaws.com. For more information about valid + // values, see the table Amazon Simple Storage Service (S3) Website Endpoints + // (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the + // Amazon Web Services General Reference. For more information about using S3 + // buckets for websites, see Getting Started with Amazon Route 53 (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html) + // in the Amazon Route 53 Developer Guide. + // + // Another Amazon Route 53 resource record setSpecify the value of the Name + // element for a resource record set in the current hosted zone. + // + // DNSName is a required field + DNSName *string `type:"string" required:"true"` + + // Applies only to alias, failover alias, geolocation alias, latency alias, + // and weighted alias resource record sets: When EvaluateTargetHealth is true, + // an alias resource record set inherits the health of the referenced AWS resource, + // such as an ELB load balancer, or the referenced resource record set. + // + // Note the following: + // + // * You can't set EvaluateTargetHealth to true when the alias target is + // a CloudFront distribution. + // + // * If the AWS resource that you specify in AliasTarget is a resource record + // set or a group of resource record sets (for example, a group of weighted + // resource record sets), but it is not another alias resource record set, + // we recommend that you associate a health check with all of the resource + // record sets in the alias target. For more information, see What Happens + // When You Omit Health Checks? (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html#dns-failover-complex-configs-hc-omitting) + // in the Amazon Route 53 Developer Guide. + // + // * If you specify an Elastic Beanstalk environment in HostedZoneId and + // DNSName, and if the environment contains an ELB load balancer, Elastic + // Load Balancing routes queries only to the healthy Amazon EC2 instances + // that are registered with the load balancer. (An environment automatically + // contains an ELB load balancer if it includes more than one EC2 instance.) + // If you set EvaluateTargetHealth to true and either no EC2 instances are + // healthy or the load balancer itself is unhealthy, Amazon Route 53 routes + // queries to other available resources that are healthy, if any. + // + // If the environment contains a single EC2 instance, there are no special requirements. + // + // * If you specify an ELB load balancer in AliasTarget, ELB routes queries + // only to the healthy EC2 instances that are registered with the load balancer. + // If no EC2 instances are healthy or if the load balancer itself is unhealthy, + // and if EvaluateTargetHealth is true for the corresponding alias resource + // record set, Amazon Route 53 routes queries to other resources. When you + // create a load balancer, you configure settings for ELB health checks; + // they're not Amazon Route 53 health checks, but they perform a similar + // function. Do not create Amazon Route 53 health checks for the EC2 instances + // that you register with an ELB load balancer. + // + // For more information, see How Health Checks Work in More Complex Amazon Route + // 53 Configurations (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html) + // in the Amazon Route 53 Developer Guide. + // + // * We recommend that you set EvaluateTargetHealth to true only when you + // have enough idle capacity to handle the failure of one or more endpoints. + // + // For more information and examples, see Amazon Route 53 Health Checks and + // DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) + // in the Amazon Route 53 Developer Guide. + // + // EvaluateTargetHealth is a required field + EvaluateTargetHealth *bool `type:"boolean" required:"true"` + + // Alias resource records sets only: The value used depends on where you want + // to route traffic: + // + // CloudFront distributionSpecify Z2FDTNDATAQYW2. + // + // Alias resource record sets for CloudFront can't be created in a private zone. + // + // Elastic Beanstalk environmentSpecify the hosted zone ID for the region in + // which you created the environment. The environment must have a regionalized + // subdomain. For a list of regions and the corresponding hosted zone IDs, see + // AWS Elastic Beanstalk (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region) + // in the "AWS Regions and Endpoints" chapter of the Amazon Web Services General + // Reference. + // + // ELB load balancerSpecify the value of the hosted zone ID for the load balancer. + // Use the following methods to get the hosted zone ID: + // + // Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region) + // table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services + // General Reference: Use the value that corresponds with the region that you + // created your load balancer in. Note that there are separate columns for Application + // and Classic Load Balancers and for Network Load Balancers. + // + // AWS Management Console: Go to the Amazon EC2 page, choose Load Balancers + // in the navigation pane, select the load balancer, and get the value of the + // Hosted zone field on the Description tab. + // + // Elastic Load Balancing API: Use DescribeLoadBalancers to get the applicable + // value. For more information, see the applicable guide: + // + // Classic Load Balancers: Use DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html) + // to get the value of CanonicalHostedZoneNameId. + // + // Application and Network Load Balancers: Use DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) + // to get the value of CanonicalHostedZoneId. + // + // AWS CLI: Use describe-load-balancers to get the applicable value. For more + // information, see the applicable guide: + // + // Classic Load Balancers: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html) + // to get the value of CanonicalHostedZoneNameId. + // + // Application and Network Load Balancers: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html) + // to get the value of CanonicalHostedZoneId. + // + // An Amazon S3 bucket configured as a static websiteSpecify the hosted zone + // ID for the region that you created the bucket in. For more information about + // valid values, see the Amazon Simple Storage Service Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) + // table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services + // General Reference. + // + // Another Amazon Route 53 resource record set in your hosted zoneSpecify the + // hosted zone ID of your hosted zone. (An alias resource record set can't reference + // a resource record set in a different hosted zone.) + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AliasTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AliasTarget) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AliasTarget) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AliasTarget"} + if s.DNSName == nil { + invalidParams.Add(request.NewErrParamRequired("DNSName")) + } + if s.EvaluateTargetHealth == nil { + invalidParams.Add(request.NewErrParamRequired("EvaluateTargetHealth")) + } + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDNSName sets the DNSName field's value. +func (s *AliasTarget) SetDNSName(v string) *AliasTarget { + s.DNSName = &v + return s +} + +// SetEvaluateTargetHealth sets the EvaluateTargetHealth field's value. +func (s *AliasTarget) SetEvaluateTargetHealth(v bool) *AliasTarget { + s.EvaluateTargetHealth = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *AliasTarget) SetHostedZoneId(v string) *AliasTarget { + s.HostedZoneId = &v + return s +} + +// A complex type that contains information about the request to associate a +// VPC with a private hosted zone. +type AssociateVPCWithHostedZoneInput struct { + _ struct{} `locationName:"AssociateVPCWithHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // Optional: A comment about the association request. + Comment *string `type:"string"` + + // The ID of the private hosted zone that you want to associate an Amazon VPC + // with. + // + // Note that you can't associate a VPC with a hosted zone that doesn't have + // an existing VPC association. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // A complex type that contains information about the VPC that you want to associate + // with a private hosted zone. + // + // VPC is a required field + VPC *VPC `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AssociateVPCWithHostedZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateVPCWithHostedZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateVPCWithHostedZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateVPCWithHostedZoneInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.VPC == nil { + invalidParams.Add(request.NewErrParamRequired("VPC")) + } + if s.VPC != nil { + if err := s.VPC.Validate(); err != nil { + invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *AssociateVPCWithHostedZoneInput) SetComment(v string) *AssociateVPCWithHostedZoneInput { + s.Comment = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *AssociateVPCWithHostedZoneInput) SetHostedZoneId(v string) *AssociateVPCWithHostedZoneInput { + s.HostedZoneId = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *AssociateVPCWithHostedZoneInput) SetVPC(v *VPC) *AssociateVPCWithHostedZoneInput { + s.VPC = v + return s +} + +// A complex type that contains the response information for the AssociateVPCWithHostedZone +// request. +type AssociateVPCWithHostedZoneOutput struct { + _ struct{} `type:"structure"` + + // A complex type that describes the changes made to your hosted zone. + // + // ChangeInfo is a required field + ChangeInfo *ChangeInfo `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AssociateVPCWithHostedZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateVPCWithHostedZoneOutput) GoString() string { + return s.String() +} + +// SetChangeInfo sets the ChangeInfo field's value. +func (s *AssociateVPCWithHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *AssociateVPCWithHostedZoneOutput { + s.ChangeInfo = v + return s +} + +// The information for each resource record set that you want to change. +type Change struct { + _ struct{} `type:"structure"` + + // The action to perform: + // + // * CREATE: Creates a resource record set that has the specified values. + // + // * DELETE: Deletes a existing resource record set. + // + // To delete the resource record set that is associated with a traffic policy + // instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete + // the resource record set automatically. If you delete the resource record + // set by using ChangeResourceRecordSets, Amazon Route 53 doesn't automatically + // delete the traffic policy instance, and you'll continue to be charged + // for it even though it's no longer in use. + // + // * UPSERT: If a resource record set doesn't already exist, Amazon Route + // 53 creates it. If a resource record set does exist, Amazon Route 53 updates + // it with the values in the request. + // + // Action is a required field + Action *string `type:"string" required:"true" enum:"ChangeAction"` + + // Information about the resource record set to create, delete, or update. + // + // ResourceRecordSet is a required field + ResourceRecordSet *ResourceRecordSet `type:"structure" required:"true"` +} + +// String returns the string representation +func (s Change) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Change) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Change) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Change"} + if s.Action == nil { + invalidParams.Add(request.NewErrParamRequired("Action")) + } + if s.ResourceRecordSet == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceRecordSet")) + } + if s.ResourceRecordSet != nil { + if err := s.ResourceRecordSet.Validate(); err != nil { + invalidParams.AddNested("ResourceRecordSet", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAction sets the Action field's value. +func (s *Change) SetAction(v string) *Change { + s.Action = &v + return s +} + +// SetResourceRecordSet sets the ResourceRecordSet field's value. +func (s *Change) SetResourceRecordSet(v *ResourceRecordSet) *Change { + s.ResourceRecordSet = v + return s +} + +// The information for a change request. +type ChangeBatch struct { + _ struct{} `type:"structure"` + + // Information about the changes to make to the record sets. + // + // Changes is a required field + Changes []*Change `locationNameList:"Change" min:"1" type:"list" required:"true"` + + // Optional: Any comments you want to include about a change batch request. + Comment *string `type:"string"` +} + +// String returns the string representation +func (s ChangeBatch) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeBatch) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeBatch) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangeBatch"} + if s.Changes == nil { + invalidParams.Add(request.NewErrParamRequired("Changes")) + } + if s.Changes != nil && len(s.Changes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Changes", 1)) + } + if s.Changes != nil { + for i, v := range s.Changes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Changes", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChanges sets the Changes field's value. +func (s *ChangeBatch) SetChanges(v []*Change) *ChangeBatch { + s.Changes = v + return s +} + +// SetComment sets the Comment field's value. +func (s *ChangeBatch) SetComment(v string) *ChangeBatch { + s.Comment = &v + return s +} + +// A complex type that describes change information about changes made to your +// hosted zone. +type ChangeInfo struct { + _ struct{} `type:"structure"` + + // A complex type that describes change information about changes made to your + // hosted zone. + // + // This element contains an ID that you use when performing a GetChange action + // to get detailed information about the change. + Comment *string `type:"string"` + + // The ID of the request. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The current state of the request. PENDING indicates that this request has + // not yet been applied to all Amazon Route 53 DNS servers. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"ChangeStatus"` + + // The date and time that the change request was submitted in ISO 8601 format + // (https://en.wikipedia.org/wiki/ISO_8601) and Coordinated Universal Time (UTC). + // For example, the value 2017-03-27T17:48:16.751Z represents March 27, 2017 + // at 17:48:16.751 UTC. + // + // SubmittedAt is a required field + SubmittedAt *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s ChangeInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeInfo) GoString() string { + return s.String() +} + +// SetComment sets the Comment field's value. +func (s *ChangeInfo) SetComment(v string) *ChangeInfo { + s.Comment = &v + return s +} + +// SetId sets the Id field's value. +func (s *ChangeInfo) SetId(v string) *ChangeInfo { + s.Id = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ChangeInfo) SetStatus(v string) *ChangeInfo { + s.Status = &v + return s +} + +// SetSubmittedAt sets the SubmittedAt field's value. +func (s *ChangeInfo) SetSubmittedAt(v time.Time) *ChangeInfo { + s.SubmittedAt = &v + return s +} + +// A complex type that contains change information for the resource record set. +type ChangeResourceRecordSetsInput struct { + _ struct{} `locationName:"ChangeResourceRecordSetsRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A complex type that contains an optional comment and the Changes element. + // + // ChangeBatch is a required field + ChangeBatch *ChangeBatch `type:"structure" required:"true"` + + // The ID of the hosted zone that contains the resource record sets that you + // want to change. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s ChangeResourceRecordSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeResourceRecordSetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeResourceRecordSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangeResourceRecordSetsInput"} + if s.ChangeBatch == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeBatch")) + } + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.ChangeBatch != nil { + if err := s.ChangeBatch.Validate(); err != nil { + invalidParams.AddNested("ChangeBatch", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChangeBatch sets the ChangeBatch field's value. +func (s *ChangeResourceRecordSetsInput) SetChangeBatch(v *ChangeBatch) *ChangeResourceRecordSetsInput { + s.ChangeBatch = v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ChangeResourceRecordSetsInput) SetHostedZoneId(v string) *ChangeResourceRecordSetsInput { + s.HostedZoneId = &v + return s +} + +// A complex type containing the response for the request. +type ChangeResourceRecordSetsOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about changes made to your hosted + // zone. + // + // This element contains an ID that you use when performing a GetChange action + // to get detailed information about the change. + // + // ChangeInfo is a required field + ChangeInfo *ChangeInfo `type:"structure" required:"true"` +} + +// String returns the string representation +func (s ChangeResourceRecordSetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeResourceRecordSetsOutput) GoString() string { + return s.String() +} + +// SetChangeInfo sets the ChangeInfo field's value. +func (s *ChangeResourceRecordSetsOutput) SetChangeInfo(v *ChangeInfo) *ChangeResourceRecordSetsOutput { + s.ChangeInfo = v + return s +} + +// A complex type that contains information about the tags that you want to +// add, edit, or delete. +type ChangeTagsForResourceInput struct { + _ struct{} `locationName:"ChangeTagsForResourceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A complex type that contains a list of the tags that you want to add to the + // specified health check or hosted zone and/or the tags that you want to edit + // Value for. + // + // You can add a maximum of 10 tags to a health check or a hosted zone. + AddTags []*Tag `locationNameList:"Tag" min:"1" type:"list"` + + // A complex type that contains a list of the tags that you want to delete from + // the specified health check or hosted zone. You can specify up to 10 keys. + RemoveTagKeys []*string `locationNameList:"Key" min:"1" type:"list"` + + // The ID of the resource for which you want to add, change, or delete tags. + // + // ResourceId is a required field + ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` + + // The type of the resource. + // + // * The resource type for health checks is healthcheck. + // + // * The resource type for hosted zones is hostedzone. + // + // ResourceType is a required field + ResourceType *string `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"TagResourceType"` +} + +// String returns the string representation +func (s ChangeTagsForResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeTagsForResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangeTagsForResourceInput"} + if s.AddTags != nil && len(s.AddTags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AddTags", 1)) + } + if s.RemoveTagKeys != nil && len(s.RemoveTagKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RemoveTagKeys", 1)) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAddTags sets the AddTags field's value. +func (s *ChangeTagsForResourceInput) SetAddTags(v []*Tag) *ChangeTagsForResourceInput { + s.AddTags = v + return s +} + +// SetRemoveTagKeys sets the RemoveTagKeys field's value. +func (s *ChangeTagsForResourceInput) SetRemoveTagKeys(v []*string) *ChangeTagsForResourceInput { + s.RemoveTagKeys = v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *ChangeTagsForResourceInput) SetResourceId(v string) *ChangeTagsForResourceInput { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ChangeTagsForResourceInput) SetResourceType(v string) *ChangeTagsForResourceInput { + s.ResourceType = &v + return s +} + +// Empty response for the request. +type ChangeTagsForResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ChangeTagsForResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeTagsForResourceOutput) GoString() string { + return s.String() +} + +// A complex type that contains information about the CloudWatch alarm that +// Amazon Route 53 is monitoring for this health check. +type CloudWatchAlarmConfiguration struct { + _ struct{} `type:"structure"` + + // For the metric that the CloudWatch alarm is associated with, the arithmetic + // operation that is used for the comparison. + // + // ComparisonOperator is a required field + ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` + + // For the metric that the CloudWatch alarm is associated with, a complex type + // that contains information about the dimensions for the metric. For information, + // see Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) + // in the Amazon CloudWatch User Guide. + Dimensions []*Dimension `locationNameList:"Dimension" type:"list"` + + // For the metric that the CloudWatch alarm is associated with, the number of + // periods that the metric is compared to the threshold. + // + // EvaluationPeriods is a required field + EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"` + + // The name of the CloudWatch metric that the alarm is associated with. + // + // MetricName is a required field + MetricName *string `min:"1" type:"string" required:"true"` + + // The namespace of the metric that the alarm is associated with. For more information, + // see Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) + // in the Amazon CloudWatch User Guide. + // + // Namespace is a required field + Namespace *string `min:"1" type:"string" required:"true"` + + // For the metric that the CloudWatch alarm is associated with, the duration + // of one evaluation period in seconds. + // + // Period is a required field + Period *int64 `min:"60" type:"integer" required:"true"` + + // For the metric that the CloudWatch alarm is associated with, the statistic + // that is applied to the metric. + // + // Statistic is a required field + Statistic *string `type:"string" required:"true" enum:"Statistic"` + + // For the metric that the CloudWatch alarm is associated with, the value the + // metric is compared with. + // + // Threshold is a required field + Threshold *float64 `type:"double" required:"true"` +} + +// String returns the string representation +func (s CloudWatchAlarmConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudWatchAlarmConfiguration) GoString() string { + return s.String() +} + +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *CloudWatchAlarmConfiguration) SetComparisonOperator(v string) *CloudWatchAlarmConfiguration { + s.ComparisonOperator = &v + return s +} + +// SetDimensions sets the Dimensions field's value. +func (s *CloudWatchAlarmConfiguration) SetDimensions(v []*Dimension) *CloudWatchAlarmConfiguration { + s.Dimensions = v + return s +} + +// SetEvaluationPeriods sets the EvaluationPeriods field's value. +func (s *CloudWatchAlarmConfiguration) SetEvaluationPeriods(v int64) *CloudWatchAlarmConfiguration { + s.EvaluationPeriods = &v + return s +} + +// SetMetricName sets the MetricName field's value. +func (s *CloudWatchAlarmConfiguration) SetMetricName(v string) *CloudWatchAlarmConfiguration { + s.MetricName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *CloudWatchAlarmConfiguration) SetNamespace(v string) *CloudWatchAlarmConfiguration { + s.Namespace = &v + return s +} + +// SetPeriod sets the Period field's value. +func (s *CloudWatchAlarmConfiguration) SetPeriod(v int64) *CloudWatchAlarmConfiguration { + s.Period = &v + return s +} + +// SetStatistic sets the Statistic field's value. +func (s *CloudWatchAlarmConfiguration) SetStatistic(v string) *CloudWatchAlarmConfiguration { + s.Statistic = &v + return s +} + +// SetThreshold sets the Threshold field's value. +func (s *CloudWatchAlarmConfiguration) SetThreshold(v float64) *CloudWatchAlarmConfiguration { + s.Threshold = &v + return s +} + +// A complex type that contains the health check request information. +type CreateHealthCheckInput struct { + _ struct{} `locationName:"CreateHealthCheckRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A unique string that identifies the request and that allows you to retry + // a failed CreateHealthCheck request without the risk of creating two identical + // health checks: + // + // * If you send a CreateHealthCheck request with the same CallerReference + // and settings as a previous request, and if the health check doesn't exist, + // Amazon Route 53 creates the health check. If the health check does exist, + // Amazon Route 53 returns the settings for the existing health check. + // + // * If you send a CreateHealthCheck request with the same CallerReference + // as a deleted health check, regardless of the settings, Amazon Route 53 + // returns a HealthCheckAlreadyExists error. + // + // * If you send a CreateHealthCheck request with the same CallerReference + // as an existing health check but with different settings, Amazon Route + // 53 returns a HealthCheckAlreadyExists error. + // + // * If you send a CreateHealthCheck request with a unique CallerReference + // but settings identical to an existing health check, Amazon Route 53 creates + // the health check. + // + // CallerReference is a required field + CallerReference *string `min:"1" type:"string" required:"true"` + + // A complex type that contains the response to a CreateHealthCheck request. + // + // HealthCheckConfig is a required field + HealthCheckConfig *HealthCheckConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateHealthCheckInput"} + if s.CallerReference == nil { + invalidParams.Add(request.NewErrParamRequired("CallerReference")) + } + if s.CallerReference != nil && len(*s.CallerReference) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CallerReference", 1)) + } + if s.HealthCheckConfig == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckConfig")) + } + if s.HealthCheckConfig != nil { + if err := s.HealthCheckConfig.Validate(); err != nil { + invalidParams.AddNested("HealthCheckConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCallerReference sets the CallerReference field's value. +func (s *CreateHealthCheckInput) SetCallerReference(v string) *CreateHealthCheckInput { + s.CallerReference = &v + return s +} + +// SetHealthCheckConfig sets the HealthCheckConfig field's value. +func (s *CreateHealthCheckInput) SetHealthCheckConfig(v *HealthCheckConfig) *CreateHealthCheckInput { + s.HealthCheckConfig = v + return s +} + +// A complex type containing the response information for the new health check. +type CreateHealthCheckOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains identifying information about the health check. + // + // HealthCheck is a required field + HealthCheck *HealthCheck `type:"structure" required:"true"` + + // The unique URL representing the new health check. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHealthCheckOutput) GoString() string { + return s.String() +} + +// SetHealthCheck sets the HealthCheck field's value. +func (s *CreateHealthCheckOutput) SetHealthCheck(v *HealthCheck) *CreateHealthCheckOutput { + s.HealthCheck = v + return s +} + +// SetLocation sets the Location field's value. +func (s *CreateHealthCheckOutput) SetLocation(v string) *CreateHealthCheckOutput { + s.Location = &v + return s +} + +// A complex type that contains information about the request to create a hosted +// zone. +type CreateHostedZoneInput struct { + _ struct{} `locationName:"CreateHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A unique string that identifies the request and that allows failed CreateHostedZone + // requests to be retried without the risk of executing the operation twice. + // You must use a unique CallerReference string every time you submit a CreateHostedZone + // request. CallerReference can be any unique string, for example, a date/time + // stamp. + // + // CallerReference is a required field + CallerReference *string `min:"1" type:"string" required:"true"` + + // If you want to associate a reusable delegation set with this hosted zone, + // the ID that Amazon Route 53 assigned to the reusable delegation set when + // you created it. For more information about reusable delegation sets, see + // CreateReusableDelegationSet. + DelegationSetId *string `type:"string"` + + // (Optional) A complex type that contains the following optional values: + // + // * For public and private hosted zones, an optional comment + // + // * For private hosted zones, an optional PrivateZone element + // + // If you don't specify a comment or the PrivateZone element, omit HostedZoneConfig + // and the other elements. + HostedZoneConfig *HostedZoneConfig `type:"structure"` + + // The name of the domain. For resource record types that include a domain name, + // specify a fully qualified domain name, for example, www.example.com. The + // trailing dot is optional; Amazon Route 53 assumes that the domain name is + // fully qualified. This means that Amazon Route 53 treats www.example.com (without + // a trailing dot) and www.example.com. (with a trailing dot) as identical. + // + // If you're creating a public hosted zone, this is the name you have registered + // with your DNS registrar. If your domain name is registered with a registrar + // other than Amazon Route 53, change the name servers for your domain to the + // set of NameServers that CreateHostedZone returns in DelegationSet. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // (Private hosted zones only) A complex type that contains information about + // the Amazon VPC that you're associating with this hosted zone. + // + // You can specify only one Amazon VPC when you create a private hosted zone. + // To associate additional Amazon VPCs with the hosted zone, use AssociateVPCWithHostedZone + // after you create a hosted zone. + VPC *VPC `type:"structure"` +} + +// String returns the string representation +func (s CreateHostedZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHostedZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateHostedZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateHostedZoneInput"} + if s.CallerReference == nil { + invalidParams.Add(request.NewErrParamRequired("CallerReference")) + } + if s.CallerReference != nil && len(*s.CallerReference) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CallerReference", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.VPC != nil { + if err := s.VPC.Validate(); err != nil { + invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCallerReference sets the CallerReference field's value. +func (s *CreateHostedZoneInput) SetCallerReference(v string) *CreateHostedZoneInput { + s.CallerReference = &v + return s +} + +// SetDelegationSetId sets the DelegationSetId field's value. +func (s *CreateHostedZoneInput) SetDelegationSetId(v string) *CreateHostedZoneInput { + s.DelegationSetId = &v + return s +} + +// SetHostedZoneConfig sets the HostedZoneConfig field's value. +func (s *CreateHostedZoneInput) SetHostedZoneConfig(v *HostedZoneConfig) *CreateHostedZoneInput { + s.HostedZoneConfig = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateHostedZoneInput) SetName(v string) *CreateHostedZoneInput { + s.Name = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *CreateHostedZoneInput) SetVPC(v *VPC) *CreateHostedZoneInput { + s.VPC = v + return s +} + +// A complex type containing the response information for the hosted zone. +type CreateHostedZoneOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about the CreateHostedZone request. + // + // ChangeInfo is a required field + ChangeInfo *ChangeInfo `type:"structure" required:"true"` + + // A complex type that describes the name servers for this hosted zone. + // + // DelegationSet is a required field + DelegationSet *DelegationSet `type:"structure" required:"true"` + + // A complex type that contains general information about the hosted zone. + // + // HostedZone is a required field + HostedZone *HostedZone `type:"structure" required:"true"` + + // The unique URL representing the new hosted zone. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` + + // A complex type that contains information about an Amazon VPC that you associated + // with this hosted zone. + VPC *VPC `type:"structure"` +} + +// String returns the string representation +func (s CreateHostedZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHostedZoneOutput) GoString() string { + return s.String() +} + +// SetChangeInfo sets the ChangeInfo field's value. +func (s *CreateHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *CreateHostedZoneOutput { + s.ChangeInfo = v + return s +} + +// SetDelegationSet sets the DelegationSet field's value. +func (s *CreateHostedZoneOutput) SetDelegationSet(v *DelegationSet) *CreateHostedZoneOutput { + s.DelegationSet = v + return s +} + +// SetHostedZone sets the HostedZone field's value. +func (s *CreateHostedZoneOutput) SetHostedZone(v *HostedZone) *CreateHostedZoneOutput { + s.HostedZone = v + return s +} + +// SetLocation sets the Location field's value. +func (s *CreateHostedZoneOutput) SetLocation(v string) *CreateHostedZoneOutput { + s.Location = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *CreateHostedZoneOutput) SetVPC(v *VPC) *CreateHostedZoneOutput { + s.VPC = v + return s +} + +type CreateQueryLoggingConfigInput struct { + _ struct{} `locationName:"CreateQueryLoggingConfigRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The Amazon Resource Name (ARN) for the log group that you want to Amazon + // Route 53 to send query logs to. This is the format of the ARN: + // + // arn:aws:logs:region:account-id:log-group:log_group_name + // + // To get the ARN for a log group, you can use the CloudWatch console, the DescribeLogGroups + // (http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html) + // API action, the describe-log-groups (http://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html) + // command, or the applicable command in one of the AWS SDKs. + // + // CloudWatchLogsLogGroupArn is a required field + CloudWatchLogsLogGroupArn *string `type:"string" required:"true"` + + // The ID of the hosted zone that you want to log queries for. You can log queries + // only for public hosted zones. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateQueryLoggingConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateQueryLoggingConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateQueryLoggingConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateQueryLoggingConfigInput"} + if s.CloudWatchLogsLogGroupArn == nil { + invalidParams.Add(request.NewErrParamRequired("CloudWatchLogsLogGroupArn")) + } + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *CreateQueryLoggingConfigInput) SetCloudWatchLogsLogGroupArn(v string) *CreateQueryLoggingConfigInput { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *CreateQueryLoggingConfigInput) SetHostedZoneId(v string) *CreateQueryLoggingConfigInput { + s.HostedZoneId = &v + return s +} + +type CreateQueryLoggingConfigOutput struct { + _ struct{} `type:"structure"` + + // The unique URL representing the new query logging configuration. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` + + // A complex type that contains the ID for a query logging configuration, the + // ID of the hosted zone that you want to log queries for, and the ARN for the + // log group that you want Amazon Route 53 to send query logs to. + // + // QueryLoggingConfig is a required field + QueryLoggingConfig *QueryLoggingConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateQueryLoggingConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateQueryLoggingConfigOutput) GoString() string { + return s.String() +} + +// SetLocation sets the Location field's value. +func (s *CreateQueryLoggingConfigOutput) SetLocation(v string) *CreateQueryLoggingConfigOutput { + s.Location = &v + return s +} + +// SetQueryLoggingConfig sets the QueryLoggingConfig field's value. +func (s *CreateQueryLoggingConfigOutput) SetQueryLoggingConfig(v *QueryLoggingConfig) *CreateQueryLoggingConfigOutput { + s.QueryLoggingConfig = v + return s +} + +type CreateReusableDelegationSetInput struct { + _ struct{} `locationName:"CreateReusableDelegationSetRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A unique string that identifies the request, and that allows you to retry + // failed CreateReusableDelegationSet requests without the risk of executing + // the operation twice. You must use a unique CallerReference string every time + // you submit a CreateReusableDelegationSet request. CallerReference can be + // any unique string, for example a date/time stamp. + // + // CallerReference is a required field + CallerReference *string `min:"1" type:"string" required:"true"` + + // If you want to mark the delegation set for an existing hosted zone as reusable, + // the ID for that hosted zone. + HostedZoneId *string `type:"string"` +} + +// String returns the string representation +func (s CreateReusableDelegationSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReusableDelegationSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateReusableDelegationSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateReusableDelegationSetInput"} + if s.CallerReference == nil { + invalidParams.Add(request.NewErrParamRequired("CallerReference")) + } + if s.CallerReference != nil && len(*s.CallerReference) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CallerReference", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCallerReference sets the CallerReference field's value. +func (s *CreateReusableDelegationSetInput) SetCallerReference(v string) *CreateReusableDelegationSetInput { + s.CallerReference = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *CreateReusableDelegationSetInput) SetHostedZoneId(v string) *CreateReusableDelegationSetInput { + s.HostedZoneId = &v + return s +} + +type CreateReusableDelegationSetOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains name server information. + // + // DelegationSet is a required field + DelegationSet *DelegationSet `type:"structure" required:"true"` + + // The unique URL representing the new reusable delegation set. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateReusableDelegationSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReusableDelegationSetOutput) GoString() string { + return s.String() +} + +// SetDelegationSet sets the DelegationSet field's value. +func (s *CreateReusableDelegationSetOutput) SetDelegationSet(v *DelegationSet) *CreateReusableDelegationSetOutput { + s.DelegationSet = v + return s +} + +// SetLocation sets the Location field's value. +func (s *CreateReusableDelegationSetOutput) SetLocation(v string) *CreateReusableDelegationSetOutput { + s.Location = &v + return s +} + +// A complex type that contains information about the traffic policy that you +// want to create. +type CreateTrafficPolicyInput struct { + _ struct{} `locationName:"CreateTrafficPolicyRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // (Optional) Any comments that you want to include about the traffic policy. + Comment *string `type:"string"` + + // The definition of this traffic policy in JSON format. For more information, + // see Traffic Policy Document Format (http://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html). + // + // Document is a required field + Document *string `type:"string" required:"true"` + + // The name of the traffic policy. + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTrafficPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrafficPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrafficPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrafficPolicyInput"} + if s.Document == nil { + invalidParams.Add(request.NewErrParamRequired("Document")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *CreateTrafficPolicyInput) SetComment(v string) *CreateTrafficPolicyInput { + s.Comment = &v + return s +} + +// SetDocument sets the Document field's value. +func (s *CreateTrafficPolicyInput) SetDocument(v string) *CreateTrafficPolicyInput { + s.Document = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateTrafficPolicyInput) SetName(v string) *CreateTrafficPolicyInput { + s.Name = &v + return s +} + +// A complex type that contains information about the resource record sets that +// you want to create based on a specified traffic policy. +type CreateTrafficPolicyInstanceInput struct { + _ struct{} `locationName:"CreateTrafficPolicyInstanceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The ID of the hosted zone in which you want Amazon Route 53 to create resource + // record sets by using the configuration in a traffic policy. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` + + // The domain name (such as example.com) or subdomain name (such as www.example.com) + // for which Amazon Route 53 responds to DNS queries by using the resource record + // sets that Amazon Route 53 creates for this traffic policy instance. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // (Optional) The TTL that you want Amazon Route 53 to assign to all of the + // resource record sets that it creates in the specified hosted zone. + // + // TTL is a required field + TTL *int64 `type:"long" required:"true"` + + // The ID of the traffic policy that you want to use to create resource record + // sets in the specified hosted zone. + // + // TrafficPolicyId is a required field + TrafficPolicyId *string `min:"1" type:"string" required:"true"` + + // The version of the traffic policy that you want to use to create resource + // record sets in the specified hosted zone. + // + // TrafficPolicyVersion is a required field + TrafficPolicyVersion *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s CreateTrafficPolicyInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrafficPolicyInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrafficPolicyInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrafficPolicyInstanceInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.TTL == nil { + invalidParams.Add(request.NewErrParamRequired("TTL")) + } + if s.TrafficPolicyId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficPolicyId")) + } + if s.TrafficPolicyId != nil && len(*s.TrafficPolicyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyId", 1)) + } + if s.TrafficPolicyVersion == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficPolicyVersion")) + } + if s.TrafficPolicyVersion != nil && *s.TrafficPolicyVersion < 1 { + invalidParams.Add(request.NewErrParamMinValue("TrafficPolicyVersion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *CreateTrafficPolicyInstanceInput) SetHostedZoneId(v string) *CreateTrafficPolicyInstanceInput { + s.HostedZoneId = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateTrafficPolicyInstanceInput) SetName(v string) *CreateTrafficPolicyInstanceInput { + s.Name = &v + return s +} + +// SetTTL sets the TTL field's value. +func (s *CreateTrafficPolicyInstanceInput) SetTTL(v int64) *CreateTrafficPolicyInstanceInput { + s.TTL = &v + return s +} + +// SetTrafficPolicyId sets the TrafficPolicyId field's value. +func (s *CreateTrafficPolicyInstanceInput) SetTrafficPolicyId(v string) *CreateTrafficPolicyInstanceInput { + s.TrafficPolicyId = &v + return s +} + +// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. +func (s *CreateTrafficPolicyInstanceInput) SetTrafficPolicyVersion(v int64) *CreateTrafficPolicyInstanceInput { + s.TrafficPolicyVersion = &v + return s +} + +// A complex type that contains the response information for the CreateTrafficPolicyInstance +// request. +type CreateTrafficPolicyInstanceOutput struct { + _ struct{} `type:"structure"` + + // A unique URL that represents a new traffic policy instance. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` + + // A complex type that contains settings for the new traffic policy instance. + // + // TrafficPolicyInstance is a required field + TrafficPolicyInstance *TrafficPolicyInstance `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateTrafficPolicyInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrafficPolicyInstanceOutput) GoString() string { + return s.String() +} + +// SetLocation sets the Location field's value. +func (s *CreateTrafficPolicyInstanceOutput) SetLocation(v string) *CreateTrafficPolicyInstanceOutput { + s.Location = &v + return s +} + +// SetTrafficPolicyInstance sets the TrafficPolicyInstance field's value. +func (s *CreateTrafficPolicyInstanceOutput) SetTrafficPolicyInstance(v *TrafficPolicyInstance) *CreateTrafficPolicyInstanceOutput { + s.TrafficPolicyInstance = v + return s +} + +// A complex type that contains the response information for the CreateTrafficPolicy +// request. +type CreateTrafficPolicyOutput struct { + _ struct{} `type:"structure"` + + // A unique URL that represents a new traffic policy. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` + + // A complex type that contains settings for the new traffic policy. + // + // TrafficPolicy is a required field + TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateTrafficPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrafficPolicyOutput) GoString() string { + return s.String() +} + +// SetLocation sets the Location field's value. +func (s *CreateTrafficPolicyOutput) SetLocation(v string) *CreateTrafficPolicyOutput { + s.Location = &v + return s +} + +// SetTrafficPolicy sets the TrafficPolicy field's value. +func (s *CreateTrafficPolicyOutput) SetTrafficPolicy(v *TrafficPolicy) *CreateTrafficPolicyOutput { + s.TrafficPolicy = v + return s +} + +// A complex type that contains information about the traffic policy that you +// want to create a new version for. +type CreateTrafficPolicyVersionInput struct { + _ struct{} `locationName:"CreateTrafficPolicyVersionRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The comment that you specified in the CreateTrafficPolicyVersion request, + // if any. + Comment *string `type:"string"` + + // The definition of this version of the traffic policy, in JSON format. You + // specified the JSON in the CreateTrafficPolicyVersion request. For more information + // about the JSON format, see CreateTrafficPolicy. + // + // Document is a required field + Document *string `type:"string" required:"true"` + + // The ID of the traffic policy for which you want to create a new version. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTrafficPolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrafficPolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrafficPolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrafficPolicyVersionInput"} + if s.Document == nil { + invalidParams.Add(request.NewErrParamRequired("Document")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *CreateTrafficPolicyVersionInput) SetComment(v string) *CreateTrafficPolicyVersionInput { + s.Comment = &v + return s +} + +// SetDocument sets the Document field's value. +func (s *CreateTrafficPolicyVersionInput) SetDocument(v string) *CreateTrafficPolicyVersionInput { + s.Document = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateTrafficPolicyVersionInput) SetId(v string) *CreateTrafficPolicyVersionInput { + s.Id = &v + return s +} + +// A complex type that contains the response information for the CreateTrafficPolicyVersion +// request. +type CreateTrafficPolicyVersionOutput struct { + _ struct{} `type:"structure"` + + // A unique URL that represents a new traffic policy version. + // + // Location is a required field + Location *string `location:"header" locationName:"Location" type:"string" required:"true"` + + // A complex type that contains settings for the new version of the traffic + // policy. + // + // TrafficPolicy is a required field + TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateTrafficPolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrafficPolicyVersionOutput) GoString() string { + return s.String() +} + +// SetLocation sets the Location field's value. +func (s *CreateTrafficPolicyVersionOutput) SetLocation(v string) *CreateTrafficPolicyVersionOutput { + s.Location = &v + return s +} + +// SetTrafficPolicy sets the TrafficPolicy field's value. +func (s *CreateTrafficPolicyVersionOutput) SetTrafficPolicy(v *TrafficPolicy) *CreateTrafficPolicyVersionOutput { + s.TrafficPolicy = v + return s +} + +// A complex type that contains information about the request to authorize associating +// a VPC with your private hosted zone. Authorization is only required when +// a private hosted zone and a VPC were created by using different accounts. +type CreateVPCAssociationAuthorizationInput struct { + _ struct{} `locationName:"CreateVPCAssociationAuthorizationRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The ID of the private hosted zone that you want to authorize associating + // a VPC with. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // A complex type that contains the VPC ID and region for the VPC that you want + // to authorize associating with your hosted zone. + // + // VPC is a required field + VPC *VPC `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateVPCAssociationAuthorizationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVPCAssociationAuthorizationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateVPCAssociationAuthorizationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVPCAssociationAuthorizationInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.VPC == nil { + invalidParams.Add(request.NewErrParamRequired("VPC")) + } + if s.VPC != nil { + if err := s.VPC.Validate(); err != nil { + invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *CreateVPCAssociationAuthorizationInput) SetHostedZoneId(v string) *CreateVPCAssociationAuthorizationInput { + s.HostedZoneId = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *CreateVPCAssociationAuthorizationInput) SetVPC(v *VPC) *CreateVPCAssociationAuthorizationInput { + s.VPC = v + return s +} + +// A complex type that contains the response information from a CreateVPCAssociationAuthorization +// request. +type CreateVPCAssociationAuthorizationOutput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that you authorized associating a VPC with. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` + + // The VPC that you authorized associating with a hosted zone. + // + // VPC is a required field + VPC *VPC `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateVPCAssociationAuthorizationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVPCAssociationAuthorizationOutput) GoString() string { + return s.String() +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *CreateVPCAssociationAuthorizationOutput) SetHostedZoneId(v string) *CreateVPCAssociationAuthorizationOutput { + s.HostedZoneId = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *CreateVPCAssociationAuthorizationOutput) SetVPC(v *VPC) *CreateVPCAssociationAuthorizationOutput { + s.VPC = v + return s +} + +// A complex type that lists the name servers in a delegation set, as well as +// the CallerReference and the ID for the delegation set. +type DelegationSet struct { + _ struct{} `type:"structure"` + + // The value that you specified for CallerReference when you created the reusable + // delegation set. + CallerReference *string `min:"1" type:"string"` + + // The ID that Amazon Route 53 assigns to a reusable delegation set. + Id *string `type:"string"` + + // A complex type that contains a list of the authoritative name servers for + // a hosted zone or for a reusable delegation set. + // + // NameServers is a required field + NameServers []*string `locationNameList:"NameServer" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s DelegationSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DelegationSet) GoString() string { + return s.String() +} + +// SetCallerReference sets the CallerReference field's value. +func (s *DelegationSet) SetCallerReference(v string) *DelegationSet { + s.CallerReference = &v + return s +} + +// SetId sets the Id field's value. +func (s *DelegationSet) SetId(v string) *DelegationSet { + s.Id = &v + return s +} + +// SetNameServers sets the NameServers field's value. +func (s *DelegationSet) SetNameServers(v []*string) *DelegationSet { + s.NameServers = v + return s +} + +// This action deletes a health check. +type DeleteHealthCheckInput struct { + _ struct{} `type:"structure"` + + // The ID of the health check that you want to delete. + // + // HealthCheckId is a required field + HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteHealthCheckInput"} + if s.HealthCheckId == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheckId sets the HealthCheckId field's value. +func (s *DeleteHealthCheckInput) SetHealthCheckId(v string) *DeleteHealthCheckInput { + s.HealthCheckId = &v + return s +} + +// An empty element. +type DeleteHealthCheckOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteHealthCheckOutput) GoString() string { + return s.String() +} + +// A request to delete a hosted zone. +type DeleteHostedZoneInput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone you want to delete. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteHostedZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteHostedZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteHostedZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteHostedZoneInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteHostedZoneInput) SetId(v string) *DeleteHostedZoneInput { + s.Id = &v + return s +} + +// A complex type that contains the response to a DeleteHostedZone request. +type DeleteHostedZoneOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains the ID, the status, and the date and time of + // a request to delete a hosted zone. + // + // ChangeInfo is a required field + ChangeInfo *ChangeInfo `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DeleteHostedZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteHostedZoneOutput) GoString() string { + return s.String() +} + +// SetChangeInfo sets the ChangeInfo field's value. +func (s *DeleteHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *DeleteHostedZoneOutput { + s.ChangeInfo = v + return s +} + +type DeleteQueryLoggingConfigInput struct { + _ struct{} `type:"structure"` + + // The ID of the configuration that you want to delete. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteQueryLoggingConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteQueryLoggingConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteQueryLoggingConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteQueryLoggingConfigInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteQueryLoggingConfigInput) SetId(v string) *DeleteQueryLoggingConfigInput { + s.Id = &v + return s +} + +type DeleteQueryLoggingConfigOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteQueryLoggingConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteQueryLoggingConfigOutput) GoString() string { + return s.String() +} + +// A request to delete a reusable delegation set. +type DeleteReusableDelegationSetInput struct { + _ struct{} `type:"structure"` + + // The ID of the reusable delegation set that you want to delete. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteReusableDelegationSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReusableDelegationSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteReusableDelegationSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteReusableDelegationSetInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteReusableDelegationSetInput) SetId(v string) *DeleteReusableDelegationSetInput { + s.Id = &v + return s +} + +// An empty element. +type DeleteReusableDelegationSetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteReusableDelegationSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReusableDelegationSetOutput) GoString() string { + return s.String() +} + +// A request to delete a specified traffic policy version. +type DeleteTrafficPolicyInput struct { + _ struct{} `type:"structure"` + + // The ID of the traffic policy that you want to delete. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` + + // The version number of the traffic policy that you want to delete. + // + // Version is a required field + Version *int64 `location:"uri" locationName:"Version" min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s DeleteTrafficPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrafficPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTrafficPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficPolicyInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.Version == nil { + invalidParams.Add(request.NewErrParamRequired("Version")) + } + if s.Version != nil && *s.Version < 1 { + invalidParams.Add(request.NewErrParamMinValue("Version", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteTrafficPolicyInput) SetId(v string) *DeleteTrafficPolicyInput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *DeleteTrafficPolicyInput) SetVersion(v int64) *DeleteTrafficPolicyInput { + s.Version = &v + return s +} + +// A request to delete a specified traffic policy instance. +type DeleteTrafficPolicyInstanceInput struct { + _ struct{} `type:"structure"` + + // The ID of the traffic policy instance that you want to delete. + // + // When you delete a traffic policy instance, Amazon Route 53 also deletes all + // of the resource record sets that were created when you created the traffic + // policy instance. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTrafficPolicyInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrafficPolicyInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTrafficPolicyInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficPolicyInstanceInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteTrafficPolicyInstanceInput) SetId(v string) *DeleteTrafficPolicyInstanceInput { + s.Id = &v + return s +} + +// An empty element. +type DeleteTrafficPolicyInstanceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTrafficPolicyInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrafficPolicyInstanceOutput) GoString() string { + return s.String() +} + +// An empty element. +type DeleteTrafficPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTrafficPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrafficPolicyOutput) GoString() string { + return s.String() +} + +// A complex type that contains information about the request to remove authorization +// to associate a VPC that was created by one AWS account with a hosted zone +// that was created with a different AWS account. +type DeleteVPCAssociationAuthorizationInput struct { + _ struct{} `locationName:"DeleteVPCAssociationAuthorizationRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // When removing authorization to associate a VPC that was created by one AWS + // account with a hosted zone that was created with a different AWS account, + // the ID of the hosted zone. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // When removing authorization to associate a VPC that was created by one AWS + // account with a hosted zone that was created with a different AWS account, + // a complex type that includes the ID and region of the VPC. + // + // VPC is a required field + VPC *VPC `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DeleteVPCAssociationAuthorizationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVPCAssociationAuthorizationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteVPCAssociationAuthorizationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVPCAssociationAuthorizationInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.VPC == nil { + invalidParams.Add(request.NewErrParamRequired("VPC")) + } + if s.VPC != nil { + if err := s.VPC.Validate(); err != nil { + invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *DeleteVPCAssociationAuthorizationInput) SetHostedZoneId(v string) *DeleteVPCAssociationAuthorizationInput { + s.HostedZoneId = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *DeleteVPCAssociationAuthorizationInput) SetVPC(v *VPC) *DeleteVPCAssociationAuthorizationInput { + s.VPC = v + return s +} + +// Empty response for the request. +type DeleteVPCAssociationAuthorizationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteVPCAssociationAuthorizationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVPCAssociationAuthorizationOutput) GoString() string { + return s.String() +} + +// For the metric that the CloudWatch alarm is associated with, a complex type +// that contains information about one dimension. +type Dimension struct { + _ struct{} `type:"structure"` + + // For the metric that the CloudWatch alarm is associated with, the name of + // one dimension. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // For the metric that the CloudWatch alarm is associated with, the value of + // one dimension. + // + // Value is a required field + Value *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s Dimension) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Dimension) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *Dimension) SetName(v string) *Dimension { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Dimension) SetValue(v string) *Dimension { + s.Value = &v + return s +} + +// A complex type that contains information about the VPC that you want to disassociate +// from a specified private hosted zone. +type DisassociateVPCFromHostedZoneInput struct { + _ struct{} `locationName:"DisassociateVPCFromHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // Optional: A comment about the disassociation request. + Comment *string `type:"string"` + + // The ID of the private hosted zone that you want to disassociate a VPC from. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // A complex type that contains information about the VPC that you're disassociating + // from the specified hosted zone. + // + // VPC is a required field + VPC *VPC `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DisassociateVPCFromHostedZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateVPCFromHostedZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateVPCFromHostedZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateVPCFromHostedZoneInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.VPC == nil { + invalidParams.Add(request.NewErrParamRequired("VPC")) + } + if s.VPC != nil { + if err := s.VPC.Validate(); err != nil { + invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *DisassociateVPCFromHostedZoneInput) SetComment(v string) *DisassociateVPCFromHostedZoneInput { + s.Comment = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *DisassociateVPCFromHostedZoneInput) SetHostedZoneId(v string) *DisassociateVPCFromHostedZoneInput { + s.HostedZoneId = &v + return s +} + +// SetVPC sets the VPC field's value. +func (s *DisassociateVPCFromHostedZoneInput) SetVPC(v *VPC) *DisassociateVPCFromHostedZoneInput { + s.VPC = v + return s +} + +// A complex type that contains the response information for the disassociate +// request. +type DisassociateVPCFromHostedZoneOutput struct { + _ struct{} `type:"structure"` + + // A complex type that describes the changes made to the specified private hosted + // zone. + // + // ChangeInfo is a required field + ChangeInfo *ChangeInfo `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DisassociateVPCFromHostedZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateVPCFromHostedZoneOutput) GoString() string { + return s.String() +} + +// SetChangeInfo sets the ChangeInfo field's value. +func (s *DisassociateVPCFromHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *DisassociateVPCFromHostedZoneOutput { + s.ChangeInfo = v + return s +} + +// A complex type that contains information about a geo location. +type GeoLocation struct { + _ struct{} `type:"structure"` + + // The two-letter code for the continent. + // + // Valid values: AF | AN | AS | EU | OC | NA | SA + // + // Constraint: Specifying ContinentCode with either CountryCode or SubdivisionCode + // returns an InvalidInput error. + ContinentCode *string `min:"2" type:"string"` + + // The two-letter code for the country. + CountryCode *string `min:"1" type:"string"` + + // The code for the subdivision, for example, a state in the United States or + // a province in Canada. + SubdivisionCode *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GeoLocation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GeoLocation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GeoLocation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GeoLocation"} + if s.ContinentCode != nil && len(*s.ContinentCode) < 2 { + invalidParams.Add(request.NewErrParamMinLen("ContinentCode", 2)) + } + if s.CountryCode != nil && len(*s.CountryCode) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CountryCode", 1)) + } + if s.SubdivisionCode != nil && len(*s.SubdivisionCode) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubdivisionCode", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContinentCode sets the ContinentCode field's value. +func (s *GeoLocation) SetContinentCode(v string) *GeoLocation { + s.ContinentCode = &v + return s +} + +// SetCountryCode sets the CountryCode field's value. +func (s *GeoLocation) SetCountryCode(v string) *GeoLocation { + s.CountryCode = &v + return s +} + +// SetSubdivisionCode sets the SubdivisionCode field's value. +func (s *GeoLocation) SetSubdivisionCode(v string) *GeoLocation { + s.SubdivisionCode = &v + return s +} + +// A complex type that contains the codes and full continent, country, and subdivision +// names for the specified geolocation code. +type GeoLocationDetails struct { + _ struct{} `type:"structure"` + + // The two-letter code for the continent. + ContinentCode *string `min:"2" type:"string"` + + // The full name of the continent. + ContinentName *string `min:"1" type:"string"` + + // The two-letter code for the country. + CountryCode *string `min:"1" type:"string"` + + // The name of the country. + CountryName *string `min:"1" type:"string"` + + // The code for the subdivision, for example, a state in the United States or + // a province in Canada. + SubdivisionCode *string `min:"1" type:"string"` + + // The full name of the subdivision, for example, a state in the United States + // or a province in Canada. + SubdivisionName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GeoLocationDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GeoLocationDetails) GoString() string { + return s.String() +} + +// SetContinentCode sets the ContinentCode field's value. +func (s *GeoLocationDetails) SetContinentCode(v string) *GeoLocationDetails { + s.ContinentCode = &v + return s +} + +// SetContinentName sets the ContinentName field's value. +func (s *GeoLocationDetails) SetContinentName(v string) *GeoLocationDetails { + s.ContinentName = &v + return s +} + +// SetCountryCode sets the CountryCode field's value. +func (s *GeoLocationDetails) SetCountryCode(v string) *GeoLocationDetails { + s.CountryCode = &v + return s +} + +// SetCountryName sets the CountryName field's value. +func (s *GeoLocationDetails) SetCountryName(v string) *GeoLocationDetails { + s.CountryName = &v + return s +} + +// SetSubdivisionCode sets the SubdivisionCode field's value. +func (s *GeoLocationDetails) SetSubdivisionCode(v string) *GeoLocationDetails { + s.SubdivisionCode = &v + return s +} + +// SetSubdivisionName sets the SubdivisionName field's value. +func (s *GeoLocationDetails) SetSubdivisionName(v string) *GeoLocationDetails { + s.SubdivisionName = &v + return s +} + +// A complex type that contains information about the request to create a hosted +// zone. +type GetAccountLimitInput struct { + _ struct{} `type:"structure"` + + // The limit that you want to get. Valid values include the following: + // + // * MAX_HEALTH_CHECKS_BY_OWNER: The maximum number of health checks that + // you can create using the current account. + // + // * MAX_HOSTED_ZONES_BY_OWNER: The maximum number of hosted zones that you + // can create using the current account. + // + // * MAX_REUSABLE_DELEGATION_SETS_BY_OWNER: The maximum number of reusable + // delegation sets that you can create using the current account. + // + // * MAX_TRAFFIC_POLICIES_BY_OWNER: The maximum number of traffic policies + // that you can create using the current account. + // + // * MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER: The maximum number of traffic + // policy instances that you can create using the current account. (Traffic + // policy instances are referred to as traffic flow policy records in the + // Amazon Route 53 console.) + // + // Type is a required field + Type *string `location:"uri" locationName:"Type" type:"string" required:"true" enum:"AccountLimitType"` +} + +// String returns the string representation +func (s GetAccountLimitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountLimitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccountLimitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccountLimitInput"} + 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 *GetAccountLimitInput) SetType(v string) *GetAccountLimitInput { + s.Type = &v + return s +} + +// A complex type that contains the requested limit. +type GetAccountLimitOutput struct { + _ struct{} `type:"structure"` + + // The current number of entities that you have created of the specified type. + // For example, if you specified MAX_HEALTH_CHECKS_BY_OWNER for the value of + // Type in the request, the value of Count is the current number of health checks + // that you have created using the current account. + // + // Count is a required field + Count *int64 `type:"long" required:"true"` + + // The current setting for the specified limit. For example, if you specified + // MAX_HEALTH_CHECKS_BY_OWNER for the value of Type in the request, the value + // of Limit is the maximum number of health checks that you can create using + // the current account. + // + // Limit is a required field + Limit *AccountLimit `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetAccountLimitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccountLimitOutput) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *GetAccountLimitOutput) SetCount(v int64) *GetAccountLimitOutput { + s.Count = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *GetAccountLimitOutput) SetLimit(v *AccountLimit) *GetAccountLimitOutput { + s.Limit = v + return s +} + +// The input for a GetChange request. +type GetChangeInput struct { + _ struct{} `type:"structure"` + + // The ID of the change batch request. The value that you specify here is the + // value that ChangeResourceRecordSets returned in the Id element when you submitted + // the request. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetChangeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetChangeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetChangeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetChangeInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetChangeInput) SetId(v string) *GetChangeInput { + s.Id = &v + return s +} + +// A complex type that contains the ChangeInfo element. +type GetChangeOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about the specified change batch. + // + // ChangeInfo is a required field + ChangeInfo *ChangeInfo `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetChangeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetChangeOutput) GoString() string { + return s.String() +} + +// SetChangeInfo sets the ChangeInfo field's value. +func (s *GetChangeOutput) SetChangeInfo(v *ChangeInfo) *GetChangeOutput { + s.ChangeInfo = v + return s +} + +type GetCheckerIpRangesInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetCheckerIpRangesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCheckerIpRangesInput) GoString() string { + return s.String() +} + +type GetCheckerIpRangesOutput struct { + _ struct{} `type:"structure"` + + // CheckerIpRanges is a required field + CheckerIpRanges []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s GetCheckerIpRangesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCheckerIpRangesOutput) GoString() string { + return s.String() +} + +// SetCheckerIpRanges sets the CheckerIpRanges field's value. +func (s *GetCheckerIpRangesOutput) SetCheckerIpRanges(v []*string) *GetCheckerIpRangesOutput { + s.CheckerIpRanges = v + return s +} + +// A request for information about whether a specified geographic location is +// supported for Amazon Route 53 geolocation resource record sets. +type GetGeoLocationInput struct { + _ struct{} `type:"structure"` + + // Amazon Route 53 supports the following continent codes: + // + // * AF: Africa + // + // * AN: Antarctica + // + // * AS: Asia + // + // * EU: Europe + // + // * OC: Oceania + // + // * NA: North America + // + // * SA: South America + ContinentCode *string `location:"querystring" locationName:"continentcode" min:"2" type:"string"` + + // Amazon Route 53 uses the two-letter country codes that are specified in ISO + // standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + CountryCode *string `location:"querystring" locationName:"countrycode" min:"1" type:"string"` + + // Amazon Route 53 uses the one- to three-letter subdivision codes that are + // specified in ISO standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + // Amazon Route 53 doesn't support subdivision codes for all countries. If you + // specify SubdivisionCode, you must also specify CountryCode. + SubdivisionCode *string `location:"querystring" locationName:"subdivisioncode" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetGeoLocationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGeoLocationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGeoLocationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGeoLocationInput"} + if s.ContinentCode != nil && len(*s.ContinentCode) < 2 { + invalidParams.Add(request.NewErrParamMinLen("ContinentCode", 2)) + } + if s.CountryCode != nil && len(*s.CountryCode) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CountryCode", 1)) + } + if s.SubdivisionCode != nil && len(*s.SubdivisionCode) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubdivisionCode", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContinentCode sets the ContinentCode field's value. +func (s *GetGeoLocationInput) SetContinentCode(v string) *GetGeoLocationInput { + s.ContinentCode = &v + return s +} + +// SetCountryCode sets the CountryCode field's value. +func (s *GetGeoLocationInput) SetCountryCode(v string) *GetGeoLocationInput { + s.CountryCode = &v + return s +} + +// SetSubdivisionCode sets the SubdivisionCode field's value. +func (s *GetGeoLocationInput) SetSubdivisionCode(v string) *GetGeoLocationInput { + s.SubdivisionCode = &v + return s +} + +// A complex type that contains the response information for the specified geolocation +// code. +type GetGeoLocationOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains the codes and full continent, country, and subdivision + // names for the specified geolocation code. + // + // GeoLocationDetails is a required field + GeoLocationDetails *GeoLocationDetails `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetGeoLocationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGeoLocationOutput) GoString() string { + return s.String() +} + +// SetGeoLocationDetails sets the GeoLocationDetails field's value. +func (s *GetGeoLocationOutput) SetGeoLocationDetails(v *GeoLocationDetails) *GetGeoLocationOutput { + s.GeoLocationDetails = v + return s +} + +// A request for the number of health checks that are associated with the current +// AWS account. +type GetHealthCheckCountInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetHealthCheckCountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckCountInput) GoString() string { + return s.String() +} + +// A complex type that contains the response to a GetHealthCheckCount request. +type GetHealthCheckCountOutput struct { + _ struct{} `type:"structure"` + + // The number of health checks associated with the current AWS account. + // + // HealthCheckCount is a required field + HealthCheckCount *int64 `type:"long" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckCountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckCountOutput) GoString() string { + return s.String() +} + +// SetHealthCheckCount sets the HealthCheckCount field's value. +func (s *GetHealthCheckCountOutput) SetHealthCheckCount(v int64) *GetHealthCheckCountOutput { + s.HealthCheckCount = &v + return s +} + +// A request to get information about a specified health check. +type GetHealthCheckInput struct { + _ struct{} `type:"structure"` + + // The identifier that Amazon Route 53 assigned to the health check when you + // created it. When you add or update a resource record set, you use this value + // to specify which health check to use. The value can be up to 64 characters + // long. + // + // HealthCheckId is a required field + HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetHealthCheckInput"} + if s.HealthCheckId == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheckId sets the HealthCheckId field's value. +func (s *GetHealthCheckInput) SetHealthCheckId(v string) *GetHealthCheckInput { + s.HealthCheckId = &v + return s +} + +// A request for the reason that a health check failed most recently. +type GetHealthCheckLastFailureReasonInput struct { + _ struct{} `type:"structure"` + + // The ID for the health check for which you want the last failure reason. When + // you created the health check, CreateHealthCheck returned the ID in the response, + // in the HealthCheckId element. + // + // If you want to get the last failure reason for a calculated health check, + // you must use the Amazon Route 53 console or the CloudWatch console. You can't + // use GetHealthCheckLastFailureReason for a calculated health check. + // + // HealthCheckId is a required field + HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckLastFailureReasonInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckLastFailureReasonInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetHealthCheckLastFailureReasonInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetHealthCheckLastFailureReasonInput"} + if s.HealthCheckId == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheckId sets the HealthCheckId field's value. +func (s *GetHealthCheckLastFailureReasonInput) SetHealthCheckId(v string) *GetHealthCheckLastFailureReasonInput { + s.HealthCheckId = &v + return s +} + +// A complex type that contains the response to a GetHealthCheckLastFailureReason +// request. +type GetHealthCheckLastFailureReasonOutput struct { + _ struct{} `type:"structure"` + + // A list that contains one Observation element for each Amazon Route 53 health + // checker that is reporting a last failure reason. + // + // HealthCheckObservations is a required field + HealthCheckObservations []*HealthCheckObservation `locationNameList:"HealthCheckObservation" type:"list" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckLastFailureReasonOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckLastFailureReasonOutput) GoString() string { + return s.String() +} + +// SetHealthCheckObservations sets the HealthCheckObservations field's value. +func (s *GetHealthCheckLastFailureReasonOutput) SetHealthCheckObservations(v []*HealthCheckObservation) *GetHealthCheckLastFailureReasonOutput { + s.HealthCheckObservations = v + return s +} + +// A complex type that contains the response to a GetHealthCheck request. +type GetHealthCheckOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about one health check that is associated + // with the current AWS account. + // + // HealthCheck is a required field + HealthCheck *HealthCheck `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckOutput) GoString() string { + return s.String() +} + +// SetHealthCheck sets the HealthCheck field's value. +func (s *GetHealthCheckOutput) SetHealthCheck(v *HealthCheck) *GetHealthCheckOutput { + s.HealthCheck = v + return s +} + +// A request to get the status for a health check. +type GetHealthCheckStatusInput struct { + _ struct{} `type:"structure"` + + // The ID for the health check that you want the current status for. When you + // created the health check, CreateHealthCheck returned the ID in the response, + // in the HealthCheckId element. + // + // If you want to check the status of a calculated health check, you must use + // the Amazon Route 53 console or the CloudWatch console. You can't use GetHealthCheckStatus + // to get the status of a calculated health check. + // + // HealthCheckId is a required field + HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetHealthCheckStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetHealthCheckStatusInput"} + if s.HealthCheckId == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheckId sets the HealthCheckId field's value. +func (s *GetHealthCheckStatusInput) SetHealthCheckId(v string) *GetHealthCheckStatusInput { + s.HealthCheckId = &v + return s +} + +// A complex type that contains the response to a GetHealthCheck request. +type GetHealthCheckStatusOutput struct { + _ struct{} `type:"structure"` + + // A list that contains one HealthCheckObservation element for each Amazon Route + // 53 health checker that is reporting a status about the health check endpoint. + // + // HealthCheckObservations is a required field + HealthCheckObservations []*HealthCheckObservation `locationNameList:"HealthCheckObservation" type:"list" required:"true"` +} + +// String returns the string representation +func (s GetHealthCheckStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHealthCheckStatusOutput) GoString() string { + return s.String() +} + +// SetHealthCheckObservations sets the HealthCheckObservations field's value. +func (s *GetHealthCheckStatusOutput) SetHealthCheckObservations(v []*HealthCheckObservation) *GetHealthCheckStatusOutput { + s.HealthCheckObservations = v + return s +} + +// A request to retrieve a count of all the hosted zones that are associated +// with the current AWS account. +type GetHostedZoneCountInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetHostedZoneCountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHostedZoneCountInput) GoString() string { + return s.String() +} + +// A complex type that contains the response to a GetHostedZoneCount request. +type GetHostedZoneCountOutput struct { + _ struct{} `type:"structure"` + + // The total number of public and private hosted zones that are associated with + // the current AWS account. + // + // HostedZoneCount is a required field + HostedZoneCount *int64 `type:"long" required:"true"` +} + +// String returns the string representation +func (s GetHostedZoneCountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHostedZoneCountOutput) GoString() string { + return s.String() +} + +// SetHostedZoneCount sets the HostedZoneCount field's value. +func (s *GetHostedZoneCountOutput) SetHostedZoneCount(v int64) *GetHostedZoneCountOutput { + s.HostedZoneCount = &v + return s +} + +// A request to get information about a specified hosted zone. +type GetHostedZoneInput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that you want to get information about. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetHostedZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHostedZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetHostedZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetHostedZoneInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetHostedZoneInput) SetId(v string) *GetHostedZoneInput { + s.Id = &v + return s +} + +// A complex type that contains information about the request to create a hosted +// zone. +type GetHostedZoneLimitInput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that you want to get a limit for. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // The limit that you want to get. Valid values include the following: + // + // * MAX_RRSETS_BY_ZONE: The maximum number of records that you can create + // in the specified hosted zone. + // + // * MAX_VPCS_ASSOCIATED_BY_ZONE: The maximum number of Amazon VPCs that + // you can associate with the specified private hosted zone. + // + // Type is a required field + Type *string `location:"uri" locationName:"Type" type:"string" required:"true" enum:"HostedZoneLimitType"` +} + +// String returns the string representation +func (s GetHostedZoneLimitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHostedZoneLimitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetHostedZoneLimitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetHostedZoneLimitInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *GetHostedZoneLimitInput) SetHostedZoneId(v string) *GetHostedZoneLimitInput { + s.HostedZoneId = &v + return s +} + +// SetType sets the Type field's value. +func (s *GetHostedZoneLimitInput) SetType(v string) *GetHostedZoneLimitInput { + s.Type = &v + return s +} + +// A complex type that contains the requested limit. +type GetHostedZoneLimitOutput struct { + _ struct{} `type:"structure"` + + // The current number of entities that you have created of the specified type. + // For example, if you specified MAX_RRSETS_BY_ZONE for the value of Type in + // the request, the value of Count is the current number of records that you + // have created in the specified hosted zone. + // + // Count is a required field + Count *int64 `type:"long" required:"true"` + + // The current setting for the specified limit. For example, if you specified + // MAX_RRSETS_BY_ZONE for the value of Type in the request, the value of Limit + // is the maximum number of records that you can create in the specified hosted + // zone. + // + // Limit is a required field + Limit *HostedZoneLimit `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetHostedZoneLimitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHostedZoneLimitOutput) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *GetHostedZoneLimitOutput) SetCount(v int64) *GetHostedZoneLimitOutput { + s.Count = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *GetHostedZoneLimitOutput) SetLimit(v *HostedZoneLimit) *GetHostedZoneLimitOutput { + s.Limit = v + return s +} + +// A complex type that contain the response to a GetHostedZone request. +type GetHostedZoneOutput struct { + _ struct{} `type:"structure"` + + // A complex type that lists the Amazon Route 53 name servers for the specified + // hosted zone. + DelegationSet *DelegationSet `type:"structure"` + + // A complex type that contains general information about the specified hosted + // zone. + // + // HostedZone is a required field + HostedZone *HostedZone `type:"structure" required:"true"` + + // A complex type that contains information about the VPCs that are associated + // with the specified hosted zone. + VPCs []*VPC `locationNameList:"VPC" min:"1" type:"list"` +} + +// String returns the string representation +func (s GetHostedZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetHostedZoneOutput) GoString() string { + return s.String() +} + +// SetDelegationSet sets the DelegationSet field's value. +func (s *GetHostedZoneOutput) SetDelegationSet(v *DelegationSet) *GetHostedZoneOutput { + s.DelegationSet = v + return s +} + +// SetHostedZone sets the HostedZone field's value. +func (s *GetHostedZoneOutput) SetHostedZone(v *HostedZone) *GetHostedZoneOutput { + s.HostedZone = v + return s +} + +// SetVPCs sets the VPCs field's value. +func (s *GetHostedZoneOutput) SetVPCs(v []*VPC) *GetHostedZoneOutput { + s.VPCs = v + return s +} + +type GetQueryLoggingConfigInput struct { + _ struct{} `type:"structure"` + + // The ID of the configuration for DNS query logging that you want to get information + // about. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetQueryLoggingConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueryLoggingConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetQueryLoggingConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetQueryLoggingConfigInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetQueryLoggingConfigInput) SetId(v string) *GetQueryLoggingConfigInput { + s.Id = &v + return s +} + +type GetQueryLoggingConfigOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about the query logging configuration + // that you specified in a GetQueryLoggingConfig request. + // + // QueryLoggingConfig is a required field + QueryLoggingConfig *QueryLoggingConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetQueryLoggingConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueryLoggingConfigOutput) GoString() string { + return s.String() +} + +// SetQueryLoggingConfig sets the QueryLoggingConfig field's value. +func (s *GetQueryLoggingConfigOutput) SetQueryLoggingConfig(v *QueryLoggingConfig) *GetQueryLoggingConfigOutput { + s.QueryLoggingConfig = v + return s +} + +// A request to get information about a specified reusable delegation set. +type GetReusableDelegationSetInput struct { + _ struct{} `type:"structure"` + + // The ID of the reusable delegation set that you want to get a list of name + // servers for. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetReusableDelegationSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetReusableDelegationSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetReusableDelegationSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetReusableDelegationSetInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetReusableDelegationSetInput) SetId(v string) *GetReusableDelegationSetInput { + s.Id = &v + return s +} + +// A complex type that contains information about the request to create a hosted +// zone. +type GetReusableDelegationSetLimitInput struct { + _ struct{} `type:"structure"` + + // The ID of the delegation set that you want to get the limit for. + // + // DelegationSetId is a required field + DelegationSetId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // Specify MAX_ZONES_BY_REUSABLE_DELEGATION_SET to get the maximum number of + // hosted zones that you can associate with the specified reusable delegation + // set. + // + // Type is a required field + Type *string `location:"uri" locationName:"Type" type:"string" required:"true" enum:"ReusableDelegationSetLimitType"` +} + +// String returns the string representation +func (s GetReusableDelegationSetLimitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetReusableDelegationSetLimitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetReusableDelegationSetLimitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetReusableDelegationSetLimitInput"} + if s.DelegationSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DelegationSetId")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDelegationSetId sets the DelegationSetId field's value. +func (s *GetReusableDelegationSetLimitInput) SetDelegationSetId(v string) *GetReusableDelegationSetLimitInput { + s.DelegationSetId = &v + return s +} + +// SetType sets the Type field's value. +func (s *GetReusableDelegationSetLimitInput) SetType(v string) *GetReusableDelegationSetLimitInput { + s.Type = &v + return s +} + +// A complex type that contains the requested limit. +type GetReusableDelegationSetLimitOutput struct { + _ struct{} `type:"structure"` + + // The current number of hosted zones that you can associate with the specified + // reusable delegation set. + // + // Count is a required field + Count *int64 `type:"long" required:"true"` + + // The current setting for the limit on hosted zones that you can associate + // with the specified reusable delegation set. + // + // Limit is a required field + Limit *ReusableDelegationSetLimit `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetReusableDelegationSetLimitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetReusableDelegationSetLimitOutput) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *GetReusableDelegationSetLimitOutput) SetCount(v int64) *GetReusableDelegationSetLimitOutput { + s.Count = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *GetReusableDelegationSetLimitOutput) SetLimit(v *ReusableDelegationSetLimit) *GetReusableDelegationSetLimitOutput { + s.Limit = v + return s +} + +// A complex type that contains the response to the GetReusableDelegationSet +// request. +type GetReusableDelegationSetOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about the reusable delegation set. + // + // DelegationSet is a required field + DelegationSet *DelegationSet `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetReusableDelegationSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetReusableDelegationSetOutput) GoString() string { + return s.String() +} + +// SetDelegationSet sets the DelegationSet field's value. +func (s *GetReusableDelegationSetOutput) SetDelegationSet(v *DelegationSet) *GetReusableDelegationSetOutput { + s.DelegationSet = v + return s +} + +// Gets information about a specific traffic policy version. +type GetTrafficPolicyInput struct { + _ struct{} `type:"structure"` + + // The ID of the traffic policy that you want to get information about. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` + + // The version number of the traffic policy that you want to get information + // about. + // + // Version is a required field + Version *int64 `location:"uri" locationName:"Version" min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s GetTrafficPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrafficPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTrafficPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTrafficPolicyInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.Version == nil { + invalidParams.Add(request.NewErrParamRequired("Version")) + } + if s.Version != nil && *s.Version < 1 { + invalidParams.Add(request.NewErrParamMinValue("Version", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetTrafficPolicyInput) SetId(v string) *GetTrafficPolicyInput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetTrafficPolicyInput) SetVersion(v int64) *GetTrafficPolicyInput { + s.Version = &v + return s +} + +// Request to get the number of traffic policy instances that are associated +// with the current AWS account. +type GetTrafficPolicyInstanceCountInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetTrafficPolicyInstanceCountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrafficPolicyInstanceCountInput) GoString() string { + return s.String() +} + +// A complex type that contains information about the resource record sets that +// Amazon Route 53 created based on a specified traffic policy. +type GetTrafficPolicyInstanceCountOutput struct { + _ struct{} `type:"structure"` + + // The number of traffic policy instances that are associated with the current + // AWS account. + // + // TrafficPolicyInstanceCount is a required field + TrafficPolicyInstanceCount *int64 `type:"integer" required:"true"` +} + +// String returns the string representation +func (s GetTrafficPolicyInstanceCountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrafficPolicyInstanceCountOutput) GoString() string { + return s.String() +} + +// SetTrafficPolicyInstanceCount sets the TrafficPolicyInstanceCount field's value. +func (s *GetTrafficPolicyInstanceCountOutput) SetTrafficPolicyInstanceCount(v int64) *GetTrafficPolicyInstanceCountOutput { + s.TrafficPolicyInstanceCount = &v + return s +} + +// Gets information about a specified traffic policy instance. +type GetTrafficPolicyInstanceInput struct { + _ struct{} `type:"structure"` + + // The ID of the traffic policy instance that you want to get information about. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTrafficPolicyInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrafficPolicyInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTrafficPolicyInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTrafficPolicyInstanceInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetTrafficPolicyInstanceInput) SetId(v string) *GetTrafficPolicyInstanceInput { + s.Id = &v + return s +} + +// A complex type that contains information about the resource record sets that +// Amazon Route 53 created based on a specified traffic policy. +type GetTrafficPolicyInstanceOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains settings for the traffic policy instance. + // + // TrafficPolicyInstance is a required field + TrafficPolicyInstance *TrafficPolicyInstance `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetTrafficPolicyInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrafficPolicyInstanceOutput) GoString() string { + return s.String() +} + +// SetTrafficPolicyInstance sets the TrafficPolicyInstance field's value. +func (s *GetTrafficPolicyInstanceOutput) SetTrafficPolicyInstance(v *TrafficPolicyInstance) *GetTrafficPolicyInstanceOutput { + s.TrafficPolicyInstance = v + return s +} + +// A complex type that contains the response information for the request. +type GetTrafficPolicyOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains settings for the specified traffic policy. + // + // TrafficPolicy is a required field + TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetTrafficPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrafficPolicyOutput) GoString() string { + return s.String() +} + +// SetTrafficPolicy sets the TrafficPolicy field's value. +func (s *GetTrafficPolicyOutput) SetTrafficPolicy(v *TrafficPolicy) *GetTrafficPolicyOutput { + s.TrafficPolicy = v + return s +} + +// A complex type that contains information about one health check that is associated +// with the current AWS account. +type HealthCheck struct { + _ struct{} `type:"structure"` + + // A unique string that you specified when you created the health check. + // + // CallerReference is a required field + CallerReference *string `min:"1" type:"string" required:"true"` + + // A complex type that contains information about the CloudWatch alarm that + // Amazon Route 53 is monitoring for this health check. + CloudWatchAlarmConfiguration *CloudWatchAlarmConfiguration `type:"structure"` + + // A complex type that contains detailed information about one health check. + // + // HealthCheckConfig is a required field + HealthCheckConfig *HealthCheckConfig `type:"structure" required:"true"` + + // The version of the health check. You can optionally pass this value in a + // call to UpdateHealthCheck to prevent overwriting another change to the health + // check. + // + // HealthCheckVersion is a required field + HealthCheckVersion *int64 `min:"1" type:"long" required:"true"` + + // The identifier that Amazon Route 53assigned to the health check when you + // created it. When you add or update a resource record set, you use this value + // to specify which health check to use. The value can be up to 64 characters + // long. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // If the health check was created by another service, the service that created + // the health check. When a health check is created by another service, you + // can't edit or delete it using Amazon Route 53. + LinkedService *LinkedService `type:"structure"` +} + +// 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() +} + +// SetCallerReference sets the CallerReference field's value. +func (s *HealthCheck) SetCallerReference(v string) *HealthCheck { + s.CallerReference = &v + return s +} + +// SetCloudWatchAlarmConfiguration sets the CloudWatchAlarmConfiguration field's value. +func (s *HealthCheck) SetCloudWatchAlarmConfiguration(v *CloudWatchAlarmConfiguration) *HealthCheck { + s.CloudWatchAlarmConfiguration = v + return s +} + +// SetHealthCheckConfig sets the HealthCheckConfig field's value. +func (s *HealthCheck) SetHealthCheckConfig(v *HealthCheckConfig) *HealthCheck { + s.HealthCheckConfig = v + return s +} + +// SetHealthCheckVersion sets the HealthCheckVersion field's value. +func (s *HealthCheck) SetHealthCheckVersion(v int64) *HealthCheck { + s.HealthCheckVersion = &v + return s +} + +// SetId sets the Id field's value. +func (s *HealthCheck) SetId(v string) *HealthCheck { + s.Id = &v + return s +} + +// SetLinkedService sets the LinkedService field's value. +func (s *HealthCheck) SetLinkedService(v *LinkedService) *HealthCheck { + s.LinkedService = v + return s +} + +// A complex type that contains information about the health check. +type HealthCheckConfig struct { + _ struct{} `type:"structure"` + + // A complex type that identifies the CloudWatch alarm that you want Amazon + // Route 53 health checkers to use to determine whether this health check is + // healthy. + AlarmIdentifier *AlarmIdentifier `type:"structure"` + + // (CALCULATED Health Checks Only) A complex type that contains one ChildHealthCheck + // element for each health check that you want to associate with a CALCULATED + // health check. + ChildHealthChecks []*string `locationNameList:"ChildHealthCheck" type:"list"` + + // Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName + // to the endpoint in the client_hello message during TLS negotiation. This + // allows the endpoint to respond to HTTPS health check requests with the applicable + // SSL/TLS certificate. + // + // Some endpoints require that HTTPS requests include the host name in the client_hello + // message. If you don't enable SNI, the status of the health check will be + // SSL alert handshake_failure. A health check can also have that status for + // other reasons. If SNI is enabled and you're still getting the error, check + // the SSL/TLS configuration on your endpoint and confirm that your certificate + // is valid. + // + // The SSL/TLS certificate on your endpoint includes a domain name in the Common + // Name field and possibly several more in the Subject Alternative Names field. + // One of the domain names in the certificate should match the value that you + // specify for FullyQualifiedDomainName. If the endpoint responds to the client_hello + // message with a certificate that does not include the domain name that you + // specified in FullyQualifiedDomainName, a health checker will retry the handshake. + // In the second attempt, the health checker will omit FullyQualifiedDomainName + // from the client_hello message. + EnableSNI *bool `type:"boolean"` + + // The number of consecutive health checks that an endpoint must pass or fail + // for Amazon Route 53 to change the current status of the endpoint from unhealthy + // to healthy or vice versa. For more information, see How Amazon Route 53 Determines + // Whether an Endpoint Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) + // in the Amazon Route 53 Developer Guide. + // + // If you don't specify a value for FailureThreshold, the default value is three + // health checks. + FailureThreshold *int64 `min:"1" type:"integer"` + + // Amazon Route 53 behavior depends on whether you specify a value for IPAddress. + // + // If you specify a value forIPAddress: + // + // Amazon Route 53 sends health check requests to the specified IPv4 or IPv6 + // address and passes the value of FullyQualifiedDomainName in the Host header + // for all health checks except TCP health checks. This is typically the fully + // qualified DNS name of the endpoint on which you want Amazon Route 53 to perform + // health checks. + // + // When Amazon Route 53 checks the health of an endpoint, here is how it constructs + // the Host header: + // + // * If you specify a value of 80 for Port and HTTP or HTTP_STR_MATCH for + // Type, Amazon Route 53 passes the value of FullyQualifiedDomainName to + // the endpoint in the Host header. + // + // * If you specify a value of 443 for Port and HTTPS or HTTPS_STR_MATCH + // for Type, Amazon Route 53 passes the value of FullyQualifiedDomainName + // to the endpoint in the Host header. + // + // * If you specify another value for Port and any value except TCP for Type, + // Amazon Route 53 passes FullyQualifiedDomainName:Port to the endpoint in + // the Host header. + // + // If you don't specify a value for FullyQualifiedDomainName, Amazon Route 53 + // substitutes the value of IPAddress in the Host header in each of the preceding + // cases. + // + // If you don't specify a value for IPAddress: + // + // Amazon Route 53 sends a DNS request to the domain that you specify for FullyQualifiedDomainName + // at the interval that you specify for RequestInterval. Using an IPv4 address + // that DNS returns, Amazon Route 53 then checks the health of the endpoint. + // + // If you don't specify a value for IPAddress, Amazon Route 53 uses only IPv4 + // to send health checks to the endpoint. If there's no resource record set + // with a type of A for the name that you specify for FullyQualifiedDomainName, + // the health check fails with a "DNS resolution failed" error. + // + // If you want to check the health of weighted, latency, or failover resource + // record sets and you choose to specify the endpoint only by FullyQualifiedDomainName, + // we recommend that you create a separate health check for each endpoint. For + // example, create a health check for each HTTP server that is serving content + // for www.example.com. For the value of FullyQualifiedDomainName, specify the + // domain name of the server (such as us-east-2-www.example.com), not the name + // of the resource record sets (www.example.com). + // + // In this configuration, if you create a health check for which the value of + // FullyQualifiedDomainName matches the name of the resource record sets and + // you then associate the health check with those resource record sets, health + // check results will be unpredictable. + // + // In addition, if the value that you specify for Type is HTTP, HTTPS, HTTP_STR_MATCH, + // or HTTPS_STR_MATCH, Amazon Route 53 passes the value of FullyQualifiedDomainName + // in the Host header, as it does when you specify a value for IPAddress. If + // the value of Type is TCP, Amazon Route 53 doesn't pass a Host header. + FullyQualifiedDomainName *string `type:"string"` + + // The number of child health checks that are associated with a CALCULATED health + // that Amazon Route 53 must consider healthy for the CALCULATED health check + // to be considered healthy. To specify the child health checks that you want + // to associate with a CALCULATED health check, use the HealthCheckConfig$ChildHealthChecks + // and HealthCheckConfig$ChildHealthChecks elements. + // + // Note the following: + // + // * If you specify a number greater than the number of child health checks, + // Amazon Route 53 always considers this health check to be unhealthy. + // + // * If you specify 0, Amazon Route 53 always considers this health check + // to be healthy. + HealthThreshold *int64 `type:"integer"` + + // The IPv4 or IPv6 IP address of the endpoint that you want Amazon Route 53 + // to perform health checks on. If you don't specify a value for IPAddress, + // Amazon Route 53 sends a DNS request to resolve the domain name that you specify + // in FullyQualifiedDomainName at the interval that you specify in RequestInterval. + // Using an IP address returned by DNS, Amazon Route 53 then checks the health + // of the endpoint. + // + // Use one of the following formats for the value of IPAddress: + // + // * IPv4 address: four values between 0 and 255, separated by periods (.), + // for example, 192.0.2.44. + // + // * IPv6 address: eight groups of four hexadecimal values, separated by + // colons (:), for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345. You + // can also shorten IPv6 addresses as described in RFC 5952, for example, + // 2001:db8:85a3::abcd:1:2345. + // + // If the endpoint is an EC2 instance, we recommend that you create an Elastic + // IP address, associate it with your EC2 instance, and specify the Elastic + // IP address for IPAddress. This ensures that the IP address of your instance + // will never change. + // + // For more information, see HealthCheckConfig$FullyQualifiedDomainName. + // + // Constraints: Amazon Route 53 can't check the health of endpoints for which + // the IP address is in local, private, non-routable, or multicast ranges. For + // more information about IP addresses for which you can't create health checks, + // see the following documents: + // + // * RFC 5735, Special Use IPv4 Addresses (https://tools.ietf.org/html/rfc5735) + // + // * RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space (https://tools.ietf.org/html/rfc6598) + // + // * RFC 5156, Special-Use IPv6 Addresses (https://tools.ietf.org/html/rfc5156) + // + // When the value of Type is CALCULATED or CLOUDWATCH_METRIC, omit IPAddress. + IPAddress *string `type:"string"` + + // When CloudWatch has insufficient data about the metric to determine the alarm + // state, the status that you want Amazon Route 53 to assign to the health check: + // + // * Healthy: Amazon Route 53 considers the health check to be healthy. + // + // * Unhealthy: Amazon Route 53 considers the health check to be unhealthy. + // + // * LastKnownStatus: Amazon Route 53 uses the status of the health check + // from the last time that CloudWatch had sufficient data to determine the + // alarm state. For new health checks that have no last known status, the + // default status for the health check is healthy. + InsufficientDataHealthStatus *string `type:"string" enum:"InsufficientDataHealthStatus"` + + // Specify whether you want Amazon Route 53 to invert the status of a health + // check, for example, to consider a health check unhealthy when it otherwise + // would be considered healthy. + Inverted *bool `type:"boolean"` + + // Specify whether you want Amazon Route 53 to measure the latency between health + // checkers in multiple AWS regions and your endpoint, and to display CloudWatch + // latency graphs on the Health Checks page in the Amazon Route 53 console. + // + // You can't change the value of MeasureLatency after you create a health check. + MeasureLatency *bool `type:"boolean"` + + // The port on the endpoint on which you want Amazon Route 53 to perform health + // checks. Specify a value for Port only when you specify a value for IPAddress. + Port *int64 `min:"1" type:"integer"` + + // A complex type that contains one Region element for each region from which + // you want Amazon Route 53 health checkers to check the specified endpoint. + // + // If you don't specify any regions, Amazon Route 53 health checkers automatically + // performs checks from all of the regions that are listed under Valid Values. + // + // If you update a health check to remove a region that has been performing + // health checks, Amazon Route 53 will briefly continue to perform checks from + // that region to ensure that some health checkers are always checking the endpoint + // (for example, if you replace three regions with four different regions). + Regions []*string `locationNameList:"Region" min:"3" type:"list"` + + // The number of seconds between the time that Amazon Route 53 gets a response + // from your endpoint and the time that it sends the next health check request. + // Each Amazon Route 53 health checker makes requests at this interval. + // + // You can't change the value of RequestInterval after you create a health check. + // + // If you don't specify a value for RequestInterval, the default value is 30 + // seconds. + RequestInterval *int64 `min:"10" type:"integer"` + + // The path, if any, that you want Amazon Route 53 to request when performing + // health checks. The path can be any value for which your endpoint will return + // an HTTP status code of 2xx or 3xx when the endpoint is healthy, for example, + // the file /docs/route53-health-check.html. + ResourcePath *string `type:"string"` + + // If the value of Type is HTTP_STR_MATCH or HTTP_STR_MATCH, the string that + // you want Amazon Route 53 to search for in the response body from the specified + // resource. If the string appears in the response body, Amazon Route 53 considers + // the resource healthy. + // + // Amazon Route 53 considers case when searching for SearchString in the response + // body. + SearchString *string `type:"string"` + + // The type of health check that you want to create, which indicates how Amazon + // Route 53 determines whether an endpoint is healthy. + // + // You can't change the value of Type after you create a health check. + // + // You can create the following types of health checks: + // + // * HTTP: Amazon Route 53 tries to establish a TCP connection. If successful, + // Amazon Route 53 submits an HTTP request and waits for an HTTP status code + // of 200 or greater and less than 400. + // + // * HTTPS: Amazon Route 53 tries to establish a TCP connection. If successful, + // Amazon Route 53 submits an HTTPS request and waits for an HTTP status + // code of 200 or greater and less than 400. + // + // If you specify HTTPS for the value of Type, the endpoint must support TLS + // v1.0 or later. + // + // * HTTP_STR_MATCH: Amazon Route 53 tries to establish a TCP connection. + // If successful, Amazon Route 53 submits an HTTP request and searches the + // first 5,120 bytes of the response body for the string that you specify + // in SearchString. + // + // * HTTPS_STR_MATCH: Amazon Route 53 tries to establish a TCP connection. + // If successful, Amazon Route 53 submits an HTTPS request and searches the + // first 5,120 bytes of the response body for the string that you specify + // in SearchString. + // + // * TCP: Amazon Route 53 tries to establish a TCP connection. + // + // * CLOUDWATCH_METRIC: The health check is associated with a CloudWatch + // alarm. If the state of the alarm is OK, the health check is considered + // healthy. If the state is ALARM, the health check is considered unhealthy. + // If CloudWatch doesn't have sufficient data to determine whether the state + // is OK or ALARM, the health check status depends on the setting for InsufficientDataHealthStatus: + // Healthy, Unhealthy, or LastKnownStatus. + // + // * CALCULATED: For health checks that monitor the status of other health + // checks, Amazon Route 53 adds up the number of health checks that Amazon + // Route 53 health checkers consider to be healthy and compares that number + // with the value of HealthThreshold. + // + // For more information, see How Amazon Route 53 Determines Whether an Endpoint + // Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) + // in the Amazon Route 53 Developer Guide. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"HealthCheckType"` +} + +// String returns the string representation +func (s HealthCheckConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HealthCheckConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HealthCheckConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HealthCheckConfig"} + if s.FailureThreshold != nil && *s.FailureThreshold < 1 { + invalidParams.Add(request.NewErrParamMinValue("FailureThreshold", 1)) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + if s.Regions != nil && len(s.Regions) < 3 { + invalidParams.Add(request.NewErrParamMinLen("Regions", 3)) + } + if s.RequestInterval != nil && *s.RequestInterval < 10 { + invalidParams.Add(request.NewErrParamMinValue("RequestInterval", 10)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.AlarmIdentifier != nil { + if err := s.AlarmIdentifier.Validate(); err != nil { + invalidParams.AddNested("AlarmIdentifier", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlarmIdentifier sets the AlarmIdentifier field's value. +func (s *HealthCheckConfig) SetAlarmIdentifier(v *AlarmIdentifier) *HealthCheckConfig { + s.AlarmIdentifier = v + return s +} + +// SetChildHealthChecks sets the ChildHealthChecks field's value. +func (s *HealthCheckConfig) SetChildHealthChecks(v []*string) *HealthCheckConfig { + s.ChildHealthChecks = v + return s +} + +// SetEnableSNI sets the EnableSNI field's value. +func (s *HealthCheckConfig) SetEnableSNI(v bool) *HealthCheckConfig { + s.EnableSNI = &v + return s +} + +// SetFailureThreshold sets the FailureThreshold field's value. +func (s *HealthCheckConfig) SetFailureThreshold(v int64) *HealthCheckConfig { + s.FailureThreshold = &v + return s +} + +// SetFullyQualifiedDomainName sets the FullyQualifiedDomainName field's value. +func (s *HealthCheckConfig) SetFullyQualifiedDomainName(v string) *HealthCheckConfig { + s.FullyQualifiedDomainName = &v + return s +} + +// SetHealthThreshold sets the HealthThreshold field's value. +func (s *HealthCheckConfig) SetHealthThreshold(v int64) *HealthCheckConfig { + s.HealthThreshold = &v + return s +} + +// SetIPAddress sets the IPAddress field's value. +func (s *HealthCheckConfig) SetIPAddress(v string) *HealthCheckConfig { + s.IPAddress = &v + return s +} + +// SetInsufficientDataHealthStatus sets the InsufficientDataHealthStatus field's value. +func (s *HealthCheckConfig) SetInsufficientDataHealthStatus(v string) *HealthCheckConfig { + s.InsufficientDataHealthStatus = &v + return s +} + +// SetInverted sets the Inverted field's value. +func (s *HealthCheckConfig) SetInverted(v bool) *HealthCheckConfig { + s.Inverted = &v + return s +} + +// SetMeasureLatency sets the MeasureLatency field's value. +func (s *HealthCheckConfig) SetMeasureLatency(v bool) *HealthCheckConfig { + s.MeasureLatency = &v + return s +} + +// SetPort sets the Port field's value. +func (s *HealthCheckConfig) SetPort(v int64) *HealthCheckConfig { + s.Port = &v + return s +} + +// SetRegions sets the Regions field's value. +func (s *HealthCheckConfig) SetRegions(v []*string) *HealthCheckConfig { + s.Regions = v + return s +} + +// SetRequestInterval sets the RequestInterval field's value. +func (s *HealthCheckConfig) SetRequestInterval(v int64) *HealthCheckConfig { + s.RequestInterval = &v + return s +} + +// SetResourcePath sets the ResourcePath field's value. +func (s *HealthCheckConfig) SetResourcePath(v string) *HealthCheckConfig { + s.ResourcePath = &v + return s +} + +// SetSearchString sets the SearchString field's value. +func (s *HealthCheckConfig) SetSearchString(v string) *HealthCheckConfig { + s.SearchString = &v + return s +} + +// SetType sets the Type field's value. +func (s *HealthCheckConfig) SetType(v string) *HealthCheckConfig { + s.Type = &v + return s +} + +// A complex type that contains the last failure reason as reported by one Amazon +// Route 53 health checker. +type HealthCheckObservation struct { + _ struct{} `type:"structure"` + + // The IP address of the Amazon Route 53 health checker that provided the failure + // reason in StatusReport. + IPAddress *string `type:"string"` + + // The region of the Amazon Route 53 health checker that provided the status + // in StatusReport. + Region *string `min:"1" type:"string" enum:"HealthCheckRegion"` + + // A complex type that contains the last failure reason as reported by one Amazon + // Route 53 health checker and the time of the failed health check. + StatusReport *StatusReport `type:"structure"` +} + +// String returns the string representation +func (s HealthCheckObservation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HealthCheckObservation) GoString() string { + return s.String() +} + +// SetIPAddress sets the IPAddress field's value. +func (s *HealthCheckObservation) SetIPAddress(v string) *HealthCheckObservation { + s.IPAddress = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *HealthCheckObservation) SetRegion(v string) *HealthCheckObservation { + s.Region = &v + return s +} + +// SetStatusReport sets the StatusReport field's value. +func (s *HealthCheckObservation) SetStatusReport(v *StatusReport) *HealthCheckObservation { + s.StatusReport = v + return s +} + +// A complex type that contains general information about the hosted zone. +type HostedZone struct { + _ struct{} `type:"structure"` + + // The value that you specified for CallerReference when you created the hosted + // zone. + // + // CallerReference is a required field + CallerReference *string `min:"1" type:"string" required:"true"` + + // A complex type that includes the Comment and PrivateZone elements. If you + // omitted the HostedZoneConfig and Comment elements from the request, the Config + // and Comment elements don't appear in the response. + Config *HostedZoneConfig `type:"structure"` + + // The ID that Amazon Route 53 assigned to the hosted zone when you created + // it. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // If the hosted zone was created by another service, the service that created + // the hosted zone. When a hosted zone is created by another service, you can't + // edit or delete it using Amazon Route 53. + LinkedService *LinkedService `type:"structure"` + + // The name of the domain. For public hosted zones, this is the name that you + // have registered with your DNS registrar. + // + // For information about how to specify characters other than a-z, 0-9, and + // - (hyphen) and how to specify internationalized domain names, see CreateHostedZone. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The number of resource record sets in the hosted zone. + ResourceRecordSetCount *int64 `type:"long"` +} + +// String returns the string representation +func (s HostedZone) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostedZone) GoString() string { + return s.String() +} + +// SetCallerReference sets the CallerReference field's value. +func (s *HostedZone) SetCallerReference(v string) *HostedZone { + s.CallerReference = &v + return s +} + +// SetConfig sets the Config field's value. +func (s *HostedZone) SetConfig(v *HostedZoneConfig) *HostedZone { + s.Config = v + return s +} + +// SetId sets the Id field's value. +func (s *HostedZone) SetId(v string) *HostedZone { + s.Id = &v + return s +} + +// SetLinkedService sets the LinkedService field's value. +func (s *HostedZone) SetLinkedService(v *LinkedService) *HostedZone { + s.LinkedService = v + return s +} + +// SetName sets the Name field's value. +func (s *HostedZone) SetName(v string) *HostedZone { + s.Name = &v + return s +} + +// SetResourceRecordSetCount sets the ResourceRecordSetCount field's value. +func (s *HostedZone) SetResourceRecordSetCount(v int64) *HostedZone { + s.ResourceRecordSetCount = &v + return s +} + +// A complex type that contains an optional comment about your hosted zone. +// If you don't want to specify a comment, omit both the HostedZoneConfig and +// Comment elements. +type HostedZoneConfig struct { + _ struct{} `type:"structure"` + + // Any comments that you want to include about the hosted zone. + Comment *string `type:"string"` + + // A value that indicates whether this is a private hosted zone. + PrivateZone *bool `type:"boolean"` +} + +// String returns the string representation +func (s HostedZoneConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostedZoneConfig) GoString() string { + return s.String() +} + +// SetComment sets the Comment field's value. +func (s *HostedZoneConfig) SetComment(v string) *HostedZoneConfig { + s.Comment = &v + return s +} + +// SetPrivateZone sets the PrivateZone field's value. +func (s *HostedZoneConfig) SetPrivateZone(v bool) *HostedZoneConfig { + s.PrivateZone = &v + return s +} + +// A complex type that contains the type of limit that you specified in the +// request and the current value for that limit. +type HostedZoneLimit struct { + _ struct{} `type:"structure"` + + // The limit that you requested. Valid values include the following: + // + // * MAX_RRSETS_BY_ZONE: The maximum number of records that you can create + // in the specified hosted zone. + // + // * MAX_VPCS_ASSOCIATED_BY_ZONE: The maximum number of Amazon VPCs that + // you can associate with the specified private hosted zone. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"HostedZoneLimitType"` + + // The current value for the limit that is specified by Type. + // + // Value is a required field + Value *int64 `min:"1" type:"long" required:"true"` +} + +// String returns the string representation +func (s HostedZoneLimit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostedZoneLimit) GoString() string { + return s.String() +} + +// SetType sets the Type field's value. +func (s *HostedZoneLimit) SetType(v string) *HostedZoneLimit { + s.Type = &v + return s +} + +// SetValue sets the Value field's value. +func (s *HostedZoneLimit) SetValue(v int64) *HostedZoneLimit { + s.Value = &v + return s +} + +// If a health check or hosted zone was created by another service, LinkedService +// is a complex type that describes the service that created the resource. When +// a resource is created by another service, you can't edit or delete it using +// Amazon Route 53. +type LinkedService struct { + _ struct{} `type:"structure"` + + // If the health check or hosted zone was created by another service, an optional + // description that can be provided by the other service. When a resource is + // created by another service, you can't edit or delete it using Amazon Route + // 53. + Description *string `type:"string"` + + // If the health check or hosted zone was created by another service, the service + // that created the resource. When a resource is created by another service, + // you can't edit or delete it using Amazon Route 53. + ServicePrincipal *string `type:"string"` +} + +// String returns the string representation +func (s LinkedService) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LinkedService) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *LinkedService) SetDescription(v string) *LinkedService { + s.Description = &v + return s +} + +// SetServicePrincipal sets the ServicePrincipal field's value. +func (s *LinkedService) SetServicePrincipal(v string) *LinkedService { + s.ServicePrincipal = &v + return s +} + +// A request to get a list of geographic locations that Amazon Route 53 supports +// for geolocation resource record sets. +type ListGeoLocationsInput struct { + _ struct{} `type:"structure"` + + // (Optional) The maximum number of geolocations to be included in the response + // body for this request. If more than MaxItems geolocations remain to be listed, + // then the value of the IsTruncated element in the response is true. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // The code for the continent with which you want to start listing locations + // that Amazon Route 53 supports for geolocation. If Amazon Route 53 has already + // returned a page or more of results, if IsTruncated is true, and if NextContinentCode + // from the previous response has a value, enter that value in StartContinentCode + // to return the next page of results. + // + // Include StartContinentCode only if you want to list continents. Don't include + // StartContinentCode when you're listing countries or countries with their + // subdivisions. + StartContinentCode *string `location:"querystring" locationName:"startcontinentcode" min:"2" type:"string"` + + // The code for the country with which you want to start listing locations that + // Amazon Route 53 supports for geolocation. If Amazon Route 53 has already + // returned a page or more of results, if IsTruncated is true, and if NextCountryCode + // from the previous response has a value, enter that value in StartCountryCode + // to return the next page of results. + // + // Amazon Route 53 uses the two-letter country codes that are specified in ISO + // standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + StartCountryCode *string `location:"querystring" locationName:"startcountrycode" min:"1" type:"string"` + + // The code for the subdivision (for example, state or province) with which + // you want to start listing locations that Amazon Route 53 supports for geolocation. + // If Amazon Route 53 has already returned a page or more of results, if IsTruncated + // is true, and if NextSubdivisionCode from the previous response has a value, + // enter that value in StartSubdivisionCode to return the next page of results. + // + // To list subdivisions of a country, you must include both StartCountryCode + // and StartSubdivisionCode. + StartSubdivisionCode *string `location:"querystring" locationName:"startsubdivisioncode" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGeoLocationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGeoLocationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGeoLocationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGeoLocationsInput"} + if s.StartContinentCode != nil && len(*s.StartContinentCode) < 2 { + invalidParams.Add(request.NewErrParamMinLen("StartContinentCode", 2)) + } + if s.StartCountryCode != nil && len(*s.StartCountryCode) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StartCountryCode", 1)) + } + if s.StartSubdivisionCode != nil && len(*s.StartSubdivisionCode) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StartSubdivisionCode", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListGeoLocationsInput) SetMaxItems(v string) *ListGeoLocationsInput { + s.MaxItems = &v + return s +} + +// SetStartContinentCode sets the StartContinentCode field's value. +func (s *ListGeoLocationsInput) SetStartContinentCode(v string) *ListGeoLocationsInput { + s.StartContinentCode = &v + return s +} + +// SetStartCountryCode sets the StartCountryCode field's value. +func (s *ListGeoLocationsInput) SetStartCountryCode(v string) *ListGeoLocationsInput { + s.StartCountryCode = &v + return s +} + +// SetStartSubdivisionCode sets the StartSubdivisionCode field's value. +func (s *ListGeoLocationsInput) SetStartSubdivisionCode(v string) *ListGeoLocationsInput { + s.StartSubdivisionCode = &v + return s +} + +// A complex type containing the response information for the request. +type ListGeoLocationsOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains one GeoLocationDetails element for each location + // that Amazon Route 53 supports for geolocation. + // + // GeoLocationDetailsList is a required field + GeoLocationDetailsList []*GeoLocationDetails `locationNameList:"GeoLocationDetails" type:"list" required:"true"` + + // A value that indicates whether more locations remain to be listed after the + // last location in this response. If so, the value of IsTruncated is true. + // To get more values, submit another request and include the values of NextContinentCode, + // NextCountryCode, and NextSubdivisionCode in the StartContinentCode, StartCountryCode, + // and StartSubdivisionCode, as applicable. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for MaxItems in the request. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, you can make a follow-up request to display more + // locations. Enter the value of NextContinentCode in the StartContinentCode + // parameter in another ListGeoLocations request. + NextContinentCode *string `min:"2" type:"string"` + + // If IsTruncated is true, you can make a follow-up request to display more + // locations. Enter the value of NextCountryCode in the StartCountryCode parameter + // in another ListGeoLocations request. + NextCountryCode *string `min:"1" type:"string"` + + // If IsTruncated is true, you can make a follow-up request to display more + // locations. Enter the value of NextSubdivisionCode in the StartSubdivisionCode + // parameter in another ListGeoLocations request. + NextSubdivisionCode *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGeoLocationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGeoLocationsOutput) GoString() string { + return s.String() +} + +// SetGeoLocationDetailsList sets the GeoLocationDetailsList field's value. +func (s *ListGeoLocationsOutput) SetGeoLocationDetailsList(v []*GeoLocationDetails) *ListGeoLocationsOutput { + s.GeoLocationDetailsList = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListGeoLocationsOutput) SetIsTruncated(v bool) *ListGeoLocationsOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListGeoLocationsOutput) SetMaxItems(v string) *ListGeoLocationsOutput { + s.MaxItems = &v + return s +} + +// SetNextContinentCode sets the NextContinentCode field's value. +func (s *ListGeoLocationsOutput) SetNextContinentCode(v string) *ListGeoLocationsOutput { + s.NextContinentCode = &v + return s +} + +// SetNextCountryCode sets the NextCountryCode field's value. +func (s *ListGeoLocationsOutput) SetNextCountryCode(v string) *ListGeoLocationsOutput { + s.NextCountryCode = &v + return s +} + +// SetNextSubdivisionCode sets the NextSubdivisionCode field's value. +func (s *ListGeoLocationsOutput) SetNextSubdivisionCode(v string) *ListGeoLocationsOutput { + s.NextSubdivisionCode = &v + return s +} + +// A request to retrieve a list of the health checks that are associated with +// the current AWS account. +type ListHealthChecksInput struct { + _ struct{} `type:"structure"` + + // If the value of IsTruncated in the previous response was true, you have more + // health checks. To get another group, submit another ListHealthChecks request. + // + // For the value of marker, specify the value of NextMarker from the previous + // response, which is the ID of the first health check that Amazon Route 53 + // will return if you submit another request. + // + // If the value of IsTruncated in the previous response was false, there are + // no more health checks to get. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The maximum number of health checks that you want ListHealthChecks to return + // in response to the current request. Amazon Route 53 returns a maximum of + // 100 items. If you set MaxItems to a value greater than 100, Amazon Route + // 53 returns only the first 100 health checks. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` +} + +// String returns the string representation +func (s ListHealthChecksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHealthChecksInput) GoString() string { + return s.String() +} + +// SetMarker sets the Marker field's value. +func (s *ListHealthChecksInput) SetMarker(v string) *ListHealthChecksInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHealthChecksInput) SetMaxItems(v string) *ListHealthChecksInput { + s.MaxItems = &v + return s +} + +// A complex type that contains the response to a ListHealthChecks request. +type ListHealthChecksOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains one HealthCheck element for each health check + // that is associated with the current AWS account. + // + // HealthChecks is a required field + HealthChecks []*HealthCheck `locationNameList:"HealthCheck" type:"list" required:"true"` + + // A flag that indicates whether there are more health checks to be listed. + // If the response was truncated, you can get the next group of health checks + // by submitting another ListHealthChecks request and specifying the value of + // NextMarker in the marker parameter. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // For the second and subsequent calls to ListHealthChecks, Marker is the value + // that you specified for the marker parameter in the previous request. + // + // Marker is a required field + Marker *string `type:"string" required:"true"` + + // The value that you specified for the maxitems parameter in the call to ListHealthChecks + // that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, the value of NextMarker identifies the first health + // check that Amazon Route 53 returns if you submit another ListHealthChecks + // request and specify the value of NextMarker in the marker parameter. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s ListHealthChecksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHealthChecksOutput) GoString() string { + return s.String() +} + +// SetHealthChecks sets the HealthChecks field's value. +func (s *ListHealthChecksOutput) SetHealthChecks(v []*HealthCheck) *ListHealthChecksOutput { + s.HealthChecks = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListHealthChecksOutput) SetIsTruncated(v bool) *ListHealthChecksOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListHealthChecksOutput) SetMarker(v string) *ListHealthChecksOutput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHealthChecksOutput) SetMaxItems(v string) *ListHealthChecksOutput { + s.MaxItems = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListHealthChecksOutput) SetNextMarker(v string) *ListHealthChecksOutput { + s.NextMarker = &v + return s +} + +// Retrieves a list of the public and private hosted zones that are associated +// with the current AWS account in ASCII order by domain name. +type ListHostedZonesByNameInput struct { + _ struct{} `type:"structure"` + + // (Optional) For your first request to ListHostedZonesByName, include the dnsname + // parameter only if you want to specify the name of the first hosted zone in + // the response. If you don't include the dnsname parameter, Amazon Route 53 + // returns all of the hosted zones that were created by the current AWS account, + // in ASCII order. For subsequent requests, include both dnsname and hostedzoneid + // parameters. For dnsname, specify the value of NextDNSName from the previous + // response. + DNSName *string `location:"querystring" locationName:"dnsname" type:"string"` + + // (Optional) For your first request to ListHostedZonesByName, do not include + // the hostedzoneid parameter. + // + // If you have more hosted zones than the value of maxitems, ListHostedZonesByName + // returns only the first maxitems hosted zones. To get the next group of maxitems + // hosted zones, submit another request to ListHostedZonesByName and include + // both dnsname and hostedzoneid parameters. For the value of hostedzoneid, + // specify the value of the NextHostedZoneId element from the previous response. + HostedZoneId *string `location:"querystring" locationName:"hostedzoneid" type:"string"` + + // The maximum number of hosted zones to be included in the response body for + // this request. If you have more than maxitems hosted zones, then the value + // of the IsTruncated element in the response is true, and the values of NextDNSName + // and NextHostedZoneId specify the first hosted zone in the next group of maxitems + // hosted zones. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` +} + +// String returns the string representation +func (s ListHostedZonesByNameInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHostedZonesByNameInput) GoString() string { + return s.String() +} + +// SetDNSName sets the DNSName field's value. +func (s *ListHostedZonesByNameInput) SetDNSName(v string) *ListHostedZonesByNameInput { + s.DNSName = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListHostedZonesByNameInput) SetHostedZoneId(v string) *ListHostedZonesByNameInput { + s.HostedZoneId = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHostedZonesByNameInput) SetMaxItems(v string) *ListHostedZonesByNameInput { + s.MaxItems = &v + return s +} + +// A complex type that contains the response information for the request. +type ListHostedZonesByNameOutput struct { + _ struct{} `type:"structure"` + + // For the second and subsequent calls to ListHostedZonesByName, DNSName is + // the value that you specified for the dnsname parameter in the request that + // produced the current response. + DNSName *string `type:"string"` + + // The ID that Amazon Route 53 assigned to the hosted zone when you created + // it. + HostedZoneId *string `type:"string"` + + // A complex type that contains general information about the hosted zone. + // + // HostedZones is a required field + HostedZones []*HostedZone `locationNameList:"HostedZone" type:"list" required:"true"` + + // A flag that indicates whether there are more hosted zones to be listed. If + // the response was truncated, you can get the next group of maxitems hosted + // zones by calling ListHostedZonesByName again and specifying the values of + // NextDNSName and NextHostedZoneId elements in the dnsname and hostedzoneid + // parameters. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for the maxitems parameter in the call to ListHostedZonesByName + // that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, the value of NextDNSName is the name of the first + // hosted zone in the next group of maxitems hosted zones. Call ListHostedZonesByName + // again and specify the value of NextDNSName and NextHostedZoneId in the dnsname + // and hostedzoneid parameters, respectively. + // + // This element is present only if IsTruncated is true. + NextDNSName *string `type:"string"` + + // If IsTruncated is true, the value of NextHostedZoneId identifies the first + // hosted zone in the next group of maxitems hosted zones. Call ListHostedZonesByName + // again and specify the value of NextDNSName and NextHostedZoneId in the dnsname + // and hostedzoneid parameters, respectively. + // + // This element is present only if IsTruncated is true. + NextHostedZoneId *string `type:"string"` +} + +// String returns the string representation +func (s ListHostedZonesByNameOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHostedZonesByNameOutput) GoString() string { + return s.String() +} + +// SetDNSName sets the DNSName field's value. +func (s *ListHostedZonesByNameOutput) SetDNSName(v string) *ListHostedZonesByNameOutput { + s.DNSName = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListHostedZonesByNameOutput) SetHostedZoneId(v string) *ListHostedZonesByNameOutput { + s.HostedZoneId = &v + return s +} + +// SetHostedZones sets the HostedZones field's value. +func (s *ListHostedZonesByNameOutput) SetHostedZones(v []*HostedZone) *ListHostedZonesByNameOutput { + s.HostedZones = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListHostedZonesByNameOutput) SetIsTruncated(v bool) *ListHostedZonesByNameOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHostedZonesByNameOutput) SetMaxItems(v string) *ListHostedZonesByNameOutput { + s.MaxItems = &v + return s +} + +// SetNextDNSName sets the NextDNSName field's value. +func (s *ListHostedZonesByNameOutput) SetNextDNSName(v string) *ListHostedZonesByNameOutput { + s.NextDNSName = &v + return s +} + +// SetNextHostedZoneId sets the NextHostedZoneId field's value. +func (s *ListHostedZonesByNameOutput) SetNextHostedZoneId(v string) *ListHostedZonesByNameOutput { + s.NextHostedZoneId = &v + return s +} + +// A request to retrieve a list of the public and private hosted zones that +// are associated with the current AWS account. +type ListHostedZonesInput struct { + _ struct{} `type:"structure"` + + // If you're using reusable delegation sets and you want to list all of the + // hosted zones that are associated with a reusable delegation set, specify + // the ID of that reusable delegation set. + DelegationSetId *string `location:"querystring" locationName:"delegationsetid" type:"string"` + + // If the value of IsTruncated in the previous response was true, you have more + // hosted zones. To get more hosted zones, submit another ListHostedZones request. + // + // For the value of marker, specify the value of NextMarker from the previous + // response, which is the ID of the first hosted zone that Amazon Route 53 will + // return if you submit another request. + // + // If the value of IsTruncated in the previous response was false, there are + // no more hosted zones to get. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // (Optional) The maximum number of hosted zones that you want Amazon Route + // 53 to return. If you have more than maxitems hosted zones, the value of IsTruncated + // in the response is true, and the value of NextMarker is the hosted zone ID + // of the first hosted zone that Amazon Route 53 will return if you submit another + // request. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` +} + +// String returns the string representation +func (s ListHostedZonesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHostedZonesInput) GoString() string { + return s.String() +} + +// SetDelegationSetId sets the DelegationSetId field's value. +func (s *ListHostedZonesInput) SetDelegationSetId(v string) *ListHostedZonesInput { + s.DelegationSetId = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListHostedZonesInput) SetMarker(v string) *ListHostedZonesInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHostedZonesInput) SetMaxItems(v string) *ListHostedZonesInput { + s.MaxItems = &v + return s +} + +type ListHostedZonesOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains general information about the hosted zone. + // + // HostedZones is a required field + HostedZones []*HostedZone `locationNameList:"HostedZone" type:"list" required:"true"` + + // A flag indicating whether there are more hosted zones to be listed. If the + // response was truncated, you can get more hosted zones by submitting another + // ListHostedZones request and specifying the value of NextMarker in the marker + // parameter. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // For the second and subsequent calls to ListHostedZones, Marker is the value + // that you specified for the marker parameter in the request that produced + // the current response. + // + // Marker is a required field + Marker *string `type:"string" required:"true"` + + // The value that you specified for the maxitems parameter in the call to ListHostedZones + // that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, the value of NextMarker identifies the first hosted + // zone in the next group of hosted zones. Submit another ListHostedZones request, + // and specify the value of NextMarker from the response in the marker parameter. + // + // This element is present only if IsTruncated is true. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s ListHostedZonesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHostedZonesOutput) GoString() string { + return s.String() +} + +// SetHostedZones sets the HostedZones field's value. +func (s *ListHostedZonesOutput) SetHostedZones(v []*HostedZone) *ListHostedZonesOutput { + s.HostedZones = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListHostedZonesOutput) SetIsTruncated(v bool) *ListHostedZonesOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListHostedZonesOutput) SetMarker(v string) *ListHostedZonesOutput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHostedZonesOutput) SetMaxItems(v string) *ListHostedZonesOutput { + s.MaxItems = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListHostedZonesOutput) SetNextMarker(v string) *ListHostedZonesOutput { + s.NextMarker = &v + return s +} + +type ListQueryLoggingConfigsInput struct { + _ struct{} `type:"structure"` + + // (Optional) If you want to list the query logging configuration that is associated + // with a hosted zone, specify the ID in HostedZoneId. + // + // If you don't specify a hosted zone ID, ListQueryLoggingConfigs returns all + // of the configurations that are associated with the current AWS account. + HostedZoneId *string `location:"querystring" locationName:"hostedzoneid" type:"string"` + + // (Optional) The maximum number of query logging configurations that you want + // Amazon Route 53 to return in response to the current request. If the current + // AWS account has more than MaxResults configurations, use the value of ListQueryLoggingConfigsResponse$NextToken + // in the response to get the next page of results. + // + // If you don't specify a value for MaxResults, Amazon Route 53 returns up to + // 100 configurations. + MaxResults *string `location:"querystring" locationName:"maxresults" type:"string"` + + // (Optional) If the current AWS account has more than MaxResults query logging + // configurations, use NextToken to get the second and subsequent pages of results. + // + // For the first ListQueryLoggingConfigs request, omit this value. + // + // For the second and subsequent requests, get the value of NextToken from the + // previous response and specify that value for NextToken in the request. + NextToken *string `location:"querystring" locationName:"nexttoken" type:"string"` +} + +// String returns the string representation +func (s ListQueryLoggingConfigsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueryLoggingConfigsInput) GoString() string { + return s.String() +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListQueryLoggingConfigsInput) SetHostedZoneId(v string) *ListQueryLoggingConfigsInput { + s.HostedZoneId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListQueryLoggingConfigsInput) SetMaxResults(v string) *ListQueryLoggingConfigsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListQueryLoggingConfigsInput) SetNextToken(v string) *ListQueryLoggingConfigsInput { + s.NextToken = &v + return s +} + +type ListQueryLoggingConfigsOutput struct { + _ struct{} `type:"structure"` + + // If a response includes the last of the query logging configurations that + // are associated with the current AWS account, NextToken doesn't appear in + // the response. + // + // If a response doesn't include the last of the configurations, you can get + // more configurations by submitting another ListQueryLoggingConfigs request. + // Get the value of NextToken that Amazon Route 53 returned in the previous + // response and include it in NextToken in the next request. + NextToken *string `type:"string"` + + // An array that contains one QueryLoggingConfig element for each configuration + // for DNS query logging that is associated with the current AWS account. + // + // QueryLoggingConfigs is a required field + QueryLoggingConfigs []*QueryLoggingConfig `locationNameList:"QueryLoggingConfig" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListQueryLoggingConfigsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueryLoggingConfigsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListQueryLoggingConfigsOutput) SetNextToken(v string) *ListQueryLoggingConfigsOutput { + s.NextToken = &v + return s +} + +// SetQueryLoggingConfigs sets the QueryLoggingConfigs field's value. +func (s *ListQueryLoggingConfigsOutput) SetQueryLoggingConfigs(v []*QueryLoggingConfig) *ListQueryLoggingConfigsOutput { + s.QueryLoggingConfigs = v + return s +} + +// A request for the resource record sets that are associated with a specified +// hosted zone. +type ListResourceRecordSetsInput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that contains the resource record sets that you + // want to list. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // (Optional) The maximum number of resource records sets to include in the + // response body for this request. If the response includes more than maxitems + // resource record sets, the value of the IsTruncated element in the response + // is true, and the values of the NextRecordName and NextRecordType elements + // in the response identify the first resource record set in the next group + // of maxitems resource record sets. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // Weighted resource record sets only: If results were truncated for a given + // DNS name and type, specify the value of NextRecordIdentifier from the previous + // response to get the next resource record set that has the current DNS name + // and type. + StartRecordIdentifier *string `location:"querystring" locationName:"identifier" min:"1" type:"string"` + + // The first name in the lexicographic ordering of resource record sets that + // you want to list. + StartRecordName *string `location:"querystring" locationName:"name" type:"string"` + + // The type of resource record set to begin the record listing from. + // + // Valid values for basic resource record sets: A | AAAA | CAA | CNAME | MX + // | NAPTR | NS | PTR | SOA | SPF | SRV | TXT + // + // Values for weighted, latency, geo, and failover resource record sets: A | + // AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT + // + // Values for alias resource record sets: + // + // * CloudFront distribution: A or AAAA + // + // * Elastic Beanstalk environment that has a regionalized subdomain: A + // + // * ELB load balancer: A | AAAA + // + // * Amazon S3 bucket: A + // + // * Another resource record set in this hosted zone: The type of the resource + // record set that the alias references. + // + // Constraint: Specifying type without specifying name returns an InvalidInput + // error. + StartRecordType *string `location:"querystring" locationName:"type" type:"string" enum:"RRType"` +} + +// String returns the string representation +func (s ListResourceRecordSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceRecordSetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourceRecordSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourceRecordSetsInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.StartRecordIdentifier != nil && len(*s.StartRecordIdentifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StartRecordIdentifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListResourceRecordSetsInput) SetHostedZoneId(v string) *ListResourceRecordSetsInput { + s.HostedZoneId = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListResourceRecordSetsInput) SetMaxItems(v string) *ListResourceRecordSetsInput { + s.MaxItems = &v + return s +} + +// SetStartRecordIdentifier sets the StartRecordIdentifier field's value. +func (s *ListResourceRecordSetsInput) SetStartRecordIdentifier(v string) *ListResourceRecordSetsInput { + s.StartRecordIdentifier = &v + return s +} + +// SetStartRecordName sets the StartRecordName field's value. +func (s *ListResourceRecordSetsInput) SetStartRecordName(v string) *ListResourceRecordSetsInput { + s.StartRecordName = &v + return s +} + +// SetStartRecordType sets the StartRecordType field's value. +func (s *ListResourceRecordSetsInput) SetStartRecordType(v string) *ListResourceRecordSetsInput { + s.StartRecordType = &v + return s +} + +// A complex type that contains list information for the resource record set. +type ListResourceRecordSetsOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether more resource record sets remain to be listed. + // If your results were truncated, you can make a follow-up pagination request + // by using the NextRecordName element. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The maximum number of records you requested. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // Weighted, latency, geolocation, and failover resource record sets only: If + // results were truncated for a given DNS name and type, the value of SetIdentifier + // for the next resource record set that has the current DNS name and type. + NextRecordIdentifier *string `min:"1" type:"string"` + + // If the results were truncated, the name of the next record in the list. + // + // This element is present only if IsTruncated is true. + NextRecordName *string `type:"string"` + + // If the results were truncated, the type of the next record in the list. + // + // This element is present only if IsTruncated is true. + NextRecordType *string `type:"string" enum:"RRType"` + + // Information about multiple resource record sets. + // + // ResourceRecordSets is a required field + ResourceRecordSets []*ResourceRecordSet `locationNameList:"ResourceRecordSet" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListResourceRecordSetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceRecordSetsOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListResourceRecordSetsOutput) SetIsTruncated(v bool) *ListResourceRecordSetsOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListResourceRecordSetsOutput) SetMaxItems(v string) *ListResourceRecordSetsOutput { + s.MaxItems = &v + return s +} + +// SetNextRecordIdentifier sets the NextRecordIdentifier field's value. +func (s *ListResourceRecordSetsOutput) SetNextRecordIdentifier(v string) *ListResourceRecordSetsOutput { + s.NextRecordIdentifier = &v + return s +} + +// SetNextRecordName sets the NextRecordName field's value. +func (s *ListResourceRecordSetsOutput) SetNextRecordName(v string) *ListResourceRecordSetsOutput { + s.NextRecordName = &v + return s +} + +// SetNextRecordType sets the NextRecordType field's value. +func (s *ListResourceRecordSetsOutput) SetNextRecordType(v string) *ListResourceRecordSetsOutput { + s.NextRecordType = &v + return s +} + +// SetResourceRecordSets sets the ResourceRecordSets field's value. +func (s *ListResourceRecordSetsOutput) SetResourceRecordSets(v []*ResourceRecordSet) *ListResourceRecordSetsOutput { + s.ResourceRecordSets = v + return s +} + +// A request to get a list of the reusable delegation sets that are associated +// with the current AWS account. +type ListReusableDelegationSetsInput struct { + _ struct{} `type:"structure"` + + // If the value of IsTruncated in the previous response was true, you have more + // reusable delegation sets. To get another group, submit another ListReusableDelegationSets + // request. + // + // For the value of marker, specify the value of NextMarker from the previous + // response, which is the ID of the first reusable delegation set that Amazon + // Route 53 will return if you submit another request. + // + // If the value of IsTruncated in the previous response was false, there are + // no more reusable delegation sets to get. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The number of reusable delegation sets that you want Amazon Route 53 to return + // in the response to this request. If you specify a value greater than 100, + // Amazon Route 53 returns only the first 100 reusable delegation sets. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` +} + +// String returns the string representation +func (s ListReusableDelegationSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListReusableDelegationSetsInput) GoString() string { + return s.String() +} + +// SetMarker sets the Marker field's value. +func (s *ListReusableDelegationSetsInput) SetMarker(v string) *ListReusableDelegationSetsInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListReusableDelegationSetsInput) SetMaxItems(v string) *ListReusableDelegationSetsInput { + s.MaxItems = &v + return s +} + +// A complex type that contains information about the reusable delegation sets +// that are associated with the current AWS account. +type ListReusableDelegationSetsOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains one DelegationSet element for each reusable + // delegation set that was created by the current AWS account. + // + // DelegationSets is a required field + DelegationSets []*DelegationSet `locationNameList:"DelegationSet" type:"list" required:"true"` + + // A flag that indicates whether there are more reusable delegation sets to + // be listed. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // For the second and subsequent calls to ListReusableDelegationSets, Marker + // is the value that you specified for the marker parameter in the request that + // produced the current response. + // + // Marker is a required field + Marker *string `type:"string" required:"true"` + + // The value that you specified for the maxitems parameter in the call to ListReusableDelegationSets + // that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, the value of NextMarker identifies the next reusable + // delegation set that Amazon Route 53 will return if you submit another ListReusableDelegationSets + // request and specify the value of NextMarker in the marker parameter. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s ListReusableDelegationSetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListReusableDelegationSetsOutput) GoString() string { + return s.String() +} + +// SetDelegationSets sets the DelegationSets field's value. +func (s *ListReusableDelegationSetsOutput) SetDelegationSets(v []*DelegationSet) *ListReusableDelegationSetsOutput { + s.DelegationSets = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListReusableDelegationSetsOutput) SetIsTruncated(v bool) *ListReusableDelegationSetsOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListReusableDelegationSetsOutput) SetMarker(v string) *ListReusableDelegationSetsOutput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListReusableDelegationSetsOutput) SetMaxItems(v string) *ListReusableDelegationSetsOutput { + s.MaxItems = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListReusableDelegationSetsOutput) SetNextMarker(v string) *ListReusableDelegationSetsOutput { + s.NextMarker = &v + return s +} + +// A complex type containing information about a request for a list of the tags +// that are associated with an individual resource. +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The ID of the resource for which you want to retrieve tags. + // + // ResourceId is a required field + ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` + + // The type of the resource. + // + // * The resource type for health checks is healthcheck. + // + // * The resource type for hosted zones is hostedzone. + // + // ResourceType is a required field + ResourceType *string `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"TagResourceType"` +} + +// String returns the string representation +func (s ListTagsForResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceId sets the ResourceId field's value. +func (s *ListTagsForResourceInput) SetResourceId(v string) *ListTagsForResourceInput { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListTagsForResourceInput) SetResourceType(v string) *ListTagsForResourceInput { + s.ResourceType = &v + return s +} + +// A complex type that contains information about the health checks or hosted +// zones for which you want to list tags. +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // A ResourceTagSet containing tags associated with the specified resource. + // + // ResourceTagSet is a required field + ResourceTagSet *ResourceTagSet `type:"structure" required:"true"` +} + +// String returns the string representation +func (s ListTagsForResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceOutput) GoString() string { + return s.String() +} + +// SetResourceTagSet sets the ResourceTagSet field's value. +func (s *ListTagsForResourceOutput) SetResourceTagSet(v *ResourceTagSet) *ListTagsForResourceOutput { + s.ResourceTagSet = v + return s +} + +// A complex type that contains information about the health checks or hosted +// zones for which you want to list tags. +type ListTagsForResourcesInput struct { + _ struct{} `locationName:"ListTagsForResourcesRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A complex type that contains the ResourceId element for each resource for + // which you want to get a list of tags. + // + // ResourceIds is a required field + ResourceIds []*string `locationNameList:"ResourceId" min:"1" type:"list" required:"true"` + + // The type of the resources. + // + // * The resource type for health checks is healthcheck. + // + // * The resource type for hosted zones is hostedzone. + // + // ResourceType is a required field + ResourceType *string `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"TagResourceType"` +} + +// String returns the string representation +func (s ListTagsForResourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTagsForResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourcesInput"} + if s.ResourceIds == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIds")) + } + if s.ResourceIds != nil && len(s.ResourceIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceIds", 1)) + } + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceIds sets the ResourceIds field's value. +func (s *ListTagsForResourcesInput) SetResourceIds(v []*string) *ListTagsForResourcesInput { + s.ResourceIds = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListTagsForResourcesInput) SetResourceType(v string) *ListTagsForResourcesInput { + s.ResourceType = &v + return s +} + +// A complex type containing tags for the specified resources. +type ListTagsForResourcesOutput struct { + _ struct{} `type:"structure"` + + // A list of ResourceTagSets containing tags associated with the specified resources. + // + // ResourceTagSets is a required field + ResourceTagSets []*ResourceTagSet `locationNameList:"ResourceTagSet" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTagsForResourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourcesOutput) GoString() string { + return s.String() +} + +// SetResourceTagSets sets the ResourceTagSets field's value. +func (s *ListTagsForResourcesOutput) SetResourceTagSets(v []*ResourceTagSet) *ListTagsForResourcesOutput { + s.ResourceTagSets = v + return s +} + +// A complex type that contains the information about the request to list the +// traffic policies that are associated with the current AWS account. +type ListTrafficPoliciesInput struct { + _ struct{} `type:"structure"` + + // (Optional) The maximum number of traffic policies that you want Amazon Route + // 53 to return in response to this request. If you have more than MaxItems + // traffic policies, the value of IsTruncated in the response is true, and the + // value of TrafficPolicyIdMarker is the ID of the first traffic policy that + // Amazon Route 53 will return if you submit another request. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // (Conditional) For your first request to ListTrafficPolicies, don't include + // the TrafficPolicyIdMarker parameter. + // + // If you have more traffic policies than the value of MaxItems, ListTrafficPolicies + // returns only the first MaxItems traffic policies. To get the next group of + // policies, submit another request to ListTrafficPolicies. For the value of + // TrafficPolicyIdMarker, specify the value of TrafficPolicyIdMarker that was + // returned in the previous response. + TrafficPolicyIdMarker *string `location:"querystring" locationName:"trafficpolicyid" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListTrafficPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTrafficPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrafficPoliciesInput"} + if s.TrafficPolicyIdMarker != nil && len(*s.TrafficPolicyIdMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyIdMarker", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPoliciesInput) SetMaxItems(v string) *ListTrafficPoliciesInput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyIdMarker sets the TrafficPolicyIdMarker field's value. +func (s *ListTrafficPoliciesInput) SetTrafficPolicyIdMarker(v string) *ListTrafficPoliciesInput { + s.TrafficPolicyIdMarker = &v + return s +} + +// A complex type that contains the response information for the request. +type ListTrafficPoliciesOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more traffic policies to be listed. + // If the response was truncated, you can get the next group of traffic policies + // by submitting another ListTrafficPolicies request and specifying the value + // of TrafficPolicyIdMarker in the TrafficPolicyIdMarker request parameter. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for the MaxItems parameter in the ListTrafficPolicies + // request that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If the value of IsTruncated is true, TrafficPolicyIdMarker is the ID of the + // first traffic policy in the next group of MaxItems traffic policies. + // + // TrafficPolicyIdMarker is a required field + TrafficPolicyIdMarker *string `min:"1" type:"string" required:"true"` + + // A list that contains one TrafficPolicySummary element for each traffic policy + // that was created by the current AWS account. + // + // TrafficPolicySummaries is a required field + TrafficPolicySummaries []*TrafficPolicySummary `locationNameList:"TrafficPolicySummary" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTrafficPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPoliciesOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListTrafficPoliciesOutput) SetIsTruncated(v bool) *ListTrafficPoliciesOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPoliciesOutput) SetMaxItems(v string) *ListTrafficPoliciesOutput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyIdMarker sets the TrafficPolicyIdMarker field's value. +func (s *ListTrafficPoliciesOutput) SetTrafficPolicyIdMarker(v string) *ListTrafficPoliciesOutput { + s.TrafficPolicyIdMarker = &v + return s +} + +// SetTrafficPolicySummaries sets the TrafficPolicySummaries field's value. +func (s *ListTrafficPoliciesOutput) SetTrafficPolicySummaries(v []*TrafficPolicySummary) *ListTrafficPoliciesOutput { + s.TrafficPolicySummaries = v + return s +} + +// A request for the traffic policy instances that you created in a specified +// hosted zone. +type ListTrafficPolicyInstancesByHostedZoneInput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that you want to list traffic policy instances + // for. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"querystring" locationName:"id" type:"string" required:"true"` + + // The maximum number of traffic policy instances to be included in the response + // body for this request. If you have more than MaxItems traffic policy instances, + // the value of the IsTruncated element in the response is true, and the values + // of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker + // represent the first traffic policy instance that Amazon Route 53 will return + // if you submit another request. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // If the value of IsTruncated in the previous response is true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename, + // specify the value of TrafficPolicyInstanceNameMarker from the previous response, + // which is the name of the first traffic policy instance in the next group + // of traffic policy instances. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + TrafficPolicyInstanceNameMarker *string `location:"querystring" locationName:"trafficpolicyinstancename" type:"string"` + + // If the value of IsTruncated in the previous response is true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype, + // specify the value of TrafficPolicyInstanceTypeMarker from the previous response, + // which is the type of the first traffic policy instance in the next group + // of traffic policy instances. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + TrafficPolicyInstanceTypeMarker *string `location:"querystring" locationName:"trafficpolicyinstancetype" type:"string" enum:"RRType"` +} + +// String returns the string representation +func (s ListTrafficPolicyInstancesByHostedZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyInstancesByHostedZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTrafficPolicyInstancesByHostedZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrafficPolicyInstancesByHostedZoneInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetHostedZoneId(v string) *ListTrafficPolicyInstancesByHostedZoneInput { + s.HostedZoneId = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetMaxItems(v string) *ListTrafficPolicyInstancesByHostedZoneInput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByHostedZoneInput { + s.TrafficPolicyInstanceNameMarker = &v + return s +} + +// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByHostedZoneInput { + s.TrafficPolicyInstanceTypeMarker = &v + return s +} + +// A complex type that contains the response information for the request. +type ListTrafficPolicyInstancesByHostedZoneOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more traffic policy instances to + // be listed. If the response was truncated, you can get the next group of traffic + // policy instances by submitting another ListTrafficPolicyInstancesByHostedZone + // request and specifying the values of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, + // and TrafficPolicyInstanceTypeMarker in the corresponding request parameters. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for the MaxItems parameter in the ListTrafficPolicyInstancesByHostedZone + // request that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the + // first traffic policy instance in the next group of traffic policy instances. + TrafficPolicyInstanceNameMarker *string `type:"string"` + + // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of + // the resource record sets that are associated with the first traffic policy + // instance in the next group of traffic policy instances. + TrafficPolicyInstanceTypeMarker *string `type:"string" enum:"RRType"` + + // A list that contains one TrafficPolicyInstance element for each traffic policy + // instance that matches the elements in the request. + // + // TrafficPolicyInstances is a required field + TrafficPolicyInstances []*TrafficPolicyInstance `locationNameList:"TrafficPolicyInstance" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTrafficPolicyInstancesByHostedZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyInstancesByHostedZoneOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetIsTruncated(v bool) *ListTrafficPolicyInstancesByHostedZoneOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetMaxItems(v string) *ListTrafficPolicyInstancesByHostedZoneOutput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByHostedZoneOutput { + s.TrafficPolicyInstanceNameMarker = &v + return s +} + +// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByHostedZoneOutput { + s.TrafficPolicyInstanceTypeMarker = &v + return s +} + +// SetTrafficPolicyInstances sets the TrafficPolicyInstances field's value. +func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetTrafficPolicyInstances(v []*TrafficPolicyInstance) *ListTrafficPolicyInstancesByHostedZoneOutput { + s.TrafficPolicyInstances = v + return s +} + +// A complex type that contains the information about the request to list your +// traffic policy instances. +type ListTrafficPolicyInstancesByPolicyInput struct { + _ struct{} `type:"structure"` + + // If the value of IsTruncated in the previous response was true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstancesByPolicy request. + // + // For the value of hostedzoneid, specify the value of HostedZoneIdMarker from + // the previous response, which is the hosted zone ID of the first traffic policy + // instance that Amazon Route 53 will return if you submit another request. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + HostedZoneIdMarker *string `location:"querystring" locationName:"hostedzoneid" type:"string"` + + // The maximum number of traffic policy instances to be included in the response + // body for this request. If you have more than MaxItems traffic policy instances, + // the value of the IsTruncated element in the response is true, and the values + // of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker + // represent the first traffic policy instance that Amazon Route 53 will return + // if you submit another request. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // The ID of the traffic policy for which you want to list traffic policy instances. + // + // TrafficPolicyId is a required field + TrafficPolicyId *string `location:"querystring" locationName:"id" min:"1" type:"string" required:"true"` + + // If the value of IsTruncated in the previous response was true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstancesByPolicy request. + // + // For the value of trafficpolicyinstancename, specify the value of TrafficPolicyInstanceNameMarker + // from the previous response, which is the name of the first traffic policy + // instance that Amazon Route 53 will return if you submit another request. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + TrafficPolicyInstanceNameMarker *string `location:"querystring" locationName:"trafficpolicyinstancename" type:"string"` + + // If the value of IsTruncated in the previous response was true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstancesByPolicy request. + // + // For the value of trafficpolicyinstancetype, specify the value of TrafficPolicyInstanceTypeMarker + // from the previous response, which is the name of the first traffic policy + // instance that Amazon Route 53 will return if you submit another request. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + TrafficPolicyInstanceTypeMarker *string `location:"querystring" locationName:"trafficpolicyinstancetype" type:"string" enum:"RRType"` + + // The version of the traffic policy for which you want to list traffic policy + // instances. The version must be associated with the traffic policy that is + // specified by TrafficPolicyId. + // + // TrafficPolicyVersion is a required field + TrafficPolicyVersion *int64 `location:"querystring" locationName:"version" min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s ListTrafficPolicyInstancesByPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyInstancesByPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTrafficPolicyInstancesByPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrafficPolicyInstancesByPolicyInput"} + if s.TrafficPolicyId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficPolicyId")) + } + if s.TrafficPolicyId != nil && len(*s.TrafficPolicyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyId", 1)) + } + if s.TrafficPolicyVersion == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficPolicyVersion")) + } + if s.TrafficPolicyVersion != nil && *s.TrafficPolicyVersion < 1 { + invalidParams.Add(request.NewErrParamMinValue("TrafficPolicyVersion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. +func (s *ListTrafficPolicyInstancesByPolicyInput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesByPolicyInput { + s.HostedZoneIdMarker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyInstancesByPolicyInput) SetMaxItems(v string) *ListTrafficPolicyInstancesByPolicyInput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyId sets the TrafficPolicyId field's value. +func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyId(v string) *ListTrafficPolicyInstancesByPolicyInput { + s.TrafficPolicyId = &v + return s +} + +// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. +func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByPolicyInput { + s.TrafficPolicyInstanceNameMarker = &v + return s +} + +// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. +func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByPolicyInput { + s.TrafficPolicyInstanceTypeMarker = &v + return s +} + +// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. +func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyVersion(v int64) *ListTrafficPolicyInstancesByPolicyInput { + s.TrafficPolicyVersion = &v + return s +} + +// A complex type that contains the response information for the request. +type ListTrafficPolicyInstancesByPolicyOutput struct { + _ struct{} `type:"structure"` + + // If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of + // the first traffic policy instance in the next group of traffic policy instances. + HostedZoneIdMarker *string `type:"string"` + + // A flag that indicates whether there are more traffic policy instances to + // be listed. If the response was truncated, you can get the next group of traffic + // policy instances by calling ListTrafficPolicyInstancesByPolicy again and + // specifying the values of the HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, + // and TrafficPolicyInstanceTypeMarker elements in the corresponding request + // parameters. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for the MaxItems parameter in the call to ListTrafficPolicyInstancesByPolicy + // that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the + // first traffic policy instance in the next group of MaxItems traffic policy + // instances. + TrafficPolicyInstanceNameMarker *string `type:"string"` + + // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of + // the resource record sets that are associated with the first traffic policy + // instance in the next group of MaxItems traffic policy instances. + TrafficPolicyInstanceTypeMarker *string `type:"string" enum:"RRType"` + + // A list that contains one TrafficPolicyInstance element for each traffic policy + // instance that matches the elements in the request. + // + // TrafficPolicyInstances is a required field + TrafficPolicyInstances []*TrafficPolicyInstance `locationNameList:"TrafficPolicyInstance" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTrafficPolicyInstancesByPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyInstancesByPolicyOutput) GoString() string { + return s.String() +} + +// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. +func (s *ListTrafficPolicyInstancesByPolicyOutput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesByPolicyOutput { + s.HostedZoneIdMarker = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListTrafficPolicyInstancesByPolicyOutput) SetIsTruncated(v bool) *ListTrafficPolicyInstancesByPolicyOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyInstancesByPolicyOutput) SetMaxItems(v string) *ListTrafficPolicyInstancesByPolicyOutput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. +func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByPolicyOutput { + s.TrafficPolicyInstanceNameMarker = &v + return s +} + +// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. +func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByPolicyOutput { + s.TrafficPolicyInstanceTypeMarker = &v + return s +} + +// SetTrafficPolicyInstances sets the TrafficPolicyInstances field's value. +func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstances(v []*TrafficPolicyInstance) *ListTrafficPolicyInstancesByPolicyOutput { + s.TrafficPolicyInstances = v + return s +} + +// A request to get information about the traffic policy instances that you +// created by using the current AWS account. +type ListTrafficPolicyInstancesInput struct { + _ struct{} `type:"structure"` + + // If the value of IsTruncated in the previous response was true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstances request. For the value of HostedZoneId, specify + // the value of HostedZoneIdMarker from the previous response, which is the + // hosted zone ID of the first traffic policy instance in the next group of + // traffic policy instances. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + HostedZoneIdMarker *string `location:"querystring" locationName:"hostedzoneid" type:"string"` + + // The maximum number of traffic policy instances that you want Amazon Route + // 53 to return in response to a ListTrafficPolicyInstances request. If you + // have more than MaxItems traffic policy instances, the value of the IsTruncated + // element in the response is true, and the values of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, + // and TrafficPolicyInstanceTypeMarker represent the first traffic policy instance + // in the next group of MaxItems traffic policy instances. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // If the value of IsTruncated in the previous response was true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename, + // specify the value of TrafficPolicyInstanceNameMarker from the previous response, + // which is the name of the first traffic policy instance in the next group + // of traffic policy instances. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + TrafficPolicyInstanceNameMarker *string `location:"querystring" locationName:"trafficpolicyinstancename" type:"string"` + + // If the value of IsTruncated in the previous response was true, you have more + // traffic policy instances. To get more traffic policy instances, submit another + // ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype, + // specify the value of TrafficPolicyInstanceTypeMarker from the previous response, + // which is the type of the first traffic policy instance in the next group + // of traffic policy instances. + // + // If the value of IsTruncated in the previous response was false, there are + // no more traffic policy instances to get. + TrafficPolicyInstanceTypeMarker *string `location:"querystring" locationName:"trafficpolicyinstancetype" type:"string" enum:"RRType"` +} + +// String returns the string representation +func (s ListTrafficPolicyInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyInstancesInput) GoString() string { + return s.String() +} + +// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. +func (s *ListTrafficPolicyInstancesInput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesInput { + s.HostedZoneIdMarker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyInstancesInput) SetMaxItems(v string) *ListTrafficPolicyInstancesInput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. +func (s *ListTrafficPolicyInstancesInput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesInput { + s.TrafficPolicyInstanceNameMarker = &v + return s +} + +// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. +func (s *ListTrafficPolicyInstancesInput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesInput { + s.TrafficPolicyInstanceTypeMarker = &v + return s +} + +// A complex type that contains the response information for the request. +type ListTrafficPolicyInstancesOutput struct { + _ struct{} `type:"structure"` + + // If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of + // the first traffic policy instance that Amazon Route 53 will return if you + // submit another ListTrafficPolicyInstances request. + HostedZoneIdMarker *string `type:"string"` + + // A flag that indicates whether there are more traffic policy instances to + // be listed. If the response was truncated, you can get more traffic policy + // instances by calling ListTrafficPolicyInstances again and specifying the + // values of the HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker + // in the corresponding request parameters. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for the MaxItems parameter in the call to ListTrafficPolicyInstances + // that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the + // first traffic policy instance that Amazon Route 53 will return if you submit + // another ListTrafficPolicyInstances request. + TrafficPolicyInstanceNameMarker *string `type:"string"` + + // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of + // the resource record sets that are associated with the first traffic policy + // instance that Amazon Route 53 will return if you submit another ListTrafficPolicyInstances + // request. + TrafficPolicyInstanceTypeMarker *string `type:"string" enum:"RRType"` + + // A list that contains one TrafficPolicyInstance element for each traffic policy + // instance that matches the elements in the request. + // + // TrafficPolicyInstances is a required field + TrafficPolicyInstances []*TrafficPolicyInstance `locationNameList:"TrafficPolicyInstance" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTrafficPolicyInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyInstancesOutput) GoString() string { + return s.String() +} + +// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. +func (s *ListTrafficPolicyInstancesOutput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesOutput { + s.HostedZoneIdMarker = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListTrafficPolicyInstancesOutput) SetIsTruncated(v bool) *ListTrafficPolicyInstancesOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyInstancesOutput) SetMaxItems(v string) *ListTrafficPolicyInstancesOutput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. +func (s *ListTrafficPolicyInstancesOutput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesOutput { + s.TrafficPolicyInstanceNameMarker = &v + return s +} + +// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. +func (s *ListTrafficPolicyInstancesOutput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesOutput { + s.TrafficPolicyInstanceTypeMarker = &v + return s +} + +// SetTrafficPolicyInstances sets the TrafficPolicyInstances field's value. +func (s *ListTrafficPolicyInstancesOutput) SetTrafficPolicyInstances(v []*TrafficPolicyInstance) *ListTrafficPolicyInstancesOutput { + s.TrafficPolicyInstances = v + return s +} + +// A complex type that contains the information about the request to list your +// traffic policies. +type ListTrafficPolicyVersionsInput struct { + _ struct{} `type:"structure"` + + // Specify the value of Id of the traffic policy for which you want to list + // all versions. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` + + // The maximum number of traffic policy versions that you want Amazon Route + // 53 to include in the response body for this request. If the specified traffic + // policy has more than MaxItems versions, the value of IsTruncated in the response + // is true, and the value of the TrafficPolicyVersionMarker element is the ID + // of the first version that Amazon Route 53 will return if you submit another + // request. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // For your first request to ListTrafficPolicyVersions, don't include the TrafficPolicyVersionMarker + // parameter. + // + // If you have more traffic policy versions than the value of MaxItems, ListTrafficPolicyVersions + // returns only the first group of MaxItems versions. To get more traffic policy + // versions, submit another ListTrafficPolicyVersions request. For the value + // of TrafficPolicyVersionMarker, specify the value of TrafficPolicyVersionMarker + // in the previous response. + TrafficPolicyVersionMarker *string `location:"querystring" locationName:"trafficpolicyversion" type:"string"` +} + +// String returns the string representation +func (s ListTrafficPolicyVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTrafficPolicyVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrafficPolicyVersionsInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *ListTrafficPolicyVersionsInput) SetId(v string) *ListTrafficPolicyVersionsInput { + s.Id = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyVersionsInput) SetMaxItems(v string) *ListTrafficPolicyVersionsInput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicyVersionMarker sets the TrafficPolicyVersionMarker field's value. +func (s *ListTrafficPolicyVersionsInput) SetTrafficPolicyVersionMarker(v string) *ListTrafficPolicyVersionsInput { + s.TrafficPolicyVersionMarker = &v + return s +} + +// A complex type that contains the response information for the request. +type ListTrafficPolicyVersionsOutput struct { + _ struct{} `type:"structure"` + + // A flag that indicates whether there are more traffic policies to be listed. + // If the response was truncated, you can get the next group of traffic policies + // by submitting another ListTrafficPolicyVersions request and specifying the + // value of NextMarker in the marker parameter. + // + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // The value that you specified for the maxitems parameter in the ListTrafficPolicyVersions + // request that produced the current response. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // A list that contains one TrafficPolicy element for each traffic policy version + // that is associated with the specified traffic policy. + // + // TrafficPolicies is a required field + TrafficPolicies []*TrafficPolicy `locationNameList:"TrafficPolicy" type:"list" required:"true"` + + // If IsTruncated is true, the value of TrafficPolicyVersionMarker identifies + // the first traffic policy that Amazon Route 53 will return if you submit another + // request. Call ListTrafficPolicyVersions again and specify the value of TrafficPolicyVersionMarker + // in the TrafficPolicyVersionMarker request parameter. + // + // This element is present only if IsTruncated is true. + // + // TrafficPolicyVersionMarker is a required field + TrafficPolicyVersionMarker *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTrafficPolicyVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrafficPolicyVersionsOutput) GoString() string { + return s.String() +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListTrafficPolicyVersionsOutput) SetIsTruncated(v bool) *ListTrafficPolicyVersionsOutput { + s.IsTruncated = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListTrafficPolicyVersionsOutput) SetMaxItems(v string) *ListTrafficPolicyVersionsOutput { + s.MaxItems = &v + return s +} + +// SetTrafficPolicies sets the TrafficPolicies field's value. +func (s *ListTrafficPolicyVersionsOutput) SetTrafficPolicies(v []*TrafficPolicy) *ListTrafficPolicyVersionsOutput { + s.TrafficPolicies = v + return s +} + +// SetTrafficPolicyVersionMarker sets the TrafficPolicyVersionMarker field's value. +func (s *ListTrafficPolicyVersionsOutput) SetTrafficPolicyVersionMarker(v string) *ListTrafficPolicyVersionsOutput { + s.TrafficPolicyVersionMarker = &v + return s +} + +// A complex type that contains information about that can be associated with +// your hosted zone. +type ListVPCAssociationAuthorizationsInput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone for which you want a list of VPCs that can be associated + // with the hosted zone. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` + + // Optional: An integer that specifies the maximum number of VPCs that you want + // Amazon Route 53 to return. If you don't specify a value for MaxResults, Amazon + // Route 53 returns up to 50 VPCs per page. + MaxResults *string `location:"querystring" locationName:"maxresults" type:"string"` + + // Optional: If a response includes a NextToken element, there are more VPCs + // that can be associated with the specified hosted zone. To get the next page + // of results, submit another request, and include the value of NextToken from + // the response in the nexttoken parameter in another ListVPCAssociationAuthorizations + // request. + NextToken *string `location:"querystring" locationName:"nexttoken" type:"string"` +} + +// String returns the string representation +func (s ListVPCAssociationAuthorizationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListVPCAssociationAuthorizationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListVPCAssociationAuthorizationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListVPCAssociationAuthorizationsInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListVPCAssociationAuthorizationsInput) SetHostedZoneId(v string) *ListVPCAssociationAuthorizationsInput { + s.HostedZoneId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListVPCAssociationAuthorizationsInput) SetMaxResults(v string) *ListVPCAssociationAuthorizationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListVPCAssociationAuthorizationsInput) SetNextToken(v string) *ListVPCAssociationAuthorizationsInput { + s.NextToken = &v + return s +} + +// A complex type that contains the response information for the request. +type ListVPCAssociationAuthorizationsOutput struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that you can associate the listed VPCs with. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` + + // When the response includes a NextToken element, there are more VPCs that + // can be associated with the specified hosted zone. To get the next page of + // VPCs, submit another ListVPCAssociationAuthorizations request, and include + // the value of the NextToken element from the response in the nexttoken request + // parameter. + NextToken *string `type:"string"` + + // The list of VPCs that are authorized to be associated with the specified + // hosted zone. + // + // VPCs is a required field + VPCs []*VPC `locationNameList:"VPC" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListVPCAssociationAuthorizationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListVPCAssociationAuthorizationsOutput) GoString() string { + return s.String() +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *ListVPCAssociationAuthorizationsOutput) SetHostedZoneId(v string) *ListVPCAssociationAuthorizationsOutput { + s.HostedZoneId = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListVPCAssociationAuthorizationsOutput) SetNextToken(v string) *ListVPCAssociationAuthorizationsOutput { + s.NextToken = &v + return s +} + +// SetVPCs sets the VPCs field's value. +func (s *ListVPCAssociationAuthorizationsOutput) SetVPCs(v []*VPC) *ListVPCAssociationAuthorizationsOutput { + s.VPCs = v + return s +} + +// A complex type that contains information about a configuration for DNS query +// logging. +type QueryLoggingConfig struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the CloudWatch Logs log group that Amazon + // Route 53 is publishing logs to. + // + // CloudWatchLogsLogGroupArn is a required field + CloudWatchLogsLogGroupArn *string `type:"string" required:"true"` + + // The ID of the hosted zone that CloudWatch Logs is logging queries for. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` + + // The ID for a configuration for DNS query logging. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s QueryLoggingConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s QueryLoggingConfig) GoString() string { + return s.String() +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *QueryLoggingConfig) SetCloudWatchLogsLogGroupArn(v string) *QueryLoggingConfig { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *QueryLoggingConfig) SetHostedZoneId(v string) *QueryLoggingConfig { + s.HostedZoneId = &v + return s +} + +// SetId sets the Id field's value. +func (s *QueryLoggingConfig) SetId(v string) *QueryLoggingConfig { + s.Id = &v + return s +} + +// Information specific to the resource record. +// +// If you're creating an alias resource record set, omit ResourceRecord. +type ResourceRecord struct { + _ struct{} `type:"structure"` + + // The current or new DNS record value, not to exceed 4,000 characters. In the + // case of a DELETE action, if the current value does not match the actual value, + // an error is returned. For descriptions about how to format Value for different + // record types, see Supported DNS Resource Record Types (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html) + // in the Amazon Route 53 Developer Guide. + // + // You can specify more than one value for all record types except CNAME and + // SOA. + // + // If you're creating an alias resource record set, omit Value. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceRecord) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceRecord) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceRecord) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceRecord"} + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetValue sets the Value field's value. +func (s *ResourceRecord) SetValue(v string) *ResourceRecord { + s.Value = &v + return s +} + +// Information about the resource record set to create or delete. +type ResourceRecordSet struct { + _ struct{} `type:"structure"` + + // Alias resource record sets only: Information about the CloudFront distribution, + // AWS Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or + // Amazon Route 53 resource record set to which you're redirecting queries. + // The AWS Elastic Beanstalk environment must have a regionalized subdomain. + // + // If you're creating resource records sets for a private hosted zone, note + // the following: + // + // * You can't create alias resource record sets for CloudFront distributions + // in a private hosted zone. + // + // * Creating geolocation alias resource record sets or latency alias resource + // record sets in a private hosted zone is unsupported. + // + // * For information about creating failover resource record sets in a private + // hosted zone, see Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html) + // in the Amazon Route 53 Developer Guide. + AliasTarget *AliasTarget `type:"structure"` + + // Failover resource record sets only: To configure failover, you add the Failover + // element to two resource record sets. For one resource record set, you specify + // PRIMARY as the value for Failover; for the other resource record set, you + // specify SECONDARY. In addition, you include the HealthCheckId element and + // specify the health check that you want Amazon Route 53 to perform for each + // resource record set. + // + // Except where noted, the following failover behaviors assume that you have + // included the HealthCheckId element in both resource record sets: + // + // * When the primary resource record set is healthy, Amazon Route 53 responds + // to DNS queries with the applicable value from the primary resource record + // set regardless of the health of the secondary resource record set. + // + // * When the primary resource record set is unhealthy and the secondary + // resource record set is healthy, Amazon Route 53 responds to DNS queries + // with the applicable value from the secondary resource record set. + // + // * When the secondary resource record set is unhealthy, Amazon Route 53 + // responds to DNS queries with the applicable value from the primary resource + // record set regardless of the health of the primary resource record set. + // + // * If you omit the HealthCheckId element for the secondary resource record + // set, and if the primary resource record set is unhealthy, Amazon Route + // 53 always responds to DNS queries with the applicable value from the secondary + // resource record set. This is true regardless of the health of the associated + // endpoint. + // + // You can't create non-failover resource record sets that have the same values + // for the Name and Type elements as failover resource record sets. + // + // For failover alias resource record sets, you must also include the EvaluateTargetHealth + // element and set the value to true. + // + // For more information about configuring failover for Amazon Route 53, see + // the following topics in the Amazon Route 53 Developer Guide: + // + // * Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) + // + // * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html) + Failover *string `type:"string" enum:"ResourceRecordSetFailover"` + + // Geo location resource record sets only: A complex type that lets you control + // how Amazon Route 53 responds to DNS queries based on the geographic origin + // of the query. For example, if you want all queries from Africa to be routed + // to a web server with an IP address of 192.0.2.111, create a resource record + // set with a Type of A and a ContinentCode of AF. + // + // Creating geolocation and geolocation alias resource record sets in private + // hosted zones is not supported. + // + // If you create separate resource record sets for overlapping geographic regions + // (for example, one resource record set for a continent and one for a country + // on the same continent), priority goes to the smallest geographic region. + // This allows you to route most queries for a continent to one resource and + // to route queries for a country on that continent to a different resource. + // + // You can't create two geolocation resource record sets that specify the same + // geographic location. + // + // The value * in the CountryCode element matches all geographic locations that + // aren't specified in other geolocation resource record sets that have the + // same values for the Name and Type elements. + // + // Geolocation works by mapping IP addresses to locations. However, some IP + // addresses aren't mapped to geographic locations, so even if you create geolocation + // resource record sets that cover all seven continents, Amazon Route 53 will + // receive some DNS queries from locations that it can't identify. We recommend + // that you create a resource record set for which the value of CountryCode + // is *, which handles both queries that come from locations for which you haven't + // created geolocation resource record sets and queries from IP addresses that + // aren't mapped to a location. If you don't create a * resource record set, + // Amazon Route 53 returns a "no answer" response for queries from those locations. + // + // You can't create non-geolocation resource record sets that have the same + // values for the Name and Type elements as geolocation resource record sets. + GeoLocation *GeoLocation `type:"structure"` + + // If you want Amazon Route 53 to return this resource record set in response + // to a DNS query only when a health check is passing, include the HealthCheckId + // element and specify the ID of the applicable health check. + // + // Amazon Route 53 determines whether a resource record set is healthy based + // on one of the following: + // + // * By periodically sending a request to the endpoint that is specified + // in the health check + // + // * By aggregating the status of a specified group of health checks (calculated + // health checks) + // + // * By determining the current state of a CloudWatch alarm (CloudWatch metric + // health checks) + // + // For more information, see How Amazon Route 53 Determines Whether an Endpoint + // Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html). + // + // The HealthCheckId element is only useful when Amazon Route 53 is choosing + // between two or more resource record sets to respond to a DNS query, and you + // want Amazon Route 53 to base the choice in part on the status of a health + // check. Configuring health checks only makes sense in the following configurations: + // + // * You're checking the health of the resource record sets in a group of + // weighted, latency, geolocation, or failover resource record sets, and + // you specify health check IDs for all of the resource record sets. If the + // health check for one resource record set specifies an endpoint that is + // not healthy, Amazon Route 53 stops responding to queries using the value + // for that resource record set. + // + // * You set EvaluateTargetHealth to true for the resource record sets in + // a group of alias, weighted alias, latency alias, geolocation alias, or + // failover alias resource record sets, and you specify health check IDs + // for all of the resource record sets that are referenced by the alias resource + // record sets. + // + // Amazon Route 53 doesn't check the health of the endpoint specified in the + // resource record set, for example, the endpoint specified by the IP address + // in the Value element. When you add a HealthCheckId element to a resource + // record set, Amazon Route 53 checks the health of the endpoint that you specified + // in the health check. + // + // For geolocation resource record sets, if an endpoint is unhealthy, Amazon + // Route 53 looks for a resource record set for the larger, associated geographic + // region. For example, suppose you have resource record sets for a state in + // the United States, for the United States, for North America, and for all + // locations. If the endpoint for the state resource record set is unhealthy, + // Amazon Route 53 checks the resource record sets for the United States, for + // North America, and for all locations (a resource record set for which the + // value of CountryCode is *), in that order, until it finds a resource record + // set for which the endpoint is healthy. + // + // If your health checks specify the endpoint only by domain name, we recommend + // that you create a separate health check for each endpoint. For example, create + // a health check for each HTTP server that is serving content for www.example.com. + // For the value of FullyQualifiedDomainName, specify the domain name of the + // server (such as us-east-2-www.example.com), not the name of the resource + // record sets (example.com). + // + // n this configuration, if you create a health check for which the value of + // FullyQualifiedDomainName matches the name of the resource record sets and + // then associate the health check with those resource record sets, health check + // results will be unpredictable. + // + // For more information, see the following topics in the Amazon Route 53 Developer + // Guide: + // + // * Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) + // + // * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html) + HealthCheckId *string `type:"string"` + + // Multivalue answer resource record sets only: To route traffic approximately + // randomly to multiple resources, such as web servers, create one multivalue + // answer record for each resource and specify true for MultiValueAnswer. Note + // the following: + // + // * If you associate a health check with a multivalue answer resource record + // set, Amazon Route 53 responds to DNS queries with the corresponding IP + // address only when the health check is healthy. + // + // * If you don't associate a health check with a multivalue answer record, + // Amazon Route 53 always considers the record to be healthy. + // + // * Amazon Route 53 responds to DNS queries with up to eight healthy records; + // if you have eight or fewer healthy records, Amazon Route 53 responds to + // all DNS queries with all the healthy records. + // + // * If you have more than eight healthy records, Amazon Route 53 responds + // to different DNS resolvers with different combinations of healthy records. + // + // * When all records are unhealthy, Amazon Route 53 responds to DNS queries + // with up to eight unhealthy records. + // + // * If a resource becomes unavailable after a resolver caches a response, + // client software typically tries another of the IP addresses in the response. + // + // You can't create multivalue answer alias records. + MultiValueAnswer *bool `type:"boolean"` + + // The name of the domain you want to perform the action on. + // + // Enter a fully qualified domain name, for example, www.example.com. You can + // optionally include a trailing dot. If you omit the trailing dot, Amazon Route + // 53 still assumes that the domain name that you specify is fully qualified. + // This means that Amazon Route 53 treats www.example.com (without a trailing + // dot) and www.example.com. (with a trailing dot) as identical. + // + // For information about how to specify characters other than a-z, 0-9, and + // - (hyphen) and how to specify internationalized domain names, see DNS Domain + // Name Format (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html) + // in the Amazon Route 53 Developer Guide. + // + // You can use the asterisk (*) wildcard to replace the leftmost label in a + // domain name, for example, *.example.com. Note the following: + // + // * The * must replace the entire label. For example, you can't specify + // *prod.example.com or prod*.example.com. + // + // * The * can't replace any of the middle labels, for example, marketing.*.example.com. + // + // * If you include * in any position other than the leftmost label in a + // domain name, DNS treats it as an * character (ASCII 42), not as a wildcard. + // + // You can't use the * wildcard for resource records sets that have a type of + // NS. + // + // You can use the * wildcard as the leftmost label in a domain name, for example, + // *.example.com. You can't use an * for one of the middle labels, for example, + // marketing.*.example.com. In addition, the * must replace the entire label; + // for example, you can't specify prod*.example.com. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Latency-based resource record sets only: The Amazon EC2 Region where you + // created the resource that this resource record set refers to. The resource + // typically is an AWS resource, such as an EC2 instance or an ELB load balancer, + // and is referred to by an IP address or a DNS domain name, depending on the + // record type. + // + // Creating latency and latency alias resource record sets in private hosted + // zones is not supported. + // + // When Amazon Route 53 receives a DNS query for a domain name and type for + // which you have created latency resource record sets, Amazon Route 53 selects + // the latency resource record set that has the lowest latency between the end + // user and the associated Amazon EC2 Region. Amazon Route 53 then returns the + // value that is associated with the selected resource record set. + // + // Note the following: + // + // * You can only specify one ResourceRecord per latency resource record + // set. + // + // * You can only create one latency resource record set for each Amazon + // EC2 Region. + // + // * You aren't required to create latency resource record sets for all Amazon + // EC2 Regions. Amazon Route 53 will choose the region with the best latency + // from among the regions that you create latency resource record sets for. + // + // * You can't create non-latency resource record sets that have the same + // values for the Name and Type elements as latency resource record sets. + Region *string `min:"1" type:"string" enum:"ResourceRecordSetRegion"` + + // Information about the resource records to act upon. + // + // If you're creating an alias resource record set, omit ResourceRecords. + ResourceRecords []*ResourceRecord `locationNameList:"ResourceRecord" min:"1" type:"list"` + + // Weighted, Latency, Geo, and Failover resource record sets only: An identifier + // that differentiates among multiple resource record sets that have the same + // combination of DNS name and type. The value of SetIdentifier must be unique + // for each resource record set that has the same combination of DNS name and + // type. Omit SetIdentifier for any other types of record sets. + SetIdentifier *string `min:"1" type:"string"` + + // The resource record cache time to live (TTL), in seconds. Note the following: + // + // * If you're creating or updating an alias resource record set, omit TTL. + // Amazon Route 53 uses the value of TTL for the alias target. + // + // * If you're associating this resource record set with a health check (if + // you're adding a HealthCheckId element), we recommend that you specify + // a TTL of 60 seconds or less so clients respond quickly to changes in health + // status. + // + // * All of the resource record sets in a group of weighted resource record + // sets must have the same value for TTL. + // + // * If a group of weighted resource record sets includes one or more weighted + // alias resource record sets for which the alias target is an ELB load balancer, + // we recommend that you specify a TTL of 60 seconds for all of the non-alias + // weighted resource record sets that have the same name and type. Values + // other than 60 seconds (the TTL for load balancers) will change the effect + // of the values that you specify for Weight. + TTL *int64 `type:"long"` + + // When you create a traffic policy instance, Amazon Route 53 automatically + // creates a resource record set. TrafficPolicyInstanceId is the ID of the traffic + // policy instance that Amazon Route 53 created this resource record set for. + // + // To delete the resource record set that is associated with a traffic policy + // instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete the + // resource record set automatically. If you delete the resource record set + // by using ChangeResourceRecordSets, Amazon Route 53 doesn't automatically + // delete the traffic policy instance, and you'll continue to be charged for + // it even though it's no longer in use. + TrafficPolicyInstanceId *string `min:"1" type:"string"` + + // The DNS record type. For information about different record types and how + // data is encoded for them, see Supported DNS Resource Record Types (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html) + // in the Amazon Route 53 Developer Guide. + // + // Valid values for basic resource record sets: A | AAAA | CAA | CNAME | MX + // | NAPTR | NS | PTR | SOA | SPF | SRV | TXT + // + // Values for weighted, latency, geolocation, and failover resource record sets: + // A | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT. When creating + // a group of weighted, latency, geolocation, or failover resource record sets, + // specify the same value for all of the resource record sets in the group. + // + // Valid values for multivalue answer resource record sets: A | AAAA | MX | + // NAPTR | PTR | SPF | SRV | TXT + // + // SPF records were formerly used to verify the identity of the sender of email + // messages. However, we no longer recommend that you create resource record + // sets for which the value of Type is SPF. RFC 7208, Sender Policy Framework + // (SPF) for Authorizing Use of Domains in Email, Version 1, has been updated + // to say, "...[I]ts existence and mechanism defined in [RFC4408] have led to + // some interoperability issues. Accordingly, its use is no longer appropriate + // for SPF version 1; implementations are not to use it." In RFC 7208, see section + // 14.1, The SPF DNS Record Type (http://tools.ietf.org/html/rfc7208#section-14.1). + // + // Values for alias resource record sets: + // + // * CloudFront distributions:A + // + // If IPv6 is enabled for the distribution, create two resource record sets + // to route traffic to your distribution, one with a value of A and one with + // a value of AAAA. + // + // * AWS Elastic Beanstalk environment that has a regionalized subdomain: + // A + // + // * ELB load balancers:A | AAAA + // + // * Amazon S3 buckets:A + // + // * Another resource record set in this hosted zone: Specify the type of + // the resource record set that you're creating the alias for. All values + // are supported except NS and SOA. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"RRType"` + + // Weighted resource record sets only: Among resource record sets that have + // the same combination of DNS name and type, a value that determines the proportion + // of DNS queries that Amazon Route 53 responds to using the current resource + // record set. Amazon Route 53 calculates the sum of the weights for the resource + // record sets that have the same combination of DNS name and type. Amazon Route + // 53 then responds to queries based on the ratio of a resource's weight to + // the total. Note the following: + // + // * You must specify a value for the Weight element for every weighted resource + // record set. + // + // * You can only specify one ResourceRecord per weighted resource record + // set. + // + // * You can't create latency, failover, or geolocation resource record sets + // that have the same values for the Name and Type elements as weighted resource + // record sets. + // + // * You can create a maximum of 100 weighted resource record sets that have + // the same values for the Name and Type elements. + // + // * For weighted (but not weighted alias) resource record sets, if you set + // Weight to 0 for a resource record set, Amazon Route 53 never responds + // to queries with the applicable value for that resource record set. However, + // if you set Weight to 0 for all resource record sets that have the same + // combination of DNS name and type, traffic is routed to all resources with + // equal probability. + // + // The effect of setting Weight to 0 is different when you associate health + // checks with weighted resource record sets. For more information, see Options + // for Configuring Amazon Route 53 Active-Active and Active-Passive Failover + // (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html) + // in the Amazon Route 53 Developer Guide. + Weight *int64 `type:"long"` +} + +// String returns the string representation +func (s ResourceRecordSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceRecordSet) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceRecordSet) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceRecordSet"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Region != nil && len(*s.Region) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Region", 1)) + } + if s.ResourceRecords != nil && len(s.ResourceRecords) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceRecords", 1)) + } + if s.SetIdentifier != nil && len(*s.SetIdentifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SetIdentifier", 1)) + } + if s.TrafficPolicyInstanceId != nil && len(*s.TrafficPolicyInstanceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyInstanceId", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.AliasTarget != nil { + if err := s.AliasTarget.Validate(); err != nil { + invalidParams.AddNested("AliasTarget", err.(request.ErrInvalidParams)) + } + } + if s.GeoLocation != nil { + if err := s.GeoLocation.Validate(); err != nil { + invalidParams.AddNested("GeoLocation", err.(request.ErrInvalidParams)) + } + } + if s.ResourceRecords != nil { + for i, v := range s.ResourceRecords { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceRecords", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAliasTarget sets the AliasTarget field's value. +func (s *ResourceRecordSet) SetAliasTarget(v *AliasTarget) *ResourceRecordSet { + s.AliasTarget = v + return s +} + +// SetFailover sets the Failover field's value. +func (s *ResourceRecordSet) SetFailover(v string) *ResourceRecordSet { + s.Failover = &v + return s +} + +// SetGeoLocation sets the GeoLocation field's value. +func (s *ResourceRecordSet) SetGeoLocation(v *GeoLocation) *ResourceRecordSet { + s.GeoLocation = v + return s +} + +// SetHealthCheckId sets the HealthCheckId field's value. +func (s *ResourceRecordSet) SetHealthCheckId(v string) *ResourceRecordSet { + s.HealthCheckId = &v + return s +} + +// SetMultiValueAnswer sets the MultiValueAnswer field's value. +func (s *ResourceRecordSet) SetMultiValueAnswer(v bool) *ResourceRecordSet { + s.MultiValueAnswer = &v + return s +} + +// SetName sets the Name field's value. +func (s *ResourceRecordSet) SetName(v string) *ResourceRecordSet { + s.Name = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *ResourceRecordSet) SetRegion(v string) *ResourceRecordSet { + s.Region = &v + return s +} + +// SetResourceRecords sets the ResourceRecords field's value. +func (s *ResourceRecordSet) SetResourceRecords(v []*ResourceRecord) *ResourceRecordSet { + s.ResourceRecords = v + return s +} + +// SetSetIdentifier sets the SetIdentifier field's value. +func (s *ResourceRecordSet) SetSetIdentifier(v string) *ResourceRecordSet { + s.SetIdentifier = &v + return s +} + +// SetTTL sets the TTL field's value. +func (s *ResourceRecordSet) SetTTL(v int64) *ResourceRecordSet { + s.TTL = &v + return s +} + +// SetTrafficPolicyInstanceId sets the TrafficPolicyInstanceId field's value. +func (s *ResourceRecordSet) SetTrafficPolicyInstanceId(v string) *ResourceRecordSet { + s.TrafficPolicyInstanceId = &v + return s +} + +// SetType sets the Type field's value. +func (s *ResourceRecordSet) SetType(v string) *ResourceRecordSet { + s.Type = &v + return s +} + +// SetWeight sets the Weight field's value. +func (s *ResourceRecordSet) SetWeight(v int64) *ResourceRecordSet { + s.Weight = &v + return s +} + +// A complex type containing a resource and its associated tags. +type ResourceTagSet struct { + _ struct{} `type:"structure"` + + // The ID for the specified resource. + ResourceId *string `type:"string"` + + // The type of the resource. + // + // * The resource type for health checks is healthcheck. + // + // * The resource type for hosted zones is hostedzone. + ResourceType *string `type:"string" enum:"TagResourceType"` + + // The tags associated with the specified resource. + Tags []*Tag `locationNameList:"Tag" min:"1" type:"list"` +} + +// String returns the string representation +func (s ResourceTagSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceTagSet) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *ResourceTagSet) SetResourceId(v string) *ResourceTagSet { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ResourceTagSet) SetResourceType(v string) *ResourceTagSet { + s.ResourceType = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ResourceTagSet) SetTags(v []*Tag) *ResourceTagSet { + s.Tags = v + return s +} + +// A complex type that contains the type of limit that you specified in the +// request and the current value for that limit. +type ReusableDelegationSetLimit struct { + _ struct{} `type:"structure"` + + // The limit that you requested: MAX_ZONES_BY_REUSABLE_DELEGATION_SET, the maximum + // number of hosted zones that you can associate with the specified reusable + // delegation set. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"ReusableDelegationSetLimitType"` + + // The current value for the MAX_ZONES_BY_REUSABLE_DELEGATION_SET limit. + // + // Value is a required field + Value *int64 `min:"1" type:"long" required:"true"` +} + +// String returns the string representation +func (s ReusableDelegationSetLimit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReusableDelegationSetLimit) GoString() string { + return s.String() +} + +// SetType sets the Type field's value. +func (s *ReusableDelegationSetLimit) SetType(v string) *ReusableDelegationSetLimit { + s.Type = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ReusableDelegationSetLimit) SetValue(v int64) *ReusableDelegationSetLimit { + s.Value = &v + return s +} + +// A complex type that contains the status that one Amazon Route 53 health checker +// reports and the time of the health check. +type StatusReport struct { + _ struct{} `type:"structure"` + + // The date and time that the health checker performed the health check in ISO + // 8601 format (https://en.wikipedia.org/wiki/ISO_8601) and Coordinated Universal + // Time (UTC). For example, the value 2017-03-27T17:48:16.751Z represents March + // 27, 2017 at 17:48:16.751 UTC. + CheckedTime *time.Time `type:"timestamp"` + + // A description of the status of the health check endpoint as reported by one + // of the Amazon Route 53 health checkers. + Status *string `type:"string"` +} + +// String returns the string representation +func (s StatusReport) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StatusReport) GoString() string { + return s.String() +} + +// SetCheckedTime sets the CheckedTime field's value. +func (s *StatusReport) SetCheckedTime(v time.Time) *StatusReport { + s.CheckedTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *StatusReport) SetStatus(v string) *StatusReport { + s.Status = &v + return s +} + +// A complex type that contains information about a tag that you want to add +// or edit for the specified health check or hosted zone. +type Tag struct { + _ struct{} `type:"structure"` + + // The value of Key depends on the operation that you want to perform: + // + // * Add a tag to a health check or hosted zone: Key is the name that you + // want to give the new tag. + // + // * Edit a tag: Key is the name of the tag that you want to change the Value + // for. + // + // * Delete a key: Key is the name of the tag you want to remove. + // + // * Give a name to a health check: Edit the default Name tag. In the Amazon + // Route 53 console, the list of your health checks includes a Name column + // that lets you see the name that you've given to each health check. + Key *string `type:"string"` + + // The value of Value depends on the operation that you want to perform: + // + // * Add a tag to a health check or hosted zone: Value is the value that + // you want to give the new tag. + // + // * Edit a tag: Value is the new value that you want to assign the tag. + Value *string `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 +} + +// Gets the value that Amazon Route 53 returns in response to a DNS request +// for a specified record name and type. You can optionally specify the IP address +// of a DNS resolver, an EDNS0 client subnet IP address, and a subnet mask. +type TestDNSAnswerInput struct { + _ struct{} `type:"structure"` + + // If the resolver that you specified for resolverip supports EDNS0, specify + // the IPv4 or IPv6 address of a client in the applicable location, for example, + // 192.0.2.44 or 2001:db8:85a3::8a2e:370:7334. + EDNS0ClientSubnetIP *string `location:"querystring" locationName:"edns0clientsubnetip" type:"string"` + + // If you specify an IP address for edns0clientsubnetip, you can optionally + // specify the number of bits of the IP address that you want the checking tool + // to include in the DNS query. For example, if you specify 192.0.2.44 for edns0clientsubnetip + // and 24 for edns0clientsubnetmask, the checking tool will simulate a request + // from 192.0.2.0/24. The default value is 24 bits for IPv4 addresses and 64 + // bits for IPv6 addresses. + EDNS0ClientSubnetMask *string `location:"querystring" locationName:"edns0clientsubnetmask" type:"string"` + + // The ID of the hosted zone that you want Amazon Route 53 to simulate a query + // for. + // + // HostedZoneId is a required field + HostedZoneId *string `location:"querystring" locationName:"hostedzoneid" type:"string" required:"true"` + + // The name of the resource record set that you want Amazon Route 53 to simulate + // a query for. + // + // RecordName is a required field + RecordName *string `location:"querystring" locationName:"recordname" type:"string" required:"true"` + + // The type of the resource record set. + // + // RecordType is a required field + RecordType *string `location:"querystring" locationName:"recordtype" type:"string" required:"true" enum:"RRType"` + + // If you want to simulate a request from a specific DNS resolver, specify the + // IP address for that resolver. If you omit this value, TestDnsAnswer uses + // the IP address of a DNS resolver in the AWS US East (N. Virginia) Region + // (us-east-1). + ResolverIP *string `location:"querystring" locationName:"resolverip" type:"string"` +} + +// String returns the string representation +func (s TestDNSAnswerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestDNSAnswerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TestDNSAnswerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TestDNSAnswerInput"} + if s.HostedZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) + } + if s.RecordName == nil { + invalidParams.Add(request.NewErrParamRequired("RecordName")) + } + if s.RecordType == nil { + invalidParams.Add(request.NewErrParamRequired("RecordType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEDNS0ClientSubnetIP sets the EDNS0ClientSubnetIP field's value. +func (s *TestDNSAnswerInput) SetEDNS0ClientSubnetIP(v string) *TestDNSAnswerInput { + s.EDNS0ClientSubnetIP = &v + return s +} + +// SetEDNS0ClientSubnetMask sets the EDNS0ClientSubnetMask field's value. +func (s *TestDNSAnswerInput) SetEDNS0ClientSubnetMask(v string) *TestDNSAnswerInput { + s.EDNS0ClientSubnetMask = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *TestDNSAnswerInput) SetHostedZoneId(v string) *TestDNSAnswerInput { + s.HostedZoneId = &v + return s +} + +// SetRecordName sets the RecordName field's value. +func (s *TestDNSAnswerInput) SetRecordName(v string) *TestDNSAnswerInput { + s.RecordName = &v + return s +} + +// SetRecordType sets the RecordType field's value. +func (s *TestDNSAnswerInput) SetRecordType(v string) *TestDNSAnswerInput { + s.RecordType = &v + return s +} + +// SetResolverIP sets the ResolverIP field's value. +func (s *TestDNSAnswerInput) SetResolverIP(v string) *TestDNSAnswerInput { + s.ResolverIP = &v + return s +} + +// A complex type that contains the response to a TestDNSAnswer request. +type TestDNSAnswerOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Route 53 name server used to respond to the request. + // + // Nameserver is a required field + Nameserver *string `type:"string" required:"true"` + + // The protocol that Amazon Route 53 used to respond to the request, either + // UDP or TCP. + // + // Protocol is a required field + Protocol *string `type:"string" required:"true"` + + // A list that contains values that Amazon Route 53 returned for this resource + // record set. + // + // RecordData is a required field + RecordData []*string `locationNameList:"RecordDataEntry" type:"list" required:"true"` + + // The name of the resource record set that you submitted a request for. + // + // RecordName is a required field + RecordName *string `type:"string" required:"true"` + + // The type of the resource record set that you submitted a request for. + // + // RecordType is a required field + RecordType *string `type:"string" required:"true" enum:"RRType"` + + // A code that indicates whether the request is valid or not. The most common + // response code is NOERROR, meaning that the request is valid. If the response + // is not valid, Amazon Route 53 returns a response code that describes the + // error. For a list of possible response codes, see DNS RCODES (http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6) + // on the IANA website. + // + // ResponseCode is a required field + ResponseCode *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s TestDNSAnswerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestDNSAnswerOutput) GoString() string { + return s.String() +} + +// SetNameserver sets the Nameserver field's value. +func (s *TestDNSAnswerOutput) SetNameserver(v string) *TestDNSAnswerOutput { + s.Nameserver = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *TestDNSAnswerOutput) SetProtocol(v string) *TestDNSAnswerOutput { + s.Protocol = &v + return s +} + +// SetRecordData sets the RecordData field's value. +func (s *TestDNSAnswerOutput) SetRecordData(v []*string) *TestDNSAnswerOutput { + s.RecordData = v + return s +} + +// SetRecordName sets the RecordName field's value. +func (s *TestDNSAnswerOutput) SetRecordName(v string) *TestDNSAnswerOutput { + s.RecordName = &v + return s +} + +// SetRecordType sets the RecordType field's value. +func (s *TestDNSAnswerOutput) SetRecordType(v string) *TestDNSAnswerOutput { + s.RecordType = &v + return s +} + +// SetResponseCode sets the ResponseCode field's value. +func (s *TestDNSAnswerOutput) SetResponseCode(v string) *TestDNSAnswerOutput { + s.ResponseCode = &v + return s +} + +// A complex type that contains settings for a traffic policy. +type TrafficPolicy struct { + _ struct{} `type:"structure"` + + // The comment that you specify in the CreateTrafficPolicy request, if any. + Comment *string `type:"string"` + + // The definition of a traffic policy in JSON format. You specify the JSON document + // to use for a new traffic policy in the CreateTrafficPolicy request. For more + // information about the JSON format, see Traffic Policy Document Format (http://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html). + // + // Document is a required field + Document *string `type:"string" required:"true"` + + // The ID that Amazon Route 53 assigned to a traffic policy when you created + // it. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // The name that you specified when you created the traffic policy. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The DNS type of the resource record sets that Amazon Route 53 creates when + // you use a traffic policy to create a traffic policy instance. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"RRType"` + + // The version number that Amazon Route 53 assigns to a traffic policy. For + // a new traffic policy, the value of Version is always 1. + // + // Version is a required field + Version *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s TrafficPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrafficPolicy) GoString() string { + return s.String() +} + +// SetComment sets the Comment field's value. +func (s *TrafficPolicy) SetComment(v string) *TrafficPolicy { + s.Comment = &v + return s +} + +// SetDocument sets the Document field's value. +func (s *TrafficPolicy) SetDocument(v string) *TrafficPolicy { + s.Document = &v + return s +} + +// SetId sets the Id field's value. +func (s *TrafficPolicy) SetId(v string) *TrafficPolicy { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *TrafficPolicy) SetName(v string) *TrafficPolicy { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *TrafficPolicy) SetType(v string) *TrafficPolicy { + s.Type = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *TrafficPolicy) SetVersion(v int64) *TrafficPolicy { + s.Version = &v + return s +} + +// A complex type that contains settings for the new traffic policy instance. +type TrafficPolicyInstance struct { + _ struct{} `type:"structure"` + + // The ID of the hosted zone that Amazon Route 53 created resource record sets + // in. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` + + // The ID that Amazon Route 53 assigned to the new traffic policy instance. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // If State is Failed, an explanation of the reason for the failure. If State + // is another value, Message is empty. + // + // Message is a required field + Message *string `type:"string" required:"true"` + + // The DNS name, such as www.example.com, for which Amazon Route 53 responds + // to queries by using the resource record sets that are associated with this + // traffic policy instance. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The value of State is one of the following values: + // + // AppliedAmazon Route 53 has finished creating resource record sets, and changes + // have propagated to all Amazon Route 53 edge locations. + // + // CreatingAmazon Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance + // to confirm that the CreateTrafficPolicyInstance request completed successfully. + // + // FailedAmazon Route 53 wasn't able to create or update the resource record + // sets. When the value of State is Failed, see Message for an explanation of + // what caused the request to fail. + // + // State is a required field + State *string `type:"string" required:"true"` + + // The TTL that Amazon Route 53 assigned to all of the resource record sets + // that it created in the specified hosted zone. + // + // TTL is a required field + TTL *int64 `type:"long" required:"true"` + + // The ID of the traffic policy that Amazon Route 53 used to create resource + // record sets in the specified hosted zone. + // + // TrafficPolicyId is a required field + TrafficPolicyId *string `min:"1" type:"string" required:"true"` + + // The DNS type that Amazon Route 53 assigned to all of the resource record + // sets that it created for this traffic policy instance. + // + // TrafficPolicyType is a required field + TrafficPolicyType *string `type:"string" required:"true" enum:"RRType"` + + // The version of the traffic policy that Amazon Route 53 used to create resource + // record sets in the specified hosted zone. + // + // TrafficPolicyVersion is a required field + TrafficPolicyVersion *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s TrafficPolicyInstance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrafficPolicyInstance) GoString() string { + return s.String() +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *TrafficPolicyInstance) SetHostedZoneId(v string) *TrafficPolicyInstance { + s.HostedZoneId = &v + return s +} + +// SetId sets the Id field's value. +func (s *TrafficPolicyInstance) SetId(v string) *TrafficPolicyInstance { + s.Id = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *TrafficPolicyInstance) SetMessage(v string) *TrafficPolicyInstance { + s.Message = &v + return s +} + +// SetName sets the Name field's value. +func (s *TrafficPolicyInstance) SetName(v string) *TrafficPolicyInstance { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *TrafficPolicyInstance) SetState(v string) *TrafficPolicyInstance { + s.State = &v + return s +} + +// SetTTL sets the TTL field's value. +func (s *TrafficPolicyInstance) SetTTL(v int64) *TrafficPolicyInstance { + s.TTL = &v + return s +} + +// SetTrafficPolicyId sets the TrafficPolicyId field's value. +func (s *TrafficPolicyInstance) SetTrafficPolicyId(v string) *TrafficPolicyInstance { + s.TrafficPolicyId = &v + return s +} + +// SetTrafficPolicyType sets the TrafficPolicyType field's value. +func (s *TrafficPolicyInstance) SetTrafficPolicyType(v string) *TrafficPolicyInstance { + s.TrafficPolicyType = &v + return s +} + +// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. +func (s *TrafficPolicyInstance) SetTrafficPolicyVersion(v int64) *TrafficPolicyInstance { + s.TrafficPolicyVersion = &v + return s +} + +// A complex type that contains information about the latest version of one +// traffic policy that is associated with the current AWS account. +type TrafficPolicySummary struct { + _ struct{} `type:"structure"` + + // The ID that Amazon Route 53 assigned to the traffic policy when you created + // it. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // The version number of the latest version of the traffic policy. + // + // LatestVersion is a required field + LatestVersion *int64 `min:"1" type:"integer" required:"true"` + + // The name that you specified for the traffic policy when you created it. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The number of traffic policies that are associated with the current AWS account. + // + // TrafficPolicyCount is a required field + TrafficPolicyCount *int64 `min:"1" type:"integer" required:"true"` + + // The DNS type of the resource record sets that Amazon Route 53 creates when + // you use a traffic policy to create a traffic policy instance. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"RRType"` +} + +// String returns the string representation +func (s TrafficPolicySummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrafficPolicySummary) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *TrafficPolicySummary) SetId(v string) *TrafficPolicySummary { + s.Id = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *TrafficPolicySummary) SetLatestVersion(v int64) *TrafficPolicySummary { + s.LatestVersion = &v + return s +} + +// SetName sets the Name field's value. +func (s *TrafficPolicySummary) SetName(v string) *TrafficPolicySummary { + s.Name = &v + return s +} + +// SetTrafficPolicyCount sets the TrafficPolicyCount field's value. +func (s *TrafficPolicySummary) SetTrafficPolicyCount(v int64) *TrafficPolicySummary { + s.TrafficPolicyCount = &v + return s +} + +// SetType sets the Type field's value. +func (s *TrafficPolicySummary) SetType(v string) *TrafficPolicySummary { + s.Type = &v + return s +} + +// A complex type that contains information about a request to update a health +// check. +type UpdateHealthCheckInput struct { + _ struct{} `locationName:"UpdateHealthCheckRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // A complex type that identifies the CloudWatch alarm that you want Amazon + // Route 53 health checkers to use to determine whether this health check is + // healthy. + AlarmIdentifier *AlarmIdentifier `type:"structure"` + + // A complex type that contains one ChildHealthCheck element for each health + // check that you want to associate with a CALCULATED health check. + ChildHealthChecks []*string `locationNameList:"ChildHealthCheck" type:"list"` + + // Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName + // to the endpoint in the client_hello message during TLS negotiation. This + // allows the endpoint to respond to HTTPS health check requests with the applicable + // SSL/TLS certificate. + // + // Some endpoints require that HTTPS requests include the host name in the client_hello + // message. If you don't enable SNI, the status of the health check will be + // SSL alert handshake_failure. A health check can also have that status for + // other reasons. If SNI is enabled and you're still getting the error, check + // the SSL/TLS configuration on your endpoint and confirm that your certificate + // is valid. + // + // The SSL/TLS certificate on your endpoint includes a domain name in the Common + // Name field and possibly several more in the Subject Alternative Names field. + // One of the domain names in the certificate should match the value that you + // specify for FullyQualifiedDomainName. If the endpoint responds to the client_hello + // message with a certificate that does not include the domain name that you + // specified in FullyQualifiedDomainName, a health checker will retry the handshake. + // In the second attempt, the health checker will omit FullyQualifiedDomainName + // from the client_hello message. + EnableSNI *bool `type:"boolean"` + + // The number of consecutive health checks that an endpoint must pass or fail + // for Amazon Route 53 to change the current status of the endpoint from unhealthy + // to healthy or vice versa. For more information, see How Amazon Route 53 Determines + // Whether an Endpoint Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) + // in the Amazon Route 53 Developer Guide. + // + // If you don't specify a value for FailureThreshold, the default value is three + // health checks. + FailureThreshold *int64 `min:"1" type:"integer"` + + // Amazon Route 53 behavior depends on whether you specify a value for IPAddress. + // + // If a health check already has a value for IPAddress, you can change the value. + // However, you can't update an existing health check to add or remove the value + // of IPAddress. + // + // If you specify a value forIPAddress: + // + // Amazon Route 53 sends health check requests to the specified IPv4 or IPv6 + // address and passes the value of FullyQualifiedDomainName in the Host header + // for all health checks except TCP health checks. This is typically the fully + // qualified DNS name of the endpoint on which you want Amazon Route 53 to perform + // health checks. + // + // When Amazon Route 53 checks the health of an endpoint, here is how it constructs + // the Host header: + // + // * If you specify a value of 80 for Port and HTTP or HTTP_STR_MATCH for + // Type, Amazon Route 53 passes the value of FullyQualifiedDomainName to + // the endpoint in the Host header. + // + // * If you specify a value of 443 for Port and HTTPS or HTTPS_STR_MATCH + // for Type, Amazon Route 53 passes the value of FullyQualifiedDomainName + // to the endpoint in the Host header. + // + // * If you specify another value for Port and any value except TCP for Type, + // Amazon Route 53 passes FullyQualifiedDomainName:Port to the endpoint in + // the Host header. + // + // If you don't specify a value for FullyQualifiedDomainName, Amazon Route 53 + // substitutes the value of IPAddress in the Host header in each of the above + // cases. + // + // If you don't specify a value forIPAddress: + // + // If you don't specify a value for IPAddress, Amazon Route 53 sends a DNS request + // to the domain that you specify in FullyQualifiedDomainName at the interval + // you specify in RequestInterval. Using an IPv4 address that is returned by + // DNS, Amazon Route 53 then checks the health of the endpoint. + // + // If you don't specify a value for IPAddress, Amazon Route 53 uses only IPv4 + // to send health checks to the endpoint. If there's no resource record set + // with a type of A for the name that you specify for FullyQualifiedDomainName, + // the health check fails with a "DNS resolution failed" error. + // + // If you want to check the health of weighted, latency, or failover resource + // record sets and you choose to specify the endpoint only by FullyQualifiedDomainName, + // we recommend that you create a separate health check for each endpoint. For + // example, create a health check for each HTTP server that is serving content + // for www.example.com. For the value of FullyQualifiedDomainName, specify the + // domain name of the server (such as us-east-2-www.example.com), not the name + // of the resource record sets (www.example.com). + // + // In this configuration, if the value of FullyQualifiedDomainName matches the + // name of the resource record sets and you then associate the health check + // with those resource record sets, health check results will be unpredictable. + // + // In addition, if the value of Type is HTTP, HTTPS, HTTP_STR_MATCH, or HTTPS_STR_MATCH, + // Amazon Route 53 passes the value of FullyQualifiedDomainName in the Host + // header, as it does when you specify a value for IPAddress. If the value of + // Type is TCP, Amazon Route 53 doesn't pass a Host header. + FullyQualifiedDomainName *string `type:"string"` + + // The ID for the health check for which you want detailed information. When + // you created the health check, CreateHealthCheck returned the ID in the response, + // in the HealthCheckId element. + // + // HealthCheckId is a required field + HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` + + // A sequential counter that Amazon Route 53 sets to 1 when you create a health + // check and increments by 1 each time you update settings for the health check. + // + // We recommend that you use GetHealthCheck or ListHealthChecks to get the current + // value of HealthCheckVersion for the health check that you want to update, + // and that you include that value in your UpdateHealthCheck request. This prevents + // Amazon Route 53 from overwriting an intervening update: + // + // * If the value in the UpdateHealthCheck request matches the value of HealthCheckVersion + // in the health check, Amazon Route 53 updates the health check with the + // new settings. + // + // * If the value of HealthCheckVersion in the health check is greater, the + // health check was changed after you got the version number. Amazon Route + // 53 does not update the health check, and it returns a HealthCheckVersionMismatch + // error. + HealthCheckVersion *int64 `min:"1" type:"long"` + + // The number of child health checks that are associated with a CALCULATED health + // that Amazon Route 53 must consider healthy for the CALCULATED health check + // to be considered healthy. To specify the child health checks that you want + // to associate with a CALCULATED health check, use the ChildHealthChecks and + // ChildHealthCheck elements. + // + // Note the following: + // + // * If you specify a number greater than the number of child health checks, + // Amazon Route 53 always considers this health check to be unhealthy. + // + // * If you specify 0, Amazon Route 53 always considers this health check + // to be healthy. + HealthThreshold *int64 `type:"integer"` + + // The IPv4 or IPv6 IP address for the endpoint that you want Amazon Route 53 + // to perform health checks on. If you don't specify a value for IPAddress, + // Amazon Route 53 sends a DNS request to resolve the domain name that you specify + // in FullyQualifiedDomainName at the interval that you specify in RequestInterval. + // Using an IP address that is returned by DNS, Amazon Route 53 then checks + // the health of the endpoint. + // + // Use one of the following formats for the value of IPAddress: + // + // * IPv4 address: four values between 0 and 255, separated by periods (.), + // for example, 192.0.2.44. + // + // * IPv6 address: eight groups of four hexadecimal values, separated by + // colons (:), for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345. You + // can also shorten IPv6 addresses as described in RFC 5952, for example, + // 2001:db8:85a3::abcd:1:2345. + // + // If the endpoint is an EC2 instance, we recommend that you create an Elastic + // IP address, associate it with your EC2 instance, and specify the Elastic + // IP address for IPAddress. This ensures that the IP address of your instance + // never changes. For more information, see the applicable documentation: + // + // * Linux: Elastic IP Addresses (EIP) (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) + // in the Amazon EC2 User Guide for Linux Instances + // + // * Windows: Elastic IP Addresses (EIP) (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-ip-addresses-eip.html) + // in the Amazon EC2 User Guide for Windows Instances + // + // If a health check already has a value for IPAddress, you can change the value. + // However, you can't update an existing health check to add or remove the value + // of IPAddress. + // + // For more information, see UpdateHealthCheckRequest$FullyQualifiedDomainName. + // + // Constraints: Amazon Route 53 can't check the health of endpoints for which + // the IP address is in local, private, non-routable, or multicast ranges. For + // more information about IP addresses for which you can't create health checks, + // see the following documents: + // + // * RFC 5735, Special Use IPv4 Addresses (https://tools.ietf.org/html/rfc5735) + // + // * RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space (https://tools.ietf.org/html/rfc6598) + // + // * RFC 5156, Special-Use IPv6 Addresses (https://tools.ietf.org/html/rfc5156) + IPAddress *string `type:"string"` + + // When CloudWatch has insufficient data about the metric to determine the alarm + // state, the status that you want Amazon Route 53 to assign to the health check: + // + // * Healthy: Amazon Route 53 considers the health check to be healthy. + // + // * Unhealthy: Amazon Route 53 considers the health check to be unhealthy. + // + // * LastKnownStatus: Amazon Route 53 uses the status of the health check + // from the last time CloudWatch had sufficient data to determine the alarm + // state. For new health checks that have no last known status, the default + // status for the health check is healthy. + InsufficientDataHealthStatus *string `type:"string" enum:"InsufficientDataHealthStatus"` + + // Specify whether you want Amazon Route 53 to invert the status of a health + // check, for example, to consider a health check unhealthy when it otherwise + // would be considered healthy. + Inverted *bool `type:"boolean"` + + // The port on the endpoint on which you want Amazon Route 53 to perform health + // checks. + Port *int64 `min:"1" type:"integer"` + + // A complex type that contains one Region element for each region that you + // want Amazon Route 53 health checkers to check the specified endpoint from. + Regions []*string `locationNameList:"Region" min:"3" type:"list"` + + // A complex type that contains one ResettableElementName element for each element + // that you want to reset to the default value. Valid values for ResettableElementName + // include the following: + // + // * ChildHealthChecks: Amazon Route 53 resets HealthCheckConfig$ChildHealthChecks + // to null. + // + // * FullyQualifiedDomainName: Amazon Route 53 resets HealthCheckConfig$FullyQualifiedDomainName + // to null. + // + // * Regions: Amazon Route 53 resets the HealthCheckConfig$Regions list to + // the default set of regions. + // + // * ResourcePath: Amazon Route 53 resets HealthCheckConfig$ResourcePath + // to null. + ResetElements []*string `locationNameList:"ResettableElementName" type:"list"` + + // The path that you want Amazon Route 53 to request when performing health + // checks. The path can be any value for which your endpoint will return an + // HTTP status code of 2xx or 3xx when the endpoint is healthy, for example + // the file /docs/route53-health-check.html. + // + // Specify this value only if you want to change it. + ResourcePath *string `type:"string"` + + // If the value of Type is HTTP_STR_MATCH or HTTP_STR_MATCH, the string that + // you want Amazon Route 53 to search for in the response body from the specified + // resource. If the string appears in the response body, Amazon Route 53 considers + // the resource healthy. (You can't change the value of Type when you update + // a health check.) + SearchString *string `type:"string"` +} + +// String returns the string representation +func (s UpdateHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateHealthCheckInput"} + if s.FailureThreshold != nil && *s.FailureThreshold < 1 { + invalidParams.Add(request.NewErrParamMinValue("FailureThreshold", 1)) + } + if s.HealthCheckId == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) + } + if s.HealthCheckVersion != nil && *s.HealthCheckVersion < 1 { + invalidParams.Add(request.NewErrParamMinValue("HealthCheckVersion", 1)) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + if s.Regions != nil && len(s.Regions) < 3 { + invalidParams.Add(request.NewErrParamMinLen("Regions", 3)) + } + if s.AlarmIdentifier != nil { + if err := s.AlarmIdentifier.Validate(); err != nil { + invalidParams.AddNested("AlarmIdentifier", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlarmIdentifier sets the AlarmIdentifier field's value. +func (s *UpdateHealthCheckInput) SetAlarmIdentifier(v *AlarmIdentifier) *UpdateHealthCheckInput { + s.AlarmIdentifier = v + return s +} + +// SetChildHealthChecks sets the ChildHealthChecks field's value. +func (s *UpdateHealthCheckInput) SetChildHealthChecks(v []*string) *UpdateHealthCheckInput { + s.ChildHealthChecks = v + return s +} + +// SetEnableSNI sets the EnableSNI field's value. +func (s *UpdateHealthCheckInput) SetEnableSNI(v bool) *UpdateHealthCheckInput { + s.EnableSNI = &v + return s +} + +// SetFailureThreshold sets the FailureThreshold field's value. +func (s *UpdateHealthCheckInput) SetFailureThreshold(v int64) *UpdateHealthCheckInput { + s.FailureThreshold = &v + return s +} + +// SetFullyQualifiedDomainName sets the FullyQualifiedDomainName field's value. +func (s *UpdateHealthCheckInput) SetFullyQualifiedDomainName(v string) *UpdateHealthCheckInput { + s.FullyQualifiedDomainName = &v + return s +} + +// SetHealthCheckId sets the HealthCheckId field's value. +func (s *UpdateHealthCheckInput) SetHealthCheckId(v string) *UpdateHealthCheckInput { + s.HealthCheckId = &v + return s +} + +// SetHealthCheckVersion sets the HealthCheckVersion field's value. +func (s *UpdateHealthCheckInput) SetHealthCheckVersion(v int64) *UpdateHealthCheckInput { + s.HealthCheckVersion = &v + return s +} + +// SetHealthThreshold sets the HealthThreshold field's value. +func (s *UpdateHealthCheckInput) SetHealthThreshold(v int64) *UpdateHealthCheckInput { + s.HealthThreshold = &v + return s +} + +// SetIPAddress sets the IPAddress field's value. +func (s *UpdateHealthCheckInput) SetIPAddress(v string) *UpdateHealthCheckInput { + s.IPAddress = &v + return s +} + +// SetInsufficientDataHealthStatus sets the InsufficientDataHealthStatus field's value. +func (s *UpdateHealthCheckInput) SetInsufficientDataHealthStatus(v string) *UpdateHealthCheckInput { + s.InsufficientDataHealthStatus = &v + return s +} + +// SetInverted sets the Inverted field's value. +func (s *UpdateHealthCheckInput) SetInverted(v bool) *UpdateHealthCheckInput { + s.Inverted = &v + return s +} + +// SetPort sets the Port field's value. +func (s *UpdateHealthCheckInput) SetPort(v int64) *UpdateHealthCheckInput { + s.Port = &v + return s +} + +// SetRegions sets the Regions field's value. +func (s *UpdateHealthCheckInput) SetRegions(v []*string) *UpdateHealthCheckInput { + s.Regions = v + return s +} + +// SetResetElements sets the ResetElements field's value. +func (s *UpdateHealthCheckInput) SetResetElements(v []*string) *UpdateHealthCheckInput { + s.ResetElements = v + return s +} + +// SetResourcePath sets the ResourcePath field's value. +func (s *UpdateHealthCheckInput) SetResourcePath(v string) *UpdateHealthCheckInput { + s.ResourcePath = &v + return s +} + +// SetSearchString sets the SearchString field's value. +func (s *UpdateHealthCheckInput) SetSearchString(v string) *UpdateHealthCheckInput { + s.SearchString = &v + return s +} + +type UpdateHealthCheckOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains information about one health check that is associated + // with the current AWS account. + // + // HealthCheck is a required field + HealthCheck *HealthCheck `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateHealthCheckOutput) GoString() string { + return s.String() +} + +// SetHealthCheck sets the HealthCheck field's value. +func (s *UpdateHealthCheckOutput) SetHealthCheck(v *HealthCheck) *UpdateHealthCheckOutput { + s.HealthCheck = v + return s +} + +// A request to update the comment for a hosted zone. +type UpdateHostedZoneCommentInput struct { + _ struct{} `locationName:"UpdateHostedZoneCommentRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The new comment for the hosted zone. If you don't specify a value for Comment, + // Amazon Route 53 deletes the existing value of the Comment element, if any. + Comment *string `type:"string"` + + // The ID for the hosted zone that you want to update the comment for. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateHostedZoneCommentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateHostedZoneCommentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateHostedZoneCommentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateHostedZoneCommentInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *UpdateHostedZoneCommentInput) SetComment(v string) *UpdateHostedZoneCommentInput { + s.Comment = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateHostedZoneCommentInput) SetId(v string) *UpdateHostedZoneCommentInput { + s.Id = &v + return s +} + +// A complex type that contains the response to the UpdateHostedZoneComment +// request. +type UpdateHostedZoneCommentOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains general information about the hosted zone. + // + // HostedZone is a required field + HostedZone *HostedZone `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateHostedZoneCommentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateHostedZoneCommentOutput) GoString() string { + return s.String() +} + +// SetHostedZone sets the HostedZone field's value. +func (s *UpdateHostedZoneCommentOutput) SetHostedZone(v *HostedZone) *UpdateHostedZoneCommentOutput { + s.HostedZone = v + return s +} + +// A complex type that contains information about the traffic policy that you +// want to update the comment for. +type UpdateTrafficPolicyCommentInput struct { + _ struct{} `locationName:"UpdateTrafficPolicyCommentRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The new comment for the specified traffic policy and version. + // + // Comment is a required field + Comment *string `type:"string" required:"true"` + + // The value of Id for the traffic policy that you want to update the comment + // for. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` + + // The value of Version for the traffic policy that you want to update the comment + // for. + // + // Version is a required field + Version *int64 `location:"uri" locationName:"Version" min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s UpdateTrafficPolicyCommentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrafficPolicyCommentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTrafficPolicyCommentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTrafficPolicyCommentInput"} + if s.Comment == nil { + invalidParams.Add(request.NewErrParamRequired("Comment")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.Version == nil { + invalidParams.Add(request.NewErrParamRequired("Version")) + } + if s.Version != nil && *s.Version < 1 { + invalidParams.Add(request.NewErrParamMinValue("Version", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *UpdateTrafficPolicyCommentInput) SetComment(v string) *UpdateTrafficPolicyCommentInput { + s.Comment = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateTrafficPolicyCommentInput) SetId(v string) *UpdateTrafficPolicyCommentInput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *UpdateTrafficPolicyCommentInput) SetVersion(v int64) *UpdateTrafficPolicyCommentInput { + s.Version = &v + return s +} + +// A complex type that contains the response information for the traffic policy. +type UpdateTrafficPolicyCommentOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains settings for the specified traffic policy. + // + // TrafficPolicy is a required field + TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateTrafficPolicyCommentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrafficPolicyCommentOutput) GoString() string { + return s.String() +} + +// SetTrafficPolicy sets the TrafficPolicy field's value. +func (s *UpdateTrafficPolicyCommentOutput) SetTrafficPolicy(v *TrafficPolicy) *UpdateTrafficPolicyCommentOutput { + s.TrafficPolicy = v + return s +} + +// A complex type that contains information about the resource record sets that +// you want to update based on a specified traffic policy instance. +type UpdateTrafficPolicyInstanceInput struct { + _ struct{} `locationName:"UpdateTrafficPolicyInstanceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` + + // The ID of the traffic policy instance that you want to update. + // + // Id is a required field + Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` + + // The TTL that you want Amazon Route 53 to assign to all of the updated resource + // record sets. + // + // TTL is a required field + TTL *int64 `type:"long" required:"true"` + + // The ID of the traffic policy that you want Amazon Route 53 to use to update + // resource record sets for the specified traffic policy instance. + // + // TrafficPolicyId is a required field + TrafficPolicyId *string `min:"1" type:"string" required:"true"` + + // The version of the traffic policy that you want Amazon Route 53 to use to + // update resource record sets for the specified traffic policy instance. + // + // TrafficPolicyVersion is a required field + TrafficPolicyVersion *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s UpdateTrafficPolicyInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrafficPolicyInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTrafficPolicyInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTrafficPolicyInstanceInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.TTL == nil { + invalidParams.Add(request.NewErrParamRequired("TTL")) + } + if s.TrafficPolicyId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficPolicyId")) + } + if s.TrafficPolicyId != nil && len(*s.TrafficPolicyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyId", 1)) + } + if s.TrafficPolicyVersion == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficPolicyVersion")) + } + if s.TrafficPolicyVersion != nil && *s.TrafficPolicyVersion < 1 { + invalidParams.Add(request.NewErrParamMinValue("TrafficPolicyVersion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *UpdateTrafficPolicyInstanceInput) SetId(v string) *UpdateTrafficPolicyInstanceInput { + s.Id = &v + return s +} + +// SetTTL sets the TTL field's value. +func (s *UpdateTrafficPolicyInstanceInput) SetTTL(v int64) *UpdateTrafficPolicyInstanceInput { + s.TTL = &v + return s +} + +// SetTrafficPolicyId sets the TrafficPolicyId field's value. +func (s *UpdateTrafficPolicyInstanceInput) SetTrafficPolicyId(v string) *UpdateTrafficPolicyInstanceInput { + s.TrafficPolicyId = &v + return s +} + +// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. +func (s *UpdateTrafficPolicyInstanceInput) SetTrafficPolicyVersion(v int64) *UpdateTrafficPolicyInstanceInput { + s.TrafficPolicyVersion = &v + return s +} + +// A complex type that contains information about the resource record sets that +// Amazon Route 53 created based on a specified traffic policy. +type UpdateTrafficPolicyInstanceOutput struct { + _ struct{} `type:"structure"` + + // A complex type that contains settings for the updated traffic policy instance. + // + // TrafficPolicyInstance is a required field + TrafficPolicyInstance *TrafficPolicyInstance `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateTrafficPolicyInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrafficPolicyInstanceOutput) GoString() string { + return s.String() +} + +// SetTrafficPolicyInstance sets the TrafficPolicyInstance field's value. +func (s *UpdateTrafficPolicyInstanceOutput) SetTrafficPolicyInstance(v *TrafficPolicyInstance) *UpdateTrafficPolicyInstanceOutput { + s.TrafficPolicyInstance = v + return s +} + +// (Private hosted zones only) A complex type that contains information about +// an Amazon VPC. +type VPC struct { + _ struct{} `type:"structure"` + + // (Private hosted zones only) The ID of an Amazon VPC. + VPCId *string `type:"string"` + + // (Private hosted zones only) The region in which you created an Amazon VPC. + VPCRegion *string `min:"1" type:"string" enum:"VPCRegion"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VPC) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VPC"} + if s.VPCRegion != nil && len(*s.VPCRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VPCRegion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetVPCId sets the VPCId field's value. +func (s *VPC) SetVPCId(v string) *VPC { + s.VPCId = &v + return s +} + +// SetVPCRegion sets the VPCRegion field's value. +func (s *VPC) SetVPCRegion(v string) *VPC { + s.VPCRegion = &v + return s +} + +const ( + // AccountLimitTypeMaxHealthChecksByOwner is a AccountLimitType enum value + AccountLimitTypeMaxHealthChecksByOwner = "MAX_HEALTH_CHECKS_BY_OWNER" + + // AccountLimitTypeMaxHostedZonesByOwner is a AccountLimitType enum value + AccountLimitTypeMaxHostedZonesByOwner = "MAX_HOSTED_ZONES_BY_OWNER" + + // AccountLimitTypeMaxTrafficPolicyInstancesByOwner is a AccountLimitType enum value + AccountLimitTypeMaxTrafficPolicyInstancesByOwner = "MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER" + + // AccountLimitTypeMaxReusableDelegationSetsByOwner is a AccountLimitType enum value + AccountLimitTypeMaxReusableDelegationSetsByOwner = "MAX_REUSABLE_DELEGATION_SETS_BY_OWNER" + + // AccountLimitTypeMaxTrafficPoliciesByOwner is a AccountLimitType enum value + AccountLimitTypeMaxTrafficPoliciesByOwner = "MAX_TRAFFIC_POLICIES_BY_OWNER" +) + +const ( + // ChangeActionCreate is a ChangeAction enum value + ChangeActionCreate = "CREATE" + + // ChangeActionDelete is a ChangeAction enum value + ChangeActionDelete = "DELETE" + + // ChangeActionUpsert is a ChangeAction enum value + ChangeActionUpsert = "UPSERT" +) + +const ( + // ChangeStatusPending is a ChangeStatus enum value + ChangeStatusPending = "PENDING" + + // ChangeStatusInsync is a ChangeStatus enum value + ChangeStatusInsync = "INSYNC" +) + +const ( + // CloudWatchRegionUsEast1 is a CloudWatchRegion enum value + CloudWatchRegionUsEast1 = "us-east-1" + + // CloudWatchRegionUsEast2 is a CloudWatchRegion enum value + CloudWatchRegionUsEast2 = "us-east-2" + + // CloudWatchRegionUsWest1 is a CloudWatchRegion enum value + CloudWatchRegionUsWest1 = "us-west-1" + + // CloudWatchRegionUsWest2 is a CloudWatchRegion enum value + CloudWatchRegionUsWest2 = "us-west-2" + + // CloudWatchRegionCaCentral1 is a CloudWatchRegion enum value + CloudWatchRegionCaCentral1 = "ca-central-1" + + // CloudWatchRegionEuCentral1 is a CloudWatchRegion enum value + CloudWatchRegionEuCentral1 = "eu-central-1" + + // CloudWatchRegionEuWest1 is a CloudWatchRegion enum value + CloudWatchRegionEuWest1 = "eu-west-1" + + // CloudWatchRegionEuWest2 is a CloudWatchRegion enum value + CloudWatchRegionEuWest2 = "eu-west-2" + + // CloudWatchRegionEuWest3 is a CloudWatchRegion enum value + CloudWatchRegionEuWest3 = "eu-west-3" + + // CloudWatchRegionApSouth1 is a CloudWatchRegion enum value + CloudWatchRegionApSouth1 = "ap-south-1" + + // CloudWatchRegionApSoutheast1 is a CloudWatchRegion enum value + CloudWatchRegionApSoutheast1 = "ap-southeast-1" + + // CloudWatchRegionApSoutheast2 is a CloudWatchRegion enum value + CloudWatchRegionApSoutheast2 = "ap-southeast-2" + + // CloudWatchRegionApNortheast1 is a CloudWatchRegion enum value + CloudWatchRegionApNortheast1 = "ap-northeast-1" + + // CloudWatchRegionApNortheast2 is a CloudWatchRegion enum value + CloudWatchRegionApNortheast2 = "ap-northeast-2" + + // CloudWatchRegionApNortheast3 is a CloudWatchRegion enum value + CloudWatchRegionApNortheast3 = "ap-northeast-3" + + // CloudWatchRegionSaEast1 is a CloudWatchRegion enum value + CloudWatchRegionSaEast1 = "sa-east-1" +) + +const ( + // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value + ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold" + + // ComparisonOperatorGreaterThanThreshold is a ComparisonOperator enum value + ComparisonOperatorGreaterThanThreshold = "GreaterThanThreshold" + + // ComparisonOperatorLessThanThreshold is a ComparisonOperator enum value + ComparisonOperatorLessThanThreshold = "LessThanThreshold" + + // ComparisonOperatorLessThanOrEqualToThreshold is a ComparisonOperator enum value + ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold" +) + +const ( + // HealthCheckRegionUsEast1 is a HealthCheckRegion enum value + HealthCheckRegionUsEast1 = "us-east-1" + + // HealthCheckRegionUsWest1 is a HealthCheckRegion enum value + HealthCheckRegionUsWest1 = "us-west-1" + + // HealthCheckRegionUsWest2 is a HealthCheckRegion enum value + HealthCheckRegionUsWest2 = "us-west-2" + + // HealthCheckRegionEuWest1 is a HealthCheckRegion enum value + HealthCheckRegionEuWest1 = "eu-west-1" + + // HealthCheckRegionApSoutheast1 is a HealthCheckRegion enum value + HealthCheckRegionApSoutheast1 = "ap-southeast-1" + + // HealthCheckRegionApSoutheast2 is a HealthCheckRegion enum value + HealthCheckRegionApSoutheast2 = "ap-southeast-2" + + // HealthCheckRegionApNortheast1 is a HealthCheckRegion enum value + HealthCheckRegionApNortheast1 = "ap-northeast-1" + + // HealthCheckRegionSaEast1 is a HealthCheckRegion enum value + HealthCheckRegionSaEast1 = "sa-east-1" +) + +const ( + // HealthCheckTypeHttp is a HealthCheckType enum value + HealthCheckTypeHttp = "HTTP" + + // HealthCheckTypeHttps is a HealthCheckType enum value + HealthCheckTypeHttps = "HTTPS" + + // HealthCheckTypeHttpStrMatch is a HealthCheckType enum value + HealthCheckTypeHttpStrMatch = "HTTP_STR_MATCH" + + // HealthCheckTypeHttpsStrMatch is a HealthCheckType enum value + HealthCheckTypeHttpsStrMatch = "HTTPS_STR_MATCH" + + // HealthCheckTypeTcp is a HealthCheckType enum value + HealthCheckTypeTcp = "TCP" + + // HealthCheckTypeCalculated is a HealthCheckType enum value + HealthCheckTypeCalculated = "CALCULATED" + + // HealthCheckTypeCloudwatchMetric is a HealthCheckType enum value + HealthCheckTypeCloudwatchMetric = "CLOUDWATCH_METRIC" +) + +const ( + // HostedZoneLimitTypeMaxRrsetsByZone is a HostedZoneLimitType enum value + HostedZoneLimitTypeMaxRrsetsByZone = "MAX_RRSETS_BY_ZONE" + + // HostedZoneLimitTypeMaxVpcsAssociatedByZone is a HostedZoneLimitType enum value + HostedZoneLimitTypeMaxVpcsAssociatedByZone = "MAX_VPCS_ASSOCIATED_BY_ZONE" +) + +const ( + // InsufficientDataHealthStatusHealthy is a InsufficientDataHealthStatus enum value + InsufficientDataHealthStatusHealthy = "Healthy" + + // InsufficientDataHealthStatusUnhealthy is a InsufficientDataHealthStatus enum value + InsufficientDataHealthStatusUnhealthy = "Unhealthy" + + // InsufficientDataHealthStatusLastKnownStatus is a InsufficientDataHealthStatus enum value + InsufficientDataHealthStatusLastKnownStatus = "LastKnownStatus" +) + +const ( + // RRTypeSoa is a RRType enum value + RRTypeSoa = "SOA" + + // RRTypeA is a RRType enum value + RRTypeA = "A" + + // RRTypeTxt is a RRType enum value + RRTypeTxt = "TXT" + + // RRTypeNs is a RRType enum value + RRTypeNs = "NS" + + // RRTypeCname is a RRType enum value + RRTypeCname = "CNAME" + + // RRTypeMx is a RRType enum value + RRTypeMx = "MX" + + // RRTypeNaptr is a RRType enum value + RRTypeNaptr = "NAPTR" + + // RRTypePtr is a RRType enum value + RRTypePtr = "PTR" + + // RRTypeSrv is a RRType enum value + RRTypeSrv = "SRV" + + // RRTypeSpf is a RRType enum value + RRTypeSpf = "SPF" + + // RRTypeAaaa is a RRType enum value + RRTypeAaaa = "AAAA" + + // RRTypeCaa is a RRType enum value + RRTypeCaa = "CAA" +) + +const ( + // ResettableElementNameFullyQualifiedDomainName is a ResettableElementName enum value + ResettableElementNameFullyQualifiedDomainName = "FullyQualifiedDomainName" + + // ResettableElementNameRegions is a ResettableElementName enum value + ResettableElementNameRegions = "Regions" + + // ResettableElementNameResourcePath is a ResettableElementName enum value + ResettableElementNameResourcePath = "ResourcePath" + + // ResettableElementNameChildHealthChecks is a ResettableElementName enum value + ResettableElementNameChildHealthChecks = "ChildHealthChecks" +) + +const ( + // ResourceRecordSetFailoverPrimary is a ResourceRecordSetFailover enum value + ResourceRecordSetFailoverPrimary = "PRIMARY" + + // ResourceRecordSetFailoverSecondary is a ResourceRecordSetFailover enum value + ResourceRecordSetFailoverSecondary = "SECONDARY" +) + +const ( + // ResourceRecordSetRegionUsEast1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionUsEast1 = "us-east-1" + + // ResourceRecordSetRegionUsEast2 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionUsEast2 = "us-east-2" + + // ResourceRecordSetRegionUsWest1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionUsWest1 = "us-west-1" + + // ResourceRecordSetRegionUsWest2 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionUsWest2 = "us-west-2" + + // ResourceRecordSetRegionCaCentral1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionCaCentral1 = "ca-central-1" + + // ResourceRecordSetRegionEuWest1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionEuWest1 = "eu-west-1" + + // ResourceRecordSetRegionEuWest2 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionEuWest2 = "eu-west-2" + + // ResourceRecordSetRegionEuWest3 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionEuWest3 = "eu-west-3" + + // ResourceRecordSetRegionEuCentral1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionEuCentral1 = "eu-central-1" + + // ResourceRecordSetRegionApSoutheast1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionApSoutheast1 = "ap-southeast-1" + + // ResourceRecordSetRegionApSoutheast2 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionApSoutheast2 = "ap-southeast-2" + + // ResourceRecordSetRegionApNortheast1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionApNortheast1 = "ap-northeast-1" + + // ResourceRecordSetRegionApNortheast2 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionApNortheast2 = "ap-northeast-2" + + // ResourceRecordSetRegionApNortheast3 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionApNortheast3 = "ap-northeast-3" + + // ResourceRecordSetRegionSaEast1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionSaEast1 = "sa-east-1" + + // ResourceRecordSetRegionCnNorth1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionCnNorth1 = "cn-north-1" + + // ResourceRecordSetRegionCnNorthwest1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionCnNorthwest1 = "cn-northwest-1" + + // ResourceRecordSetRegionApSouth1 is a ResourceRecordSetRegion enum value + ResourceRecordSetRegionApSouth1 = "ap-south-1" +) + +const ( + // ReusableDelegationSetLimitTypeMaxZonesByReusableDelegationSet is a ReusableDelegationSetLimitType enum value + ReusableDelegationSetLimitTypeMaxZonesByReusableDelegationSet = "MAX_ZONES_BY_REUSABLE_DELEGATION_SET" +) + +const ( + // StatisticAverage is a Statistic enum value + StatisticAverage = "Average" + + // StatisticSum is a Statistic enum value + StatisticSum = "Sum" + + // StatisticSampleCount is a Statistic enum value + StatisticSampleCount = "SampleCount" + + // StatisticMaximum is a Statistic enum value + StatisticMaximum = "Maximum" + + // StatisticMinimum is a Statistic enum value + StatisticMinimum = "Minimum" +) + +const ( + // TagResourceTypeHealthcheck is a TagResourceType enum value + TagResourceTypeHealthcheck = "healthcheck" + + // TagResourceTypeHostedzone is a TagResourceType enum value + TagResourceTypeHostedzone = "hostedzone" +) + +const ( + // VPCRegionUsEast1 is a VPCRegion enum value + VPCRegionUsEast1 = "us-east-1" + + // VPCRegionUsEast2 is a VPCRegion enum value + VPCRegionUsEast2 = "us-east-2" + + // VPCRegionUsWest1 is a VPCRegion enum value + VPCRegionUsWest1 = "us-west-1" + + // VPCRegionUsWest2 is a VPCRegion enum value + VPCRegionUsWest2 = "us-west-2" + + // VPCRegionEuWest1 is a VPCRegion enum value + VPCRegionEuWest1 = "eu-west-1" + + // VPCRegionEuWest2 is a VPCRegion enum value + VPCRegionEuWest2 = "eu-west-2" + + // VPCRegionEuWest3 is a VPCRegion enum value + VPCRegionEuWest3 = "eu-west-3" + + // VPCRegionEuCentral1 is a VPCRegion enum value + VPCRegionEuCentral1 = "eu-central-1" + + // VPCRegionApSoutheast1 is a VPCRegion enum value + VPCRegionApSoutheast1 = "ap-southeast-1" + + // VPCRegionApSoutheast2 is a VPCRegion enum value + VPCRegionApSoutheast2 = "ap-southeast-2" + + // VPCRegionApSouth1 is a VPCRegion enum value + VPCRegionApSouth1 = "ap-south-1" + + // VPCRegionApNortheast1 is a VPCRegion enum value + VPCRegionApNortheast1 = "ap-northeast-1" + + // VPCRegionApNortheast2 is a VPCRegion enum value + VPCRegionApNortheast2 = "ap-northeast-2" + + // VPCRegionApNortheast3 is a VPCRegion enum value + VPCRegionApNortheast3 = "ap-northeast-3" + + // VPCRegionSaEast1 is a VPCRegion enum value + VPCRegionSaEast1 = "sa-east-1" + + // VPCRegionCaCentral1 is a VPCRegion enum value + VPCRegionCaCentral1 = "ca-central-1" + + // VPCRegionCnNorth1 is a VPCRegion enum value + VPCRegionCnNorth1 = "cn-north-1" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go new file mode 100644 index 00000000000..efe2d6e7c0a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go @@ -0,0 +1,42 @@ +package route53 + +import ( + "net/url" + "regexp" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/restxml" +) + +func init() { + initClient = func(c *client.Client) { + c.Handlers.Build.PushBack(sanitizeURL) + } + + initRequest = func(r *request.Request) { + switch r.Operation.Name { + case opChangeResourceRecordSets: + r.Handlers.UnmarshalError.Remove(restxml.UnmarshalErrorHandler) + r.Handlers.UnmarshalError.PushBack(unmarshalChangeResourceRecordSetsError) + } + } +} + +var reSanitizeURL = regexp.MustCompile(`\/%2F\w+%2F`) + +func sanitizeURL(r *request.Request) { + r.HTTPRequest.URL.RawPath = + reSanitizeURL.ReplaceAllString(r.HTTPRequest.URL.RawPath, "/") + + // Update Path so that it reflects the cleaned RawPath + updated, err := url.Parse(r.HTTPRequest.URL.RawPath) + if err != nil { + r.Error = awserr.New("SerializationError", "failed to clean Route53 URL", err) + return + } + + // Take the updated path so the requests's URL Path has parity with RawPath. + r.HTTPRequest.URL.Path = updated.Path +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go b/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go new file mode 100644 index 00000000000..7965fea67a9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go @@ -0,0 +1,26 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package route53 provides the client and types for making API +// requests to Amazon Route 53. +// +// See https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01 for more information on this service. +// +// See route53 package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/route53/ +// +// Using the Client +// +// To contact Amazon Route 53 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 Route 53 client Route53 for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/route53/#New +package route53 diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go new file mode 100644 index 00000000000..d37e10cdebd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go @@ -0,0 +1,436 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package route53 + +const ( + + // ErrCodeConcurrentModification for service response error code + // "ConcurrentModification". + // + // Another user submitted a request to create, update, or delete the object + // at the same time that you did. Retry the request. + ErrCodeConcurrentModification = "ConcurrentModification" + + // ErrCodeConflictingDomainExists for service response error code + // "ConflictingDomainExists". + // + // The cause of this error depends on whether you're trying to create a public + // or a private hosted zone: + // + // * Public hosted zone: Two hosted zones that have the same name or that + // have a parent/child relationship (example.com and test.example.com) can't + // have any common name servers. You tried to create a hosted zone that has + // the same name as an existing hosted zone or that's the parent or child + // of an existing hosted zone, and you specified a delegation set that shares + // one or more name servers with the existing hosted zone. For more information, + // see CreateReusableDelegationSet. + // + // * Private hosted zone: You specified an Amazon VPC that you're already + // using for another hosted zone, and the domain that you specified for one + // of the hosted zones is a subdomain of the domain that you specified for + // the other hosted zone. For example, you can't use the same Amazon VPC + // for the hosted zones for example.com and test.example.com. + ErrCodeConflictingDomainExists = "ConflictingDomainExists" + + // ErrCodeConflictingTypes for service response error code + // "ConflictingTypes". + // + // You tried to update a traffic policy instance by using a traffic policy version + // that has a different DNS type than the current type for the instance. You + // specified the type in the JSON document in the CreateTrafficPolicy or CreateTrafficPolicyVersionrequest. + ErrCodeConflictingTypes = "ConflictingTypes" + + // ErrCodeDelegationSetAlreadyCreated for service response error code + // "DelegationSetAlreadyCreated". + // + // A delegation set with the same owner and caller reference combination has + // already been created. + ErrCodeDelegationSetAlreadyCreated = "DelegationSetAlreadyCreated" + + // ErrCodeDelegationSetAlreadyReusable for service response error code + // "DelegationSetAlreadyReusable". + // + // The specified delegation set has already been marked as reusable. + ErrCodeDelegationSetAlreadyReusable = "DelegationSetAlreadyReusable" + + // ErrCodeDelegationSetInUse for service response error code + // "DelegationSetInUse". + // + // The specified delegation contains associated hosted zones which must be deleted + // before the reusable delegation set can be deleted. + ErrCodeDelegationSetInUse = "DelegationSetInUse" + + // ErrCodeDelegationSetNotAvailable for service response error code + // "DelegationSetNotAvailable". + // + // You can create a hosted zone that has the same name as an existing hosted + // zone (example.com is common), but there is a limit to the number of hosted + // zones that have the same name. If you get this error, Amazon Route 53 has + // reached that limit. If you own the domain name and Amazon Route 53 generates + // this error, contact Customer Support. + ErrCodeDelegationSetNotAvailable = "DelegationSetNotAvailable" + + // ErrCodeDelegationSetNotReusable for service response error code + // "DelegationSetNotReusable". + // + // A reusable delegation set with the specified ID does not exist. + ErrCodeDelegationSetNotReusable = "DelegationSetNotReusable" + + // ErrCodeHealthCheckAlreadyExists for service response error code + // "HealthCheckAlreadyExists". + // + // The health check you're attempting to create already exists. Amazon Route + // 53 returns this error when you submit a request that has the following values: + // + // * The same value for CallerReference as an existing health check, and + // one or more values that differ from the existing health check that has + // the same caller reference. + // + // * The same value for CallerReference as a health check that you created + // and later deleted, regardless of the other settings in the request. + ErrCodeHealthCheckAlreadyExists = "HealthCheckAlreadyExists" + + // ErrCodeHealthCheckInUse for service response error code + // "HealthCheckInUse". + // + // This error code is not in use. + ErrCodeHealthCheckInUse = "HealthCheckInUse" + + // ErrCodeHealthCheckVersionMismatch for service response error code + // "HealthCheckVersionMismatch". + // + // The value of HealthCheckVersion in the request doesn't match the value of + // HealthCheckVersion in the health check. + ErrCodeHealthCheckVersionMismatch = "HealthCheckVersionMismatch" + + // ErrCodeHostedZoneAlreadyExists for service response error code + // "HostedZoneAlreadyExists". + // + // The hosted zone you're trying to create already exists. Amazon Route 53 returns + // this error when a hosted zone has already been created with the specified + // CallerReference. + ErrCodeHostedZoneAlreadyExists = "HostedZoneAlreadyExists" + + // ErrCodeHostedZoneNotEmpty for service response error code + // "HostedZoneNotEmpty". + // + // The hosted zone contains resource records that are not SOA or NS records. + ErrCodeHostedZoneNotEmpty = "HostedZoneNotEmpty" + + // ErrCodeHostedZoneNotFound for service response error code + // "HostedZoneNotFound". + // + // The specified HostedZone can't be found. + ErrCodeHostedZoneNotFound = "HostedZoneNotFound" + + // ErrCodeHostedZoneNotPrivate for service response error code + // "HostedZoneNotPrivate". + // + // The specified hosted zone is a public hosted zone, not a private hosted zone. + ErrCodeHostedZoneNotPrivate = "HostedZoneNotPrivate" + + // ErrCodeIncompatibleVersion for service response error code + // "IncompatibleVersion". + // + // The resource you're trying to access is unsupported on this Amazon Route + // 53 endpoint. + ErrCodeIncompatibleVersion = "IncompatibleVersion" + + // ErrCodeInsufficientCloudWatchLogsResourcePolicy for service response error code + // "InsufficientCloudWatchLogsResourcePolicy". + // + // Amazon Route 53 doesn't have the permissions required to create log streams + // and send query logs to log streams. Possible causes include the following: + // + // * There is no resource policy that specifies the log group ARN in the + // value for Resource. + // + // * The resource policy that includes the log group ARN in the value for + // Resource doesn't have the necessary permissions. + // + // * The resource policy hasn't finished propagating yet. + ErrCodeInsufficientCloudWatchLogsResourcePolicy = "InsufficientCloudWatchLogsResourcePolicy" + + // ErrCodeInvalidArgument for service response error code + // "InvalidArgument". + // + // Parameter name is invalid. + ErrCodeInvalidArgument = "InvalidArgument" + + // ErrCodeInvalidChangeBatch for service response error code + // "InvalidChangeBatch". + // + // This exception contains a list of messages that might contain one or more + // error messages. Each error message indicates one error in the change batch. + ErrCodeInvalidChangeBatch = "InvalidChangeBatch" + + // ErrCodeInvalidDomainName for service response error code + // "InvalidDomainName". + // + // The specified domain name is not valid. + ErrCodeInvalidDomainName = "InvalidDomainName" + + // ErrCodeInvalidInput for service response error code + // "InvalidInput". + // + // The input is not valid. + ErrCodeInvalidInput = "InvalidInput" + + // ErrCodeInvalidPaginationToken for service response error code + // "InvalidPaginationToken". + // + // The value that you specified to get the second or subsequent page of results + // is invalid. + ErrCodeInvalidPaginationToken = "InvalidPaginationToken" + + // ErrCodeInvalidTrafficPolicyDocument for service response error code + // "InvalidTrafficPolicyDocument". + // + // The format of the traffic policy document that you specified in the Document + // element is invalid. + ErrCodeInvalidTrafficPolicyDocument = "InvalidTrafficPolicyDocument" + + // ErrCodeInvalidVPCId for service response error code + // "InvalidVPCId". + // + // The VPC ID that you specified either isn't a valid ID or the current account + // is not authorized to access this VPC. + ErrCodeInvalidVPCId = "InvalidVPCId" + + // ErrCodeLastVPCAssociation for service response error code + // "LastVPCAssociation". + // + // The VPC that you're trying to disassociate from the private hosted zone is + // the last VPC that is associated with the hosted zone. Amazon Route 53 doesn't + // support disassociating the last VPC from a hosted zone. + ErrCodeLastVPCAssociation = "LastVPCAssociation" + + // ErrCodeLimitsExceeded for service response error code + // "LimitsExceeded". + // + // This operation can't be completed either because the current account has + // reached the limit on reusable delegation sets that it can create or because + // you've reached the limit on the number of Amazon VPCs that you can associate + // with a private hosted zone. To get the current limit on the number of reusable + // delegation sets, see GetAccountLimit. To get the current limit on the number + // of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit. + // To request a higher limit, create a case (http://aws.amazon.com/route53-request) + // with the AWS Support Center. + ErrCodeLimitsExceeded = "LimitsExceeded" + + // ErrCodeNoSuchChange for service response error code + // "NoSuchChange". + // + // A change with the specified change ID does not exist. + ErrCodeNoSuchChange = "NoSuchChange" + + // ErrCodeNoSuchCloudWatchLogsLogGroup for service response error code + // "NoSuchCloudWatchLogsLogGroup". + // + // There is no CloudWatch Logs log group with the specified ARN. + ErrCodeNoSuchCloudWatchLogsLogGroup = "NoSuchCloudWatchLogsLogGroup" + + // ErrCodeNoSuchDelegationSet for service response error code + // "NoSuchDelegationSet". + // + // A reusable delegation set with the specified ID does not exist. + ErrCodeNoSuchDelegationSet = "NoSuchDelegationSet" + + // ErrCodeNoSuchGeoLocation for service response error code + // "NoSuchGeoLocation". + // + // Amazon Route 53 doesn't support the specified geolocation. + ErrCodeNoSuchGeoLocation = "NoSuchGeoLocation" + + // ErrCodeNoSuchHealthCheck for service response error code + // "NoSuchHealthCheck". + // + // No health check exists with the ID that you specified in the DeleteHealthCheck + // request. + ErrCodeNoSuchHealthCheck = "NoSuchHealthCheck" + + // ErrCodeNoSuchHostedZone for service response error code + // "NoSuchHostedZone". + // + // No hosted zone exists with the ID that you specified. + ErrCodeNoSuchHostedZone = "NoSuchHostedZone" + + // ErrCodeNoSuchQueryLoggingConfig for service response error code + // "NoSuchQueryLoggingConfig". + // + // There is no DNS query logging configuration with the specified ID. + ErrCodeNoSuchQueryLoggingConfig = "NoSuchQueryLoggingConfig" + + // ErrCodeNoSuchTrafficPolicy for service response error code + // "NoSuchTrafficPolicy". + // + // No traffic policy exists with the specified ID. + ErrCodeNoSuchTrafficPolicy = "NoSuchTrafficPolicy" + + // ErrCodeNoSuchTrafficPolicyInstance for service response error code + // "NoSuchTrafficPolicyInstance". + // + // No traffic policy instance exists with the specified ID. + ErrCodeNoSuchTrafficPolicyInstance = "NoSuchTrafficPolicyInstance" + + // ErrCodeNotAuthorizedException for service response error code + // "NotAuthorizedException". + // + // Associating the specified VPC with the specified hosted zone has not been + // authorized. + ErrCodeNotAuthorizedException = "NotAuthorizedException" + + // ErrCodePriorRequestNotComplete for service response error code + // "PriorRequestNotComplete". + // + // If Amazon Route 53 can't process a request before the next request arrives, + // it will reject subsequent requests for the same hosted zone and return an + // HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly + // for the same request, we recommend that you wait, in intervals of increasing + // duration, before you try the request again. + ErrCodePriorRequestNotComplete = "PriorRequestNotComplete" + + // ErrCodePublicZoneVPCAssociation for service response error code + // "PublicZoneVPCAssociation". + // + // You're trying to associate a VPC with a public hosted zone. Amazon Route + // 53 doesn't support associating a VPC with a public hosted zone. + ErrCodePublicZoneVPCAssociation = "PublicZoneVPCAssociation" + + // ErrCodeQueryLoggingConfigAlreadyExists for service response error code + // "QueryLoggingConfigAlreadyExists". + // + // You can create only one query logging configuration for a hosted zone, and + // a query logging configuration already exists for this hosted zone. + ErrCodeQueryLoggingConfigAlreadyExists = "QueryLoggingConfigAlreadyExists" + + // ErrCodeThrottlingException for service response error code + // "ThrottlingException". + // + // The limit on the number of requests per second was exceeded. + ErrCodeThrottlingException = "ThrottlingException" + + // ErrCodeTooManyHealthChecks for service response error code + // "TooManyHealthChecks". + // + // This health check can't be created because the current account has reached + // the limit on the number of active health checks. + // + // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) + // in the Amazon Route 53 Developer Guide. + // + // For information about how to get the current limit for an account, see GetAccountLimit. + // To request a higher limit, create a case (http://aws.amazon.com/route53-request) + // with the AWS Support Center. + // + // You have reached the maximum number of active health checks for an AWS account. + // To request a higher limit, create a case (http://aws.amazon.com/route53-request) + // with the AWS Support Center. + ErrCodeTooManyHealthChecks = "TooManyHealthChecks" + + // ErrCodeTooManyHostedZones for service response error code + // "TooManyHostedZones". + // + // This operation can't be completed either because the current account has + // reached the limit on the number of hosted zones or because you've reached + // the limit on the number of hosted zones that can be associated with a reusable + // delegation set. + // + // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) + // in the Amazon Route 53 Developer Guide. + // + // To get the current limit on hosted zones that can be created by an account, + // see GetAccountLimit. + // + // To get the current limit on hosted zones that can be associated with a reusable + // delegation set, see GetReusableDelegationSetLimit. + // + // To request a higher limit, create a case (http://aws.amazon.com/route53-request) + // with the AWS Support Center. + ErrCodeTooManyHostedZones = "TooManyHostedZones" + + // ErrCodeTooManyTrafficPolicies for service response error code + // "TooManyTrafficPolicies". + // + // This traffic policy can't be created because the current account has reached + // the limit on the number of traffic policies. + // + // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) + // in the Amazon Route 53 Developer Guide. + // + // To get the current limit for an account, see GetAccountLimit. + // + // To request a higher limit, create a case (http://aws.amazon.com/route53-request) + // with the AWS Support Center. + ErrCodeTooManyTrafficPolicies = "TooManyTrafficPolicies" + + // ErrCodeTooManyTrafficPolicyInstances for service response error code + // "TooManyTrafficPolicyInstances". + // + // This traffic policy instance can't be created because the current account + // has reached the limit on the number of traffic policy instances. + // + // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) + // in the Amazon Route 53 Developer Guide. + // + // For information about how to get the current limit for an account, see GetAccountLimit. + // + // To request a higher limit, create a case (http://aws.amazon.com/route53-request) + // with the AWS Support Center. + ErrCodeTooManyTrafficPolicyInstances = "TooManyTrafficPolicyInstances" + + // ErrCodeTooManyTrafficPolicyVersionsForCurrentPolicy for service response error code + // "TooManyTrafficPolicyVersionsForCurrentPolicy". + // + // This traffic policy version can't be created because you've reached the limit + // of 1000 on the number of versions that you can create for the current traffic + // policy. + // + // To create more traffic policy versions, you can use GetTrafficPolicy to get + // the traffic policy document for a specified traffic policy version, and then + // use CreateTrafficPolicy to create a new traffic policy using the traffic + // policy document. + ErrCodeTooManyTrafficPolicyVersionsForCurrentPolicy = "TooManyTrafficPolicyVersionsForCurrentPolicy" + + // ErrCodeTooManyVPCAssociationAuthorizations for service response error code + // "TooManyVPCAssociationAuthorizations". + // + // You've created the maximum number of authorizations that can be created for + // the specified hosted zone. To authorize another VPC to be associated with + // the hosted zone, submit a DeleteVPCAssociationAuthorization request to remove + // an existing authorization. To get a list of existing authorizations, submit + // a ListVPCAssociationAuthorizations request. + ErrCodeTooManyVPCAssociationAuthorizations = "TooManyVPCAssociationAuthorizations" + + // ErrCodeTrafficPolicyAlreadyExists for service response error code + // "TrafficPolicyAlreadyExists". + // + // A traffic policy that has the same value for Name already exists. + ErrCodeTrafficPolicyAlreadyExists = "TrafficPolicyAlreadyExists" + + // ErrCodeTrafficPolicyInUse for service response error code + // "TrafficPolicyInUse". + // + // One or more traffic policy instances were created by using the specified + // traffic policy. + ErrCodeTrafficPolicyInUse = "TrafficPolicyInUse" + + // ErrCodeTrafficPolicyInstanceAlreadyExists for service response error code + // "TrafficPolicyInstanceAlreadyExists". + // + // There is already a traffic policy instance with the specified ID. + ErrCodeTrafficPolicyInstanceAlreadyExists = "TrafficPolicyInstanceAlreadyExists" + + // ErrCodeVPCAssociationAuthorizationNotFound for service response error code + // "VPCAssociationAuthorizationNotFound". + // + // The VPC that you specified is not authorized to be associated with the hosted + // zone. + ErrCodeVPCAssociationAuthorizationNotFound = "VPCAssociationAuthorizationNotFound" + + // ErrCodeVPCAssociationNotFound for service response error code + // "VPCAssociationNotFound". + // + // The specified VPC and hosted zone are not currently associated. + ErrCodeVPCAssociationNotFound = "VPCAssociationNotFound" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go new file mode 100644 index 00000000000..dd22cb2cd84 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go @@ -0,0 +1,95 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package route53 + +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/restxml" +) + +// Route53 provides the API operation methods for making requests to +// Amazon Route 53. See this package's package overview docs +// for details on the service. +// +// Route53 methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type Route53 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 = "route53" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "Route 53" // ServiceID is a unique identifer of a specific service. +) + +// New creates a new instance of the Route53 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 Route53 client from just a session. +// svc := route53.New(mySession) +// +// // Create a Route53 client with additional configuration +// svc := route53.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *Route53 { + 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) *Route53 { + svc := &Route53{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2013-04-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a Route53 operation and runs any +// custom request initialization. +func (c *Route53) 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/route53/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go new file mode 100644 index 00000000000..266e9a8ba43 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go @@ -0,0 +1,77 @@ +package route53 + +import ( + "bytes" + "encoding/xml" + "io/ioutil" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/restxml" +) + +type baseXMLErrorResponse struct { + XMLName xml.Name +} + +type standardXMLErrorResponse struct { + XMLName xml.Name `xml:"ErrorResponse"` + Code string `xml:"Error>Code"` + Message string `xml:"Error>Message"` + RequestID string `xml:"RequestId"` +} + +type invalidChangeBatchXMLErrorResponse struct { + XMLName xml.Name `xml:"InvalidChangeBatch"` + Messages []string `xml:"Messages>Message"` +} + +func unmarshalChangeResourceRecordSetsError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + + responseBody, err := ioutil.ReadAll(r.HTTPResponse.Body) + + if err != nil { + r.Error = awserr.New("SerializationError", "failed to read Route53 XML error response", err) + return + } + + baseError := &baseXMLErrorResponse{} + + if err := xml.Unmarshal(responseBody, baseError); err != nil { + r.Error = awserr.New("SerializationError", "failed to decode Route53 XML error response", err) + return + } + + switch baseError.XMLName.Local { + case "InvalidChangeBatch": + unmarshalInvalidChangeBatchError(r, responseBody) + default: + r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewReader(responseBody)) + restxml.UnmarshalError(r) + } +} + +func unmarshalInvalidChangeBatchError(r *request.Request, requestBody []byte) { + resp := &invalidChangeBatchXMLErrorResponse{} + err := xml.Unmarshal(requestBody, resp) + + if err != nil { + r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err) + return + } + + const errorCode = "InvalidChangeBatch" + errors := []error{} + + for _, msg := range resp.Messages { + errors = append(errors, awserr.New(errorCode, msg, nil)) + } + + r.Error = awserr.NewRequestFailure( + awserr.NewBatchError(errorCode, "ChangeBatch errors occurred", errors), + r.HTTPResponse.StatusCode, + r.RequestID, + ) + +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go new file mode 100644 index 00000000000..9bd7a9a7174 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go @@ -0,0 +1,56 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package route53 + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilResourceRecordSetsChanged uses the Route 53 API operation +// GetChange 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 *Route53) WaitUntilResourceRecordSetsChanged(input *GetChangeInput) error { + return c.WaitUntilResourceRecordSetsChangedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilResourceRecordSetsChangedWithContext is an extended version of WaitUntilResourceRecordSetsChanged. +// 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 *Route53) WaitUntilResourceRecordSetsChangedWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilResourceRecordSetsChanged", + MaxAttempts: 60, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ChangeInfo.Status", + Expected: "INSYNC", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetChangeInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetChangeRequest(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/s3/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/s3/BUILD.bazel new file mode 100644 index 00000000000..3d29938c892 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "body_hash.go", + "bucket_location.go", + "customizations.go", + "doc.go", + "doc_custom.go", + "errors.go", + "host_style_bucket.go", + "platform_handlers.go", + "platform_handlers_go1.6.go", + "service.go", + "sse.go", + "statusok_error.go", + "unmarshal_error.go", + "waiters.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/s3", + importpath = "github.com/aws/aws-sdk-go/service/s3", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/internal/sdkio:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/rest:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/restxml:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go new file mode 100644 index 00000000000..10436195009 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -0,0 +1,22357 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package s3 + +import ( + "bytes" + "fmt" + "io" + "sync" + "sync/atomic" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/eventstream" + "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" + "github.com/aws/aws-sdk-go/private/protocol/rest" + "github.com/aws/aws-sdk-go/private/protocol/restxml" +) + +const opAbortMultipartUpload = "AbortMultipartUpload" + +// AbortMultipartUploadRequest generates a "aws/request.Request" representing the +// client's request for the AbortMultipartUpload operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AbortMultipartUpload for more information on using the AbortMultipartUpload +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AbortMultipartUploadRequest method. +// req, resp := client.AbortMultipartUploadRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload +func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req *request.Request, output *AbortMultipartUploadOutput) { + op := &request.Operation{ + Name: opAbortMultipartUpload, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &AbortMultipartUploadInput{} + } + + output = &AbortMultipartUploadOutput{} + req = c.newRequest(op, input, output) + return +} + +// AbortMultipartUpload API operation for Amazon Simple Storage Service. +// +// Aborts a multipart upload. +// +// To verify that all parts have been removed, so you don't get charged for +// the part storage, you should call the List Parts operation and ensure the +// parts list is empty. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation AbortMultipartUpload for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchUpload "NoSuchUpload" +// The specified multipart upload does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload +func (c *S3) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { + req, out := c.AbortMultipartUploadRequest(input) + return out, req.Send() +} + +// AbortMultipartUploadWithContext is the same as AbortMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See AbortMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) AbortMultipartUploadWithContext(ctx aws.Context, input *AbortMultipartUploadInput, opts ...request.Option) (*AbortMultipartUploadOutput, error) { + req, out := c.AbortMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCompleteMultipartUpload = "CompleteMultipartUpload" + +// CompleteMultipartUploadRequest generates a "aws/request.Request" representing the +// client's request for the CompleteMultipartUpload operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CompleteMultipartUpload for more information on using the CompleteMultipartUpload +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CompleteMultipartUploadRequest method. +// req, resp := client.CompleteMultipartUploadRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload +func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) (req *request.Request, output *CompleteMultipartUploadOutput) { + op := &request.Operation{ + Name: opCompleteMultipartUpload, + HTTPMethod: "POST", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &CompleteMultipartUploadInput{} + } + + output = &CompleteMultipartUploadOutput{} + req = c.newRequest(op, input, output) + return +} + +// CompleteMultipartUpload API operation for Amazon Simple Storage Service. +// +// Completes a multipart upload by assembling previously uploaded parts. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation CompleteMultipartUpload for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload +func (c *S3) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*CompleteMultipartUploadOutput, error) { + req, out := c.CompleteMultipartUploadRequest(input) + return out, req.Send() +} + +// CompleteMultipartUploadWithContext is the same as CompleteMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) CompleteMultipartUploadWithContext(ctx aws.Context, input *CompleteMultipartUploadInput, opts ...request.Option) (*CompleteMultipartUploadOutput, error) { + req, out := c.CompleteMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCopyObject = "CopyObject" + +// CopyObjectRequest generates a "aws/request.Request" representing the +// client's request for the CopyObject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CopyObject for more information on using the CopyObject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CopyObjectRequest method. +// req, resp := client.CopyObjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject +func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, output *CopyObjectOutput) { + op := &request.Operation{ + Name: opCopyObject, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &CopyObjectInput{} + } + + output = &CopyObjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// CopyObject API operation for Amazon Simple Storage Service. +// +// Creates a copy of an object that is already stored in Amazon S3. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation CopyObject for usage and error information. +// +// Returned Error Codes: +// * ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError" +// The source object of the COPY operation is not in the active tier and is +// only stored in Amazon Glacier. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject +func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { + req, out := c.CopyObjectRequest(input) + return out, req.Send() +} + +// CopyObjectWithContext is the same as CopyObject with the addition of +// the ability to pass a context and additional request options. +// +// See CopyObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) CopyObjectWithContext(ctx aws.Context, input *CopyObjectInput, opts ...request.Option) (*CopyObjectOutput, error) { + req, out := c.CopyObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateBucket = "CreateBucket" + +// CreateBucketRequest generates a "aws/request.Request" representing the +// client's request for the CreateBucket operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateBucket for more information on using the CreateBucket +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateBucketRequest method. +// req, resp := client.CreateBucketRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket +func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request, output *CreateBucketOutput) { + op := &request.Operation{ + Name: opCreateBucket, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}", + } + + if input == nil { + input = &CreateBucketInput{} + } + + output = &CreateBucketOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateBucket API operation for Amazon Simple Storage Service. +// +// Creates a new bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation CreateBucket for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBucketAlreadyExists "BucketAlreadyExists" +// The requested bucket name is not available. The bucket namespace is shared +// by all users of the system. Please select a different name and try again. +// +// * ErrCodeBucketAlreadyOwnedByYou "BucketAlreadyOwnedByYou" +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket +func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) { + req, out := c.CreateBucketRequest(input) + return out, req.Send() +} + +// CreateBucketWithContext is the same as CreateBucket with the addition of +// the ability to pass a context and additional request options. +// +// See CreateBucket for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) CreateBucketWithContext(ctx aws.Context, input *CreateBucketInput, opts ...request.Option) (*CreateBucketOutput, error) { + req, out := c.CreateBucketRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateMultipartUpload = "CreateMultipartUpload" + +// CreateMultipartUploadRequest generates a "aws/request.Request" representing the +// client's request for the CreateMultipartUpload operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateMultipartUpload for more information on using the CreateMultipartUpload +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateMultipartUploadRequest method. +// req, resp := client.CreateMultipartUploadRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload +func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (req *request.Request, output *CreateMultipartUploadOutput) { + op := &request.Operation{ + Name: opCreateMultipartUpload, + HTTPMethod: "POST", + HTTPPath: "/{Bucket}/{Key+}?uploads", + } + + if input == nil { + input = &CreateMultipartUploadInput{} + } + + output = &CreateMultipartUploadOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateMultipartUpload API operation for Amazon Simple Storage Service. +// +// Initiates a multipart upload and returns an upload ID. +// +// Note: After you initiate multipart upload and upload one or more parts, you +// must either complete or abort multipart upload in order to stop getting charged +// for storage of the uploaded parts. Only after you either complete or abort +// multipart upload, Amazon S3 frees up the parts storage and stops charging +// you for the parts storage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation CreateMultipartUpload for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload +func (c *S3) CreateMultipartUpload(input *CreateMultipartUploadInput) (*CreateMultipartUploadOutput, error) { + req, out := c.CreateMultipartUploadRequest(input) + return out, req.Send() +} + +// CreateMultipartUploadWithContext is the same as CreateMultipartUpload with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMultipartUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) CreateMultipartUploadWithContext(ctx aws.Context, input *CreateMultipartUploadInput, opts ...request.Option) (*CreateMultipartUploadOutput, error) { + req, out := c.CreateMultipartUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucket = "DeleteBucket" + +// DeleteBucketRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucket operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucket for more information on using the DeleteBucket +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketRequest method. +// req, resp := client.DeleteBucketRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket +func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request, output *DeleteBucketOutput) { + op := &request.Operation{ + Name: opDeleteBucket, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}", + } + + if input == nil { + input = &DeleteBucketInput{} + } + + output = &DeleteBucketOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucket API operation for Amazon Simple Storage Service. +// +// Deletes the bucket. All objects (including all object versions and Delete +// Markers) in the bucket must be deleted before the bucket itself can be 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 Simple Storage Service's +// API operation DeleteBucket for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket +func (c *S3) DeleteBucket(input *DeleteBucketInput) (*DeleteBucketOutput, error) { + req, out := c.DeleteBucketRequest(input) + return out, req.Send() +} + +// DeleteBucketWithContext is the same as DeleteBucket with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucket for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketWithContext(ctx aws.Context, input *DeleteBucketInput, opts ...request.Option) (*DeleteBucketOutput, error) { + req, out := c.DeleteBucketRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration" + +// DeleteBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketAnalyticsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketAnalyticsConfiguration for more information on using the DeleteBucketAnalyticsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketAnalyticsConfigurationRequest method. +// req, resp := client.DeleteBucketAnalyticsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration +func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyticsConfigurationInput) (req *request.Request, output *DeleteBucketAnalyticsConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteBucketAnalyticsConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?analytics", + } + + if input == nil { + input = &DeleteBucketAnalyticsConfigurationInput{} + } + + output = &DeleteBucketAnalyticsConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. +// +// Deletes an analytics configuration for the bucket (specified by the analytics +// configuration 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 Simple Storage Service's +// API operation DeleteBucketAnalyticsConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration +func (c *S3) DeleteBucketAnalyticsConfiguration(input *DeleteBucketAnalyticsConfigurationInput) (*DeleteBucketAnalyticsConfigurationOutput, error) { + req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) + return out, req.Send() +} + +// DeleteBucketAnalyticsConfigurationWithContext is the same as DeleteBucketAnalyticsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketAnalyticsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *DeleteBucketAnalyticsConfigurationInput, opts ...request.Option) (*DeleteBucketAnalyticsConfigurationOutput, error) { + req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketCors = "DeleteBucketCors" + +// DeleteBucketCorsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketCors operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketCors for more information on using the DeleteBucketCors +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketCorsRequest method. +// req, resp := client.DeleteBucketCorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors +func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request.Request, output *DeleteBucketCorsOutput) { + op := &request.Operation{ + Name: opDeleteBucketCors, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?cors", + } + + if input == nil { + input = &DeleteBucketCorsInput{} + } + + output = &DeleteBucketCorsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketCors API operation for Amazon Simple Storage Service. +// +// Deletes the cors configuration information set for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketCors for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors +func (c *S3) DeleteBucketCors(input *DeleteBucketCorsInput) (*DeleteBucketCorsOutput, error) { + req, out := c.DeleteBucketCorsRequest(input) + return out, req.Send() +} + +// DeleteBucketCorsWithContext is the same as DeleteBucketCors with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketCors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketCorsWithContext(ctx aws.Context, input *DeleteBucketCorsInput, opts ...request.Option) (*DeleteBucketCorsOutput, error) { + req, out := c.DeleteBucketCorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketEncryption = "DeleteBucketEncryption" + +// DeleteBucketEncryptionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketEncryption operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketEncryption for more information on using the DeleteBucketEncryption +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketEncryptionRequest method. +// req, resp := client.DeleteBucketEncryptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketEncryption +func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) (req *request.Request, output *DeleteBucketEncryptionOutput) { + op := &request.Operation{ + Name: opDeleteBucketEncryption, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?encryption", + } + + if input == nil { + input = &DeleteBucketEncryptionInput{} + } + + output = &DeleteBucketEncryptionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketEncryption API operation for Amazon Simple Storage Service. +// +// Deletes the server-side encryption configuration from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketEncryption for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketEncryption +func (c *S3) DeleteBucketEncryption(input *DeleteBucketEncryptionInput) (*DeleteBucketEncryptionOutput, error) { + req, out := c.DeleteBucketEncryptionRequest(input) + return out, req.Send() +} + +// DeleteBucketEncryptionWithContext is the same as DeleteBucketEncryption with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketEncryption for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketEncryptionWithContext(ctx aws.Context, input *DeleteBucketEncryptionInput, opts ...request.Option) (*DeleteBucketEncryptionOutput, error) { + req, out := c.DeleteBucketEncryptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration" + +// DeleteBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketInventoryConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketInventoryConfiguration for more information on using the DeleteBucketInventoryConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketInventoryConfigurationRequest method. +// req, resp := client.DeleteBucketInventoryConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration +func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInventoryConfigurationInput) (req *request.Request, output *DeleteBucketInventoryConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteBucketInventoryConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?inventory", + } + + if input == nil { + input = &DeleteBucketInventoryConfigurationInput{} + } + + output = &DeleteBucketInventoryConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketInventoryConfiguration API operation for Amazon Simple Storage Service. +// +// Deletes an inventory configuration (identified by the inventory ID) from +// the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketInventoryConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration +func (c *S3) DeleteBucketInventoryConfiguration(input *DeleteBucketInventoryConfigurationInput) (*DeleteBucketInventoryConfigurationOutput, error) { + req, out := c.DeleteBucketInventoryConfigurationRequest(input) + return out, req.Send() +} + +// DeleteBucketInventoryConfigurationWithContext is the same as DeleteBucketInventoryConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketInventoryConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketInventoryConfigurationWithContext(ctx aws.Context, input *DeleteBucketInventoryConfigurationInput, opts ...request.Option) (*DeleteBucketInventoryConfigurationOutput, error) { + req, out := c.DeleteBucketInventoryConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketLifecycle = "DeleteBucketLifecycle" + +// DeleteBucketLifecycleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketLifecycle operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketLifecycle for more information on using the DeleteBucketLifecycle +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketLifecycleRequest method. +// req, resp := client.DeleteBucketLifecycleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle +func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (req *request.Request, output *DeleteBucketLifecycleOutput) { + op := &request.Operation{ + Name: opDeleteBucketLifecycle, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?lifecycle", + } + + if input == nil { + input = &DeleteBucketLifecycleInput{} + } + + output = &DeleteBucketLifecycleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketLifecycle API operation for Amazon Simple Storage Service. +// +// Deletes the lifecycle configuration from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketLifecycle for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle +func (c *S3) DeleteBucketLifecycle(input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error) { + req, out := c.DeleteBucketLifecycleRequest(input) + return out, req.Send() +} + +// DeleteBucketLifecycleWithContext is the same as DeleteBucketLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketLifecycleWithContext(ctx aws.Context, input *DeleteBucketLifecycleInput, opts ...request.Option) (*DeleteBucketLifecycleOutput, error) { + req, out := c.DeleteBucketLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" + +// DeleteBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketMetricsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketMetricsConfiguration for more information on using the DeleteBucketMetricsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketMetricsConfigurationRequest method. +// req, resp := client.DeleteBucketMetricsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration +func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsConfigurationInput) (req *request.Request, output *DeleteBucketMetricsConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteBucketMetricsConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?metrics", + } + + if input == nil { + input = &DeleteBucketMetricsConfigurationInput{} + } + + output = &DeleteBucketMetricsConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketMetricsConfiguration API operation for Amazon Simple Storage Service. +// +// Deletes a metrics configuration (specified by the metrics configuration ID) +// from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketMetricsConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration +func (c *S3) DeleteBucketMetricsConfiguration(input *DeleteBucketMetricsConfigurationInput) (*DeleteBucketMetricsConfigurationOutput, error) { + req, out := c.DeleteBucketMetricsConfigurationRequest(input) + return out, req.Send() +} + +// DeleteBucketMetricsConfigurationWithContext is the same as DeleteBucketMetricsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketMetricsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketMetricsConfigurationWithContext(ctx aws.Context, input *DeleteBucketMetricsConfigurationInput, opts ...request.Option) (*DeleteBucketMetricsConfigurationOutput, error) { + req, out := c.DeleteBucketMetricsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketPolicy = "DeleteBucketPolicy" + +// DeleteBucketPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketPolicy for more information on using the DeleteBucketPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketPolicyRequest method. +// req, resp := client.DeleteBucketPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy +func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *request.Request, output *DeleteBucketPolicyOutput) { + op := &request.Operation{ + Name: opDeleteBucketPolicy, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?policy", + } + + if input == nil { + input = &DeleteBucketPolicyInput{} + } + + output = &DeleteBucketPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketPolicy API operation for Amazon Simple Storage Service. +// +// Deletes the policy from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy +func (c *S3) DeleteBucketPolicy(input *DeleteBucketPolicyInput) (*DeleteBucketPolicyOutput, error) { + req, out := c.DeleteBucketPolicyRequest(input) + return out, req.Send() +} + +// DeleteBucketPolicyWithContext is the same as DeleteBucketPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketPolicyWithContext(ctx aws.Context, input *DeleteBucketPolicyInput, opts ...request.Option) (*DeleteBucketPolicyOutput, error) { + req, out := c.DeleteBucketPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketReplication = "DeleteBucketReplication" + +// DeleteBucketReplicationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketReplication operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketReplication for more information on using the DeleteBucketReplication +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketReplicationRequest method. +// req, resp := client.DeleteBucketReplicationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication +func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) (req *request.Request, output *DeleteBucketReplicationOutput) { + op := &request.Operation{ + Name: opDeleteBucketReplication, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?replication", + } + + if input == nil { + input = &DeleteBucketReplicationInput{} + } + + output = &DeleteBucketReplicationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketReplication API operation for Amazon Simple Storage Service. +// +// Deletes the replication configuration from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketReplication for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication +func (c *S3) DeleteBucketReplication(input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error) { + req, out := c.DeleteBucketReplicationRequest(input) + return out, req.Send() +} + +// DeleteBucketReplicationWithContext is the same as DeleteBucketReplication with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketReplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketReplicationWithContext(ctx aws.Context, input *DeleteBucketReplicationInput, opts ...request.Option) (*DeleteBucketReplicationOutput, error) { + req, out := c.DeleteBucketReplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketTagging = "DeleteBucketTagging" + +// DeleteBucketTaggingRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketTagging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketTagging for more information on using the DeleteBucketTagging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketTaggingRequest method. +// req, resp := client.DeleteBucketTaggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging +func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *request.Request, output *DeleteBucketTaggingOutput) { + op := &request.Operation{ + Name: opDeleteBucketTagging, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?tagging", + } + + if input == nil { + input = &DeleteBucketTaggingInput{} + } + + output = &DeleteBucketTaggingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketTagging API operation for Amazon Simple Storage Service. +// +// Deletes the tags from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketTagging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging +func (c *S3) DeleteBucketTagging(input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error) { + req, out := c.DeleteBucketTaggingRequest(input) + return out, req.Send() +} + +// DeleteBucketTaggingWithContext is the same as DeleteBucketTagging with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketTaggingWithContext(ctx aws.Context, input *DeleteBucketTaggingInput, opts ...request.Option) (*DeleteBucketTaggingOutput, error) { + req, out := c.DeleteBucketTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteBucketWebsite = "DeleteBucketWebsite" + +// DeleteBucketWebsiteRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBucketWebsite operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBucketWebsite for more information on using the DeleteBucketWebsite +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBucketWebsiteRequest method. +// req, resp := client.DeleteBucketWebsiteRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite +func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *request.Request, output *DeleteBucketWebsiteOutput) { + op := &request.Operation{ + Name: opDeleteBucketWebsite, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}?website", + } + + if input == nil { + input = &DeleteBucketWebsiteInput{} + } + + output = &DeleteBucketWebsiteOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteBucketWebsite API operation for Amazon Simple Storage Service. +// +// This operation removes the website configuration from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteBucketWebsite for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite +func (c *S3) DeleteBucketWebsite(input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error) { + req, out := c.DeleteBucketWebsiteRequest(input) + return out, req.Send() +} + +// DeleteBucketWebsiteWithContext is the same as DeleteBucketWebsite with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBucketWebsite for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteBucketWebsiteWithContext(ctx aws.Context, input *DeleteBucketWebsiteInput, opts ...request.Option) (*DeleteBucketWebsiteOutput, error) { + req, out := c.DeleteBucketWebsiteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteObject = "DeleteObject" + +// DeleteObjectRequest generates a "aws/request.Request" representing the +// client's request for the DeleteObject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteObject for more information on using the DeleteObject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteObjectRequest method. +// req, resp := client.DeleteObjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject +func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request, output *DeleteObjectOutput) { + op := &request.Operation{ + Name: opDeleteObject, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &DeleteObjectInput{} + } + + output = &DeleteObjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteObject API operation for Amazon Simple Storage Service. +// +// Removes the null version (if there is one) of an object and inserts a delete +// marker, which becomes the latest version of the object. If there isn't a +// null version, Amazon S3 does not remove any objects. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteObject for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject +func (c *S3) DeleteObject(input *DeleteObjectInput) (*DeleteObjectOutput, error) { + req, out := c.DeleteObjectRequest(input) + return out, req.Send() +} + +// DeleteObjectWithContext is the same as DeleteObject with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteObjectWithContext(ctx aws.Context, input *DeleteObjectInput, opts ...request.Option) (*DeleteObjectOutput, error) { + req, out := c.DeleteObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteObjectTagging = "DeleteObjectTagging" + +// DeleteObjectTaggingRequest generates a "aws/request.Request" representing the +// client's request for the DeleteObjectTagging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteObjectTagging for more information on using the DeleteObjectTagging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteObjectTaggingRequest method. +// req, resp := client.DeleteObjectTaggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging +func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *request.Request, output *DeleteObjectTaggingOutput) { + op := &request.Operation{ + Name: opDeleteObjectTagging, + HTTPMethod: "DELETE", + HTTPPath: "/{Bucket}/{Key+}?tagging", + } + + if input == nil { + input = &DeleteObjectTaggingInput{} + } + + output = &DeleteObjectTaggingOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteObjectTagging API operation for Amazon Simple Storage Service. +// +// Removes the tag-set from an existing object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteObjectTagging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging +func (c *S3) DeleteObjectTagging(input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error) { + req, out := c.DeleteObjectTaggingRequest(input) + return out, req.Send() +} + +// DeleteObjectTaggingWithContext is the same as DeleteObjectTagging with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteObjectTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteObjectTaggingWithContext(ctx aws.Context, input *DeleteObjectTaggingInput, opts ...request.Option) (*DeleteObjectTaggingOutput, error) { + req, out := c.DeleteObjectTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteObjects = "DeleteObjects" + +// DeleteObjectsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteObjects operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteObjects for more information on using the DeleteObjects +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteObjectsRequest method. +// req, resp := client.DeleteObjectsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects +func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Request, output *DeleteObjectsOutput) { + op := &request.Operation{ + Name: opDeleteObjects, + HTTPMethod: "POST", + HTTPPath: "/{Bucket}?delete", + } + + if input == nil { + input = &DeleteObjectsInput{} + } + + output = &DeleteObjectsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteObjects API operation for Amazon Simple Storage Service. +// +// This operation enables you to delete multiple objects from a bucket using +// a single HTTP request. You may specify up to 1000 keys. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation DeleteObjects for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects +func (c *S3) DeleteObjects(input *DeleteObjectsInput) (*DeleteObjectsOutput, error) { + req, out := c.DeleteObjectsRequest(input) + return out, req.Send() +} + +// DeleteObjectsWithContext is the same as DeleteObjects with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteObjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) DeleteObjectsWithContext(ctx aws.Context, input *DeleteObjectsInput, opts ...request.Option) (*DeleteObjectsOutput, error) { + req, out := c.DeleteObjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" + +// GetBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketAccelerateConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketAccelerateConfiguration for more information on using the GetBucketAccelerateConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketAccelerateConfigurationRequest method. +// req, resp := client.GetBucketAccelerateConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration +func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateConfigurationInput) (req *request.Request, output *GetBucketAccelerateConfigurationOutput) { + op := &request.Operation{ + Name: opGetBucketAccelerateConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?accelerate", + } + + if input == nil { + input = &GetBucketAccelerateConfigurationInput{} + } + + output = &GetBucketAccelerateConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. +// +// Returns the accelerate configuration of a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketAccelerateConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration +func (c *S3) GetBucketAccelerateConfiguration(input *GetBucketAccelerateConfigurationInput) (*GetBucketAccelerateConfigurationOutput, error) { + req, out := c.GetBucketAccelerateConfigurationRequest(input) + return out, req.Send() +} + +// GetBucketAccelerateConfigurationWithContext is the same as GetBucketAccelerateConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketAccelerateConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketAccelerateConfigurationWithContext(ctx aws.Context, input *GetBucketAccelerateConfigurationInput, opts ...request.Option) (*GetBucketAccelerateConfigurationOutput, error) { + req, out := c.GetBucketAccelerateConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketAcl = "GetBucketAcl" + +// GetBucketAclRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketAcl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketAcl for more information on using the GetBucketAcl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketAclRequest method. +// req, resp := client.GetBucketAclRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl +func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request, output *GetBucketAclOutput) { + op := &request.Operation{ + Name: opGetBucketAcl, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?acl", + } + + if input == nil { + input = &GetBucketAclInput{} + } + + output = &GetBucketAclOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketAcl API operation for Amazon Simple Storage Service. +// +// Gets the access control policy for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketAcl for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl +func (c *S3) GetBucketAcl(input *GetBucketAclInput) (*GetBucketAclOutput, error) { + req, out := c.GetBucketAclRequest(input) + return out, req.Send() +} + +// GetBucketAclWithContext is the same as GetBucketAcl with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketAclWithContext(ctx aws.Context, input *GetBucketAclInput, opts ...request.Option) (*GetBucketAclOutput, error) { + req, out := c.GetBucketAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" + +// GetBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketAnalyticsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketAnalyticsConfiguration for more information on using the GetBucketAnalyticsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketAnalyticsConfigurationRequest method. +// req, resp := client.GetBucketAnalyticsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration +func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsConfigurationInput) (req *request.Request, output *GetBucketAnalyticsConfigurationOutput) { + op := &request.Operation{ + Name: opGetBucketAnalyticsConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?analytics", + } + + if input == nil { + input = &GetBucketAnalyticsConfigurationInput{} + } + + output = &GetBucketAnalyticsConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. +// +// Gets an analytics configuration for the bucket (specified by the analytics +// configuration 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 Simple Storage Service's +// API operation GetBucketAnalyticsConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration +func (c *S3) GetBucketAnalyticsConfiguration(input *GetBucketAnalyticsConfigurationInput) (*GetBucketAnalyticsConfigurationOutput, error) { + req, out := c.GetBucketAnalyticsConfigurationRequest(input) + return out, req.Send() +} + +// GetBucketAnalyticsConfigurationWithContext is the same as GetBucketAnalyticsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketAnalyticsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *GetBucketAnalyticsConfigurationInput, opts ...request.Option) (*GetBucketAnalyticsConfigurationOutput, error) { + req, out := c.GetBucketAnalyticsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketCors = "GetBucketCors" + +// GetBucketCorsRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketCors operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketCors for more information on using the GetBucketCors +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketCorsRequest method. +// req, resp := client.GetBucketCorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors +func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Request, output *GetBucketCorsOutput) { + op := &request.Operation{ + Name: opGetBucketCors, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?cors", + } + + if input == nil { + input = &GetBucketCorsInput{} + } + + output = &GetBucketCorsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketCors API operation for Amazon Simple Storage Service. +// +// Returns the cors configuration for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketCors for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors +func (c *S3) GetBucketCors(input *GetBucketCorsInput) (*GetBucketCorsOutput, error) { + req, out := c.GetBucketCorsRequest(input) + return out, req.Send() +} + +// GetBucketCorsWithContext is the same as GetBucketCors with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketCors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketCorsWithContext(ctx aws.Context, input *GetBucketCorsInput, opts ...request.Option) (*GetBucketCorsOutput, error) { + req, out := c.GetBucketCorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketEncryption = "GetBucketEncryption" + +// GetBucketEncryptionRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketEncryption operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketEncryption for more information on using the GetBucketEncryption +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketEncryptionRequest method. +// req, resp := client.GetBucketEncryptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryption +func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) (req *request.Request, output *GetBucketEncryptionOutput) { + op := &request.Operation{ + Name: opGetBucketEncryption, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?encryption", + } + + if input == nil { + input = &GetBucketEncryptionInput{} + } + + output = &GetBucketEncryptionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketEncryption API operation for Amazon Simple Storage Service. +// +// Returns the server-side encryption configuration of a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketEncryption for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryption +func (c *S3) GetBucketEncryption(input *GetBucketEncryptionInput) (*GetBucketEncryptionOutput, error) { + req, out := c.GetBucketEncryptionRequest(input) + return out, req.Send() +} + +// GetBucketEncryptionWithContext is the same as GetBucketEncryption with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketEncryption for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketEncryptionWithContext(ctx aws.Context, input *GetBucketEncryptionInput, opts ...request.Option) (*GetBucketEncryptionOutput, error) { + req, out := c.GetBucketEncryptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" + +// GetBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketInventoryConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketInventoryConfiguration for more information on using the GetBucketInventoryConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketInventoryConfigurationRequest method. +// req, resp := client.GetBucketInventoryConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration +func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryConfigurationInput) (req *request.Request, output *GetBucketInventoryConfigurationOutput) { + op := &request.Operation{ + Name: opGetBucketInventoryConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?inventory", + } + + if input == nil { + input = &GetBucketInventoryConfigurationInput{} + } + + output = &GetBucketInventoryConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketInventoryConfiguration API operation for Amazon Simple Storage Service. +// +// Returns an inventory configuration (identified by the inventory ID) from +// the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketInventoryConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration +func (c *S3) GetBucketInventoryConfiguration(input *GetBucketInventoryConfigurationInput) (*GetBucketInventoryConfigurationOutput, error) { + req, out := c.GetBucketInventoryConfigurationRequest(input) + return out, req.Send() +} + +// GetBucketInventoryConfigurationWithContext is the same as GetBucketInventoryConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketInventoryConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketInventoryConfigurationWithContext(ctx aws.Context, input *GetBucketInventoryConfigurationInput, opts ...request.Option) (*GetBucketInventoryConfigurationOutput, error) { + req, out := c.GetBucketInventoryConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketLifecycle = "GetBucketLifecycle" + +// GetBucketLifecycleRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketLifecycle operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketLifecycle for more information on using the GetBucketLifecycle +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketLifecycleRequest method. +// req, resp := client.GetBucketLifecycleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle +// +// Deprecated: GetBucketLifecycle has been deprecated +func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *request.Request, output *GetBucketLifecycleOutput) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, GetBucketLifecycle, has been deprecated") + } + op := &request.Operation{ + Name: opGetBucketLifecycle, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?lifecycle", + } + + if input == nil { + input = &GetBucketLifecycleInput{} + } + + output = &GetBucketLifecycleOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketLifecycle API operation for Amazon Simple Storage Service. +// +// Deprecated, see the GetBucketLifecycleConfiguration 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 Simple Storage Service's +// API operation GetBucketLifecycle for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle +// +// Deprecated: GetBucketLifecycle has been deprecated +func (c *S3) GetBucketLifecycle(input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error) { + req, out := c.GetBucketLifecycleRequest(input) + return out, req.Send() +} + +// GetBucketLifecycleWithContext is the same as GetBucketLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +// +// Deprecated: GetBucketLifecycleWithContext has been deprecated +func (c *S3) GetBucketLifecycleWithContext(ctx aws.Context, input *GetBucketLifecycleInput, opts ...request.Option) (*GetBucketLifecycleOutput, error) { + req, out := c.GetBucketLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" + +// GetBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketLifecycleConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketLifecycleConfiguration for more information on using the GetBucketLifecycleConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketLifecycleConfigurationRequest method. +// req, resp := client.GetBucketLifecycleConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration +func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleConfigurationInput) (req *request.Request, output *GetBucketLifecycleConfigurationOutput) { + op := &request.Operation{ + Name: opGetBucketLifecycleConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?lifecycle", + } + + if input == nil { + input = &GetBucketLifecycleConfigurationInput{} + } + + output = &GetBucketLifecycleConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. +// +// Returns the lifecycle configuration information set on the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketLifecycleConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration +func (c *S3) GetBucketLifecycleConfiguration(input *GetBucketLifecycleConfigurationInput) (*GetBucketLifecycleConfigurationOutput, error) { + req, out := c.GetBucketLifecycleConfigurationRequest(input) + return out, req.Send() +} + +// GetBucketLifecycleConfigurationWithContext is the same as GetBucketLifecycleConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLifecycleConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketLifecycleConfigurationWithContext(ctx aws.Context, input *GetBucketLifecycleConfigurationInput, opts ...request.Option) (*GetBucketLifecycleConfigurationOutput, error) { + req, out := c.GetBucketLifecycleConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketLocation = "GetBucketLocation" + +// GetBucketLocationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketLocation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketLocation for more information on using the GetBucketLocation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketLocationRequest method. +// req, resp := client.GetBucketLocationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation +func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *request.Request, output *GetBucketLocationOutput) { + op := &request.Operation{ + Name: opGetBucketLocation, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?location", + } + + if input == nil { + input = &GetBucketLocationInput{} + } + + output = &GetBucketLocationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketLocation API operation for Amazon Simple Storage Service. +// +// Returns the region the bucket resides in. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketLocation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation +func (c *S3) GetBucketLocation(input *GetBucketLocationInput) (*GetBucketLocationOutput, error) { + req, out := c.GetBucketLocationRequest(input) + return out, req.Send() +} + +// GetBucketLocationWithContext is the same as GetBucketLocation with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLocation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketLocationWithContext(ctx aws.Context, input *GetBucketLocationInput, opts ...request.Option) (*GetBucketLocationOutput, error) { + req, out := c.GetBucketLocationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketLogging = "GetBucketLogging" + +// GetBucketLoggingRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketLogging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketLogging for more information on using the GetBucketLogging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketLoggingRequest method. +// req, resp := client.GetBucketLoggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging +func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request.Request, output *GetBucketLoggingOutput) { + op := &request.Operation{ + Name: opGetBucketLogging, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?logging", + } + + if input == nil { + input = &GetBucketLoggingInput{} + } + + output = &GetBucketLoggingOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketLogging API operation for Amazon Simple Storage Service. +// +// Returns the logging status of a bucket and the permissions users have to +// view and modify that status. To use GET, you must be the bucket owner. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketLogging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging +func (c *S3) GetBucketLogging(input *GetBucketLoggingInput) (*GetBucketLoggingOutput, error) { + req, out := c.GetBucketLoggingRequest(input) + return out, req.Send() +} + +// GetBucketLoggingWithContext is the same as GetBucketLogging with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketLoggingWithContext(ctx aws.Context, input *GetBucketLoggingInput, opts ...request.Option) (*GetBucketLoggingOutput, error) { + req, out := c.GetBucketLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" + +// GetBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketMetricsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketMetricsConfiguration for more information on using the GetBucketMetricsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketMetricsConfigurationRequest method. +// req, resp := client.GetBucketMetricsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration +func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigurationInput) (req *request.Request, output *GetBucketMetricsConfigurationOutput) { + op := &request.Operation{ + Name: opGetBucketMetricsConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?metrics", + } + + if input == nil { + input = &GetBucketMetricsConfigurationInput{} + } + + output = &GetBucketMetricsConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketMetricsConfiguration API operation for Amazon Simple Storage Service. +// +// Gets a metrics configuration (specified by the metrics configuration ID) +// from the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketMetricsConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration +func (c *S3) GetBucketMetricsConfiguration(input *GetBucketMetricsConfigurationInput) (*GetBucketMetricsConfigurationOutput, error) { + req, out := c.GetBucketMetricsConfigurationRequest(input) + return out, req.Send() +} + +// GetBucketMetricsConfigurationWithContext is the same as GetBucketMetricsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketMetricsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketMetricsConfigurationWithContext(ctx aws.Context, input *GetBucketMetricsConfigurationInput, opts ...request.Option) (*GetBucketMetricsConfigurationOutput, error) { + req, out := c.GetBucketMetricsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketNotification = "GetBucketNotification" + +// GetBucketNotificationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketNotification operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketNotification for more information on using the GetBucketNotification +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketNotificationRequest method. +// req, resp := client.GetBucketNotificationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification +// +// Deprecated: GetBucketNotification has been deprecated +func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfigurationDeprecated) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, GetBucketNotification, has been deprecated") + } + op := &request.Operation{ + Name: opGetBucketNotification, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?notification", + } + + if input == nil { + input = &GetBucketNotificationConfigurationRequest{} + } + + output = &NotificationConfigurationDeprecated{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketNotification API operation for Amazon Simple Storage Service. +// +// Deprecated, see the GetBucketNotificationConfiguration 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 Simple Storage Service's +// API operation GetBucketNotification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification +// +// Deprecated: GetBucketNotification has been deprecated +func (c *S3) GetBucketNotification(input *GetBucketNotificationConfigurationRequest) (*NotificationConfigurationDeprecated, error) { + req, out := c.GetBucketNotificationRequest(input) + return out, req.Send() +} + +// GetBucketNotificationWithContext is the same as GetBucketNotification with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketNotification for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +// +// Deprecated: GetBucketNotificationWithContext has been deprecated +func (c *S3) GetBucketNotificationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfigurationDeprecated, error) { + req, out := c.GetBucketNotificationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration" + +// GetBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketNotificationConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketNotificationConfiguration for more information on using the GetBucketNotificationConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketNotificationConfigurationRequest method. +// req, resp := client.GetBucketNotificationConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration +func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfiguration) { + op := &request.Operation{ + Name: opGetBucketNotificationConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?notification", + } + + if input == nil { + input = &GetBucketNotificationConfigurationRequest{} + } + + output = &NotificationConfiguration{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketNotificationConfiguration API operation for Amazon Simple Storage Service. +// +// Returns the notification configuration of a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketNotificationConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration +func (c *S3) GetBucketNotificationConfiguration(input *GetBucketNotificationConfigurationRequest) (*NotificationConfiguration, error) { + req, out := c.GetBucketNotificationConfigurationRequest(input) + return out, req.Send() +} + +// GetBucketNotificationConfigurationWithContext is the same as GetBucketNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketNotificationConfigurationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfiguration, error) { + req, out := c.GetBucketNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketPolicy = "GetBucketPolicy" + +// GetBucketPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketPolicy for more information on using the GetBucketPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketPolicyRequest method. +// req, resp := client.GetBucketPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy +func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.Request, output *GetBucketPolicyOutput) { + op := &request.Operation{ + Name: opGetBucketPolicy, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?policy", + } + + if input == nil { + input = &GetBucketPolicyInput{} + } + + output = &GetBucketPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketPolicy API operation for Amazon Simple Storage Service. +// +// Returns the policy of a specified bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy +func (c *S3) GetBucketPolicy(input *GetBucketPolicyInput) (*GetBucketPolicyOutput, error) { + req, out := c.GetBucketPolicyRequest(input) + return out, req.Send() +} + +// GetBucketPolicyWithContext is the same as GetBucketPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketPolicyWithContext(ctx aws.Context, input *GetBucketPolicyInput, opts ...request.Option) (*GetBucketPolicyOutput, error) { + req, out := c.GetBucketPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketReplication = "GetBucketReplication" + +// GetBucketReplicationRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketReplication operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketReplication for more information on using the GetBucketReplication +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketReplicationRequest method. +// req, resp := client.GetBucketReplicationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication +func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req *request.Request, output *GetBucketReplicationOutput) { + op := &request.Operation{ + Name: opGetBucketReplication, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?replication", + } + + if input == nil { + input = &GetBucketReplicationInput{} + } + + output = &GetBucketReplicationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketReplication API operation for Amazon Simple Storage Service. +// +// Returns the replication configuration of a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketReplication for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication +func (c *S3) GetBucketReplication(input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error) { + req, out := c.GetBucketReplicationRequest(input) + return out, req.Send() +} + +// GetBucketReplicationWithContext is the same as GetBucketReplication with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketReplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketReplicationWithContext(ctx aws.Context, input *GetBucketReplicationInput, opts ...request.Option) (*GetBucketReplicationOutput, error) { + req, out := c.GetBucketReplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketRequestPayment = "GetBucketRequestPayment" + +// GetBucketRequestPaymentRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketRequestPayment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketRequestPayment for more information on using the GetBucketRequestPayment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketRequestPaymentRequest method. +// req, resp := client.GetBucketRequestPaymentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment +func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) (req *request.Request, output *GetBucketRequestPaymentOutput) { + op := &request.Operation{ + Name: opGetBucketRequestPayment, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?requestPayment", + } + + if input == nil { + input = &GetBucketRequestPaymentInput{} + } + + output = &GetBucketRequestPaymentOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketRequestPayment API operation for Amazon Simple Storage Service. +// +// Returns the request payment configuration of a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketRequestPayment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment +func (c *S3) GetBucketRequestPayment(input *GetBucketRequestPaymentInput) (*GetBucketRequestPaymentOutput, error) { + req, out := c.GetBucketRequestPaymentRequest(input) + return out, req.Send() +} + +// GetBucketRequestPaymentWithContext is the same as GetBucketRequestPayment with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketRequestPayment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketRequestPaymentWithContext(ctx aws.Context, input *GetBucketRequestPaymentInput, opts ...request.Option) (*GetBucketRequestPaymentOutput, error) { + req, out := c.GetBucketRequestPaymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketTagging = "GetBucketTagging" + +// GetBucketTaggingRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketTagging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketTagging for more information on using the GetBucketTagging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketTaggingRequest method. +// req, resp := client.GetBucketTaggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging +func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request.Request, output *GetBucketTaggingOutput) { + op := &request.Operation{ + Name: opGetBucketTagging, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?tagging", + } + + if input == nil { + input = &GetBucketTaggingInput{} + } + + output = &GetBucketTaggingOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketTagging API operation for Amazon Simple Storage Service. +// +// Returns the tag set associated with the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketTagging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging +func (c *S3) GetBucketTagging(input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error) { + req, out := c.GetBucketTaggingRequest(input) + return out, req.Send() +} + +// GetBucketTaggingWithContext is the same as GetBucketTagging with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketTaggingWithContext(ctx aws.Context, input *GetBucketTaggingInput, opts ...request.Option) (*GetBucketTaggingOutput, error) { + req, out := c.GetBucketTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketVersioning = "GetBucketVersioning" + +// GetBucketVersioningRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketVersioning operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketVersioning for more information on using the GetBucketVersioning +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketVersioningRequest method. +// req, resp := client.GetBucketVersioningRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning +func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *request.Request, output *GetBucketVersioningOutput) { + op := &request.Operation{ + Name: opGetBucketVersioning, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?versioning", + } + + if input == nil { + input = &GetBucketVersioningInput{} + } + + output = &GetBucketVersioningOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketVersioning API operation for Amazon Simple Storage Service. +// +// Returns the versioning state of a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketVersioning for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning +func (c *S3) GetBucketVersioning(input *GetBucketVersioningInput) (*GetBucketVersioningOutput, error) { + req, out := c.GetBucketVersioningRequest(input) + return out, req.Send() +} + +// GetBucketVersioningWithContext is the same as GetBucketVersioning with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketVersioning for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketVersioningWithContext(ctx aws.Context, input *GetBucketVersioningInput, opts ...request.Option) (*GetBucketVersioningOutput, error) { + req, out := c.GetBucketVersioningRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBucketWebsite = "GetBucketWebsite" + +// GetBucketWebsiteRequest generates a "aws/request.Request" representing the +// client's request for the GetBucketWebsite operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBucketWebsite for more information on using the GetBucketWebsite +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBucketWebsiteRequest method. +// req, resp := client.GetBucketWebsiteRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite +func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request.Request, output *GetBucketWebsiteOutput) { + op := &request.Operation{ + Name: opGetBucketWebsite, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?website", + } + + if input == nil { + input = &GetBucketWebsiteInput{} + } + + output = &GetBucketWebsiteOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBucketWebsite API operation for Amazon Simple Storage Service. +// +// Returns the website configuration for a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetBucketWebsite for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite +func (c *S3) GetBucketWebsite(input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error) { + req, out := c.GetBucketWebsiteRequest(input) + return out, req.Send() +} + +// GetBucketWebsiteWithContext is the same as GetBucketWebsite with the addition of +// the ability to pass a context and additional request options. +// +// See GetBucketWebsite for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetBucketWebsiteWithContext(ctx aws.Context, input *GetBucketWebsiteInput, opts ...request.Option) (*GetBucketWebsiteOutput, error) { + req, out := c.GetBucketWebsiteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetObject = "GetObject" + +// GetObjectRequest generates a "aws/request.Request" representing the +// client's request for the GetObject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetObject for more information on using the GetObject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetObjectRequest method. +// req, resp := client.GetObjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject +func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, output *GetObjectOutput) { + op := &request.Operation{ + Name: opGetObject, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &GetObjectInput{} + } + + output = &GetObjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetObject API operation for Amazon Simple Storage Service. +// +// Retrieves objects from Amazon S3. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetObject for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchKey "NoSuchKey" +// The specified key does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject +func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + return out, req.Send() +} + +// GetObjectWithContext is the same as GetObject with the addition of +// the ability to pass a context and additional request options. +// +// See GetObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetObjectWithContext(ctx aws.Context, input *GetObjectInput, opts ...request.Option) (*GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetObjectAcl = "GetObjectAcl" + +// GetObjectAclRequest generates a "aws/request.Request" representing the +// client's request for the GetObjectAcl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetObjectAcl for more information on using the GetObjectAcl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetObjectAclRequest method. +// req, resp := client.GetObjectAclRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl +func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request, output *GetObjectAclOutput) { + op := &request.Operation{ + Name: opGetObjectAcl, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}/{Key+}?acl", + } + + if input == nil { + input = &GetObjectAclInput{} + } + + output = &GetObjectAclOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetObjectAcl API operation for Amazon Simple Storage Service. +// +// Returns the access control list (ACL) of an object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetObjectAcl for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchKey "NoSuchKey" +// The specified key does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl +func (c *S3) GetObjectAcl(input *GetObjectAclInput) (*GetObjectAclOutput, error) { + req, out := c.GetObjectAclRequest(input) + return out, req.Send() +} + +// GetObjectAclWithContext is the same as GetObjectAcl with the addition of +// the ability to pass a context and additional request options. +// +// See GetObjectAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetObjectAclWithContext(ctx aws.Context, input *GetObjectAclInput, opts ...request.Option) (*GetObjectAclOutput, error) { + req, out := c.GetObjectAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetObjectTagging = "GetObjectTagging" + +// GetObjectTaggingRequest generates a "aws/request.Request" representing the +// client's request for the GetObjectTagging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetObjectTagging for more information on using the GetObjectTagging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetObjectTaggingRequest method. +// req, resp := client.GetObjectTaggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging +func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request.Request, output *GetObjectTaggingOutput) { + op := &request.Operation{ + Name: opGetObjectTagging, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}/{Key+}?tagging", + } + + if input == nil { + input = &GetObjectTaggingInput{} + } + + output = &GetObjectTaggingOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetObjectTagging API operation for Amazon Simple Storage Service. +// +// Returns the tag-set of an object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetObjectTagging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging +func (c *S3) GetObjectTagging(input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error) { + req, out := c.GetObjectTaggingRequest(input) + return out, req.Send() +} + +// GetObjectTaggingWithContext is the same as GetObjectTagging with the addition of +// the ability to pass a context and additional request options. +// +// See GetObjectTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetObjectTaggingWithContext(ctx aws.Context, input *GetObjectTaggingInput, opts ...request.Option) (*GetObjectTaggingOutput, error) { + req, out := c.GetObjectTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetObjectTorrent = "GetObjectTorrent" + +// GetObjectTorrentRequest generates a "aws/request.Request" representing the +// client's request for the GetObjectTorrent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetObjectTorrent for more information on using the GetObjectTorrent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetObjectTorrentRequest method. +// req, resp := client.GetObjectTorrentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent +func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request.Request, output *GetObjectTorrentOutput) { + op := &request.Operation{ + Name: opGetObjectTorrent, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}/{Key+}?torrent", + } + + if input == nil { + input = &GetObjectTorrentInput{} + } + + output = &GetObjectTorrentOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetObjectTorrent API operation for Amazon Simple Storage Service. +// +// Return torrent files from a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetObjectTorrent for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent +func (c *S3) GetObjectTorrent(input *GetObjectTorrentInput) (*GetObjectTorrentOutput, error) { + req, out := c.GetObjectTorrentRequest(input) + return out, req.Send() +} + +// GetObjectTorrentWithContext is the same as GetObjectTorrent with the addition of +// the ability to pass a context and additional request options. +// +// See GetObjectTorrent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) GetObjectTorrentWithContext(ctx aws.Context, input *GetObjectTorrentInput, opts ...request.Option) (*GetObjectTorrentOutput, error) { + req, out := c.GetObjectTorrentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opHeadBucket = "HeadBucket" + +// HeadBucketRequest generates a "aws/request.Request" representing the +// client's request for the HeadBucket operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See HeadBucket for more information on using the HeadBucket +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the HeadBucketRequest method. +// req, resp := client.HeadBucketRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket +func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, output *HeadBucketOutput) { + op := &request.Operation{ + Name: opHeadBucket, + HTTPMethod: "HEAD", + HTTPPath: "/{Bucket}", + } + + if input == nil { + input = &HeadBucketInput{} + } + + output = &HeadBucketOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// HeadBucket API operation for Amazon Simple Storage Service. +// +// This operation is useful to determine if a bucket exists and you have permission +// to access 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 Simple Storage Service's +// API operation HeadBucket for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchBucket "NoSuchBucket" +// The specified bucket does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket +func (c *S3) HeadBucket(input *HeadBucketInput) (*HeadBucketOutput, error) { + req, out := c.HeadBucketRequest(input) + return out, req.Send() +} + +// HeadBucketWithContext is the same as HeadBucket with the addition of +// the ability to pass a context and additional request options. +// +// See HeadBucket for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) HeadBucketWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.Option) (*HeadBucketOutput, error) { + req, out := c.HeadBucketRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opHeadObject = "HeadObject" + +// HeadObjectRequest generates a "aws/request.Request" representing the +// client's request for the HeadObject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See HeadObject for more information on using the HeadObject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the HeadObjectRequest method. +// req, resp := client.HeadObjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject +func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, output *HeadObjectOutput) { + op := &request.Operation{ + Name: opHeadObject, + HTTPMethod: "HEAD", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &HeadObjectInput{} + } + + output = &HeadObjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// HeadObject API operation for Amazon Simple Storage Service. +// +// The HEAD operation retrieves metadata from an object without returning the +// object itself. This operation is useful if you're only interested in an object's +// metadata. To use HEAD, you must have READ access to the object. +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses +// for more information on returned errors. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation HeadObject for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject +func (c *S3) HeadObject(input *HeadObjectInput) (*HeadObjectOutput, error) { + req, out := c.HeadObjectRequest(input) + return out, req.Send() +} + +// HeadObjectWithContext is the same as HeadObject with the addition of +// the ability to pass a context and additional request options. +// +// See HeadObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.Option) (*HeadObjectOutput, error) { + req, out := c.HeadObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" + +// ListBucketAnalyticsConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListBucketAnalyticsConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBucketAnalyticsConfigurations for more information on using the ListBucketAnalyticsConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBucketAnalyticsConfigurationsRequest method. +// req, resp := client.ListBucketAnalyticsConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations +func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalyticsConfigurationsInput) (req *request.Request, output *ListBucketAnalyticsConfigurationsOutput) { + op := &request.Operation{ + Name: opListBucketAnalyticsConfigurations, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?analytics", + } + + if input == nil { + input = &ListBucketAnalyticsConfigurationsInput{} + } + + output = &ListBucketAnalyticsConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBucketAnalyticsConfigurations API operation for Amazon Simple Storage Service. +// +// Lists the analytics configurations for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListBucketAnalyticsConfigurations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations +func (c *S3) ListBucketAnalyticsConfigurations(input *ListBucketAnalyticsConfigurationsInput) (*ListBucketAnalyticsConfigurationsOutput, error) { + req, out := c.ListBucketAnalyticsConfigurationsRequest(input) + return out, req.Send() +} + +// ListBucketAnalyticsConfigurationsWithContext is the same as ListBucketAnalyticsConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketAnalyticsConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListBucketAnalyticsConfigurationsWithContext(ctx aws.Context, input *ListBucketAnalyticsConfigurationsInput, opts ...request.Option) (*ListBucketAnalyticsConfigurationsOutput, error) { + req, out := c.ListBucketAnalyticsConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" + +// ListBucketInventoryConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListBucketInventoryConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBucketInventoryConfigurations for more information on using the ListBucketInventoryConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBucketInventoryConfigurationsRequest method. +// req, resp := client.ListBucketInventoryConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations +func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventoryConfigurationsInput) (req *request.Request, output *ListBucketInventoryConfigurationsOutput) { + op := &request.Operation{ + Name: opListBucketInventoryConfigurations, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?inventory", + } + + if input == nil { + input = &ListBucketInventoryConfigurationsInput{} + } + + output = &ListBucketInventoryConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBucketInventoryConfigurations API operation for Amazon Simple Storage Service. +// +// Returns a list of inventory configurations for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListBucketInventoryConfigurations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations +func (c *S3) ListBucketInventoryConfigurations(input *ListBucketInventoryConfigurationsInput) (*ListBucketInventoryConfigurationsOutput, error) { + req, out := c.ListBucketInventoryConfigurationsRequest(input) + return out, req.Send() +} + +// ListBucketInventoryConfigurationsWithContext is the same as ListBucketInventoryConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketInventoryConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListBucketInventoryConfigurationsWithContext(ctx aws.Context, input *ListBucketInventoryConfigurationsInput, opts ...request.Option) (*ListBucketInventoryConfigurationsOutput, error) { + req, out := c.ListBucketInventoryConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" + +// ListBucketMetricsConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListBucketMetricsConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBucketMetricsConfigurations for more information on using the ListBucketMetricsConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBucketMetricsConfigurationsRequest method. +// req, resp := client.ListBucketMetricsConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations +func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConfigurationsInput) (req *request.Request, output *ListBucketMetricsConfigurationsOutput) { + op := &request.Operation{ + Name: opListBucketMetricsConfigurations, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?metrics", + } + + if input == nil { + input = &ListBucketMetricsConfigurationsInput{} + } + + output = &ListBucketMetricsConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBucketMetricsConfigurations API operation for Amazon Simple Storage Service. +// +// Lists the metrics configurations for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListBucketMetricsConfigurations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations +func (c *S3) ListBucketMetricsConfigurations(input *ListBucketMetricsConfigurationsInput) (*ListBucketMetricsConfigurationsOutput, error) { + req, out := c.ListBucketMetricsConfigurationsRequest(input) + return out, req.Send() +} + +// ListBucketMetricsConfigurationsWithContext is the same as ListBucketMetricsConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketMetricsConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListBucketMetricsConfigurationsWithContext(ctx aws.Context, input *ListBucketMetricsConfigurationsInput, opts ...request.Option) (*ListBucketMetricsConfigurationsOutput, error) { + req, out := c.ListBucketMetricsConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListBuckets = "ListBuckets" + +// ListBucketsRequest generates a "aws/request.Request" representing the +// client's request for the ListBuckets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBuckets for more information on using the ListBuckets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBucketsRequest method. +// req, resp := client.ListBucketsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets +func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, output *ListBucketsOutput) { + op := &request.Operation{ + Name: opListBuckets, + HTTPMethod: "GET", + HTTPPath: "/", + } + + if input == nil { + input = &ListBucketsInput{} + } + + output = &ListBucketsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBuckets API operation for Amazon Simple Storage Service. +// +// Returns a list of all buckets owned by the authenticated sender of 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 Simple Storage Service's +// API operation ListBuckets for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets +func (c *S3) ListBuckets(input *ListBucketsInput) (*ListBucketsOutput, error) { + req, out := c.ListBucketsRequest(input) + return out, req.Send() +} + +// ListBucketsWithContext is the same as ListBuckets with the addition of +// the ability to pass a context and additional request options. +// +// See ListBuckets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput, opts ...request.Option) (*ListBucketsOutput, error) { + req, out := c.ListBucketsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListMultipartUploads = "ListMultipartUploads" + +// ListMultipartUploadsRequest generates a "aws/request.Request" representing the +// client's request for the ListMultipartUploads operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListMultipartUploads for more information on using the ListMultipartUploads +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListMultipartUploadsRequest method. +// req, resp := client.ListMultipartUploadsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads +func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req *request.Request, output *ListMultipartUploadsOutput) { + op := &request.Operation{ + Name: opListMultipartUploads, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?uploads", + Paginator: &request.Paginator{ + InputTokens: []string{"KeyMarker", "UploadIdMarker"}, + OutputTokens: []string{"NextKeyMarker", "NextUploadIdMarker"}, + LimitToken: "MaxUploads", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListMultipartUploadsInput{} + } + + output = &ListMultipartUploadsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListMultipartUploads API operation for Amazon Simple Storage Service. +// +// This operation lists in-progress multipart uploads. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListMultipartUploads for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads +func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { + req, out := c.ListMultipartUploadsRequest(input) + return out, req.Send() +} + +// ListMultipartUploadsWithContext is the same as ListMultipartUploads with the addition of +// the ability to pass a context and additional request options. +// +// See ListMultipartUploads for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListMultipartUploadsWithContext(ctx aws.Context, input *ListMultipartUploadsInput, opts ...request.Option) (*ListMultipartUploadsOutput, error) { + req, out := c.ListMultipartUploadsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMultipartUploads 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 ListMultipartUploads operation. +// pageNum := 0 +// err := client.ListMultipartUploadsPages(params, +// func(page *ListMultipartUploadsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool) error { + return c.ListMultipartUploadsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMultipartUploadsPagesWithContext same as ListMultipartUploadsPages 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 *S3) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMultipartUploadsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMultipartUploadsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListObjectVersions = "ListObjectVersions" + +// ListObjectVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListObjectVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListObjectVersions for more information on using the ListObjectVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListObjectVersionsRequest method. +// req, resp := client.ListObjectVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions +func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *request.Request, output *ListObjectVersionsOutput) { + op := &request.Operation{ + Name: opListObjectVersions, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?versions", + Paginator: &request.Paginator{ + InputTokens: []string{"KeyMarker", "VersionIdMarker"}, + OutputTokens: []string{"NextKeyMarker", "NextVersionIdMarker"}, + LimitToken: "MaxKeys", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListObjectVersionsInput{} + } + + output = &ListObjectVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListObjectVersions API operation for Amazon Simple Storage Service. +// +// Returns metadata about all of the versions of objects in a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListObjectVersions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions +func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVersionsOutput, error) { + req, out := c.ListObjectVersionsRequest(input) + return out, req.Send() +} + +// ListObjectVersionsWithContext is the same as ListObjectVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListObjectVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListObjectVersionsWithContext(ctx aws.Context, input *ListObjectVersionsInput, opts ...request.Option) (*ListObjectVersionsOutput, error) { + req, out := c.ListObjectVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListObjectVersionsPages iterates over the pages of a ListObjectVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListObjectVersions 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 ListObjectVersions operation. +// pageNum := 0 +// err := client.ListObjectVersionsPages(params, +// func(page *ListObjectVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool) error { + return c.ListObjectVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListObjectVersionsPagesWithContext same as ListObjectVersionsPages 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 *S3) ListObjectVersionsPagesWithContext(ctx aws.Context, input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListObjectVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListObjectVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListObjects = "ListObjects" + +// ListObjectsRequest generates a "aws/request.Request" representing the +// client's request for the ListObjects operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListObjects for more information on using the ListObjects +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListObjectsRequest method. +// req, resp := client.ListObjectsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects +func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, output *ListObjectsOutput) { + op := &request.Operation{ + Name: opListObjects, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker || Contents[-1].Key"}, + LimitToken: "MaxKeys", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListObjectsInput{} + } + + output = &ListObjectsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListObjects API operation for Amazon Simple Storage Service. +// +// Returns some or all (up to 1000) of the objects in a bucket. You can use +// the request parameters as selection criteria to return a subset of the objects +// in a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListObjects for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchBucket "NoSuchBucket" +// The specified bucket does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects +func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { + req, out := c.ListObjectsRequest(input) + return out, req.Send() +} + +// ListObjectsWithContext is the same as ListObjects with the addition of +// the ability to pass a context and additional request options. +// +// See ListObjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListObjectsWithContext(ctx aws.Context, input *ListObjectsInput, opts ...request.Option) (*ListObjectsOutput, error) { + req, out := c.ListObjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListObjectsPages iterates over the pages of a ListObjects operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListObjects 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 ListObjects operation. +// pageNum := 0 +// err := client.ListObjectsPages(params, +// func(page *ListObjectsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool) error { + return c.ListObjectsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListObjectsPagesWithContext same as ListObjectsPages 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 *S3) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListObjectsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListObjectsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opListObjectsV2 = "ListObjectsV2" + +// ListObjectsV2Request generates a "aws/request.Request" representing the +// client's request for the ListObjectsV2 operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListObjectsV2 for more information on using the ListObjectsV2 +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListObjectsV2Request method. +// req, resp := client.ListObjectsV2Request(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 +func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Request, output *ListObjectsV2Output) { + op := &request.Operation{ + Name: opListObjectsV2, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?list-type=2", + Paginator: &request.Paginator{ + InputTokens: []string{"ContinuationToken"}, + OutputTokens: []string{"NextContinuationToken"}, + LimitToken: "MaxKeys", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListObjectsV2Input{} + } + + output = &ListObjectsV2Output{} + req = c.newRequest(op, input, output) + return +} + +// ListObjectsV2 API operation for Amazon Simple Storage Service. +// +// Returns some or all (up to 1000) of the objects in a bucket. You can use +// the request parameters as selection criteria to return a subset of the objects +// in a bucket. Note: ListObjectsV2 is the revised List Objects API and we recommend +// you use this revised API for new application development. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListObjectsV2 for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchBucket "NoSuchBucket" +// The specified bucket does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 +func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, error) { + req, out := c.ListObjectsV2Request(input) + return out, req.Send() +} + +// ListObjectsV2WithContext is the same as ListObjectsV2 with the addition of +// the ability to pass a context and additional request options. +// +// See ListObjectsV2 for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListObjectsV2WithContext(ctx aws.Context, input *ListObjectsV2Input, opts ...request.Option) (*ListObjectsV2Output, error) { + req, out := c.ListObjectsV2Request(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListObjectsV2Pages iterates over the pages of a ListObjectsV2 operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListObjectsV2 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 ListObjectsV2 operation. +// pageNum := 0 +// err := client.ListObjectsV2Pages(params, +// func(page *ListObjectsV2Output, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool) error { + return c.ListObjectsV2PagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListObjectsV2PagesWithContext same as ListObjectsV2Pages 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 *S3) ListObjectsV2PagesWithContext(ctx aws.Context, input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListObjectsV2Input + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListObjectsV2Request(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) + } + return p.Err() +} + +const opListParts = "ListParts" + +// ListPartsRequest generates a "aws/request.Request" representing the +// client's request for the ListParts operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListParts for more information on using the ListParts +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListPartsRequest method. +// req, resp := client.ListPartsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts +func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, output *ListPartsOutput) { + op := &request.Operation{ + Name: opListParts, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}/{Key+}", + Paginator: &request.Paginator{ + InputTokens: []string{"PartNumberMarker"}, + OutputTokens: []string{"NextPartNumberMarker"}, + LimitToken: "MaxParts", + TruncationToken: "IsTruncated", + }, + } + + if input == nil { + input = &ListPartsInput{} + } + + output = &ListPartsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListParts API operation for Amazon Simple Storage Service. +// +// Lists the parts that have been uploaded for a specific multipart upload. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListParts for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts +func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { + req, out := c.ListPartsRequest(input) + return out, req.Send() +} + +// ListPartsWithContext is the same as ListParts with the addition of +// the ability to pass a context and additional request options. +// +// See ListParts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListPartsWithContext(ctx aws.Context, input *ListPartsInput, opts ...request.Option) (*ListPartsOutput, error) { + req, out := c.ListPartsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListPartsPages iterates over the pages of a ListParts operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListParts 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 ListParts operation. +// pageNum := 0 +// err := client.ListPartsPages(params, +// func(page *ListPartsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3) ListPartsPages(input *ListPartsInput, fn func(*ListPartsOutput, bool) bool) error { + return c.ListPartsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPartsPagesWithContext same as ListPartsPages 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 *S3) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, fn func(*ListPartsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPartsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPartsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) + } + return p.Err() +} + +const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" + +// PutBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketAccelerateConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketAccelerateConfiguration for more information on using the PutBucketAccelerateConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketAccelerateConfigurationRequest method. +// req, resp := client.PutBucketAccelerateConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration +func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateConfigurationInput) (req *request.Request, output *PutBucketAccelerateConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketAccelerateConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?accelerate", + } + + if input == nil { + input = &PutBucketAccelerateConfigurationInput{} + } + + output = &PutBucketAccelerateConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. +// +// Sets the accelerate configuration of an existing bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketAccelerateConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration +func (c *S3) PutBucketAccelerateConfiguration(input *PutBucketAccelerateConfigurationInput) (*PutBucketAccelerateConfigurationOutput, error) { + req, out := c.PutBucketAccelerateConfigurationRequest(input) + return out, req.Send() +} + +// PutBucketAccelerateConfigurationWithContext is the same as PutBucketAccelerateConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketAccelerateConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketAccelerateConfigurationWithContext(ctx aws.Context, input *PutBucketAccelerateConfigurationInput, opts ...request.Option) (*PutBucketAccelerateConfigurationOutput, error) { + req, out := c.PutBucketAccelerateConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketAcl = "PutBucketAcl" + +// PutBucketAclRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketAcl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketAcl for more information on using the PutBucketAcl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketAclRequest method. +// req, resp := client.PutBucketAclRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl +func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request, output *PutBucketAclOutput) { + op := &request.Operation{ + Name: opPutBucketAcl, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?acl", + } + + if input == nil { + input = &PutBucketAclInput{} + } + + output = &PutBucketAclOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketAcl API operation for Amazon Simple Storage Service. +// +// Sets the permissions on a bucket using access control lists (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 Simple Storage Service's +// API operation PutBucketAcl for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl +func (c *S3) PutBucketAcl(input *PutBucketAclInput) (*PutBucketAclOutput, error) { + req, out := c.PutBucketAclRequest(input) + return out, req.Send() +} + +// PutBucketAclWithContext is the same as PutBucketAcl with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketAclWithContext(ctx aws.Context, input *PutBucketAclInput, opts ...request.Option) (*PutBucketAclOutput, error) { + req, out := c.PutBucketAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" + +// PutBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketAnalyticsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketAnalyticsConfiguration for more information on using the PutBucketAnalyticsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketAnalyticsConfigurationRequest method. +// req, resp := client.PutBucketAnalyticsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration +func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsConfigurationInput) (req *request.Request, output *PutBucketAnalyticsConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketAnalyticsConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?analytics", + } + + if input == nil { + input = &PutBucketAnalyticsConfigurationInput{} + } + + output = &PutBucketAnalyticsConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. +// +// Sets an analytics configuration for the bucket (specified by the analytics +// configuration 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 Simple Storage Service's +// API operation PutBucketAnalyticsConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration +func (c *S3) PutBucketAnalyticsConfiguration(input *PutBucketAnalyticsConfigurationInput) (*PutBucketAnalyticsConfigurationOutput, error) { + req, out := c.PutBucketAnalyticsConfigurationRequest(input) + return out, req.Send() +} + +// PutBucketAnalyticsConfigurationWithContext is the same as PutBucketAnalyticsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketAnalyticsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *PutBucketAnalyticsConfigurationInput, opts ...request.Option) (*PutBucketAnalyticsConfigurationOutput, error) { + req, out := c.PutBucketAnalyticsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketCors = "PutBucketCors" + +// PutBucketCorsRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketCors operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketCors for more information on using the PutBucketCors +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketCorsRequest method. +// req, resp := client.PutBucketCorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors +func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Request, output *PutBucketCorsOutput) { + op := &request.Operation{ + Name: opPutBucketCors, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?cors", + } + + if input == nil { + input = &PutBucketCorsInput{} + } + + output = &PutBucketCorsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketCors API operation for Amazon Simple Storage Service. +// +// Sets the cors configuration for a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketCors for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors +func (c *S3) PutBucketCors(input *PutBucketCorsInput) (*PutBucketCorsOutput, error) { + req, out := c.PutBucketCorsRequest(input) + return out, req.Send() +} + +// PutBucketCorsWithContext is the same as PutBucketCors with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketCors for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketCorsWithContext(ctx aws.Context, input *PutBucketCorsInput, opts ...request.Option) (*PutBucketCorsOutput, error) { + req, out := c.PutBucketCorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketEncryption = "PutBucketEncryption" + +// PutBucketEncryptionRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketEncryption operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketEncryption for more information on using the PutBucketEncryption +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketEncryptionRequest method. +// req, resp := client.PutBucketEncryptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketEncryption +func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *request.Request, output *PutBucketEncryptionOutput) { + op := &request.Operation{ + Name: opPutBucketEncryption, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?encryption", + } + + if input == nil { + input = &PutBucketEncryptionInput{} + } + + output = &PutBucketEncryptionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketEncryption API operation for Amazon Simple Storage Service. +// +// Creates a new server-side encryption configuration (or replaces an existing +// one, if present). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketEncryption for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketEncryption +func (c *S3) PutBucketEncryption(input *PutBucketEncryptionInput) (*PutBucketEncryptionOutput, error) { + req, out := c.PutBucketEncryptionRequest(input) + return out, req.Send() +} + +// PutBucketEncryptionWithContext is the same as PutBucketEncryption with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketEncryption for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketEncryptionWithContext(ctx aws.Context, input *PutBucketEncryptionInput, opts ...request.Option) (*PutBucketEncryptionOutput, error) { + req, out := c.PutBucketEncryptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" + +// PutBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketInventoryConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketInventoryConfiguration for more information on using the PutBucketInventoryConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketInventoryConfigurationRequest method. +// req, resp := client.PutBucketInventoryConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration +func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryConfigurationInput) (req *request.Request, output *PutBucketInventoryConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketInventoryConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?inventory", + } + + if input == nil { + input = &PutBucketInventoryConfigurationInput{} + } + + output = &PutBucketInventoryConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketInventoryConfiguration API operation for Amazon Simple Storage Service. +// +// Adds an inventory configuration (identified by the inventory ID) from the +// bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketInventoryConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration +func (c *S3) PutBucketInventoryConfiguration(input *PutBucketInventoryConfigurationInput) (*PutBucketInventoryConfigurationOutput, error) { + req, out := c.PutBucketInventoryConfigurationRequest(input) + return out, req.Send() +} + +// PutBucketInventoryConfigurationWithContext is the same as PutBucketInventoryConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketInventoryConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketInventoryConfigurationWithContext(ctx aws.Context, input *PutBucketInventoryConfigurationInput, opts ...request.Option) (*PutBucketInventoryConfigurationOutput, error) { + req, out := c.PutBucketInventoryConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketLifecycle = "PutBucketLifecycle" + +// PutBucketLifecycleRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketLifecycle operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketLifecycle for more information on using the PutBucketLifecycle +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketLifecycleRequest method. +// req, resp := client.PutBucketLifecycleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle +// +// Deprecated: PutBucketLifecycle has been deprecated +func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *request.Request, output *PutBucketLifecycleOutput) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, PutBucketLifecycle, has been deprecated") + } + op := &request.Operation{ + Name: opPutBucketLifecycle, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?lifecycle", + } + + if input == nil { + input = &PutBucketLifecycleInput{} + } + + output = &PutBucketLifecycleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketLifecycle API operation for Amazon Simple Storage Service. +// +// Deprecated, see the PutBucketLifecycleConfiguration 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 Simple Storage Service's +// API operation PutBucketLifecycle for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle +// +// Deprecated: PutBucketLifecycle has been deprecated +func (c *S3) PutBucketLifecycle(input *PutBucketLifecycleInput) (*PutBucketLifecycleOutput, error) { + req, out := c.PutBucketLifecycleRequest(input) + return out, req.Send() +} + +// PutBucketLifecycleWithContext is the same as PutBucketLifecycle with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketLifecycle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +// +// Deprecated: PutBucketLifecycleWithContext has been deprecated +func (c *S3) PutBucketLifecycleWithContext(ctx aws.Context, input *PutBucketLifecycleInput, opts ...request.Option) (*PutBucketLifecycleOutput, error) { + req, out := c.PutBucketLifecycleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" + +// PutBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketLifecycleConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketLifecycleConfiguration for more information on using the PutBucketLifecycleConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketLifecycleConfigurationRequest method. +// req, resp := client.PutBucketLifecycleConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration +func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleConfigurationInput) (req *request.Request, output *PutBucketLifecycleConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketLifecycleConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?lifecycle", + } + + if input == nil { + input = &PutBucketLifecycleConfigurationInput{} + } + + output = &PutBucketLifecycleConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. +// +// Sets lifecycle configuration for your bucket. If a lifecycle configuration +// exists, it replaces 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 Simple Storage Service's +// API operation PutBucketLifecycleConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration +func (c *S3) PutBucketLifecycleConfiguration(input *PutBucketLifecycleConfigurationInput) (*PutBucketLifecycleConfigurationOutput, error) { + req, out := c.PutBucketLifecycleConfigurationRequest(input) + return out, req.Send() +} + +// PutBucketLifecycleConfigurationWithContext is the same as PutBucketLifecycleConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketLifecycleConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketLifecycleConfigurationWithContext(ctx aws.Context, input *PutBucketLifecycleConfigurationInput, opts ...request.Option) (*PutBucketLifecycleConfigurationOutput, error) { + req, out := c.PutBucketLifecycleConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketLogging = "PutBucketLogging" + +// PutBucketLoggingRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketLogging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketLogging for more information on using the PutBucketLogging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketLoggingRequest method. +// req, resp := client.PutBucketLoggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging +func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request.Request, output *PutBucketLoggingOutput) { + op := &request.Operation{ + Name: opPutBucketLogging, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?logging", + } + + if input == nil { + input = &PutBucketLoggingInput{} + } + + output = &PutBucketLoggingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketLogging API operation for Amazon Simple Storage Service. +// +// Set the logging parameters for a bucket and to specify permissions for who +// can view and modify the logging parameters. To set the logging status of +// a bucket, you must be the bucket owner. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketLogging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging +func (c *S3) PutBucketLogging(input *PutBucketLoggingInput) (*PutBucketLoggingOutput, error) { + req, out := c.PutBucketLoggingRequest(input) + return out, req.Send() +} + +// PutBucketLoggingWithContext is the same as PutBucketLogging with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketLoggingWithContext(ctx aws.Context, input *PutBucketLoggingInput, opts ...request.Option) (*PutBucketLoggingOutput, error) { + req, out := c.PutBucketLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" + +// PutBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketMetricsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketMetricsConfiguration for more information on using the PutBucketMetricsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketMetricsConfigurationRequest method. +// req, resp := client.PutBucketMetricsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration +func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigurationInput) (req *request.Request, output *PutBucketMetricsConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketMetricsConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?metrics", + } + + if input == nil { + input = &PutBucketMetricsConfigurationInput{} + } + + output = &PutBucketMetricsConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketMetricsConfiguration API operation for Amazon Simple Storage Service. +// +// Sets a metrics configuration (specified by the metrics configuration ID) +// for the bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketMetricsConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration +func (c *S3) PutBucketMetricsConfiguration(input *PutBucketMetricsConfigurationInput) (*PutBucketMetricsConfigurationOutput, error) { + req, out := c.PutBucketMetricsConfigurationRequest(input) + return out, req.Send() +} + +// PutBucketMetricsConfigurationWithContext is the same as PutBucketMetricsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketMetricsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketMetricsConfigurationWithContext(ctx aws.Context, input *PutBucketMetricsConfigurationInput, opts ...request.Option) (*PutBucketMetricsConfigurationOutput, error) { + req, out := c.PutBucketMetricsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketNotification = "PutBucketNotification" + +// PutBucketNotificationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketNotification operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketNotification for more information on using the PutBucketNotification +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketNotificationRequest method. +// req, resp := client.PutBucketNotificationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification +// +// Deprecated: PutBucketNotification has been deprecated +func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (req *request.Request, output *PutBucketNotificationOutput) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, PutBucketNotification, has been deprecated") + } + op := &request.Operation{ + Name: opPutBucketNotification, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?notification", + } + + if input == nil { + input = &PutBucketNotificationInput{} + } + + output = &PutBucketNotificationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketNotification API operation for Amazon Simple Storage Service. +// +// Deprecated, see the PutBucketNotificationConfiguraiton 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 Simple Storage Service's +// API operation PutBucketNotification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification +// +// Deprecated: PutBucketNotification has been deprecated +func (c *S3) PutBucketNotification(input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error) { + req, out := c.PutBucketNotificationRequest(input) + return out, req.Send() +} + +// PutBucketNotificationWithContext is the same as PutBucketNotification with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketNotification for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +// +// Deprecated: PutBucketNotificationWithContext has been deprecated +func (c *S3) PutBucketNotificationWithContext(ctx aws.Context, input *PutBucketNotificationInput, opts ...request.Option) (*PutBucketNotificationOutput, error) { + req, out := c.PutBucketNotificationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration" + +// PutBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketNotificationConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketNotificationConfiguration for more information on using the PutBucketNotificationConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketNotificationConfigurationRequest method. +// req, resp := client.PutBucketNotificationConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration +func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificationConfigurationInput) (req *request.Request, output *PutBucketNotificationConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketNotificationConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?notification", + } + + if input == nil { + input = &PutBucketNotificationConfigurationInput{} + } + + output = &PutBucketNotificationConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketNotificationConfiguration API operation for Amazon Simple Storage Service. +// +// Enables notifications of specified events for a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketNotificationConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration +func (c *S3) PutBucketNotificationConfiguration(input *PutBucketNotificationConfigurationInput) (*PutBucketNotificationConfigurationOutput, error) { + req, out := c.PutBucketNotificationConfigurationRequest(input) + return out, req.Send() +} + +// PutBucketNotificationConfigurationWithContext is the same as PutBucketNotificationConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketNotificationConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketNotificationConfigurationWithContext(ctx aws.Context, input *PutBucketNotificationConfigurationInput, opts ...request.Option) (*PutBucketNotificationConfigurationOutput, error) { + req, out := c.PutBucketNotificationConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketPolicy = "PutBucketPolicy" + +// PutBucketPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketPolicy for more information on using the PutBucketPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketPolicyRequest method. +// req, resp := client.PutBucketPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy +func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.Request, output *PutBucketPolicyOutput) { + op := &request.Operation{ + Name: opPutBucketPolicy, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?policy", + } + + if input == nil { + input = &PutBucketPolicyInput{} + } + + output = &PutBucketPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketPolicy API operation for Amazon Simple Storage Service. +// +// Replaces a policy on a bucket. If the bucket already has a policy, the one +// in this request completely replaces 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 Simple Storage Service's +// API operation PutBucketPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy +func (c *S3) PutBucketPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput, error) { + req, out := c.PutBucketPolicyRequest(input) + return out, req.Send() +} + +// PutBucketPolicyWithContext is the same as PutBucketPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketPolicyWithContext(ctx aws.Context, input *PutBucketPolicyInput, opts ...request.Option) (*PutBucketPolicyOutput, error) { + req, out := c.PutBucketPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketReplication = "PutBucketReplication" + +// PutBucketReplicationRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketReplication operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketReplication for more information on using the PutBucketReplication +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketReplicationRequest method. +// req, resp := client.PutBucketReplicationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication +func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req *request.Request, output *PutBucketReplicationOutput) { + op := &request.Operation{ + Name: opPutBucketReplication, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?replication", + } + + if input == nil { + input = &PutBucketReplicationInput{} + } + + output = &PutBucketReplicationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketReplication API operation for Amazon Simple Storage Service. +// +// Creates a new replication configuration (or replaces an existing one, if +// present). For more information, see Cross-Region Replication (CRR) ( https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) +// in the Amazon S3 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 Simple Storage Service's +// API operation PutBucketReplication for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication +func (c *S3) PutBucketReplication(input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error) { + req, out := c.PutBucketReplicationRequest(input) + return out, req.Send() +} + +// PutBucketReplicationWithContext is the same as PutBucketReplication with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketReplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketReplicationInput, opts ...request.Option) (*PutBucketReplicationOutput, error) { + req, out := c.PutBucketReplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketRequestPayment = "PutBucketRequestPayment" + +// PutBucketRequestPaymentRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketRequestPayment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketRequestPayment for more information on using the PutBucketRequestPayment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketRequestPaymentRequest method. +// req, resp := client.PutBucketRequestPaymentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment +func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) (req *request.Request, output *PutBucketRequestPaymentOutput) { + op := &request.Operation{ + Name: opPutBucketRequestPayment, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?requestPayment", + } + + if input == nil { + input = &PutBucketRequestPaymentInput{} + } + + output = &PutBucketRequestPaymentOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketRequestPayment API operation for Amazon Simple Storage Service. +// +// Sets the request payment configuration for a bucket. By default, the bucket +// owner pays for downloads from the bucket. This configuration parameter enables +// the bucket owner (only) to specify that the person requesting the download +// will be charged for the download. Documentation on requester pays buckets +// can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.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 Simple Storage Service's +// API operation PutBucketRequestPayment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment +func (c *S3) PutBucketRequestPayment(input *PutBucketRequestPaymentInput) (*PutBucketRequestPaymentOutput, error) { + req, out := c.PutBucketRequestPaymentRequest(input) + return out, req.Send() +} + +// PutBucketRequestPaymentWithContext is the same as PutBucketRequestPayment with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketRequestPayment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketRequestPaymentWithContext(ctx aws.Context, input *PutBucketRequestPaymentInput, opts ...request.Option) (*PutBucketRequestPaymentOutput, error) { + req, out := c.PutBucketRequestPaymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketTagging = "PutBucketTagging" + +// PutBucketTaggingRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketTagging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketTagging for more information on using the PutBucketTagging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketTaggingRequest method. +// req, resp := client.PutBucketTaggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging +func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request.Request, output *PutBucketTaggingOutput) { + op := &request.Operation{ + Name: opPutBucketTagging, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?tagging", + } + + if input == nil { + input = &PutBucketTaggingInput{} + } + + output = &PutBucketTaggingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketTagging API operation for Amazon Simple Storage Service. +// +// Sets the tags for a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketTagging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging +func (c *S3) PutBucketTagging(input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error) { + req, out := c.PutBucketTaggingRequest(input) + return out, req.Send() +} + +// PutBucketTaggingWithContext is the same as PutBucketTagging with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketTaggingWithContext(ctx aws.Context, input *PutBucketTaggingInput, opts ...request.Option) (*PutBucketTaggingOutput, error) { + req, out := c.PutBucketTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketVersioning = "PutBucketVersioning" + +// PutBucketVersioningRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketVersioning operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketVersioning for more information on using the PutBucketVersioning +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketVersioningRequest method. +// req, resp := client.PutBucketVersioningRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning +func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *request.Request, output *PutBucketVersioningOutput) { + op := &request.Operation{ + Name: opPutBucketVersioning, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?versioning", + } + + if input == nil { + input = &PutBucketVersioningInput{} + } + + output = &PutBucketVersioningOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketVersioning API operation for Amazon Simple Storage Service. +// +// Sets the versioning state of an existing bucket. To set the versioning state, +// you must be the bucket owner. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketVersioning for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning +func (c *S3) PutBucketVersioning(input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error) { + req, out := c.PutBucketVersioningRequest(input) + return out, req.Send() +} + +// PutBucketVersioningWithContext is the same as PutBucketVersioning with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketVersioning for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketVersioningWithContext(ctx aws.Context, input *PutBucketVersioningInput, opts ...request.Option) (*PutBucketVersioningOutput, error) { + req, out := c.PutBucketVersioningRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutBucketWebsite = "PutBucketWebsite" + +// PutBucketWebsiteRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketWebsite operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketWebsite for more information on using the PutBucketWebsite +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutBucketWebsiteRequest method. +// req, resp := client.PutBucketWebsiteRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite +func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request.Request, output *PutBucketWebsiteOutput) { + op := &request.Operation{ + Name: opPutBucketWebsite, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?website", + } + + if input == nil { + input = &PutBucketWebsiteInput{} + } + + output = &PutBucketWebsiteOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutBucketWebsite API operation for Amazon Simple Storage Service. +// +// Set the website configuration for a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketWebsite for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite +func (c *S3) PutBucketWebsite(input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error) { + req, out := c.PutBucketWebsiteRequest(input) + return out, req.Send() +} + +// PutBucketWebsiteWithContext is the same as PutBucketWebsite with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketWebsite for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketWebsiteWithContext(ctx aws.Context, input *PutBucketWebsiteInput, opts ...request.Option) (*PutBucketWebsiteOutput, error) { + req, out := c.PutBucketWebsiteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutObject = "PutObject" + +// PutObjectRequest generates a "aws/request.Request" representing the +// client's request for the PutObject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutObject for more information on using the PutObject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutObjectRequest method. +// req, resp := client.PutObjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject +func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, output *PutObjectOutput) { + op := &request.Operation{ + Name: opPutObject, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &PutObjectInput{} + } + + output = &PutObjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutObject API operation for Amazon Simple Storage Service. +// +// Adds an object to a bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutObject for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject +func (c *S3) PutObject(input *PutObjectInput) (*PutObjectOutput, error) { + req, out := c.PutObjectRequest(input) + return out, req.Send() +} + +// PutObjectWithContext is the same as PutObject with the addition of +// the ability to pass a context and additional request options. +// +// See PutObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutObjectWithContext(ctx aws.Context, input *PutObjectInput, opts ...request.Option) (*PutObjectOutput, error) { + req, out := c.PutObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutObjectAcl = "PutObjectAcl" + +// PutObjectAclRequest generates a "aws/request.Request" representing the +// client's request for the PutObjectAcl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutObjectAcl for more information on using the PutObjectAcl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutObjectAclRequest method. +// req, resp := client.PutObjectAclRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl +func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request, output *PutObjectAclOutput) { + op := &request.Operation{ + Name: opPutObjectAcl, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}/{Key+}?acl", + } + + if input == nil { + input = &PutObjectAclInput{} + } + + output = &PutObjectAclOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutObjectAcl API operation for Amazon Simple Storage Service. +// +// uses the acl subresource to set the access control list (ACL) permissions +// for an object that already exists in a bucket +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutObjectAcl for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchKey "NoSuchKey" +// The specified key does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl +func (c *S3) PutObjectAcl(input *PutObjectAclInput) (*PutObjectAclOutput, error) { + req, out := c.PutObjectAclRequest(input) + return out, req.Send() +} + +// PutObjectAclWithContext is the same as PutObjectAcl with the addition of +// the ability to pass a context and additional request options. +// +// See PutObjectAcl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutObjectAclWithContext(ctx aws.Context, input *PutObjectAclInput, opts ...request.Option) (*PutObjectAclOutput, error) { + req, out := c.PutObjectAclRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutObjectTagging = "PutObjectTagging" + +// PutObjectTaggingRequest generates a "aws/request.Request" representing the +// client's request for the PutObjectTagging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutObjectTagging for more information on using the PutObjectTagging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutObjectTaggingRequest method. +// req, resp := client.PutObjectTaggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging +func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request.Request, output *PutObjectTaggingOutput) { + op := &request.Operation{ + Name: opPutObjectTagging, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}/{Key+}?tagging", + } + + if input == nil { + input = &PutObjectTaggingInput{} + } + + output = &PutObjectTaggingOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutObjectTagging API operation for Amazon Simple Storage Service. +// +// Sets the supplied tag-set to an object that already exists in a bucket +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutObjectTagging for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging +func (c *S3) PutObjectTagging(input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error) { + req, out := c.PutObjectTaggingRequest(input) + return out, req.Send() +} + +// PutObjectTaggingWithContext is the same as PutObjectTagging with the addition of +// the ability to pass a context and additional request options. +// +// See PutObjectTagging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutObjectTaggingWithContext(ctx aws.Context, input *PutObjectTaggingInput, opts ...request.Option) (*PutObjectTaggingOutput, error) { + req, out := c.PutObjectTaggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRestoreObject = "RestoreObject" + +// RestoreObjectRequest generates a "aws/request.Request" representing the +// client's request for the RestoreObject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RestoreObject for more information on using the RestoreObject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RestoreObjectRequest method. +// req, resp := client.RestoreObjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject +func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Request, output *RestoreObjectOutput) { + op := &request.Operation{ + Name: opRestoreObject, + HTTPMethod: "POST", + HTTPPath: "/{Bucket}/{Key+}?restore", + } + + if input == nil { + input = &RestoreObjectInput{} + } + + output = &RestoreObjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// RestoreObject API operation for Amazon Simple Storage Service. +// +// Restores an archived copy of an object back into Amazon S3 +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation RestoreObject for usage and error information. +// +// Returned Error Codes: +// * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" +// This operation is not allowed against this storage tier +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject +func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { + req, out := c.RestoreObjectRequest(input) + return out, req.Send() +} + +// RestoreObjectWithContext is the same as RestoreObject with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) RestoreObjectWithContext(ctx aws.Context, input *RestoreObjectInput, opts ...request.Option) (*RestoreObjectOutput, error) { + req, out := c.RestoreObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSelectObjectContent = "SelectObjectContent" + +// SelectObjectContentRequest generates a "aws/request.Request" representing the +// client's request for the SelectObjectContent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SelectObjectContent for more information on using the SelectObjectContent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SelectObjectContentRequest method. +// req, resp := client.SelectObjectContentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent +func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *request.Request, output *SelectObjectContentOutput) { + op := &request.Operation{ + Name: opSelectObjectContent, + HTTPMethod: "POST", + HTTPPath: "/{Bucket}/{Key+}?select&select-type=2", + } + + if input == nil { + input = &SelectObjectContentInput{} + } + + output = &SelectObjectContentOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, rest.UnmarshalHandler) + req.Handlers.Unmarshal.PushBack(output.runEventStreamLoop) + return +} + +// SelectObjectContent API operation for Amazon Simple Storage Service. +// +// This operation filters the contents of an Amazon S3 object based on a simple +// Structured Query Language (SQL) statement. In the request, along with the +// SQL expression, you must also specify a data serialization format (JSON or +// CSV) of the object. Amazon S3 uses this to parse object data into records, +// and returns only records that match the specified SQL expression. You must +// also specify the data serialization format for the 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 Simple Storage Service's +// API operation SelectObjectContent for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent +func (c *S3) SelectObjectContent(input *SelectObjectContentInput) (*SelectObjectContentOutput, error) { + req, out := c.SelectObjectContentRequest(input) + return out, req.Send() +} + +// SelectObjectContentWithContext is the same as SelectObjectContent with the addition of +// the ability to pass a context and additional request options. +// +// See SelectObjectContent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) SelectObjectContentWithContext(ctx aws.Context, input *SelectObjectContentInput, opts ...request.Option) (*SelectObjectContentOutput, error) { + req, out := c.SelectObjectContentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUploadPart = "UploadPart" + +// UploadPartRequest generates a "aws/request.Request" representing the +// client's request for the UploadPart operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UploadPart for more information on using the UploadPart +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UploadPartRequest method. +// req, resp := client.UploadPartRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart +func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, output *UploadPartOutput) { + op := &request.Operation{ + Name: opUploadPart, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &UploadPartInput{} + } + + output = &UploadPartOutput{} + req = c.newRequest(op, input, output) + return +} + +// UploadPart API operation for Amazon Simple Storage Service. +// +// Uploads a part in a multipart upload. +// +// Note: After you initiate multipart upload and upload one or more parts, you +// must either complete or abort multipart upload in order to stop getting charged +// for storage of the uploaded parts. Only after you either complete or abort +// multipart upload, Amazon S3 frees up the parts storage and stops charging +// you for the parts storage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation UploadPart for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart +func (c *S3) UploadPart(input *UploadPartInput) (*UploadPartOutput, error) { + req, out := c.UploadPartRequest(input) + return out, req.Send() +} + +// UploadPartWithContext is the same as UploadPart with the addition of +// the ability to pass a context and additional request options. +// +// See UploadPart for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) UploadPartWithContext(ctx aws.Context, input *UploadPartInput, opts ...request.Option) (*UploadPartOutput, error) { + req, out := c.UploadPartRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUploadPartCopy = "UploadPartCopy" + +// UploadPartCopyRequest generates a "aws/request.Request" representing the +// client's request for the UploadPartCopy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfuly. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UploadPartCopy for more information on using the UploadPartCopy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UploadPartCopyRequest method. +// req, resp := client.UploadPartCopyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy +func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Request, output *UploadPartCopyOutput) { + op := &request.Operation{ + Name: opUploadPartCopy, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}/{Key+}", + } + + if input == nil { + input = &UploadPartCopyInput{} + } + + output = &UploadPartCopyOutput{} + req = c.newRequest(op, input, output) + return +} + +// UploadPartCopy API operation for Amazon Simple Storage Service. +// +// Uploads a part by copying data from an existing object as data source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation UploadPartCopy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy +func (c *S3) UploadPartCopy(input *UploadPartCopyInput) (*UploadPartCopyOutput, error) { + req, out := c.UploadPartCopyRequest(input) + return out, req.Send() +} + +// UploadPartCopyWithContext is the same as UploadPartCopy with the addition of +// the ability to pass a context and additional request options. +// +// See UploadPartCopy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInput, opts ...request.Option) (*UploadPartCopyOutput, error) { + req, out := c.UploadPartCopyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Specifies the days since the initiation of an Incomplete Multipart Upload +// that Lifecycle will wait before permanently removing all parts of the upload. +type AbortIncompleteMultipartUpload struct { + _ struct{} `type:"structure"` + + // Indicates the number of days that must pass since initiation for Lifecycle + // to abort an Incomplete Multipart Upload. + DaysAfterInitiation *int64 `type:"integer"` +} + +// String returns the string representation +func (s AbortIncompleteMultipartUpload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AbortIncompleteMultipartUpload) GoString() string { + return s.String() +} + +// SetDaysAfterInitiation sets the DaysAfterInitiation field's value. +func (s *AbortIncompleteMultipartUpload) SetDaysAfterInitiation(v int64) *AbortIncompleteMultipartUpload { + s.DaysAfterInitiation = &v + return s +} + +type AbortMultipartUploadInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // UploadId is a required field + UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` +} + +// String returns the string representation +func (s AbortMultipartUploadInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AbortMultipartUploadInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AbortMultipartUploadInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AbortMultipartUploadInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.UploadId == nil { + invalidParams.Add(request.NewErrParamRequired("UploadId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *AbortMultipartUploadInput) SetBucket(v string) *AbortMultipartUploadInput { + s.Bucket = &v + return s +} + +func (s *AbortMultipartUploadInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *AbortMultipartUploadInput) SetKey(v string) *AbortMultipartUploadInput { + s.Key = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *AbortMultipartUploadInput) SetRequestPayer(v string) *AbortMultipartUploadInput { + s.RequestPayer = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *AbortMultipartUploadInput) SetUploadId(v string) *AbortMultipartUploadInput { + s.UploadId = &v + return s +} + +type AbortMultipartUploadOutput struct { + _ struct{} `type:"structure"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` +} + +// String returns the string representation +func (s AbortMultipartUploadOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AbortMultipartUploadOutput) GoString() string { + return s.String() +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *AbortMultipartUploadOutput) SetRequestCharged(v string) *AbortMultipartUploadOutput { + s.RequestCharged = &v + return s +} + +type AccelerateConfiguration struct { + _ struct{} `type:"structure"` + + // The accelerate configuration of the bucket. + Status *string `type:"string" enum:"BucketAccelerateStatus"` +} + +// String returns the string representation +func (s AccelerateConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccelerateConfiguration) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *AccelerateConfiguration) SetStatus(v string) *AccelerateConfiguration { + s.Status = &v + return s +} + +type AccessControlPolicy struct { + _ struct{} `type:"structure"` + + // A list of grants. + Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` + + Owner *Owner `type:"structure"` +} + +// String returns the string representation +func (s AccessControlPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessControlPolicy) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AccessControlPolicy) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AccessControlPolicy"} + if s.Grants != nil { + for i, v := range s.Grants { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Grants", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGrants sets the Grants field's value. +func (s *AccessControlPolicy) SetGrants(v []*Grant) *AccessControlPolicy { + s.Grants = v + return s +} + +// SetOwner sets the Owner field's value. +func (s *AccessControlPolicy) SetOwner(v *Owner) *AccessControlPolicy { + s.Owner = v + return s +} + +// Container for information regarding the access control for replicas. +type AccessControlTranslation struct { + _ struct{} `type:"structure"` + + // The override value for the owner of the replica object. + // + // Owner is a required field + Owner *string `type:"string" required:"true" enum:"OwnerOverride"` +} + +// String returns the string representation +func (s AccessControlTranslation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessControlTranslation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AccessControlTranslation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AccessControlTranslation"} + if s.Owner == nil { + invalidParams.Add(request.NewErrParamRequired("Owner")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOwner sets the Owner field's value. +func (s *AccessControlTranslation) SetOwner(v string) *AccessControlTranslation { + s.Owner = &v + return s +} + +type AnalyticsAndOperator struct { + _ struct{} `type:"structure"` + + // The prefix to use when evaluating an AND predicate. + Prefix *string `type:"string"` + + // The list of tags to use when evaluating an AND predicate. + Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s AnalyticsAndOperator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyticsAndOperator) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AnalyticsAndOperator) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AnalyticsAndOperator"} + 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 +} + +// SetPrefix sets the Prefix field's value. +func (s *AnalyticsAndOperator) SetPrefix(v string) *AnalyticsAndOperator { + s.Prefix = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator { + s.Tags = v + return s +} + +type AnalyticsConfiguration struct { + _ struct{} `type:"structure"` + + // The filter used to describe a set of objects for analyses. A filter must + // have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). + // If no filter is provided, all objects will be considered in any analysis. + Filter *AnalyticsFilter `type:"structure"` + + // The identifier used to represent an analytics configuration. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // If present, it indicates that data related to access patterns will be collected + // and made available to analyze the tradeoffs between different storage classes. + // + // StorageClassAnalysis is a required field + StorageClassAnalysis *StorageClassAnalysis `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AnalyticsConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyticsConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AnalyticsConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AnalyticsConfiguration"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.StorageClassAnalysis == nil { + invalidParams.Add(request.NewErrParamRequired("StorageClassAnalysis")) + } + if s.Filter != nil { + if err := s.Filter.Validate(); err != nil { + invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) + } + } + if s.StorageClassAnalysis != nil { + if err := s.StorageClassAnalysis.Validate(); err != nil { + invalidParams.AddNested("StorageClassAnalysis", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilter sets the Filter field's value. +func (s *AnalyticsConfiguration) SetFilter(v *AnalyticsFilter) *AnalyticsConfiguration { + s.Filter = v + return s +} + +// SetId sets the Id field's value. +func (s *AnalyticsConfiguration) SetId(v string) *AnalyticsConfiguration { + s.Id = &v + return s +} + +// SetStorageClassAnalysis sets the StorageClassAnalysis field's value. +func (s *AnalyticsConfiguration) SetStorageClassAnalysis(v *StorageClassAnalysis) *AnalyticsConfiguration { + s.StorageClassAnalysis = v + return s +} + +type AnalyticsExportDestination struct { + _ struct{} `type:"structure"` + + // A destination signifying output to an S3 bucket. + // + // S3BucketDestination is a required field + S3BucketDestination *AnalyticsS3BucketDestination `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AnalyticsExportDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyticsExportDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AnalyticsExportDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AnalyticsExportDestination"} + if s.S3BucketDestination == nil { + invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) + } + if s.S3BucketDestination != nil { + if err := s.S3BucketDestination.Validate(); err != nil { + invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3BucketDestination sets the S3BucketDestination field's value. +func (s *AnalyticsExportDestination) SetS3BucketDestination(v *AnalyticsS3BucketDestination) *AnalyticsExportDestination { + s.S3BucketDestination = v + return s +} + +type AnalyticsFilter struct { + _ struct{} `type:"structure"` + + // A conjunction (logical AND) of predicates, which is used in evaluating an + // analytics filter. The operator must have at least two predicates. + And *AnalyticsAndOperator `type:"structure"` + + // The prefix to use when evaluating an analytics filter. + Prefix *string `type:"string"` + + // The tag to use when evaluating an analytics filter. + Tag *Tag `type:"structure"` +} + +// String returns the string representation +func (s AnalyticsFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyticsFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AnalyticsFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AnalyticsFilter"} + if s.And != nil { + if err := s.And.Validate(); err != nil { + invalidParams.AddNested("And", err.(request.ErrInvalidParams)) + } + } + if s.Tag != nil { + if err := s.Tag.Validate(); err != nil { + invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnd sets the And field's value. +func (s *AnalyticsFilter) SetAnd(v *AnalyticsAndOperator) *AnalyticsFilter { + s.And = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *AnalyticsFilter) SetPrefix(v string) *AnalyticsFilter { + s.Prefix = &v + return s +} + +// SetTag sets the Tag field's value. +func (s *AnalyticsFilter) SetTag(v *Tag) *AnalyticsFilter { + s.Tag = v + return s +} + +type AnalyticsS3BucketDestination struct { + _ struct{} `type:"structure"` + + // The Amazon resource name (ARN) of the bucket to which data is exported. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // The account ID that owns the destination bucket. If no account ID is provided, + // the owner will not be validated prior to exporting data. + BucketAccountId *string `type:"string"` + + // The file format used when exporting data to Amazon S3. + // + // Format is a required field + Format *string `type:"string" required:"true" enum:"AnalyticsS3ExportFileFormat"` + + // The prefix to use when exporting data. The exported data begins with this + // prefix. + Prefix *string `type:"string"` +} + +// String returns the string representation +func (s AnalyticsS3BucketDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyticsS3BucketDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AnalyticsS3BucketDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AnalyticsS3BucketDestination"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Format == nil { + invalidParams.Add(request.NewErrParamRequired("Format")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *AnalyticsS3BucketDestination) SetBucket(v string) *AnalyticsS3BucketDestination { + s.Bucket = &v + return s +} + +func (s *AnalyticsS3BucketDestination) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetBucketAccountId sets the BucketAccountId field's value. +func (s *AnalyticsS3BucketDestination) SetBucketAccountId(v string) *AnalyticsS3BucketDestination { + s.BucketAccountId = &v + return s +} + +// SetFormat sets the Format field's value. +func (s *AnalyticsS3BucketDestination) SetFormat(v string) *AnalyticsS3BucketDestination { + s.Format = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *AnalyticsS3BucketDestination) SetPrefix(v string) *AnalyticsS3BucketDestination { + s.Prefix = &v + return s +} + +type Bucket struct { + _ struct{} `type:"structure"` + + // Date the bucket was created. + CreationDate *time.Time `type:"timestamp"` + + // The name of the bucket. + Name *string `type:"string"` +} + +// String returns the string representation +func (s Bucket) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Bucket) GoString() string { + return s.String() +} + +// SetCreationDate sets the CreationDate field's value. +func (s *Bucket) SetCreationDate(v time.Time) *Bucket { + s.CreationDate = &v + return s +} + +// SetName sets the Name field's value. +func (s *Bucket) SetName(v string) *Bucket { + s.Name = &v + return s +} + +type BucketLifecycleConfiguration struct { + _ struct{} `type:"structure"` + + // Rules is a required field + Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s BucketLifecycleConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BucketLifecycleConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BucketLifecycleConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BucketLifecycleConfiguration"} + if s.Rules == nil { + invalidParams.Add(request.NewErrParamRequired("Rules")) + } + if s.Rules != nil { + for i, v := range s.Rules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRules sets the Rules field's value. +func (s *BucketLifecycleConfiguration) SetRules(v []*LifecycleRule) *BucketLifecycleConfiguration { + s.Rules = v + return s +} + +type BucketLoggingStatus struct { + _ struct{} `type:"structure"` + + // Container for logging information. Presence of this element indicates that + // logging is enabled. Parameters TargetBucket and TargetPrefix are required + // in this case. + LoggingEnabled *LoggingEnabled `type:"structure"` +} + +// String returns the string representation +func (s BucketLoggingStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BucketLoggingStatus) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BucketLoggingStatus) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BucketLoggingStatus"} + if s.LoggingEnabled != nil { + if err := s.LoggingEnabled.Validate(); err != nil { + invalidParams.AddNested("LoggingEnabled", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggingEnabled sets the LoggingEnabled field's value. +func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggingStatus { + s.LoggingEnabled = v + return s +} + +type CORSConfiguration struct { + _ struct{} `type:"structure"` + + // CORSRules is a required field + CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s CORSConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CORSConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CORSConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CORSConfiguration"} + if s.CORSRules == nil { + invalidParams.Add(request.NewErrParamRequired("CORSRules")) + } + if s.CORSRules != nil { + for i, v := range s.CORSRules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CORSRules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCORSRules sets the CORSRules field's value. +func (s *CORSConfiguration) SetCORSRules(v []*CORSRule) *CORSConfiguration { + s.CORSRules = v + return s +} + +type CORSRule struct { + _ struct{} `type:"structure"` + + // Specifies which headers are allowed in a pre-flight OPTIONS request. + AllowedHeaders []*string `locationName:"AllowedHeader" type:"list" flattened:"true"` + + // Identifies HTTP methods that the domain/origin specified in the rule is allowed + // to execute. + // + // AllowedMethods is a required field + AllowedMethods []*string `locationName:"AllowedMethod" type:"list" flattened:"true" required:"true"` + + // One or more origins you want customers to be able to access the bucket from. + // + // AllowedOrigins is a required field + AllowedOrigins []*string `locationName:"AllowedOrigin" type:"list" flattened:"true" required:"true"` + + // One or more headers in the response that you want customers to be able to + // access from their applications (for example, from a JavaScript XMLHttpRequest + // object). + ExposeHeaders []*string `locationName:"ExposeHeader" type:"list" flattened:"true"` + + // The time in seconds that your browser is to cache the preflight response + // for the specified resource. + MaxAgeSeconds *int64 `type:"integer"` +} + +// String returns the string representation +func (s CORSRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CORSRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CORSRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CORSRule"} + if s.AllowedMethods == nil { + invalidParams.Add(request.NewErrParamRequired("AllowedMethods")) + } + if s.AllowedOrigins == nil { + invalidParams.Add(request.NewErrParamRequired("AllowedOrigins")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllowedHeaders sets the AllowedHeaders field's value. +func (s *CORSRule) SetAllowedHeaders(v []*string) *CORSRule { + s.AllowedHeaders = v + return s +} + +// SetAllowedMethods sets the AllowedMethods field's value. +func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule { + s.AllowedMethods = v + return s +} + +// SetAllowedOrigins sets the AllowedOrigins field's value. +func (s *CORSRule) SetAllowedOrigins(v []*string) *CORSRule { + s.AllowedOrigins = v + return s +} + +// SetExposeHeaders sets the ExposeHeaders field's value. +func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule { + s.ExposeHeaders = v + return s +} + +// SetMaxAgeSeconds sets the MaxAgeSeconds field's value. +func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { + s.MaxAgeSeconds = &v + return s +} + +// Describes how a CSV-formatted input object is formatted. +type CSVInput struct { + _ struct{} `type:"structure"` + + // Specifies that CSV field values may contain quoted record delimiters and + // such records should be allowed. Default value is FALSE. Setting this value + // to TRUE may lower performance. + AllowQuotedRecordDelimiter *bool `type:"boolean"` + + // Single character used to indicate a row should be ignored when present at + // the start of a row. + Comments *string `type:"string"` + + // Value used to separate individual fields in a record. + FieldDelimiter *string `type:"string"` + + // Describes the first line of input. Valid values: None, Ignore, Use. + FileHeaderInfo *string `type:"string" enum:"FileHeaderInfo"` + + // Value used for escaping where the field delimiter is part of the value. + QuoteCharacter *string `type:"string"` + + // Single character used for escaping the quote character inside an already + // escaped value. + QuoteEscapeCharacter *string `type:"string"` + + // Value used to separate individual records. + RecordDelimiter *string `type:"string"` +} + +// String returns the string representation +func (s CSVInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CSVInput) GoString() string { + return s.String() +} + +// SetAllowQuotedRecordDelimiter sets the AllowQuotedRecordDelimiter field's value. +func (s *CSVInput) SetAllowQuotedRecordDelimiter(v bool) *CSVInput { + s.AllowQuotedRecordDelimiter = &v + return s +} + +// SetComments sets the Comments field's value. +func (s *CSVInput) SetComments(v string) *CSVInput { + s.Comments = &v + return s +} + +// SetFieldDelimiter sets the FieldDelimiter field's value. +func (s *CSVInput) SetFieldDelimiter(v string) *CSVInput { + s.FieldDelimiter = &v + return s +} + +// SetFileHeaderInfo sets the FileHeaderInfo field's value. +func (s *CSVInput) SetFileHeaderInfo(v string) *CSVInput { + s.FileHeaderInfo = &v + return s +} + +// SetQuoteCharacter sets the QuoteCharacter field's value. +func (s *CSVInput) SetQuoteCharacter(v string) *CSVInput { + s.QuoteCharacter = &v + return s +} + +// SetQuoteEscapeCharacter sets the QuoteEscapeCharacter field's value. +func (s *CSVInput) SetQuoteEscapeCharacter(v string) *CSVInput { + s.QuoteEscapeCharacter = &v + return s +} + +// SetRecordDelimiter sets the RecordDelimiter field's value. +func (s *CSVInput) SetRecordDelimiter(v string) *CSVInput { + s.RecordDelimiter = &v + return s +} + +// Describes how CSV-formatted results are formatted. +type CSVOutput struct { + _ struct{} `type:"structure"` + + // Value used to separate individual fields in a record. + FieldDelimiter *string `type:"string"` + + // Value used for escaping where the field delimiter is part of the value. + QuoteCharacter *string `type:"string"` + + // Single character used for escaping the quote character inside an already + // escaped value. + QuoteEscapeCharacter *string `type:"string"` + + // Indicates whether or not all output fields should be quoted. + QuoteFields *string `type:"string" enum:"QuoteFields"` + + // Value used to separate individual records. + RecordDelimiter *string `type:"string"` +} + +// String returns the string representation +func (s CSVOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CSVOutput) GoString() string { + return s.String() +} + +// SetFieldDelimiter sets the FieldDelimiter field's value. +func (s *CSVOutput) SetFieldDelimiter(v string) *CSVOutput { + s.FieldDelimiter = &v + return s +} + +// SetQuoteCharacter sets the QuoteCharacter field's value. +func (s *CSVOutput) SetQuoteCharacter(v string) *CSVOutput { + s.QuoteCharacter = &v + return s +} + +// SetQuoteEscapeCharacter sets the QuoteEscapeCharacter field's value. +func (s *CSVOutput) SetQuoteEscapeCharacter(v string) *CSVOutput { + s.QuoteEscapeCharacter = &v + return s +} + +// SetQuoteFields sets the QuoteFields field's value. +func (s *CSVOutput) SetQuoteFields(v string) *CSVOutput { + s.QuoteFields = &v + return s +} + +// SetRecordDelimiter sets the RecordDelimiter field's value. +func (s *CSVOutput) SetRecordDelimiter(v string) *CSVOutput { + s.RecordDelimiter = &v + return s +} + +type CloudFunctionConfiguration struct { + _ struct{} `type:"structure"` + + CloudFunction *string `type:"string"` + + // Bucket event for which to send notifications. + // + // Deprecated: Event has been deprecated + Event *string `deprecated:"true" type:"string" enum:"Event"` + + Events []*string `locationName:"Event" type:"list" flattened:"true"` + + // Optional unique identifier for configurations in a notification configuration. + // If you don't provide one, Amazon S3 will assign an ID. + Id *string `type:"string"` + + InvocationRole *string `type:"string"` +} + +// String returns the string representation +func (s CloudFunctionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudFunctionConfiguration) GoString() string { + return s.String() +} + +// SetCloudFunction sets the CloudFunction field's value. +func (s *CloudFunctionConfiguration) SetCloudFunction(v string) *CloudFunctionConfiguration { + s.CloudFunction = &v + return s +} + +// SetEvent sets the Event field's value. +func (s *CloudFunctionConfiguration) SetEvent(v string) *CloudFunctionConfiguration { + s.Event = &v + return s +} + +// SetEvents sets the Events field's value. +func (s *CloudFunctionConfiguration) SetEvents(v []*string) *CloudFunctionConfiguration { + s.Events = v + return s +} + +// SetId sets the Id field's value. +func (s *CloudFunctionConfiguration) SetId(v string) *CloudFunctionConfiguration { + s.Id = &v + return s +} + +// SetInvocationRole sets the InvocationRole field's value. +func (s *CloudFunctionConfiguration) SetInvocationRole(v string) *CloudFunctionConfiguration { + s.InvocationRole = &v + return s +} + +type CommonPrefix struct { + _ struct{} `type:"structure"` + + Prefix *string `type:"string"` +} + +// String returns the string representation +func (s CommonPrefix) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommonPrefix) GoString() string { + return s.String() +} + +// SetPrefix sets the Prefix field's value. +func (s *CommonPrefix) SetPrefix(v string) *CommonPrefix { + s.Prefix = &v + return s +} + +type CompleteMultipartUploadInput struct { + _ struct{} `type:"structure" payload:"MultipartUpload"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // UploadId is a required field + UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` +} + +// String returns the string representation +func (s CompleteMultipartUploadInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteMultipartUploadInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CompleteMultipartUploadInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CompleteMultipartUploadInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.UploadId == nil { + invalidParams.Add(request.NewErrParamRequired("UploadId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *CompleteMultipartUploadInput) SetBucket(v string) *CompleteMultipartUploadInput { + s.Bucket = &v + return s +} + +func (s *CompleteMultipartUploadInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput { + s.Key = &v + return s +} + +// SetMultipartUpload sets the MultipartUpload field's value. +func (s *CompleteMultipartUploadInput) SetMultipartUpload(v *CompletedMultipartUpload) *CompleteMultipartUploadInput { + s.MultipartUpload = v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *CompleteMultipartUploadInput) SetRequestPayer(v string) *CompleteMultipartUploadInput { + s.RequestPayer = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartUploadInput { + s.UploadId = &v + return s +} + +type CompleteMultipartUploadOutput struct { + _ struct{} `type:"structure"` + + Bucket *string `type:"string"` + + // Entity tag of the object. + ETag *string `type:"string"` + + // If the object expiration is configured, this will contain the expiration + // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. + Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` + + Key *string `min:"1" type:"string"` + + Location *string `type:"string"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // Version of the object. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s CompleteMultipartUploadOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteMultipartUploadOutput) GoString() string { + return s.String() +} + +// SetBucket sets the Bucket field's value. +func (s *CompleteMultipartUploadOutput) SetBucket(v string) *CompleteMultipartUploadOutput { + s.Bucket = &v + return s +} + +func (s *CompleteMultipartUploadOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetETag sets the ETag field's value. +func (s *CompleteMultipartUploadOutput) SetETag(v string) *CompleteMultipartUploadOutput { + s.ETag = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *CompleteMultipartUploadOutput) SetExpiration(v string) *CompleteMultipartUploadOutput { + s.Expiration = &v + return s +} + +// SetKey sets the Key field's value. +func (s *CompleteMultipartUploadOutput) SetKey(v string) *CompleteMultipartUploadOutput { + s.Key = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *CompleteMultipartUploadOutput) SetLocation(v string) *CompleteMultipartUploadOutput { + s.Location = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *CompleteMultipartUploadOutput) SetRequestCharged(v string) *CompleteMultipartUploadOutput { + s.RequestCharged = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *CompleteMultipartUploadOutput) SetSSEKMSKeyId(v string) *CompleteMultipartUploadOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *CompleteMultipartUploadOutput) SetServerSideEncryption(v string) *CompleteMultipartUploadOutput { + s.ServerSideEncryption = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *CompleteMultipartUploadOutput) SetVersionId(v string) *CompleteMultipartUploadOutput { + s.VersionId = &v + return s +} + +type CompletedMultipartUpload struct { + _ struct{} `type:"structure"` + + Parts []*CompletedPart `locationName:"Part" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s CompletedMultipartUpload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompletedMultipartUpload) GoString() string { + return s.String() +} + +// SetParts sets the Parts field's value. +func (s *CompletedMultipartUpload) SetParts(v []*CompletedPart) *CompletedMultipartUpload { + s.Parts = v + return s +} + +type CompletedPart struct { + _ struct{} `type:"structure"` + + // Entity tag returned when the part was uploaded. + ETag *string `type:"string"` + + // Part number that identifies the part. This is a positive integer between + // 1 and 10,000. + PartNumber *int64 `type:"integer"` +} + +// String returns the string representation +func (s CompletedPart) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompletedPart) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *CompletedPart) SetETag(v string) *CompletedPart { + s.ETag = &v + return s +} + +// SetPartNumber sets the PartNumber field's value. +func (s *CompletedPart) SetPartNumber(v int64) *CompletedPart { + s.PartNumber = &v + return s +} + +type Condition struct { + _ struct{} `type:"structure"` + + // The HTTP error code when the redirect is applied. In the event of an error, + // if the error code equals this value, then the specified redirect is applied. + // Required when parent element Condition is specified and sibling KeyPrefixEquals + // is not specified. If both are specified, then both must be true for the redirect + // to be applied. + HttpErrorCodeReturnedEquals *string `type:"string"` + + // The object key name prefix when the redirect is applied. For example, to + // redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. + // To redirect request for all pages with the prefix docs/, the key prefix will + // be /docs, which identifies all objects in the docs/ folder. Required when + // the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals + // is not specified. If both conditions are specified, both must be true for + // the redirect to be applied. + KeyPrefixEquals *string `type:"string"` +} + +// 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() +} + +// SetHttpErrorCodeReturnedEquals sets the HttpErrorCodeReturnedEquals field's value. +func (s *Condition) SetHttpErrorCodeReturnedEquals(v string) *Condition { + s.HttpErrorCodeReturnedEquals = &v + return s +} + +// SetKeyPrefixEquals sets the KeyPrefixEquals field's value. +func (s *Condition) SetKeyPrefixEquals(v string) *Condition { + s.KeyPrefixEquals = &v + return s +} + +type ContinuationEvent struct { + _ struct{} `locationName:"ContinuationEvent" type:"structure"` +} + +// String returns the string representation +func (s ContinuationEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContinuationEvent) GoString() string { + return s.String() +} + +// The ContinuationEvent is and event in the SelectObjectContentEventStream group of events. +func (s *ContinuationEvent) eventSelectObjectContentEventStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ContinuationEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ContinuationEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + return nil +} + +type CopyObjectInput struct { + _ struct{} `type:"structure"` + + // The canned ACL to apply to the object. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // The name of the source bucket and key name of the source object, separated + // by a slash (/). Must be URL-encoded. + // + // CopySource is a required field + CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` + + // Copies the object if its entity tag (ETag) matches the specified tag. + CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` + + // Copies the object if it has been modified since the specified time. + CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp"` + + // Copies the object if its entity tag (ETag) is different than the specified + // ETag. + CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` + + // Copies the object if it hasn't been modified since the specified time. + CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp"` + + // Specifies the algorithm to use when decrypting the source object (e.g., AES256). + CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt + // the source object. The encryption key provided in this header must be one + // that was used when the source object was created. + CopySourceSSECustomerKey *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` + + // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to read the object data and its metadata. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the object ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to write the ACL for the applicable object. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // Specifies whether the metadata is copied from the source object or replaced + // with metadata provided in the request. + MetadataDirective *string `location:"header" locationName:"x-amz-metadata-directive" type:"string" enum:"MetadataDirective"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT + // requests for an object protected by AWS KMS will fail if not made via SSL + // or using SigV4. Documentation on configuring any of the officially supported + // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // The type of storage to use for the object. Defaults to 'STANDARD'. + StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` + + // The tag-set for the object destination object this value must be used in + // conjunction with the TaggingDirective. The tag-set must be encoded as URL + // Query parameters + Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` + + // Specifies whether the object tag-set are copied from the source object or + // replaced with tag-set provided in the request. + TaggingDirective *string `location:"header" locationName:"x-amz-tagging-directive" type:"string" enum:"TaggingDirective"` + + // If the bucket is configured as a website, redirects requests for this object + // to another object in the same bucket or to an external URL. Amazon S3 stores + // the value of this header in the object metadata. + WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` +} + +// String returns the string representation +func (s CopyObjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyObjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CopyObjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CopyObjectInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.CopySource == nil { + invalidParams.Add(request.NewErrParamRequired("CopySource")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetACL sets the ACL field's value. +func (s *CopyObjectInput) SetACL(v string) *CopyObjectInput { + s.ACL = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *CopyObjectInput) SetBucket(v string) *CopyObjectInput { + s.Bucket = &v + return s +} + +func (s *CopyObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCacheControl sets the CacheControl field's value. +func (s *CopyObjectInput) SetCacheControl(v string) *CopyObjectInput { + s.CacheControl = &v + return s +} + +// SetContentDisposition sets the ContentDisposition field's value. +func (s *CopyObjectInput) SetContentDisposition(v string) *CopyObjectInput { + s.ContentDisposition = &v + return s +} + +// SetContentEncoding sets the ContentEncoding field's value. +func (s *CopyObjectInput) SetContentEncoding(v string) *CopyObjectInput { + s.ContentEncoding = &v + return s +} + +// SetContentLanguage sets the ContentLanguage field's value. +func (s *CopyObjectInput) SetContentLanguage(v string) *CopyObjectInput { + s.ContentLanguage = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *CopyObjectInput) SetContentType(v string) *CopyObjectInput { + s.ContentType = &v + return s +} + +// SetCopySource sets the CopySource field's value. +func (s *CopyObjectInput) SetCopySource(v string) *CopyObjectInput { + s.CopySource = &v + return s +} + +// SetCopySourceIfMatch sets the CopySourceIfMatch field's value. +func (s *CopyObjectInput) SetCopySourceIfMatch(v string) *CopyObjectInput { + s.CopySourceIfMatch = &v + return s +} + +// SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. +func (s *CopyObjectInput) SetCopySourceIfModifiedSince(v time.Time) *CopyObjectInput { + s.CopySourceIfModifiedSince = &v + return s +} + +// SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. +func (s *CopyObjectInput) SetCopySourceIfNoneMatch(v string) *CopyObjectInput { + s.CopySourceIfNoneMatch = &v + return s +} + +// SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. +func (s *CopyObjectInput) SetCopySourceIfUnmodifiedSince(v time.Time) *CopyObjectInput { + s.CopySourceIfUnmodifiedSince = &v + return s +} + +// SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. +func (s *CopyObjectInput) SetCopySourceSSECustomerAlgorithm(v string) *CopyObjectInput { + s.CopySourceSSECustomerAlgorithm = &v + return s +} + +// SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. +func (s *CopyObjectInput) SetCopySourceSSECustomerKey(v string) *CopyObjectInput { + s.CopySourceSSECustomerKey = &v + return s +} + +func (s *CopyObjectInput) getCopySourceSSECustomerKey() (v string) { + if s.CopySourceSSECustomerKey == nil { + return v + } + return *s.CopySourceSSECustomerKey +} + +// SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. +func (s *CopyObjectInput) SetCopySourceSSECustomerKeyMD5(v string) *CopyObjectInput { + s.CopySourceSSECustomerKeyMD5 = &v + return s +} + +// SetExpires sets the Expires field's value. +func (s *CopyObjectInput) SetExpires(v time.Time) *CopyObjectInput { + s.Expires = &v + return s +} + +// SetGrantFullControl sets the GrantFullControl field's value. +func (s *CopyObjectInput) SetGrantFullControl(v string) *CopyObjectInput { + s.GrantFullControl = &v + return s +} + +// SetGrantRead sets the GrantRead field's value. +func (s *CopyObjectInput) SetGrantRead(v string) *CopyObjectInput { + s.GrantRead = &v + return s +} + +// SetGrantReadACP sets the GrantReadACP field's value. +func (s *CopyObjectInput) SetGrantReadACP(v string) *CopyObjectInput { + s.GrantReadACP = &v + return s +} + +// SetGrantWriteACP sets the GrantWriteACP field's value. +func (s *CopyObjectInput) SetGrantWriteACP(v string) *CopyObjectInput { + s.GrantWriteACP = &v + return s +} + +// SetKey sets the Key field's value. +func (s *CopyObjectInput) SetKey(v string) *CopyObjectInput { + s.Key = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *CopyObjectInput) SetMetadata(v map[string]*string) *CopyObjectInput { + s.Metadata = v + return s +} + +// SetMetadataDirective sets the MetadataDirective field's value. +func (s *CopyObjectInput) SetMetadataDirective(v string) *CopyObjectInput { + s.MetadataDirective = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *CopyObjectInput) SetRequestPayer(v string) *CopyObjectInput { + s.RequestPayer = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *CopyObjectInput) SetSSECustomerAlgorithm(v string) *CopyObjectInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *CopyObjectInput) SetSSECustomerKey(v string) *CopyObjectInput { + s.SSECustomerKey = &v + return s +} + +func (s *CopyObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *CopyObjectInput) SetSSECustomerKeyMD5(v string) *CopyObjectInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *CopyObjectInput) SetSSEKMSKeyId(v string) *CopyObjectInput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *CopyObjectInput) SetServerSideEncryption(v string) *CopyObjectInput { + s.ServerSideEncryption = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *CopyObjectInput) SetStorageClass(v string) *CopyObjectInput { + s.StorageClass = &v + return s +} + +// SetTagging sets the Tagging field's value. +func (s *CopyObjectInput) SetTagging(v string) *CopyObjectInput { + s.Tagging = &v + return s +} + +// SetTaggingDirective sets the TaggingDirective field's value. +func (s *CopyObjectInput) SetTaggingDirective(v string) *CopyObjectInput { + s.TaggingDirective = &v + return s +} + +// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. +func (s *CopyObjectInput) SetWebsiteRedirectLocation(v string) *CopyObjectInput { + s.WebsiteRedirectLocation = &v + return s +} + +type CopyObjectOutput struct { + _ struct{} `type:"structure" payload:"CopyObjectResult"` + + CopyObjectResult *CopyObjectResult `type:"structure"` + + CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` + + // If the object expiration is configured, the response includes this header. + Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // Version ID of the newly created copy. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s CopyObjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyObjectOutput) GoString() string { + return s.String() +} + +// SetCopyObjectResult sets the CopyObjectResult field's value. +func (s *CopyObjectOutput) SetCopyObjectResult(v *CopyObjectResult) *CopyObjectOutput { + s.CopyObjectResult = v + return s +} + +// SetCopySourceVersionId sets the CopySourceVersionId field's value. +func (s *CopyObjectOutput) SetCopySourceVersionId(v string) *CopyObjectOutput { + s.CopySourceVersionId = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *CopyObjectOutput) SetExpiration(v string) *CopyObjectOutput { + s.Expiration = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *CopyObjectOutput) SetRequestCharged(v string) *CopyObjectOutput { + s.RequestCharged = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *CopyObjectOutput) SetSSECustomerAlgorithm(v string) *CopyObjectOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *CopyObjectOutput) SetSSECustomerKeyMD5(v string) *CopyObjectOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *CopyObjectOutput) SetSSEKMSKeyId(v string) *CopyObjectOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *CopyObjectOutput) SetServerSideEncryption(v string) *CopyObjectOutput { + s.ServerSideEncryption = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *CopyObjectOutput) SetVersionId(v string) *CopyObjectOutput { + s.VersionId = &v + return s +} + +type CopyObjectResult struct { + _ struct{} `type:"structure"` + + ETag *string `type:"string"` + + LastModified *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s CopyObjectResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyObjectResult) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *CopyObjectResult) SetETag(v string) *CopyObjectResult { + s.ETag = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *CopyObjectResult) SetLastModified(v time.Time) *CopyObjectResult { + s.LastModified = &v + return s +} + +type CopyPartResult struct { + _ struct{} `type:"structure"` + + // Entity tag of the object. + ETag *string `type:"string"` + + // Date and time at which the object was uploaded. + LastModified *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s CopyPartResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyPartResult) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *CopyPartResult) SetETag(v string) *CopyPartResult { + s.ETag = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *CopyPartResult) SetLastModified(v time.Time) *CopyPartResult { + s.LastModified = &v + return s +} + +type CreateBucketConfiguration struct { + _ struct{} `type:"structure"` + + // Specifies the region where the bucket will be created. If you don't specify + // a region, the bucket will be created in US Standard. + LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` +} + +// String returns the string representation +func (s CreateBucketConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBucketConfiguration) GoString() string { + return s.String() +} + +// SetLocationConstraint sets the LocationConstraint field's value. +func (s *CreateBucketConfiguration) SetLocationConstraint(v string) *CreateBucketConfiguration { + s.LocationConstraint = &v + return s +} + +type CreateBucketInput struct { + _ struct{} `type:"structure" payload:"CreateBucketConfiguration"` + + // The canned ACL to apply to the bucket. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + CreateBucketConfiguration *CreateBucketConfiguration `locationName:"CreateBucketConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // Allows grantee the read, write, read ACP, and write ACP permissions on the + // bucket. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to list the objects in the bucket. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the bucket ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to create, overwrite, and delete any object in the bucket. + GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` + + // Allows grantee to write the ACL for the applicable bucket. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` +} + +// String returns the string representation +func (s CreateBucketInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBucketInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateBucketInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateBucketInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetACL sets the ACL field's value. +func (s *CreateBucketInput) SetACL(v string) *CreateBucketInput { + s.ACL = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *CreateBucketInput) SetBucket(v string) *CreateBucketInput { + s.Bucket = &v + return s +} + +func (s *CreateBucketInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCreateBucketConfiguration sets the CreateBucketConfiguration field's value. +func (s *CreateBucketInput) SetCreateBucketConfiguration(v *CreateBucketConfiguration) *CreateBucketInput { + s.CreateBucketConfiguration = v + return s +} + +// SetGrantFullControl sets the GrantFullControl field's value. +func (s *CreateBucketInput) SetGrantFullControl(v string) *CreateBucketInput { + s.GrantFullControl = &v + return s +} + +// SetGrantRead sets the GrantRead field's value. +func (s *CreateBucketInput) SetGrantRead(v string) *CreateBucketInput { + s.GrantRead = &v + return s +} + +// SetGrantReadACP sets the GrantReadACP field's value. +func (s *CreateBucketInput) SetGrantReadACP(v string) *CreateBucketInput { + s.GrantReadACP = &v + return s +} + +// SetGrantWrite sets the GrantWrite field's value. +func (s *CreateBucketInput) SetGrantWrite(v string) *CreateBucketInput { + s.GrantWrite = &v + return s +} + +// SetGrantWriteACP sets the GrantWriteACP field's value. +func (s *CreateBucketInput) SetGrantWriteACP(v string) *CreateBucketInput { + s.GrantWriteACP = &v + return s +} + +type CreateBucketOutput struct { + _ struct{} `type:"structure"` + + Location *string `location:"header" locationName:"Location" type:"string"` +} + +// String returns the string representation +func (s CreateBucketOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBucketOutput) GoString() string { + return s.String() +} + +// SetLocation sets the Location field's value. +func (s *CreateBucketOutput) SetLocation(v string) *CreateBucketOutput { + s.Location = &v + return s +} + +type CreateMultipartUploadInput struct { + _ struct{} `type:"structure"` + + // The canned ACL to apply to the object. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` + + // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to read the object data and its metadata. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the object ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to write the ACL for the applicable object. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT + // requests for an object protected by AWS KMS will fail if not made via SSL + // or using SigV4. Documentation on configuring any of the officially supported + // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // The type of storage to use for the object. Defaults to 'STANDARD'. + StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` + + // The tag-set for the object. The tag-set must be encoded as URL Query parameters + Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` + + // If the bucket is configured as a website, redirects requests for this object + // to another object in the same bucket or to an external URL. Amazon S3 stores + // the value of this header in the object metadata. + WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` +} + +// String returns the string representation +func (s CreateMultipartUploadInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateMultipartUploadInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateMultipartUploadInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateMultipartUploadInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetACL sets the ACL field's value. +func (s *CreateMultipartUploadInput) SetACL(v string) *CreateMultipartUploadInput { + s.ACL = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *CreateMultipartUploadInput) SetBucket(v string) *CreateMultipartUploadInput { + s.Bucket = &v + return s +} + +func (s *CreateMultipartUploadInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCacheControl sets the CacheControl field's value. +func (s *CreateMultipartUploadInput) SetCacheControl(v string) *CreateMultipartUploadInput { + s.CacheControl = &v + return s +} + +// SetContentDisposition sets the ContentDisposition field's value. +func (s *CreateMultipartUploadInput) SetContentDisposition(v string) *CreateMultipartUploadInput { + s.ContentDisposition = &v + return s +} + +// SetContentEncoding sets the ContentEncoding field's value. +func (s *CreateMultipartUploadInput) SetContentEncoding(v string) *CreateMultipartUploadInput { + s.ContentEncoding = &v + return s +} + +// SetContentLanguage sets the ContentLanguage field's value. +func (s *CreateMultipartUploadInput) SetContentLanguage(v string) *CreateMultipartUploadInput { + s.ContentLanguage = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *CreateMultipartUploadInput) SetContentType(v string) *CreateMultipartUploadInput { + s.ContentType = &v + return s +} + +// SetExpires sets the Expires field's value. +func (s *CreateMultipartUploadInput) SetExpires(v time.Time) *CreateMultipartUploadInput { + s.Expires = &v + return s +} + +// SetGrantFullControl sets the GrantFullControl field's value. +func (s *CreateMultipartUploadInput) SetGrantFullControl(v string) *CreateMultipartUploadInput { + s.GrantFullControl = &v + return s +} + +// SetGrantRead sets the GrantRead field's value. +func (s *CreateMultipartUploadInput) SetGrantRead(v string) *CreateMultipartUploadInput { + s.GrantRead = &v + return s +} + +// SetGrantReadACP sets the GrantReadACP field's value. +func (s *CreateMultipartUploadInput) SetGrantReadACP(v string) *CreateMultipartUploadInput { + s.GrantReadACP = &v + return s +} + +// SetGrantWriteACP sets the GrantWriteACP field's value. +func (s *CreateMultipartUploadInput) SetGrantWriteACP(v string) *CreateMultipartUploadInput { + s.GrantWriteACP = &v + return s +} + +// SetKey sets the Key field's value. +func (s *CreateMultipartUploadInput) SetKey(v string) *CreateMultipartUploadInput { + s.Key = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *CreateMultipartUploadInput) SetMetadata(v map[string]*string) *CreateMultipartUploadInput { + s.Metadata = v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *CreateMultipartUploadInput) SetRequestPayer(v string) *CreateMultipartUploadInput { + s.RequestPayer = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *CreateMultipartUploadInput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *CreateMultipartUploadInput) SetSSECustomerKey(v string) *CreateMultipartUploadInput { + s.SSECustomerKey = &v + return s +} + +func (s *CreateMultipartUploadInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *CreateMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *CreateMultipartUploadInput) SetSSEKMSKeyId(v string) *CreateMultipartUploadInput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *CreateMultipartUploadInput) SetServerSideEncryption(v string) *CreateMultipartUploadInput { + s.ServerSideEncryption = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *CreateMultipartUploadInput) SetStorageClass(v string) *CreateMultipartUploadInput { + s.StorageClass = &v + return s +} + +// SetTagging sets the Tagging field's value. +func (s *CreateMultipartUploadInput) SetTagging(v string) *CreateMultipartUploadInput { + s.Tagging = &v + return s +} + +// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. +func (s *CreateMultipartUploadInput) SetWebsiteRedirectLocation(v string) *CreateMultipartUploadInput { + s.WebsiteRedirectLocation = &v + return s +} + +type CreateMultipartUploadOutput struct { + _ struct{} `type:"structure"` + + // Date when multipart upload will become eligible for abort operation by lifecycle. + AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp"` + + // Id of the lifecycle rule that makes a multipart upload eligible for abort + // operation. + AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` + + // Name of the bucket to which the multipart upload was initiated. + Bucket *string `locationName:"Bucket" type:"string"` + + // Object key for which the multipart upload was initiated. + Key *string `min:"1" type:"string"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // ID for the initiated multipart upload. + UploadId *string `type:"string"` +} + +// String returns the string representation +func (s CreateMultipartUploadOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateMultipartUploadOutput) GoString() string { + return s.String() +} + +// SetAbortDate sets the AbortDate field's value. +func (s *CreateMultipartUploadOutput) SetAbortDate(v time.Time) *CreateMultipartUploadOutput { + s.AbortDate = &v + return s +} + +// SetAbortRuleId sets the AbortRuleId field's value. +func (s *CreateMultipartUploadOutput) SetAbortRuleId(v string) *CreateMultipartUploadOutput { + s.AbortRuleId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *CreateMultipartUploadOutput) SetBucket(v string) *CreateMultipartUploadOutput { + s.Bucket = &v + return s +} + +func (s *CreateMultipartUploadOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *CreateMultipartUploadOutput) SetKey(v string) *CreateMultipartUploadOutput { + s.Key = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *CreateMultipartUploadOutput) SetRequestCharged(v string) *CreateMultipartUploadOutput { + s.RequestCharged = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *CreateMultipartUploadOutput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *CreateMultipartUploadOutput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *CreateMultipartUploadOutput) SetSSEKMSKeyId(v string) *CreateMultipartUploadOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *CreateMultipartUploadOutput) SetServerSideEncryption(v string) *CreateMultipartUploadOutput { + s.ServerSideEncryption = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUploadOutput { + s.UploadId = &v + return s +} + +type Delete struct { + _ struct{} `type:"structure"` + + // Objects is a required field + Objects []*ObjectIdentifier `locationName:"Object" type:"list" flattened:"true" required:"true"` + + // Element to enable quiet mode for the request. When you add this element, + // you must set its value to true. + Quiet *bool `type:"boolean"` +} + +// String returns the string representation +func (s Delete) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Delete) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Delete) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Delete"} + if s.Objects == nil { + invalidParams.Add(request.NewErrParamRequired("Objects")) + } + if s.Objects != nil { + for i, v := range s.Objects { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Objects", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetObjects sets the Objects field's value. +func (s *Delete) SetObjects(v []*ObjectIdentifier) *Delete { + s.Objects = v + return s +} + +// SetQuiet sets the Quiet field's value. +func (s *Delete) SetQuiet(v bool) *Delete { + s.Quiet = &v + return s +} + +type DeleteBucketAnalyticsConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket from which an analytics configuration is deleted. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The identifier used to represent an analytics configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketAnalyticsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketAnalyticsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketAnalyticsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketAnalyticsConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *DeleteBucketAnalyticsConfigurationInput) SetBucket(v string) *DeleteBucketAnalyticsConfigurationInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketAnalyticsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketAnalyticsConfigurationInput { + s.Id = &v + return s +} + +type DeleteBucketAnalyticsConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketAnalyticsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketAnalyticsConfigurationOutput) GoString() string { + return s.String() +} + +type DeleteBucketCorsInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketCorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketCorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketCorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketCorsInput"} + 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 *DeleteBucketCorsInput) SetBucket(v string) *DeleteBucketCorsInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketCorsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketCorsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketCorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketCorsOutput) GoString() string { + return s.String() +} + +type DeleteBucketEncryptionInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the server-side encryption configuration + // to delete. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketEncryptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketEncryptionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketEncryptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketEncryptionInput"} + 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 *DeleteBucketEncryptionInput) SetBucket(v string) *DeleteBucketEncryptionInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketEncryptionInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketEncryptionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketEncryptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketEncryptionOutput) GoString() string { + return s.String() +} + +type DeleteBucketInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInput"} + 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 *DeleteBucketInput) SetBucket(v string) *DeleteBucketInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketInventoryConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the inventory configuration to delete. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ID used to identify the inventory configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketInventoryConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketInventoryConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketInventoryConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInventoryConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *DeleteBucketInventoryConfigurationInput) SetBucket(v string) *DeleteBucketInventoryConfigurationInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketInventoryConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketInventoryConfigurationInput { + s.Id = &v + return s +} + +type DeleteBucketInventoryConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketInventoryConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketInventoryConfigurationOutput) GoString() string { + return s.String() +} + +type DeleteBucketLifecycleInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketLifecycleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketLifecycleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketLifecycleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketLifecycleInput"} + 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 *DeleteBucketLifecycleInput) SetBucket(v string) *DeleteBucketLifecycleInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketLifecycleInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketLifecycleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketLifecycleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketLifecycleOutput) GoString() string { + return s.String() +} + +type DeleteBucketMetricsConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the metrics configuration to delete. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ID used to identify the metrics configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketMetricsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketMetricsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketMetricsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketMetricsConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *DeleteBucketMetricsConfigurationInput) SetBucket(v string) *DeleteBucketMetricsConfigurationInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketMetricsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMetricsConfigurationInput { + s.Id = &v + return s +} + +type DeleteBucketMetricsConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketMetricsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketMetricsConfigurationOutput) GoString() string { + return s.String() +} + +type DeleteBucketOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketOutput) GoString() string { + return s.String() +} + +type DeleteBucketPolicyInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketPolicyInput"} + 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 *DeleteBucketPolicyInput) SetBucket(v string) *DeleteBucketPolicyInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketPolicyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketPolicyOutput) GoString() string { + return s.String() +} + +type DeleteBucketReplicationInput struct { + _ struct{} `type:"structure"` + + // Deletes the replication subresource associated with the specified bucket. + // + // There is usually some time lag before replication configuration deletion + // is fully propagated to all the Amazon S3 systems. + // + // For more information, see Cross-Region Replication (CRR) ( https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) + // in the Amazon S3 Developer Guide. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketReplicationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketReplicationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketReplicationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketReplicationInput"} + 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 *DeleteBucketReplicationInput) SetBucket(v string) *DeleteBucketReplicationInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketReplicationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketReplicationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketReplicationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketReplicationOutput) GoString() string { + return s.String() +} + +type DeleteBucketTaggingInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketTaggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketTaggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketTaggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketTaggingInput"} + 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 *DeleteBucketTaggingInput) SetBucket(v string) *DeleteBucketTaggingInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketTaggingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketTaggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketTaggingOutput) GoString() string { + return s.String() +} + +type DeleteBucketWebsiteInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBucketWebsiteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketWebsiteInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBucketWebsiteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBucketWebsiteInput"} + 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 *DeleteBucketWebsiteInput) SetBucket(v string) *DeleteBucketWebsiteInput { + s.Bucket = &v + return s +} + +func (s *DeleteBucketWebsiteInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type DeleteBucketWebsiteOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteBucketWebsiteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBucketWebsiteOutput) GoString() string { + return s.String() +} + +type DeleteMarkerEntry struct { + _ struct{} `type:"structure"` + + // Specifies whether the object is (true) or is not (false) the latest version + // of an object. + IsLatest *bool `type:"boolean"` + + // The object key. + Key *string `min:"1" type:"string"` + + // Date and time the object was last modified. + LastModified *time.Time `type:"timestamp"` + + Owner *Owner `type:"structure"` + + // Version ID of an object. + VersionId *string `type:"string"` +} + +// String returns the string representation +func (s DeleteMarkerEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMarkerEntry) GoString() string { + return s.String() +} + +// SetIsLatest sets the IsLatest field's value. +func (s *DeleteMarkerEntry) SetIsLatest(v bool) *DeleteMarkerEntry { + s.IsLatest = &v + return s +} + +// SetKey sets the Key field's value. +func (s *DeleteMarkerEntry) SetKey(v string) *DeleteMarkerEntry { + s.Key = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *DeleteMarkerEntry) SetLastModified(v time.Time) *DeleteMarkerEntry { + s.LastModified = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *DeleteMarkerEntry) SetOwner(v *Owner) *DeleteMarkerEntry { + s.Owner = v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeleteMarkerEntry) SetVersionId(v string) *DeleteMarkerEntry { + s.VersionId = &v + return s +} + +// Specifies whether Amazon S3 should replicate delete makers. +type DeleteMarkerReplication struct { + _ struct{} `type:"structure"` + + // The status of the delete marker replication. + // + // In the current implementation, Amazon S3 does not replicate the delete markers. + // Therefore, the status must be Disabled. + Status *string `type:"string" enum:"DeleteMarkerReplicationStatus"` +} + +// String returns the string representation +func (s DeleteMarkerReplication) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMarkerReplication) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *DeleteMarkerReplication) SetStatus(v string) *DeleteMarkerReplication { + s.Status = &v + return s +} + +type DeleteObjectInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // The concatenation of the authentication device's serial number, a space, + // and the value that is displayed on your authentication device. + MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // VersionId used to reference a specific version of the object. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s DeleteObjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteObjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteObjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteObjectInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *DeleteObjectInput) SetBucket(v string) *DeleteObjectInput { + s.Bucket = &v + return s +} + +func (s *DeleteObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *DeleteObjectInput) SetKey(v string) *DeleteObjectInput { + s.Key = &v + return s +} + +// SetMFA sets the MFA field's value. +func (s *DeleteObjectInput) SetMFA(v string) *DeleteObjectInput { + s.MFA = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *DeleteObjectInput) SetRequestPayer(v string) *DeleteObjectInput { + s.RequestPayer = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeleteObjectInput) SetVersionId(v string) *DeleteObjectInput { + s.VersionId = &v + return s +} + +type DeleteObjectOutput struct { + _ struct{} `type:"structure"` + + // Specifies whether the versioned object that was permanently deleted was (true) + // or was not (false) a delete marker. + DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // Returns the version ID of the delete marker created as a result of the DELETE + // operation. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s DeleteObjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteObjectOutput) GoString() string { + return s.String() +} + +// SetDeleteMarker sets the DeleteMarker field's value. +func (s *DeleteObjectOutput) SetDeleteMarker(v bool) *DeleteObjectOutput { + s.DeleteMarker = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *DeleteObjectOutput) SetRequestCharged(v string) *DeleteObjectOutput { + s.RequestCharged = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeleteObjectOutput) SetVersionId(v string) *DeleteObjectOutput { + s.VersionId = &v + return s +} + +type DeleteObjectTaggingInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // The versionId of the object that the tag-set will be removed from. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s DeleteObjectTaggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteObjectTaggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteObjectTaggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteObjectTaggingInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *DeleteObjectTaggingInput) SetBucket(v string) *DeleteObjectTaggingInput { + s.Bucket = &v + return s +} + +func (s *DeleteObjectTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *DeleteObjectTaggingInput) SetKey(v string) *DeleteObjectTaggingInput { + s.Key = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeleteObjectTaggingInput) SetVersionId(v string) *DeleteObjectTaggingInput { + s.VersionId = &v + return s +} + +type DeleteObjectTaggingOutput struct { + _ struct{} `type:"structure"` + + // The versionId of the object the tag-set was removed from. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s DeleteObjectTaggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteObjectTaggingOutput) GoString() string { + return s.String() +} + +// SetVersionId sets the VersionId field's value. +func (s *DeleteObjectTaggingOutput) SetVersionId(v string) *DeleteObjectTaggingOutput { + s.VersionId = &v + return s +} + +type DeleteObjectsInput struct { + _ struct{} `type:"structure" payload:"Delete"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Delete is a required field + Delete *Delete `locationName:"Delete" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // The concatenation of the authentication device's serial number, a space, + // and the value that is displayed on your authentication device. + MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` +} + +// String returns the string representation +func (s DeleteObjectsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteObjectsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteObjectsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteObjectsInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Delete == nil { + invalidParams.Add(request.NewErrParamRequired("Delete")) + } + 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 +} + +// SetBucket sets the Bucket field's value. +func (s *DeleteObjectsInput) SetBucket(v string) *DeleteObjectsInput { + s.Bucket = &v + return s +} + +func (s *DeleteObjectsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetDelete sets the Delete field's value. +func (s *DeleteObjectsInput) SetDelete(v *Delete) *DeleteObjectsInput { + s.Delete = v + return s +} + +// SetMFA sets the MFA field's value. +func (s *DeleteObjectsInput) SetMFA(v string) *DeleteObjectsInput { + s.MFA = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *DeleteObjectsInput) SetRequestPayer(v string) *DeleteObjectsInput { + s.RequestPayer = &v + return s +} + +type DeleteObjectsOutput struct { + _ struct{} `type:"structure"` + + Deleted []*DeletedObject `type:"list" flattened:"true"` + + Errors []*Error `locationName:"Error" type:"list" flattened:"true"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` +} + +// String returns the string representation +func (s DeleteObjectsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteObjectsOutput) GoString() string { + return s.String() +} + +// SetDeleted sets the Deleted field's value. +func (s *DeleteObjectsOutput) SetDeleted(v []*DeletedObject) *DeleteObjectsOutput { + s.Deleted = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *DeleteObjectsOutput) SetErrors(v []*Error) *DeleteObjectsOutput { + s.Errors = v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *DeleteObjectsOutput) SetRequestCharged(v string) *DeleteObjectsOutput { + s.RequestCharged = &v + return s +} + +type DeletedObject struct { + _ struct{} `type:"structure"` + + DeleteMarker *bool `type:"boolean"` + + DeleteMarkerVersionId *string `type:"string"` + + Key *string `min:"1" type:"string"` + + VersionId *string `type:"string"` +} + +// String returns the string representation +func (s DeletedObject) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletedObject) GoString() string { + return s.String() +} + +// SetDeleteMarker sets the DeleteMarker field's value. +func (s *DeletedObject) SetDeleteMarker(v bool) *DeletedObject { + s.DeleteMarker = &v + return s +} + +// SetDeleteMarkerVersionId sets the DeleteMarkerVersionId field's value. +func (s *DeletedObject) SetDeleteMarkerVersionId(v string) *DeletedObject { + s.DeleteMarkerVersionId = &v + return s +} + +// SetKey sets the Key field's value. +func (s *DeletedObject) SetKey(v string) *DeletedObject { + s.Key = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeletedObject) SetVersionId(v string) *DeletedObject { + s.VersionId = &v + return s +} + +// Container for replication destination information. +type Destination struct { + _ struct{} `type:"structure"` + + // Container for information regarding the access control for replicas. + // + // Use only in a cross-account scenario, where source and destination bucket + // owners are not the same, when you want to change replica ownership to the + // AWS account that owns the destination bucket. If you don't add this element + // to the replication configuration, the replicas are owned by same AWS account + // that owns the source object. + AccessControlTranslation *AccessControlTranslation `type:"structure"` + + // Account ID of the destination bucket. Currently Amazon S3 verifies this value + // only if Access Control Translation is enabled. + // + // In a cross-account scenario, if you tell Amazon S3 to change replica ownership + // to the AWS account that owns the destination bucket by adding the AccessControlTranslation + // element, this is the account ID of the destination bucket owner. + Account *string `type:"string"` + + // Amazon resource name (ARN) of the bucket where you want Amazon S3 to store + // replicas of the object identified by the rule. + // + // If you have multiple rules in your replication configuration, all rules must + // specify the same bucket as the destination. A replication configuration can + // replicate objects only to one destination bucket. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // Container that provides encryption-related information. You must specify + // this element if the SourceSelectionCriteria is specified. + EncryptionConfiguration *EncryptionConfiguration `type:"structure"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"StorageClass"` +} + +// String returns the string representation +func (s Destination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Destination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Destination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Destination"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.AccessControlTranslation != nil { + if err := s.AccessControlTranslation.Validate(); err != nil { + invalidParams.AddNested("AccessControlTranslation", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessControlTranslation sets the AccessControlTranslation field's value. +func (s *Destination) SetAccessControlTranslation(v *AccessControlTranslation) *Destination { + s.AccessControlTranslation = v + return s +} + +// SetAccount sets the Account field's value. +func (s *Destination) SetAccount(v string) *Destination { + s.Account = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *Destination) SetBucket(v string) *Destination { + s.Bucket = &v + return s +} + +func (s *Destination) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. +func (s *Destination) SetEncryptionConfiguration(v *EncryptionConfiguration) *Destination { + s.EncryptionConfiguration = v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *Destination) SetStorageClass(v string) *Destination { + s.StorageClass = &v + return s +} + +// Describes the server-side encryption that will be applied to the restore +// results. +type Encryption struct { + _ struct{} `type:"structure"` + + // The server-side encryption algorithm used when storing job results in Amazon + // S3 (e.g., AES256, aws:kms). + // + // EncryptionType is a required field + EncryptionType *string `type:"string" required:"true" enum:"ServerSideEncryption"` + + // If the encryption type is aws:kms, this optional value can be used to specify + // the encryption context for the restore results. + KMSContext *string `type:"string"` + + // If the encryption type is aws:kms, this optional value specifies the AWS + // KMS key ID to use for encryption of job results. + KMSKeyId *string `type:"string"` +} + +// String returns the string representation +func (s Encryption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Encryption) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Encryption) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Encryption"} + if s.EncryptionType == nil { + invalidParams.Add(request.NewErrParamRequired("EncryptionType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEncryptionType sets the EncryptionType field's value. +func (s *Encryption) SetEncryptionType(v string) *Encryption { + s.EncryptionType = &v + return s +} + +// SetKMSContext sets the KMSContext field's value. +func (s *Encryption) SetKMSContext(v string) *Encryption { + s.KMSContext = &v + return s +} + +// SetKMSKeyId sets the KMSKeyId field's value. +func (s *Encryption) SetKMSKeyId(v string) *Encryption { + s.KMSKeyId = &v + return s +} + +// Container for information regarding encryption based configuration for replicas. +type EncryptionConfiguration struct { + _ struct{} `type:"structure"` + + // The ID of the AWS KMS key for the region where the destination bucket resides. + // Amazon S3 uses this key to encrypt the replica object. + ReplicaKmsKeyID *string `type:"string"` +} + +// String returns the string representation +func (s EncryptionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionConfiguration) GoString() string { + return s.String() +} + +// SetReplicaKmsKeyID sets the ReplicaKmsKeyID field's value. +func (s *EncryptionConfiguration) SetReplicaKmsKeyID(v string) *EncryptionConfiguration { + s.ReplicaKmsKeyID = &v + return s +} + +type EndEvent struct { + _ struct{} `locationName:"EndEvent" type:"structure"` +} + +// String returns the string representation +func (s EndEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EndEvent) GoString() string { + return s.String() +} + +// The EndEvent is and event in the SelectObjectContentEventStream group of events. +func (s *EndEvent) eventSelectObjectContentEventStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the EndEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *EndEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + return nil +} + +type Error struct { + _ struct{} `type:"structure"` + + Code *string `type:"string"` + + Key *string `min:"1" type:"string"` + + Message *string `type:"string"` + + VersionId *string `type:"string"` +} + +// String returns the string representation +func (s Error) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Error) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *Error) SetCode(v string) *Error { + s.Code = &v + return s +} + +// SetKey sets the Key field's value. +func (s *Error) SetKey(v string) *Error { + s.Key = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *Error) SetMessage(v string) *Error { + s.Message = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *Error) SetVersionId(v string) *Error { + s.VersionId = &v + return s +} + +type ErrorDocument struct { + _ struct{} `type:"structure"` + + // The object key name to use when a 4XX class error occurs. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ErrorDocument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorDocument) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ErrorDocument) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ErrorDocument"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *ErrorDocument) SetKey(v string) *ErrorDocument { + s.Key = &v + return s +} + +// Container for key value pair that defines the criteria for the filter rule. +type FilterRule struct { + _ struct{} `type:"structure"` + + // Object key name prefix or suffix identifying one or more objects to which + // the filtering rule applies. Maximum prefix length can be up to 1,024 characters. + // Overlapping prefixes and suffixes are not supported. For more information, + // go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // in the Amazon Simple Storage Service Developer Guide. + Name *string `type:"string" enum:"FilterRuleName"` + + Value *string `type:"string"` +} + +// String returns the string representation +func (s FilterRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FilterRule) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *FilterRule) SetName(v string) *FilterRule { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *FilterRule) SetValue(v string) *FilterRule { + s.Value = &v + return s +} + +type GetBucketAccelerateConfigurationInput struct { + _ struct{} `type:"structure"` + + // Name of the bucket for which the accelerate configuration is retrieved. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketAccelerateConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAccelerateConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketAccelerateConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketAccelerateConfigurationInput"} + 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 *GetBucketAccelerateConfigurationInput) SetBucket(v string) *GetBucketAccelerateConfigurationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketAccelerateConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketAccelerateConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The accelerate configuration of the bucket. + Status *string `type:"string" enum:"BucketAccelerateStatus"` +} + +// String returns the string representation +func (s GetBucketAccelerateConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAccelerateConfigurationOutput) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *GetBucketAccelerateConfigurationOutput) SetStatus(v string) *GetBucketAccelerateConfigurationOutput { + s.Status = &v + return s +} + +type GetBucketAclInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketAclInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAclInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketAclInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketAclInput"} + 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 *GetBucketAclInput) SetBucket(v string) *GetBucketAclInput { + s.Bucket = &v + return s +} + +func (s *GetBucketAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketAclOutput struct { + _ struct{} `type:"structure"` + + // A list of grants. + Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` + + Owner *Owner `type:"structure"` +} + +// String returns the string representation +func (s GetBucketAclOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAclOutput) GoString() string { + return s.String() +} + +// SetGrants sets the Grants field's value. +func (s *GetBucketAclOutput) SetGrants(v []*Grant) *GetBucketAclOutput { + s.Grants = v + return s +} + +// SetOwner sets the Owner field's value. +func (s *GetBucketAclOutput) SetOwner(v *Owner) *GetBucketAclOutput { + s.Owner = v + return s +} + +type GetBucketAnalyticsConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket from which an analytics configuration is retrieved. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The identifier used to represent an analytics configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketAnalyticsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAnalyticsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketAnalyticsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketAnalyticsConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetBucketAnalyticsConfigurationInput) SetBucket(v string) *GetBucketAnalyticsConfigurationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketAnalyticsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput { + s.Id = &v + return s +} + +type GetBucketAnalyticsConfigurationOutput struct { + _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` + + // The configuration and any analyses for the analytics filter. + AnalyticsConfiguration *AnalyticsConfiguration `type:"structure"` +} + +// String returns the string representation +func (s GetBucketAnalyticsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAnalyticsConfigurationOutput) GoString() string { + return s.String() +} + +// SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. +func (s *GetBucketAnalyticsConfigurationOutput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *GetBucketAnalyticsConfigurationOutput { + s.AnalyticsConfiguration = v + return s +} + +type GetBucketCorsInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketCorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketCorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketCorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketCorsInput"} + 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 *GetBucketCorsInput) SetBucket(v string) *GetBucketCorsInput { + s.Bucket = &v + return s +} + +func (s *GetBucketCorsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketCorsOutput struct { + _ struct{} `type:"structure"` + + CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s GetBucketCorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketCorsOutput) GoString() string { + return s.String() +} + +// SetCORSRules sets the CORSRules field's value. +func (s *GetBucketCorsOutput) SetCORSRules(v []*CORSRule) *GetBucketCorsOutput { + s.CORSRules = v + return s +} + +type GetBucketEncryptionInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket from which the server-side encryption configuration + // is retrieved. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketEncryptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketEncryptionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketEncryptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketEncryptionInput"} + 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 *GetBucketEncryptionInput) SetBucket(v string) *GetBucketEncryptionInput { + s.Bucket = &v + return s +} + +func (s *GetBucketEncryptionInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketEncryptionOutput struct { + _ struct{} `type:"structure" payload:"ServerSideEncryptionConfiguration"` + + // Container for server-side encryption configuration rules. Currently S3 supports + // one rule only. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `type:"structure"` +} + +// String returns the string representation +func (s GetBucketEncryptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketEncryptionOutput) GoString() string { + return s.String() +} + +// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. +func (s *GetBucketEncryptionOutput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *GetBucketEncryptionOutput { + s.ServerSideEncryptionConfiguration = v + return s +} + +type GetBucketInventoryConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the inventory configuration to retrieve. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ID used to identify the inventory configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketInventoryConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketInventoryConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketInventoryConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketInventoryConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetBucketInventoryConfigurationInput) SetBucket(v string) *GetBucketInventoryConfigurationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketInventoryConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInventoryConfigurationInput { + s.Id = &v + return s +} + +type GetBucketInventoryConfigurationOutput struct { + _ struct{} `type:"structure" payload:"InventoryConfiguration"` + + // Specifies the inventory configuration. + InventoryConfiguration *InventoryConfiguration `type:"structure"` +} + +// String returns the string representation +func (s GetBucketInventoryConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketInventoryConfigurationOutput) GoString() string { + return s.String() +} + +// SetInventoryConfiguration sets the InventoryConfiguration field's value. +func (s *GetBucketInventoryConfigurationOutput) SetInventoryConfiguration(v *InventoryConfiguration) *GetBucketInventoryConfigurationOutput { + s.InventoryConfiguration = v + return s +} + +type GetBucketLifecycleConfigurationInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketLifecycleConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLifecycleConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketLifecycleConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleConfigurationInput"} + 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 *GetBucketLifecycleConfigurationInput) SetBucket(v string) *GetBucketLifecycleConfigurationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketLifecycleConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketLifecycleConfigurationOutput struct { + _ struct{} `type:"structure"` + + Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s GetBucketLifecycleConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLifecycleConfigurationOutput) GoString() string { + return s.String() +} + +// SetRules sets the Rules field's value. +func (s *GetBucketLifecycleConfigurationOutput) SetRules(v []*LifecycleRule) *GetBucketLifecycleConfigurationOutput { + s.Rules = v + return s +} + +type GetBucketLifecycleInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketLifecycleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLifecycleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketLifecycleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleInput"} + 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 *GetBucketLifecycleInput) SetBucket(v string) *GetBucketLifecycleInput { + s.Bucket = &v + return s +} + +func (s *GetBucketLifecycleInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketLifecycleOutput struct { + _ struct{} `type:"structure"` + + Rules []*Rule `locationName:"Rule" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s GetBucketLifecycleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLifecycleOutput) GoString() string { + return s.String() +} + +// SetRules sets the Rules field's value. +func (s *GetBucketLifecycleOutput) SetRules(v []*Rule) *GetBucketLifecycleOutput { + s.Rules = v + return s +} + +type GetBucketLocationInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketLocationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLocationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketLocationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketLocationInput"} + 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 *GetBucketLocationInput) SetBucket(v string) *GetBucketLocationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketLocationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketLocationOutput struct { + _ struct{} `type:"structure"` + + LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` +} + +// String returns the string representation +func (s GetBucketLocationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLocationOutput) GoString() string { + return s.String() +} + +// SetLocationConstraint sets the LocationConstraint field's value. +func (s *GetBucketLocationOutput) SetLocationConstraint(v string) *GetBucketLocationOutput { + s.LocationConstraint = &v + return s +} + +type GetBucketLoggingInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketLoggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLoggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketLoggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketLoggingInput"} + 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 *GetBucketLoggingInput) SetBucket(v string) *GetBucketLoggingInput { + s.Bucket = &v + return s +} + +func (s *GetBucketLoggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketLoggingOutput struct { + _ struct{} `type:"structure"` + + // Container for logging information. Presence of this element indicates that + // logging is enabled. Parameters TargetBucket and TargetPrefix are required + // in this case. + LoggingEnabled *LoggingEnabled `type:"structure"` +} + +// String returns the string representation +func (s GetBucketLoggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketLoggingOutput) GoString() string { + return s.String() +} + +// SetLoggingEnabled sets the LoggingEnabled field's value. +func (s *GetBucketLoggingOutput) SetLoggingEnabled(v *LoggingEnabled) *GetBucketLoggingOutput { + s.LoggingEnabled = v + return s +} + +type GetBucketMetricsConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the metrics configuration to retrieve. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ID used to identify the metrics configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketMetricsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketMetricsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketMetricsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketMetricsConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetBucketMetricsConfigurationInput) SetBucket(v string) *GetBucketMetricsConfigurationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketMetricsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsConfigurationInput { + s.Id = &v + return s +} + +type GetBucketMetricsConfigurationOutput struct { + _ struct{} `type:"structure" payload:"MetricsConfiguration"` + + // Specifies the metrics configuration. + MetricsConfiguration *MetricsConfiguration `type:"structure"` +} + +// String returns the string representation +func (s GetBucketMetricsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketMetricsConfigurationOutput) GoString() string { + return s.String() +} + +// SetMetricsConfiguration sets the MetricsConfiguration field's value. +func (s *GetBucketMetricsConfigurationOutput) SetMetricsConfiguration(v *MetricsConfiguration) *GetBucketMetricsConfigurationOutput { + s.MetricsConfiguration = v + return s +} + +type GetBucketNotificationConfigurationRequest struct { + _ struct{} `type:"structure"` + + // Name of the bucket to get the notification configuration for. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketNotificationConfigurationRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketNotificationConfigurationRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketNotificationConfigurationRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketNotificationConfigurationRequest"} + 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 *GetBucketNotificationConfigurationRequest) SetBucket(v string) *GetBucketNotificationConfigurationRequest { + s.Bucket = &v + return s +} + +func (s *GetBucketNotificationConfigurationRequest) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketPolicyInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketPolicyInput"} + 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 *GetBucketPolicyInput) SetBucket(v string) *GetBucketPolicyInput { + s.Bucket = &v + return s +} + +func (s *GetBucketPolicyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketPolicyOutput struct { + _ struct{} `type:"structure" payload:"Policy"` + + // The bucket policy as a JSON document. + Policy *string `type:"string"` +} + +// String returns the string representation +func (s GetBucketPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetBucketPolicyOutput) SetPolicy(v string) *GetBucketPolicyOutput { + s.Policy = &v + return s +} + +type GetBucketReplicationInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketReplicationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketReplicationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketReplicationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketReplicationInput"} + 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 *GetBucketReplicationInput) SetBucket(v string) *GetBucketReplicationInput { + s.Bucket = &v + return s +} + +func (s *GetBucketReplicationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketReplicationOutput struct { + _ struct{} `type:"structure" payload:"ReplicationConfiguration"` + + // Container for replication rules. You can add as many as 1,000 rules. Total + // replication configuration size can be up to 2 MB. + ReplicationConfiguration *ReplicationConfiguration `type:"structure"` +} + +// String returns the string representation +func (s GetBucketReplicationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketReplicationOutput) GoString() string { + return s.String() +} + +// SetReplicationConfiguration sets the ReplicationConfiguration field's value. +func (s *GetBucketReplicationOutput) SetReplicationConfiguration(v *ReplicationConfiguration) *GetBucketReplicationOutput { + s.ReplicationConfiguration = v + return s +} + +type GetBucketRequestPaymentInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketRequestPaymentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketRequestPaymentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketRequestPaymentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketRequestPaymentInput"} + 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 *GetBucketRequestPaymentInput) SetBucket(v string) *GetBucketRequestPaymentInput { + s.Bucket = &v + return s +} + +func (s *GetBucketRequestPaymentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketRequestPaymentOutput struct { + _ struct{} `type:"structure"` + + // Specifies who pays for the download and request fees. + Payer *string `type:"string" enum:"Payer"` +} + +// String returns the string representation +func (s GetBucketRequestPaymentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketRequestPaymentOutput) GoString() string { + return s.String() +} + +// SetPayer sets the Payer field's value. +func (s *GetBucketRequestPaymentOutput) SetPayer(v string) *GetBucketRequestPaymentOutput { + s.Payer = &v + return s +} + +type GetBucketTaggingInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketTaggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketTaggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketTaggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketTaggingInput"} + 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 *GetBucketTaggingInput) SetBucket(v string) *GetBucketTaggingInput { + s.Bucket = &v + return s +} + +func (s *GetBucketTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketTaggingOutput struct { + _ struct{} `type:"structure"` + + // TagSet is a required field + TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` +} + +// String returns the string representation +func (s GetBucketTaggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketTaggingOutput) GoString() string { + return s.String() +} + +// SetTagSet sets the TagSet field's value. +func (s *GetBucketTaggingOutput) SetTagSet(v []*Tag) *GetBucketTaggingOutput { + s.TagSet = v + return s +} + +type GetBucketVersioningInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketVersioningInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketVersioningInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketVersioningInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketVersioningInput"} + 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 *GetBucketVersioningInput) SetBucket(v string) *GetBucketVersioningInput { + s.Bucket = &v + return s +} + +func (s *GetBucketVersioningInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketVersioningOutput struct { + _ struct{} `type:"structure"` + + // Specifies whether MFA delete is enabled in the bucket versioning configuration. + // This element is only returned if the bucket has been configured with MFA + // delete. If the bucket has never been so configured, this element is not returned. + MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADeleteStatus"` + + // The versioning state of the bucket. + Status *string `type:"string" enum:"BucketVersioningStatus"` +} + +// String returns the string representation +func (s GetBucketVersioningOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketVersioningOutput) GoString() string { + return s.String() +} + +// SetMFADelete sets the MFADelete field's value. +func (s *GetBucketVersioningOutput) SetMFADelete(v string) *GetBucketVersioningOutput { + s.MFADelete = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *GetBucketVersioningOutput) SetStatus(v string) *GetBucketVersioningOutput { + s.Status = &v + return s +} + +type GetBucketWebsiteInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketWebsiteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketWebsiteInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBucketWebsiteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBucketWebsiteInput"} + 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 *GetBucketWebsiteInput) SetBucket(v string) *GetBucketWebsiteInput { + s.Bucket = &v + return s +} + +func (s *GetBucketWebsiteInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type GetBucketWebsiteOutput struct { + _ struct{} `type:"structure"` + + ErrorDocument *ErrorDocument `type:"structure"` + + IndexDocument *IndexDocument `type:"structure"` + + RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` + + RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` +} + +// String returns the string representation +func (s GetBucketWebsiteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketWebsiteOutput) GoString() string { + return s.String() +} + +// SetErrorDocument sets the ErrorDocument field's value. +func (s *GetBucketWebsiteOutput) SetErrorDocument(v *ErrorDocument) *GetBucketWebsiteOutput { + s.ErrorDocument = v + return s +} + +// SetIndexDocument sets the IndexDocument field's value. +func (s *GetBucketWebsiteOutput) SetIndexDocument(v *IndexDocument) *GetBucketWebsiteOutput { + s.IndexDocument = v + return s +} + +// SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. +func (s *GetBucketWebsiteOutput) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *GetBucketWebsiteOutput { + s.RedirectAllRequestsTo = v + return s +} + +// SetRoutingRules sets the RoutingRules field's value. +func (s *GetBucketWebsiteOutput) SetRoutingRules(v []*RoutingRule) *GetBucketWebsiteOutput { + s.RoutingRules = v + return s +} + +type GetObjectAclInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // VersionId used to reference a specific version of the object. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s GetObjectAclInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectAclInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetObjectAclInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetObjectAclInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetObjectAclInput) SetBucket(v string) *GetObjectAclInput { + s.Bucket = &v + return s +} + +func (s *GetObjectAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *GetObjectAclInput) SetKey(v string) *GetObjectAclInput { + s.Key = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *GetObjectAclInput) SetRequestPayer(v string) *GetObjectAclInput { + s.RequestPayer = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *GetObjectAclInput) SetVersionId(v string) *GetObjectAclInput { + s.VersionId = &v + return s +} + +type GetObjectAclOutput struct { + _ struct{} `type:"structure"` + + // A list of grants. + Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` + + Owner *Owner `type:"structure"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` +} + +// String returns the string representation +func (s GetObjectAclOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectAclOutput) GoString() string { + return s.String() +} + +// SetGrants sets the Grants field's value. +func (s *GetObjectAclOutput) SetGrants(v []*Grant) *GetObjectAclOutput { + s.Grants = v + return s +} + +// SetOwner sets the Owner field's value. +func (s *GetObjectAclOutput) SetOwner(v *Owner) *GetObjectAclOutput { + s.Owner = v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *GetObjectAclOutput) SetRequestCharged(v string) *GetObjectAclOutput { + s.RequestCharged = &v + return s +} + +type GetObjectInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Return the object only if its entity tag (ETag) is the same as the one specified, + // otherwise return a 412 (precondition failed). + IfMatch *string `location:"header" locationName:"If-Match" type:"string"` + + // Return the object only if it has been modified since the specified time, + // otherwise return a 304 (not modified). + IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp"` + + // Return the object only if its entity tag (ETag) is different from the one + // specified, otherwise return a 304 (not modified). + IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` + + // Return the object only if it has not been modified since the specified time, + // otherwise return a 412 (precondition failed). + IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Part number of the object being read. This is a positive integer between + // 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. + // Useful for downloading just a part of an object. + PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` + + // Downloads the specified range bytes of an object. For more information about + // the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. + Range *string `location:"header" locationName:"Range" type:"string"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Sets the Cache-Control header of the response. + ResponseCacheControl *string `location:"querystring" locationName:"response-cache-control" type:"string"` + + // Sets the Content-Disposition header of the response + ResponseContentDisposition *string `location:"querystring" locationName:"response-content-disposition" type:"string"` + + // Sets the Content-Encoding header of the response. + ResponseContentEncoding *string `location:"querystring" locationName:"response-content-encoding" type:"string"` + + // Sets the Content-Language header of the response. + ResponseContentLanguage *string `location:"querystring" locationName:"response-content-language" type:"string"` + + // Sets the Content-Type header of the response. + ResponseContentType *string `location:"querystring" locationName:"response-content-type" type:"string"` + + // Sets the Expires header of the response. + ResponseExpires *time.Time `location:"querystring" locationName:"response-expires" type:"timestamp"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // VersionId used to reference a specific version of the object. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s GetObjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetObjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetObjectInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetObjectInput) SetBucket(v string) *GetObjectInput { + s.Bucket = &v + return s +} + +func (s *GetObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetIfMatch sets the IfMatch field's value. +func (s *GetObjectInput) SetIfMatch(v string) *GetObjectInput { + s.IfMatch = &v + return s +} + +// SetIfModifiedSince sets the IfModifiedSince field's value. +func (s *GetObjectInput) SetIfModifiedSince(v time.Time) *GetObjectInput { + s.IfModifiedSince = &v + return s +} + +// SetIfNoneMatch sets the IfNoneMatch field's value. +func (s *GetObjectInput) SetIfNoneMatch(v string) *GetObjectInput { + s.IfNoneMatch = &v + return s +} + +// SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. +func (s *GetObjectInput) SetIfUnmodifiedSince(v time.Time) *GetObjectInput { + s.IfUnmodifiedSince = &v + return s +} + +// SetKey sets the Key field's value. +func (s *GetObjectInput) SetKey(v string) *GetObjectInput { + s.Key = &v + return s +} + +// SetPartNumber sets the PartNumber field's value. +func (s *GetObjectInput) SetPartNumber(v int64) *GetObjectInput { + s.PartNumber = &v + return s +} + +// SetRange sets the Range field's value. +func (s *GetObjectInput) SetRange(v string) *GetObjectInput { + s.Range = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *GetObjectInput) SetRequestPayer(v string) *GetObjectInput { + s.RequestPayer = &v + return s +} + +// SetResponseCacheControl sets the ResponseCacheControl field's value. +func (s *GetObjectInput) SetResponseCacheControl(v string) *GetObjectInput { + s.ResponseCacheControl = &v + return s +} + +// SetResponseContentDisposition sets the ResponseContentDisposition field's value. +func (s *GetObjectInput) SetResponseContentDisposition(v string) *GetObjectInput { + s.ResponseContentDisposition = &v + return s +} + +// SetResponseContentEncoding sets the ResponseContentEncoding field's value. +func (s *GetObjectInput) SetResponseContentEncoding(v string) *GetObjectInput { + s.ResponseContentEncoding = &v + return s +} + +// SetResponseContentLanguage sets the ResponseContentLanguage field's value. +func (s *GetObjectInput) SetResponseContentLanguage(v string) *GetObjectInput { + s.ResponseContentLanguage = &v + return s +} + +// SetResponseContentType sets the ResponseContentType field's value. +func (s *GetObjectInput) SetResponseContentType(v string) *GetObjectInput { + s.ResponseContentType = &v + return s +} + +// SetResponseExpires sets the ResponseExpires field's value. +func (s *GetObjectInput) SetResponseExpires(v time.Time) *GetObjectInput { + s.ResponseExpires = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *GetObjectInput) SetSSECustomerAlgorithm(v string) *GetObjectInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *GetObjectInput) SetSSECustomerKey(v string) *GetObjectInput { + s.SSECustomerKey = &v + return s +} + +func (s *GetObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *GetObjectInput) SetSSECustomerKeyMD5(v string) *GetObjectInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *GetObjectInput) SetVersionId(v string) *GetObjectInput { + s.VersionId = &v + return s +} + +type GetObjectOutput struct { + _ struct{} `type:"structure" payload:"Body"` + + AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` + + // Object data. + Body io.ReadCloser `type:"blob"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` + + // Size of the body in bytes. + ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` + + // The portion of the object returned in the response. + ContentRange *string `location:"header" locationName:"Content-Range" type:"string"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // Specifies whether the object retrieved was (true) or was not (false) a Delete + // Marker. If false, this response header does not appear in the response. + DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` + + // An ETag is an opaque identifier assigned by a web server to a specific version + // of a resource found at a URL + ETag *string `location:"header" locationName:"ETag" type:"string"` + + // If the object expiration is configured (see PUT Bucket lifecycle), the response + // includes this header. It includes the expiry-date and rule-id key value pairs + // providing object expiration information. The value of the rule-id is URL + // encoded. + Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *string `location:"header" locationName:"Expires" type:"string"` + + // Last modified date of the object + LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // This is set to the number of metadata entries not returned in x-amz-meta + // headers. This can happen if you create metadata using an API like SOAP that + // supports more flexible metadata than the REST API. For example, using SOAP, + // you can create metadata whose values are not legal HTTP headers. + MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` + + // The count of parts this object has. + PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` + + ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // Provides information about object restoration operation and expiration time + // of the restored object copy. + Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` + + // The number of tags, if any, on the object. + TagCount *int64 `location:"header" locationName:"x-amz-tagging-count" type:"integer"` + + // Version of the object. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` + + // If the bucket is configured as a website, redirects requests for this object + // to another object in the same bucket or to an external URL. Amazon S3 stores + // the value of this header in the object metadata. + WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` +} + +// String returns the string representation +func (s GetObjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectOutput) GoString() string { + return s.String() +} + +// SetAcceptRanges sets the AcceptRanges field's value. +func (s *GetObjectOutput) SetAcceptRanges(v string) *GetObjectOutput { + s.AcceptRanges = &v + return s +} + +// SetBody sets the Body field's value. +func (s *GetObjectOutput) SetBody(v io.ReadCloser) *GetObjectOutput { + s.Body = v + return s +} + +// SetCacheControl sets the CacheControl field's value. +func (s *GetObjectOutput) SetCacheControl(v string) *GetObjectOutput { + s.CacheControl = &v + return s +} + +// SetContentDisposition sets the ContentDisposition field's value. +func (s *GetObjectOutput) SetContentDisposition(v string) *GetObjectOutput { + s.ContentDisposition = &v + return s +} + +// SetContentEncoding sets the ContentEncoding field's value. +func (s *GetObjectOutput) SetContentEncoding(v string) *GetObjectOutput { + s.ContentEncoding = &v + return s +} + +// SetContentLanguage sets the ContentLanguage field's value. +func (s *GetObjectOutput) SetContentLanguage(v string) *GetObjectOutput { + s.ContentLanguage = &v + return s +} + +// SetContentLength sets the ContentLength field's value. +func (s *GetObjectOutput) SetContentLength(v int64) *GetObjectOutput { + s.ContentLength = &v + return s +} + +// SetContentRange sets the ContentRange field's value. +func (s *GetObjectOutput) SetContentRange(v string) *GetObjectOutput { + s.ContentRange = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *GetObjectOutput) SetContentType(v string) *GetObjectOutput { + s.ContentType = &v + return s +} + +// SetDeleteMarker sets the DeleteMarker field's value. +func (s *GetObjectOutput) SetDeleteMarker(v bool) *GetObjectOutput { + s.DeleteMarker = &v + return s +} + +// SetETag sets the ETag field's value. +func (s *GetObjectOutput) SetETag(v string) *GetObjectOutput { + s.ETag = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *GetObjectOutput) SetExpiration(v string) *GetObjectOutput { + s.Expiration = &v + return s +} + +// SetExpires sets the Expires field's value. +func (s *GetObjectOutput) SetExpires(v string) *GetObjectOutput { + s.Expires = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *GetObjectOutput) SetLastModified(v time.Time) *GetObjectOutput { + s.LastModified = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *GetObjectOutput) SetMetadata(v map[string]*string) *GetObjectOutput { + s.Metadata = v + return s +} + +// SetMissingMeta sets the MissingMeta field's value. +func (s *GetObjectOutput) SetMissingMeta(v int64) *GetObjectOutput { + s.MissingMeta = &v + return s +} + +// SetPartsCount sets the PartsCount field's value. +func (s *GetObjectOutput) SetPartsCount(v int64) *GetObjectOutput { + s.PartsCount = &v + return s +} + +// SetReplicationStatus sets the ReplicationStatus field's value. +func (s *GetObjectOutput) SetReplicationStatus(v string) *GetObjectOutput { + s.ReplicationStatus = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *GetObjectOutput) SetRequestCharged(v string) *GetObjectOutput { + s.RequestCharged = &v + return s +} + +// SetRestore sets the Restore field's value. +func (s *GetObjectOutput) SetRestore(v string) *GetObjectOutput { + s.Restore = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *GetObjectOutput) SetSSECustomerAlgorithm(v string) *GetObjectOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *GetObjectOutput) SetSSECustomerKeyMD5(v string) *GetObjectOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *GetObjectOutput) SetSSEKMSKeyId(v string) *GetObjectOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *GetObjectOutput) SetServerSideEncryption(v string) *GetObjectOutput { + s.ServerSideEncryption = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *GetObjectOutput) SetStorageClass(v string) *GetObjectOutput { + s.StorageClass = &v + return s +} + +// SetTagCount sets the TagCount field's value. +func (s *GetObjectOutput) SetTagCount(v int64) *GetObjectOutput { + s.TagCount = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *GetObjectOutput) SetVersionId(v string) *GetObjectOutput { + s.VersionId = &v + return s +} + +// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. +func (s *GetObjectOutput) SetWebsiteRedirectLocation(v string) *GetObjectOutput { + s.WebsiteRedirectLocation = &v + return s +} + +type GetObjectTaggingInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s GetObjectTaggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectTaggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetObjectTaggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetObjectTaggingInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetObjectTaggingInput) SetBucket(v string) *GetObjectTaggingInput { + s.Bucket = &v + return s +} + +func (s *GetObjectTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { + s.Key = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *GetObjectTaggingInput) SetVersionId(v string) *GetObjectTaggingInput { + s.VersionId = &v + return s +} + +type GetObjectTaggingOutput struct { + _ struct{} `type:"structure"` + + // TagSet is a required field + TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` + + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s GetObjectTaggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectTaggingOutput) GoString() string { + return s.String() +} + +// SetTagSet sets the TagSet field's value. +func (s *GetObjectTaggingOutput) SetTagSet(v []*Tag) *GetObjectTaggingOutput { + s.TagSet = v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *GetObjectTaggingOutput) SetVersionId(v string) *GetObjectTaggingOutput { + s.VersionId = &v + return s +} + +type GetObjectTorrentInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` +} + +// String returns the string representation +func (s GetObjectTorrentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectTorrentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetObjectTorrentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetObjectTorrentInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *GetObjectTorrentInput) SetBucket(v string) *GetObjectTorrentInput { + s.Bucket = &v + return s +} + +func (s *GetObjectTorrentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *GetObjectTorrentInput) SetKey(v string) *GetObjectTorrentInput { + s.Key = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *GetObjectTorrentInput) SetRequestPayer(v string) *GetObjectTorrentInput { + s.RequestPayer = &v + return s +} + +type GetObjectTorrentOutput struct { + _ struct{} `type:"structure" payload:"Body"` + + Body io.ReadCloser `type:"blob"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` +} + +// String returns the string representation +func (s GetObjectTorrentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetObjectTorrentOutput) GoString() string { + return s.String() +} + +// SetBody sets the Body field's value. +func (s *GetObjectTorrentOutput) SetBody(v io.ReadCloser) *GetObjectTorrentOutput { + s.Body = v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *GetObjectTorrentOutput) SetRequestCharged(v string) *GetObjectTorrentOutput { + s.RequestCharged = &v + return s +} + +type GlacierJobParameters struct { + _ struct{} `type:"structure"` + + // Glacier retrieval tier at which the restore will be processed. + // + // Tier is a required field + Tier *string `type:"string" required:"true" enum:"Tier"` +} + +// String returns the string representation +func (s GlacierJobParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GlacierJobParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GlacierJobParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GlacierJobParameters"} + if s.Tier == nil { + invalidParams.Add(request.NewErrParamRequired("Tier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTier sets the Tier field's value. +func (s *GlacierJobParameters) SetTier(v string) *GlacierJobParameters { + s.Tier = &v + return s +} + +type Grant struct { + _ struct{} `type:"structure"` + + Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` + + // Specifies the permission given to the grantee. + Permission *string `type:"string" enum:"Permission"` +} + +// String returns the string representation +func (s Grant) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Grant) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Grant) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Grant"} + if s.Grantee != nil { + if err := s.Grantee.Validate(); err != nil { + invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGrantee sets the Grantee field's value. +func (s *Grant) SetGrantee(v *Grantee) *Grant { + s.Grantee = v + return s +} + +// SetPermission sets the Permission field's value. +func (s *Grant) SetPermission(v string) *Grant { + s.Permission = &v + return s +} + +type Grantee struct { + _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` + + // Screen name of the grantee. + DisplayName *string `type:"string"` + + // Email address of the grantee. + EmailAddress *string `type:"string"` + + // The canonical user ID of the grantee. + ID *string `type:"string"` + + // Type of grantee + // + // Type is a required field + Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true" required:"true" enum:"Type"` + + // URI of the grantee group. + URI *string `type:"string"` +} + +// String returns the string representation +func (s Grantee) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Grantee) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Grantee) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Grantee"} + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDisplayName sets the DisplayName field's value. +func (s *Grantee) SetDisplayName(v string) *Grantee { + s.DisplayName = &v + return s +} + +// SetEmailAddress sets the EmailAddress field's value. +func (s *Grantee) SetEmailAddress(v string) *Grantee { + s.EmailAddress = &v + return s +} + +// SetID sets the ID field's value. +func (s *Grantee) SetID(v string) *Grantee { + s.ID = &v + return s +} + +// SetType sets the Type field's value. +func (s *Grantee) SetType(v string) *Grantee { + s.Type = &v + return s +} + +// SetURI sets the URI field's value. +func (s *Grantee) SetURI(v string) *Grantee { + s.URI = &v + return s +} + +type HeadBucketInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s HeadBucketInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HeadBucketInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HeadBucketInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HeadBucketInput"} + 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 *HeadBucketInput) SetBucket(v string) *HeadBucketInput { + s.Bucket = &v + return s +} + +func (s *HeadBucketInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type HeadBucketOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s HeadBucketOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HeadBucketOutput) GoString() string { + return s.String() +} + +type HeadObjectInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Return the object only if its entity tag (ETag) is the same as the one specified, + // otherwise return a 412 (precondition failed). + IfMatch *string `location:"header" locationName:"If-Match" type:"string"` + + // Return the object only if it has been modified since the specified time, + // otherwise return a 304 (not modified). + IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp"` + + // Return the object only if its entity tag (ETag) is different from the one + // specified, otherwise return a 304 (not modified). + IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` + + // Return the object only if it has not been modified since the specified time, + // otherwise return a 412 (precondition failed). + IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Part number of the object being read. This is a positive integer between + // 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. + // Useful querying about the size of the part and the number of parts in this + // object. + PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` + + // Downloads the specified range bytes of an object. For more information about + // the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. + Range *string `location:"header" locationName:"Range" type:"string"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // VersionId used to reference a specific version of the object. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s HeadObjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HeadObjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HeadObjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HeadObjectInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *HeadObjectInput) SetBucket(v string) *HeadObjectInput { + s.Bucket = &v + return s +} + +func (s *HeadObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetIfMatch sets the IfMatch field's value. +func (s *HeadObjectInput) SetIfMatch(v string) *HeadObjectInput { + s.IfMatch = &v + return s +} + +// SetIfModifiedSince sets the IfModifiedSince field's value. +func (s *HeadObjectInput) SetIfModifiedSince(v time.Time) *HeadObjectInput { + s.IfModifiedSince = &v + return s +} + +// SetIfNoneMatch sets the IfNoneMatch field's value. +func (s *HeadObjectInput) SetIfNoneMatch(v string) *HeadObjectInput { + s.IfNoneMatch = &v + return s +} + +// SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. +func (s *HeadObjectInput) SetIfUnmodifiedSince(v time.Time) *HeadObjectInput { + s.IfUnmodifiedSince = &v + return s +} + +// SetKey sets the Key field's value. +func (s *HeadObjectInput) SetKey(v string) *HeadObjectInput { + s.Key = &v + return s +} + +// SetPartNumber sets the PartNumber field's value. +func (s *HeadObjectInput) SetPartNumber(v int64) *HeadObjectInput { + s.PartNumber = &v + return s +} + +// SetRange sets the Range field's value. +func (s *HeadObjectInput) SetRange(v string) *HeadObjectInput { + s.Range = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *HeadObjectInput) SetRequestPayer(v string) *HeadObjectInput { + s.RequestPayer = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *HeadObjectInput) SetSSECustomerAlgorithm(v string) *HeadObjectInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *HeadObjectInput) SetSSECustomerKey(v string) *HeadObjectInput { + s.SSECustomerKey = &v + return s +} + +func (s *HeadObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *HeadObjectInput) SetSSECustomerKeyMD5(v string) *HeadObjectInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *HeadObjectInput) SetVersionId(v string) *HeadObjectInput { + s.VersionId = &v + return s +} + +type HeadObjectOutput struct { + _ struct{} `type:"structure"` + + AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` + + // Size of the body in bytes. + ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // Specifies whether the object retrieved was (true) or was not (false) a Delete + // Marker. If false, this response header does not appear in the response. + DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` + + // An ETag is an opaque identifier assigned by a web server to a specific version + // of a resource found at a URL + ETag *string `location:"header" locationName:"ETag" type:"string"` + + // If the object expiration is configured (see PUT Bucket lifecycle), the response + // includes this header. It includes the expiry-date and rule-id key value pairs + // providing object expiration information. The value of the rule-id is URL + // encoded. + Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *string `location:"header" locationName:"Expires" type:"string"` + + // Last modified date of the object + LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // This is set to the number of metadata entries not returned in x-amz-meta + // headers. This can happen if you create metadata using an API like SOAP that + // supports more flexible metadata than the REST API. For example, using SOAP, + // you can create metadata whose values are not legal HTTP headers. + MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` + + // The count of parts this object has. + PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` + + ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // Provides information about object restoration operation and expiration time + // of the restored object copy. + Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` + + // Version of the object. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` + + // If the bucket is configured as a website, redirects requests for this object + // to another object in the same bucket or to an external URL. Amazon S3 stores + // the value of this header in the object metadata. + WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` +} + +// String returns the string representation +func (s HeadObjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HeadObjectOutput) GoString() string { + return s.String() +} + +// SetAcceptRanges sets the AcceptRanges field's value. +func (s *HeadObjectOutput) SetAcceptRanges(v string) *HeadObjectOutput { + s.AcceptRanges = &v + return s +} + +// SetCacheControl sets the CacheControl field's value. +func (s *HeadObjectOutput) SetCacheControl(v string) *HeadObjectOutput { + s.CacheControl = &v + return s +} + +// SetContentDisposition sets the ContentDisposition field's value. +func (s *HeadObjectOutput) SetContentDisposition(v string) *HeadObjectOutput { + s.ContentDisposition = &v + return s +} + +// SetContentEncoding sets the ContentEncoding field's value. +func (s *HeadObjectOutput) SetContentEncoding(v string) *HeadObjectOutput { + s.ContentEncoding = &v + return s +} + +// SetContentLanguage sets the ContentLanguage field's value. +func (s *HeadObjectOutput) SetContentLanguage(v string) *HeadObjectOutput { + s.ContentLanguage = &v + return s +} + +// SetContentLength sets the ContentLength field's value. +func (s *HeadObjectOutput) SetContentLength(v int64) *HeadObjectOutput { + s.ContentLength = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *HeadObjectOutput) SetContentType(v string) *HeadObjectOutput { + s.ContentType = &v + return s +} + +// SetDeleteMarker sets the DeleteMarker field's value. +func (s *HeadObjectOutput) SetDeleteMarker(v bool) *HeadObjectOutput { + s.DeleteMarker = &v + return s +} + +// SetETag sets the ETag field's value. +func (s *HeadObjectOutput) SetETag(v string) *HeadObjectOutput { + s.ETag = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *HeadObjectOutput) SetExpiration(v string) *HeadObjectOutput { + s.Expiration = &v + return s +} + +// SetExpires sets the Expires field's value. +func (s *HeadObjectOutput) SetExpires(v string) *HeadObjectOutput { + s.Expires = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *HeadObjectOutput) SetLastModified(v time.Time) *HeadObjectOutput { + s.LastModified = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *HeadObjectOutput) SetMetadata(v map[string]*string) *HeadObjectOutput { + s.Metadata = v + return s +} + +// SetMissingMeta sets the MissingMeta field's value. +func (s *HeadObjectOutput) SetMissingMeta(v int64) *HeadObjectOutput { + s.MissingMeta = &v + return s +} + +// SetPartsCount sets the PartsCount field's value. +func (s *HeadObjectOutput) SetPartsCount(v int64) *HeadObjectOutput { + s.PartsCount = &v + return s +} + +// SetReplicationStatus sets the ReplicationStatus field's value. +func (s *HeadObjectOutput) SetReplicationStatus(v string) *HeadObjectOutput { + s.ReplicationStatus = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *HeadObjectOutput) SetRequestCharged(v string) *HeadObjectOutput { + s.RequestCharged = &v + return s +} + +// SetRestore sets the Restore field's value. +func (s *HeadObjectOutput) SetRestore(v string) *HeadObjectOutput { + s.Restore = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *HeadObjectOutput) SetSSECustomerAlgorithm(v string) *HeadObjectOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *HeadObjectOutput) SetSSECustomerKeyMD5(v string) *HeadObjectOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *HeadObjectOutput) SetSSEKMSKeyId(v string) *HeadObjectOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *HeadObjectOutput) SetServerSideEncryption(v string) *HeadObjectOutput { + s.ServerSideEncryption = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *HeadObjectOutput) SetStorageClass(v string) *HeadObjectOutput { + s.StorageClass = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *HeadObjectOutput) SetVersionId(v string) *HeadObjectOutput { + s.VersionId = &v + return s +} + +// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. +func (s *HeadObjectOutput) SetWebsiteRedirectLocation(v string) *HeadObjectOutput { + s.WebsiteRedirectLocation = &v + return s +} + +type IndexDocument struct { + _ struct{} `type:"structure"` + + // A suffix that is appended to a request that is for a directory on the website + // endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ + // the data that is returned will be for the object with the key name images/index.html) + // The suffix must not be empty and must not include a slash character. + // + // Suffix is a required field + Suffix *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s IndexDocument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IndexDocument) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *IndexDocument) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IndexDocument"} + if s.Suffix == nil { + invalidParams.Add(request.NewErrParamRequired("Suffix")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSuffix sets the Suffix field's value. +func (s *IndexDocument) SetSuffix(v string) *IndexDocument { + s.Suffix = &v + return s +} + +type Initiator struct { + _ struct{} `type:"structure"` + + // Name of the Principal. + DisplayName *string `type:"string"` + + // If the principal is an AWS account, it provides the Canonical User ID. If + // the principal is an IAM User, it provides a user ARN value. + ID *string `type:"string"` +} + +// String returns the string representation +func (s Initiator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Initiator) GoString() string { + return s.String() +} + +// SetDisplayName sets the DisplayName field's value. +func (s *Initiator) SetDisplayName(v string) *Initiator { + s.DisplayName = &v + return s +} + +// SetID sets the ID field's value. +func (s *Initiator) SetID(v string) *Initiator { + s.ID = &v + return s +} + +// Describes the serialization format of the object. +type InputSerialization struct { + _ struct{} `type:"structure"` + + // Describes the serialization of a CSV-encoded object. + CSV *CSVInput `type:"structure"` + + // Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default + // Value: NONE. + CompressionType *string `type:"string" enum:"CompressionType"` + + // Specifies JSON as object's input serialization format. + JSON *JSONInput `type:"structure"` + + // Specifies Parquet as object's input serialization format. + Parquet *ParquetInput `type:"structure"` +} + +// String returns the string representation +func (s InputSerialization) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InputSerialization) GoString() string { + return s.String() +} + +// SetCSV sets the CSV field's value. +func (s *InputSerialization) SetCSV(v *CSVInput) *InputSerialization { + s.CSV = v + return s +} + +// SetCompressionType sets the CompressionType field's value. +func (s *InputSerialization) SetCompressionType(v string) *InputSerialization { + s.CompressionType = &v + return s +} + +// SetJSON sets the JSON field's value. +func (s *InputSerialization) SetJSON(v *JSONInput) *InputSerialization { + s.JSON = v + return s +} + +// SetParquet sets the Parquet field's value. +func (s *InputSerialization) SetParquet(v *ParquetInput) *InputSerialization { + s.Parquet = v + return s +} + +type InventoryConfiguration struct { + _ struct{} `type:"structure"` + + // Contains information about where to publish the inventory results. + // + // Destination is a required field + Destination *InventoryDestination `type:"structure" required:"true"` + + // Specifies an inventory filter. The inventory only includes objects that meet + // the filter's criteria. + Filter *InventoryFilter `type:"structure"` + + // The ID used to identify the inventory configuration. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // Specifies which object version(s) to included in the inventory results. + // + // IncludedObjectVersions is a required field + IncludedObjectVersions *string `type:"string" required:"true" enum:"InventoryIncludedObjectVersions"` + + // Specifies whether the inventory is enabled or disabled. + // + // IsEnabled is a required field + IsEnabled *bool `type:"boolean" required:"true"` + + // Contains the optional fields that are included in the inventory results. + OptionalFields []*string `locationNameList:"Field" type:"list"` + + // Specifies the schedule for generating inventory results. + // + // Schedule is a required field + Schedule *InventorySchedule `type:"structure" required:"true"` +} + +// String returns the string representation +func (s InventoryConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InventoryConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InventoryConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InventoryConfiguration"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.IncludedObjectVersions == nil { + invalidParams.Add(request.NewErrParamRequired("IncludedObjectVersions")) + } + if s.IsEnabled == nil { + invalidParams.Add(request.NewErrParamRequired("IsEnabled")) + } + if s.Schedule == nil { + invalidParams.Add(request.NewErrParamRequired("Schedule")) + } + if s.Destination != nil { + if err := s.Destination.Validate(); err != nil { + invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) + } + } + if s.Filter != nil { + if err := s.Filter.Validate(); err != nil { + invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) + } + } + if s.Schedule != nil { + if err := s.Schedule.Validate(); err != nil { + invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestination sets the Destination field's value. +func (s *InventoryConfiguration) SetDestination(v *InventoryDestination) *InventoryConfiguration { + s.Destination = v + return s +} + +// SetFilter sets the Filter field's value. +func (s *InventoryConfiguration) SetFilter(v *InventoryFilter) *InventoryConfiguration { + s.Filter = v + return s +} + +// SetId sets the Id field's value. +func (s *InventoryConfiguration) SetId(v string) *InventoryConfiguration { + s.Id = &v + return s +} + +// SetIncludedObjectVersions sets the IncludedObjectVersions field's value. +func (s *InventoryConfiguration) SetIncludedObjectVersions(v string) *InventoryConfiguration { + s.IncludedObjectVersions = &v + return s +} + +// SetIsEnabled sets the IsEnabled field's value. +func (s *InventoryConfiguration) SetIsEnabled(v bool) *InventoryConfiguration { + s.IsEnabled = &v + return s +} + +// SetOptionalFields sets the OptionalFields field's value. +func (s *InventoryConfiguration) SetOptionalFields(v []*string) *InventoryConfiguration { + s.OptionalFields = v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *InventoryConfiguration) SetSchedule(v *InventorySchedule) *InventoryConfiguration { + s.Schedule = v + return s +} + +type InventoryDestination struct { + _ struct{} `type:"structure"` + + // Contains the bucket name, file format, bucket owner (optional), and prefix + // (optional) where inventory results are published. + // + // S3BucketDestination is a required field + S3BucketDestination *InventoryS3BucketDestination `type:"structure" required:"true"` +} + +// String returns the string representation +func (s InventoryDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InventoryDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InventoryDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InventoryDestination"} + if s.S3BucketDestination == nil { + invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) + } + if s.S3BucketDestination != nil { + if err := s.S3BucketDestination.Validate(); err != nil { + invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3BucketDestination sets the S3BucketDestination field's value. +func (s *InventoryDestination) SetS3BucketDestination(v *InventoryS3BucketDestination) *InventoryDestination { + s.S3BucketDestination = v + return s +} + +// Contains the type of server-side encryption used to encrypt the inventory +// results. +type InventoryEncryption struct { + _ struct{} `type:"structure"` + + // Specifies the use of SSE-KMS to encrypt delievered Inventory reports. + SSEKMS *SSEKMS `locationName:"SSE-KMS" type:"structure"` + + // Specifies the use of SSE-S3 to encrypt delievered Inventory reports. + SSES3 *SSES3 `locationName:"SSE-S3" type:"structure"` +} + +// String returns the string representation +func (s InventoryEncryption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InventoryEncryption) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InventoryEncryption) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InventoryEncryption"} + if s.SSEKMS != nil { + if err := s.SSEKMS.Validate(); err != nil { + invalidParams.AddNested("SSEKMS", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSSEKMS sets the SSEKMS field's value. +func (s *InventoryEncryption) SetSSEKMS(v *SSEKMS) *InventoryEncryption { + s.SSEKMS = v + return s +} + +// SetSSES3 sets the SSES3 field's value. +func (s *InventoryEncryption) SetSSES3(v *SSES3) *InventoryEncryption { + s.SSES3 = v + return s +} + +type InventoryFilter struct { + _ struct{} `type:"structure"` + + // The prefix that an object must have to be included in the inventory results. + // + // Prefix is a required field + Prefix *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s InventoryFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InventoryFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InventoryFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InventoryFilter"} + if s.Prefix == nil { + invalidParams.Add(request.NewErrParamRequired("Prefix")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPrefix sets the Prefix field's value. +func (s *InventoryFilter) SetPrefix(v string) *InventoryFilter { + s.Prefix = &v + return s +} + +type InventoryS3BucketDestination struct { + _ struct{} `type:"structure"` + + // The ID of the account that owns the destination bucket. + AccountId *string `type:"string"` + + // The Amazon resource name (ARN) of the bucket where inventory results will + // be published. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // Contains the type of server-side encryption used to encrypt the inventory + // results. + Encryption *InventoryEncryption `type:"structure"` + + // Specifies the output format of the inventory results. + // + // Format is a required field + Format *string `type:"string" required:"true" enum:"InventoryFormat"` + + // The prefix that is prepended to all inventory results. + Prefix *string `type:"string"` +} + +// String returns the string representation +func (s InventoryS3BucketDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InventoryS3BucketDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InventoryS3BucketDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InventoryS3BucketDestination"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Format == nil { + invalidParams.Add(request.NewErrParamRequired("Format")) + } + if s.Encryption != nil { + if err := s.Encryption.Validate(); err != nil { + invalidParams.AddNested("Encryption", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *InventoryS3BucketDestination) SetAccountId(v string) *InventoryS3BucketDestination { + s.AccountId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *InventoryS3BucketDestination) SetBucket(v string) *InventoryS3BucketDestination { + s.Bucket = &v + return s +} + +func (s *InventoryS3BucketDestination) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetEncryption sets the Encryption field's value. +func (s *InventoryS3BucketDestination) SetEncryption(v *InventoryEncryption) *InventoryS3BucketDestination { + s.Encryption = v + return s +} + +// SetFormat sets the Format field's value. +func (s *InventoryS3BucketDestination) SetFormat(v string) *InventoryS3BucketDestination { + s.Format = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDestination { + s.Prefix = &v + return s +} + +type InventorySchedule struct { + _ struct{} `type:"structure"` + + // Specifies how frequently inventory results are produced. + // + // Frequency is a required field + Frequency *string `type:"string" required:"true" enum:"InventoryFrequency"` +} + +// String returns the string representation +func (s InventorySchedule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InventorySchedule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InventorySchedule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InventorySchedule"} + if s.Frequency == nil { + invalidParams.Add(request.NewErrParamRequired("Frequency")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFrequency sets the Frequency field's value. +func (s *InventorySchedule) SetFrequency(v string) *InventorySchedule { + s.Frequency = &v + return s +} + +type JSONInput struct { + _ struct{} `type:"structure"` + + // The type of JSON. Valid values: Document, Lines. + Type *string `type:"string" enum:"JSONType"` +} + +// String returns the string representation +func (s JSONInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JSONInput) GoString() string { + return s.String() +} + +// SetType sets the Type field's value. +func (s *JSONInput) SetType(v string) *JSONInput { + s.Type = &v + return s +} + +type JSONOutput struct { + _ struct{} `type:"structure"` + + // The value used to separate individual records in the output. + RecordDelimiter *string `type:"string"` +} + +// String returns the string representation +func (s JSONOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JSONOutput) GoString() string { + return s.String() +} + +// SetRecordDelimiter sets the RecordDelimiter field's value. +func (s *JSONOutput) SetRecordDelimiter(v string) *JSONOutput { + s.RecordDelimiter = &v + return s +} + +// Container for object key name prefix and suffix filtering rules. +type KeyFilter struct { + _ struct{} `type:"structure"` + + // A list of containers for key value pair that defines the criteria for the + // filter rule. + FilterRules []*FilterRule `locationName:"FilterRule" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s KeyFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KeyFilter) GoString() string { + return s.String() +} + +// SetFilterRules sets the FilterRules field's value. +func (s *KeyFilter) SetFilterRules(v []*FilterRule) *KeyFilter { + s.FilterRules = v + return s +} + +// Container for specifying the AWS Lambda notification configuration. +type LambdaFunctionConfiguration struct { + _ struct{} `type:"structure"` + + // Events is a required field + Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` + + // Container for object key name filtering rules. For information about key + // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // in the Amazon Simple Storage Service Developer Guide. + Filter *NotificationConfigurationFilter `type:"structure"` + + // Optional unique identifier for configurations in a notification configuration. + // If you don't provide one, Amazon S3 will assign an ID. + Id *string `type:"string"` + + // Lambda cloud function ARN that Amazon S3 can invoke when it detects events + // of the specified type. + // + // LambdaFunctionArn is a required field + LambdaFunctionArn *string `locationName:"CloudFunction" type:"string" required:"true"` +} + +// String returns the string representation +func (s LambdaFunctionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LambdaFunctionConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LambdaFunctionConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LambdaFunctionConfiguration"} + if s.Events == nil { + invalidParams.Add(request.NewErrParamRequired("Events")) + } + if s.LambdaFunctionArn == nil { + invalidParams.Add(request.NewErrParamRequired("LambdaFunctionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEvents sets the Events field's value. +func (s *LambdaFunctionConfiguration) SetEvents(v []*string) *LambdaFunctionConfiguration { + s.Events = v + return s +} + +// SetFilter sets the Filter field's value. +func (s *LambdaFunctionConfiguration) SetFilter(v *NotificationConfigurationFilter) *LambdaFunctionConfiguration { + s.Filter = v + return s +} + +// SetId sets the Id field's value. +func (s *LambdaFunctionConfiguration) SetId(v string) *LambdaFunctionConfiguration { + s.Id = &v + return s +} + +// SetLambdaFunctionArn sets the LambdaFunctionArn field's value. +func (s *LambdaFunctionConfiguration) SetLambdaFunctionArn(v string) *LambdaFunctionConfiguration { + s.LambdaFunctionArn = &v + return s +} + +type LifecycleConfiguration struct { + _ struct{} `type:"structure"` + + // Rules is a required field + Rules []*Rule `locationName:"Rule" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s LifecycleConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LifecycleConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LifecycleConfiguration"} + if s.Rules == nil { + invalidParams.Add(request.NewErrParamRequired("Rules")) + } + if s.Rules != nil { + for i, v := range s.Rules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRules sets the Rules field's value. +func (s *LifecycleConfiguration) SetRules(v []*Rule) *LifecycleConfiguration { + s.Rules = v + return s +} + +type LifecycleExpiration struct { + _ struct{} `type:"structure"` + + // Indicates at what date the object is to be moved or deleted. Should be in + // GMT ISO 8601 Format. + Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // Indicates the lifetime, in days, of the objects that are subject to the rule. + // The value must be a non-zero positive integer. + Days *int64 `type:"integer"` + + // Indicates whether Amazon S3 will remove a delete marker with no noncurrent + // versions. If set to true, the delete marker will be expired; if set to false + // the policy takes no action. This cannot be specified with Days or Date in + // a Lifecycle Expiration Policy. + ExpiredObjectDeleteMarker *bool `type:"boolean"` +} + +// String returns the string representation +func (s LifecycleExpiration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleExpiration) GoString() string { + return s.String() +} + +// SetDate sets the Date field's value. +func (s *LifecycleExpiration) SetDate(v time.Time) *LifecycleExpiration { + s.Date = &v + return s +} + +// SetDays sets the Days field's value. +func (s *LifecycleExpiration) SetDays(v int64) *LifecycleExpiration { + s.Days = &v + return s +} + +// SetExpiredObjectDeleteMarker sets the ExpiredObjectDeleteMarker field's value. +func (s *LifecycleExpiration) SetExpiredObjectDeleteMarker(v bool) *LifecycleExpiration { + s.ExpiredObjectDeleteMarker = &v + return s +} + +type LifecycleRule struct { + _ struct{} `type:"structure"` + + // Specifies the days since the initiation of an Incomplete Multipart Upload + // that Lifecycle will wait before permanently removing all parts of the upload. + AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` + + Expiration *LifecycleExpiration `type:"structure"` + + // The Filter is used to identify objects that a Lifecycle Rule applies to. + // A Filter must have exactly one of Prefix, Tag, or And specified. + Filter *LifecycleRuleFilter `type:"structure"` + + // Unique identifier for the rule. The value cannot be longer than 255 characters. + ID *string `type:"string"` + + // Specifies when noncurrent object versions expire. Upon expiration, Amazon + // S3 permanently deletes the noncurrent object versions. You set this lifecycle + // configuration action on a bucket that has versioning enabled (or suspended) + // to request that Amazon S3 delete noncurrent object versions at a specific + // period in the object's lifetime. + NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` + + NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"` + + // Prefix identifying one or more objects to which the rule applies. This is + // deprecated; use Filter instead. + // + // Deprecated: Prefix has been deprecated + Prefix *string `deprecated:"true" type:"string"` + + // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule + // is not currently being applied. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"ExpirationStatus"` + + Transitions []*Transition `locationName:"Transition" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s LifecycleRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LifecycleRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LifecycleRule"} + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.Filter != nil { + if err := s.Filter.Validate(); err != nil { + invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. +func (s *LifecycleRule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *LifecycleRule { + s.AbortIncompleteMultipartUpload = v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *LifecycleRule) SetExpiration(v *LifecycleExpiration) *LifecycleRule { + s.Expiration = v + return s +} + +// SetFilter sets the Filter field's value. +func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule { + s.Filter = v + return s +} + +// SetID sets the ID field's value. +func (s *LifecycleRule) SetID(v string) *LifecycleRule { + s.ID = &v + return s +} + +// SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. +func (s *LifecycleRule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *LifecycleRule { + s.NoncurrentVersionExpiration = v + return s +} + +// SetNoncurrentVersionTransitions sets the NoncurrentVersionTransitions field's value. +func (s *LifecycleRule) SetNoncurrentVersionTransitions(v []*NoncurrentVersionTransition) *LifecycleRule { + s.NoncurrentVersionTransitions = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *LifecycleRule) SetPrefix(v string) *LifecycleRule { + s.Prefix = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *LifecycleRule) SetStatus(v string) *LifecycleRule { + s.Status = &v + return s +} + +// SetTransitions sets the Transitions field's value. +func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule { + s.Transitions = v + return s +} + +// This is used in a Lifecycle Rule Filter to apply a logical AND to two or +// more predicates. The Lifecycle Rule will apply to any object matching all +// of the predicates configured inside the And operator. +type LifecycleRuleAndOperator struct { + _ struct{} `type:"structure"` + + Prefix *string `type:"string"` + + // All of these tags must exist in the object's tag set in order for the rule + // to apply. + Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s LifecycleRuleAndOperator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleRuleAndOperator) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LifecycleRuleAndOperator) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleAndOperator"} + 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 +} + +// SetPrefix sets the Prefix field's value. +func (s *LifecycleRuleAndOperator) SetPrefix(v string) *LifecycleRuleAndOperator { + s.Prefix = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LifecycleRuleAndOperator) SetTags(v []*Tag) *LifecycleRuleAndOperator { + s.Tags = v + return s +} + +// The Filter is used to identify objects that a Lifecycle Rule applies to. +// A Filter must have exactly one of Prefix, Tag, or And specified. +type LifecycleRuleFilter struct { + _ struct{} `type:"structure"` + + // This is used in a Lifecycle Rule Filter to apply a logical AND to two or + // more predicates. The Lifecycle Rule will apply to any object matching all + // of the predicates configured inside the And operator. + And *LifecycleRuleAndOperator `type:"structure"` + + // Prefix identifying one or more objects to which the rule applies. + Prefix *string `type:"string"` + + // This tag must exist in the object's tag set in order for the rule to apply. + Tag *Tag `type:"structure"` +} + +// String returns the string representation +func (s LifecycleRuleFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleRuleFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LifecycleRuleFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleFilter"} + if s.And != nil { + if err := s.And.Validate(); err != nil { + invalidParams.AddNested("And", err.(request.ErrInvalidParams)) + } + } + if s.Tag != nil { + if err := s.Tag.Validate(); err != nil { + invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnd sets the And field's value. +func (s *LifecycleRuleFilter) SetAnd(v *LifecycleRuleAndOperator) *LifecycleRuleFilter { + s.And = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *LifecycleRuleFilter) SetPrefix(v string) *LifecycleRuleFilter { + s.Prefix = &v + return s +} + +// SetTag sets the Tag field's value. +func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { + s.Tag = v + return s +} + +type ListBucketAnalyticsConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket from which analytics configurations are retrieved. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ContinuationToken that represents a placeholder from where this request + // should begin. + ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` +} + +// String returns the string representation +func (s ListBucketAnalyticsConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketAnalyticsConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBucketAnalyticsConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBucketAnalyticsConfigurationsInput"} + 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 *ListBucketAnalyticsConfigurationsInput) SetBucket(v string) *ListBucketAnalyticsConfigurationsInput { + s.Bucket = &v + return s +} + +func (s *ListBucketAnalyticsConfigurationsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsInput { + s.ContinuationToken = &v + return s +} + +type ListBucketAnalyticsConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // The list of analytics configurations for a bucket. + AnalyticsConfigurationList []*AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"list" flattened:"true"` + + // The ContinuationToken that represents where this request began. + ContinuationToken *string `type:"string"` + + // Indicates whether the returned list of analytics configurations is complete. + // A value of true indicates that the list is not complete and the NextContinuationToken + // will be provided for a subsequent request. + IsTruncated *bool `type:"boolean"` + + // NextContinuationToken is sent when isTruncated is true, which indicates that + // there are more analytics configurations to list. The next request must include + // this NextContinuationToken. The token is obfuscated and is not a usable value. + NextContinuationToken *string `type:"string"` +} + +// String returns the string representation +func (s ListBucketAnalyticsConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketAnalyticsConfigurationsOutput) GoString() string { + return s.String() +} + +// SetAnalyticsConfigurationList sets the AnalyticsConfigurationList field's value. +func (s *ListBucketAnalyticsConfigurationsOutput) SetAnalyticsConfigurationList(v []*AnalyticsConfiguration) *ListBucketAnalyticsConfigurationsOutput { + s.AnalyticsConfigurationList = v + return s +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketAnalyticsConfigurationsOutput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { + s.ContinuationToken = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListBucketAnalyticsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketAnalyticsConfigurationsOutput { + s.IsTruncated = &v + return s +} + +// SetNextContinuationToken sets the NextContinuationToken field's value. +func (s *ListBucketAnalyticsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { + s.NextContinuationToken = &v + return s +} + +type ListBucketInventoryConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the inventory configurations to retrieve. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The marker used to continue an inventory configuration listing that has been + // truncated. Use the NextContinuationToken from a previously truncated list + // response to continue the listing. The continuation token is an opaque value + // that Amazon S3 understands. + ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` +} + +// String returns the string representation +func (s ListBucketInventoryConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketInventoryConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBucketInventoryConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBucketInventoryConfigurationsInput"} + 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 *ListBucketInventoryConfigurationsInput) SetBucket(v string) *ListBucketInventoryConfigurationsInput { + s.Bucket = &v + return s +} + +func (s *ListBucketInventoryConfigurationsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsInput { + s.ContinuationToken = &v + return s +} + +type ListBucketInventoryConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // If sent in the request, the marker that is used as a starting point for this + // inventory configuration list response. + ContinuationToken *string `type:"string"` + + // The list of inventory configurations for a bucket. + InventoryConfigurationList []*InventoryConfiguration `locationName:"InventoryConfiguration" type:"list" flattened:"true"` + + // Indicates whether the returned list of inventory configurations is truncated + // in this response. A value of true indicates that the list is truncated. + IsTruncated *bool `type:"boolean"` + + // The marker used to continue this inventory configuration listing. Use the + // NextContinuationToken from this response to continue the listing in a subsequent + // request. The continuation token is an opaque value that Amazon S3 understands. + NextContinuationToken *string `type:"string"` +} + +// String returns the string representation +func (s ListBucketInventoryConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketInventoryConfigurationsOutput) GoString() string { + return s.String() +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketInventoryConfigurationsOutput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { + s.ContinuationToken = &v + return s +} + +// SetInventoryConfigurationList sets the InventoryConfigurationList field's value. +func (s *ListBucketInventoryConfigurationsOutput) SetInventoryConfigurationList(v []*InventoryConfiguration) *ListBucketInventoryConfigurationsOutput { + s.InventoryConfigurationList = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListBucketInventoryConfigurationsOutput) SetIsTruncated(v bool) *ListBucketInventoryConfigurationsOutput { + s.IsTruncated = &v + return s +} + +// SetNextContinuationToken sets the NextContinuationToken field's value. +func (s *ListBucketInventoryConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { + s.NextContinuationToken = &v + return s +} + +type ListBucketMetricsConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The name of the bucket containing the metrics configurations to retrieve. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The marker that is used to continue a metrics configuration listing that + // has been truncated. Use the NextContinuationToken from a previously truncated + // list response to continue the listing. The continuation token is an opaque + // value that Amazon S3 understands. + ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` +} + +// String returns the string representation +func (s ListBucketMetricsConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketMetricsConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBucketMetricsConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBucketMetricsConfigurationsInput"} + 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 *ListBucketMetricsConfigurationsInput) SetBucket(v string) *ListBucketMetricsConfigurationsInput { + s.Bucket = &v + return s +} + +func (s *ListBucketMetricsConfigurationsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsInput { + s.ContinuationToken = &v + return s +} + +type ListBucketMetricsConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // The marker that is used as a starting point for this metrics configuration + // list response. This value is present if it was sent in the request. + ContinuationToken *string `type:"string"` + + // Indicates whether the returned list of metrics configurations is complete. + // A value of true indicates that the list is not complete and the NextContinuationToken + // will be provided for a subsequent request. + IsTruncated *bool `type:"boolean"` + + // The list of metrics configurations for a bucket. + MetricsConfigurationList []*MetricsConfiguration `locationName:"MetricsConfiguration" type:"list" flattened:"true"` + + // The marker used to continue a metrics configuration listing that has been + // truncated. Use the NextContinuationToken from a previously truncated list + // response to continue the listing. The continuation token is an opaque value + // that Amazon S3 understands. + NextContinuationToken *string `type:"string"` +} + +// String returns the string representation +func (s ListBucketMetricsConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketMetricsConfigurationsOutput) GoString() string { + return s.String() +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketMetricsConfigurationsOutput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { + s.ContinuationToken = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListBucketMetricsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketMetricsConfigurationsOutput { + s.IsTruncated = &v + return s +} + +// SetMetricsConfigurationList sets the MetricsConfigurationList field's value. +func (s *ListBucketMetricsConfigurationsOutput) SetMetricsConfigurationList(v []*MetricsConfiguration) *ListBucketMetricsConfigurationsOutput { + s.MetricsConfigurationList = v + return s +} + +// SetNextContinuationToken sets the NextContinuationToken field's value. +func (s *ListBucketMetricsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { + s.NextContinuationToken = &v + return s +} + +type ListBucketsInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ListBucketsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketsInput) GoString() string { + return s.String() +} + +type ListBucketsOutput struct { + _ struct{} `type:"structure"` + + Buckets []*Bucket `locationNameList:"Bucket" type:"list"` + + Owner *Owner `type:"structure"` +} + +// String returns the string representation +func (s ListBucketsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBucketsOutput) GoString() string { + return s.String() +} + +// SetBuckets sets the Buckets field's value. +func (s *ListBucketsOutput) SetBuckets(v []*Bucket) *ListBucketsOutput { + s.Buckets = v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ListBucketsOutput) SetOwner(v *Owner) *ListBucketsOutput { + s.Owner = v + return s +} + +type ListMultipartUploadsInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Character you use to group keys. + Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key may contain any Unicode character; + // however, XML 1.0 parser cannot parse some characters, such as characters + // with an ASCII value from 0 to 10. For characters that are not supported in + // XML 1.0, you can add this parameter to request that Amazon S3 encode the + // keys in the response. + EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + + // Together with upload-id-marker, this parameter specifies the multipart upload + // after which listing should begin. + KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` + + // Sets the maximum number of multipart uploads, from 1 to 1,000, to return + // in the response body. 1,000 is the maximum number of uploads that can be + // returned in a response. + MaxUploads *int64 `location:"querystring" locationName:"max-uploads" type:"integer"` + + // Lists in-progress uploads only for those keys that begin with the specified + // prefix. + Prefix *string `location:"querystring" locationName:"prefix" type:"string"` + + // Together with key-marker, specifies the multipart upload after which listing + // should begin. If key-marker is not specified, the upload-id-marker parameter + // is ignored. + UploadIdMarker *string `location:"querystring" locationName:"upload-id-marker" type:"string"` +} + +// String returns the string representation +func (s ListMultipartUploadsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMultipartUploadsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListMultipartUploadsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMultipartUploadsInput"} + 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 *ListMultipartUploadsInput) SetBucket(v string) *ListMultipartUploadsInput { + s.Bucket = &v + return s +} + +func (s *ListMultipartUploadsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListMultipartUploadsInput) SetDelimiter(v string) *ListMultipartUploadsInput { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListMultipartUploadsInput) SetEncodingType(v string) *ListMultipartUploadsInput { + s.EncodingType = &v + return s +} + +// SetKeyMarker sets the KeyMarker field's value. +func (s *ListMultipartUploadsInput) SetKeyMarker(v string) *ListMultipartUploadsInput { + s.KeyMarker = &v + return s +} + +// SetMaxUploads sets the MaxUploads field's value. +func (s *ListMultipartUploadsInput) SetMaxUploads(v int64) *ListMultipartUploadsInput { + s.MaxUploads = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListMultipartUploadsInput) SetPrefix(v string) *ListMultipartUploadsInput { + s.Prefix = &v + return s +} + +// SetUploadIdMarker sets the UploadIdMarker field's value. +func (s *ListMultipartUploadsInput) SetUploadIdMarker(v string) *ListMultipartUploadsInput { + s.UploadIdMarker = &v + return s +} + +type ListMultipartUploadsOutput struct { + _ struct{} `type:"structure"` + + // Name of the bucket to which the multipart upload was initiated. + Bucket *string `type:"string"` + + CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + + Delimiter *string `type:"string"` + + // Encoding type used by Amazon S3 to encode object keys in the response. + EncodingType *string `type:"string" enum:"EncodingType"` + + // Indicates whether the returned list of multipart uploads is truncated. A + // value of true indicates that the list was truncated. The list can be truncated + // if the number of multipart uploads exceeds the limit allowed or specified + // by max uploads. + IsTruncated *bool `type:"boolean"` + + // The key at or after which the listing began. + KeyMarker *string `type:"string"` + + // Maximum number of multipart uploads that could have been included in the + // response. + MaxUploads *int64 `type:"integer"` + + // When a list is truncated, this element specifies the value that should be + // used for the key-marker request parameter in a subsequent request. + NextKeyMarker *string `type:"string"` + + // When a list is truncated, this element specifies the value that should be + // used for the upload-id-marker request parameter in a subsequent request. + NextUploadIdMarker *string `type:"string"` + + // When a prefix is provided in the request, this field contains the specified + // prefix. The result contains only keys starting with the specified prefix. + Prefix *string `type:"string"` + + // Upload ID after which listing began. + UploadIdMarker *string `type:"string"` + + Uploads []*MultipartUpload `locationName:"Upload" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ListMultipartUploadsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMultipartUploadsOutput) GoString() string { + return s.String() +} + +// SetBucket sets the Bucket field's value. +func (s *ListMultipartUploadsOutput) SetBucket(v string) *ListMultipartUploadsOutput { + s.Bucket = &v + return s +} + +func (s *ListMultipartUploadsOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCommonPrefixes sets the CommonPrefixes field's value. +func (s *ListMultipartUploadsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListMultipartUploadsOutput { + s.CommonPrefixes = v + return s +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListMultipartUploadsOutput) SetDelimiter(v string) *ListMultipartUploadsOutput { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListMultipartUploadsOutput) SetEncodingType(v string) *ListMultipartUploadsOutput { + s.EncodingType = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListMultipartUploadsOutput) SetIsTruncated(v bool) *ListMultipartUploadsOutput { + s.IsTruncated = &v + return s +} + +// SetKeyMarker sets the KeyMarker field's value. +func (s *ListMultipartUploadsOutput) SetKeyMarker(v string) *ListMultipartUploadsOutput { + s.KeyMarker = &v + return s +} + +// SetMaxUploads sets the MaxUploads field's value. +func (s *ListMultipartUploadsOutput) SetMaxUploads(v int64) *ListMultipartUploadsOutput { + s.MaxUploads = &v + return s +} + +// SetNextKeyMarker sets the NextKeyMarker field's value. +func (s *ListMultipartUploadsOutput) SetNextKeyMarker(v string) *ListMultipartUploadsOutput { + s.NextKeyMarker = &v + return s +} + +// SetNextUploadIdMarker sets the NextUploadIdMarker field's value. +func (s *ListMultipartUploadsOutput) SetNextUploadIdMarker(v string) *ListMultipartUploadsOutput { + s.NextUploadIdMarker = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListMultipartUploadsOutput) SetPrefix(v string) *ListMultipartUploadsOutput { + s.Prefix = &v + return s +} + +// SetUploadIdMarker sets the UploadIdMarker field's value. +func (s *ListMultipartUploadsOutput) SetUploadIdMarker(v string) *ListMultipartUploadsOutput { + s.UploadIdMarker = &v + return s +} + +// SetUploads sets the Uploads field's value. +func (s *ListMultipartUploadsOutput) SetUploads(v []*MultipartUpload) *ListMultipartUploadsOutput { + s.Uploads = v + return s +} + +type ListObjectVersionsInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // A delimiter is a character you use to group keys. + Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key may contain any Unicode character; + // however, XML 1.0 parser cannot parse some characters, such as characters + // with an ASCII value from 0 to 10. For characters that are not supported in + // XML 1.0, you can add this parameter to request that Amazon S3 encode the + // keys in the response. + EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + + // Specifies the key to start with when listing objects in a bucket. + KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` + + // Sets the maximum number of keys returned in the response. The response might + // contain fewer keys but will never contain more. + MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` + + // Limits the response to keys that begin with the specified prefix. + Prefix *string `location:"querystring" locationName:"prefix" type:"string"` + + // Specifies the object version you want to start listing from. + VersionIdMarker *string `location:"querystring" locationName:"version-id-marker" type:"string"` +} + +// String returns the string representation +func (s ListObjectVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListObjectVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListObjectVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListObjectVersionsInput"} + 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 *ListObjectVersionsInput) SetBucket(v string) *ListObjectVersionsInput { + s.Bucket = &v + return s +} + +func (s *ListObjectVersionsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListObjectVersionsInput) SetDelimiter(v string) *ListObjectVersionsInput { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListObjectVersionsInput) SetEncodingType(v string) *ListObjectVersionsInput { + s.EncodingType = &v + return s +} + +// SetKeyMarker sets the KeyMarker field's value. +func (s *ListObjectVersionsInput) SetKeyMarker(v string) *ListObjectVersionsInput { + s.KeyMarker = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListObjectVersionsInput) SetMaxKeys(v int64) *ListObjectVersionsInput { + s.MaxKeys = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListObjectVersionsInput) SetPrefix(v string) *ListObjectVersionsInput { + s.Prefix = &v + return s +} + +// SetVersionIdMarker sets the VersionIdMarker field's value. +func (s *ListObjectVersionsInput) SetVersionIdMarker(v string) *ListObjectVersionsInput { + s.VersionIdMarker = &v + return s +} + +type ListObjectVersionsOutput struct { + _ struct{} `type:"structure"` + + CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + + DeleteMarkers []*DeleteMarkerEntry `locationName:"DeleteMarker" type:"list" flattened:"true"` + + Delimiter *string `type:"string"` + + // Encoding type used by Amazon S3 to encode object keys in the response. + EncodingType *string `type:"string" enum:"EncodingType"` + + // A flag that indicates whether or not Amazon S3 returned all of the results + // that satisfied the search criteria. If your results were truncated, you can + // make a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker + // response parameters as a starting place in another request to return the + // rest of the results. + IsTruncated *bool `type:"boolean"` + + // Marks the last Key returned in a truncated response. + KeyMarker *string `type:"string"` + + MaxKeys *int64 `type:"integer"` + + Name *string `type:"string"` + + // Use this value for the key marker request parameter in a subsequent request. + NextKeyMarker *string `type:"string"` + + // Use this value for the next version id marker parameter in a subsequent request. + NextVersionIdMarker *string `type:"string"` + + Prefix *string `type:"string"` + + VersionIdMarker *string `type:"string"` + + Versions []*ObjectVersion `locationName:"Version" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ListObjectVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListObjectVersionsOutput) GoString() string { + return s.String() +} + +// SetCommonPrefixes sets the CommonPrefixes field's value. +func (s *ListObjectVersionsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectVersionsOutput { + s.CommonPrefixes = v + return s +} + +// SetDeleteMarkers sets the DeleteMarkers field's value. +func (s *ListObjectVersionsOutput) SetDeleteMarkers(v []*DeleteMarkerEntry) *ListObjectVersionsOutput { + s.DeleteMarkers = v + return s +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListObjectVersionsOutput) SetDelimiter(v string) *ListObjectVersionsOutput { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListObjectVersionsOutput) SetEncodingType(v string) *ListObjectVersionsOutput { + s.EncodingType = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListObjectVersionsOutput) SetIsTruncated(v bool) *ListObjectVersionsOutput { + s.IsTruncated = &v + return s +} + +// SetKeyMarker sets the KeyMarker field's value. +func (s *ListObjectVersionsOutput) SetKeyMarker(v string) *ListObjectVersionsOutput { + s.KeyMarker = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListObjectVersionsOutput) SetMaxKeys(v int64) *ListObjectVersionsOutput { + s.MaxKeys = &v + return s +} + +// SetName sets the Name field's value. +func (s *ListObjectVersionsOutput) SetName(v string) *ListObjectVersionsOutput { + s.Name = &v + return s +} + +// SetNextKeyMarker sets the NextKeyMarker field's value. +func (s *ListObjectVersionsOutput) SetNextKeyMarker(v string) *ListObjectVersionsOutput { + s.NextKeyMarker = &v + return s +} + +// SetNextVersionIdMarker sets the NextVersionIdMarker field's value. +func (s *ListObjectVersionsOutput) SetNextVersionIdMarker(v string) *ListObjectVersionsOutput { + s.NextVersionIdMarker = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListObjectVersionsOutput) SetPrefix(v string) *ListObjectVersionsOutput { + s.Prefix = &v + return s +} + +// SetVersionIdMarker sets the VersionIdMarker field's value. +func (s *ListObjectVersionsOutput) SetVersionIdMarker(v string) *ListObjectVersionsOutput { + s.VersionIdMarker = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListObjectVersionsOutput) SetVersions(v []*ObjectVersion) *ListObjectVersionsOutput { + s.Versions = v + return s +} + +type ListObjectsInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // A delimiter is a character you use to group keys. + Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key may contain any Unicode character; + // however, XML 1.0 parser cannot parse some characters, such as characters + // with an ASCII value from 0 to 10. For characters that are not supported in + // XML 1.0, you can add this parameter to request that Amazon S3 encode the + // keys in the response. + EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + + // Specifies the key to start with when listing objects in a bucket. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // Sets the maximum number of keys returned in the response. The response might + // contain fewer keys but will never contain more. + MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` + + // Limits the response to keys that begin with the specified prefix. + Prefix *string `location:"querystring" locationName:"prefix" type:"string"` + + // Confirms that the requester knows that she or he will be charged for the + // list objects request. Bucket owners need not specify this parameter in their + // requests. + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` +} + +// String returns the string representation +func (s ListObjectsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListObjectsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListObjectsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListObjectsInput"} + 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 *ListObjectsInput) SetBucket(v string) *ListObjectsInput { + s.Bucket = &v + return s +} + +func (s *ListObjectsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListObjectsInput) SetDelimiter(v string) *ListObjectsInput { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListObjectsInput) SetEncodingType(v string) *ListObjectsInput { + s.EncodingType = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListObjectsInput) SetMarker(v string) *ListObjectsInput { + s.Marker = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListObjectsInput) SetMaxKeys(v int64) *ListObjectsInput { + s.MaxKeys = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListObjectsInput) SetPrefix(v string) *ListObjectsInput { + s.Prefix = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *ListObjectsInput) SetRequestPayer(v string) *ListObjectsInput { + s.RequestPayer = &v + return s +} + +type ListObjectsOutput struct { + _ struct{} `type:"structure"` + + CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + + Contents []*Object `type:"list" flattened:"true"` + + Delimiter *string `type:"string"` + + // Encoding type used by Amazon S3 to encode object keys in the response. + EncodingType *string `type:"string" enum:"EncodingType"` + + // A flag that indicates whether or not Amazon S3 returned all of the results + // that satisfied the search criteria. + IsTruncated *bool `type:"boolean"` + + Marker *string `type:"string"` + + MaxKeys *int64 `type:"integer"` + + Name *string `type:"string"` + + // When response is truncated (the IsTruncated element value in the response + // is true), you can use the key name in this field as marker in the subsequent + // request to get next set of objects. Amazon S3 lists objects in alphabetical + // order Note: This element is returned only if you have delimiter request parameter + // specified. If response does not include the NextMaker and it is truncated, + // you can use the value of the last Key in the response as the marker in the + // subsequent request to get the next set of object keys. + NextMarker *string `type:"string"` + + Prefix *string `type:"string"` +} + +// String returns the string representation +func (s ListObjectsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListObjectsOutput) GoString() string { + return s.String() +} + +// SetCommonPrefixes sets the CommonPrefixes field's value. +func (s *ListObjectsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsOutput { + s.CommonPrefixes = v + return s +} + +// SetContents sets the Contents field's value. +func (s *ListObjectsOutput) SetContents(v []*Object) *ListObjectsOutput { + s.Contents = v + return s +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListObjectsOutput) SetDelimiter(v string) *ListObjectsOutput { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListObjectsOutput) SetEncodingType(v string) *ListObjectsOutput { + s.EncodingType = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListObjectsOutput) SetIsTruncated(v bool) *ListObjectsOutput { + s.IsTruncated = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListObjectsOutput) SetMarker(v string) *ListObjectsOutput { + s.Marker = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListObjectsOutput) SetMaxKeys(v int64) *ListObjectsOutput { + s.MaxKeys = &v + return s +} + +// SetName sets the Name field's value. +func (s *ListObjectsOutput) SetName(v string) *ListObjectsOutput { + s.Name = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListObjectsOutput) SetNextMarker(v string) *ListObjectsOutput { + s.NextMarker = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput { + s.Prefix = &v + return s +} + +type ListObjectsV2Input struct { + _ struct{} `type:"structure"` + + // Name of the bucket to list. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // ContinuationToken indicates Amazon S3 that the list is being continued on + // this bucket with a token. ContinuationToken is obfuscated and is not a real + // key + ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` + + // A delimiter is a character you use to group keys. + Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` + + // Encoding type used by Amazon S3 to encode object keys in the response. + EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + + // The owner field is not present in listV2 by default, if you want to return + // owner field with each key in the result then set the fetch owner field to + // true + FetchOwner *bool `location:"querystring" locationName:"fetch-owner" type:"boolean"` + + // Sets the maximum number of keys returned in the response. The response might + // contain fewer keys but will never contain more. + MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` + + // Limits the response to keys that begin with the specified prefix. + Prefix *string `location:"querystring" locationName:"prefix" type:"string"` + + // Confirms that the requester knows that she or he will be charged for the + // list objects request in V2 style. Bucket owners need not specify this parameter + // in their requests. + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts + // listing after this specified key. StartAfter can be any key in the bucket + StartAfter *string `location:"querystring" locationName:"start-after" type:"string"` +} + +// String returns the string representation +func (s ListObjectsV2Input) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListObjectsV2Input) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListObjectsV2Input) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListObjectsV2Input"} + 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 *ListObjectsV2Input) SetBucket(v string) *ListObjectsV2Input { + s.Bucket = &v + return s +} + +func (s *ListObjectsV2Input) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListObjectsV2Input) SetContinuationToken(v string) *ListObjectsV2Input { + s.ContinuationToken = &v + return s +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListObjectsV2Input) SetDelimiter(v string) *ListObjectsV2Input { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListObjectsV2Input) SetEncodingType(v string) *ListObjectsV2Input { + s.EncodingType = &v + return s +} + +// SetFetchOwner sets the FetchOwner field's value. +func (s *ListObjectsV2Input) SetFetchOwner(v bool) *ListObjectsV2Input { + s.FetchOwner = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListObjectsV2Input) SetMaxKeys(v int64) *ListObjectsV2Input { + s.MaxKeys = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListObjectsV2Input) SetPrefix(v string) *ListObjectsV2Input { + s.Prefix = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *ListObjectsV2Input) SetRequestPayer(v string) *ListObjectsV2Input { + s.RequestPayer = &v + return s +} + +// SetStartAfter sets the StartAfter field's value. +func (s *ListObjectsV2Input) SetStartAfter(v string) *ListObjectsV2Input { + s.StartAfter = &v + return s +} + +type ListObjectsV2Output struct { + _ struct{} `type:"structure"` + + // CommonPrefixes contains all (if there are any) keys between Prefix and the + // next occurrence of the string specified by delimiter + CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + + // Metadata about each object returned. + Contents []*Object `type:"list" flattened:"true"` + + // ContinuationToken indicates Amazon S3 that the list is being continued on + // this bucket with a token. ContinuationToken is obfuscated and is not a real + // key + ContinuationToken *string `type:"string"` + + // A delimiter is a character you use to group keys. + Delimiter *string `type:"string"` + + // Encoding type used by Amazon S3 to encode object keys in the response. + EncodingType *string `type:"string" enum:"EncodingType"` + + // A flag that indicates whether or not Amazon S3 returned all of the results + // that satisfied the search criteria. + IsTruncated *bool `type:"boolean"` + + // KeyCount is the number of keys returned with this request. KeyCount will + // always be less than equals to MaxKeys field. Say you ask for 50 keys, your + // result will include less than equals 50 keys + KeyCount *int64 `type:"integer"` + + // Sets the maximum number of keys returned in the response. The response might + // contain fewer keys but will never contain more. + MaxKeys *int64 `type:"integer"` + + // Name of the bucket to list. + Name *string `type:"string"` + + // NextContinuationToken is sent when isTruncated is true which means there + // are more keys in the bucket that can be listed. The next list requests to + // Amazon S3 can be continued with this NextContinuationToken. NextContinuationToken + // is obfuscated and is not a real key + NextContinuationToken *string `type:"string"` + + // Limits the response to keys that begin with the specified prefix. + Prefix *string `type:"string"` + + // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts + // listing after this specified key. StartAfter can be any key in the bucket + StartAfter *string `type:"string"` +} + +// String returns the string representation +func (s ListObjectsV2Output) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListObjectsV2Output) GoString() string { + return s.String() +} + +// SetCommonPrefixes sets the CommonPrefixes field's value. +func (s *ListObjectsV2Output) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsV2Output { + s.CommonPrefixes = v + return s +} + +// SetContents sets the Contents field's value. +func (s *ListObjectsV2Output) SetContents(v []*Object) *ListObjectsV2Output { + s.Contents = v + return s +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListObjectsV2Output) SetContinuationToken(v string) *ListObjectsV2Output { + s.ContinuationToken = &v + return s +} + +// SetDelimiter sets the Delimiter field's value. +func (s *ListObjectsV2Output) SetDelimiter(v string) *ListObjectsV2Output { + s.Delimiter = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListObjectsV2Output) SetEncodingType(v string) *ListObjectsV2Output { + s.EncodingType = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListObjectsV2Output) SetIsTruncated(v bool) *ListObjectsV2Output { + s.IsTruncated = &v + return s +} + +// SetKeyCount sets the KeyCount field's value. +func (s *ListObjectsV2Output) SetKeyCount(v int64) *ListObjectsV2Output { + s.KeyCount = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListObjectsV2Output) SetMaxKeys(v int64) *ListObjectsV2Output { + s.MaxKeys = &v + return s +} + +// SetName sets the Name field's value. +func (s *ListObjectsV2Output) SetName(v string) *ListObjectsV2Output { + s.Name = &v + return s +} + +// SetNextContinuationToken sets the NextContinuationToken field's value. +func (s *ListObjectsV2Output) SetNextContinuationToken(v string) *ListObjectsV2Output { + s.NextContinuationToken = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ListObjectsV2Output) SetPrefix(v string) *ListObjectsV2Output { + s.Prefix = &v + return s +} + +// SetStartAfter sets the StartAfter field's value. +func (s *ListObjectsV2Output) SetStartAfter(v string) *ListObjectsV2Output { + s.StartAfter = &v + return s +} + +type ListPartsInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Sets the maximum number of parts to return. + MaxParts *int64 `location:"querystring" locationName:"max-parts" type:"integer"` + + // Specifies the part after which listing should begin. Only parts with higher + // part numbers will be listed. + PartNumberMarker *int64 `location:"querystring" locationName:"part-number-marker" type:"integer"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Upload ID identifying the multipart upload whose parts are being listed. + // + // UploadId is a required field + UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListPartsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPartsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPartsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPartsInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.UploadId == nil { + invalidParams.Add(request.NewErrParamRequired("UploadId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *ListPartsInput) SetBucket(v string) *ListPartsInput { + s.Bucket = &v + return s +} + +func (s *ListPartsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *ListPartsInput) SetKey(v string) *ListPartsInput { + s.Key = &v + return s +} + +// SetMaxParts sets the MaxParts field's value. +func (s *ListPartsInput) SetMaxParts(v int64) *ListPartsInput { + s.MaxParts = &v + return s +} + +// SetPartNumberMarker sets the PartNumberMarker field's value. +func (s *ListPartsInput) SetPartNumberMarker(v int64) *ListPartsInput { + s.PartNumberMarker = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *ListPartsInput) SetRequestPayer(v string) *ListPartsInput { + s.RequestPayer = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *ListPartsInput) SetUploadId(v string) *ListPartsInput { + s.UploadId = &v + return s +} + +type ListPartsOutput struct { + _ struct{} `type:"structure"` + + // Date when multipart upload will become eligible for abort operation by lifecycle. + AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp"` + + // Id of the lifecycle rule that makes a multipart upload eligible for abort + // operation. + AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` + + // Name of the bucket to which the multipart upload was initiated. + Bucket *string `type:"string"` + + // Identifies who initiated the multipart upload. + Initiator *Initiator `type:"structure"` + + // Indicates whether the returned list of parts is truncated. + IsTruncated *bool `type:"boolean"` + + // Object key for which the multipart upload was initiated. + Key *string `min:"1" type:"string"` + + // Maximum number of parts that were allowed in the response. + MaxParts *int64 `type:"integer"` + + // When a list is truncated, this element specifies the last part in the list, + // as well as the value to use for the part-number-marker request parameter + // in a subsequent request. + NextPartNumberMarker *int64 `type:"integer"` + + Owner *Owner `type:"structure"` + + // Part number after which listing begins. + PartNumberMarker *int64 `type:"integer"` + + Parts []*Part `locationName:"Part" type:"list" flattened:"true"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"StorageClass"` + + // Upload ID identifying the multipart upload whose parts are being listed. + UploadId *string `type:"string"` +} + +// String returns the string representation +func (s ListPartsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPartsOutput) GoString() string { + return s.String() +} + +// SetAbortDate sets the AbortDate field's value. +func (s *ListPartsOutput) SetAbortDate(v time.Time) *ListPartsOutput { + s.AbortDate = &v + return s +} + +// SetAbortRuleId sets the AbortRuleId field's value. +func (s *ListPartsOutput) SetAbortRuleId(v string) *ListPartsOutput { + s.AbortRuleId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *ListPartsOutput) SetBucket(v string) *ListPartsOutput { + s.Bucket = &v + return s +} + +func (s *ListPartsOutput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetInitiator sets the Initiator field's value. +func (s *ListPartsOutput) SetInitiator(v *Initiator) *ListPartsOutput { + s.Initiator = v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListPartsOutput) SetIsTruncated(v bool) *ListPartsOutput { + s.IsTruncated = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ListPartsOutput) SetKey(v string) *ListPartsOutput { + s.Key = &v + return s +} + +// SetMaxParts sets the MaxParts field's value. +func (s *ListPartsOutput) SetMaxParts(v int64) *ListPartsOutput { + s.MaxParts = &v + return s +} + +// SetNextPartNumberMarker sets the NextPartNumberMarker field's value. +func (s *ListPartsOutput) SetNextPartNumberMarker(v int64) *ListPartsOutput { + s.NextPartNumberMarker = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ListPartsOutput) SetOwner(v *Owner) *ListPartsOutput { + s.Owner = v + return s +} + +// SetPartNumberMarker sets the PartNumberMarker field's value. +func (s *ListPartsOutput) SetPartNumberMarker(v int64) *ListPartsOutput { + s.PartNumberMarker = &v + return s +} + +// SetParts sets the Parts field's value. +func (s *ListPartsOutput) SetParts(v []*Part) *ListPartsOutput { + s.Parts = v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *ListPartsOutput) SetRequestCharged(v string) *ListPartsOutput { + s.RequestCharged = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *ListPartsOutput) SetStorageClass(v string) *ListPartsOutput { + s.StorageClass = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { + s.UploadId = &v + return s +} + +// Describes an S3 location that will receive the results of the restore request. +type Location struct { + _ struct{} `type:"structure"` + + // A list of grants that control access to the staged results. + AccessControlList []*Grant `locationNameList:"Grant" type:"list"` + + // The name of the bucket where the restore results will be placed. + // + // BucketName is a required field + BucketName *string `type:"string" required:"true"` + + // The canned ACL to apply to the restore results. + CannedACL *string `type:"string" enum:"ObjectCannedACL"` + + // Describes the server-side encryption that will be applied to the restore + // results. + Encryption *Encryption `type:"structure"` + + // The prefix that is prepended to the restore results for this request. + // + // Prefix is a required field + Prefix *string `type:"string" required:"true"` + + // The class of storage used to store the restore results. + StorageClass *string `type:"string" enum:"StorageClass"` + + // The tag-set that is applied to the restore results. + Tagging *Tagging `type:"structure"` + + // A list of metadata to store with the restore results in S3. + UserMetadata []*MetadataEntry `locationNameList:"MetadataEntry" type:"list"` +} + +// String returns the string representation +func (s Location) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Location) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Location) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Location"} + if s.BucketName == nil { + invalidParams.Add(request.NewErrParamRequired("BucketName")) + } + if s.Prefix == nil { + invalidParams.Add(request.NewErrParamRequired("Prefix")) + } + if s.AccessControlList != nil { + for i, v := range s.AccessControlList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AccessControlList", i), err.(request.ErrInvalidParams)) + } + } + } + if s.Encryption != nil { + if err := s.Encryption.Validate(); err != nil { + invalidParams.AddNested("Encryption", err.(request.ErrInvalidParams)) + } + } + if s.Tagging != nil { + if err := s.Tagging.Validate(); err != nil { + invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessControlList sets the AccessControlList field's value. +func (s *Location) SetAccessControlList(v []*Grant) *Location { + s.AccessControlList = v + return s +} + +// SetBucketName sets the BucketName field's value. +func (s *Location) SetBucketName(v string) *Location { + s.BucketName = &v + return s +} + +// SetCannedACL sets the CannedACL field's value. +func (s *Location) SetCannedACL(v string) *Location { + s.CannedACL = &v + return s +} + +// SetEncryption sets the Encryption field's value. +func (s *Location) SetEncryption(v *Encryption) *Location { + s.Encryption = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *Location) SetPrefix(v string) *Location { + s.Prefix = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *Location) SetStorageClass(v string) *Location { + s.StorageClass = &v + return s +} + +// SetTagging sets the Tagging field's value. +func (s *Location) SetTagging(v *Tagging) *Location { + s.Tagging = v + return s +} + +// SetUserMetadata sets the UserMetadata field's value. +func (s *Location) SetUserMetadata(v []*MetadataEntry) *Location { + s.UserMetadata = v + return s +} + +// Container for logging information. Presence of this element indicates that +// logging is enabled. Parameters TargetBucket and TargetPrefix are required +// in this case. +type LoggingEnabled struct { + _ struct{} `type:"structure"` + + // Specifies the bucket where you want Amazon S3 to store server access logs. + // You can have your logs delivered to any bucket that you own, including the + // same bucket that is being logged. You can also configure multiple buckets + // to deliver their logs to the same target bucket. In this case you should + // choose a different TargetPrefix for each source bucket so that the delivered + // log files can be distinguished by key. + // + // TargetBucket is a required field + TargetBucket *string `type:"string" required:"true"` + + TargetGrants []*TargetGrant `locationNameList:"Grant" type:"list"` + + // This element lets you specify a prefix for the keys that the log files will + // be stored under. + // + // TargetPrefix is a required field + TargetPrefix *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s LoggingEnabled) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoggingEnabled) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoggingEnabled) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggingEnabled"} + if s.TargetBucket == nil { + invalidParams.Add(request.NewErrParamRequired("TargetBucket")) + } + if s.TargetPrefix == nil { + invalidParams.Add(request.NewErrParamRequired("TargetPrefix")) + } + if s.TargetGrants != nil { + for i, v := range s.TargetGrants { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGrants", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTargetBucket sets the TargetBucket field's value. +func (s *LoggingEnabled) SetTargetBucket(v string) *LoggingEnabled { + s.TargetBucket = &v + return s +} + +// SetTargetGrants sets the TargetGrants field's value. +func (s *LoggingEnabled) SetTargetGrants(v []*TargetGrant) *LoggingEnabled { + s.TargetGrants = v + return s +} + +// SetTargetPrefix sets the TargetPrefix field's value. +func (s *LoggingEnabled) SetTargetPrefix(v string) *LoggingEnabled { + s.TargetPrefix = &v + return s +} + +// A metadata key-value pair to store with an object. +type MetadataEntry struct { + _ struct{} `type:"structure"` + + Name *string `type:"string"` + + Value *string `type:"string"` +} + +// String returns the string representation +func (s MetadataEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetadataEntry) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *MetadataEntry) SetName(v string) *MetadataEntry { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *MetadataEntry) SetValue(v string) *MetadataEntry { + s.Value = &v + return s +} + +type MetricsAndOperator struct { + _ struct{} `type:"structure"` + + // The prefix used when evaluating an AND predicate. + Prefix *string `type:"string"` + + // The list of tags used when evaluating an AND predicate. + Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s MetricsAndOperator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricsAndOperator) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MetricsAndOperator) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MetricsAndOperator"} + 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 +} + +// SetPrefix sets the Prefix field's value. +func (s *MetricsAndOperator) SetPrefix(v string) *MetricsAndOperator { + s.Prefix = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator { + s.Tags = v + return s +} + +type MetricsConfiguration struct { + _ struct{} `type:"structure"` + + // Specifies a metrics configuration filter. The metrics configuration will + // only include objects that meet the filter's criteria. A filter must be a + // prefix, a tag, or a conjunction (MetricsAndOperator). + Filter *MetricsFilter `type:"structure"` + + // The ID used to identify the metrics configuration. + // + // Id is a required field + Id *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s MetricsConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricsConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MetricsConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MetricsConfiguration"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Filter != nil { + if err := s.Filter.Validate(); err != nil { + invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilter sets the Filter field's value. +func (s *MetricsConfiguration) SetFilter(v *MetricsFilter) *MetricsConfiguration { + s.Filter = v + return s +} + +// SetId sets the Id field's value. +func (s *MetricsConfiguration) SetId(v string) *MetricsConfiguration { + s.Id = &v + return s +} + +type MetricsFilter struct { + _ struct{} `type:"structure"` + + // A conjunction (logical AND) of predicates, which is used in evaluating a + // metrics filter. The operator must have at least two predicates, and an object + // must match all of the predicates in order for the filter to apply. + And *MetricsAndOperator `type:"structure"` + + // The prefix used when evaluating a metrics filter. + Prefix *string `type:"string"` + + // The tag used when evaluating a metrics filter. + Tag *Tag `type:"structure"` +} + +// String returns the string representation +func (s MetricsFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricsFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MetricsFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MetricsFilter"} + if s.And != nil { + if err := s.And.Validate(); err != nil { + invalidParams.AddNested("And", err.(request.ErrInvalidParams)) + } + } + if s.Tag != nil { + if err := s.Tag.Validate(); err != nil { + invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnd sets the And field's value. +func (s *MetricsFilter) SetAnd(v *MetricsAndOperator) *MetricsFilter { + s.And = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *MetricsFilter) SetPrefix(v string) *MetricsFilter { + s.Prefix = &v + return s +} + +// SetTag sets the Tag field's value. +func (s *MetricsFilter) SetTag(v *Tag) *MetricsFilter { + s.Tag = v + return s +} + +type MultipartUpload struct { + _ struct{} `type:"structure"` + + // Date and time at which the multipart upload was initiated. + Initiated *time.Time `type:"timestamp"` + + // Identifies who initiated the multipart upload. + Initiator *Initiator `type:"structure"` + + // Key of the object for which the multipart upload was initiated. + Key *string `min:"1" type:"string"` + + Owner *Owner `type:"structure"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"StorageClass"` + + // Upload ID that identifies the multipart upload. + UploadId *string `type:"string"` +} + +// String returns the string representation +func (s MultipartUpload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MultipartUpload) GoString() string { + return s.String() +} + +// SetInitiated sets the Initiated field's value. +func (s *MultipartUpload) SetInitiated(v time.Time) *MultipartUpload { + s.Initiated = &v + return s +} + +// SetInitiator sets the Initiator field's value. +func (s *MultipartUpload) SetInitiator(v *Initiator) *MultipartUpload { + s.Initiator = v + return s +} + +// SetKey sets the Key field's value. +func (s *MultipartUpload) SetKey(v string) *MultipartUpload { + s.Key = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *MultipartUpload) SetOwner(v *Owner) *MultipartUpload { + s.Owner = v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *MultipartUpload) SetStorageClass(v string) *MultipartUpload { + s.StorageClass = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *MultipartUpload) SetUploadId(v string) *MultipartUpload { + s.UploadId = &v + return s +} + +// Specifies when noncurrent object versions expire. Upon expiration, Amazon +// S3 permanently deletes the noncurrent object versions. You set this lifecycle +// configuration action on a bucket that has versioning enabled (or suspended) +// to request that Amazon S3 delete noncurrent object versions at a specific +// period in the object's lifetime. +type NoncurrentVersionExpiration struct { + _ struct{} `type:"structure"` + + // Specifies the number of days an object is noncurrent before Amazon S3 can + // perform the associated action. For information about the noncurrent days + // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent + // (http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) in + // the Amazon Simple Storage Service Developer Guide. + NoncurrentDays *int64 `type:"integer"` +} + +// String returns the string representation +func (s NoncurrentVersionExpiration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoncurrentVersionExpiration) GoString() string { + return s.String() +} + +// SetNoncurrentDays sets the NoncurrentDays field's value. +func (s *NoncurrentVersionExpiration) SetNoncurrentDays(v int64) *NoncurrentVersionExpiration { + s.NoncurrentDays = &v + return s +} + +// Container for the transition rule that describes when noncurrent objects +// transition to the STANDARD_IA, ONEZONE_IA or GLACIER storage class. If your +// bucket is versioning-enabled (or versioning is suspended), you can set this +// action to request that Amazon S3 transition noncurrent object versions to +// the STANDARD_IA, ONEZONE_IA or GLACIER storage class at a specific period +// in the object's lifetime. +type NoncurrentVersionTransition struct { + _ struct{} `type:"structure"` + + // Specifies the number of days an object is noncurrent before Amazon S3 can + // perform the associated action. For information about the noncurrent days + // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent + // (http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) in + // the Amazon Simple Storage Service Developer Guide. + NoncurrentDays *int64 `type:"integer"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"TransitionStorageClass"` +} + +// String returns the string representation +func (s NoncurrentVersionTransition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoncurrentVersionTransition) GoString() string { + return s.String() +} + +// SetNoncurrentDays sets the NoncurrentDays field's value. +func (s *NoncurrentVersionTransition) SetNoncurrentDays(v int64) *NoncurrentVersionTransition { + s.NoncurrentDays = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *NoncurrentVersionTransition) SetStorageClass(v string) *NoncurrentVersionTransition { + s.StorageClass = &v + return s +} + +// Container for specifying the notification configuration of the bucket. If +// this element is empty, notifications are turned off on the bucket. +type NotificationConfiguration struct { + _ struct{} `type:"structure"` + + LambdaFunctionConfigurations []*LambdaFunctionConfiguration `locationName:"CloudFunctionConfiguration" type:"list" flattened:"true"` + + QueueConfigurations []*QueueConfiguration `locationName:"QueueConfiguration" type:"list" flattened:"true"` + + TopicConfigurations []*TopicConfiguration `locationName:"TopicConfiguration" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s NotificationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotificationConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *NotificationConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NotificationConfiguration"} + if s.LambdaFunctionConfigurations != nil { + for i, v := range s.LambdaFunctionConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LambdaFunctionConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } + if s.QueueConfigurations != nil { + for i, v := range s.QueueConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueueConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } + if s.TopicConfigurations != nil { + for i, v := range s.TopicConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TopicConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLambdaFunctionConfigurations sets the LambdaFunctionConfigurations field's value. +func (s *NotificationConfiguration) SetLambdaFunctionConfigurations(v []*LambdaFunctionConfiguration) *NotificationConfiguration { + s.LambdaFunctionConfigurations = v + return s +} + +// SetQueueConfigurations sets the QueueConfigurations field's value. +func (s *NotificationConfiguration) SetQueueConfigurations(v []*QueueConfiguration) *NotificationConfiguration { + s.QueueConfigurations = v + return s +} + +// SetTopicConfigurations sets the TopicConfigurations field's value. +func (s *NotificationConfiguration) SetTopicConfigurations(v []*TopicConfiguration) *NotificationConfiguration { + s.TopicConfigurations = v + return s +} + +type NotificationConfigurationDeprecated struct { + _ struct{} `type:"structure"` + + CloudFunctionConfiguration *CloudFunctionConfiguration `type:"structure"` + + QueueConfiguration *QueueConfigurationDeprecated `type:"structure"` + + TopicConfiguration *TopicConfigurationDeprecated `type:"structure"` +} + +// String returns the string representation +func (s NotificationConfigurationDeprecated) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotificationConfigurationDeprecated) GoString() string { + return s.String() +} + +// SetCloudFunctionConfiguration sets the CloudFunctionConfiguration field's value. +func (s *NotificationConfigurationDeprecated) SetCloudFunctionConfiguration(v *CloudFunctionConfiguration) *NotificationConfigurationDeprecated { + s.CloudFunctionConfiguration = v + return s +} + +// SetQueueConfiguration sets the QueueConfiguration field's value. +func (s *NotificationConfigurationDeprecated) SetQueueConfiguration(v *QueueConfigurationDeprecated) *NotificationConfigurationDeprecated { + s.QueueConfiguration = v + return s +} + +// SetTopicConfiguration sets the TopicConfiguration field's value. +func (s *NotificationConfigurationDeprecated) SetTopicConfiguration(v *TopicConfigurationDeprecated) *NotificationConfigurationDeprecated { + s.TopicConfiguration = v + return s +} + +// Container for object key name filtering rules. For information about key +// name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) +// in the Amazon Simple Storage Service Developer Guide. +type NotificationConfigurationFilter struct { + _ struct{} `type:"structure"` + + // Container for object key name prefix and suffix filtering rules. + Key *KeyFilter `locationName:"S3Key" type:"structure"` +} + +// String returns the string representation +func (s NotificationConfigurationFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotificationConfigurationFilter) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *NotificationConfigurationFilter) SetKey(v *KeyFilter) *NotificationConfigurationFilter { + s.Key = v + return s +} + +type Object struct { + _ struct{} `type:"structure"` + + ETag *string `type:"string"` + + Key *string `min:"1" type:"string"` + + LastModified *time.Time `type:"timestamp"` + + Owner *Owner `type:"structure"` + + Size *int64 `type:"integer"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"ObjectStorageClass"` +} + +// String returns the string representation +func (s Object) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Object) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *Object) SetETag(v string) *Object { + s.ETag = &v + return s +} + +// SetKey sets the Key field's value. +func (s *Object) SetKey(v string) *Object { + s.Key = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *Object) SetLastModified(v time.Time) *Object { + s.LastModified = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *Object) SetOwner(v *Owner) *Object { + s.Owner = v + return s +} + +// SetSize sets the Size field's value. +func (s *Object) SetSize(v int64) *Object { + s.Size = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *Object) SetStorageClass(v string) *Object { + s.StorageClass = &v + return s +} + +type ObjectIdentifier struct { + _ struct{} `type:"structure"` + + // Key name of the object to delete. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // VersionId for the specific version of the object to delete. + VersionId *string `type:"string"` +} + +// String returns the string representation +func (s ObjectIdentifier) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ObjectIdentifier) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ObjectIdentifier) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ObjectIdentifier"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *ObjectIdentifier) SetKey(v string) *ObjectIdentifier { + s.Key = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { + s.VersionId = &v + return s +} + +type ObjectVersion struct { + _ struct{} `type:"structure"` + + ETag *string `type:"string"` + + // Specifies whether the object is (true) or is not (false) the latest version + // of an object. + IsLatest *bool `type:"boolean"` + + // The object key. + Key *string `min:"1" type:"string"` + + // Date and time the object was last modified. + LastModified *time.Time `type:"timestamp"` + + Owner *Owner `type:"structure"` + + // Size in bytes of the object. + Size *int64 `type:"integer"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"ObjectVersionStorageClass"` + + // Version ID of an object. + VersionId *string `type:"string"` +} + +// String returns the string representation +func (s ObjectVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ObjectVersion) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *ObjectVersion) SetETag(v string) *ObjectVersion { + s.ETag = &v + return s +} + +// SetIsLatest sets the IsLatest field's value. +func (s *ObjectVersion) SetIsLatest(v bool) *ObjectVersion { + s.IsLatest = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ObjectVersion) SetKey(v string) *ObjectVersion { + s.Key = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *ObjectVersion) SetLastModified(v time.Time) *ObjectVersion { + s.LastModified = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ObjectVersion) SetOwner(v *Owner) *ObjectVersion { + s.Owner = v + return s +} + +// SetSize sets the Size field's value. +func (s *ObjectVersion) SetSize(v int64) *ObjectVersion { + s.Size = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *ObjectVersion) SetStorageClass(v string) *ObjectVersion { + s.StorageClass = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *ObjectVersion) SetVersionId(v string) *ObjectVersion { + s.VersionId = &v + return s +} + +// Describes the location where the restore job's output is stored. +type OutputLocation struct { + _ struct{} `type:"structure"` + + // Describes an S3 location that will receive the results of the restore request. + S3 *Location `type:"structure"` +} + +// String returns the string representation +func (s OutputLocation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OutputLocation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *OutputLocation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OutputLocation"} + if s.S3 != nil { + if err := s.S3.Validate(); err != nil { + invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3 sets the S3 field's value. +func (s *OutputLocation) SetS3(v *Location) *OutputLocation { + s.S3 = v + return s +} + +// Describes how results of the Select job are serialized. +type OutputSerialization struct { + _ struct{} `type:"structure"` + + // Describes the serialization of CSV-encoded Select results. + CSV *CSVOutput `type:"structure"` + + // Specifies JSON as request's output serialization format. + JSON *JSONOutput `type:"structure"` +} + +// String returns the string representation +func (s OutputSerialization) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OutputSerialization) GoString() string { + return s.String() +} + +// SetCSV sets the CSV field's value. +func (s *OutputSerialization) SetCSV(v *CSVOutput) *OutputSerialization { + s.CSV = v + return s +} + +// SetJSON sets the JSON field's value. +func (s *OutputSerialization) SetJSON(v *JSONOutput) *OutputSerialization { + s.JSON = v + return s +} + +type Owner struct { + _ struct{} `type:"structure"` + + DisplayName *string `type:"string"` + + ID *string `type:"string"` +} + +// String returns the string representation +func (s Owner) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Owner) GoString() string { + return s.String() +} + +// SetDisplayName sets the DisplayName field's value. +func (s *Owner) SetDisplayName(v string) *Owner { + s.DisplayName = &v + return s +} + +// SetID sets the ID field's value. +func (s *Owner) SetID(v string) *Owner { + s.ID = &v + return s +} + +type ParquetInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ParquetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParquetInput) GoString() string { + return s.String() +} + +type Part struct { + _ struct{} `type:"structure"` + + // Entity tag returned when the part was uploaded. + ETag *string `type:"string"` + + // Date and time at which the part was uploaded. + LastModified *time.Time `type:"timestamp"` + + // Part number identifying the part. This is a positive integer between 1 and + // 10,000. + PartNumber *int64 `type:"integer"` + + // Size of the uploaded part data. + Size *int64 `type:"integer"` +} + +// String returns the string representation +func (s Part) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Part) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *Part) SetETag(v string) *Part { + s.ETag = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *Part) SetLastModified(v time.Time) *Part { + s.LastModified = &v + return s +} + +// SetPartNumber sets the PartNumber field's value. +func (s *Part) SetPartNumber(v int64) *Part { + s.PartNumber = &v + return s +} + +// SetSize sets the Size field's value. +func (s *Part) SetSize(v int64) *Part { + s.Size = &v + return s +} + +type Progress struct { + _ struct{} `type:"structure"` + + // Current number of uncompressed object bytes processed. + BytesProcessed *int64 `type:"long"` + + // Current number of bytes of records payload data returned. + BytesReturned *int64 `type:"long"` + + // Current number of object bytes scanned. + BytesScanned *int64 `type:"long"` +} + +// String returns the string representation +func (s Progress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Progress) GoString() string { + return s.String() +} + +// SetBytesProcessed sets the BytesProcessed field's value. +func (s *Progress) SetBytesProcessed(v int64) *Progress { + s.BytesProcessed = &v + return s +} + +// SetBytesReturned sets the BytesReturned field's value. +func (s *Progress) SetBytesReturned(v int64) *Progress { + s.BytesReturned = &v + return s +} + +// SetBytesScanned sets the BytesScanned field's value. +func (s *Progress) SetBytesScanned(v int64) *Progress { + s.BytesScanned = &v + return s +} + +type ProgressEvent struct { + _ struct{} `locationName:"ProgressEvent" type:"structure" payload:"Details"` + + // The Progress event details. + Details *Progress `locationName:"Details" type:"structure"` +} + +// String returns the string representation +func (s ProgressEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProgressEvent) GoString() string { + return s.String() +} + +// SetDetails sets the Details field's value. +func (s *ProgressEvent) SetDetails(v *Progress) *ProgressEvent { + s.Details = v + return s +} + +// The ProgressEvent is and event in the SelectObjectContentEventStream group of events. +func (s *ProgressEvent) eventSelectObjectContentEventStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the ProgressEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *ProgressEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +type PutBucketAccelerateConfigurationInput struct { + _ struct{} `type:"structure" payload:"AccelerateConfiguration"` + + // Specifies the Accelerate Configuration you want to set for the bucket. + // + // AccelerateConfiguration is a required field + AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // Name of the bucket for which the accelerate configuration is set. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutBucketAccelerateConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAccelerateConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketAccelerateConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketAccelerateConfigurationInput"} + if s.AccelerateConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("AccelerateConfiguration")) + } + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccelerateConfiguration sets the AccelerateConfiguration field's value. +func (s *PutBucketAccelerateConfigurationInput) SetAccelerateConfiguration(v *AccelerateConfiguration) *PutBucketAccelerateConfigurationInput { + s.AccelerateConfiguration = v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketAccelerateConfigurationInput) SetBucket(v string) *PutBucketAccelerateConfigurationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketAccelerateConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type PutBucketAccelerateConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketAccelerateConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAccelerateConfigurationOutput) GoString() string { + return s.String() +} + +type PutBucketAclInput struct { + _ struct{} `type:"structure" payload:"AccessControlPolicy"` + + // The canned ACL to apply to the bucket. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` + + AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Allows grantee the read, write, read ACP, and write ACP permissions on the + // bucket. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to list the objects in the bucket. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the bucket ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to create, overwrite, and delete any object in the bucket. + GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` + + // Allows grantee to write the ACL for the applicable bucket. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` +} + +// String returns the string representation +func (s PutBucketAclInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAclInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketAclInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketAclInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.AccessControlPolicy != nil { + if err := s.AccessControlPolicy.Validate(); err != nil { + invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetACL sets the ACL field's value. +func (s *PutBucketAclInput) SetACL(v string) *PutBucketAclInput { + s.ACL = &v + return s +} + +// SetAccessControlPolicy sets the AccessControlPolicy field's value. +func (s *PutBucketAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutBucketAclInput { + s.AccessControlPolicy = v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketAclInput) SetBucket(v string) *PutBucketAclInput { + s.Bucket = &v + return s +} + +func (s *PutBucketAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetGrantFullControl sets the GrantFullControl field's value. +func (s *PutBucketAclInput) SetGrantFullControl(v string) *PutBucketAclInput { + s.GrantFullControl = &v + return s +} + +// SetGrantRead sets the GrantRead field's value. +func (s *PutBucketAclInput) SetGrantRead(v string) *PutBucketAclInput { + s.GrantRead = &v + return s +} + +// SetGrantReadACP sets the GrantReadACP field's value. +func (s *PutBucketAclInput) SetGrantReadACP(v string) *PutBucketAclInput { + s.GrantReadACP = &v + return s +} + +// SetGrantWrite sets the GrantWrite field's value. +func (s *PutBucketAclInput) SetGrantWrite(v string) *PutBucketAclInput { + s.GrantWrite = &v + return s +} + +// SetGrantWriteACP sets the GrantWriteACP field's value. +func (s *PutBucketAclInput) SetGrantWriteACP(v string) *PutBucketAclInput { + s.GrantWriteACP = &v + return s +} + +type PutBucketAclOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketAclOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAclOutput) GoString() string { + return s.String() +} + +type PutBucketAnalyticsConfigurationInput struct { + _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` + + // The configuration and any analyses for the analytics filter. + // + // AnalyticsConfiguration is a required field + AnalyticsConfiguration *AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // The name of the bucket to which an analytics configuration is stored. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The identifier used to represent an analytics configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutBucketAnalyticsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAnalyticsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketAnalyticsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketAnalyticsConfigurationInput"} + if s.AnalyticsConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyticsConfiguration")) + } + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.AnalyticsConfiguration != nil { + if err := s.AnalyticsConfiguration.Validate(); err != nil { + invalidParams.AddNested("AnalyticsConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. +func (s *PutBucketAnalyticsConfigurationInput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *PutBucketAnalyticsConfigurationInput { + s.AnalyticsConfiguration = v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketAnalyticsConfigurationInput) SetBucket(v string) *PutBucketAnalyticsConfigurationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketAnalyticsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput { + s.Id = &v + return s +} + +type PutBucketAnalyticsConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketAnalyticsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAnalyticsConfigurationOutput) GoString() string { + return s.String() +} + +type PutBucketCorsInput struct { + _ struct{} `type:"structure" payload:"CORSConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // CORSConfiguration is a required field + CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketCorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketCorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketCorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketCorsInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.CORSConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("CORSConfiguration")) + } + if s.CORSConfiguration != nil { + if err := s.CORSConfiguration.Validate(); err != nil { + invalidParams.AddNested("CORSConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketCorsInput) SetBucket(v string) *PutBucketCorsInput { + s.Bucket = &v + return s +} + +func (s *PutBucketCorsInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCORSConfiguration sets the CORSConfiguration field's value. +func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput { + s.CORSConfiguration = v + return s +} + +type PutBucketCorsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketCorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketCorsOutput) GoString() string { + return s.String() +} + +type PutBucketEncryptionInput struct { + _ struct{} `type:"structure" payload:"ServerSideEncryptionConfiguration"` + + // The name of the bucket for which the server-side encryption configuration + // is set. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Container for server-side encryption configuration rules. Currently S3 supports + // one rule only. + // + // ServerSideEncryptionConfiguration is a required field + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"ServerSideEncryptionConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketEncryptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketEncryptionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketEncryptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketEncryptionInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.ServerSideEncryptionConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("ServerSideEncryptionConfiguration")) + } + if s.ServerSideEncryptionConfiguration != nil { + if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { + invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketEncryptionInput) SetBucket(v string) *PutBucketEncryptionInput { + s.Bucket = &v + return s +} + +func (s *PutBucketEncryptionInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. +func (s *PutBucketEncryptionInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *PutBucketEncryptionInput { + s.ServerSideEncryptionConfiguration = v + return s +} + +type PutBucketEncryptionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketEncryptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketEncryptionOutput) GoString() string { + return s.String() +} + +type PutBucketInventoryConfigurationInput struct { + _ struct{} `type:"structure" payload:"InventoryConfiguration"` + + // The name of the bucket where the inventory configuration will be stored. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ID used to identify the inventory configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` + + // Specifies the inventory configuration. + // + // InventoryConfiguration is a required field + InventoryConfiguration *InventoryConfiguration `locationName:"InventoryConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketInventoryConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketInventoryConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketInventoryConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketInventoryConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.InventoryConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("InventoryConfiguration")) + } + if s.InventoryConfiguration != nil { + if err := s.InventoryConfiguration.Validate(); err != nil { + invalidParams.AddNested("InventoryConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketInventoryConfigurationInput) SetBucket(v string) *PutBucketInventoryConfigurationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketInventoryConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *PutBucketInventoryConfigurationInput) SetId(v string) *PutBucketInventoryConfigurationInput { + s.Id = &v + return s +} + +// SetInventoryConfiguration sets the InventoryConfiguration field's value. +func (s *PutBucketInventoryConfigurationInput) SetInventoryConfiguration(v *InventoryConfiguration) *PutBucketInventoryConfigurationInput { + s.InventoryConfiguration = v + return s +} + +type PutBucketInventoryConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketInventoryConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketInventoryConfigurationOutput) GoString() string { + return s.String() +} + +type PutBucketLifecycleConfigurationInput struct { + _ struct{} `type:"structure" payload:"LifecycleConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketLifecycleConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketLifecycleConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketLifecycleConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.LifecycleConfiguration != nil { + if err := s.LifecycleConfiguration.Validate(); err != nil { + invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketLifecycleConfigurationInput) SetBucket(v string) *PutBucketLifecycleConfigurationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketLifecycleConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. +func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *BucketLifecycleConfiguration) *PutBucketLifecycleConfigurationInput { + s.LifecycleConfiguration = v + return s +} + +type PutBucketLifecycleConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketLifecycleConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketLifecycleConfigurationOutput) GoString() string { + return s.String() +} + +type PutBucketLifecycleInput struct { + _ struct{} `type:"structure" payload:"LifecycleConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketLifecycleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketLifecycleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketLifecycleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.LifecycleConfiguration != nil { + if err := s.LifecycleConfiguration.Validate(); err != nil { + invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketLifecycleInput) SetBucket(v string) *PutBucketLifecycleInput { + s.Bucket = &v + return s +} + +func (s *PutBucketLifecycleInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. +func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfiguration) *PutBucketLifecycleInput { + s.LifecycleConfiguration = v + return s +} + +type PutBucketLifecycleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketLifecycleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketLifecycleOutput) GoString() string { + return s.String() +} + +type PutBucketLoggingInput struct { + _ struct{} `type:"structure" payload:"BucketLoggingStatus"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // BucketLoggingStatus is a required field + BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketLoggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketLoggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketLoggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketLoggingInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.BucketLoggingStatus == nil { + invalidParams.Add(request.NewErrParamRequired("BucketLoggingStatus")) + } + if s.BucketLoggingStatus != nil { + if err := s.BucketLoggingStatus.Validate(); err != nil { + invalidParams.AddNested("BucketLoggingStatus", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketLoggingInput) SetBucket(v string) *PutBucketLoggingInput { + s.Bucket = &v + return s +} + +func (s *PutBucketLoggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetBucketLoggingStatus sets the BucketLoggingStatus field's value. +func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) *PutBucketLoggingInput { + s.BucketLoggingStatus = v + return s +} + +type PutBucketLoggingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketLoggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketLoggingOutput) GoString() string { + return s.String() +} + +type PutBucketMetricsConfigurationInput struct { + _ struct{} `type:"structure" payload:"MetricsConfiguration"` + + // The name of the bucket for which the metrics configuration is set. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The ID used to identify the metrics configuration. + // + // Id is a required field + Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` + + // Specifies the metrics configuration. + // + // MetricsConfiguration is a required field + MetricsConfiguration *MetricsConfiguration `locationName:"MetricsConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketMetricsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketMetricsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketMetricsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketMetricsConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.MetricsConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("MetricsConfiguration")) + } + if s.MetricsConfiguration != nil { + if err := s.MetricsConfiguration.Validate(); err != nil { + invalidParams.AddNested("MetricsConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketMetricsConfigurationInput) SetBucket(v string) *PutBucketMetricsConfigurationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketMetricsConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetId sets the Id field's value. +func (s *PutBucketMetricsConfigurationInput) SetId(v string) *PutBucketMetricsConfigurationInput { + s.Id = &v + return s +} + +// SetMetricsConfiguration sets the MetricsConfiguration field's value. +func (s *PutBucketMetricsConfigurationInput) SetMetricsConfiguration(v *MetricsConfiguration) *PutBucketMetricsConfigurationInput { + s.MetricsConfiguration = v + return s +} + +type PutBucketMetricsConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketMetricsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketMetricsConfigurationOutput) GoString() string { + return s.String() +} + +type PutBucketNotificationConfigurationInput struct { + _ struct{} `type:"structure" payload:"NotificationConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Container for specifying the notification configuration of the bucket. If + // this element is empty, notifications are turned off on the bucket. + // + // NotificationConfiguration is a required field + NotificationConfiguration *NotificationConfiguration `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketNotificationConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketNotificationConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketNotificationConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationConfigurationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.NotificationConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) + } + if s.NotificationConfiguration != nil { + if err := s.NotificationConfiguration.Validate(); err != nil { + invalidParams.AddNested("NotificationConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketNotificationConfigurationInput) SetBucket(v string) *PutBucketNotificationConfigurationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketNotificationConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetNotificationConfiguration sets the NotificationConfiguration field's value. +func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v *NotificationConfiguration) *PutBucketNotificationConfigurationInput { + s.NotificationConfiguration = v + return s +} + +type PutBucketNotificationConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketNotificationConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketNotificationConfigurationOutput) GoString() string { + return s.String() +} + +type PutBucketNotificationInput struct { + _ struct{} `type:"structure" payload:"NotificationConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // NotificationConfiguration is a required field + NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketNotificationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketNotificationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketNotificationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.NotificationConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketNotificationInput) SetBucket(v string) *PutBucketNotificationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketNotificationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetNotificationConfiguration sets the NotificationConfiguration field's value. +func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput { + s.NotificationConfiguration = v + return s +} + +type PutBucketNotificationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketNotificationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketNotificationOutput) GoString() string { + return s.String() +} + +type PutBucketPolicyInput struct { + _ struct{} `type:"structure" payload:"Policy"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Set this parameter to true to confirm that you want to remove your permissions + // to change this bucket policy in the future. + ConfirmRemoveSelfBucketAccess *bool `location:"header" locationName:"x-amz-confirm-remove-self-bucket-access" type:"boolean"` + + // The bucket policy as a JSON document. + // + // Policy is a required field + Policy *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PutBucketPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketPolicyInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Policy == nil { + invalidParams.Add(request.NewErrParamRequired("Policy")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketPolicyInput) SetBucket(v string) *PutBucketPolicyInput { + s.Bucket = &v + return s +} + +func (s *PutBucketPolicyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetConfirmRemoveSelfBucketAccess sets the ConfirmRemoveSelfBucketAccess field's value. +func (s *PutBucketPolicyInput) SetConfirmRemoveSelfBucketAccess(v bool) *PutBucketPolicyInput { + s.ConfirmRemoveSelfBucketAccess = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { + s.Policy = &v + return s +} + +type PutBucketPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketPolicyOutput) GoString() string { + return s.String() +} + +type PutBucketReplicationInput struct { + _ struct{} `type:"structure" payload:"ReplicationConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Container for replication rules. You can add as many as 1,000 rules. Total + // replication configuration size can be up to 2 MB. + // + // ReplicationConfiguration is a required field + ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketReplicationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketReplicationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketReplicationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketReplicationInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.ReplicationConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("ReplicationConfiguration")) + } + if s.ReplicationConfiguration != nil { + if err := s.ReplicationConfiguration.Validate(); err != nil { + invalidParams.AddNested("ReplicationConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketReplicationInput) SetBucket(v string) *PutBucketReplicationInput { + s.Bucket = &v + return s +} + +func (s *PutBucketReplicationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetReplicationConfiguration sets the ReplicationConfiguration field's value. +func (s *PutBucketReplicationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutBucketReplicationInput { + s.ReplicationConfiguration = v + return s +} + +type PutBucketReplicationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketReplicationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketReplicationOutput) GoString() string { + return s.String() +} + +type PutBucketRequestPaymentInput struct { + _ struct{} `type:"structure" payload:"RequestPaymentConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // RequestPaymentConfiguration is a required field + RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketRequestPaymentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketRequestPaymentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketRequestPaymentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketRequestPaymentInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.RequestPaymentConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("RequestPaymentConfiguration")) + } + if s.RequestPaymentConfiguration != nil { + if err := s.RequestPaymentConfiguration.Validate(); err != nil { + invalidParams.AddNested("RequestPaymentConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketRequestPaymentInput) SetBucket(v string) *PutBucketRequestPaymentInput { + s.Bucket = &v + return s +} + +func (s *PutBucketRequestPaymentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetRequestPaymentConfiguration sets the RequestPaymentConfiguration field's value. +func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *RequestPaymentConfiguration) *PutBucketRequestPaymentInput { + s.RequestPaymentConfiguration = v + return s +} + +type PutBucketRequestPaymentOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketRequestPaymentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketRequestPaymentOutput) GoString() string { + return s.String() +} + +type PutBucketTaggingInput struct { + _ struct{} `type:"structure" payload:"Tagging"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Tagging is a required field + Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketTaggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketTaggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketTaggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketTaggingInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Tagging == nil { + invalidParams.Add(request.NewErrParamRequired("Tagging")) + } + if s.Tagging != nil { + if err := s.Tagging.Validate(); err != nil { + invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketTaggingInput) SetBucket(v string) *PutBucketTaggingInput { + s.Bucket = &v + return s +} + +func (s *PutBucketTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetTagging sets the Tagging field's value. +func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { + s.Tagging = v + return s +} + +type PutBucketTaggingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketTaggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketTaggingOutput) GoString() string { + return s.String() +} + +type PutBucketVersioningInput struct { + _ struct{} `type:"structure" payload:"VersioningConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The concatenation of the authentication device's serial number, a space, + // and the value that is displayed on your authentication device. + MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` + + // VersioningConfiguration is a required field + VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketVersioningInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketVersioningInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketVersioningInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketVersioningInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.VersioningConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("VersioningConfiguration")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketVersioningInput) SetBucket(v string) *PutBucketVersioningInput { + s.Bucket = &v + return s +} + +func (s *PutBucketVersioningInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetMFA sets the MFA field's value. +func (s *PutBucketVersioningInput) SetMFA(v string) *PutBucketVersioningInput { + s.MFA = &v + return s +} + +// SetVersioningConfiguration sets the VersioningConfiguration field's value. +func (s *PutBucketVersioningInput) SetVersioningConfiguration(v *VersioningConfiguration) *PutBucketVersioningInput { + s.VersioningConfiguration = v + return s +} + +type PutBucketVersioningOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketVersioningOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketVersioningOutput) GoString() string { + return s.String() +} + +type PutBucketWebsiteInput struct { + _ struct{} `type:"structure" payload:"WebsiteConfiguration"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // WebsiteConfiguration is a required field + WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation +func (s PutBucketWebsiteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketWebsiteInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketWebsiteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketWebsiteInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.WebsiteConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("WebsiteConfiguration")) + } + if s.WebsiteConfiguration != nil { + if err := s.WebsiteConfiguration.Validate(); err != nil { + invalidParams.AddNested("WebsiteConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketWebsiteInput) SetBucket(v string) *PutBucketWebsiteInput { + s.Bucket = &v + return s +} + +func (s *PutBucketWebsiteInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetWebsiteConfiguration sets the WebsiteConfiguration field's value. +func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) *PutBucketWebsiteInput { + s.WebsiteConfiguration = v + return s +} + +type PutBucketWebsiteOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketWebsiteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketWebsiteOutput) GoString() string { + return s.String() +} + +type PutObjectAclInput struct { + _ struct{} `type:"structure" payload:"AccessControlPolicy"` + + // The canned ACL to apply to the object. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + + AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Allows grantee the read, write, read ACP, and write ACP permissions on the + // bucket. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to list the objects in the bucket. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the bucket ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to create, overwrite, and delete any object in the bucket. + GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` + + // Allows grantee to write the ACL for the applicable bucket. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // VersionId used to reference a specific version of the object. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s PutObjectAclInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutObjectAclInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutObjectAclInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutObjectAclInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.AccessControlPolicy != nil { + if err := s.AccessControlPolicy.Validate(); err != nil { + invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetACL sets the ACL field's value. +func (s *PutObjectAclInput) SetACL(v string) *PutObjectAclInput { + s.ACL = &v + return s +} + +// SetAccessControlPolicy sets the AccessControlPolicy field's value. +func (s *PutObjectAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutObjectAclInput { + s.AccessControlPolicy = v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *PutObjectAclInput) SetBucket(v string) *PutObjectAclInput { + s.Bucket = &v + return s +} + +func (s *PutObjectAclInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetGrantFullControl sets the GrantFullControl field's value. +func (s *PutObjectAclInput) SetGrantFullControl(v string) *PutObjectAclInput { + s.GrantFullControl = &v + return s +} + +// SetGrantRead sets the GrantRead field's value. +func (s *PutObjectAclInput) SetGrantRead(v string) *PutObjectAclInput { + s.GrantRead = &v + return s +} + +// SetGrantReadACP sets the GrantReadACP field's value. +func (s *PutObjectAclInput) SetGrantReadACP(v string) *PutObjectAclInput { + s.GrantReadACP = &v + return s +} + +// SetGrantWrite sets the GrantWrite field's value. +func (s *PutObjectAclInput) SetGrantWrite(v string) *PutObjectAclInput { + s.GrantWrite = &v + return s +} + +// SetGrantWriteACP sets the GrantWriteACP field's value. +func (s *PutObjectAclInput) SetGrantWriteACP(v string) *PutObjectAclInput { + s.GrantWriteACP = &v + return s +} + +// SetKey sets the Key field's value. +func (s *PutObjectAclInput) SetKey(v string) *PutObjectAclInput { + s.Key = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *PutObjectAclInput) SetRequestPayer(v string) *PutObjectAclInput { + s.RequestPayer = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *PutObjectAclInput) SetVersionId(v string) *PutObjectAclInput { + s.VersionId = &v + return s +} + +type PutObjectAclOutput struct { + _ struct{} `type:"structure"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` +} + +// String returns the string representation +func (s PutObjectAclOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutObjectAclOutput) GoString() string { + return s.String() +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *PutObjectAclOutput) SetRequestCharged(v string) *PutObjectAclOutput { + s.RequestCharged = &v + return s +} + +type PutObjectInput struct { + _ struct{} `type:"structure" payload:"Body"` + + // The canned ACL to apply to the object. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + + // Object data. + Body io.ReadSeeker `type:"blob"` + + // Name of the bucket to which the PUT operation was initiated. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` + + // Size of the body in bytes. This parameter is useful when the size of the + // body cannot be determined automatically. + ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` + + // The base64-encoded 128-bit MD5 digest of the part data. + ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` + + // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to read the object data and its metadata. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the object ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to write the ACL for the applicable object. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + + // Object key for which the PUT operation was initiated. + // + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT + // requests for an object protected by AWS KMS will fail if not made via SSL + // or using SigV4. Documentation on configuring any of the officially supported + // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // The type of storage to use for the object. Defaults to 'STANDARD'. + StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` + + // The tag-set for the object. The tag-set must be encoded as URL Query parameters + Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` + + // If the bucket is configured as a website, redirects requests for this object + // to another object in the same bucket or to an external URL. Amazon S3 stores + // the value of this header in the object metadata. + WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` +} + +// String returns the string representation +func (s PutObjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutObjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutObjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutObjectInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetACL sets the ACL field's value. +func (s *PutObjectInput) SetACL(v string) *PutObjectInput { + s.ACL = &v + return s +} + +// SetBody sets the Body field's value. +func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput { + s.Body = v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *PutObjectInput) SetBucket(v string) *PutObjectInput { + s.Bucket = &v + return s +} + +func (s *PutObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCacheControl sets the CacheControl field's value. +func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput { + s.CacheControl = &v + return s +} + +// SetContentDisposition sets the ContentDisposition field's value. +func (s *PutObjectInput) SetContentDisposition(v string) *PutObjectInput { + s.ContentDisposition = &v + return s +} + +// SetContentEncoding sets the ContentEncoding field's value. +func (s *PutObjectInput) SetContentEncoding(v string) *PutObjectInput { + s.ContentEncoding = &v + return s +} + +// SetContentLanguage sets the ContentLanguage field's value. +func (s *PutObjectInput) SetContentLanguage(v string) *PutObjectInput { + s.ContentLanguage = &v + return s +} + +// SetContentLength sets the ContentLength field's value. +func (s *PutObjectInput) SetContentLength(v int64) *PutObjectInput { + s.ContentLength = &v + return s +} + +// SetContentMD5 sets the ContentMD5 field's value. +func (s *PutObjectInput) SetContentMD5(v string) *PutObjectInput { + s.ContentMD5 = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *PutObjectInput) SetContentType(v string) *PutObjectInput { + s.ContentType = &v + return s +} + +// SetExpires sets the Expires field's value. +func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput { + s.Expires = &v + return s +} + +// SetGrantFullControl sets the GrantFullControl field's value. +func (s *PutObjectInput) SetGrantFullControl(v string) *PutObjectInput { + s.GrantFullControl = &v + return s +} + +// SetGrantRead sets the GrantRead field's value. +func (s *PutObjectInput) SetGrantRead(v string) *PutObjectInput { + s.GrantRead = &v + return s +} + +// SetGrantReadACP sets the GrantReadACP field's value. +func (s *PutObjectInput) SetGrantReadACP(v string) *PutObjectInput { + s.GrantReadACP = &v + return s +} + +// SetGrantWriteACP sets the GrantWriteACP field's value. +func (s *PutObjectInput) SetGrantWriteACP(v string) *PutObjectInput { + s.GrantWriteACP = &v + return s +} + +// SetKey sets the Key field's value. +func (s *PutObjectInput) SetKey(v string) *PutObjectInput { + s.Key = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput { + s.Metadata = v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *PutObjectInput) SetRequestPayer(v string) *PutObjectInput { + s.RequestPayer = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *PutObjectInput) SetSSECustomerAlgorithm(v string) *PutObjectInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput { + s.SSECustomerKey = &v + return s +} + +func (s *PutObjectInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *PutObjectInput) SetServerSideEncryption(v string) *PutObjectInput { + s.ServerSideEncryption = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *PutObjectInput) SetStorageClass(v string) *PutObjectInput { + s.StorageClass = &v + return s +} + +// SetTagging sets the Tagging field's value. +func (s *PutObjectInput) SetTagging(v string) *PutObjectInput { + s.Tagging = &v + return s +} + +// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. +func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { + s.WebsiteRedirectLocation = &v + return s +} + +type PutObjectOutput struct { + _ struct{} `type:"structure"` + + // Entity tag for the uploaded object. + ETag *string `location:"header" locationName:"ETag" type:"string"` + + // If the object expiration is configured, this will contain the expiration + // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. + Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // Version of the object. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s PutObjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutObjectOutput) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *PutObjectOutput) SetETag(v string) *PutObjectOutput { + s.ETag = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *PutObjectOutput) SetExpiration(v string) *PutObjectOutput { + s.Expiration = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *PutObjectOutput) SetRequestCharged(v string) *PutObjectOutput { + s.RequestCharged = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *PutObjectOutput) SetSSECustomerAlgorithm(v string) *PutObjectOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *PutObjectOutput) SetSSECustomerKeyMD5(v string) *PutObjectOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *PutObjectOutput) SetSSEKMSKeyId(v string) *PutObjectOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *PutObjectOutput) SetServerSideEncryption(v string) *PutObjectOutput { + s.ServerSideEncryption = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *PutObjectOutput) SetVersionId(v string) *PutObjectOutput { + s.VersionId = &v + return s +} + +type PutObjectTaggingInput struct { + _ struct{} `type:"structure" payload:"Tagging"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Tagging is a required field + Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s PutObjectTaggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutObjectTaggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutObjectTaggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutObjectTaggingInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.Tagging == nil { + invalidParams.Add(request.NewErrParamRequired("Tagging")) + } + if s.Tagging != nil { + if err := s.Tagging.Validate(); err != nil { + invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutObjectTaggingInput) SetBucket(v string) *PutObjectTaggingInput { + s.Bucket = &v + return s +} + +func (s *PutObjectTaggingInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { + s.Key = &v + return s +} + +// SetTagging sets the Tagging field's value. +func (s *PutObjectTaggingInput) SetTagging(v *Tagging) *PutObjectTaggingInput { + s.Tagging = v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *PutObjectTaggingInput) SetVersionId(v string) *PutObjectTaggingInput { + s.VersionId = &v + return s +} + +type PutObjectTaggingOutput struct { + _ struct{} `type:"structure"` + + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s PutObjectTaggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutObjectTaggingOutput) GoString() string { + return s.String() +} + +// SetVersionId sets the VersionId field's value. +func (s *PutObjectTaggingOutput) SetVersionId(v string) *PutObjectTaggingOutput { + s.VersionId = &v + return s +} + +// Container for specifying an configuration when you want Amazon S3 to publish +// events to an Amazon Simple Queue Service (Amazon SQS) queue. +type QueueConfiguration struct { + _ struct{} `type:"structure"` + + // Events is a required field + Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` + + // Container for object key name filtering rules. For information about key + // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // in the Amazon Simple Storage Service Developer Guide. + Filter *NotificationConfigurationFilter `type:"structure"` + + // Optional unique identifier for configurations in a notification configuration. + // If you don't provide one, Amazon S3 will assign an ID. + Id *string `type:"string"` + + // Amazon SQS queue ARN to which Amazon S3 will publish a message when it detects + // events of specified type. + // + // QueueArn is a required field + QueueArn *string `locationName:"Queue" type:"string" required:"true"` +} + +// String returns the string representation +func (s QueueConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s QueueConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *QueueConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "QueueConfiguration"} + if s.Events == nil { + invalidParams.Add(request.NewErrParamRequired("Events")) + } + if s.QueueArn == nil { + invalidParams.Add(request.NewErrParamRequired("QueueArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEvents sets the Events field's value. +func (s *QueueConfiguration) SetEvents(v []*string) *QueueConfiguration { + s.Events = v + return s +} + +// SetFilter sets the Filter field's value. +func (s *QueueConfiguration) SetFilter(v *NotificationConfigurationFilter) *QueueConfiguration { + s.Filter = v + return s +} + +// SetId sets the Id field's value. +func (s *QueueConfiguration) SetId(v string) *QueueConfiguration { + s.Id = &v + return s +} + +// SetQueueArn sets the QueueArn field's value. +func (s *QueueConfiguration) SetQueueArn(v string) *QueueConfiguration { + s.QueueArn = &v + return s +} + +type QueueConfigurationDeprecated struct { + _ struct{} `type:"structure"` + + // Bucket event for which to send notifications. + // + // Deprecated: Event has been deprecated + Event *string `deprecated:"true" type:"string" enum:"Event"` + + Events []*string `locationName:"Event" type:"list" flattened:"true"` + + // Optional unique identifier for configurations in a notification configuration. + // If you don't provide one, Amazon S3 will assign an ID. + Id *string `type:"string"` + + Queue *string `type:"string"` +} + +// String returns the string representation +func (s QueueConfigurationDeprecated) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s QueueConfigurationDeprecated) GoString() string { + return s.String() +} + +// SetEvent sets the Event field's value. +func (s *QueueConfigurationDeprecated) SetEvent(v string) *QueueConfigurationDeprecated { + s.Event = &v + return s +} + +// SetEvents sets the Events field's value. +func (s *QueueConfigurationDeprecated) SetEvents(v []*string) *QueueConfigurationDeprecated { + s.Events = v + return s +} + +// SetId sets the Id field's value. +func (s *QueueConfigurationDeprecated) SetId(v string) *QueueConfigurationDeprecated { + s.Id = &v + return s +} + +// SetQueue sets the Queue field's value. +func (s *QueueConfigurationDeprecated) SetQueue(v string) *QueueConfigurationDeprecated { + s.Queue = &v + return s +} + +type RecordsEvent struct { + _ struct{} `locationName:"RecordsEvent" type:"structure" payload:"Payload"` + + // The byte array of partial, one or more result records. + // + // Payload is automatically base64 encoded/decoded by the SDK. + Payload []byte `type:"blob"` +} + +// String returns the string representation +func (s RecordsEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordsEvent) GoString() string { + return s.String() +} + +// SetPayload sets the Payload field's value. +func (s *RecordsEvent) SetPayload(v []byte) *RecordsEvent { + s.Payload = v + return s +} + +// The RecordsEvent is and event in the SelectObjectContentEventStream group of events. +func (s *RecordsEvent) eventSelectObjectContentEventStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the RecordsEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *RecordsEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + s.Payload = make([]byte, len(msg.Payload)) + copy(s.Payload, msg.Payload) + return nil +} + +type Redirect struct { + _ struct{} `type:"structure"` + + // The host name to use in the redirect request. + HostName *string `type:"string"` + + // The HTTP redirect code to use on the response. Not required if one of the + // siblings is present. + HttpRedirectCode *string `type:"string"` + + // Protocol to use (http, https) when redirecting requests. The default is the + // protocol that is used in the original request. + Protocol *string `type:"string" enum:"Protocol"` + + // The object key prefix to use in the redirect request. For example, to redirect + // requests for all pages with prefix docs/ (objects in the docs/ folder) to + // documents/, you can set a condition block with KeyPrefixEquals set to docs/ + // and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required + // if one of the siblings is present. Can be present only if ReplaceKeyWith + // is not provided. + ReplaceKeyPrefixWith *string `type:"string"` + + // The specific object key to use in the redirect request. For example, redirect + // request to error.html. Not required if one of the sibling is present. Can + // be present only if ReplaceKeyPrefixWith is not provided. + ReplaceKeyWith *string `type:"string"` +} + +// String returns the string representation +func (s Redirect) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Redirect) GoString() string { + return s.String() +} + +// SetHostName sets the HostName field's value. +func (s *Redirect) SetHostName(v string) *Redirect { + s.HostName = &v + return s +} + +// SetHttpRedirectCode sets the HttpRedirectCode field's value. +func (s *Redirect) SetHttpRedirectCode(v string) *Redirect { + s.HttpRedirectCode = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *Redirect) SetProtocol(v string) *Redirect { + s.Protocol = &v + return s +} + +// SetReplaceKeyPrefixWith sets the ReplaceKeyPrefixWith field's value. +func (s *Redirect) SetReplaceKeyPrefixWith(v string) *Redirect { + s.ReplaceKeyPrefixWith = &v + return s +} + +// SetReplaceKeyWith sets the ReplaceKeyWith field's value. +func (s *Redirect) SetReplaceKeyWith(v string) *Redirect { + s.ReplaceKeyWith = &v + return s +} + +type RedirectAllRequestsTo struct { + _ struct{} `type:"structure"` + + // Name of the host where requests will be redirected. + // + // HostName is a required field + HostName *string `type:"string" required:"true"` + + // Protocol to use (http, https) when redirecting requests. The default is the + // protocol that is used in the original request. + Protocol *string `type:"string" enum:"Protocol"` +} + +// String returns the string representation +func (s RedirectAllRequestsTo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RedirectAllRequestsTo) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RedirectAllRequestsTo) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RedirectAllRequestsTo"} + if s.HostName == nil { + invalidParams.Add(request.NewErrParamRequired("HostName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHostName sets the HostName field's value. +func (s *RedirectAllRequestsTo) SetHostName(v string) *RedirectAllRequestsTo { + s.HostName = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *RedirectAllRequestsTo) SetProtocol(v string) *RedirectAllRequestsTo { + s.Protocol = &v + return s +} + +// Container for replication rules. You can add as many as 1,000 rules. Total +// replication configuration size can be up to 2 MB. +type ReplicationConfiguration struct { + _ struct{} `type:"structure"` + + // Amazon Resource Name (ARN) of an IAM role for Amazon S3 to assume when replicating + // the objects. + // + // Role is a required field + Role *string `type:"string" required:"true"` + + // Container for one or more replication rules. Replication configuration must + // have at least one rule and can contain up to 1,000 rules. + // + // Rules is a required field + Rules []*ReplicationRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s ReplicationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationConfiguration"} + if s.Role == nil { + invalidParams.Add(request.NewErrParamRequired("Role")) + } + if s.Rules == nil { + invalidParams.Add(request.NewErrParamRequired("Rules")) + } + if s.Rules != nil { + for i, v := range s.Rules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRole sets the Role field's value. +func (s *ReplicationConfiguration) SetRole(v string) *ReplicationConfiguration { + s.Role = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationConfiguration { + s.Rules = v + return s +} + +// Container for information about a particular replication rule. +type ReplicationRule struct { + _ struct{} `type:"structure"` + + // Specifies whether Amazon S3 should replicate delete makers. + DeleteMarkerReplication *DeleteMarkerReplication `type:"structure"` + + // Container for replication destination information. + // + // Destination is a required field + Destination *Destination `type:"structure" required:"true"` + + // Filter that identifies subset of objects to which the replication rule applies. + // A Filter must specify exactly one Prefix, Tag, or an And child element. + Filter *ReplicationRuleFilter `type:"structure"` + + // Unique identifier for the rule. The value cannot be longer than 255 characters. + ID *string `type:"string"` + + // Object keyname prefix identifying one or more objects to which the rule applies. + // Maximum prefix length can be up to 1,024 characters. + // + // Deprecated: Prefix has been deprecated + Prefix *string `deprecated:"true" type:"string"` + + // The priority associated with the rule. If you specify multiple rules in a + // replication configuration, then Amazon S3 applies rule priority in the event + // there are conflicts (two or more rules identify the same object based on + // filter specified). The rule with higher priority takes precedence. For example, + // + // * Same object quality prefix based filter criteria If prefixes you specified + // in multiple rules overlap. + // + // * Same object qualify tag based filter criteria specified in multiple + // rules + // + // For more information, see Cross-Region Replication (CRR) ( https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) + // in the Amazon S3 Developer Guide. + Priority *int64 `type:"integer"` + + // Container that describes additional filters in identifying source objects + // that you want to replicate. Currently, Amazon S3 supports only the filter + // that you can specify for objects created with server-side encryption using + // an AWS KMS-managed key. You can choose to enable or disable replication of + // these objects. + // + // if you want Amazon S3 to replicate objects created with server-side encryption + // using AWS KMS-managed keys. + SourceSelectionCriteria *SourceSelectionCriteria `type:"structure"` + + // The rule is ignored if status is not Enabled. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"ReplicationRuleStatus"` +} + +// String returns the string representation +func (s ReplicationRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationRule"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.Destination != nil { + if err := s.Destination.Validate(); err != nil { + invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) + } + } + if s.Filter != nil { + if err := s.Filter.Validate(); err != nil { + invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) + } + } + if s.SourceSelectionCriteria != nil { + if err := s.SourceSelectionCriteria.Validate(); err != nil { + invalidParams.AddNested("SourceSelectionCriteria", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeleteMarkerReplication sets the DeleteMarkerReplication field's value. +func (s *ReplicationRule) SetDeleteMarkerReplication(v *DeleteMarkerReplication) *ReplicationRule { + s.DeleteMarkerReplication = v + return s +} + +// SetDestination sets the Destination field's value. +func (s *ReplicationRule) SetDestination(v *Destination) *ReplicationRule { + s.Destination = v + return s +} + +// SetFilter sets the Filter field's value. +func (s *ReplicationRule) SetFilter(v *ReplicationRuleFilter) *ReplicationRule { + s.Filter = v + return s +} + +// SetID sets the ID field's value. +func (s *ReplicationRule) SetID(v string) *ReplicationRule { + s.ID = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ReplicationRule) SetPrefix(v string) *ReplicationRule { + s.Prefix = &v + return s +} + +// SetPriority sets the Priority field's value. +func (s *ReplicationRule) SetPriority(v int64) *ReplicationRule { + s.Priority = &v + return s +} + +// SetSourceSelectionCriteria sets the SourceSelectionCriteria field's value. +func (s *ReplicationRule) SetSourceSelectionCriteria(v *SourceSelectionCriteria) *ReplicationRule { + s.SourceSelectionCriteria = v + return s +} + +// SetStatus sets the Status field's value. +func (s *ReplicationRule) SetStatus(v string) *ReplicationRule { + s.Status = &v + return s +} + +type ReplicationRuleAndOperator struct { + _ struct{} `type:"structure"` + + Prefix *string `type:"string"` + + Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ReplicationRuleAndOperator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationRuleAndOperator) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationRuleAndOperator) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationRuleAndOperator"} + 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 +} + +// SetPrefix sets the Prefix field's value. +func (s *ReplicationRuleAndOperator) SetPrefix(v string) *ReplicationRuleAndOperator { + s.Prefix = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ReplicationRuleAndOperator) SetTags(v []*Tag) *ReplicationRuleAndOperator { + s.Tags = v + return s +} + +// Filter that identifies subset of objects to which the replication rule applies. +// A Filter must specify exactly one Prefix, Tag, or an And child element. +type ReplicationRuleFilter struct { + _ struct{} `type:"structure"` + + // Container for specifying rule filters. These filters determine the subset + // of objects to which the rule applies. The element is required only if you + // specify more than one filter. For example: + // + // * You specify both a Prefix and a Tag filters. Then you wrap these in + // an And tag. + // + // * You specify filter based on multiple tags. Then you wrap the Tag elements + // in an And tag. + And *ReplicationRuleAndOperator `type:"structure"` + + // Object keyname prefix that identifies subset of objects to which the rule + // applies. + Prefix *string `type:"string"` + + // Container for specifying a tag key and value. + // + // The rule applies only to objects having the tag in its tagset. + Tag *Tag `type:"structure"` +} + +// String returns the string representation +func (s ReplicationRuleFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationRuleFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationRuleFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationRuleFilter"} + if s.And != nil { + if err := s.And.Validate(); err != nil { + invalidParams.AddNested("And", err.(request.ErrInvalidParams)) + } + } + if s.Tag != nil { + if err := s.Tag.Validate(); err != nil { + invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnd sets the And field's value. +func (s *ReplicationRuleFilter) SetAnd(v *ReplicationRuleAndOperator) *ReplicationRuleFilter { + s.And = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *ReplicationRuleFilter) SetPrefix(v string) *ReplicationRuleFilter { + s.Prefix = &v + return s +} + +// SetTag sets the Tag field's value. +func (s *ReplicationRuleFilter) SetTag(v *Tag) *ReplicationRuleFilter { + s.Tag = v + return s +} + +type RequestPaymentConfiguration struct { + _ struct{} `type:"structure"` + + // Specifies who pays for the download and request fees. + // + // Payer is a required field + Payer *string `type:"string" required:"true" enum:"Payer"` +} + +// String returns the string representation +func (s RequestPaymentConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestPaymentConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RequestPaymentConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RequestPaymentConfiguration"} + if s.Payer == nil { + invalidParams.Add(request.NewErrParamRequired("Payer")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPayer sets the Payer field's value. +func (s *RequestPaymentConfiguration) SetPayer(v string) *RequestPaymentConfiguration { + s.Payer = &v + return s +} + +type RequestProgress struct { + _ struct{} `type:"structure"` + + // Specifies whether periodic QueryProgress frames should be sent. Valid values: + // TRUE, FALSE. Default value: FALSE. + Enabled *bool `type:"boolean"` +} + +// String returns the string representation +func (s RequestProgress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestProgress) GoString() string { + return s.String() +} + +// SetEnabled sets the Enabled field's value. +func (s *RequestProgress) SetEnabled(v bool) *RequestProgress { + s.Enabled = &v + return s +} + +type RestoreObjectInput struct { + _ struct{} `type:"structure" payload:"RestoreRequest"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Container for restore job parameters. + RestoreRequest *RestoreRequest `locationName:"RestoreRequest" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s RestoreObjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreObjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RestoreObjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RestoreObjectInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.RestoreRequest != nil { + if err := s.RestoreRequest.Validate(); err != nil { + invalidParams.AddNested("RestoreRequest", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *RestoreObjectInput) SetBucket(v string) *RestoreObjectInput { + s.Bucket = &v + return s +} + +func (s *RestoreObjectInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetKey sets the Key field's value. +func (s *RestoreObjectInput) SetKey(v string) *RestoreObjectInput { + s.Key = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *RestoreObjectInput) SetRequestPayer(v string) *RestoreObjectInput { + s.RequestPayer = &v + return s +} + +// SetRestoreRequest sets the RestoreRequest field's value. +func (s *RestoreObjectInput) SetRestoreRequest(v *RestoreRequest) *RestoreObjectInput { + s.RestoreRequest = v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *RestoreObjectInput) SetVersionId(v string) *RestoreObjectInput { + s.VersionId = &v + return s +} + +type RestoreObjectOutput struct { + _ struct{} `type:"structure"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // Indicates the path in the provided S3 output location where Select results + // will be restored to. + RestoreOutputPath *string `location:"header" locationName:"x-amz-restore-output-path" type:"string"` +} + +// String returns the string representation +func (s RestoreObjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreObjectOutput) GoString() string { + return s.String() +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *RestoreObjectOutput) SetRequestCharged(v string) *RestoreObjectOutput { + s.RequestCharged = &v + return s +} + +// SetRestoreOutputPath sets the RestoreOutputPath field's value. +func (s *RestoreObjectOutput) SetRestoreOutputPath(v string) *RestoreObjectOutput { + s.RestoreOutputPath = &v + return s +} + +// Container for restore job parameters. +type RestoreRequest struct { + _ struct{} `type:"structure"` + + // Lifetime of the active copy in days. Do not use with restores that specify + // OutputLocation. + Days *int64 `type:"integer"` + + // The optional description for the job. + Description *string `type:"string"` + + // Glacier related parameters pertaining to this job. Do not use with restores + // that specify OutputLocation. + GlacierJobParameters *GlacierJobParameters `type:"structure"` + + // Describes the location where the restore job's output is stored. + OutputLocation *OutputLocation `type:"structure"` + + // Describes the parameters for Select job types. + SelectParameters *SelectParameters `type:"structure"` + + // Glacier retrieval tier at which the restore will be processed. + Tier *string `type:"string" enum:"Tier"` + + // Type of restore request. + Type *string `type:"string" enum:"RestoreRequestType"` +} + +// String returns the string representation +func (s RestoreRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RestoreRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RestoreRequest"} + if s.GlacierJobParameters != nil { + if err := s.GlacierJobParameters.Validate(); err != nil { + invalidParams.AddNested("GlacierJobParameters", err.(request.ErrInvalidParams)) + } + } + if s.OutputLocation != nil { + if err := s.OutputLocation.Validate(); err != nil { + invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) + } + } + if s.SelectParameters != nil { + if err := s.SelectParameters.Validate(); err != nil { + invalidParams.AddNested("SelectParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDays sets the Days field's value. +func (s *RestoreRequest) SetDays(v int64) *RestoreRequest { + s.Days = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *RestoreRequest) SetDescription(v string) *RestoreRequest { + s.Description = &v + return s +} + +// SetGlacierJobParameters sets the GlacierJobParameters field's value. +func (s *RestoreRequest) SetGlacierJobParameters(v *GlacierJobParameters) *RestoreRequest { + s.GlacierJobParameters = v + return s +} + +// SetOutputLocation sets the OutputLocation field's value. +func (s *RestoreRequest) SetOutputLocation(v *OutputLocation) *RestoreRequest { + s.OutputLocation = v + return s +} + +// SetSelectParameters sets the SelectParameters field's value. +func (s *RestoreRequest) SetSelectParameters(v *SelectParameters) *RestoreRequest { + s.SelectParameters = v + return s +} + +// SetTier sets the Tier field's value. +func (s *RestoreRequest) SetTier(v string) *RestoreRequest { + s.Tier = &v + return s +} + +// SetType sets the Type field's value. +func (s *RestoreRequest) SetType(v string) *RestoreRequest { + s.Type = &v + return s +} + +type RoutingRule struct { + _ struct{} `type:"structure"` + + // A container for describing a condition that must be met for the specified + // redirect to apply. For example, 1. If request is for pages in the /docs folder, + // redirect to the /documents folder. 2. If request results in HTTP error 4xx, + // redirect request to another host where you might process the error. + Condition *Condition `type:"structure"` + + // Container for redirect information. You can redirect requests to another + // host, to another page, or with another protocol. In the event of an error, + // you can can specify a different error code to return. + // + // Redirect is a required field + Redirect *Redirect `type:"structure" required:"true"` +} + +// String returns the string representation +func (s RoutingRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoutingRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RoutingRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RoutingRule"} + if s.Redirect == nil { + invalidParams.Add(request.NewErrParamRequired("Redirect")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCondition sets the Condition field's value. +func (s *RoutingRule) SetCondition(v *Condition) *RoutingRule { + s.Condition = v + return s +} + +// SetRedirect sets the Redirect field's value. +func (s *RoutingRule) SetRedirect(v *Redirect) *RoutingRule { + s.Redirect = v + return s +} + +type Rule struct { + _ struct{} `type:"structure"` + + // Specifies the days since the initiation of an Incomplete Multipart Upload + // that Lifecycle will wait before permanently removing all parts of the upload. + AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` + + Expiration *LifecycleExpiration `type:"structure"` + + // Unique identifier for the rule. The value cannot be longer than 255 characters. + ID *string `type:"string"` + + // Specifies when noncurrent object versions expire. Upon expiration, Amazon + // S3 permanently deletes the noncurrent object versions. You set this lifecycle + // configuration action on a bucket that has versioning enabled (or suspended) + // to request that Amazon S3 delete noncurrent object versions at a specific + // period in the object's lifetime. + NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` + + // Container for the transition rule that describes when noncurrent objects + // transition to the STANDARD_IA, ONEZONE_IA or GLACIER storage class. If your + // bucket is versioning-enabled (or versioning is suspended), you can set this + // action to request that Amazon S3 transition noncurrent object versions to + // the STANDARD_IA, ONEZONE_IA or GLACIER storage class at a specific period + // in the object's lifetime. + NoncurrentVersionTransition *NoncurrentVersionTransition `type:"structure"` + + // Prefix identifying one or more objects to which the rule applies. + // + // Prefix is a required field + Prefix *string `type:"string" required:"true"` + + // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule + // is not currently being applied. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"ExpirationStatus"` + + Transition *Transition `type:"structure"` +} + +// String returns the string representation +func (s Rule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Rule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Rule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Rule"} + if s.Prefix == nil { + invalidParams.Add(request.NewErrParamRequired("Prefix")) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. +func (s *Rule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *Rule { + s.AbortIncompleteMultipartUpload = v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *Rule) SetExpiration(v *LifecycleExpiration) *Rule { + s.Expiration = v + return s +} + +// SetID sets the ID field's value. +func (s *Rule) SetID(v string) *Rule { + s.ID = &v + return s +} + +// SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. +func (s *Rule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *Rule { + s.NoncurrentVersionExpiration = v + return s +} + +// SetNoncurrentVersionTransition sets the NoncurrentVersionTransition field's value. +func (s *Rule) SetNoncurrentVersionTransition(v *NoncurrentVersionTransition) *Rule { + s.NoncurrentVersionTransition = v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *Rule) SetPrefix(v string) *Rule { + s.Prefix = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Rule) SetStatus(v string) *Rule { + s.Status = &v + return s +} + +// SetTransition sets the Transition field's value. +func (s *Rule) SetTransition(v *Transition) *Rule { + s.Transition = v + return s +} + +// Specifies the use of SSE-KMS to encrypt delievered Inventory reports. +type SSEKMS struct { + _ struct{} `locationName:"SSE-KMS" type:"structure"` + + // Specifies the ID of the AWS Key Management Service (KMS) master encryption + // key to use for encrypting Inventory reports. + // + // KeyId is a required field + KeyId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SSEKMS) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SSEKMS) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SSEKMS) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SSEKMS"} + if s.KeyId == nil { + invalidParams.Add(request.NewErrParamRequired("KeyId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKeyId sets the KeyId field's value. +func (s *SSEKMS) SetKeyId(v string) *SSEKMS { + s.KeyId = &v + return s +} + +// Specifies the use of SSE-S3 to encrypt delievered Inventory reports. +type SSES3 struct { + _ struct{} `locationName:"SSE-S3" type:"structure"` +} + +// String returns the string representation +func (s SSES3) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SSES3) GoString() string { + return s.String() +} + +// SelectObjectContentEventStream provides handling of EventStreams for +// the SelectObjectContent API. +// +// Use this type to receive SelectObjectContentEventStream events. The events +// can be read from the Events channel member. +// +// The events that can be received are: +// +// * ContinuationEvent +// * EndEvent +// * ProgressEvent +// * RecordsEvent +// * StatsEvent +type SelectObjectContentEventStream struct { + // Reader is the EventStream reader for the SelectObjectContentEventStream + // events. This value is automatically set by the SDK when the API call is made + // Use this member when unit testing your code with the SDK to mock out the + // EventStream Reader. + // + // Must not be nil. + Reader SelectObjectContentEventStreamReader + + // StreamCloser is the io.Closer for the EventStream connection. For HTTP + // EventStream this is the response Body. The stream will be closed when + // the Close method of the EventStream is called. + StreamCloser io.Closer +} + +// Close closes the EventStream. This will also cause the Events channel to be +// closed. You can use the closing of the Events channel to terminate your +// application's read from the API's EventStream. +// +// Will close the underlying EventStream reader. For EventStream over HTTP +// connection this will also close the HTTP connection. +// +// Close must be called when done using the EventStream API. Not calling Close +// may result in resource leaks. +func (es *SelectObjectContentEventStream) Close() (err error) { + es.Reader.Close() + return es.Err() +} + +// Err returns any error that occurred while reading EventStream Events from +// the service API's response. Returns nil if there were no errors. +func (es *SelectObjectContentEventStream) Err() error { + if err := es.Reader.Err(); err != nil { + return err + } + es.StreamCloser.Close() + + return nil +} + +// Events returns a channel to read EventStream Events from the +// SelectObjectContent API. +// +// These events are: +// +// * ContinuationEvent +// * EndEvent +// * ProgressEvent +// * RecordsEvent +// * StatsEvent +func (es *SelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { + return es.Reader.Events() +} + +// SelectObjectContentEventStreamEvent groups together all EventStream +// events read from the SelectObjectContent API. +// +// These events are: +// +// * ContinuationEvent +// * EndEvent +// * ProgressEvent +// * RecordsEvent +// * StatsEvent +type SelectObjectContentEventStreamEvent interface { + eventSelectObjectContentEventStream() +} + +// SelectObjectContentEventStreamReader provides the interface for reading EventStream +// Events from the SelectObjectContent API. The +// default implementation for this interface will be SelectObjectContentEventStream. +// +// The reader's Close method must allow multiple concurrent calls. +// +// These events are: +// +// * ContinuationEvent +// * EndEvent +// * ProgressEvent +// * RecordsEvent +// * StatsEvent +type SelectObjectContentEventStreamReader interface { + // Returns a channel of events as they are read from the event stream. + Events() <-chan SelectObjectContentEventStreamEvent + + // Close will close the underlying event stream reader. For event stream over + // HTTP this will also close the HTTP connection. + Close() error + + // Returns any error that has occured while reading from the event stream. + Err() error +} + +type readSelectObjectContentEventStream struct { + eventReader *eventstreamapi.EventReader + stream chan SelectObjectContentEventStreamEvent + errVal atomic.Value + + done chan struct{} + closeOnce sync.Once +} + +func newReadSelectObjectContentEventStream( + reader io.ReadCloser, + unmarshalers request.HandlerList, + logger aws.Logger, + logLevel aws.LogLevelType, +) *readSelectObjectContentEventStream { + r := &readSelectObjectContentEventStream{ + stream: make(chan SelectObjectContentEventStreamEvent), + done: make(chan struct{}), + } + + r.eventReader = eventstreamapi.NewEventReader( + reader, + protocol.HandlerPayloadUnmarshal{ + Unmarshalers: unmarshalers, + }, + r.unmarshalerForEventType, + ) + r.eventReader.UseLogger(logger, logLevel) + + return r +} + +// Close will close the underlying event stream reader. For EventStream over +// HTTP this will also close the HTTP connection. +func (r *readSelectObjectContentEventStream) Close() error { + r.closeOnce.Do(r.safeClose) + + return r.Err() +} + +func (r *readSelectObjectContentEventStream) safeClose() { + close(r.done) + err := r.eventReader.Close() + if err != nil { + r.errVal.Store(err) + } +} + +func (r *readSelectObjectContentEventStream) Err() error { + if v := r.errVal.Load(); v != nil { + return v.(error) + } + + return nil +} + +func (r *readSelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { + return r.stream +} + +func (r *readSelectObjectContentEventStream) readEventStream() { + defer close(r.stream) + + for { + event, err := r.eventReader.ReadEvent() + if err != nil { + if err == io.EOF { + return + } + select { + case <-r.done: + // If closed already ignore the error + return + default: + } + r.errVal.Store(err) + return + } + + select { + case r.stream <- event.(SelectObjectContentEventStreamEvent): + case <-r.done: + return + } + } +} + +func (r *readSelectObjectContentEventStream) unmarshalerForEventType( + eventType string, +) (eventstreamapi.Unmarshaler, error) { + switch eventType { + case "Cont": + return &ContinuationEvent{}, nil + + case "End": + return &EndEvent{}, nil + + case "Progress": + return &ProgressEvent{}, nil + + case "Records": + return &RecordsEvent{}, nil + + case "Stats": + return &StatsEvent{}, nil + default: + return nil, awserr.New( + request.ErrCodeSerialization, + fmt.Sprintf("unknown event type name, %s, for SelectObjectContentEventStream", eventType), + nil, + ) + } +} + +// Request to filter the contents of an Amazon S3 object based on a simple Structured +// Query Language (SQL) statement. In the request, along with the SQL expression, +// you must also specify a data serialization format (JSON or CSV) of the object. +// Amazon S3 uses this to parse object data into records, and returns only records +// that match the specified SQL expression. You must also specify the data serialization +// format for the response. For more information, go to S3Select API Documentation +// (http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html). +type SelectObjectContentInput struct { + _ struct{} `locationName:"SelectObjectContentRequest" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // The S3 Bucket. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The expression that is used to query the object. + // + // Expression is a required field + Expression *string `type:"string" required:"true"` + + // The type of the provided expression (e.g., SQL). + // + // ExpressionType is a required field + ExpressionType *string `type:"string" required:"true" enum:"ExpressionType"` + + // Describes the format of the data in the object that is being queried. + // + // InputSerialization is a required field + InputSerialization *InputSerialization `type:"structure" required:"true"` + + // The Object Key. + // + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Describes the format of the data that you want Amazon S3 to return in response. + // + // OutputSerialization is a required field + OutputSerialization *OutputSerialization `type:"structure" required:"true"` + + // Specifies if periodic request progress information should be enabled. + RequestProgress *RequestProgress `type:"structure"` + + // The SSE Algorithm used to encrypt the object. For more information, go to + // Server-Side Encryption (Using Customer-Provided Encryption Keys (http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // The SSE Customer Key. For more information, go to Server-Side Encryption + // (Using Customer-Provided Encryption Keys (http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // The SSE Customer Key MD5. For more information, go to Server-Side Encryption + // (Using Customer-Provided Encryption Keys (http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` +} + +// String returns the string representation +func (s SelectObjectContentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SelectObjectContentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SelectObjectContentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SelectObjectContentInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Expression == nil { + invalidParams.Add(request.NewErrParamRequired("Expression")) + } + if s.ExpressionType == nil { + invalidParams.Add(request.NewErrParamRequired("ExpressionType")) + } + if s.InputSerialization == nil { + invalidParams.Add(request.NewErrParamRequired("InputSerialization")) + } + 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.OutputSerialization == nil { + invalidParams.Add(request.NewErrParamRequired("OutputSerialization")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *SelectObjectContentInput) SetBucket(v string) *SelectObjectContentInput { + s.Bucket = &v + return s +} + +func (s *SelectObjectContentInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetExpression sets the Expression field's value. +func (s *SelectObjectContentInput) SetExpression(v string) *SelectObjectContentInput { + s.Expression = &v + return s +} + +// SetExpressionType sets the ExpressionType field's value. +func (s *SelectObjectContentInput) SetExpressionType(v string) *SelectObjectContentInput { + s.ExpressionType = &v + return s +} + +// SetInputSerialization sets the InputSerialization field's value. +func (s *SelectObjectContentInput) SetInputSerialization(v *InputSerialization) *SelectObjectContentInput { + s.InputSerialization = v + return s +} + +// SetKey sets the Key field's value. +func (s *SelectObjectContentInput) SetKey(v string) *SelectObjectContentInput { + s.Key = &v + return s +} + +// SetOutputSerialization sets the OutputSerialization field's value. +func (s *SelectObjectContentInput) SetOutputSerialization(v *OutputSerialization) *SelectObjectContentInput { + s.OutputSerialization = v + return s +} + +// SetRequestProgress sets the RequestProgress field's value. +func (s *SelectObjectContentInput) SetRequestProgress(v *RequestProgress) *SelectObjectContentInput { + s.RequestProgress = v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *SelectObjectContentInput) SetSSECustomerAlgorithm(v string) *SelectObjectContentInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *SelectObjectContentInput) SetSSECustomerKey(v string) *SelectObjectContentInput { + s.SSECustomerKey = &v + return s +} + +func (s *SelectObjectContentInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *SelectObjectContentInput) SetSSECustomerKeyMD5(v string) *SelectObjectContentInput { + s.SSECustomerKeyMD5 = &v + return s +} + +type SelectObjectContentOutput struct { + _ struct{} `type:"structure" payload:"Payload"` + + // Use EventStream to use the API's stream. + EventStream *SelectObjectContentEventStream `type:"structure"` +} + +// String returns the string representation +func (s SelectObjectContentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SelectObjectContentOutput) GoString() string { + return s.String() +} + +// SetEventStream sets the EventStream field's value. +func (s *SelectObjectContentOutput) SetEventStream(v *SelectObjectContentEventStream) *SelectObjectContentOutput { + s.EventStream = v + return s +} + +func (s *SelectObjectContentOutput) runEventStreamLoop(r *request.Request) { + if r.Error != nil { + return + } + reader := newReadSelectObjectContentEventStream( + r.HTTPResponse.Body, + r.Handlers.UnmarshalStream, + r.Config.Logger, + r.Config.LogLevel.Value(), + ) + go reader.readEventStream() + + eventStream := &SelectObjectContentEventStream{ + StreamCloser: r.HTTPResponse.Body, + Reader: reader, + } + s.EventStream = eventStream +} + +// Describes the parameters for Select job types. +type SelectParameters struct { + _ struct{} `type:"structure"` + + // The expression that is used to query the object. + // + // Expression is a required field + Expression *string `type:"string" required:"true"` + + // The type of the provided expression (e.g., SQL). + // + // ExpressionType is a required field + ExpressionType *string `type:"string" required:"true" enum:"ExpressionType"` + + // Describes the serialization format of the object. + // + // InputSerialization is a required field + InputSerialization *InputSerialization `type:"structure" required:"true"` + + // Describes how the results of the Select job are serialized. + // + // OutputSerialization is a required field + OutputSerialization *OutputSerialization `type:"structure" required:"true"` +} + +// String returns the string representation +func (s SelectParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SelectParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SelectParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SelectParameters"} + if s.Expression == nil { + invalidParams.Add(request.NewErrParamRequired("Expression")) + } + if s.ExpressionType == nil { + invalidParams.Add(request.NewErrParamRequired("ExpressionType")) + } + if s.InputSerialization == nil { + invalidParams.Add(request.NewErrParamRequired("InputSerialization")) + } + if s.OutputSerialization == nil { + invalidParams.Add(request.NewErrParamRequired("OutputSerialization")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExpression sets the Expression field's value. +func (s *SelectParameters) SetExpression(v string) *SelectParameters { + s.Expression = &v + return s +} + +// SetExpressionType sets the ExpressionType field's value. +func (s *SelectParameters) SetExpressionType(v string) *SelectParameters { + s.ExpressionType = &v + return s +} + +// SetInputSerialization sets the InputSerialization field's value. +func (s *SelectParameters) SetInputSerialization(v *InputSerialization) *SelectParameters { + s.InputSerialization = v + return s +} + +// SetOutputSerialization sets the OutputSerialization field's value. +func (s *SelectParameters) SetOutputSerialization(v *OutputSerialization) *SelectParameters { + s.OutputSerialization = v + return s +} + +// Describes the default server-side encryption to apply to new objects in the +// bucket. If Put Object request does not specify any server-side encryption, +// this default encryption will be applied. +type ServerSideEncryptionByDefault struct { + _ struct{} `type:"structure"` + + // KMS master key ID to use for the default encryption. This parameter is allowed + // if SSEAlgorithm is aws:kms. + KMSMasterKeyID *string `type:"string"` + + // Server-side encryption algorithm to use for the default encryption. + // + // SSEAlgorithm is a required field + SSEAlgorithm *string `type:"string" required:"true" enum:"ServerSideEncryption"` +} + +// String returns the string representation +func (s ServerSideEncryptionByDefault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerSideEncryptionByDefault) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ServerSideEncryptionByDefault) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionByDefault"} + if s.SSEAlgorithm == nil { + invalidParams.Add(request.NewErrParamRequired("SSEAlgorithm")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKMSMasterKeyID sets the KMSMasterKeyID field's value. +func (s *ServerSideEncryptionByDefault) SetKMSMasterKeyID(v string) *ServerSideEncryptionByDefault { + s.KMSMasterKeyID = &v + return s +} + +// SetSSEAlgorithm sets the SSEAlgorithm field's value. +func (s *ServerSideEncryptionByDefault) SetSSEAlgorithm(v string) *ServerSideEncryptionByDefault { + s.SSEAlgorithm = &v + return s +} + +// Container for server-side encryption configuration rules. Currently S3 supports +// one rule only. +type ServerSideEncryptionConfiguration struct { + _ struct{} `type:"structure"` + + // Container for information about a particular server-side encryption configuration + // rule. + // + // Rules is a required field + Rules []*ServerSideEncryptionRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s ServerSideEncryptionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerSideEncryptionConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ServerSideEncryptionConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionConfiguration"} + if s.Rules == nil { + invalidParams.Add(request.NewErrParamRequired("Rules")) + } + if s.Rules != nil { + for i, v := range s.Rules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRules sets the Rules field's value. +func (s *ServerSideEncryptionConfiguration) SetRules(v []*ServerSideEncryptionRule) *ServerSideEncryptionConfiguration { + s.Rules = v + return s +} + +// Container for information about a particular server-side encryption configuration +// rule. +type ServerSideEncryptionRule struct { + _ struct{} `type:"structure"` + + // Describes the default server-side encryption to apply to new objects in the + // bucket. If Put Object request does not specify any server-side encryption, + // this default encryption will be applied. + ApplyServerSideEncryptionByDefault *ServerSideEncryptionByDefault `type:"structure"` +} + +// String returns the string representation +func (s ServerSideEncryptionRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerSideEncryptionRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ServerSideEncryptionRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionRule"} + if s.ApplyServerSideEncryptionByDefault != nil { + if err := s.ApplyServerSideEncryptionByDefault.Validate(); err != nil { + invalidParams.AddNested("ApplyServerSideEncryptionByDefault", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplyServerSideEncryptionByDefault sets the ApplyServerSideEncryptionByDefault field's value. +func (s *ServerSideEncryptionRule) SetApplyServerSideEncryptionByDefault(v *ServerSideEncryptionByDefault) *ServerSideEncryptionRule { + s.ApplyServerSideEncryptionByDefault = v + return s +} + +// Container for filters that define which source objects should be replicated. +type SourceSelectionCriteria struct { + _ struct{} `type:"structure"` + + // Container for filter information of selection of KMS Encrypted S3 objects. + // The element is required if you include SourceSelectionCriteria in the replication + // configuration. + SseKmsEncryptedObjects *SseKmsEncryptedObjects `type:"structure"` +} + +// String returns the string representation +func (s SourceSelectionCriteria) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SourceSelectionCriteria) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SourceSelectionCriteria) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SourceSelectionCriteria"} + if s.SseKmsEncryptedObjects != nil { + if err := s.SseKmsEncryptedObjects.Validate(); err != nil { + invalidParams.AddNested("SseKmsEncryptedObjects", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSseKmsEncryptedObjects sets the SseKmsEncryptedObjects field's value. +func (s *SourceSelectionCriteria) SetSseKmsEncryptedObjects(v *SseKmsEncryptedObjects) *SourceSelectionCriteria { + s.SseKmsEncryptedObjects = v + return s +} + +// Container for filter information of selection of KMS Encrypted S3 objects. +type SseKmsEncryptedObjects struct { + _ struct{} `type:"structure"` + + // The replication for KMS encrypted S3 objects is disabled if status is not + // Enabled. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"SseKmsEncryptedObjectsStatus"` +} + +// String returns the string representation +func (s SseKmsEncryptedObjects) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SseKmsEncryptedObjects) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SseKmsEncryptedObjects) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SseKmsEncryptedObjects"} + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStatus sets the Status field's value. +func (s *SseKmsEncryptedObjects) SetStatus(v string) *SseKmsEncryptedObjects { + s.Status = &v + return s +} + +type Stats struct { + _ struct{} `type:"structure"` + + // Total number of uncompressed object bytes processed. + BytesProcessed *int64 `type:"long"` + + // Total number of bytes of records payload data returned. + BytesReturned *int64 `type:"long"` + + // Total number of object bytes scanned. + BytesScanned *int64 `type:"long"` +} + +// String returns the string representation +func (s Stats) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Stats) GoString() string { + return s.String() +} + +// SetBytesProcessed sets the BytesProcessed field's value. +func (s *Stats) SetBytesProcessed(v int64) *Stats { + s.BytesProcessed = &v + return s +} + +// SetBytesReturned sets the BytesReturned field's value. +func (s *Stats) SetBytesReturned(v int64) *Stats { + s.BytesReturned = &v + return s +} + +// SetBytesScanned sets the BytesScanned field's value. +func (s *Stats) SetBytesScanned(v int64) *Stats { + s.BytesScanned = &v + return s +} + +type StatsEvent struct { + _ struct{} `locationName:"StatsEvent" type:"structure" payload:"Details"` + + // The Stats event details. + Details *Stats `locationName:"Details" type:"structure"` +} + +// String returns the string representation +func (s StatsEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StatsEvent) GoString() string { + return s.String() +} + +// SetDetails sets the Details field's value. +func (s *StatsEvent) SetDetails(v *Stats) *StatsEvent { + s.Details = v + return s +} + +// The StatsEvent is and event in the SelectObjectContentEventStream group of events. +func (s *StatsEvent) eventSelectObjectContentEventStream() {} + +// UnmarshalEvent unmarshals the EventStream Message into the StatsEvent value. +// This method is only used internally within the SDK's EventStream handling. +func (s *StatsEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + if err := payloadUnmarshaler.UnmarshalPayload( + bytes.NewReader(msg.Payload), s, + ); err != nil { + return err + } + return nil +} + +type StorageClassAnalysis struct { + _ struct{} `type:"structure"` + + // A container used to describe how data related to the storage class analysis + // should be exported. + DataExport *StorageClassAnalysisDataExport `type:"structure"` +} + +// String returns the string representation +func (s StorageClassAnalysis) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StorageClassAnalysis) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StorageClassAnalysis) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysis"} + if s.DataExport != nil { + if err := s.DataExport.Validate(); err != nil { + invalidParams.AddNested("DataExport", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataExport sets the DataExport field's value. +func (s *StorageClassAnalysis) SetDataExport(v *StorageClassAnalysisDataExport) *StorageClassAnalysis { + s.DataExport = v + return s +} + +type StorageClassAnalysisDataExport struct { + _ struct{} `type:"structure"` + + // The place to store the data for an analysis. + // + // Destination is a required field + Destination *AnalyticsExportDestination `type:"structure" required:"true"` + + // The version of the output schema to use when exporting data. Must be V_1. + // + // OutputSchemaVersion is a required field + OutputSchemaVersion *string `type:"string" required:"true" enum:"StorageClassAnalysisSchemaVersion"` +} + +// String returns the string representation +func (s StorageClassAnalysisDataExport) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StorageClassAnalysisDataExport) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StorageClassAnalysisDataExport) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysisDataExport"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.OutputSchemaVersion == nil { + invalidParams.Add(request.NewErrParamRequired("OutputSchemaVersion")) + } + if s.Destination != nil { + if err := s.Destination.Validate(); err != nil { + invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestination sets the Destination field's value. +func (s *StorageClassAnalysisDataExport) SetDestination(v *AnalyticsExportDestination) *StorageClassAnalysisDataExport { + s.Destination = v + return s +} + +// SetOutputSchemaVersion sets the OutputSchemaVersion field's value. +func (s *StorageClassAnalysisDataExport) SetOutputSchemaVersion(v string) *StorageClassAnalysisDataExport { + s.OutputSchemaVersion = &v + return s +} + +type Tag struct { + _ struct{} `type:"structure"` + + // Name of the tag. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // Value of the tag. + // + // 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 Tagging struct { + _ struct{} `type:"structure"` + + // TagSet is a required field + TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` +} + +// String returns the string representation +func (s Tagging) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tagging) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tagging) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tagging"} + if s.TagSet == nil { + invalidParams.Add(request.NewErrParamRequired("TagSet")) + } + if s.TagSet != nil { + for i, v := range s.TagSet { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagSet", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTagSet sets the TagSet field's value. +func (s *Tagging) SetTagSet(v []*Tag) *Tagging { + s.TagSet = v + return s +} + +type TargetGrant struct { + _ struct{} `type:"structure"` + + Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` + + // Logging permissions assigned to the Grantee for the bucket. + Permission *string `type:"string" enum:"BucketLogsPermission"` +} + +// String returns the string representation +func (s TargetGrant) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetGrant) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TargetGrant) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TargetGrant"} + if s.Grantee != nil { + if err := s.Grantee.Validate(); err != nil { + invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGrantee sets the Grantee field's value. +func (s *TargetGrant) SetGrantee(v *Grantee) *TargetGrant { + s.Grantee = v + return s +} + +// SetPermission sets the Permission field's value. +func (s *TargetGrant) SetPermission(v string) *TargetGrant { + s.Permission = &v + return s +} + +// Container for specifying the configuration when you want Amazon S3 to publish +// events to an Amazon Simple Notification Service (Amazon SNS) topic. +type TopicConfiguration struct { + _ struct{} `type:"structure"` + + // Events is a required field + Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` + + // Container for object key name filtering rules. For information about key + // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // in the Amazon Simple Storage Service Developer Guide. + Filter *NotificationConfigurationFilter `type:"structure"` + + // Optional unique identifier for configurations in a notification configuration. + // If you don't provide one, Amazon S3 will assign an ID. + Id *string `type:"string"` + + // Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects + // events of specified type. + // + // TopicArn is a required field + TopicArn *string `locationName:"Topic" type:"string" required:"true"` +} + +// String returns the string representation +func (s TopicConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TopicConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TopicConfiguration"} + if s.Events == nil { + invalidParams.Add(request.NewErrParamRequired("Events")) + } + if s.TopicArn == nil { + invalidParams.Add(request.NewErrParamRequired("TopicArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEvents sets the Events field's value. +func (s *TopicConfiguration) SetEvents(v []*string) *TopicConfiguration { + s.Events = v + return s +} + +// SetFilter sets the Filter field's value. +func (s *TopicConfiguration) SetFilter(v *NotificationConfigurationFilter) *TopicConfiguration { + s.Filter = v + return s +} + +// SetId sets the Id field's value. +func (s *TopicConfiguration) SetId(v string) *TopicConfiguration { + s.Id = &v + return s +} + +// SetTopicArn sets the TopicArn field's value. +func (s *TopicConfiguration) SetTopicArn(v string) *TopicConfiguration { + s.TopicArn = &v + return s +} + +type TopicConfigurationDeprecated struct { + _ struct{} `type:"structure"` + + // Bucket event for which to send notifications. + // + // Deprecated: Event has been deprecated + Event *string `deprecated:"true" type:"string" enum:"Event"` + + Events []*string `locationName:"Event" type:"list" flattened:"true"` + + // Optional unique identifier for configurations in a notification configuration. + // If you don't provide one, Amazon S3 will assign an ID. + Id *string `type:"string"` + + // Amazon SNS topic to which Amazon S3 will publish a message to report the + // specified events for the bucket. + Topic *string `type:"string"` +} + +// String returns the string representation +func (s TopicConfigurationDeprecated) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicConfigurationDeprecated) GoString() string { + return s.String() +} + +// SetEvent sets the Event field's value. +func (s *TopicConfigurationDeprecated) SetEvent(v string) *TopicConfigurationDeprecated { + s.Event = &v + return s +} + +// SetEvents sets the Events field's value. +func (s *TopicConfigurationDeprecated) SetEvents(v []*string) *TopicConfigurationDeprecated { + s.Events = v + return s +} + +// SetId sets the Id field's value. +func (s *TopicConfigurationDeprecated) SetId(v string) *TopicConfigurationDeprecated { + s.Id = &v + return s +} + +// SetTopic sets the Topic field's value. +func (s *TopicConfigurationDeprecated) SetTopic(v string) *TopicConfigurationDeprecated { + s.Topic = &v + return s +} + +type Transition struct { + _ struct{} `type:"structure"` + + // Indicates at what date the object is to be moved or deleted. Should be in + // GMT ISO 8601 Format. + Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // Indicates the lifetime, in days, of the objects that are subject to the rule. + // The value must be a non-zero positive integer. + Days *int64 `type:"integer"` + + // The class of storage used to store the object. + StorageClass *string `type:"string" enum:"TransitionStorageClass"` +} + +// String returns the string representation +func (s Transition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Transition) GoString() string { + return s.String() +} + +// SetDate sets the Date field's value. +func (s *Transition) SetDate(v time.Time) *Transition { + s.Date = &v + return s +} + +// SetDays sets the Days field's value. +func (s *Transition) SetDays(v int64) *Transition { + s.Days = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *Transition) SetStorageClass(v string) *Transition { + s.StorageClass = &v + return s +} + +type UploadPartCopyInput struct { + _ struct{} `type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The name of the source bucket and key name of the source object, separated + // by a slash (/). Must be URL-encoded. + // + // CopySource is a required field + CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` + + // Copies the object if its entity tag (ETag) matches the specified tag. + CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` + + // Copies the object if it has been modified since the specified time. + CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp"` + + // Copies the object if its entity tag (ETag) is different than the specified + // ETag. + CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` + + // Copies the object if it hasn't been modified since the specified time. + CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp"` + + // The range of bytes to copy from the source object. The range value must use + // the form bytes=first-last, where the first and last are the zero-based byte + // offsets to copy. For example, bytes=0-9 indicates that you want to copy the + // first ten bytes of the source. You can copy a range only if the source object + // is greater than 5 GB. + CopySourceRange *string `location:"header" locationName:"x-amz-copy-source-range" type:"string"` + + // Specifies the algorithm to use when decrypting the source object (e.g., AES256). + CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt + // the source object. The encryption key provided in this header must be one + // that was used when the source object was created. + CopySourceSSECustomerKey *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` + + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Part number of part being copied. This is a positive integer between 1 and + // 10,000. + // + // PartNumber is a required field + PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. This must be the same encryption key specified in the initiate multipart + // upload request. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Upload ID identifying the multipart upload whose part is being copied. + // + // UploadId is a required field + UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UploadPartCopyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadPartCopyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UploadPartCopyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UploadPartCopyInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.CopySource == nil { + invalidParams.Add(request.NewErrParamRequired("CopySource")) + } + 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.PartNumber == nil { + invalidParams.Add(request.NewErrParamRequired("PartNumber")) + } + if s.UploadId == nil { + invalidParams.Add(request.NewErrParamRequired("UploadId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *UploadPartCopyInput) SetBucket(v string) *UploadPartCopyInput { + s.Bucket = &v + return s +} + +func (s *UploadPartCopyInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetCopySource sets the CopySource field's value. +func (s *UploadPartCopyInput) SetCopySource(v string) *UploadPartCopyInput { + s.CopySource = &v + return s +} + +// SetCopySourceIfMatch sets the CopySourceIfMatch field's value. +func (s *UploadPartCopyInput) SetCopySourceIfMatch(v string) *UploadPartCopyInput { + s.CopySourceIfMatch = &v + return s +} + +// SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. +func (s *UploadPartCopyInput) SetCopySourceIfModifiedSince(v time.Time) *UploadPartCopyInput { + s.CopySourceIfModifiedSince = &v + return s +} + +// SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. +func (s *UploadPartCopyInput) SetCopySourceIfNoneMatch(v string) *UploadPartCopyInput { + s.CopySourceIfNoneMatch = &v + return s +} + +// SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. +func (s *UploadPartCopyInput) SetCopySourceIfUnmodifiedSince(v time.Time) *UploadPartCopyInput { + s.CopySourceIfUnmodifiedSince = &v + return s +} + +// SetCopySourceRange sets the CopySourceRange field's value. +func (s *UploadPartCopyInput) SetCopySourceRange(v string) *UploadPartCopyInput { + s.CopySourceRange = &v + return s +} + +// SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. +func (s *UploadPartCopyInput) SetCopySourceSSECustomerAlgorithm(v string) *UploadPartCopyInput { + s.CopySourceSSECustomerAlgorithm = &v + return s +} + +// SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. +func (s *UploadPartCopyInput) SetCopySourceSSECustomerKey(v string) *UploadPartCopyInput { + s.CopySourceSSECustomerKey = &v + return s +} + +func (s *UploadPartCopyInput) getCopySourceSSECustomerKey() (v string) { + if s.CopySourceSSECustomerKey == nil { + return v + } + return *s.CopySourceSSECustomerKey +} + +// SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. +func (s *UploadPartCopyInput) SetCopySourceSSECustomerKeyMD5(v string) *UploadPartCopyInput { + s.CopySourceSSECustomerKeyMD5 = &v + return s +} + +// SetKey sets the Key field's value. +func (s *UploadPartCopyInput) SetKey(v string) *UploadPartCopyInput { + s.Key = &v + return s +} + +// SetPartNumber sets the PartNumber field's value. +func (s *UploadPartCopyInput) SetPartNumber(v int64) *UploadPartCopyInput { + s.PartNumber = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *UploadPartCopyInput) SetRequestPayer(v string) *UploadPartCopyInput { + s.RequestPayer = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *UploadPartCopyInput) SetSSECustomerAlgorithm(v string) *UploadPartCopyInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *UploadPartCopyInput) SetSSECustomerKey(v string) *UploadPartCopyInput { + s.SSECustomerKey = &v + return s +} + +func (s *UploadPartCopyInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *UploadPartCopyInput) SetSSECustomerKeyMD5(v string) *UploadPartCopyInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *UploadPartCopyInput) SetUploadId(v string) *UploadPartCopyInput { + s.UploadId = &v + return s +} + +type UploadPartCopyOutput struct { + _ struct{} `type:"structure" payload:"CopyPartResult"` + + CopyPartResult *CopyPartResult `type:"structure"` + + // The version of the source object that was copied, if you have enabled versioning + // on the source bucket. + CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` +} + +// String returns the string representation +func (s UploadPartCopyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadPartCopyOutput) GoString() string { + return s.String() +} + +// SetCopyPartResult sets the CopyPartResult field's value. +func (s *UploadPartCopyOutput) SetCopyPartResult(v *CopyPartResult) *UploadPartCopyOutput { + s.CopyPartResult = v + return s +} + +// SetCopySourceVersionId sets the CopySourceVersionId field's value. +func (s *UploadPartCopyOutput) SetCopySourceVersionId(v string) *UploadPartCopyOutput { + s.CopySourceVersionId = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *UploadPartCopyOutput) SetRequestCharged(v string) *UploadPartCopyOutput { + s.RequestCharged = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *UploadPartCopyOutput) SetSSECustomerAlgorithm(v string) *UploadPartCopyOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *UploadPartCopyOutput) SetSSECustomerKeyMD5(v string) *UploadPartCopyOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *UploadPartCopyOutput) SetSSEKMSKeyId(v string) *UploadPartCopyOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *UploadPartCopyOutput) SetServerSideEncryption(v string) *UploadPartCopyOutput { + s.ServerSideEncryption = &v + return s +} + +type UploadPartInput struct { + _ struct{} `type:"structure" payload:"Body"` + + // Object data. + Body io.ReadSeeker `type:"blob"` + + // Name of the bucket to which the multipart upload was initiated. + // + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Size of the body in bytes. This parameter is useful when the size of the + // body cannot be determined automatically. + ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` + + // The base64-encoded 128-bit MD5 digest of the part data. + ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` + + // Object key for which the multipart upload was initiated. + // + // Key is a required field + Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + + // Part number of part being uploaded. This is a positive integer between 1 + // and 10,000. + // + // PartNumber is a required field + PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. This must be the same encryption key specified in the initiate multipart + // upload request. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Upload ID identifying the multipart upload whose part is being uploaded. + // + // UploadId is a required field + UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UploadPartInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadPartInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UploadPartInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UploadPartInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + 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.PartNumber == nil { + invalidParams.Add(request.NewErrParamRequired("PartNumber")) + } + if s.UploadId == nil { + invalidParams.Add(request.NewErrParamRequired("UploadId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBody sets the Body field's value. +func (s *UploadPartInput) SetBody(v io.ReadSeeker) *UploadPartInput { + s.Body = v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *UploadPartInput) SetBucket(v string) *UploadPartInput { + s.Bucket = &v + return s +} + +func (s *UploadPartInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContentLength sets the ContentLength field's value. +func (s *UploadPartInput) SetContentLength(v int64) *UploadPartInput { + s.ContentLength = &v + return s +} + +// SetContentMD5 sets the ContentMD5 field's value. +func (s *UploadPartInput) SetContentMD5(v string) *UploadPartInput { + s.ContentMD5 = &v + return s +} + +// SetKey sets the Key field's value. +func (s *UploadPartInput) SetKey(v string) *UploadPartInput { + s.Key = &v + return s +} + +// SetPartNumber sets the PartNumber field's value. +func (s *UploadPartInput) SetPartNumber(v int64) *UploadPartInput { + s.PartNumber = &v + return s +} + +// SetRequestPayer sets the RequestPayer field's value. +func (s *UploadPartInput) SetRequestPayer(v string) *UploadPartInput { + s.RequestPayer = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *UploadPartInput) SetSSECustomerAlgorithm(v string) *UploadPartInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKey sets the SSECustomerKey field's value. +func (s *UploadPartInput) SetSSECustomerKey(v string) *UploadPartInput { + s.SSECustomerKey = &v + return s +} + +func (s *UploadPartInput) getSSECustomerKey() (v string) { + if s.SSECustomerKey == nil { + return v + } + return *s.SSECustomerKey +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *UploadPartInput) SetSSECustomerKeyMD5(v string) *UploadPartInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetUploadId sets the UploadId field's value. +func (s *UploadPartInput) SetUploadId(v string) *UploadPartInput { + s.UploadId = &v + return s +} + +type UploadPartOutput struct { + _ struct{} `type:"structure"` + + // Entity tag for the uploaded object. + ETag *string `location:"header" locationName:"ETag" type:"string"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header confirming the encryption algorithm + // used. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // If server-side encryption with a customer-provided encryption key was requested, + // the response will include this header to provide round trip message integrity + // verification of the customer-provided encryption key. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (KMS) master + // encryption key that was used for the object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` +} + +// String returns the string representation +func (s UploadPartOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadPartOutput) GoString() string { + return s.String() +} + +// SetETag sets the ETag field's value. +func (s *UploadPartOutput) SetETag(v string) *UploadPartOutput { + s.ETag = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *UploadPartOutput) SetRequestCharged(v string) *UploadPartOutput { + s.RequestCharged = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *UploadPartOutput) SetSSECustomerAlgorithm(v string) *UploadPartOutput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *UploadPartOutput) SetSSECustomerKeyMD5(v string) *UploadPartOutput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *UploadPartOutput) SetSSEKMSKeyId(v string) *UploadPartOutput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *UploadPartOutput) SetServerSideEncryption(v string) *UploadPartOutput { + s.ServerSideEncryption = &v + return s +} + +type VersioningConfiguration struct { + _ struct{} `type:"structure"` + + // Specifies whether MFA delete is enabled in the bucket versioning configuration. + // This element is only returned if the bucket has been configured with MFA + // delete. If the bucket has never been so configured, this element is not returned. + MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADelete"` + + // The versioning state of the bucket. + Status *string `type:"string" enum:"BucketVersioningStatus"` +} + +// String returns the string representation +func (s VersioningConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VersioningConfiguration) GoString() string { + return s.String() +} + +// SetMFADelete sets the MFADelete field's value. +func (s *VersioningConfiguration) SetMFADelete(v string) *VersioningConfiguration { + s.MFADelete = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *VersioningConfiguration) SetStatus(v string) *VersioningConfiguration { + s.Status = &v + return s +} + +type WebsiteConfiguration struct { + _ struct{} `type:"structure"` + + ErrorDocument *ErrorDocument `type:"structure"` + + IndexDocument *IndexDocument `type:"structure"` + + RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` + + RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` +} + +// String returns the string representation +func (s WebsiteConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WebsiteConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *WebsiteConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "WebsiteConfiguration"} + if s.ErrorDocument != nil { + if err := s.ErrorDocument.Validate(); err != nil { + invalidParams.AddNested("ErrorDocument", err.(request.ErrInvalidParams)) + } + } + if s.IndexDocument != nil { + if err := s.IndexDocument.Validate(); err != nil { + invalidParams.AddNested("IndexDocument", err.(request.ErrInvalidParams)) + } + } + if s.RedirectAllRequestsTo != nil { + if err := s.RedirectAllRequestsTo.Validate(); err != nil { + invalidParams.AddNested("RedirectAllRequestsTo", err.(request.ErrInvalidParams)) + } + } + if s.RoutingRules != nil { + for i, v := range s.RoutingRules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RoutingRules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetErrorDocument sets the ErrorDocument field's value. +func (s *WebsiteConfiguration) SetErrorDocument(v *ErrorDocument) *WebsiteConfiguration { + s.ErrorDocument = v + return s +} + +// SetIndexDocument sets the IndexDocument field's value. +func (s *WebsiteConfiguration) SetIndexDocument(v *IndexDocument) *WebsiteConfiguration { + s.IndexDocument = v + return s +} + +// SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. +func (s *WebsiteConfiguration) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *WebsiteConfiguration { + s.RedirectAllRequestsTo = v + return s +} + +// SetRoutingRules sets the RoutingRules field's value. +func (s *WebsiteConfiguration) SetRoutingRules(v []*RoutingRule) *WebsiteConfiguration { + s.RoutingRules = v + return s +} + +const ( + // AnalyticsS3ExportFileFormatCsv is a AnalyticsS3ExportFileFormat enum value + AnalyticsS3ExportFileFormatCsv = "CSV" +) + +const ( + // BucketAccelerateStatusEnabled is a BucketAccelerateStatus enum value + BucketAccelerateStatusEnabled = "Enabled" + + // BucketAccelerateStatusSuspended is a BucketAccelerateStatus enum value + BucketAccelerateStatusSuspended = "Suspended" +) + +const ( + // BucketCannedACLPrivate is a BucketCannedACL enum value + BucketCannedACLPrivate = "private" + + // BucketCannedACLPublicRead is a BucketCannedACL enum value + BucketCannedACLPublicRead = "public-read" + + // BucketCannedACLPublicReadWrite is a BucketCannedACL enum value + BucketCannedACLPublicReadWrite = "public-read-write" + + // BucketCannedACLAuthenticatedRead is a BucketCannedACL enum value + BucketCannedACLAuthenticatedRead = "authenticated-read" +) + +const ( + // BucketLocationConstraintEu is a BucketLocationConstraint enum value + BucketLocationConstraintEu = "EU" + + // BucketLocationConstraintEuWest1 is a BucketLocationConstraint enum value + BucketLocationConstraintEuWest1 = "eu-west-1" + + // BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value + BucketLocationConstraintUsWest1 = "us-west-1" + + // BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value + BucketLocationConstraintUsWest2 = "us-west-2" + + // BucketLocationConstraintApSouth1 is a BucketLocationConstraint enum value + BucketLocationConstraintApSouth1 = "ap-south-1" + + // BucketLocationConstraintApSoutheast1 is a BucketLocationConstraint enum value + BucketLocationConstraintApSoutheast1 = "ap-southeast-1" + + // BucketLocationConstraintApSoutheast2 is a BucketLocationConstraint enum value + BucketLocationConstraintApSoutheast2 = "ap-southeast-2" + + // BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value + BucketLocationConstraintApNortheast1 = "ap-northeast-1" + + // BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value + BucketLocationConstraintSaEast1 = "sa-east-1" + + // BucketLocationConstraintCnNorth1 is a BucketLocationConstraint enum value + BucketLocationConstraintCnNorth1 = "cn-north-1" + + // BucketLocationConstraintEuCentral1 is a BucketLocationConstraint enum value + BucketLocationConstraintEuCentral1 = "eu-central-1" +) + +const ( + // BucketLogsPermissionFullControl is a BucketLogsPermission enum value + BucketLogsPermissionFullControl = "FULL_CONTROL" + + // BucketLogsPermissionRead is a BucketLogsPermission enum value + BucketLogsPermissionRead = "READ" + + // BucketLogsPermissionWrite is a BucketLogsPermission enum value + BucketLogsPermissionWrite = "WRITE" +) + +const ( + // BucketVersioningStatusEnabled is a BucketVersioningStatus enum value + BucketVersioningStatusEnabled = "Enabled" + + // BucketVersioningStatusSuspended is a BucketVersioningStatus enum value + BucketVersioningStatusSuspended = "Suspended" +) + +const ( + // CompressionTypeNone is a CompressionType enum value + CompressionTypeNone = "NONE" + + // CompressionTypeGzip is a CompressionType enum value + CompressionTypeGzip = "GZIP" + + // CompressionTypeBzip2 is a CompressionType enum value + CompressionTypeBzip2 = "BZIP2" +) + +const ( + // DeleteMarkerReplicationStatusEnabled is a DeleteMarkerReplicationStatus enum value + DeleteMarkerReplicationStatusEnabled = "Enabled" + + // DeleteMarkerReplicationStatusDisabled is a DeleteMarkerReplicationStatus enum value + DeleteMarkerReplicationStatusDisabled = "Disabled" +) + +// Requests Amazon S3 to encode the object keys in the response and specifies +// the encoding method to use. An object key may contain any Unicode character; +// however, XML 1.0 parser cannot parse some characters, such as characters +// with an ASCII value from 0 to 10. For characters that are not supported in +// XML 1.0, you can add this parameter to request that Amazon S3 encode the +// keys in the response. +const ( + // EncodingTypeUrl is a EncodingType enum value + EncodingTypeUrl = "url" +) + +// Bucket event for which to send notifications. +const ( + // EventS3ReducedRedundancyLostObject is a Event enum value + EventS3ReducedRedundancyLostObject = "s3:ReducedRedundancyLostObject" + + // EventS3ObjectCreated is a Event enum value + EventS3ObjectCreated = "s3:ObjectCreated:*" + + // EventS3ObjectCreatedPut is a Event enum value + EventS3ObjectCreatedPut = "s3:ObjectCreated:Put" + + // EventS3ObjectCreatedPost is a Event enum value + EventS3ObjectCreatedPost = "s3:ObjectCreated:Post" + + // EventS3ObjectCreatedCopy is a Event enum value + EventS3ObjectCreatedCopy = "s3:ObjectCreated:Copy" + + // EventS3ObjectCreatedCompleteMultipartUpload is a Event enum value + EventS3ObjectCreatedCompleteMultipartUpload = "s3:ObjectCreated:CompleteMultipartUpload" + + // EventS3ObjectRemoved is a Event enum value + EventS3ObjectRemoved = "s3:ObjectRemoved:*" + + // EventS3ObjectRemovedDelete is a Event enum value + EventS3ObjectRemovedDelete = "s3:ObjectRemoved:Delete" + + // EventS3ObjectRemovedDeleteMarkerCreated is a Event enum value + EventS3ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated" +) + +const ( + // ExpirationStatusEnabled is a ExpirationStatus enum value + ExpirationStatusEnabled = "Enabled" + + // ExpirationStatusDisabled is a ExpirationStatus enum value + ExpirationStatusDisabled = "Disabled" +) + +const ( + // ExpressionTypeSql is a ExpressionType enum value + ExpressionTypeSql = "SQL" +) + +const ( + // FileHeaderInfoUse is a FileHeaderInfo enum value + FileHeaderInfoUse = "USE" + + // FileHeaderInfoIgnore is a FileHeaderInfo enum value + FileHeaderInfoIgnore = "IGNORE" + + // FileHeaderInfoNone is a FileHeaderInfo enum value + FileHeaderInfoNone = "NONE" +) + +const ( + // FilterRuleNamePrefix is a FilterRuleName enum value + FilterRuleNamePrefix = "prefix" + + // FilterRuleNameSuffix is a FilterRuleName enum value + FilterRuleNameSuffix = "suffix" +) + +const ( + // InventoryFormatCsv is a InventoryFormat enum value + InventoryFormatCsv = "CSV" + + // InventoryFormatOrc is a InventoryFormat enum value + InventoryFormatOrc = "ORC" +) + +const ( + // InventoryFrequencyDaily is a InventoryFrequency enum value + InventoryFrequencyDaily = "Daily" + + // InventoryFrequencyWeekly is a InventoryFrequency enum value + InventoryFrequencyWeekly = "Weekly" +) + +const ( + // InventoryIncludedObjectVersionsAll is a InventoryIncludedObjectVersions enum value + InventoryIncludedObjectVersionsAll = "All" + + // InventoryIncludedObjectVersionsCurrent is a InventoryIncludedObjectVersions enum value + InventoryIncludedObjectVersionsCurrent = "Current" +) + +const ( + // InventoryOptionalFieldSize is a InventoryOptionalField enum value + InventoryOptionalFieldSize = "Size" + + // InventoryOptionalFieldLastModifiedDate is a InventoryOptionalField enum value + InventoryOptionalFieldLastModifiedDate = "LastModifiedDate" + + // InventoryOptionalFieldStorageClass is a InventoryOptionalField enum value + InventoryOptionalFieldStorageClass = "StorageClass" + + // InventoryOptionalFieldEtag is a InventoryOptionalField enum value + InventoryOptionalFieldEtag = "ETag" + + // InventoryOptionalFieldIsMultipartUploaded is a InventoryOptionalField enum value + InventoryOptionalFieldIsMultipartUploaded = "IsMultipartUploaded" + + // InventoryOptionalFieldReplicationStatus is a InventoryOptionalField enum value + InventoryOptionalFieldReplicationStatus = "ReplicationStatus" + + // InventoryOptionalFieldEncryptionStatus is a InventoryOptionalField enum value + InventoryOptionalFieldEncryptionStatus = "EncryptionStatus" +) + +const ( + // JSONTypeDocument is a JSONType enum value + JSONTypeDocument = "DOCUMENT" + + // JSONTypeLines is a JSONType enum value + JSONTypeLines = "LINES" +) + +const ( + // MFADeleteEnabled is a MFADelete enum value + MFADeleteEnabled = "Enabled" + + // MFADeleteDisabled is a MFADelete enum value + MFADeleteDisabled = "Disabled" +) + +const ( + // MFADeleteStatusEnabled is a MFADeleteStatus enum value + MFADeleteStatusEnabled = "Enabled" + + // MFADeleteStatusDisabled is a MFADeleteStatus enum value + MFADeleteStatusDisabled = "Disabled" +) + +const ( + // MetadataDirectiveCopy is a MetadataDirective enum value + MetadataDirectiveCopy = "COPY" + + // MetadataDirectiveReplace is a MetadataDirective enum value + MetadataDirectiveReplace = "REPLACE" +) + +const ( + // ObjectCannedACLPrivate is a ObjectCannedACL enum value + ObjectCannedACLPrivate = "private" + + // ObjectCannedACLPublicRead is a ObjectCannedACL enum value + ObjectCannedACLPublicRead = "public-read" + + // ObjectCannedACLPublicReadWrite is a ObjectCannedACL enum value + ObjectCannedACLPublicReadWrite = "public-read-write" + + // ObjectCannedACLAuthenticatedRead is a ObjectCannedACL enum value + ObjectCannedACLAuthenticatedRead = "authenticated-read" + + // ObjectCannedACLAwsExecRead is a ObjectCannedACL enum value + ObjectCannedACLAwsExecRead = "aws-exec-read" + + // ObjectCannedACLBucketOwnerRead is a ObjectCannedACL enum value + ObjectCannedACLBucketOwnerRead = "bucket-owner-read" + + // ObjectCannedACLBucketOwnerFullControl is a ObjectCannedACL enum value + ObjectCannedACLBucketOwnerFullControl = "bucket-owner-full-control" +) + +const ( + // ObjectStorageClassStandard is a ObjectStorageClass enum value + ObjectStorageClassStandard = "STANDARD" + + // ObjectStorageClassReducedRedundancy is a ObjectStorageClass enum value + ObjectStorageClassReducedRedundancy = "REDUCED_REDUNDANCY" + + // ObjectStorageClassGlacier is a ObjectStorageClass enum value + ObjectStorageClassGlacier = "GLACIER" + + // ObjectStorageClassStandardIa is a ObjectStorageClass enum value + ObjectStorageClassStandardIa = "STANDARD_IA" + + // ObjectStorageClassOnezoneIa is a ObjectStorageClass enum value + ObjectStorageClassOnezoneIa = "ONEZONE_IA" +) + +const ( + // ObjectVersionStorageClassStandard is a ObjectVersionStorageClass enum value + ObjectVersionStorageClassStandard = "STANDARD" +) + +const ( + // OwnerOverrideDestination is a OwnerOverride enum value + OwnerOverrideDestination = "Destination" +) + +const ( + // PayerRequester is a Payer enum value + PayerRequester = "Requester" + + // PayerBucketOwner is a Payer enum value + PayerBucketOwner = "BucketOwner" +) + +const ( + // PermissionFullControl is a Permission enum value + PermissionFullControl = "FULL_CONTROL" + + // PermissionWrite is a Permission enum value + PermissionWrite = "WRITE" + + // PermissionWriteAcp is a Permission enum value + PermissionWriteAcp = "WRITE_ACP" + + // PermissionRead is a Permission enum value + PermissionRead = "READ" + + // PermissionReadAcp is a Permission enum value + PermissionReadAcp = "READ_ACP" +) + +const ( + // ProtocolHttp is a Protocol enum value + ProtocolHttp = "http" + + // ProtocolHttps is a Protocol enum value + ProtocolHttps = "https" +) + +const ( + // QuoteFieldsAlways is a QuoteFields enum value + QuoteFieldsAlways = "ALWAYS" + + // QuoteFieldsAsneeded is a QuoteFields enum value + QuoteFieldsAsneeded = "ASNEEDED" +) + +const ( + // ReplicationRuleStatusEnabled is a ReplicationRuleStatus enum value + ReplicationRuleStatusEnabled = "Enabled" + + // ReplicationRuleStatusDisabled is a ReplicationRuleStatus enum value + ReplicationRuleStatusDisabled = "Disabled" +) + +const ( + // ReplicationStatusComplete is a ReplicationStatus enum value + ReplicationStatusComplete = "COMPLETE" + + // ReplicationStatusPending is a ReplicationStatus enum value + ReplicationStatusPending = "PENDING" + + // ReplicationStatusFailed is a ReplicationStatus enum value + ReplicationStatusFailed = "FAILED" + + // ReplicationStatusReplica is a ReplicationStatus enum value + ReplicationStatusReplica = "REPLICA" +) + +// If present, indicates that the requester was successfully charged for the +// request. +const ( + // RequestChargedRequester is a RequestCharged enum value + RequestChargedRequester = "requester" +) + +// Confirms that the requester knows that she or he will be charged for the +// request. Bucket owners need not specify this parameter in their requests. +// Documentation on downloading objects from requester pays buckets can be found +// at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html +const ( + // RequestPayerRequester is a RequestPayer enum value + RequestPayerRequester = "requester" +) + +const ( + // RestoreRequestTypeSelect is a RestoreRequestType enum value + RestoreRequestTypeSelect = "SELECT" +) + +const ( + // ServerSideEncryptionAes256 is a ServerSideEncryption enum value + ServerSideEncryptionAes256 = "AES256" + + // ServerSideEncryptionAwsKms is a ServerSideEncryption enum value + ServerSideEncryptionAwsKms = "aws:kms" +) + +const ( + // SseKmsEncryptedObjectsStatusEnabled is a SseKmsEncryptedObjectsStatus enum value + SseKmsEncryptedObjectsStatusEnabled = "Enabled" + + // SseKmsEncryptedObjectsStatusDisabled is a SseKmsEncryptedObjectsStatus enum value + SseKmsEncryptedObjectsStatusDisabled = "Disabled" +) + +const ( + // StorageClassStandard is a StorageClass enum value + StorageClassStandard = "STANDARD" + + // StorageClassReducedRedundancy is a StorageClass enum value + StorageClassReducedRedundancy = "REDUCED_REDUNDANCY" + + // StorageClassStandardIa is a StorageClass enum value + StorageClassStandardIa = "STANDARD_IA" + + // StorageClassOnezoneIa is a StorageClass enum value + StorageClassOnezoneIa = "ONEZONE_IA" +) + +const ( + // StorageClassAnalysisSchemaVersionV1 is a StorageClassAnalysisSchemaVersion enum value + StorageClassAnalysisSchemaVersionV1 = "V_1" +) + +const ( + // TaggingDirectiveCopy is a TaggingDirective enum value + TaggingDirectiveCopy = "COPY" + + // TaggingDirectiveReplace is a TaggingDirective enum value + TaggingDirectiveReplace = "REPLACE" +) + +const ( + // TierStandard is a Tier enum value + TierStandard = "Standard" + + // TierBulk is a Tier enum value + TierBulk = "Bulk" + + // TierExpedited is a Tier enum value + TierExpedited = "Expedited" +) + +const ( + // TransitionStorageClassGlacier is a TransitionStorageClass enum value + TransitionStorageClassGlacier = "GLACIER" + + // TransitionStorageClassStandardIa is a TransitionStorageClass enum value + TransitionStorageClassStandardIa = "STANDARD_IA" + + // TransitionStorageClassOnezoneIa is a TransitionStorageClass enum value + TransitionStorageClassOnezoneIa = "ONEZONE_IA" +) + +const ( + // TypeCanonicalUser is a Type enum value + TypeCanonicalUser = "CanonicalUser" + + // TypeAmazonCustomerByEmail is a Type enum value + TypeAmazonCustomerByEmail = "AmazonCustomerByEmail" + + // TypeGroup is a Type enum value + TypeGroup = "Group" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go b/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go new file mode 100644 index 00000000000..5c8ce5cc8a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go @@ -0,0 +1,249 @@ +package s3 + +import ( + "bytes" + "crypto/md5" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "fmt" + "hash" + "io" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkio" +) + +const ( + contentMD5Header = "Content-Md5" + contentSha256Header = "X-Amz-Content-Sha256" + amzTeHeader = "X-Amz-Te" + amzTxEncodingHeader = "X-Amz-Transfer-Encoding" + + appendMD5TxEncoding = "append-md5" +) + +// contentMD5 computes and sets the HTTP Content-MD5 header for requests that +// require it. +func contentMD5(r *request.Request) { + h := md5.New() + + if !aws.IsReaderSeekable(r.Body) { + if r.Config.Logger != nil { + r.Config.Logger.Log(fmt.Sprintf( + "Unable to compute Content-MD5 for unseekable body, S3.%s", + r.Operation.Name)) + } + return + } + + if _, err := copySeekableBody(h, r.Body); err != nil { + r.Error = awserr.New("ContentMD5", "failed to compute body MD5", err) + return + } + + // encode the md5 checksum in base64 and set the request header. + v := base64.StdEncoding.EncodeToString(h.Sum(nil)) + r.HTTPRequest.Header.Set(contentMD5Header, v) +} + +// computeBodyHashes will add Content MD5 and Content Sha256 hashes to the +// request. If the body is not seekable or S3DisableContentMD5Validation set +// this handler will be ignored. +func computeBodyHashes(r *request.Request) { + if aws.BoolValue(r.Config.S3DisableContentMD5Validation) { + return + } + if r.IsPresigned() { + return + } + if r.Error != nil || !aws.IsReaderSeekable(r.Body) { + return + } + + var md5Hash, sha256Hash hash.Hash + hashers := make([]io.Writer, 0, 2) + + // Determine upfront which hashes can be set without overriding user + // provide header data. + if v := r.HTTPRequest.Header.Get(contentMD5Header); len(v) == 0 { + md5Hash = md5.New() + hashers = append(hashers, md5Hash) + } + + if v := r.HTTPRequest.Header.Get(contentSha256Header); len(v) == 0 { + sha256Hash = sha256.New() + hashers = append(hashers, sha256Hash) + } + + // Create the destination writer based on the hashes that are not already + // provided by the user. + var dst io.Writer + switch len(hashers) { + case 0: + return + case 1: + dst = hashers[0] + default: + dst = io.MultiWriter(hashers...) + } + + if _, err := copySeekableBody(dst, r.Body); err != nil { + r.Error = awserr.New("BodyHashError", "failed to compute body hashes", err) + return + } + + // For the hashes created, set the associated headers that the user did not + // already provide. + if md5Hash != nil { + sum := make([]byte, md5.Size) + encoded := make([]byte, md5Base64EncLen) + + base64.StdEncoding.Encode(encoded, md5Hash.Sum(sum[0:0])) + r.HTTPRequest.Header[contentMD5Header] = []string{string(encoded)} + } + + if sha256Hash != nil { + encoded := make([]byte, sha256HexEncLen) + sum := make([]byte, sha256.Size) + + hex.Encode(encoded, sha256Hash.Sum(sum[0:0])) + r.HTTPRequest.Header[contentSha256Header] = []string{string(encoded)} + } +} + +const ( + md5Base64EncLen = (md5.Size + 2) / 3 * 4 // base64.StdEncoding.EncodedLen + sha256HexEncLen = sha256.Size * 2 // hex.EncodedLen +) + +func copySeekableBody(dst io.Writer, src io.ReadSeeker) (int64, error) { + curPos, err := src.Seek(0, sdkio.SeekCurrent) + if err != nil { + return 0, err + } + + // hash the body. seek back to the first position after reading to reset + // the body for transmission. copy errors may be assumed to be from the + // body. + n, err := io.Copy(dst, src) + if err != nil { + return n, err + } + + _, err = src.Seek(curPos, sdkio.SeekStart) + if err != nil { + return n, err + } + + return n, nil +} + +// Adds the x-amz-te: append_md5 header to the request. This requests the service +// responds with a trailing MD5 checksum. +// +// Will not ask for append MD5 if disabled, the request is presigned or, +// or the API operation does not support content MD5 validation. +func askForTxEncodingAppendMD5(r *request.Request) { + if aws.BoolValue(r.Config.S3DisableContentMD5Validation) { + return + } + if r.IsPresigned() { + return + } + r.HTTPRequest.Header.Set(amzTeHeader, appendMD5TxEncoding) +} + +func useMD5ValidationReader(r *request.Request) { + if r.Error != nil { + return + } + + if v := r.HTTPResponse.Header.Get(amzTxEncodingHeader); v != appendMD5TxEncoding { + return + } + + var bodyReader *io.ReadCloser + var contentLen int64 + switch tv := r.Data.(type) { + case *GetObjectOutput: + bodyReader = &tv.Body + contentLen = aws.Int64Value(tv.ContentLength) + // Update ContentLength hiden the trailing MD5 checksum. + tv.ContentLength = aws.Int64(contentLen - md5.Size) + tv.ContentRange = aws.String(r.HTTPResponse.Header.Get("X-Amz-Content-Range")) + default: + r.Error = awserr.New("ChecksumValidationError", + fmt.Sprintf("%s: %s header received on unsupported API, %s", + amzTxEncodingHeader, appendMD5TxEncoding, r.Operation.Name, + ), nil) + return + } + + if contentLen < md5.Size { + r.Error = awserr.New("ChecksumValidationError", + fmt.Sprintf("invalid Content-Length %d for %s %s", + contentLen, appendMD5TxEncoding, amzTxEncodingHeader, + ), nil) + return + } + + // Wrap and swap the response body reader with the validation reader. + *bodyReader = newMD5ValidationReader(*bodyReader, contentLen-md5.Size) +} + +type md5ValidationReader struct { + rawReader io.ReadCloser + payload io.Reader + hash hash.Hash + + payloadLen int64 + read int64 +} + +func newMD5ValidationReader(reader io.ReadCloser, payloadLen int64) *md5ValidationReader { + h := md5.New() + return &md5ValidationReader{ + rawReader: reader, + payload: io.TeeReader(&io.LimitedReader{R: reader, N: payloadLen}, h), + hash: h, + payloadLen: payloadLen, + } +} + +func (v *md5ValidationReader) Read(p []byte) (n int, err error) { + n, err = v.payload.Read(p) + if err != nil && err != io.EOF { + return n, err + } + + v.read += int64(n) + + if err == io.EOF { + if v.read != v.payloadLen { + return n, io.ErrUnexpectedEOF + } + expectSum := make([]byte, md5.Size) + actualSum := make([]byte, md5.Size) + if _, sumReadErr := io.ReadFull(v.rawReader, expectSum); sumReadErr != nil { + return n, sumReadErr + } + actualSum = v.hash.Sum(actualSum[0:0]) + if !bytes.Equal(expectSum, actualSum) { + return n, awserr.New("InvalidChecksum", + fmt.Sprintf("expected MD5 checksum %s, got %s", + hex.EncodeToString(expectSum), + hex.EncodeToString(actualSum), + ), + nil) + } + } + + return n, err +} + +func (v *md5ValidationReader) Close() error { + return v.rawReader.Close() +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go new file mode 100644 index 00000000000..bc68a46acfa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go @@ -0,0 +1,106 @@ +package s3 + +import ( + "io/ioutil" + "regexp" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" +) + +var reBucketLocation = regexp.MustCompile(`>([^<>]+)<\/Location`) + +// NormalizeBucketLocation is a utility function which will update the +// passed in value to always be a region ID. Generally this would be used +// with GetBucketLocation API operation. +// +// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html +// for more information on the values that can be returned. +func NormalizeBucketLocation(loc string) string { + switch loc { + case "": + loc = "us-east-1" + case "EU": + loc = "eu-west-1" + } + + return loc +} + +// NormalizeBucketLocationHandler is a request handler which will update the +// GetBucketLocation's result LocationConstraint value to always be a region ID. +// +// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html +// for more information on the values that can be returned. +// +// req, result := svc.GetBucketLocationRequest(&s3.GetBucketLocationInput{ +// Bucket: aws.String(bucket), +// }) +// req.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) +// err := req.Send() +var NormalizeBucketLocationHandler = request.NamedHandler{ + Name: "awssdk.s3.NormalizeBucketLocation", + Fn: func(req *request.Request) { + if req.Error != nil { + return + } + + out := req.Data.(*GetBucketLocationOutput) + loc := NormalizeBucketLocation(aws.StringValue(out.LocationConstraint)) + out.LocationConstraint = aws.String(loc) + }, +} + +// WithNormalizeBucketLocation is a request option which will update the +// GetBucketLocation's result LocationConstraint value to always be a region ID. +// +// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". +// +// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html +// for more information on the values that can be returned. +// +// result, err := svc.GetBucketLocationWithContext(ctx, +// &s3.GetBucketLocationInput{ +// Bucket: aws.String(bucket), +// }, +// s3.WithNormalizeBucketLocation, +// ) +func WithNormalizeBucketLocation(r *request.Request) { + r.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) +} + +func buildGetBucketLocation(r *request.Request) { + if r.DataFilled() { + out := r.Data.(*GetBucketLocationOutput) + b, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.New("SerializationError", "failed reading response body", err) + return + } + + match := reBucketLocation.FindSubmatch(b) + if len(match) > 1 { + loc := string(match[1]) + out.LocationConstraint = aws.String(loc) + } + } +} + +func populateLocationConstraint(r *request.Request) { + if r.ParamsFilled() && aws.StringValue(r.Config.Region) != "us-east-1" { + in := r.Params.(*CreateBucketInput) + if in.CreateBucketConfiguration == nil { + r.Params = awsutil.CopyOf(r.Params) + in = r.Params.(*CreateBucketInput) + in.CreateBucketConfiguration = &CreateBucketConfiguration{ + LocationConstraint: r.Config.Region, + } + } + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go new file mode 100644 index 00000000000..a55beab96db --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go @@ -0,0 +1,70 @@ +package s3 + +import ( + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" +) + +func init() { + initClient = defaultInitClientFn + initRequest = defaultInitRequestFn +} + +func defaultInitClientFn(c *client.Client) { + // Support building custom endpoints based on config + c.Handlers.Build.PushFront(updateEndpointForS3Config) + + // Require SSL when using SSE keys + c.Handlers.Validate.PushBack(validateSSERequiresSSL) + c.Handlers.Build.PushBack(computeSSEKeys) + + // S3 uses custom error unmarshaling logic + c.Handlers.UnmarshalError.Clear() + c.Handlers.UnmarshalError.PushBack(unmarshalError) +} + +func defaultInitRequestFn(r *request.Request) { + // Add reuest handlers for specific platforms. + // e.g. 100-continue support for PUT requests using Go 1.6 + platformRequestHandlers(r) + + switch r.Operation.Name { + case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, + opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration, + opPutBucketReplication: + // These S3 operations require Content-MD5 to be set + r.Handlers.Build.PushBack(contentMD5) + case opGetBucketLocation: + // GetBucketLocation has custom parsing logic + r.Handlers.Unmarshal.PushFront(buildGetBucketLocation) + case opCreateBucket: + // Auto-populate LocationConstraint with current region + r.Handlers.Validate.PushFront(populateLocationConstraint) + case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload: + r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError) + case opPutObject, opUploadPart: + r.Handlers.Build.PushBack(computeBodyHashes) + // Disabled until #1837 root issue is resolved. + // case opGetObject: + // r.Handlers.Build.PushBack(askForTxEncodingAppendMD5) + // r.Handlers.Unmarshal.PushBack(useMD5ValidationReader) + } +} + +// bucketGetter is an accessor interface to grab the "Bucket" field from +// an S3 type. +type bucketGetter interface { + getBucket() string +} + +// sseCustomerKeyGetter is an accessor interface to grab the "SSECustomerKey" +// field from an S3 type. +type sseCustomerKeyGetter interface { + getSSECustomerKey() string +} + +// copySourceSSECustomerKeyGetter is an accessor interface to grab the +// "CopySourceSSECustomerKey" field from an S3 type. +type copySourceSSECustomerKeyGetter interface { + getCopySourceSSECustomerKey() string +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go new file mode 100644 index 00000000000..0def02255ac --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go @@ -0,0 +1,26 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package s3 provides the client and types for making API +// requests to Amazon Simple Storage Service. +// +// See https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01 for more information on this service. +// +// See s3 package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/ +// +// Using the Client +// +// To contact Amazon Simple Storage 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 Simple Storage Service client S3 for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#New +package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go new file mode 100644 index 00000000000..39b912c260b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go @@ -0,0 +1,109 @@ +// Upload Managers +// +// The s3manager package's Uploader provides concurrent upload of content to S3 +// by taking advantage of S3's Multipart APIs. The Uploader also supports both +// io.Reader for streaming uploads, and will also take advantage of io.ReadSeeker +// for optimizations if the Body satisfies that type. Once the Uploader instance +// is created you can call Upload concurrently from multiple goroutines safely. +// +// // The session the S3 Uploader will use +// sess := session.Must(session.NewSession()) +// +// // Create an uploader with the session and default options +// uploader := s3manager.NewUploader(sess) +// +// f, err := os.Open(filename) +// if err != nil { +// return fmt.Errorf("failed to open file %q, %v", filename, err) +// } +// +// // Upload the file to S3. +// result, err := uploader.Upload(&s3manager.UploadInput{ +// Bucket: aws.String(myBucket), +// Key: aws.String(myString), +// Body: f, +// }) +// if err != nil { +// return fmt.Errorf("failed to upload file, %v", err) +// } +// fmt.Printf("file uploaded to, %s\n", aws.StringValue(result.Location)) +// +// See the s3manager package's Uploader type documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Uploader +// +// Download Manager +// +// The s3manager package's Downloader provides concurrently downloading of Objects +// from S3. The Downloader will write S3 Object content with an io.WriterAt. +// Once the Downloader instance is created you can call Download concurrently from +// multiple goroutines safely. +// +// // The session the S3 Downloader will use +// sess := session.Must(session.NewSession()) +// +// // Create a downloader with the session and default options +// downloader := s3manager.NewDownloader(sess) +// +// // Create a file to write the S3 Object contents to. +// f, err := os.Create(filename) +// if err != nil { +// return fmt.Errorf("failed to create file %q, %v", filename, err) +// } +// +// // Write the contents of S3 Object to the file +// n, err := downloader.Download(f, &s3.GetObjectInput{ +// Bucket: aws.String(myBucket), +// Key: aws.String(myString), +// }) +// if err != nil { +// return fmt.Errorf("failed to download file, %v", err) +// } +// fmt.Printf("file downloaded, %d bytes\n", n) +// +// See the s3manager package's Downloader type documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Downloader +// +// Get Bucket Region +// +// GetBucketRegion will attempt to get the region for a bucket using a region +// hint to determine which AWS partition to perform the query on. Use this utility +// to determine the region a bucket is in. +// +// sess := session.Must(session.NewSession()) +// +// bucket := "my-bucket" +// region, err := s3manager.GetBucketRegion(ctx, sess, bucket, "us-west-2") +// if err != nil { +// if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" { +// fmt.Fprintf(os.Stderr, "unable to find bucket %s's region not found\n", bucket) +// } +// return err +// } +// fmt.Printf("Bucket %s is in %s region\n", bucket, region) +// +// See the s3manager package's GetBucketRegion function documentation for more information +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#GetBucketRegion +// +// S3 Crypto Client +// +// The s3crypto package provides the tools to upload and download encrypted +// content from S3. The Encryption and Decryption clients can be used concurrently +// once the client is created. +// +// sess := session.Must(session.NewSession()) +// +// // Create the decryption client. +// svc := s3crypto.NewDecryptionClient(sess) +// +// // The object will be downloaded from S3 and decrypted locally. By metadata +// // about the object's encryption will instruct the decryption client how +// // decrypt the content of the object. By default KMS is used for keys. +// result, err := svc.GetObject(&s3.GetObjectInput { +// Bucket: aws.String(myBucket), +// Key: aws.String(myKey), +// }) +// +// See the s3crypto package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3crypto/ +// +package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go new file mode 100644 index 00000000000..931cb17bb05 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go @@ -0,0 +1,48 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package s3 + +const ( + + // ErrCodeBucketAlreadyExists for service response error code + // "BucketAlreadyExists". + // + // The requested bucket name is not available. The bucket namespace is shared + // by all users of the system. Please select a different name and try again. + ErrCodeBucketAlreadyExists = "BucketAlreadyExists" + + // ErrCodeBucketAlreadyOwnedByYou for service response error code + // "BucketAlreadyOwnedByYou". + ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" + + // ErrCodeNoSuchBucket for service response error code + // "NoSuchBucket". + // + // The specified bucket does not exist. + ErrCodeNoSuchBucket = "NoSuchBucket" + + // ErrCodeNoSuchKey for service response error code + // "NoSuchKey". + // + // The specified key does not exist. + ErrCodeNoSuchKey = "NoSuchKey" + + // ErrCodeNoSuchUpload for service response error code + // "NoSuchUpload". + // + // The specified multipart upload does not exist. + ErrCodeNoSuchUpload = "NoSuchUpload" + + // ErrCodeObjectAlreadyInActiveTierError for service response error code + // "ObjectAlreadyInActiveTierError". + // + // This operation is not allowed against this storage tier + ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" + + // ErrCodeObjectNotInActiveTierError for service response error code + // "ObjectNotInActiveTierError". + // + // The source object of the COPY operation is not in the active tier and is + // only stored in Amazon Glacier. + ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go new file mode 100644 index 00000000000..a7fbc2de2f8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go @@ -0,0 +1,155 @@ +package s3 + +import ( + "fmt" + "net/url" + "regexp" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// an operationBlacklist is a list of operation names that should a +// request handler should not be executed with. +type operationBlacklist []string + +// Continue will return true of the Request's operation name is not +// in the blacklist. False otherwise. +func (b operationBlacklist) Continue(r *request.Request) bool { + for i := 0; i < len(b); i++ { + if b[i] == r.Operation.Name { + return false + } + } + return true +} + +var accelerateOpBlacklist = operationBlacklist{ + opListBuckets, opCreateBucket, opDeleteBucket, +} + +// Request handler to automatically add the bucket name to the endpoint domain +// if possible. This style of bucket is valid for all bucket names which are +// DNS compatible and do not contain "." +func updateEndpointForS3Config(r *request.Request) { + forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle) + accelerate := aws.BoolValue(r.Config.S3UseAccelerate) + + if accelerate && accelerateOpBlacklist.Continue(r) { + if forceHostStyle { + if r.Config.Logger != nil { + r.Config.Logger.Log("ERROR: aws.Config.S3UseAccelerate is not compatible with aws.Config.S3ForcePathStyle, ignoring S3ForcePathStyle.") + } + } + updateEndpointForAccelerate(r) + } else if !forceHostStyle && r.Operation.Name != opGetBucketLocation { + updateEndpointForHostStyle(r) + } +} + +func updateEndpointForHostStyle(r *request.Request) { + bucket, ok := bucketNameFromReqParams(r.Params) + if !ok { + // Ignore operation requests if the bucketname was not provided + // if this is an input validation error the validation handler + // will report it. + return + } + + if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { + // bucket name must be valid to put into the host + return + } + + moveBucketToHost(r.HTTPRequest.URL, bucket) +} + +var ( + accelElem = []byte("s3-accelerate.dualstack.") +) + +func updateEndpointForAccelerate(r *request.Request) { + bucket, ok := bucketNameFromReqParams(r.Params) + if !ok { + // Ignore operation requests if the bucketname was not provided + // if this is an input validation error the validation handler + // will report it. + return + } + + if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { + r.Error = awserr.New("InvalidParameterException", + fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucket), + nil) + return + } + + parts := strings.Split(r.HTTPRequest.URL.Host, ".") + if len(parts) < 3 { + r.Error = awserr.New("InvalidParameterExecption", + fmt.Sprintf("unable to update endpoint host for S3 accelerate, hostname invalid, %s", + r.HTTPRequest.URL.Host), nil) + return + } + + if parts[0] == "s3" || strings.HasPrefix(parts[0], "s3-") { + parts[0] = "s3-accelerate" + } + for i := 1; i+1 < len(parts); i++ { + if parts[i] == aws.StringValue(r.Config.Region) { + parts = append(parts[:i], parts[i+1:]...) + break + } + } + + r.HTTPRequest.URL.Host = strings.Join(parts, ".") + + moveBucketToHost(r.HTTPRequest.URL, bucket) +} + +// Attempts to retrieve the bucket name from the request input parameters. +// If no bucket is found, or the field is empty "", false will be returned. +func bucketNameFromReqParams(params interface{}) (string, bool) { + if iface, ok := params.(bucketGetter); ok { + b := iface.getBucket() + return b, len(b) > 0 + } + + return "", false +} + +// hostCompatibleBucketName returns true if the request should +// put the bucket in the host. This is false if S3ForcePathStyle is +// explicitly set or if the bucket is not DNS compatible. +func hostCompatibleBucketName(u *url.URL, bucket string) bool { + // Bucket might be DNS compatible but dots in the hostname will fail + // certificate validation, so do not use host-style. + if u.Scheme == "https" && strings.Contains(bucket, ".") { + return false + } + + // if the bucket is DNS compatible + return dnsCompatibleBucketName(bucket) +} + +var reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) +var reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) + +// dnsCompatibleBucketName returns true if the bucket name is DNS compatible. +// Buckets created outside of the classic region MUST be DNS compatible. +func dnsCompatibleBucketName(bucket string) bool { + return reDomain.MatchString(bucket) && + !reIPAddress.MatchString(bucket) && + !strings.Contains(bucket, "..") +} + +// moveBucketToHost moves the bucket name from the URI path to URL host. +func moveBucketToHost(u *url.URL, bucket string) { + u.Host = bucket + "." + u.Host + u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1) + if u.Path == "" { + u.Path = "/" + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go new file mode 100644 index 00000000000..8e6f3307d41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go @@ -0,0 +1,8 @@ +// +build !go1.6 + +package s3 + +import "github.com/aws/aws-sdk-go/aws/request" + +func platformRequestHandlers(r *request.Request) { +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go new file mode 100644 index 00000000000..14d05f7b75a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go @@ -0,0 +1,28 @@ +// +build go1.6 + +package s3 + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +func platformRequestHandlers(r *request.Request) { + if r.Operation.HTTPMethod == "PUT" { + // 100-Continue should only be used on put requests. + r.Handlers.Sign.PushBack(add100Continue) + } +} + +func add100Continue(r *request.Request) { + if aws.BoolValue(r.Config.S3Disable100Continue) { + return + } + if r.HTTPRequest.ContentLength < 1024*1024*2 { + // Ignore requests smaller than 2MB. This helps prevent delaying + // requests unnecessarily. + return + } + + r.HTTPRequest.Header.Set("Expect", "100-Continue") +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/BUILD.bazel new file mode 100644 index 00000000000..de575c28db8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["interface.go"], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface", + importpath = "github.com/aws/aws-sdk-go/service/s3/s3iface", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/s3:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go new file mode 100644 index 00000000000..cc427882b88 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go @@ -0,0 +1,403 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package s3iface provides an interface to enable mocking the Amazon Simple Storage Service 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 s3iface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" +) + +// S3API provides an interface to enable mocking the +// s3.S3 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 Simple Storage Service. +// func myFunc(svc s3iface.S3API) bool { +// // Make svc.AbortMultipartUpload request +// } +// +// func main() { +// sess := session.New() +// svc := s3.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockS3Client struct { +// s3iface.S3API +// } +// func (m *mockS3Client) AbortMultipartUpload(input *s3.AbortMultipartUploadInput) (*s3.AbortMultipartUploadOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockS3Client{} +// +// 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 S3API interface { + AbortMultipartUpload(*s3.AbortMultipartUploadInput) (*s3.AbortMultipartUploadOutput, error) + AbortMultipartUploadWithContext(aws.Context, *s3.AbortMultipartUploadInput, ...request.Option) (*s3.AbortMultipartUploadOutput, error) + AbortMultipartUploadRequest(*s3.AbortMultipartUploadInput) (*request.Request, *s3.AbortMultipartUploadOutput) + + CompleteMultipartUpload(*s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error) + CompleteMultipartUploadWithContext(aws.Context, *s3.CompleteMultipartUploadInput, ...request.Option) (*s3.CompleteMultipartUploadOutput, error) + CompleteMultipartUploadRequest(*s3.CompleteMultipartUploadInput) (*request.Request, *s3.CompleteMultipartUploadOutput) + + CopyObject(*s3.CopyObjectInput) (*s3.CopyObjectOutput, error) + CopyObjectWithContext(aws.Context, *s3.CopyObjectInput, ...request.Option) (*s3.CopyObjectOutput, error) + CopyObjectRequest(*s3.CopyObjectInput) (*request.Request, *s3.CopyObjectOutput) + + CreateBucket(*s3.CreateBucketInput) (*s3.CreateBucketOutput, error) + CreateBucketWithContext(aws.Context, *s3.CreateBucketInput, ...request.Option) (*s3.CreateBucketOutput, error) + CreateBucketRequest(*s3.CreateBucketInput) (*request.Request, *s3.CreateBucketOutput) + + CreateMultipartUpload(*s3.CreateMultipartUploadInput) (*s3.CreateMultipartUploadOutput, error) + CreateMultipartUploadWithContext(aws.Context, *s3.CreateMultipartUploadInput, ...request.Option) (*s3.CreateMultipartUploadOutput, error) + CreateMultipartUploadRequest(*s3.CreateMultipartUploadInput) (*request.Request, *s3.CreateMultipartUploadOutput) + + DeleteBucket(*s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error) + DeleteBucketWithContext(aws.Context, *s3.DeleteBucketInput, ...request.Option) (*s3.DeleteBucketOutput, error) + DeleteBucketRequest(*s3.DeleteBucketInput) (*request.Request, *s3.DeleteBucketOutput) + + DeleteBucketAnalyticsConfiguration(*s3.DeleteBucketAnalyticsConfigurationInput) (*s3.DeleteBucketAnalyticsConfigurationOutput, error) + DeleteBucketAnalyticsConfigurationWithContext(aws.Context, *s3.DeleteBucketAnalyticsConfigurationInput, ...request.Option) (*s3.DeleteBucketAnalyticsConfigurationOutput, error) + DeleteBucketAnalyticsConfigurationRequest(*s3.DeleteBucketAnalyticsConfigurationInput) (*request.Request, *s3.DeleteBucketAnalyticsConfigurationOutput) + + DeleteBucketCors(*s3.DeleteBucketCorsInput) (*s3.DeleteBucketCorsOutput, error) + DeleteBucketCorsWithContext(aws.Context, *s3.DeleteBucketCorsInput, ...request.Option) (*s3.DeleteBucketCorsOutput, error) + DeleteBucketCorsRequest(*s3.DeleteBucketCorsInput) (*request.Request, *s3.DeleteBucketCorsOutput) + + DeleteBucketEncryption(*s3.DeleteBucketEncryptionInput) (*s3.DeleteBucketEncryptionOutput, error) + DeleteBucketEncryptionWithContext(aws.Context, *s3.DeleteBucketEncryptionInput, ...request.Option) (*s3.DeleteBucketEncryptionOutput, error) + DeleteBucketEncryptionRequest(*s3.DeleteBucketEncryptionInput) (*request.Request, *s3.DeleteBucketEncryptionOutput) + + DeleteBucketInventoryConfiguration(*s3.DeleteBucketInventoryConfigurationInput) (*s3.DeleteBucketInventoryConfigurationOutput, error) + DeleteBucketInventoryConfigurationWithContext(aws.Context, *s3.DeleteBucketInventoryConfigurationInput, ...request.Option) (*s3.DeleteBucketInventoryConfigurationOutput, error) + DeleteBucketInventoryConfigurationRequest(*s3.DeleteBucketInventoryConfigurationInput) (*request.Request, *s3.DeleteBucketInventoryConfigurationOutput) + + DeleteBucketLifecycle(*s3.DeleteBucketLifecycleInput) (*s3.DeleteBucketLifecycleOutput, error) + DeleteBucketLifecycleWithContext(aws.Context, *s3.DeleteBucketLifecycleInput, ...request.Option) (*s3.DeleteBucketLifecycleOutput, error) + DeleteBucketLifecycleRequest(*s3.DeleteBucketLifecycleInput) (*request.Request, *s3.DeleteBucketLifecycleOutput) + + DeleteBucketMetricsConfiguration(*s3.DeleteBucketMetricsConfigurationInput) (*s3.DeleteBucketMetricsConfigurationOutput, error) + DeleteBucketMetricsConfigurationWithContext(aws.Context, *s3.DeleteBucketMetricsConfigurationInput, ...request.Option) (*s3.DeleteBucketMetricsConfigurationOutput, error) + DeleteBucketMetricsConfigurationRequest(*s3.DeleteBucketMetricsConfigurationInput) (*request.Request, *s3.DeleteBucketMetricsConfigurationOutput) + + DeleteBucketPolicy(*s3.DeleteBucketPolicyInput) (*s3.DeleteBucketPolicyOutput, error) + DeleteBucketPolicyWithContext(aws.Context, *s3.DeleteBucketPolicyInput, ...request.Option) (*s3.DeleteBucketPolicyOutput, error) + DeleteBucketPolicyRequest(*s3.DeleteBucketPolicyInput) (*request.Request, *s3.DeleteBucketPolicyOutput) + + DeleteBucketReplication(*s3.DeleteBucketReplicationInput) (*s3.DeleteBucketReplicationOutput, error) + DeleteBucketReplicationWithContext(aws.Context, *s3.DeleteBucketReplicationInput, ...request.Option) (*s3.DeleteBucketReplicationOutput, error) + DeleteBucketReplicationRequest(*s3.DeleteBucketReplicationInput) (*request.Request, *s3.DeleteBucketReplicationOutput) + + DeleteBucketTagging(*s3.DeleteBucketTaggingInput) (*s3.DeleteBucketTaggingOutput, error) + DeleteBucketTaggingWithContext(aws.Context, *s3.DeleteBucketTaggingInput, ...request.Option) (*s3.DeleteBucketTaggingOutput, error) + DeleteBucketTaggingRequest(*s3.DeleteBucketTaggingInput) (*request.Request, *s3.DeleteBucketTaggingOutput) + + DeleteBucketWebsite(*s3.DeleteBucketWebsiteInput) (*s3.DeleteBucketWebsiteOutput, error) + DeleteBucketWebsiteWithContext(aws.Context, *s3.DeleteBucketWebsiteInput, ...request.Option) (*s3.DeleteBucketWebsiteOutput, error) + DeleteBucketWebsiteRequest(*s3.DeleteBucketWebsiteInput) (*request.Request, *s3.DeleteBucketWebsiteOutput) + + DeleteObject(*s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error) + DeleteObjectWithContext(aws.Context, *s3.DeleteObjectInput, ...request.Option) (*s3.DeleteObjectOutput, error) + DeleteObjectRequest(*s3.DeleteObjectInput) (*request.Request, *s3.DeleteObjectOutput) + + DeleteObjectTagging(*s3.DeleteObjectTaggingInput) (*s3.DeleteObjectTaggingOutput, error) + DeleteObjectTaggingWithContext(aws.Context, *s3.DeleteObjectTaggingInput, ...request.Option) (*s3.DeleteObjectTaggingOutput, error) + DeleteObjectTaggingRequest(*s3.DeleteObjectTaggingInput) (*request.Request, *s3.DeleteObjectTaggingOutput) + + DeleteObjects(*s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error) + DeleteObjectsWithContext(aws.Context, *s3.DeleteObjectsInput, ...request.Option) (*s3.DeleteObjectsOutput, error) + DeleteObjectsRequest(*s3.DeleteObjectsInput) (*request.Request, *s3.DeleteObjectsOutput) + + GetBucketAccelerateConfiguration(*s3.GetBucketAccelerateConfigurationInput) (*s3.GetBucketAccelerateConfigurationOutput, error) + GetBucketAccelerateConfigurationWithContext(aws.Context, *s3.GetBucketAccelerateConfigurationInput, ...request.Option) (*s3.GetBucketAccelerateConfigurationOutput, error) + GetBucketAccelerateConfigurationRequest(*s3.GetBucketAccelerateConfigurationInput) (*request.Request, *s3.GetBucketAccelerateConfigurationOutput) + + GetBucketAcl(*s3.GetBucketAclInput) (*s3.GetBucketAclOutput, error) + GetBucketAclWithContext(aws.Context, *s3.GetBucketAclInput, ...request.Option) (*s3.GetBucketAclOutput, error) + GetBucketAclRequest(*s3.GetBucketAclInput) (*request.Request, *s3.GetBucketAclOutput) + + GetBucketAnalyticsConfiguration(*s3.GetBucketAnalyticsConfigurationInput) (*s3.GetBucketAnalyticsConfigurationOutput, error) + GetBucketAnalyticsConfigurationWithContext(aws.Context, *s3.GetBucketAnalyticsConfigurationInput, ...request.Option) (*s3.GetBucketAnalyticsConfigurationOutput, error) + GetBucketAnalyticsConfigurationRequest(*s3.GetBucketAnalyticsConfigurationInput) (*request.Request, *s3.GetBucketAnalyticsConfigurationOutput) + + GetBucketCors(*s3.GetBucketCorsInput) (*s3.GetBucketCorsOutput, error) + GetBucketCorsWithContext(aws.Context, *s3.GetBucketCorsInput, ...request.Option) (*s3.GetBucketCorsOutput, error) + GetBucketCorsRequest(*s3.GetBucketCorsInput) (*request.Request, *s3.GetBucketCorsOutput) + + GetBucketEncryption(*s3.GetBucketEncryptionInput) (*s3.GetBucketEncryptionOutput, error) + GetBucketEncryptionWithContext(aws.Context, *s3.GetBucketEncryptionInput, ...request.Option) (*s3.GetBucketEncryptionOutput, error) + GetBucketEncryptionRequest(*s3.GetBucketEncryptionInput) (*request.Request, *s3.GetBucketEncryptionOutput) + + GetBucketInventoryConfiguration(*s3.GetBucketInventoryConfigurationInput) (*s3.GetBucketInventoryConfigurationOutput, error) + GetBucketInventoryConfigurationWithContext(aws.Context, *s3.GetBucketInventoryConfigurationInput, ...request.Option) (*s3.GetBucketInventoryConfigurationOutput, error) + GetBucketInventoryConfigurationRequest(*s3.GetBucketInventoryConfigurationInput) (*request.Request, *s3.GetBucketInventoryConfigurationOutput) + + GetBucketLifecycle(*s3.GetBucketLifecycleInput) (*s3.GetBucketLifecycleOutput, error) + GetBucketLifecycleWithContext(aws.Context, *s3.GetBucketLifecycleInput, ...request.Option) (*s3.GetBucketLifecycleOutput, error) + GetBucketLifecycleRequest(*s3.GetBucketLifecycleInput) (*request.Request, *s3.GetBucketLifecycleOutput) + + GetBucketLifecycleConfiguration(*s3.GetBucketLifecycleConfigurationInput) (*s3.GetBucketLifecycleConfigurationOutput, error) + GetBucketLifecycleConfigurationWithContext(aws.Context, *s3.GetBucketLifecycleConfigurationInput, ...request.Option) (*s3.GetBucketLifecycleConfigurationOutput, error) + GetBucketLifecycleConfigurationRequest(*s3.GetBucketLifecycleConfigurationInput) (*request.Request, *s3.GetBucketLifecycleConfigurationOutput) + + GetBucketLocation(*s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error) + GetBucketLocationWithContext(aws.Context, *s3.GetBucketLocationInput, ...request.Option) (*s3.GetBucketLocationOutput, error) + GetBucketLocationRequest(*s3.GetBucketLocationInput) (*request.Request, *s3.GetBucketLocationOutput) + + GetBucketLogging(*s3.GetBucketLoggingInput) (*s3.GetBucketLoggingOutput, error) + GetBucketLoggingWithContext(aws.Context, *s3.GetBucketLoggingInput, ...request.Option) (*s3.GetBucketLoggingOutput, error) + GetBucketLoggingRequest(*s3.GetBucketLoggingInput) (*request.Request, *s3.GetBucketLoggingOutput) + + GetBucketMetricsConfiguration(*s3.GetBucketMetricsConfigurationInput) (*s3.GetBucketMetricsConfigurationOutput, error) + GetBucketMetricsConfigurationWithContext(aws.Context, *s3.GetBucketMetricsConfigurationInput, ...request.Option) (*s3.GetBucketMetricsConfigurationOutput, error) + GetBucketMetricsConfigurationRequest(*s3.GetBucketMetricsConfigurationInput) (*request.Request, *s3.GetBucketMetricsConfigurationOutput) + + GetBucketNotification(*s3.GetBucketNotificationConfigurationRequest) (*s3.NotificationConfigurationDeprecated, error) + GetBucketNotificationWithContext(aws.Context, *s3.GetBucketNotificationConfigurationRequest, ...request.Option) (*s3.NotificationConfigurationDeprecated, error) + GetBucketNotificationRequest(*s3.GetBucketNotificationConfigurationRequest) (*request.Request, *s3.NotificationConfigurationDeprecated) + + GetBucketNotificationConfiguration(*s3.GetBucketNotificationConfigurationRequest) (*s3.NotificationConfiguration, error) + GetBucketNotificationConfigurationWithContext(aws.Context, *s3.GetBucketNotificationConfigurationRequest, ...request.Option) (*s3.NotificationConfiguration, error) + GetBucketNotificationConfigurationRequest(*s3.GetBucketNotificationConfigurationRequest) (*request.Request, *s3.NotificationConfiguration) + + GetBucketPolicy(*s3.GetBucketPolicyInput) (*s3.GetBucketPolicyOutput, error) + GetBucketPolicyWithContext(aws.Context, *s3.GetBucketPolicyInput, ...request.Option) (*s3.GetBucketPolicyOutput, error) + GetBucketPolicyRequest(*s3.GetBucketPolicyInput) (*request.Request, *s3.GetBucketPolicyOutput) + + GetBucketReplication(*s3.GetBucketReplicationInput) (*s3.GetBucketReplicationOutput, error) + GetBucketReplicationWithContext(aws.Context, *s3.GetBucketReplicationInput, ...request.Option) (*s3.GetBucketReplicationOutput, error) + GetBucketReplicationRequest(*s3.GetBucketReplicationInput) (*request.Request, *s3.GetBucketReplicationOutput) + + GetBucketRequestPayment(*s3.GetBucketRequestPaymentInput) (*s3.GetBucketRequestPaymentOutput, error) + GetBucketRequestPaymentWithContext(aws.Context, *s3.GetBucketRequestPaymentInput, ...request.Option) (*s3.GetBucketRequestPaymentOutput, error) + GetBucketRequestPaymentRequest(*s3.GetBucketRequestPaymentInput) (*request.Request, *s3.GetBucketRequestPaymentOutput) + + GetBucketTagging(*s3.GetBucketTaggingInput) (*s3.GetBucketTaggingOutput, error) + GetBucketTaggingWithContext(aws.Context, *s3.GetBucketTaggingInput, ...request.Option) (*s3.GetBucketTaggingOutput, error) + GetBucketTaggingRequest(*s3.GetBucketTaggingInput) (*request.Request, *s3.GetBucketTaggingOutput) + + GetBucketVersioning(*s3.GetBucketVersioningInput) (*s3.GetBucketVersioningOutput, error) + GetBucketVersioningWithContext(aws.Context, *s3.GetBucketVersioningInput, ...request.Option) (*s3.GetBucketVersioningOutput, error) + GetBucketVersioningRequest(*s3.GetBucketVersioningInput) (*request.Request, *s3.GetBucketVersioningOutput) + + GetBucketWebsite(*s3.GetBucketWebsiteInput) (*s3.GetBucketWebsiteOutput, error) + GetBucketWebsiteWithContext(aws.Context, *s3.GetBucketWebsiteInput, ...request.Option) (*s3.GetBucketWebsiteOutput, error) + GetBucketWebsiteRequest(*s3.GetBucketWebsiteInput) (*request.Request, *s3.GetBucketWebsiteOutput) + + GetObject(*s3.GetObjectInput) (*s3.GetObjectOutput, error) + GetObjectWithContext(aws.Context, *s3.GetObjectInput, ...request.Option) (*s3.GetObjectOutput, error) + GetObjectRequest(*s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) + + GetObjectAcl(*s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error) + GetObjectAclWithContext(aws.Context, *s3.GetObjectAclInput, ...request.Option) (*s3.GetObjectAclOutput, error) + GetObjectAclRequest(*s3.GetObjectAclInput) (*request.Request, *s3.GetObjectAclOutput) + + GetObjectTagging(*s3.GetObjectTaggingInput) (*s3.GetObjectTaggingOutput, error) + GetObjectTaggingWithContext(aws.Context, *s3.GetObjectTaggingInput, ...request.Option) (*s3.GetObjectTaggingOutput, error) + GetObjectTaggingRequest(*s3.GetObjectTaggingInput) (*request.Request, *s3.GetObjectTaggingOutput) + + GetObjectTorrent(*s3.GetObjectTorrentInput) (*s3.GetObjectTorrentOutput, error) + GetObjectTorrentWithContext(aws.Context, *s3.GetObjectTorrentInput, ...request.Option) (*s3.GetObjectTorrentOutput, error) + GetObjectTorrentRequest(*s3.GetObjectTorrentInput) (*request.Request, *s3.GetObjectTorrentOutput) + + HeadBucket(*s3.HeadBucketInput) (*s3.HeadBucketOutput, error) + HeadBucketWithContext(aws.Context, *s3.HeadBucketInput, ...request.Option) (*s3.HeadBucketOutput, error) + HeadBucketRequest(*s3.HeadBucketInput) (*request.Request, *s3.HeadBucketOutput) + + HeadObject(*s3.HeadObjectInput) (*s3.HeadObjectOutput, error) + HeadObjectWithContext(aws.Context, *s3.HeadObjectInput, ...request.Option) (*s3.HeadObjectOutput, error) + HeadObjectRequest(*s3.HeadObjectInput) (*request.Request, *s3.HeadObjectOutput) + + ListBucketAnalyticsConfigurations(*s3.ListBucketAnalyticsConfigurationsInput) (*s3.ListBucketAnalyticsConfigurationsOutput, error) + ListBucketAnalyticsConfigurationsWithContext(aws.Context, *s3.ListBucketAnalyticsConfigurationsInput, ...request.Option) (*s3.ListBucketAnalyticsConfigurationsOutput, error) + ListBucketAnalyticsConfigurationsRequest(*s3.ListBucketAnalyticsConfigurationsInput) (*request.Request, *s3.ListBucketAnalyticsConfigurationsOutput) + + ListBucketInventoryConfigurations(*s3.ListBucketInventoryConfigurationsInput) (*s3.ListBucketInventoryConfigurationsOutput, error) + ListBucketInventoryConfigurationsWithContext(aws.Context, *s3.ListBucketInventoryConfigurationsInput, ...request.Option) (*s3.ListBucketInventoryConfigurationsOutput, error) + ListBucketInventoryConfigurationsRequest(*s3.ListBucketInventoryConfigurationsInput) (*request.Request, *s3.ListBucketInventoryConfigurationsOutput) + + ListBucketMetricsConfigurations(*s3.ListBucketMetricsConfigurationsInput) (*s3.ListBucketMetricsConfigurationsOutput, error) + ListBucketMetricsConfigurationsWithContext(aws.Context, *s3.ListBucketMetricsConfigurationsInput, ...request.Option) (*s3.ListBucketMetricsConfigurationsOutput, error) + ListBucketMetricsConfigurationsRequest(*s3.ListBucketMetricsConfigurationsInput) (*request.Request, *s3.ListBucketMetricsConfigurationsOutput) + + ListBuckets(*s3.ListBucketsInput) (*s3.ListBucketsOutput, error) + ListBucketsWithContext(aws.Context, *s3.ListBucketsInput, ...request.Option) (*s3.ListBucketsOutput, error) + ListBucketsRequest(*s3.ListBucketsInput) (*request.Request, *s3.ListBucketsOutput) + + ListMultipartUploads(*s3.ListMultipartUploadsInput) (*s3.ListMultipartUploadsOutput, error) + ListMultipartUploadsWithContext(aws.Context, *s3.ListMultipartUploadsInput, ...request.Option) (*s3.ListMultipartUploadsOutput, error) + ListMultipartUploadsRequest(*s3.ListMultipartUploadsInput) (*request.Request, *s3.ListMultipartUploadsOutput) + + ListMultipartUploadsPages(*s3.ListMultipartUploadsInput, func(*s3.ListMultipartUploadsOutput, bool) bool) error + ListMultipartUploadsPagesWithContext(aws.Context, *s3.ListMultipartUploadsInput, func(*s3.ListMultipartUploadsOutput, bool) bool, ...request.Option) error + + ListObjectVersions(*s3.ListObjectVersionsInput) (*s3.ListObjectVersionsOutput, error) + ListObjectVersionsWithContext(aws.Context, *s3.ListObjectVersionsInput, ...request.Option) (*s3.ListObjectVersionsOutput, error) + ListObjectVersionsRequest(*s3.ListObjectVersionsInput) (*request.Request, *s3.ListObjectVersionsOutput) + + ListObjectVersionsPages(*s3.ListObjectVersionsInput, func(*s3.ListObjectVersionsOutput, bool) bool) error + ListObjectVersionsPagesWithContext(aws.Context, *s3.ListObjectVersionsInput, func(*s3.ListObjectVersionsOutput, bool) bool, ...request.Option) error + + ListObjects(*s3.ListObjectsInput) (*s3.ListObjectsOutput, error) + ListObjectsWithContext(aws.Context, *s3.ListObjectsInput, ...request.Option) (*s3.ListObjectsOutput, error) + ListObjectsRequest(*s3.ListObjectsInput) (*request.Request, *s3.ListObjectsOutput) + + ListObjectsPages(*s3.ListObjectsInput, func(*s3.ListObjectsOutput, bool) bool) error + ListObjectsPagesWithContext(aws.Context, *s3.ListObjectsInput, func(*s3.ListObjectsOutput, bool) bool, ...request.Option) error + + ListObjectsV2(*s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, error) + ListObjectsV2WithContext(aws.Context, *s3.ListObjectsV2Input, ...request.Option) (*s3.ListObjectsV2Output, error) + ListObjectsV2Request(*s3.ListObjectsV2Input) (*request.Request, *s3.ListObjectsV2Output) + + ListObjectsV2Pages(*s3.ListObjectsV2Input, func(*s3.ListObjectsV2Output, bool) bool) error + ListObjectsV2PagesWithContext(aws.Context, *s3.ListObjectsV2Input, func(*s3.ListObjectsV2Output, bool) bool, ...request.Option) error + + ListParts(*s3.ListPartsInput) (*s3.ListPartsOutput, error) + ListPartsWithContext(aws.Context, *s3.ListPartsInput, ...request.Option) (*s3.ListPartsOutput, error) + ListPartsRequest(*s3.ListPartsInput) (*request.Request, *s3.ListPartsOutput) + + ListPartsPages(*s3.ListPartsInput, func(*s3.ListPartsOutput, bool) bool) error + ListPartsPagesWithContext(aws.Context, *s3.ListPartsInput, func(*s3.ListPartsOutput, bool) bool, ...request.Option) error + + PutBucketAccelerateConfiguration(*s3.PutBucketAccelerateConfigurationInput) (*s3.PutBucketAccelerateConfigurationOutput, error) + PutBucketAccelerateConfigurationWithContext(aws.Context, *s3.PutBucketAccelerateConfigurationInput, ...request.Option) (*s3.PutBucketAccelerateConfigurationOutput, error) + PutBucketAccelerateConfigurationRequest(*s3.PutBucketAccelerateConfigurationInput) (*request.Request, *s3.PutBucketAccelerateConfigurationOutput) + + PutBucketAcl(*s3.PutBucketAclInput) (*s3.PutBucketAclOutput, error) + PutBucketAclWithContext(aws.Context, *s3.PutBucketAclInput, ...request.Option) (*s3.PutBucketAclOutput, error) + PutBucketAclRequest(*s3.PutBucketAclInput) (*request.Request, *s3.PutBucketAclOutput) + + PutBucketAnalyticsConfiguration(*s3.PutBucketAnalyticsConfigurationInput) (*s3.PutBucketAnalyticsConfigurationOutput, error) + PutBucketAnalyticsConfigurationWithContext(aws.Context, *s3.PutBucketAnalyticsConfigurationInput, ...request.Option) (*s3.PutBucketAnalyticsConfigurationOutput, error) + PutBucketAnalyticsConfigurationRequest(*s3.PutBucketAnalyticsConfigurationInput) (*request.Request, *s3.PutBucketAnalyticsConfigurationOutput) + + PutBucketCors(*s3.PutBucketCorsInput) (*s3.PutBucketCorsOutput, error) + PutBucketCorsWithContext(aws.Context, *s3.PutBucketCorsInput, ...request.Option) (*s3.PutBucketCorsOutput, error) + PutBucketCorsRequest(*s3.PutBucketCorsInput) (*request.Request, *s3.PutBucketCorsOutput) + + PutBucketEncryption(*s3.PutBucketEncryptionInput) (*s3.PutBucketEncryptionOutput, error) + PutBucketEncryptionWithContext(aws.Context, *s3.PutBucketEncryptionInput, ...request.Option) (*s3.PutBucketEncryptionOutput, error) + PutBucketEncryptionRequest(*s3.PutBucketEncryptionInput) (*request.Request, *s3.PutBucketEncryptionOutput) + + PutBucketInventoryConfiguration(*s3.PutBucketInventoryConfigurationInput) (*s3.PutBucketInventoryConfigurationOutput, error) + PutBucketInventoryConfigurationWithContext(aws.Context, *s3.PutBucketInventoryConfigurationInput, ...request.Option) (*s3.PutBucketInventoryConfigurationOutput, error) + PutBucketInventoryConfigurationRequest(*s3.PutBucketInventoryConfigurationInput) (*request.Request, *s3.PutBucketInventoryConfigurationOutput) + + PutBucketLifecycle(*s3.PutBucketLifecycleInput) (*s3.PutBucketLifecycleOutput, error) + PutBucketLifecycleWithContext(aws.Context, *s3.PutBucketLifecycleInput, ...request.Option) (*s3.PutBucketLifecycleOutput, error) + PutBucketLifecycleRequest(*s3.PutBucketLifecycleInput) (*request.Request, *s3.PutBucketLifecycleOutput) + + PutBucketLifecycleConfiguration(*s3.PutBucketLifecycleConfigurationInput) (*s3.PutBucketLifecycleConfigurationOutput, error) + PutBucketLifecycleConfigurationWithContext(aws.Context, *s3.PutBucketLifecycleConfigurationInput, ...request.Option) (*s3.PutBucketLifecycleConfigurationOutput, error) + PutBucketLifecycleConfigurationRequest(*s3.PutBucketLifecycleConfigurationInput) (*request.Request, *s3.PutBucketLifecycleConfigurationOutput) + + PutBucketLogging(*s3.PutBucketLoggingInput) (*s3.PutBucketLoggingOutput, error) + PutBucketLoggingWithContext(aws.Context, *s3.PutBucketLoggingInput, ...request.Option) (*s3.PutBucketLoggingOutput, error) + PutBucketLoggingRequest(*s3.PutBucketLoggingInput) (*request.Request, *s3.PutBucketLoggingOutput) + + PutBucketMetricsConfiguration(*s3.PutBucketMetricsConfigurationInput) (*s3.PutBucketMetricsConfigurationOutput, error) + PutBucketMetricsConfigurationWithContext(aws.Context, *s3.PutBucketMetricsConfigurationInput, ...request.Option) (*s3.PutBucketMetricsConfigurationOutput, error) + PutBucketMetricsConfigurationRequest(*s3.PutBucketMetricsConfigurationInput) (*request.Request, *s3.PutBucketMetricsConfigurationOutput) + + PutBucketNotification(*s3.PutBucketNotificationInput) (*s3.PutBucketNotificationOutput, error) + PutBucketNotificationWithContext(aws.Context, *s3.PutBucketNotificationInput, ...request.Option) (*s3.PutBucketNotificationOutput, error) + PutBucketNotificationRequest(*s3.PutBucketNotificationInput) (*request.Request, *s3.PutBucketNotificationOutput) + + PutBucketNotificationConfiguration(*s3.PutBucketNotificationConfigurationInput) (*s3.PutBucketNotificationConfigurationOutput, error) + PutBucketNotificationConfigurationWithContext(aws.Context, *s3.PutBucketNotificationConfigurationInput, ...request.Option) (*s3.PutBucketNotificationConfigurationOutput, error) + PutBucketNotificationConfigurationRequest(*s3.PutBucketNotificationConfigurationInput) (*request.Request, *s3.PutBucketNotificationConfigurationOutput) + + PutBucketPolicy(*s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error) + PutBucketPolicyWithContext(aws.Context, *s3.PutBucketPolicyInput, ...request.Option) (*s3.PutBucketPolicyOutput, error) + PutBucketPolicyRequest(*s3.PutBucketPolicyInput) (*request.Request, *s3.PutBucketPolicyOutput) + + PutBucketReplication(*s3.PutBucketReplicationInput) (*s3.PutBucketReplicationOutput, error) + PutBucketReplicationWithContext(aws.Context, *s3.PutBucketReplicationInput, ...request.Option) (*s3.PutBucketReplicationOutput, error) + PutBucketReplicationRequest(*s3.PutBucketReplicationInput) (*request.Request, *s3.PutBucketReplicationOutput) + + PutBucketRequestPayment(*s3.PutBucketRequestPaymentInput) (*s3.PutBucketRequestPaymentOutput, error) + PutBucketRequestPaymentWithContext(aws.Context, *s3.PutBucketRequestPaymentInput, ...request.Option) (*s3.PutBucketRequestPaymentOutput, error) + PutBucketRequestPaymentRequest(*s3.PutBucketRequestPaymentInput) (*request.Request, *s3.PutBucketRequestPaymentOutput) + + PutBucketTagging(*s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error) + PutBucketTaggingWithContext(aws.Context, *s3.PutBucketTaggingInput, ...request.Option) (*s3.PutBucketTaggingOutput, error) + PutBucketTaggingRequest(*s3.PutBucketTaggingInput) (*request.Request, *s3.PutBucketTaggingOutput) + + PutBucketVersioning(*s3.PutBucketVersioningInput) (*s3.PutBucketVersioningOutput, error) + PutBucketVersioningWithContext(aws.Context, *s3.PutBucketVersioningInput, ...request.Option) (*s3.PutBucketVersioningOutput, error) + PutBucketVersioningRequest(*s3.PutBucketVersioningInput) (*request.Request, *s3.PutBucketVersioningOutput) + + PutBucketWebsite(*s3.PutBucketWebsiteInput) (*s3.PutBucketWebsiteOutput, error) + PutBucketWebsiteWithContext(aws.Context, *s3.PutBucketWebsiteInput, ...request.Option) (*s3.PutBucketWebsiteOutput, error) + PutBucketWebsiteRequest(*s3.PutBucketWebsiteInput) (*request.Request, *s3.PutBucketWebsiteOutput) + + PutObject(*s3.PutObjectInput) (*s3.PutObjectOutput, error) + PutObjectWithContext(aws.Context, *s3.PutObjectInput, ...request.Option) (*s3.PutObjectOutput, error) + PutObjectRequest(*s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) + + PutObjectAcl(*s3.PutObjectAclInput) (*s3.PutObjectAclOutput, error) + PutObjectAclWithContext(aws.Context, *s3.PutObjectAclInput, ...request.Option) (*s3.PutObjectAclOutput, error) + PutObjectAclRequest(*s3.PutObjectAclInput) (*request.Request, *s3.PutObjectAclOutput) + + PutObjectTagging(*s3.PutObjectTaggingInput) (*s3.PutObjectTaggingOutput, error) + PutObjectTaggingWithContext(aws.Context, *s3.PutObjectTaggingInput, ...request.Option) (*s3.PutObjectTaggingOutput, error) + PutObjectTaggingRequest(*s3.PutObjectTaggingInput) (*request.Request, *s3.PutObjectTaggingOutput) + + RestoreObject(*s3.RestoreObjectInput) (*s3.RestoreObjectOutput, error) + RestoreObjectWithContext(aws.Context, *s3.RestoreObjectInput, ...request.Option) (*s3.RestoreObjectOutput, error) + RestoreObjectRequest(*s3.RestoreObjectInput) (*request.Request, *s3.RestoreObjectOutput) + + SelectObjectContent(*s3.SelectObjectContentInput) (*s3.SelectObjectContentOutput, error) + SelectObjectContentWithContext(aws.Context, *s3.SelectObjectContentInput, ...request.Option) (*s3.SelectObjectContentOutput, error) + SelectObjectContentRequest(*s3.SelectObjectContentInput) (*request.Request, *s3.SelectObjectContentOutput) + + UploadPart(*s3.UploadPartInput) (*s3.UploadPartOutput, error) + UploadPartWithContext(aws.Context, *s3.UploadPartInput, ...request.Option) (*s3.UploadPartOutput, error) + UploadPartRequest(*s3.UploadPartInput) (*request.Request, *s3.UploadPartOutput) + + UploadPartCopy(*s3.UploadPartCopyInput) (*s3.UploadPartCopyOutput, error) + UploadPartCopyWithContext(aws.Context, *s3.UploadPartCopyInput, ...request.Option) (*s3.UploadPartCopyOutput, error) + UploadPartCopyRequest(*s3.UploadPartCopyInput) (*request.Request, *s3.UploadPartCopyOutput) + + WaitUntilBucketExists(*s3.HeadBucketInput) error + WaitUntilBucketExistsWithContext(aws.Context, *s3.HeadBucketInput, ...request.WaiterOption) error + + WaitUntilBucketNotExists(*s3.HeadBucketInput) error + WaitUntilBucketNotExistsWithContext(aws.Context, *s3.HeadBucketInput, ...request.WaiterOption) error + + WaitUntilObjectExists(*s3.HeadObjectInput) error + WaitUntilObjectExistsWithContext(aws.Context, *s3.HeadObjectInput, ...request.WaiterOption) error + + WaitUntilObjectNotExists(*s3.HeadObjectInput) error + WaitUntilObjectNotExistsWithContext(aws.Context, *s3.HeadObjectInput, ...request.WaiterOption) error +} + +var _ S3API = (*s3.S3)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/BUILD.bazel new file mode 100644 index 00000000000..6af5ed9d827 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "batch.go", + "bucket_region.go", + "doc.go", + "download.go", + "upload.go", + ], + importmap = "installer/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager", + importpath = "github.com/aws/aws-sdk-go/service/s3/s3manager", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/s3:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/s3/s3iface:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch.go new file mode 100644 index 00000000000..18215574bf3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch.go @@ -0,0 +1,529 @@ +package s3manager + +import ( + "bytes" + "fmt" + "io" + + "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" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +const ( + // DefaultBatchSize is the batch size we initialize when constructing a batch delete client. + // This value is used when calling DeleteObjects. This represents how many objects to delete + // per DeleteObjects call. + DefaultBatchSize = 100 +) + +// BatchError will contain the key and bucket of the object that failed to +// either upload or download. +type BatchError struct { + Errors Errors + code string + message string +} + +// Errors is a typed alias for a slice of errors to satisfy the error +// interface. +type Errors []Error + +func (errs Errors) Error() string { + buf := bytes.NewBuffer(nil) + for i, err := range errs { + buf.WriteString(err.Error()) + if i+1 < len(errs) { + buf.WriteString("\n") + } + } + return buf.String() +} + +// Error will contain the original error, bucket, and key of the operation that failed +// during batch operations. +type Error struct { + OrigErr error + Bucket *string + Key *string +} + +func newError(err error, bucket, key *string) Error { + return Error{ + err, + bucket, + key, + } +} + +func (err *Error) Error() string { + origErr := "" + if err.OrigErr != nil { + origErr = ":\n" + err.OrigErr.Error() + } + return fmt.Sprintf("failed to perform batch operation on %q to %q%s", + aws.StringValue(err.Key), + aws.StringValue(err.Bucket), + origErr, + ) +} + +// NewBatchError will return a BatchError that satisfies the awserr.Error interface. +func NewBatchError(code, message string, err []Error) awserr.Error { + return &BatchError{ + Errors: err, + code: code, + message: message, + } +} + +// Code will return the code associated with the batch error. +func (err *BatchError) Code() string { + return err.code +} + +// Message will return the message associated with the batch error. +func (err *BatchError) Message() string { + return err.message +} + +func (err *BatchError) Error() string { + return awserr.SprintError(err.Code(), err.Message(), "", err.Errors) +} + +// OrigErr will return the original error. Which, in this case, will always be nil +// for batched operations. +func (err *BatchError) OrigErr() error { + return err.Errors +} + +// BatchDeleteIterator is an interface that uses the scanner pattern to +// iterate through what needs to be deleted. +type BatchDeleteIterator interface { + Next() bool + Err() error + DeleteObject() BatchDeleteObject +} + +// DeleteListIterator is an alternative iterator for the BatchDelete client. This will +// iterate through a list of objects and delete the objects. +// +// Example: +// iter := &s3manager.DeleteListIterator{ +// Client: svc, +// Input: &s3.ListObjectsInput{ +// Bucket: aws.String("bucket"), +// MaxKeys: aws.Int64(5), +// }, +// Paginator: request.Pagination{ +// NewRequest: func() (*request.Request, error) { +// var inCpy *ListObjectsInput +// if input != nil { +// tmp := *input +// inCpy = &tmp +// } +// req, _ := c.ListObjectsRequest(inCpy) +// return req, nil +// }, +// }, +// } +// +// batcher := s3manager.NewBatchDeleteWithClient(svc) +// if err := batcher.Delete(aws.BackgroundContext(), iter); err != nil { +// return err +// } +type DeleteListIterator struct { + Bucket *string + Paginator request.Pagination + objects []*s3.Object +} + +// NewDeleteListIterator will return a new DeleteListIterator. +func NewDeleteListIterator(svc s3iface.S3API, input *s3.ListObjectsInput, opts ...func(*DeleteListIterator)) BatchDeleteIterator { + iter := &DeleteListIterator{ + Bucket: input.Bucket, + Paginator: request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *s3.ListObjectsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := svc.ListObjectsRequest(inCpy) + return req, nil + }, + }, + } + + for _, opt := range opts { + opt(iter) + } + return iter +} + +// Next will use the S3API client to iterate through a list of objects. +func (iter *DeleteListIterator) Next() bool { + if len(iter.objects) > 0 { + iter.objects = iter.objects[1:] + } + + if len(iter.objects) == 0 && iter.Paginator.Next() { + iter.objects = iter.Paginator.Page().(*s3.ListObjectsOutput).Contents + } + + return len(iter.objects) > 0 +} + +// Err will return the last known error from Next. +func (iter *DeleteListIterator) Err() error { + return iter.Paginator.Err() +} + +// DeleteObject will return the current object to be deleted. +func (iter *DeleteListIterator) DeleteObject() BatchDeleteObject { + return BatchDeleteObject{ + Object: &s3.DeleteObjectInput{ + Bucket: iter.Bucket, + Key: iter.objects[0].Key, + }, + } +} + +// BatchDelete will use the s3 package's service client to perform a batch +// delete. +type BatchDelete struct { + Client s3iface.S3API + BatchSize int +} + +// NewBatchDeleteWithClient will return a new delete client that can delete a batched amount of +// objects. +// +// Example: +// batcher := s3manager.NewBatchDeleteWithClient(client, size) +// +// objects := []BatchDeleteObject{ +// { +// Object: &s3.DeleteObjectInput { +// Key: aws.String("key"), +// Bucket: aws.String("bucket"), +// }, +// }, +// } +// +// if err := batcher.Delete(aws.BackgroundContext(), &s3manager.DeleteObjectsIterator{ +// Objects: objects, +// }); err != nil { +// return err +// } +func NewBatchDeleteWithClient(client s3iface.S3API, options ...func(*BatchDelete)) *BatchDelete { + svc := &BatchDelete{ + Client: client, + BatchSize: DefaultBatchSize, + } + + for _, opt := range options { + opt(svc) + } + + return svc +} + +// NewBatchDelete will return a new delete client that can delete a batched amount of +// objects. +// +// Example: +// batcher := s3manager.NewBatchDelete(sess, size) +// +// objects := []BatchDeleteObject{ +// { +// Object: &s3.DeleteObjectInput { +// Key: aws.String("key"), +// Bucket: aws.String("bucket"), +// }, +// }, +// } +// +// if err := batcher.Delete(aws.BackgroundContext(), &s3manager.DeleteObjectsIterator{ +// Objects: objects, +// }); err != nil { +// return err +// } +func NewBatchDelete(c client.ConfigProvider, options ...func(*BatchDelete)) *BatchDelete { + client := s3.New(c) + return NewBatchDeleteWithClient(client, options...) +} + +// BatchDeleteObject is a wrapper object for calling the batch delete operation. +type BatchDeleteObject struct { + Object *s3.DeleteObjectInput + // After will run after each iteration during the batch process. This function will + // be executed whether or not the request was successful. + After func() error +} + +// DeleteObjectsIterator is an interface that uses the scanner pattern to iterate +// through a series of objects to be deleted. +type DeleteObjectsIterator struct { + Objects []BatchDeleteObject + index int + inc bool +} + +// Next will increment the default iterator's index and and ensure that there +// is another object to iterator to. +func (iter *DeleteObjectsIterator) Next() bool { + if iter.inc { + iter.index++ + } else { + iter.inc = true + } + return iter.index < len(iter.Objects) +} + +// Err will return an error. Since this is just used to satisfy the BatchDeleteIterator interface +// this will only return nil. +func (iter *DeleteObjectsIterator) Err() error { + return nil +} + +// DeleteObject will return the BatchDeleteObject at the current batched index. +func (iter *DeleteObjectsIterator) DeleteObject() BatchDeleteObject { + object := iter.Objects[iter.index] + return object +} + +// Delete will use the iterator to queue up objects that need to be deleted. +// Once the batch size is met, this will call the deleteBatch function. +func (d *BatchDelete) Delete(ctx aws.Context, iter BatchDeleteIterator) error { + var errs []Error + objects := []BatchDeleteObject{} + var input *s3.DeleteObjectsInput + + for iter.Next() { + o := iter.DeleteObject() + + if input == nil { + input = initDeleteObjectsInput(o.Object) + } + + parity := hasParity(input, o) + if parity { + input.Delete.Objects = append(input.Delete.Objects, &s3.ObjectIdentifier{ + Key: o.Object.Key, + VersionId: o.Object.VersionId, + }) + objects = append(objects, o) + } + + if len(input.Delete.Objects) == d.BatchSize || !parity { + if err := deleteBatch(ctx, d, input, objects); err != nil { + errs = append(errs, err...) + } + + objects = objects[:0] + input = nil + + if !parity { + objects = append(objects, o) + input = initDeleteObjectsInput(o.Object) + input.Delete.Objects = append(input.Delete.Objects, &s3.ObjectIdentifier{ + Key: o.Object.Key, + VersionId: o.Object.VersionId, + }) + } + } + } + + // iter.Next() could return false (above) plus populate iter.Err() + if iter.Err() != nil { + errs = append(errs, newError(iter.Err(), nil, nil)) + } + + if input != nil && len(input.Delete.Objects) > 0 { + if err := deleteBatch(ctx, d, input, objects); err != nil { + errs = append(errs, err...) + } + } + + if len(errs) > 0 { + return NewBatchError("BatchedDeleteIncomplete", "some objects have failed to be deleted.", errs) + } + return nil +} + +func initDeleteObjectsInput(o *s3.DeleteObjectInput) *s3.DeleteObjectsInput { + return &s3.DeleteObjectsInput{ + Bucket: o.Bucket, + MFA: o.MFA, + RequestPayer: o.RequestPayer, + Delete: &s3.Delete{}, + } +} + +const ( + // ErrDeleteBatchFailCode represents an error code which will be returned + // only when DeleteObjects.Errors has an error that does not contain a code. + ErrDeleteBatchFailCode = "DeleteBatchError" + errDefaultDeleteBatchMessage = "failed to delete" +) + +// deleteBatch will delete a batch of items in the objects parameters. +func deleteBatch(ctx aws.Context, d *BatchDelete, input *s3.DeleteObjectsInput, objects []BatchDeleteObject) []Error { + errs := []Error{} + + if result, err := d.Client.DeleteObjectsWithContext(ctx, input); err != nil { + for i := 0; i < len(input.Delete.Objects); i++ { + errs = append(errs, newError(err, input.Bucket, input.Delete.Objects[i].Key)) + } + } else if len(result.Errors) > 0 { + for i := 0; i < len(result.Errors); i++ { + code := ErrDeleteBatchFailCode + msg := errDefaultDeleteBatchMessage + if result.Errors[i].Message != nil { + msg = *result.Errors[i].Message + } + if result.Errors[i].Code != nil { + code = *result.Errors[i].Code + } + + errs = append(errs, newError(awserr.New(code, msg, err), input.Bucket, result.Errors[i].Key)) + } + } + for _, object := range objects { + if object.After == nil { + continue + } + if err := object.After(); err != nil { + errs = append(errs, newError(err, object.Object.Bucket, object.Object.Key)) + } + } + + return errs +} + +func hasParity(o1 *s3.DeleteObjectsInput, o2 BatchDeleteObject) bool { + if o1.Bucket != nil && o2.Object.Bucket != nil { + if *o1.Bucket != *o2.Object.Bucket { + return false + } + } else if o1.Bucket != o2.Object.Bucket { + return false + } + + if o1.MFA != nil && o2.Object.MFA != nil { + if *o1.MFA != *o2.Object.MFA { + return false + } + } else if o1.MFA != o2.Object.MFA { + return false + } + + if o1.RequestPayer != nil && o2.Object.RequestPayer != nil { + if *o1.RequestPayer != *o2.Object.RequestPayer { + return false + } + } else if o1.RequestPayer != o2.Object.RequestPayer { + return false + } + + return true +} + +// BatchDownloadIterator is an interface that uses the scanner pattern to iterate +// through a series of objects to be downloaded. +type BatchDownloadIterator interface { + Next() bool + Err() error + DownloadObject() BatchDownloadObject +} + +// BatchDownloadObject contains all necessary information to run a batch operation once. +type BatchDownloadObject struct { + Object *s3.GetObjectInput + Writer io.WriterAt + // After will run after each iteration during the batch process. This function will + // be executed whether or not the request was successful. + After func() error +} + +// DownloadObjectsIterator implements the BatchDownloadIterator interface and allows for batched +// download of objects. +type DownloadObjectsIterator struct { + Objects []BatchDownloadObject + index int + inc bool +} + +// Next will increment the default iterator's index and and ensure that there +// is another object to iterator to. +func (batcher *DownloadObjectsIterator) Next() bool { + if batcher.inc { + batcher.index++ + } else { + batcher.inc = true + } + return batcher.index < len(batcher.Objects) +} + +// DownloadObject will return the BatchDownloadObject at the current batched index. +func (batcher *DownloadObjectsIterator) DownloadObject() BatchDownloadObject { + object := batcher.Objects[batcher.index] + return object +} + +// Err will return an error. Since this is just used to satisfy the BatchDeleteIterator interface +// this will only return nil. +func (batcher *DownloadObjectsIterator) Err() error { + return nil +} + +// BatchUploadIterator is an interface that uses the scanner pattern to +// iterate through what needs to be uploaded. +type BatchUploadIterator interface { + Next() bool + Err() error + UploadObject() BatchUploadObject +} + +// UploadObjectsIterator implements the BatchUploadIterator interface and allows for batched +// upload of objects. +type UploadObjectsIterator struct { + Objects []BatchUploadObject + index int + inc bool +} + +// Next will increment the default iterator's index and and ensure that there +// is another object to iterator to. +func (batcher *UploadObjectsIterator) Next() bool { + if batcher.inc { + batcher.index++ + } else { + batcher.inc = true + } + return batcher.index < len(batcher.Objects) +} + +// Err will return an error. Since this is just used to satisfy the BatchUploadIterator interface +// this will only return nil. +func (batcher *UploadObjectsIterator) Err() error { + return nil +} + +// UploadObject will return the BatchUploadObject at the current batched index. +func (batcher *UploadObjectsIterator) UploadObject() BatchUploadObject { + object := batcher.Objects[batcher.index] + return object +} + +// BatchUploadObject contains all necessary information to run a batch operation once. +type BatchUploadObject struct { + Object *UploadInput + // After will run after each iteration during the batch process. This function will + // be executed whether or not the request was successful. + After func() error +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go new file mode 100644 index 00000000000..f61665a58a4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go @@ -0,0 +1,88 @@ +package s3manager + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// GetBucketRegion will attempt to get the region for a bucket using the +// regionHint to determine which AWS partition to perform the query on. +// +// The request will not be signed, and will not use your AWS credentials. +// +// A "NotFound" error code will be returned if the bucket does not exist in the +// AWS partition the regionHint belongs to. If the regionHint parameter is an +// empty string GetBucketRegion will fallback to the ConfigProvider's region +// config. If the regionHint is empty, and the ConfigProvider does not have a +// region value, an error will be returned.. +// +// For example to get the region of a bucket which exists in "eu-central-1" +// you could provide a region hint of "us-west-2". +// +// sess := session.Must(session.NewSession()) +// +// bucket := "my-bucket" +// region, err := s3manager.GetBucketRegion(ctx, sess, bucket, "us-west-2") +// if err != nil { +// if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" { +// fmt.Fprintf(os.Stderr, "unable to find bucket %s's region not found\n", bucket) +// } +// return err +// } +// fmt.Printf("Bucket %s is in %s region\n", bucket, region) +// +func GetBucketRegion(ctx aws.Context, c client.ConfigProvider, bucket, regionHint string, opts ...request.Option) (string, error) { + var cfg aws.Config + if len(regionHint) != 0 { + cfg.Region = aws.String(regionHint) + } + svc := s3.New(c, &cfg) + return GetBucketRegionWithClient(ctx, svc, bucket, opts...) +} + +const bucketRegionHeader = "X-Amz-Bucket-Region" + +// GetBucketRegionWithClient is the same as GetBucketRegion with the exception +// that it takes a S3 service client instead of a Session. The regionHint is +// derived from the region the S3 service client was created in. +// +// See GetBucketRegion for more information. +func GetBucketRegionWithClient(ctx aws.Context, svc s3iface.S3API, bucket string, opts ...request.Option) (string, error) { + req, _ := svc.HeadBucketRequest(&s3.HeadBucketInput{ + Bucket: aws.String(bucket), + }) + req.Config.S3ForcePathStyle = aws.Bool(true) + req.Config.Credentials = credentials.AnonymousCredentials + req.SetContext(ctx) + + // Disable HTTP redirects to prevent an invalid 301 from eating the response + // because Go's HTTP client will fail, and drop the response if an 301 is + // received without a location header. S3 will return a 301 without the + // location header for HeadObject API calls. + req.DisableFollowRedirects = true + + var bucketRegion string + req.Handlers.Send.PushBack(func(r *request.Request) { + bucketRegion = r.HTTPResponse.Header.Get(bucketRegionHeader) + if len(bucketRegion) == 0 { + return + } + r.HTTPResponse.StatusCode = 200 + r.HTTPResponse.Status = "OK" + r.Error = nil + }) + + req.ApplyOptions(opts...) + + if err := req.Send(); err != nil { + return "", err + } + + bucketRegion = s3.NormalizeBucketLocation(bucketRegion) + + return bucketRegion, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go new file mode 100644 index 00000000000..229c0d63bda --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go @@ -0,0 +1,3 @@ +// Package s3manager provides utilities to upload and download objects from +// S3 concurrently. Helpful for when working with large objects. +package s3manager diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go new file mode 100644 index 00000000000..4a9ad65e49e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go @@ -0,0 +1,555 @@ +package s3manager + +import ( + "fmt" + "io" + "net/http" + "strconv" + "strings" + "sync" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// DefaultDownloadPartSize is the default range of bytes to get at a time when +// using Download(). +const DefaultDownloadPartSize = 1024 * 1024 * 5 + +// DefaultDownloadConcurrency is the default number of goroutines to spin up +// when using Download(). +const DefaultDownloadConcurrency = 5 + +// The Downloader structure that calls Download(). It is safe to call Download() +// on this structure for multiple objects and across concurrent goroutines. +// Mutating the Downloader's properties is not safe to be done concurrently. +type Downloader struct { + // The buffer size (in bytes) to use when buffering data into chunks and + // sending them as parts to S3. The minimum allowed part size is 5MB, and + // if this value is set to zero, the DefaultDownloadPartSize value will be used. + // + // PartSize is ignored if the Range input parameter is provided. + PartSize int64 + + // The number of goroutines to spin up in parallel when sending parts. + // If this is set to zero, the DefaultDownloadConcurrency value will be used. + // + // Concurrency of 1 will download the parts sequentially. + // + // Concurrency is ignored if the Range input parameter is provided. + Concurrency int + + // An S3 client to use when performing downloads. + S3 s3iface.S3API + + // List of request options that will be passed down to individual API + // operation requests made by the downloader. + RequestOptions []request.Option +} + +// WithDownloaderRequestOptions appends to the Downloader's API request options. +func WithDownloaderRequestOptions(opts ...request.Option) func(*Downloader) { + return func(d *Downloader) { + d.RequestOptions = append(d.RequestOptions, opts...) + } +} + +// NewDownloader creates a new Downloader instance to downloads objects from +// S3 in concurrent chunks. Pass in additional functional options to customize +// the downloader behavior. Requires a client.ConfigProvider in order to create +// a S3 service client. The session.Session satisfies the client.ConfigProvider +// interface. +// +// Example: +// // The session the S3 Downloader will use +// sess := session.Must(session.NewSession()) +// +// // Create a downloader with the session and default options +// downloader := s3manager.NewDownloader(sess) +// +// // Create a downloader with the session and custom options +// downloader := s3manager.NewDownloader(sess, func(d *s3manager.Downloader) { +// d.PartSize = 64 * 1024 * 1024 // 64MB per part +// }) +func NewDownloader(c client.ConfigProvider, options ...func(*Downloader)) *Downloader { + d := &Downloader{ + S3: s3.New(c), + PartSize: DefaultDownloadPartSize, + Concurrency: DefaultDownloadConcurrency, + } + for _, option := range options { + option(d) + } + + return d +} + +// NewDownloaderWithClient creates a new Downloader instance to downloads +// objects from S3 in concurrent chunks. Pass in additional functional +// options to customize the downloader behavior. Requires a S3 service client +// to make S3 API calls. +// +// Example: +// // The session the S3 Downloader will use +// sess := session.Must(session.NewSession()) +// +// // The S3 client the S3 Downloader will use +// s3Svc := s3.new(sess) +// +// // Create a downloader with the s3 client and default options +// downloader := s3manager.NewDownloaderWithClient(s3Svc) +// +// // Create a downloader with the s3 client and custom options +// downloader := s3manager.NewDownloaderWithClient(s3Svc, func(d *s3manager.Downloader) { +// d.PartSize = 64 * 1024 * 1024 // 64MB per part +// }) +func NewDownloaderWithClient(svc s3iface.S3API, options ...func(*Downloader)) *Downloader { + d := &Downloader{ + S3: svc, + PartSize: DefaultDownloadPartSize, + Concurrency: DefaultDownloadConcurrency, + } + for _, option := range options { + option(d) + } + + return d +} + +type maxRetrier interface { + MaxRetries() int +} + +// Download downloads an object in S3 and writes the payload into w using +// concurrent GET requests. +// +// Additional functional options can be provided to configure the individual +// download. These options are copies of the Downloader instance Download is called from. +// Modifying the options will not impact the original Downloader instance. +// +// It is safe to call this method concurrently across goroutines. +// +// The w io.WriterAt can be satisfied by an os.File to do multipart concurrent +// downloads, or in memory []byte wrapper using aws.WriteAtBuffer. +// +// Specifying a Downloader.Concurrency of 1 will cause the Downloader to +// download the parts from S3 sequentially. +// +// If the GetObjectInput's Range value is provided that will cause the downloader +// to perform a single GetObjectInput request for that object's range. This will +// caused the part size, and concurrency configurations to be ignored. +func (d Downloader) Download(w io.WriterAt, input *s3.GetObjectInput, options ...func(*Downloader)) (n int64, err error) { + return d.DownloadWithContext(aws.BackgroundContext(), w, input, options...) +} + +// DownloadWithContext downloads an object in S3 and writes the payload into w +// using concurrent GET requests. +// +// DownloadWithContext is the same as Download with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. The +// DownloadWithContext may create sub-contexts for individual underlying +// requests. +// +// Additional functional options can be provided to configure the individual +// download. These options are copies of the Downloader instance Download is +// called from. Modifying the options will not impact the original Downloader +// instance. Use the WithDownloaderRequestOptions helper function to pass in request +// options that will be applied to all API operations made with this downloader. +// +// The w io.WriterAt can be satisfied by an os.File to do multipart concurrent +// downloads, or in memory []byte wrapper using aws.WriteAtBuffer. +// +// Specifying a Downloader.Concurrency of 1 will cause the Downloader to +// download the parts from S3 sequentially. +// +// It is safe to call this method concurrently across goroutines. +// +// If the GetObjectInput's Range value is provided that will cause the downloader +// to perform a single GetObjectInput request for that object's range. This will +// caused the part size, and concurrency configurations to be ignored. +func (d Downloader) DownloadWithContext(ctx aws.Context, w io.WriterAt, input *s3.GetObjectInput, options ...func(*Downloader)) (n int64, err error) { + impl := downloader{w: w, in: input, cfg: d, ctx: ctx} + + for _, option := range options { + option(&impl.cfg) + } + impl.cfg.RequestOptions = append(impl.cfg.RequestOptions, request.WithAppendUserAgent("S3Manager")) + + if s, ok := d.S3.(maxRetrier); ok { + impl.partBodyMaxRetries = s.MaxRetries() + } + + impl.totalBytes = -1 + if impl.cfg.Concurrency == 0 { + impl.cfg.Concurrency = DefaultDownloadConcurrency + } + + if impl.cfg.PartSize == 0 { + impl.cfg.PartSize = DefaultDownloadPartSize + } + + return impl.download() +} + +// DownloadWithIterator will download a batched amount of objects in S3 and writes them +// to the io.WriterAt specificed in the iterator. +// +// Example: +// svc := s3manager.NewDownloader(session) +// +// fooFile, err := os.Open("/tmp/foo.file") +// if err != nil { +// return err +// } +// +// barFile, err := os.Open("/tmp/bar.file") +// if err != nil { +// return err +// } +// +// objects := []s3manager.BatchDownloadObject { +// { +// Object: &s3.GetObjectInput { +// Bucket: aws.String("bucket"), +// Key: aws.String("foo"), +// }, +// Writer: fooFile, +// }, +// { +// Object: &s3.GetObjectInput { +// Bucket: aws.String("bucket"), +// Key: aws.String("bar"), +// }, +// Writer: barFile, +// }, +// } +// +// iter := &s3manager.DownloadObjectsIterator{Objects: objects} +// if err := svc.DownloadWithIterator(aws.BackgroundContext(), iter); err != nil { +// return err +// } +func (d Downloader) DownloadWithIterator(ctx aws.Context, iter BatchDownloadIterator, opts ...func(*Downloader)) error { + var errs []Error + for iter.Next() { + object := iter.DownloadObject() + if _, err := d.DownloadWithContext(ctx, object.Writer, object.Object, opts...); err != nil { + errs = append(errs, newError(err, object.Object.Bucket, object.Object.Key)) + } + + if object.After == nil { + continue + } + + if err := object.After(); err != nil { + errs = append(errs, newError(err, object.Object.Bucket, object.Object.Key)) + } + } + + if len(errs) > 0 { + return NewBatchError("BatchedDownloadIncomplete", "some objects have failed to download.", errs) + } + return nil +} + +// downloader is the implementation structure used internally by Downloader. +type downloader struct { + ctx aws.Context + cfg Downloader + + in *s3.GetObjectInput + w io.WriterAt + + wg sync.WaitGroup + m sync.Mutex + + pos int64 + totalBytes int64 + written int64 + err error + + partBodyMaxRetries int +} + +// download performs the implementation of the object download across ranged +// GETs. +func (d *downloader) download() (n int64, err error) { + // If range is specified fall back to single download of that range + // this enables the functionality of ranged gets with the downloader but + // at the cost of no multipart downloads. + if rng := aws.StringValue(d.in.Range); len(rng) > 0 { + d.downloadRange(rng) + return d.written, d.err + } + + // Spin off first worker to check additional header information + d.getChunk() + + if total := d.getTotalBytes(); total >= 0 { + // Spin up workers + ch := make(chan dlchunk, d.cfg.Concurrency) + + for i := 0; i < d.cfg.Concurrency; i++ { + d.wg.Add(1) + go d.downloadPart(ch) + } + + // Assign work + for d.getErr() == nil { + if d.pos >= total { + break // We're finished queuing chunks + } + + // Queue the next range of bytes to read. + ch <- dlchunk{w: d.w, start: d.pos, size: d.cfg.PartSize} + d.pos += d.cfg.PartSize + } + + // Wait for completion + close(ch) + d.wg.Wait() + } else { + // Checking if we read anything new + for d.err == nil { + d.getChunk() + } + + // We expect a 416 error letting us know we are done downloading the + // total bytes. Since we do not know the content's length, this will + // keep grabbing chunks of data until the range of bytes specified in + // the request is out of range of the content. Once, this happens, a + // 416 should occur. + e, ok := d.err.(awserr.RequestFailure) + if ok && e.StatusCode() == http.StatusRequestedRangeNotSatisfiable { + d.err = nil + } + } + + // Return error + return d.written, d.err +} + +// downloadPart is an individual goroutine worker reading from the ch channel +// and performing a GetObject request on the data with a given byte range. +// +// If this is the first worker, this operation also resolves the total number +// of bytes to be read so that the worker manager knows when it is finished. +func (d *downloader) downloadPart(ch chan dlchunk) { + defer d.wg.Done() + for { + chunk, ok := <-ch + if !ok { + break + } + if d.getErr() != nil { + // Drain the channel if there is an error, to prevent deadlocking + // of download producer. + continue + } + + if err := d.downloadChunk(chunk); err != nil { + d.setErr(err) + } + } +} + +// getChunk grabs a chunk of data from the body. +// Not thread safe. Should only used when grabbing data on a single thread. +func (d *downloader) getChunk() { + if d.getErr() != nil { + return + } + + chunk := dlchunk{w: d.w, start: d.pos, size: d.cfg.PartSize} + d.pos += d.cfg.PartSize + + if err := d.downloadChunk(chunk); err != nil { + d.setErr(err) + } +} + +// downloadRange downloads an Object given the passed in Byte-Range value. +// The chunk used down download the range will be configured for that range. +func (d *downloader) downloadRange(rng string) { + if d.getErr() != nil { + return + } + + chunk := dlchunk{w: d.w, start: d.pos} + // Ranges specified will short circuit the multipart download + chunk.withRange = rng + + if err := d.downloadChunk(chunk); err != nil { + d.setErr(err) + } + + // Update the position based on the amount of data received. + d.pos = d.written +} + +// downloadChunk downloads the chunk from s3 +func (d *downloader) downloadChunk(chunk dlchunk) error { + in := &s3.GetObjectInput{} + awsutil.Copy(in, d.in) + + // Get the next byte range of data + in.Range = aws.String(chunk.ByteRange()) + + var n int64 + var err error + for retry := 0; retry <= d.partBodyMaxRetries; retry++ { + var resp *s3.GetObjectOutput + resp, err = d.cfg.S3.GetObjectWithContext(d.ctx, in, d.cfg.RequestOptions...) + if err != nil { + return err + } + d.setTotalBytes(resp) // Set total if not yet set. + + n, err = io.Copy(&chunk, resp.Body) + resp.Body.Close() + if err == nil { + break + } + + chunk.cur = 0 + logMessage(d.cfg.S3, aws.LogDebugWithRequestRetries, + fmt.Sprintf("DEBUG: object part body download interrupted %s, err, %v, retrying attempt %d", + aws.StringValue(in.Key), err, retry)) + } + + d.incrWritten(n) + + return err +} + +func logMessage(svc s3iface.S3API, level aws.LogLevelType, msg string) { + s, ok := svc.(*s3.S3) + if !ok { + return + } + + if s.Config.Logger == nil { + return + } + + if s.Config.LogLevel.Matches(level) { + s.Config.Logger.Log(msg) + } +} + +// getTotalBytes is a thread-safe getter for retrieving the total byte status. +func (d *downloader) getTotalBytes() int64 { + d.m.Lock() + defer d.m.Unlock() + + return d.totalBytes +} + +// setTotalBytes is a thread-safe setter for setting the total byte status. +// Will extract the object's total bytes from the Content-Range if the file +// will be chunked, or Content-Length. Content-Length is used when the response +// does not include a Content-Range. Meaning the object was not chunked. This +// occurs when the full file fits within the PartSize directive. +func (d *downloader) setTotalBytes(resp *s3.GetObjectOutput) { + d.m.Lock() + defer d.m.Unlock() + + if d.totalBytes >= 0 { + return + } + + if resp.ContentRange == nil { + // ContentRange is nil when the full file contents is provided, and + // is not chunked. Use ContentLength instead. + if resp.ContentLength != nil { + d.totalBytes = *resp.ContentLength + return + } + } else { + parts := strings.Split(*resp.ContentRange, "/") + + total := int64(-1) + var err error + // Checking for whether or not a numbered total exists + // If one does not exist, we will assume the total to be -1, undefined, + // and sequentially download each chunk until hitting a 416 error + totalStr := parts[len(parts)-1] + if totalStr != "*" { + total, err = strconv.ParseInt(totalStr, 10, 64) + if err != nil { + d.err = err + return + } + } + + d.totalBytes = total + } +} + +func (d *downloader) incrWritten(n int64) { + d.m.Lock() + defer d.m.Unlock() + + d.written += n +} + +// getErr is a thread-safe getter for the error object +func (d *downloader) getErr() error { + d.m.Lock() + defer d.m.Unlock() + + return d.err +} + +// setErr is a thread-safe setter for the error object +func (d *downloader) setErr(e error) { + d.m.Lock() + defer d.m.Unlock() + + d.err = e +} + +// dlchunk represents a single chunk of data to write by the worker routine. +// This structure also implements an io.SectionReader style interface for +// io.WriterAt, effectively making it an io.SectionWriter (which does not +// exist). +type dlchunk struct { + w io.WriterAt + start int64 + size int64 + cur int64 + + // specifies the byte range the chunk should be downloaded with. + withRange string +} + +// Write wraps io.WriterAt for the dlchunk, writing from the dlchunk's start +// position to its end (or EOF). +// +// If a range is specified on the dlchunk the size will be ignored when writing. +// as the total size may not of be known ahead of time. +func (c *dlchunk) Write(p []byte) (n int, err error) { + if c.cur >= c.size && len(c.withRange) == 0 { + return 0, io.EOF + } + + n, err = c.w.WriteAt(p, c.start+c.cur) + c.cur += int64(n) + + return +} + +// ByteRange returns a HTTP Byte-Range header value that should be used by the +// client to request the chunk's range. +func (c *dlchunk) ByteRange() string { + if len(c.withRange) != 0 { + return c.withRange + } + + return fmt.Sprintf("bytes=%d-%d", c.start, c.start+c.size-1) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go new file mode 100644 index 00000000000..0ccf634c5bc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go @@ -0,0 +1,802 @@ +package s3manager + +import ( + "bytes" + "fmt" + "io" + "sort" + "sync" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// MaxUploadParts is the maximum allowed number of parts in a multi-part upload +// on Amazon S3. +const MaxUploadParts = 10000 + +// MinUploadPartSize is the minimum allowed part size when uploading a part to +// Amazon S3. +const MinUploadPartSize int64 = 1024 * 1024 * 5 + +// DefaultUploadPartSize is the default part size to buffer chunks of a +// payload into. +const DefaultUploadPartSize = MinUploadPartSize + +// DefaultUploadConcurrency is the default number of goroutines to spin up when +// using Upload(). +const DefaultUploadConcurrency = 5 + +// A MultiUploadFailure wraps a failed S3 multipart upload. An error returned +// will satisfy this interface when a multi part upload failed to upload all +// chucks to S3. In the case of a failure the UploadID is needed to operate on +// the chunks, if any, which were uploaded. +// +// Example: +// +// u := s3manager.NewUploader(opts) +// output, err := u.upload(input) +// if err != nil { +// if multierr, ok := err.(s3manager.MultiUploadFailure); ok { +// // Process error and its associated uploadID +// fmt.Println("Error:", multierr.Code(), multierr.Message(), multierr.UploadID()) +// } else { +// // Process error generically +// fmt.Println("Error:", err.Error()) +// } +// } +// +type MultiUploadFailure interface { + awserr.Error + + // Returns the upload id for the S3 multipart upload that failed. + UploadID() string +} + +// So that the Error interface type can be included as an anonymous field +// in the multiUploadError struct and not conflict with the error.Error() method. +type awsError awserr.Error + +// A multiUploadError wraps the upload ID of a failed s3 multipart upload. +// Composed of BaseError for code, message, and original error +// +// Should be used for an error that occurred failing a S3 multipart upload, +// and a upload ID is available. If an uploadID is not available a more relevant +type multiUploadError struct { + awsError + + // ID for multipart upload which failed. + uploadID string +} + +// Error returns the string representation of the error. +// +// See apierr.BaseError ErrorWithExtra for output format +// +// Satisfies the error interface. +func (m multiUploadError) Error() string { + extra := fmt.Sprintf("upload id: %s", m.uploadID) + return awserr.SprintError(m.Code(), m.Message(), extra, m.OrigErr()) +} + +// String returns the string representation of the error. +// Alias for Error to satisfy the stringer interface. +func (m multiUploadError) String() string { + return m.Error() +} + +// UploadID returns the id of the S3 upload which failed. +func (m multiUploadError) UploadID() string { + return m.uploadID +} + +// UploadInput contains all input for upload requests to Amazon S3. +type UploadInput struct { + // The canned ACL to apply to the object. + ACL *string `location:"header" locationName:"x-amz-acl" type:"string"` + + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` + + // The base64-encoded 128-bit MD5 digest of the part data. + ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` + + // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` + + // Allows grantee to read the object data and its metadata. + GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` + + // Allows grantee to read the object ACL. + GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` + + // Allows grantee to write the ACL for the applicable object. + GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + + Key *string `location:"uri" locationName:"Key" type:"string" required:"true"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // Confirms that the requester knows that she or he will be charged for the + // request. Bucket owners need not specify this parameter in their requests. + // Documentation on downloading objects from requester pays buckets can be found + // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string"` + + // Specifies the algorithm to use to when encrypting the object (e.g., AES256, + // aws:kms). + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting + // data. This value is used to store the object and then it is discarded; Amazon + // does not store the encryption key. The key must be appropriate for use with + // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // header. + SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` + + // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + // Amazon S3 uses this header for a message integrity check to ensure the encryption + // key was transmitted without error. + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT + // requests for an object protected by AWS KMS will fail if not made via SSL + // or using SigV4. Documentation on configuring any of the officially supported + // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` + + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string"` + + // The type of storage to use for the object. Defaults to 'STANDARD'. + StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string"` + + // The tag-set for the object. The tag-set must be encoded as URL Query parameters + Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` + + // If the bucket is configured as a website, redirects requests for this object + // to another object in the same bucket or to an external URL. Amazon S3 stores + // the value of this header in the object metadata. + WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` + + // The readable body payload to send to S3. + Body io.Reader +} + +// UploadOutput represents a response from the Upload() call. +type UploadOutput struct { + // The URL where the object was uploaded to. + Location string + + // The version of the object that was uploaded. Will only be populated if + // the S3 Bucket is versioned. If the bucket is not versioned this field + // will not be set. + VersionID *string + + // The ID for a multipart upload to S3. In the case of an error the error + // can be cast to the MultiUploadFailure interface to extract the upload ID. + UploadID string +} + +// WithUploaderRequestOptions appends to the Uploader's API request options. +func WithUploaderRequestOptions(opts ...request.Option) func(*Uploader) { + return func(u *Uploader) { + u.RequestOptions = append(u.RequestOptions, opts...) + } +} + +// The Uploader structure that calls Upload(). It is safe to call Upload() +// on this structure for multiple objects and across concurrent goroutines. +// Mutating the Uploader's properties is not safe to be done concurrently. +type Uploader struct { + // The buffer size (in bytes) to use when buffering data into chunks and + // sending them as parts to S3. The minimum allowed part size is 5MB, and + // if this value is set to zero, the DefaultUploadPartSize value will be used. + PartSize int64 + + // The number of goroutines to spin up in parallel per call to Upload when + // sending parts. If this is set to zero, the DefaultUploadConcurrency value + // will be used. + // + // The concurrency pool is not shared between calls to Upload. + Concurrency int + + // Setting this value to true will cause the SDK to avoid calling + // AbortMultipartUpload on a failure, leaving all successfully uploaded + // parts on S3 for manual recovery. + // + // Note that storing parts of an incomplete multipart upload counts towards + // space usage on S3 and will add additional costs if not cleaned up. + LeavePartsOnError bool + + // MaxUploadParts is the max number of parts which will be uploaded to S3. + // Will be used to calculate the partsize of the object to be uploaded. + // E.g: 5GB file, with MaxUploadParts set to 100, will upload the file + // as 100, 50MB parts. + // With a limited of s3.MaxUploadParts (10,000 parts). + // + // Defaults to package const's MaxUploadParts value. + MaxUploadParts int + + // The client to use when uploading to S3. + S3 s3iface.S3API + + // List of request options that will be passed down to individual API + // operation requests made by the uploader. + RequestOptions []request.Option +} + +// NewUploader creates a new Uploader instance to upload objects to S3. Pass In +// additional functional options to customize the uploader's behavior. Requires a +// client.ConfigProvider in order to create a S3 service client. The session.Session +// satisfies the client.ConfigProvider interface. +// +// Example: +// // The session the S3 Uploader will use +// sess := session.Must(session.NewSession()) +// +// // Create an uploader with the session and default options +// uploader := s3manager.NewUploader(sess) +// +// // Create an uploader with the session and custom options +// uploader := s3manager.NewUploader(session, func(u *s3manager.Uploader) { +// u.PartSize = 64 * 1024 * 1024 // 64MB per part +// }) +func NewUploader(c client.ConfigProvider, options ...func(*Uploader)) *Uploader { + u := &Uploader{ + S3: s3.New(c), + PartSize: DefaultUploadPartSize, + Concurrency: DefaultUploadConcurrency, + LeavePartsOnError: false, + MaxUploadParts: MaxUploadParts, + } + + for _, option := range options { + option(u) + } + + return u +} + +// NewUploaderWithClient creates a new Uploader instance to upload objects to S3. Pass in +// additional functional options to customize the uploader's behavior. Requires +// a S3 service client to make S3 API calls. +// +// Example: +// // The session the S3 Uploader will use +// sess := session.Must(session.NewSession()) +// +// // S3 service client the Upload manager will use. +// s3Svc := s3.New(sess) +// +// // Create an uploader with S3 client and default options +// uploader := s3manager.NewUploaderWithClient(s3Svc) +// +// // Create an uploader with S3 client and custom options +// uploader := s3manager.NewUploaderWithClient(s3Svc, func(u *s3manager.Uploader) { +// u.PartSize = 64 * 1024 * 1024 // 64MB per part +// }) +func NewUploaderWithClient(svc s3iface.S3API, options ...func(*Uploader)) *Uploader { + u := &Uploader{ + S3: svc, + PartSize: DefaultUploadPartSize, + Concurrency: DefaultUploadConcurrency, + LeavePartsOnError: false, + MaxUploadParts: MaxUploadParts, + } + + for _, option := range options { + option(u) + } + + return u +} + +// Upload uploads an object to S3, intelligently buffering large files into +// smaller chunks and sending them in parallel across multiple goroutines. You +// can configure the buffer size and concurrency through the Uploader's parameters. +// +// Additional functional options can be provided to configure the individual +// upload. These options are copies of the Uploader instance Upload is called from. +// Modifying the options will not impact the original Uploader instance. +// +// Use the WithUploaderRequestOptions helper function to pass in request +// options that will be applied to all API operations made with this uploader. +// +// It is safe to call this method concurrently across goroutines. +// +// Example: +// // Upload input parameters +// upParams := &s3manager.UploadInput{ +// Bucket: &bucketName, +// Key: &keyName, +// Body: file, +// } +// +// // Perform an upload. +// result, err := uploader.Upload(upParams) +// +// // Perform upload with options different than the those in the Uploader. +// result, err := uploader.Upload(upParams, func(u *s3manager.Uploader) { +// u.PartSize = 10 * 1024 * 1024 // 10MB part size +// u.LeavePartsOnError = true // Don't delete the parts if the upload fails. +// }) +func (u Uploader) Upload(input *UploadInput, options ...func(*Uploader)) (*UploadOutput, error) { + return u.UploadWithContext(aws.BackgroundContext(), input, options...) +} + +// UploadWithContext uploads an object to S3, intelligently buffering large +// files into smaller chunks and sending them in parallel across multiple +// goroutines. You can configure the buffer size and concurrency through the +// Uploader's parameters. +// +// UploadWithContext is the same as Upload with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the context to add deadlining, timeouts, etc. The +// UploadWithContext may create sub-contexts for individual underlying requests. +// +// Additional functional options can be provided to configure the individual +// upload. These options are copies of the Uploader instance Upload is called from. +// Modifying the options will not impact the original Uploader instance. +// +// Use the WithUploaderRequestOptions helper function to pass in request +// options that will be applied to all API operations made with this uploader. +// +// It is safe to call this method concurrently across goroutines. +func (u Uploader) UploadWithContext(ctx aws.Context, input *UploadInput, opts ...func(*Uploader)) (*UploadOutput, error) { + i := uploader{in: input, cfg: u, ctx: ctx} + + for _, opt := range opts { + opt(&i.cfg) + } + i.cfg.RequestOptions = append(i.cfg.RequestOptions, request.WithAppendUserAgent("S3Manager")) + + return i.upload() +} + +// UploadWithIterator will upload a batched amount of objects to S3. This operation uses +// the iterator pattern to know which object to upload next. Since this is an interface this +// allows for custom defined functionality. +// +// Example: +// svc:= s3manager.NewUploader(sess) +// +// objects := []BatchUploadObject{ +// { +// Object: &s3manager.UploadInput { +// Key: aws.String("key"), +// Bucket: aws.String("bucket"), +// }, +// }, +// } +// +// iter := &s3manager.UploadObjectsIterator{Objects: objects} +// if err := svc.UploadWithIterator(aws.BackgroundContext(), iter); err != nil { +// return err +// } +func (u Uploader) UploadWithIterator(ctx aws.Context, iter BatchUploadIterator, opts ...func(*Uploader)) error { + var errs []Error + for iter.Next() { + object := iter.UploadObject() + if _, err := u.UploadWithContext(ctx, object.Object, opts...); err != nil { + s3Err := Error{ + OrigErr: err, + Bucket: object.Object.Bucket, + Key: object.Object.Key, + } + + errs = append(errs, s3Err) + } + + if object.After == nil { + continue + } + + if err := object.After(); err != nil { + s3Err := Error{ + OrigErr: err, + Bucket: object.Object.Bucket, + Key: object.Object.Key, + } + + errs = append(errs, s3Err) + } + } + + if len(errs) > 0 { + return NewBatchError("BatchedUploadIncomplete", "some objects have failed to upload.", errs) + } + return nil +} + +// internal structure to manage an upload to S3. +type uploader struct { + ctx aws.Context + cfg Uploader + + in *UploadInput + + readerPos int64 // current reader position + totalSize int64 // set to -1 if the size is not known + + bufferPool sync.Pool +} + +// internal logic for deciding whether to upload a single part or use a +// multipart upload. +func (u *uploader) upload() (*UploadOutput, error) { + u.init() + + if u.cfg.PartSize < MinUploadPartSize { + msg := fmt.Sprintf("part size must be at least %d bytes", MinUploadPartSize) + return nil, awserr.New("ConfigError", msg, nil) + } + + // Do one read to determine if we have more than one part + reader, _, part, err := u.nextReader() + if err == io.EOF { // single part + return u.singlePart(reader) + } else if err != nil { + return nil, awserr.New("ReadRequestBody", "read upload data failed", err) + } + + mu := multiuploader{uploader: u} + return mu.upload(reader, part) +} + +// init will initialize all default options. +func (u *uploader) init() { + if u.cfg.Concurrency == 0 { + u.cfg.Concurrency = DefaultUploadConcurrency + } + if u.cfg.PartSize == 0 { + u.cfg.PartSize = DefaultUploadPartSize + } + if u.cfg.MaxUploadParts == 0 { + u.cfg.MaxUploadParts = MaxUploadParts + } + + u.bufferPool = sync.Pool{ + New: func() interface{} { return make([]byte, u.cfg.PartSize) }, + } + + // Try to get the total size for some optimizations + u.initSize() +} + +// initSize tries to detect the total stream size, setting u.totalSize. If +// the size is not known, totalSize is set to -1. +func (u *uploader) initSize() { + u.totalSize = -1 + + switch r := u.in.Body.(type) { + case io.Seeker: + n, err := aws.SeekerLen(r) + if err != nil { + return + } + u.totalSize = n + + // Try to adjust partSize if it is too small and account for + // integer division truncation. + if u.totalSize/u.cfg.PartSize >= int64(u.cfg.MaxUploadParts) { + // Add one to the part size to account for remainders + // during the size calculation. e.g odd number of bytes. + u.cfg.PartSize = (u.totalSize / int64(u.cfg.MaxUploadParts)) + 1 + } + } +} + +// nextReader returns a seekable reader representing the next packet of data. +// This operation increases the shared u.readerPos counter, but note that it +// does not need to be wrapped in a mutex because nextReader is only called +// from the main thread. +func (u *uploader) nextReader() (io.ReadSeeker, int, []byte, error) { + type readerAtSeeker interface { + io.ReaderAt + io.ReadSeeker + } + switch r := u.in.Body.(type) { + case readerAtSeeker: + var err error + + n := u.cfg.PartSize + if u.totalSize >= 0 { + bytesLeft := u.totalSize - u.readerPos + + if bytesLeft <= u.cfg.PartSize { + err = io.EOF + n = bytesLeft + } + } + + reader := io.NewSectionReader(r, u.readerPos, n) + u.readerPos += n + + return reader, int(n), nil, err + + default: + part := u.bufferPool.Get().([]byte) + n, err := readFillBuf(r, part) + u.readerPos += int64(n) + + return bytes.NewReader(part[0:n]), n, part, err + } +} + +func readFillBuf(r io.Reader, b []byte) (offset int, err error) { + for offset < len(b) && err == nil { + var n int + n, err = r.Read(b[offset:]) + offset += n + } + + return offset, err +} + +// singlePart contains upload logic for uploading a single chunk via +// a regular PutObject request. Multipart requests require at least two +// parts, or at least 5MB of data. +func (u *uploader) singlePart(buf io.ReadSeeker) (*UploadOutput, error) { + params := &s3.PutObjectInput{} + awsutil.Copy(params, u.in) + params.Body = buf + + // Need to use request form because URL generated in request is + // used in return. + req, out := u.cfg.S3.PutObjectRequest(params) + req.SetContext(u.ctx) + req.ApplyOptions(u.cfg.RequestOptions...) + if err := req.Send(); err != nil { + return nil, err + } + + url := req.HTTPRequest.URL.String() + return &UploadOutput{ + Location: url, + VersionID: out.VersionId, + }, nil +} + +// internal structure to manage a specific multipart upload to S3. +type multiuploader struct { + *uploader + wg sync.WaitGroup + m sync.Mutex + err error + uploadID string + parts completedParts +} + +// keeps track of a single chunk of data being sent to S3. +type chunk struct { + buf io.ReadSeeker + part []byte + num int64 +} + +// completedParts is a wrapper to make parts sortable by their part number, +// since S3 required this list to be sent in sorted order. +type completedParts []*s3.CompletedPart + +func (a completedParts) Len() int { return len(a) } +func (a completedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a completedParts) Less(i, j int) bool { return *a[i].PartNumber < *a[j].PartNumber } + +// upload will perform a multipart upload using the firstBuf buffer containing +// the first chunk of data. +func (u *multiuploader) upload(firstBuf io.ReadSeeker, firstPart []byte) (*UploadOutput, error) { + params := &s3.CreateMultipartUploadInput{} + awsutil.Copy(params, u.in) + + // Create the multipart + resp, err := u.cfg.S3.CreateMultipartUploadWithContext(u.ctx, params, u.cfg.RequestOptions...) + if err != nil { + return nil, err + } + u.uploadID = *resp.UploadId + + // Create the workers + ch := make(chan chunk, u.cfg.Concurrency) + for i := 0; i < u.cfg.Concurrency; i++ { + u.wg.Add(1) + go u.readChunk(ch) + } + + // Send part 1 to the workers + var num int64 = 1 + ch <- chunk{buf: firstBuf, part: firstPart, num: num} + + // Read and queue the rest of the parts + for u.geterr() == nil && err == nil { + num++ + // This upload exceeded maximum number of supported parts, error now. + if num > int64(u.cfg.MaxUploadParts) || num > int64(MaxUploadParts) { + var msg string + if num > int64(u.cfg.MaxUploadParts) { + msg = fmt.Sprintf("exceeded total allowed configured MaxUploadParts (%d). Adjust PartSize to fit in this limit", + u.cfg.MaxUploadParts) + } else { + msg = fmt.Sprintf("exceeded total allowed S3 limit MaxUploadParts (%d). Adjust PartSize to fit in this limit", + MaxUploadParts) + } + u.seterr(awserr.New("TotalPartsExceeded", msg, nil)) + break + } + + var reader io.ReadSeeker + var nextChunkLen int + var part []byte + reader, nextChunkLen, part, err = u.nextReader() + + if err != nil && err != io.EOF { + u.seterr(awserr.New( + "ReadRequestBody", + "read multipart upload data failed", + err)) + break + } + + if nextChunkLen == 0 { + // No need to upload empty part, if file was empty to start + // with empty single part would of been created and never + // started multipart upload. + break + } + + ch <- chunk{buf: reader, part: part, num: num} + } + + // Close the channel, wait for workers, and complete upload + close(ch) + u.wg.Wait() + complete := u.complete() + + if err := u.geterr(); err != nil { + return nil, &multiUploadError{ + awsError: awserr.New( + "MultipartUpload", + "upload multipart failed", + err), + uploadID: u.uploadID, + } + } + return &UploadOutput{ + Location: aws.StringValue(complete.Location), + VersionID: complete.VersionId, + UploadID: u.uploadID, + }, nil +} + +// readChunk runs in worker goroutines to pull chunks off of the ch channel +// and send() them as UploadPart requests. +func (u *multiuploader) readChunk(ch chan chunk) { + defer u.wg.Done() + for { + data, ok := <-ch + + if !ok { + break + } + + if u.geterr() == nil { + if err := u.send(data); err != nil { + u.seterr(err) + } + } + } +} + +// send performs an UploadPart request and keeps track of the completed +// part information. +func (u *multiuploader) send(c chunk) error { + params := &s3.UploadPartInput{ + Bucket: u.in.Bucket, + Key: u.in.Key, + Body: c.buf, + UploadId: &u.uploadID, + SSECustomerAlgorithm: u.in.SSECustomerAlgorithm, + SSECustomerKey: u.in.SSECustomerKey, + PartNumber: &c.num, + } + resp, err := u.cfg.S3.UploadPartWithContext(u.ctx, params, u.cfg.RequestOptions...) + // put the byte array back into the pool to conserve memory + u.bufferPool.Put(c.part) + if err != nil { + return err + } + + n := c.num + completed := &s3.CompletedPart{ETag: resp.ETag, PartNumber: &n} + + u.m.Lock() + u.parts = append(u.parts, completed) + u.m.Unlock() + + return nil +} + +// geterr is a thread-safe getter for the error object +func (u *multiuploader) geterr() error { + u.m.Lock() + defer u.m.Unlock() + + return u.err +} + +// seterr is a thread-safe setter for the error object +func (u *multiuploader) seterr(e error) { + u.m.Lock() + defer u.m.Unlock() + + u.err = e +} + +// fail will abort the multipart unless LeavePartsOnError is set to true. +func (u *multiuploader) fail() { + if u.cfg.LeavePartsOnError { + return + } + + params := &s3.AbortMultipartUploadInput{ + Bucket: u.in.Bucket, + Key: u.in.Key, + UploadId: &u.uploadID, + } + _, err := u.cfg.S3.AbortMultipartUploadWithContext(u.ctx, params, u.cfg.RequestOptions...) + if err != nil { + logMessage(u.cfg.S3, aws.LogDebug, fmt.Sprintf("failed to abort multipart upload, %v", err)) + } +} + +// complete successfully completes a multipart upload and returns the response. +func (u *multiuploader) complete() *s3.CompleteMultipartUploadOutput { + if u.geterr() != nil { + u.fail() + return nil + } + + // Parts must be sorted in PartNumber order. + sort.Sort(u.parts) + + params := &s3.CompleteMultipartUploadInput{ + Bucket: u.in.Bucket, + Key: u.in.Key, + UploadId: &u.uploadID, + MultipartUpload: &s3.CompletedMultipartUpload{Parts: u.parts}, + } + resp, err := u.cfg.S3.CompleteMultipartUploadWithContext(u.ctx, params, u.cfg.RequestOptions...) + if err != nil { + u.seterr(err) + u.fail() + } + + return resp +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go new file mode 100644 index 00000000000..20de53f29d7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go @@ -0,0 +1,97 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package s3 + +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/restxml" +) + +// S3 provides the API operation methods for making requests to +// Amazon Simple Storage Service. See this package's package overview docs +// for details on the service. +// +// S3 methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type S3 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 = "s3" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "S3" // ServiceID is a unique identifer of a specific service. +) + +// New creates a new instance of the S3 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 S3 client from just a session. +// svc := s3.New(mySession) +// +// // Create a S3 client with additional configuration +// svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 { + 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) *S3 { + svc := &S3{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2006-03-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) + + svc.Handlers.UnmarshalStream.PushBackNamed(restxml.UnmarshalHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a S3 operation and runs any +// custom request initialization. +func (c *S3) 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/s3/sse.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go new file mode 100644 index 00000000000..8010c4fa196 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go @@ -0,0 +1,54 @@ +package s3 + +import ( + "crypto/md5" + "encoding/base64" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) + +func validateSSERequiresSSL(r *request.Request) { + if r.HTTPRequest.URL.Scheme == "https" { + return + } + + if iface, ok := r.Params.(sseCustomerKeyGetter); ok { + if len(iface.getSSECustomerKey()) > 0 { + r.Error = errSSERequiresSSL + return + } + } + + if iface, ok := r.Params.(copySourceSSECustomerKeyGetter); ok { + if len(iface.getCopySourceSSECustomerKey()) > 0 { + r.Error = errSSERequiresSSL + return + } + } +} + +func computeSSEKeys(r *request.Request) { + headers := []string{ + "x-amz-server-side-encryption-customer-key", + "x-amz-copy-source-server-side-encryption-customer-key", + } + + for _, h := range headers { + md5h := h + "-md5" + if key := r.HTTPRequest.Header.Get(h); key != "" { + // Base64-encode the value + b64v := base64.StdEncoding.EncodeToString([]byte(key)) + r.HTTPRequest.Header.Set(h, b64v) + + // Add MD5 if it wasn't computed + if r.HTTPRequest.Header.Get(md5h) == "" { + sum := md5.Sum([]byte(key)) + b64sum := base64.StdEncoding.EncodeToString(sum[:]) + r.HTTPRequest.Header.Set(md5h, b64sum) + } + } + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go new file mode 100644 index 00000000000..9f33efc6ca8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go @@ -0,0 +1,36 @@ +package s3 + +import ( + "bytes" + "io/ioutil" + "net/http" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkio" +) + +func copyMultipartStatusOKUnmarhsalError(r *request.Request) { + b, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.New("SerializationError", "unable to read response body", err) + return + } + body := bytes.NewReader(b) + r.HTTPResponse.Body = ioutil.NopCloser(body) + defer body.Seek(0, sdkio.SeekStart) + + if body.Len() == 0 { + // If there is no body don't attempt to parse the body. + return + } + + unmarshalError(r) + if err, ok := r.Error.(awserr.Error); ok && err != nil { + if err.Code() == "SerializationError" { + r.Error = nil + return + } + r.HTTPResponse.StatusCode = http.StatusServiceUnavailable + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go new file mode 100644 index 00000000000..bcca8627af3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go @@ -0,0 +1,103 @@ +package s3 + +import ( + "encoding/xml" + "fmt" + "io" + "io/ioutil" + "net/http" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +type xmlErrorResponse struct { + XMLName xml.Name `xml:"Error"` + Code string `xml:"Code"` + Message string `xml:"Message"` +} + +func unmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) + + hostID := r.HTTPResponse.Header.Get("X-Amz-Id-2") + + // Bucket exists in a different region, and request needs + // to be made to the correct region. + if r.HTTPResponse.StatusCode == http.StatusMovedPermanently { + r.Error = requestFailure{ + RequestFailure: awserr.NewRequestFailure( + awserr.New("BucketRegionError", + fmt.Sprintf("incorrect region, the bucket is not in '%s' region", + aws.StringValue(r.Config.Region)), + nil), + r.HTTPResponse.StatusCode, + r.RequestID, + ), + hostID: hostID, + } + return + } + + var errCode, errMsg string + + // Attempt to parse error from body if it is known + resp := &xmlErrorResponse{} + err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) + if err != nil && err != io.EOF { + errCode = "SerializationError" + errMsg = "failed to decode S3 XML error response" + } else { + errCode = resp.Code + errMsg = resp.Message + err = nil + } + + // Fallback to status code converted to message if still no error code + if len(errCode) == 0 { + statusText := http.StatusText(r.HTTPResponse.StatusCode) + errCode = strings.Replace(statusText, " ", "", -1) + errMsg = statusText + } + + r.Error = requestFailure{ + RequestFailure: awserr.NewRequestFailure( + awserr.New(errCode, errMsg, err), + r.HTTPResponse.StatusCode, + r.RequestID, + ), + hostID: hostID, + } +} + +// A RequestFailure provides access to the S3 Request ID and Host ID values +// returned from API operation errors. Getting the error as a string will +// return the formated error with the same information as awserr.RequestFailure, +// while also adding the HostID value from the response. +type RequestFailure interface { + awserr.RequestFailure + + // Host ID is the S3 Host ID needed for debug, and contacting support + HostID() string +} + +type requestFailure struct { + awserr.RequestFailure + + hostID string +} + +func (r requestFailure) Error() string { + extra := fmt.Sprintf("status code: %d, request id: %s, host id: %s", + r.StatusCode(), r.RequestID(), r.hostID) + return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr()) +} +func (r requestFailure) String() string { + return r.Error() +} +func (r requestFailure) HostID() string { + return r.hostID +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go new file mode 100644 index 00000000000..2596c694b50 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go @@ -0,0 +1,214 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package s3 + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilBucketExists uses the Amazon S3 API operation +// HeadBucket 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 *S3) WaitUntilBucketExists(input *HeadBucketInput) error { + return c.WaitUntilBucketExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilBucketExistsWithContext is an extended version of WaitUntilBucketExists. +// 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 *S3) WaitUntilBucketExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilBucketExists", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 200, + }, + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 301, + }, + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 403, + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 404, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadBucketInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadBucketRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilBucketNotExists uses the Amazon S3 API operation +// HeadBucket 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 *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { + return c.WaitUntilBucketNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilBucketNotExistsWithContext is an extended version of WaitUntilBucketNotExists. +// 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 *S3) WaitUntilBucketNotExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilBucketNotExists", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 404, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadBucketInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadBucketRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilObjectExists uses the Amazon S3 API operation +// HeadObject 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 *S3) WaitUntilObjectExists(input *HeadObjectInput) error { + return c.WaitUntilObjectExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilObjectExistsWithContext is an extended version of WaitUntilObjectExists. +// 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 *S3) WaitUntilObjectExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilObjectExists", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 200, + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 404, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadObjectInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadObjectRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilObjectNotExists uses the Amazon S3 API operation +// HeadObject 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 *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error { + return c.WaitUntilObjectNotExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilObjectNotExistsWithContext is an extended version of WaitUntilObjectNotExists. +// 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 *S3) WaitUntilObjectNotExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilObjectNotExists", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 404, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *HeadObjectInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.HeadObjectRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/inconshreveable/mousetrap/BUILD.bazel b/vendor/github.com/inconshreveable/mousetrap/BUILD.bazel new file mode 100644 index 00000000000..0feb6c8013b --- /dev/null +++ b/vendor/github.com/inconshreveable/mousetrap/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "trap_others.go", + "trap_windows.go", + "trap_windows_1.4.go", + ], + importmap = "installer/vendor/github.com/inconshreveable/mousetrap", + importpath = "github.com/inconshreveable/mousetrap", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/inconshreveable/mousetrap/LICENSE b/vendor/github.com/inconshreveable/mousetrap/LICENSE new file mode 100644 index 00000000000..5f0d1fb6a7b --- /dev/null +++ b/vendor/github.com/inconshreveable/mousetrap/LICENSE @@ -0,0 +1,13 @@ +Copyright 2014 Alan Shreve + +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/inconshreveable/mousetrap/trap_others.go b/vendor/github.com/inconshreveable/mousetrap/trap_others.go new file mode 100644 index 00000000000..9d2d8a4bab9 --- /dev/null +++ b/vendor/github.com/inconshreveable/mousetrap/trap_others.go @@ -0,0 +1,15 @@ +// +build !windows + +package mousetrap + +// StartedByExplorer returns true if the program was invoked by the user +// double-clicking on the executable from explorer.exe +// +// It is conservative and returns false if any of the internal calls fail. +// It does not guarantee that the program was run from a terminal. It only can tell you +// whether it was launched from explorer.exe +// +// On non-Windows platforms, it always returns false. +func StartedByExplorer() bool { + return false +} diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_windows.go b/vendor/github.com/inconshreveable/mousetrap/trap_windows.go new file mode 100644 index 00000000000..336142a5e3e --- /dev/null +++ b/vendor/github.com/inconshreveable/mousetrap/trap_windows.go @@ -0,0 +1,98 @@ +// +build windows +// +build !go1.4 + +package mousetrap + +import ( + "fmt" + "os" + "syscall" + "unsafe" +) + +const ( + // defined by the Win32 API + th32cs_snapprocess uintptr = 0x2 +) + +var ( + kernel = syscall.MustLoadDLL("kernel32.dll") + CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot") + Process32First = kernel.MustFindProc("Process32FirstW") + Process32Next = kernel.MustFindProc("Process32NextW") +) + +// ProcessEntry32 structure defined by the Win32 API +type processEntry32 struct { + dwSize uint32 + cntUsage uint32 + th32ProcessID uint32 + th32DefaultHeapID int + th32ModuleID uint32 + cntThreads uint32 + th32ParentProcessID uint32 + pcPriClassBase int32 + dwFlags uint32 + szExeFile [syscall.MAX_PATH]uint16 +} + +func getProcessEntry(pid int) (pe *processEntry32, err error) { + snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0)) + if snapshot == uintptr(syscall.InvalidHandle) { + err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1) + return + } + defer syscall.CloseHandle(syscall.Handle(snapshot)) + + var processEntry processEntry32 + processEntry.dwSize = uint32(unsafe.Sizeof(processEntry)) + ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry))) + if ok == 0 { + err = fmt.Errorf("Process32First: %v", e1) + return + } + + for { + if processEntry.th32ProcessID == uint32(pid) { + pe = &processEntry + return + } + + ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry))) + if ok == 0 { + err = fmt.Errorf("Process32Next: %v", e1) + return + } + } +} + +func getppid() (pid int, err error) { + pe, err := getProcessEntry(os.Getpid()) + if err != nil { + return + } + + pid = int(pe.th32ParentProcessID) + return +} + +// StartedByExplorer returns true if the program was invoked by the user double-clicking +// on the executable from explorer.exe +// +// It is conservative and returns false if any of the internal calls fail. +// It does not guarantee that the program was run from a terminal. It only can tell you +// whether it was launched from explorer.exe +func StartedByExplorer() bool { + ppid, err := getppid() + if err != nil { + return false + } + + pe, err := getProcessEntry(ppid) + if err != nil { + return false + } + + name := syscall.UTF16ToString(pe.szExeFile[:]) + return name == "explorer.exe" +} diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go b/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go new file mode 100644 index 00000000000..9a28e57c3c3 --- /dev/null +++ b/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go @@ -0,0 +1,46 @@ +// +build windows +// +build go1.4 + +package mousetrap + +import ( + "os" + "syscall" + "unsafe" +) + +func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { + snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) + if err != nil { + return nil, err + } + defer syscall.CloseHandle(snapshot) + var procEntry syscall.ProcessEntry32 + procEntry.Size = uint32(unsafe.Sizeof(procEntry)) + if err = syscall.Process32First(snapshot, &procEntry); err != nil { + return nil, err + } + for { + if procEntry.ProcessID == uint32(pid) { + return &procEntry, nil + } + err = syscall.Process32Next(snapshot, &procEntry) + if err != nil { + return nil, err + } + } +} + +// StartedByExplorer returns true if the program was invoked by the user double-clicking +// on the executable from explorer.exe +// +// It is conservative and returns false if any of the internal calls fail. +// It does not guarantee that the program was run from a terminal. It only can tell you +// whether it was launched from explorer.exe +func StartedByExplorer() bool { + pe, err := getProcessEntry(os.Getppid()) + if err != nil { + return false + } + return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) +} diff --git a/vendor/github.com/libvirt/libvirt-go/BUILD.bazel b/vendor/github.com/libvirt/libvirt-go/BUILD.bazel new file mode 100644 index 00000000000..b42a08b755c --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/BUILD.bazel @@ -0,0 +1,88 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "callbacks.go", + "callbacks_wrapper.go", + "callbacks_wrapper.h", + "connect.go", + "connect_compat.h", + "connect_wrapper.go", + "connect_wrapper.h", + "doc.go", + "domain.go", + "domain_compat.h", + "domain_events.go", + "domain_events_wrapper.go", + "domain_events_wrapper.h", + "domain_snapshot.go", + "domain_snapshot_wrapper.go", + "domain_snapshot_wrapper.h", + "domain_wrapper.go", + "domain_wrapper.h", + "error.go", + "error_compat.h", + "events.go", + "events_wrapper.go", + "events_wrapper.h", + "interface.go", + "interface_wrapper.go", + "interface_wrapper.h", + "lxc.go", + "lxc_wrapper.go", + "lxc_wrapper.h", + "network.go", + "network_compat.h", + "network_events.go", + "network_events_wrapper.go", + "network_events_wrapper.h", + "network_wrapper.go", + "network_wrapper.h", + "node_device.go", + "node_device_compat.h", + "node_device_events.go", + "node_device_events_wrapper.go", + "node_device_events_wrapper.h", + "node_device_wrapper.go", + "node_device_wrapper.h", + "nwfilter.go", + "nwfilter_binding.go", + "nwfilter_binding_compat.h", + "nwfilter_binding_wrapper.go", + "nwfilter_binding_wrapper.h", + "nwfilter_wrapper.go", + "nwfilter_wrapper.h", + "qemu.go", + "qemu_compat.h", + "qemu_wrapper.go", + "qemu_wrapper.h", + "secret.go", + "secret_compat.h", + "secret_events.go", + "secret_events_wrapper.go", + "secret_events_wrapper.h", + "secret_wrapper.go", + "secret_wrapper.h", + "storage_pool.go", + "storage_pool_compat.h", + "storage_pool_events.go", + "storage_pool_events_wrapper.go", + "storage_pool_events_wrapper.h", + "storage_pool_wrapper.go", + "storage_pool_wrapper.h", + "storage_volume.go", + "storage_volume_compat.h", + "storage_volume_wrapper.go", + "storage_volume_wrapper.h", + "stream.go", + "stream_compat.h", + "stream_wrapper.go", + "stream_wrapper.h", + "typedparams.go", + ], + cgo = True, + importmap = "installer/vendor/github.com/libvirt/libvirt-go", + importpath = "github.com/libvirt/libvirt-go", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/libvirt/libvirt-go/LICENSE b/vendor/github.com/libvirt/libvirt-go/LICENSE new file mode 100644 index 00000000000..202f5fcef8d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2013 Alex Zorin + +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. \ No newline at end of file diff --git a/vendor/github.com/libvirt/libvirt-go/callbacks.go b/vendor/github.com/libvirt/libvirt-go/callbacks.go new file mode 100644 index 00000000000..7b2d11ba17b --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/callbacks.go @@ -0,0 +1,102 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +// Helpers functions to register a Go callback function to a C +// function. For a simple example, look at how SetErrorFunc works in +// error.go. +// +// - Create a struct that will contain at least the Go callback to +// invoke (errorContext). +// +// - Create an exported Golang function whose job will be to retrieve +// the context and execute the callback in it +// (connErrCallback). Such a function should receive a callback ID +// and will use it to retrive the context. +// +// - Create a CGO function similar to the above function but with the +// appropriate signature to be registered as a callback in C code +// (connErrCallbackHelper). Notably, it will have a void* argument +// that should be cast to long to retrieve the callback ID. It +// should be just a thin wrapper to transform the opaque argument to +// a callback ID. +// +// - Create a CGO function which will be a wrapper around the C +// function to register the callback (virConnSetErrorFuncWrapper). Its +// only role is to transform a callback ID (long) to an opaque (void*) +// and call the C function. +// +// - When setting up a callback (SetErrorFunc), register the struct from first step +// with registerCallbackId and invoke the CGO function from the +// previous step with the appropriate ID. +// +// - When unregistering the callback, don't forget to call freecallbackId. +// +// If you need to associate some additional data with the connection, +// look at saveConnectionData, getConnectionData and +// releaseConnectionData. + +import "C" + +import ( + "sync" +) + +const firstGoCallbackId int = 100 // help catch some additional errors during test +var goCallbackLock sync.RWMutex +var goCallbacks = make(map[int]interface{}) +var nextGoCallbackId int = firstGoCallbackId + +//export freeCallbackId +func freeCallbackId(goCallbackId int) { + goCallbackLock.Lock() + delete(goCallbacks, goCallbackId) + goCallbackLock.Unlock() +} + +func getCallbackId(goCallbackId int) interface{} { + goCallbackLock.RLock() + ctx := goCallbacks[goCallbackId] + goCallbackLock.RUnlock() + if ctx == nil { + // If this happens there must be a bug in libvirt + panic("Callback arrived after freeCallbackId was called") + } + return ctx +} + +func registerCallbackId(ctx interface{}) int { + goCallbackLock.Lock() + goCallBackId := nextGoCallbackId + nextGoCallbackId++ + for goCallbacks[nextGoCallbackId] != nil { + nextGoCallbackId++ + } + goCallbacks[goCallBackId] = ctx + goCallbackLock.Unlock() + return goCallBackId +} diff --git a/vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.go b/vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.go new file mode 100644 index 00000000000..9716bb10815 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.go @@ -0,0 +1,39 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include "callbacks_wrapper.h" + +extern void freeCallbackId(long); +void freeGoCallbackHelper(void* goCallbackId) { + freeCallbackId((long)goCallbackId); +} + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.h b/vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.h new file mode 100644 index 00000000000..4b91f7a75af --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/callbacks_wrapper.h @@ -0,0 +1,32 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_CALLBACKS_WRAPPER_H__ +#define LIBVIRT_GO_CALLBACKS_WRAPPER_H__ + +void freeGoCallbackHelper(void* goCallbackId); + +#endif /* LIBVIRT_GO_CALLBACKS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/connect.go b/vendor/github.com/libvirt/libvirt-go/connect.go new file mode 100644 index 00000000000..8cc7cc771f7 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/connect.go @@ -0,0 +1,2998 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "os" + "reflect" + "sync" + "unsafe" +) + +/* +#cgo pkg-config: libvirt +#include +#include "connect_wrapper.h" +*/ +import "C" + +func init() { + C.virInitialize() +} + +const ( + VERSION_NUMBER = uint32(C.LIBVIR_VERSION_NUMBER) +) + +type ConnectCloseReason int + +const ( + CONNECT_CLOSE_REASON_ERROR = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_ERROR) + CONNECT_CLOSE_REASON_EOF = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_EOF) + CONNECT_CLOSE_REASON_KEEPALIVE = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_KEEPALIVE) + CONNECT_CLOSE_REASON_CLIENT = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_CLIENT) +) + +type ConnectListAllDomainsFlags int + +const ( + CONNECT_LIST_DOMAINS_ACTIVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_ACTIVE) + CONNECT_LIST_DOMAINS_INACTIVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_INACTIVE) + CONNECT_LIST_DOMAINS_PERSISTENT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_PERSISTENT) + CONNECT_LIST_DOMAINS_TRANSIENT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_TRANSIENT) + CONNECT_LIST_DOMAINS_RUNNING = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_RUNNING) + CONNECT_LIST_DOMAINS_PAUSED = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_PAUSED) + CONNECT_LIST_DOMAINS_SHUTOFF = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_SHUTOFF) + CONNECT_LIST_DOMAINS_OTHER = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_OTHER) + CONNECT_LIST_DOMAINS_MANAGEDSAVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE) + CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE) + CONNECT_LIST_DOMAINS_AUTOSTART = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_AUTOSTART) + CONNECT_LIST_DOMAINS_NO_AUTOSTART = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART) + CONNECT_LIST_DOMAINS_HAS_SNAPSHOT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT) + CONNECT_LIST_DOMAINS_NO_SNAPSHOT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT) +) + +type ConnectListAllNetworksFlags int + +const ( + CONNECT_LIST_NETWORKS_INACTIVE = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_INACTIVE) + CONNECT_LIST_NETWORKS_ACTIVE = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_ACTIVE) + CONNECT_LIST_NETWORKS_PERSISTENT = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_PERSISTENT) + CONNECT_LIST_NETWORKS_TRANSIENT = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_TRANSIENT) + CONNECT_LIST_NETWORKS_AUTOSTART = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_AUTOSTART) + CONNECT_LIST_NETWORKS_NO_AUTOSTART = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_NO_AUTOSTART) +) + +type ConnectListAllStoragePoolsFlags int + +const ( + CONNECT_LIST_STORAGE_POOLS_INACTIVE = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE) + CONNECT_LIST_STORAGE_POOLS_ACTIVE = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE) + CONNECT_LIST_STORAGE_POOLS_PERSISTENT = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT) + CONNECT_LIST_STORAGE_POOLS_TRANSIENT = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT) + CONNECT_LIST_STORAGE_POOLS_AUTOSTART = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART) + CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART) + CONNECT_LIST_STORAGE_POOLS_DIR = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_DIR) + CONNECT_LIST_STORAGE_POOLS_FS = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_FS) + CONNECT_LIST_STORAGE_POOLS_NETFS = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_NETFS) + CONNECT_LIST_STORAGE_POOLS_LOGICAL = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_LOGICAL) + CONNECT_LIST_STORAGE_POOLS_DISK = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_DISK) + CONNECT_LIST_STORAGE_POOLS_ISCSI = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI) + CONNECT_LIST_STORAGE_POOLS_SCSI = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_SCSI) + CONNECT_LIST_STORAGE_POOLS_MPATH = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_MPATH) + CONNECT_LIST_STORAGE_POOLS_RBD = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_RBD) + CONNECT_LIST_STORAGE_POOLS_SHEEPDOG = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG) + CONNECT_LIST_STORAGE_POOLS_GLUSTER = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER) + CONNECT_LIST_STORAGE_POOLS_ZFS = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ZFS) + CONNECT_LIST_STORAGE_POOLS_VSTORAGE = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE) +) + +type ConnectBaselineCPUFlags int + +const ( + CONNECT_BASELINE_CPU_EXPAND_FEATURES = ConnectBaselineCPUFlags(C.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) + CONNECT_BASELINE_CPU_MIGRATABLE = ConnectBaselineCPUFlags(C.VIR_CONNECT_BASELINE_CPU_MIGRATABLE) +) + +type ConnectCompareCPUFlags int + +const ( + CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE = ConnectCompareCPUFlags(C.VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE) +) + +type ConnectListAllInterfacesFlags int + +const ( + CONNECT_LIST_INTERFACES_INACTIVE = ConnectListAllInterfacesFlags(C.VIR_CONNECT_LIST_INTERFACES_INACTIVE) + CONNECT_LIST_INTERFACES_ACTIVE = ConnectListAllInterfacesFlags(C.VIR_CONNECT_LIST_INTERFACES_ACTIVE) +) + +type ConnectListAllNodeDeviceFlags int + +const ( + CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM) + CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV) + CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV) + CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE) + CONNECT_LIST_NODE_DEVICES_CAP_NET = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI) + CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE) + CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST) + CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC) + CONNECT_LIST_NODE_DEVICES_CAP_DRM = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM) + CONNECT_LIST_NODE_DEVICES_CAP_MDEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV) + CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES) + CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV) +) + +type ConnectListAllSecretsFlags int + +const ( + CONNECT_LIST_SECRETS_EPHEMERAL = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_EPHEMERAL) + CONNECT_LIST_SECRETS_NO_EPHEMERAL = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL) + CONNECT_LIST_SECRETS_PRIVATE = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_PRIVATE) + CONNECT_LIST_SECRETS_NO_PRIVATE = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_NO_PRIVATE) +) + +type ConnectGetAllDomainStatsFlags int + +const ( + CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE) + CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE) + CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT) + CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT) + CONNECT_GET_ALL_DOMAINS_STATS_RUNNING = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING) + CONNECT_GET_ALL_DOMAINS_STATS_PAUSED = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED) + CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF) + CONNECT_GET_ALL_DOMAINS_STATS_OTHER = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER) + CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT) + CONNECT_GET_ALL_DOMAINS_STATS_BACKING = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING) + CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS) +) + +type ConnectFlags int + +const ( + CONNECT_RO = ConnectFlags(C.VIR_CONNECT_RO) + CONNECT_NO_ALIASES = ConnectFlags(C.VIR_CONNECT_NO_ALIASES) +) + +type ConnectDomainEventAgentLifecycleState int + +const ( + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED = ConnectDomainEventAgentLifecycleState(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED) + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED = ConnectDomainEventAgentLifecycleState(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED) +) + +type ConnectDomainEventAgentLifecycleReason int + +const ( + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN = ConnectDomainEventAgentLifecycleReason(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN) + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED = ConnectDomainEventAgentLifecycleReason(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED) + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL = ConnectDomainEventAgentLifecycleReason(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL) +) + +type CPUCompareResult int + +const ( + CPU_COMPARE_ERROR = CPUCompareResult(C.VIR_CPU_COMPARE_ERROR) + CPU_COMPARE_INCOMPATIBLE = CPUCompareResult(C.VIR_CPU_COMPARE_INCOMPATIBLE) + CPU_COMPARE_IDENTICAL = CPUCompareResult(C.VIR_CPU_COMPARE_IDENTICAL) + CPU_COMPARE_SUPERSET = CPUCompareResult(C.VIR_CPU_COMPARE_SUPERSET) +) + +type NodeAllocPagesFlags int + +const ( + NODE_ALLOC_PAGES_ADD = NodeAllocPagesFlags(C.VIR_NODE_ALLOC_PAGES_ADD) + NODE_ALLOC_PAGES_SET = NodeAllocPagesFlags(C.VIR_NODE_ALLOC_PAGES_SET) +) + +type NodeSuspendTarget int + +const ( + NODE_SUSPEND_TARGET_MEM = NodeSuspendTarget(C.VIR_NODE_SUSPEND_TARGET_MEM) + NODE_SUSPEND_TARGET_DISK = NodeSuspendTarget(C.VIR_NODE_SUSPEND_TARGET_DISK) + NODE_SUSPEND_TARGET_HYBRID = NodeSuspendTarget(C.VIR_NODE_SUSPEND_TARGET_HYBRID) +) + +type NodeGetCPUStatsAllCPUs int + +const ( + NODE_CPU_STATS_ALL_CPUS = NodeGetCPUStatsAllCPUs(C.VIR_NODE_CPU_STATS_ALL_CPUS) +) + +const ( + NODE_MEMORY_STATS_ALL_CELLS = int(C.VIR_NODE_MEMORY_STATS_ALL_CELLS) +) + +type ConnectCredentialType int + +const ( + CRED_USERNAME = ConnectCredentialType(C.VIR_CRED_USERNAME) + CRED_AUTHNAME = ConnectCredentialType(C.VIR_CRED_AUTHNAME) + CRED_LANGUAGE = ConnectCredentialType(C.VIR_CRED_LANGUAGE) + CRED_CNONCE = ConnectCredentialType(C.VIR_CRED_CNONCE) + CRED_PASSPHRASE = ConnectCredentialType(C.VIR_CRED_PASSPHRASE) + CRED_ECHOPROMPT = ConnectCredentialType(C.VIR_CRED_ECHOPROMPT) + CRED_NOECHOPROMPT = ConnectCredentialType(C.VIR_CRED_NOECHOPROMPT) + CRED_REALM = ConnectCredentialType(C.VIR_CRED_REALM) + CRED_EXTERNAL = ConnectCredentialType(C.VIR_CRED_EXTERNAL) +) + +type Connect struct { + ptr C.virConnectPtr +} + +type NodeInfo struct { + Model string + Memory uint64 + Cpus uint + MHz uint + Nodes uint32 + Sockets uint32 + Cores uint32 + Threads uint32 +} + +// Additional data associated to the connection. +type virConnectionData struct { + errCallbackId *int + closeCallbackId *int +} + +var connections map[C.virConnectPtr]*virConnectionData +var connectionsLock sync.RWMutex + +func init() { + connections = make(map[C.virConnectPtr]*virConnectionData) +} + +func saveConnectionData(c *Connect, d *virConnectionData) { + if c.ptr == nil { + return // Or panic? + } + connectionsLock.Lock() + defer connectionsLock.Unlock() + connections[c.ptr] = d +} + +func getConnectionData(c *Connect) *virConnectionData { + connectionsLock.RLock() + d := connections[c.ptr] + connectionsLock.RUnlock() + if d != nil { + return d + } + d = &virConnectionData{} + saveConnectionData(c, d) + return d +} + +func releaseConnectionData(c *Connect) { + if c.ptr == nil { + return + } + connectionsLock.Lock() + defer connectionsLock.Unlock() + delete(connections, c.ptr) +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virGetVersion +func GetVersion() (uint32, error) { + var version C.ulong + var err C.virError + ret := C.virGetVersionWrapper(&version, nil, nil, &err) + if ret < 0 { + return 0, makeError(&err) + } + return uint32(version), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpen +func NewConnect(uri string) (*Connect, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + ptr := C.virConnectOpenWrapper(cUri, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +type ConnectCredential struct { + Type ConnectCredentialType + Prompt string + Challenge string + DefResult string + Result string + ResultLen int +} + +type ConnectAuthCallback func(creds []*ConnectCredential) + +type ConnectAuth struct { + CredType []ConnectCredentialType + Callback ConnectAuthCallback +} + +//export connectAuthCallback +func connectAuthCallback(ccredlist C.virConnectCredentialPtr, ncred C.uint, callbackID C.int) C.int { + cred := make([]*ConnectCredential, int(ncred)) + + for i := 0; i < int(ncred); i++ { + ccred := (C.virConnectCredentialPtr)(unsafe.Pointer((uintptr)(unsafe.Pointer(ccredlist)) + (unsafe.Sizeof(*ccredlist) * uintptr(i)))) + cred[i] = &ConnectCredential{ + Type: ConnectCredentialType(ccred._type), + Prompt: C.GoString(ccred.prompt), + Challenge: C.GoString(ccred.challenge), + DefResult: C.GoString(ccred.defresult), + ResultLen: -1, + } + } + callbackEntry := getCallbackId(int(callbackID)) + callback, ok := callbackEntry.(ConnectAuthCallback) + if !ok { + panic("Unexpected callback type") + } + + callback(cred) + + for i := 0; i < int(ncred); i++ { + ccred := (C.virConnectCredentialPtr)(unsafe.Pointer((uintptr)(unsafe.Pointer(ccredlist)) + (unsafe.Sizeof(*ccredlist) * uintptr(i)))) + if cred[i].ResultLen >= 0 { + ccred.result = C.CString(cred[i].Result) + ccred.resultlen = C.uint(cred[i].ResultLen) + } + } + + return 0 +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenAuth +func NewConnectWithAuth(uri string, auth *ConnectAuth, flags ConnectFlags) (*Connect, error) { + var cUri *C.char + + ccredtype := make([]C.int, len(auth.CredType)) + + for i := 0; i < len(auth.CredType); i++ { + ccredtype[i] = C.int(auth.CredType[i]) + } + + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + + callbackID := registerCallbackId(auth.Callback) + + var err C.virError + ptr := C.virConnectOpenAuthWrapper(cUri, &ccredtype[0], C.uint(len(auth.CredType)), C.int(callbackID), C.uint(flags), &err) + freeCallbackId(callbackID) + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenReadOnly +func NewConnectReadOnly(uri string) (*Connect, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + ptr := C.virConnectOpenReadOnlyWrapper(cUri, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectClose +func (c *Connect) Close() (int, error) { + var err C.virError + result := int(C.virConnectCloseWrapper(c.ptr, &err)) + if result == -1 { + return result, makeError(&err) + } + if result == 0 { + // No more reference to this connection, release data. + releaseConnectionData(c) + c.ptr = nil + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectRef +func (c *Connect) Ref() error { + var err C.virError + ret := C.virConnectRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +type CloseCallback func(conn *Connect, reason ConnectCloseReason) + +// Register a close callback for the given destination. Only one +// callback per connection is allowed. Setting a callback will remove +// the previous one. +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectRegisterCloseCallback +func (c *Connect) RegisterCloseCallback(callback CloseCallback) error { + c.UnregisterCloseCallback() + goCallbackId := registerCallbackId(callback) + var err C.virError + res := C.virConnectRegisterCloseCallbackWrapper(c.ptr, C.long(goCallbackId), &err) + if res != 0 { + freeCallbackId(goCallbackId) + return makeError(&err) + } + connData := getConnectionData(c) + connData.closeCallbackId = &goCallbackId + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectUnregisterCloseCallback +func (c *Connect) UnregisterCloseCallback() error { + connData := getConnectionData(c) + if connData.closeCallbackId == nil { + return nil + } + var err C.virError + res := C.virConnectUnregisterCloseCallbackWrapper(c.ptr, &err) + if res != 0 { + return makeError(&err) + } + connData.closeCallbackId = nil + return nil +} + +//export closeCallback +func closeCallback(conn C.virConnectPtr, reason ConnectCloseReason, goCallbackId int) { + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(CloseCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(&Connect{ptr: conn}, reason) +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCapabilities +func (c *Connect) GetCapabilities() (string, error) { + var err C.virError + str := C.virConnectGetCapabilitiesWrapper(c.ptr, &err) + if str == nil { + return "", makeError(&err) + } + capabilities := C.GoString(str) + C.free(unsafe.Pointer(str)) + return capabilities, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetInfo +func (c *Connect) GetNodeInfo() (*NodeInfo, error) { + var cinfo C.virNodeInfo + var err C.virError + result := C.virNodeGetInfoWrapper(c.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &NodeInfo{ + Model: C.GoString((*C.char)(unsafe.Pointer(&cinfo.model[0]))), + Memory: uint64(cinfo.memory), + Cpus: uint(cinfo.cpus), + MHz: uint(cinfo.mhz), + Nodes: uint32(cinfo.nodes), + Sockets: uint32(cinfo.sockets), + Cores: uint32(cinfo.cores), + Threads: uint32(cinfo.threads), + }, nil +} + +func (ni *NodeInfo) GetMaxCPUs() uint32 { + return ni.Nodes * ni.Sockets * ni.Cores * ni.Threads +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetHostname +func (c *Connect) GetHostname() (string, error) { + var err C.virError + str := C.virConnectGetHostnameWrapper(c.ptr, &err) + if str == nil { + return "", makeError(&err) + } + hostname := C.GoString(str) + C.free(unsafe.Pointer(str)) + return hostname, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetLibVersion +func (c *Connect) GetLibVersion() (uint32, error) { + var version C.ulong + var err C.virError + ret := C.virConnectGetLibVersionWrapper(c.ptr, &version, &err) + if ret < 0 { + return 0, makeError(&err) + } + return uint32(version), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetType +func (c *Connect) GetType() (string, error) { + var err C.virError + str := C.virConnectGetTypeWrapper(c.ptr, &err) + if str == nil { + return "", makeError(&err) + } + hypDriver := C.GoString(str) + return hypDriver, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsAlive +func (c *Connect) IsAlive() (bool, error) { + var err C.virError + result := C.virConnectIsAliveWrapper(c.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsEncrypted +func (c *Connect) IsEncrypted() (bool, error) { + var err C.virError + result := C.virConnectIsEncryptedWrapper(c.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsSecure +func (c *Connect) IsSecure() (bool, error) { + var err C.virError + result := C.virConnectIsSecureWrapper(c.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectListDefinedDomains +func (c *Connect) ListDefinedDomains() ([]string, error) { + var names [1024](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numDomains := C.virConnectListDefinedDomainsWrapper( + c.ptr, + (**C.char)(namesPtr), + 1024, &err) + if numDomains == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numDomains) + for k := 0; k < int(numDomains); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectListDomains +func (c *Connect) ListDomains() ([]uint32, error) { + var cDomainsIds [512](uint32) + cDomainsPointer := unsafe.Pointer(&cDomainsIds) + var err C.virError + numDomains := C.virConnectListDomainsWrapper(c.ptr, (*C.int)(cDomainsPointer), 512, &err) + if numDomains == -1 { + return nil, makeError(&err) + } + + return cDomainsIds[:numDomains], nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectListInterfaces +func (c *Connect) ListInterfaces() ([]string, error) { + const maxIfaces = 1024 + var names [maxIfaces](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numIfaces := C.virConnectListInterfacesWrapper( + c.ptr, + (**C.char)(namesPtr), + maxIfaces, &err) + if numIfaces == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numIfaces) + for k := 0; k < int(numIfaces); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectListNetworks +func (c *Connect) ListNetworks() ([]string, error) { + const maxNets = 1024 + var names [maxNets](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNetworks := C.virConnectListNetworksWrapper( + c.ptr, + (**C.char)(namesPtr), + maxNets, &err) + if numNetworks == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNetworks) + for k := 0; k < int(numNetworks); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectListNWFilters +func (c *Connect) ListNWFilters() ([]string, error) { + const maxFilters = 1024 + var names [maxFilters](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNWFilters := C.virConnectListNWFiltersWrapper( + c.ptr, + (**C.char)(namesPtr), + maxFilters, &err) + if numNWFilters == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNWFilters) + for k := 0; k < int(numNWFilters); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectListStoragePools +func (c *Connect) ListStoragePools() ([]string, error) { + const maxPools = 1024 + var names [maxPools](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numStoragePools := C.virConnectListStoragePoolsWrapper( + c.ptr, + (**C.char)(namesPtr), + maxPools, &err) + if numStoragePools == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numStoragePools) + for k := 0; k < int(numStoragePools); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectListSecrets +func (c *Connect) ListSecrets() ([]string, error) { + const maxSecrets = 1024 + var uuids [maxSecrets](*C.char) + uuidsPtr := unsafe.Pointer(&uuids) + var err C.virError + numSecrets := C.virConnectListSecretsWrapper( + c.ptr, + (**C.char)(uuidsPtr), + maxSecrets, &err) + if numSecrets == -1 { + return nil, makeError(&err) + } + goUuids := make([]string, numSecrets) + for k := 0; k < int(numSecrets); k++ { + goUuids[k] = C.GoString(uuids[k]) + C.free(unsafe.Pointer(uuids[k])) + } + return goUuids, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeListDevices +func (c *Connect) ListDevices(cap string, flags uint32) ([]string, error) { + ccap := C.CString(cap) + defer C.free(unsafe.Pointer(ccap)) + const maxNodeDevices = 1024 + var uuids [maxNodeDevices](*C.char) + uuidsPtr := unsafe.Pointer(&uuids) + var err C.virError + numNodeDevices := C.virNodeListDevicesWrapper( + c.ptr, ccap, + (**C.char)(uuidsPtr), + maxNodeDevices, C.uint(flags), &err) + if numNodeDevices == -1 { + return nil, makeError(&err) + } + goUuids := make([]string, numNodeDevices) + for k := 0; k < int(numNodeDevices); k++ { + goUuids[k] = C.GoString(uuids[k]) + C.free(unsafe.Pointer(uuids[k])) + } + return goUuids, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByID +func (c *Connect) LookupDomainById(id uint32) (*Domain, error) { + var err C.virError + ptr := C.virDomainLookupByIDWrapper(c.ptr, C.int(id), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByName +func (c *Connect) LookupDomainByName(id string) (*Domain, error) { + cName := C.CString(id) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virDomainLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByUUIDString +func (c *Connect) LookupDomainByUUIDString(uuid string) (*Domain, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virDomainLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByUUID +func (c *Connect) LookupDomainByUUID(uuid []byte) (*Domain, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virDomainLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateXML +func (c *Connect) DomainCreateXML(xmlConfig string, flags DomainCreateFlags) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virDomainCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateXMLWithFiles +func (c *Connect) DomainCreateXMLWithFiles(xmlConfig string, files []os.File, flags DomainCreateFlags) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + cfiles := make([]C.int, len(files)) + for i := 0; i < len(files); i++ { + cfiles[i] = C.int(files[i].Fd()) + } + var err C.virError + ptr := C.virDomainCreateXMLWithFilesWrapper(c.ptr, cXml, C.uint(len(files)), (&cfiles[0]), C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDefineXML +func (c *Connect) DomainDefineXML(xmlConfig string) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virDomainDefineXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDefineXMLFlags +func (c *Connect) DomainDefineXMLFlags(xmlConfig string, flags DomainDefineFlags) (*Domain, error) { + if C.LIBVIR_VERSION_NUMBER < 1002012 { + return nil, makeNotImplementedError("virDomainDefineXMLFlags") + } + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virDomainDefineXMLFlagsWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectListDefinedInterfaces +func (c *Connect) ListDefinedInterfaces() ([]string, error) { + const maxIfaces = 1024 + var names [maxIfaces](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numIfaces := C.virConnectListDefinedInterfacesWrapper( + c.ptr, + (**C.char)(namesPtr), + maxIfaces, &err) + if numIfaces == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numIfaces) + for k := 0; k < int(numIfaces); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectListDefinedNetworks +func (c *Connect) ListDefinedNetworks() ([]string, error) { + const maxNets = 1024 + var names [maxNets](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNetworks := C.virConnectListDefinedNetworksWrapper( + c.ptr, + (**C.char)(namesPtr), + maxNets, &err) + if numNetworks == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNetworks) + for k := 0; k < int(numNetworks); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectListDefinedStoragePools +func (c *Connect) ListDefinedStoragePools() ([]string, error) { + const maxPools = 1024 + var names [maxPools](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numStoragePools := C.virConnectListDefinedStoragePoolsWrapper( + c.ptr, + (**C.char)(namesPtr), + maxPools, &err) + if numStoragePools == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numStoragePools) + for k := 0; k < int(numStoragePools); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectNumOfDefinedDomains +func (c *Connect) NumOfDefinedDomains() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedDomainsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectNumOfDefinedInterfaces +func (c *Connect) NumOfDefinedInterfaces() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedInterfacesWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectNumOfDefinedNetworks +func (c *Connect) NumOfDefinedNetworks() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedNetworksWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectNumOfDefinedStoragePools +func (c *Connect) NumOfDefinedStoragePools() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedStoragePoolsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectNumOfDomains +func (c *Connect) NumOfDomains() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDomainsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectNumOfStoragePools +func (c *Connect) NumOfStoragePools() (int, error) { + var err C.virError + result := int(C.virConnectNumOfStoragePoolsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectNumOfInterfaces +func (c *Connect) NumOfInterfaces() (int, error) { + var err C.virError + result := int(C.virConnectNumOfInterfacesWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectNumOfNetworks +func (c *Connect) NumOfNetworks() (int, error) { + var err C.virError + result := int(C.virConnectNumOfNetworksWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectNumOfNWFilters +func (c *Connect) NumOfNWFilters() (int, error) { + var err C.virError + result := int(C.virConnectNumOfNWFiltersWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectNumOfSecrets +func (c *Connect) NumOfSecrets() (int, error) { + var err C.virError + result := int(C.virConnectNumOfSecretsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeNumOfDevices +func (c *Connect) NumOfDevices(cap string, flags uint32) (int, error) { + ccap := C.CString(cap) + defer C.free(unsafe.Pointer(ccap)) + var err C.virError + result := int(C.virNodeNumOfDevicesWrapper(c.ptr, ccap, C.uint(flags), &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDefineXML +func (c *Connect) NetworkDefineXML(xmlConfig string) (*Network, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkDefineXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreateXML +func (c *Connect) NetworkCreateXML(xmlConfig string) (*Network, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkCreateXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByName +func (c *Connect) LookupNetworkByName(name string) (*Network, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNetworkLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByUUIDString +func (c *Connect) LookupNetworkByUUIDString(uuid string) (*Network, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virNetworkLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByUUID +func (c *Connect) LookupNetworkByUUID(uuid []byte) (*Network, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virNetworkLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectSetKeepAlive +func (c *Connect) SetKeepAlive(interval int, count uint) error { + var err C.virError + res := int(C.virConnectSetKeepAliveWrapper(c.ptr, C.int(interval), C.uint(count), &err)) + switch res { + case 0: + return nil + default: + return makeError(&err) + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetSysinfo +func (c *Connect) GetSysinfo(flags uint32) (string, error) { + var err C.virError + cStr := C.virConnectGetSysinfoWrapper(c.ptr, C.uint(flags), &err) + if cStr == nil { + return "", makeError(&err) + } + info := C.GoString(cStr) + C.free(unsafe.Pointer(cStr)) + return info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetURI +func (c *Connect) GetURI() (string, error) { + var err C.virError + cStr := C.virConnectGetURIWrapper(c.ptr, &err) + if cStr == nil { + return "", makeError(&err) + } + uri := C.GoString(cStr) + C.free(unsafe.Pointer(cStr)) + return uri, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetMaxVcpus +func (c *Connect) GetMaxVcpus(typeAttr string) (int, error) { + var cTypeAttr *C.char + if typeAttr != "" { + cTypeAttr = C.CString(typeAttr) + defer C.free(unsafe.Pointer(cTypeAttr)) + } + var err C.virError + result := int(C.virConnectGetMaxVcpusWrapper(c.ptr, cTypeAttr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDefineXML +func (c *Connect) InterfaceDefineXML(xmlConfig string, flags uint32) (*Interface, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virInterfaceDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Interface{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceLookupByName +func (c *Connect) LookupInterfaceByName(name string) (*Interface, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virInterfaceLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Interface{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceLookupByMACString +func (c *Connect) LookupInterfaceByMACString(mac string) (*Interface, error) { + cName := C.CString(mac) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virInterfaceLookupByMACStringWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Interface{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDefineXML +func (c *Connect) StoragePoolDefineXML(xmlConfig string, flags uint32) (*StoragePool, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStoragePoolDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolCreateXML +func (c *Connect) StoragePoolCreateXML(xmlConfig string, flags StoragePoolCreateFlags) (*StoragePool, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStoragePoolCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByName +func (c *Connect) LookupStoragePoolByName(name string) (*StoragePool, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virStoragePoolLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByUUIDString +func (c *Connect) LookupStoragePoolByUUIDString(uuid string) (*StoragePool, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virStoragePoolLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByUUID +func (c *Connect) LookupStoragePoolByUUID(uuid []byte) (*StoragePool, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virStoragePoolLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByTargetPath +func (c *Connect) LookupStoragePoolByTargetPath(path string) (*StoragePool, error) { + if C.LIBVIR_VERSION_NUMBER < 4001000 { + return nil, makeNotImplementedError("virStoragePoolLookupByTargetPath") + } + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + ptr := C.virStoragePoolLookupByTargetPathWrapper(c.ptr, cPath, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterDefineXML +func (c *Connect) NWFilterDefineXML(xmlConfig string) (*NWFilter, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNWFilterDefineXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByName +func (c *Connect) LookupNWFilterByName(name string) (*NWFilter, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNWFilterLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByUUIDString +func (c *Connect) LookupNWFilterByUUIDString(uuid string) (*NWFilter, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virNWFilterLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByUUID +func (c *Connect) LookupNWFilterByUUID(uuid []byte) (*NWFilter, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virNWFilterLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingLookupByPortDev +func (c *Connect) LookupNWFilterBindingByPortDev(name string) (*NWFilterBinding, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return nil, makeNotImplementedError("virNWFilterBindingLookupByPortDev") + } + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNWFilterBindingLookupByPortDevWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilterBinding{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByKey +func (c *Connect) LookupStorageVolByKey(key string) (*StorageVol, error) { + cKey := C.CString(key) + defer C.free(unsafe.Pointer(cKey)) + var err C.virError + ptr := C.virStorageVolLookupByKeyWrapper(c.ptr, cKey, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByPath +func (c *Connect) LookupStorageVolByPath(path string) (*StorageVol, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + ptr := C.virStorageVolLookupByPathWrapper(c.ptr, cPath, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretDefineXML +func (c *Connect) SecretDefineXML(xmlConfig string, flags uint32) (*Secret, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virSecretDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretLookupByUUID +func (c *Connect) LookupSecretByUUID(uuid []byte) (*Secret, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virSecretLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretLookupByUUIDString +func (c *Connect) LookupSecretByUUIDString(uuid string) (*Secret, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virSecretLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretLookupByUsage +func (c *Connect) LookupSecretByUsage(usageType SecretUsageType, usageID string) (*Secret, error) { + cUsageID := C.CString(usageID) + defer C.free(unsafe.Pointer(cUsageID)) + var err C.virError + ptr := C.virSecretLookupByUsageWrapper(c.ptr, C.int(usageType), cUsageID, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceLookupByName +func (c *Connect) LookupDeviceByName(id string) (*NodeDevice, error) { + cName := C.CString(id) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNodeDeviceLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceLookupSCSIHostByWWN +func (c *Connect) LookupDeviceSCSIHostByWWN(wwnn, wwpn string, flags uint32) (*NodeDevice, error) { + cWwnn := C.CString(wwnn) + cWwpn := C.CString(wwpn) + defer C.free(unsafe.Pointer(cWwnn)) + defer C.free(unsafe.Pointer(cWwpn)) + var err C.virError + ptr := C.virNodeDeviceLookupSCSIHostByWWNWrapper(c.ptr, cWwnn, cWwpn, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceCreateXML +func (c *Connect) DeviceCreateXML(xmlConfig string, flags uint32) (*NodeDevice, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNodeDeviceCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectListAllInterfaces +func (c *Connect) ListAllInterfaces(flags ConnectListAllInterfacesFlags) ([]Interface, error) { + var cList *C.virInterfacePtr + var err C.virError + numIfaces := C.virConnectListAllInterfacesWrapper(c.ptr, (**C.virInterfacePtr)(&cList), C.uint(flags), &err) + if numIfaces == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numIfaces), + Cap: int(numIfaces), + } + var ifaces []Interface + slice := *(*[]C.virInterfacePtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + ifaces = append(ifaces, Interface{ptr}) + } + C.free(unsafe.Pointer(cList)) + return ifaces, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectListAllNetworks +func (c *Connect) ListAllNetworks(flags ConnectListAllNetworksFlags) ([]Network, error) { + var cList *C.virNetworkPtr + var err C.virError + numNets := C.virConnectListAllNetworksWrapper(c.ptr, (**C.virNetworkPtr)(&cList), C.uint(flags), &err) + if numNets == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numNets), + Cap: int(numNets), + } + var nets []Network + slice := *(*[]C.virNetworkPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + nets = append(nets, Network{ptr}) + } + C.free(unsafe.Pointer(cList)) + return nets, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectListAllDomains +func (c *Connect) ListAllDomains(flags ConnectListAllDomainsFlags) ([]Domain, error) { + var cList *C.virDomainPtr + var err C.virError + numDomains := C.virConnectListAllDomainsWrapper(c.ptr, (**C.virDomainPtr)(&cList), C.uint(flags), &err) + if numDomains == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numDomains), + Cap: int(numDomains), + } + var domains []Domain + slice := *(*[]C.virDomainPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + domains = append(domains, Domain{ptr}) + } + C.free(unsafe.Pointer(cList)) + return domains, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectListAllNWFilters +func (c *Connect) ListAllNWFilters(flags uint32) ([]NWFilter, error) { + var cList *C.virNWFilterPtr + var err C.virError + numNWFilters := C.virConnectListAllNWFiltersWrapper(c.ptr, (**C.virNWFilterPtr)(&cList), C.uint(flags), &err) + if numNWFilters == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numNWFilters), + Cap: int(numNWFilters), + } + var filters []NWFilter + slice := *(*[]C.virNWFilterPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + filters = append(filters, NWFilter{ptr}) + } + C.free(unsafe.Pointer(cList)) + return filters, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectListAllNWFilterBindings +func (c *Connect) ListAllNWFilterBindings(flags uint32) ([]NWFilterBinding, error) { + var cList *C.virNWFilterBindingPtr + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return []NWFilterBinding{}, makeNotImplementedError("virConnectListAllNWFilterBindings") + } + var err C.virError + numNWFilters := C.virConnectListAllNWFilterBindingsWrapper(c.ptr, (**C.virNWFilterBindingPtr)(&cList), C.uint(flags), &err) + if numNWFilters == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numNWFilters), + Cap: int(numNWFilters), + } + var filters []NWFilterBinding + slice := *(*[]C.virNWFilterBindingPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + filters = append(filters, NWFilterBinding{ptr}) + } + C.free(unsafe.Pointer(cList)) + return filters, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectListAllStoragePools +func (c *Connect) ListAllStoragePools(flags ConnectListAllStoragePoolsFlags) ([]StoragePool, error) { + var cList *C.virStoragePoolPtr + var err C.virError + numPools := C.virConnectListAllStoragePoolsWrapper(c.ptr, (**C.virStoragePoolPtr)(&cList), C.uint(flags), &err) + if numPools == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPools), + Cap: int(numPools), + } + var pools []StoragePool + slice := *(*[]C.virStoragePoolPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, StoragePool{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectListAllSecrets +func (c *Connect) ListAllSecrets(flags ConnectListAllSecretsFlags) ([]Secret, error) { + var cList *C.virSecretPtr + var err C.virError + numPools := C.virConnectListAllSecretsWrapper(c.ptr, (**C.virSecretPtr)(&cList), C.uint(flags), &err) + if numPools == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPools), + Cap: int(numPools), + } + var pools []Secret + slice := *(*[]C.virSecretPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, Secret{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virConnectListAllNodeDevices +func (c *Connect) ListAllNodeDevices(flags ConnectListAllNodeDeviceFlags) ([]NodeDevice, error) { + var cList *C.virNodeDevicePtr + var err C.virError + numPools := C.virConnectListAllNodeDevicesWrapper(c.ptr, (**C.virNodeDevicePtr)(&cList), C.uint(flags), &err) + if numPools == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPools), + Cap: int(numPools), + } + var pools []NodeDevice + slice := *(*[]C.virNodeDevicePtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, NodeDevice{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeBegin +func (c *Connect) InterfaceChangeBegin(flags uint32) error { + var err C.virError + ret := C.virInterfaceChangeBeginWrapper(c.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeCommit +func (c *Connect) InterfaceChangeCommit(flags uint32) error { + var err C.virError + ret := C.virInterfaceChangeCommitWrapper(c.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeRollback +func (c *Connect) InterfaceChangeRollback(flags uint32) error { + var err C.virError + ret := C.virInterfaceChangeRollbackWrapper(c.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeAllocPages +func (c *Connect) AllocPages(pageSizes map[int]int64, startCell int, cellCount uint, flags NodeAllocPagesFlags) (int, error) { + if C.LIBVIR_VERSION_NUMBER < 1002009 { + return 0, makeNotImplementedError("virNodeAllocPages") + } + cpages := make([]C.uint, len(pageSizes)) + ccounts := make([]C.ulonglong, len(pageSizes)) + + i := 0 + for key, val := range pageSizes { + cpages[i] = C.uint(key) + ccounts[i] = C.ulonglong(val) + i++ + } + + var err C.virError + ret := C.virNodeAllocPagesWrapper(c.ptr, C.uint(len(pageSizes)), (*C.uint)(unsafe.Pointer(&cpages)), + (*C.ulonglong)(unsafe.Pointer(&ccounts)), C.int(startCell), C.uint(cellCount), C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCPUMap +func (c *Connect) GetCPUMap(flags uint32) (map[int]bool, uint, error) { + var ccpumap *C.uchar + var conline C.uint + var err C.virError + ret := C.virNodeGetCPUMapWrapper(c.ptr, &ccpumap, &conline, C.uint(flags), &err) + if ret == -1 { + return map[int]bool{}, 0, makeError(&err) + } + defer C.free(unsafe.Pointer(ccpumap)) + + cpumapbytes := C.GoBytes(unsafe.Pointer(ccpumap), C.int(ret/8)) + + cpumap := make(map[int]bool, 0) + for i := 0; i < int(ret); i++ { + idx := int(i / 8) + val := byte(cpumapbytes[idx]) + shift := i % 8 + cpumap[i] = (val & (1 << uint(shift))) == 1 + } + + return cpumap, uint(conline), nil +} + +type NodeCPUStats struct { + KernelSet bool + Kernel uint64 + UserSet bool + User uint64 + IdleSet bool + Idle uint64 + IowaitSet bool + Iowait uint64 + IntrSet bool + Intr uint64 + UtilizationSet bool + Utilization uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCPUStats +func (c *Connect) GetCPUStats(cpuNum int, flags uint32) (*NodeCPUStats, error) { + var nparams C.int + + var err C.virError + ret := C.virNodeGetCPUStatsWrapper(c.ptr, C.int(cpuNum), nil, &nparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + params := make([]C.virNodeCPUStats, nparams) + ret = C.virNodeGetCPUStatsWrapper(c.ptr, C.int(cpuNum), (*C.virNodeCPUStats)(unsafe.Pointer(¶ms[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + stats := &NodeCPUStats{} + for i := 0; i < int(nparams); i++ { + param := params[i] + field := C.GoString((*C.char)(unsafe.Pointer(¶m.field))) + switch field { + case C.VIR_NODE_CPU_STATS_KERNEL: + stats.KernelSet = true + stats.Kernel = uint64(param.value) + case C.VIR_NODE_CPU_STATS_USER: + stats.UserSet = true + stats.User = uint64(param.value) + case C.VIR_NODE_CPU_STATS_IDLE: + stats.IdleSet = true + stats.Idle = uint64(param.value) + case C.VIR_NODE_CPU_STATS_IOWAIT: + stats.IowaitSet = true + stats.Iowait = uint64(param.value) + case C.VIR_NODE_CPU_STATS_INTR: + stats.IntrSet = true + stats.Intr = uint64(param.value) + case C.VIR_NODE_CPU_STATS_UTILIZATION: + stats.UtilizationSet = true + stats.Utilization = uint64(param.value) + } + } + + return stats, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCellsFreeMemory +func (c *Connect) GetCellsFreeMemory(startCell int, maxCells int) ([]uint64, error) { + cmem := make([]C.ulonglong, maxCells) + var err C.virError + ret := C.virNodeGetCellsFreeMemoryWrapper(c.ptr, (*C.ulonglong)(unsafe.Pointer(&cmem[0])), C.int(startCell), C.int(maxCells), &err) + if ret == -1 { + return []uint64{}, makeError(&err) + } + + mem := make([]uint64, ret) + for i := 0; i < int(ret); i++ { + mem[i] = uint64(cmem[i]) + } + + return mem, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetFreeMemory +func (c *Connect) GetFreeMemory() (uint64, error) { + var err C.virError + ret := C.virNodeGetFreeMemoryWrapper(c.ptr, &err) + if ret == 0 { + return 0, makeError(&err) + } + + return (uint64)(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetFreePages +func (c *Connect) GetFreePages(pageSizes []uint64, startCell int, maxCells uint, flags uint32) ([]uint64, error) { + if C.LIBVIR_VERSION_NUMBER < 1002006 { + return []uint64{}, makeNotImplementedError("virNodeGetFreePages") + } + cpageSizes := make([]C.uint, len(pageSizes)) + ccounts := make([]C.ulonglong, len(pageSizes)*int(maxCells)) + + for i := 0; i < len(pageSizes); i++ { + cpageSizes[i] = C.uint(pageSizes[i]) + } + + var err C.virError + ret := C.virNodeGetFreePagesWrapper(c.ptr, C.uint(len(pageSizes)), (*C.uint)(unsafe.Pointer(&cpageSizes)), C.int(startCell), + C.uint(maxCells), (*C.ulonglong)(unsafe.Pointer(&ccounts)), C.uint(flags), &err) + if ret == -1 { + return []uint64{}, makeError(&err) + } + + counts := make([]uint64, ret) + for i := 0; i < int(ret); i++ { + counts[i] = uint64(ccounts[i]) + } + + return counts, nil +} + +type NodeMemoryParameters struct { + ShmPagesToScanSet bool + ShmPagesToScan uint + ShmSleepMillisecsSet bool + ShmSleepMillisecs uint + ShmPagesSharedSet bool + ShmPagesShared uint64 + ShmPagesSharingSet bool + ShmPagesSharing uint64 + ShmPagesUnsharedSet bool + ShmPagesUnshared uint64 + ShmPagesVolatileSet bool + ShmPagesVolatile uint64 + ShmFullScansSet bool + ShmFullScans uint64 + ShmMergeAcrossNodesSet bool + ShmMergeAcrossNodes uint +} + +func getMemoryParameterFieldInfo(params *NodeMemoryParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN: typedParamsFieldInfo{ + set: ¶ms.ShmPagesToScanSet, + ui: ¶ms.ShmPagesToScan, + }, + C.VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS: typedParamsFieldInfo{ + set: ¶ms.ShmSleepMillisecsSet, + ui: ¶ms.ShmSleepMillisecs, + }, + C.VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES: typedParamsFieldInfo{ + set: ¶ms.ShmMergeAcrossNodesSet, + ui: ¶ms.ShmMergeAcrossNodes, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_SHARED: typedParamsFieldInfo{ + set: ¶ms.ShmPagesSharedSet, + ul: ¶ms.ShmPagesShared, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_SHARING: typedParamsFieldInfo{ + set: ¶ms.ShmPagesSharingSet, + ul: ¶ms.ShmPagesSharing, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED: typedParamsFieldInfo{ + set: ¶ms.ShmPagesUnsharedSet, + ul: ¶ms.ShmPagesUnshared, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE: typedParamsFieldInfo{ + set: ¶ms.ShmPagesVolatileSet, + ul: ¶ms.ShmPagesVolatile, + }, + C.VIR_NODE_MEMORY_SHARED_FULL_SCANS: typedParamsFieldInfo{ + set: ¶ms.ShmFullScansSet, + ul: ¶ms.ShmFullScans, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetMemoryParameters +func (c *Connect) GetMemoryParameters(flags uint32) (*NodeMemoryParameters, error) { + params := &NodeMemoryParameters{} + info := getMemoryParameterFieldInfo(params) + + var nparams C.int + + var err C.virError + ret := C.virNodeGetMemoryParametersWrapper(c.ptr, nil, &nparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virNodeGetMemoryParametersWrapper(c.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +type NodeMemoryStats struct { + TotalSet bool + Total uint64 + FreeSet bool + Free uint64 + BuffersSet bool + Buffers uint64 + CachedSet bool + Cached uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetMemoryStats +func (c *Connect) GetMemoryStats(cellNum int, flags uint32) (*NodeMemoryStats, error) { + var nparams C.int + + var err C.virError + ret := C.virNodeGetMemoryStatsWrapper(c.ptr, C.int(cellNum), nil, &nparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + params := make([]C.virNodeMemoryStats, nparams) + ret = C.virNodeGetMemoryStatsWrapper(c.ptr, C.int(cellNum), (*C.virNodeMemoryStats)(unsafe.Pointer(¶ms[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + stats := &NodeMemoryStats{} + for i := 0; i < int(nparams); i++ { + param := params[i] + field := C.GoString((*C.char)(unsafe.Pointer(¶m.field))) + switch field { + case C.VIR_NODE_MEMORY_STATS_TOTAL: + stats.TotalSet = true + stats.Total = uint64(param.value) + case C.VIR_NODE_MEMORY_STATS_FREE: + stats.FreeSet = true + stats.Free = uint64(param.value) + case C.VIR_NODE_MEMORY_STATS_BUFFERS: + stats.BuffersSet = true + stats.Buffers = uint64(param.value) + case C.VIR_NODE_MEMORY_STATS_CACHED: + stats.CachedSet = true + stats.Cached = uint64(param.value) + } + } + + return stats, nil +} + +type NodeSecurityModel struct { + Model string + Doi string +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSecurityModel +func (c *Connect) GetSecurityModel() (*NodeSecurityModel, error) { + var cmodel C.virSecurityModel + var err C.virError + ret := C.virNodeGetSecurityModelWrapper(c.ptr, &cmodel, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &NodeSecurityModel{ + Model: C.GoString((*C.char)(unsafe.Pointer(&cmodel.model))), + Doi: C.GoString((*C.char)(unsafe.Pointer(&cmodel.doi))), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeSetMemoryParameters +func (c *Connect) SetMemoryParameters(params *NodeMemoryParameters, flags uint32) error { + info := getMemoryParameterFieldInfo(params) + + var nparams C.int + + var err C.virError + ret := C.virNodeGetMemoryParametersWrapper(c.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virNodeGetMemoryParametersWrapper(c.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virNodeSetMemoryParametersWrapper(c.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeSuspendForDuration +func (c *Connect) SuspendForDuration(target NodeSuspendTarget, duration uint64, flags uint32) error { + var err C.virError + ret := C.virNodeSuspendForDurationWrapper(c.ptr, C.uint(target), C.ulonglong(duration), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveImageDefineXML +func (c *Connect) DomainSaveImageDefineXML(file string, xml string, flags DomainSaveRestoreFlags) error { + cfile := C.CString(file) + defer C.free(unsafe.Pointer(cfile)) + cxml := C.CString(xml) + defer C.free(unsafe.Pointer(cxml)) + + var err C.virError + ret := C.virDomainSaveImageDefineXMLWrapper(c.ptr, cfile, cxml, C.uint(flags), &err) + + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveImageGetXMLDesc +func (c *Connect) DomainSaveImageGetXMLDesc(file string, flags DomainXMLFlags) (string, error) { + cfile := C.CString(file) + defer C.free(unsafe.Pointer(cfile)) + + var err C.virError + ret := C.virDomainSaveImageGetXMLDescWrapper(c.ptr, cfile, C.uint(flags), &err) + + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectBaselineCPU +func (c *Connect) BaselineCPU(xmlCPUs []string, flags ConnectBaselineCPUFlags) (string, error) { + cxmlCPUs := make([]*C.char, len(xmlCPUs)) + for i := 0; i < len(xmlCPUs); i++ { + cxmlCPUs[i] = C.CString(xmlCPUs[i]) + defer C.free(unsafe.Pointer(cxmlCPUs[i])) + } + + var err C.virError + ret := C.virConnectBaselineCPUWrapper(c.ptr, &cxmlCPUs[0], C.uint(len(xmlCPUs)), C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectBaselineHypervisorCPU +func (c *Connect) BaselineHypervisorCPU(emulator string, arch string, machine string, virttype string, xmlCPUs []string, flags ConnectBaselineCPUFlags) (string, error) { + if C.LIBVIR_VERSION_NUMBER < 4004000 { + return "", makeNotImplementedError("virConnectBaselineHypervisorCPU") + } + + var cemulator, carch, cmachine, cvirttype *C.char + if emulator != "" { + cemulator = C.CString(emulator) + defer C.free(unsafe.Pointer(cemulator)) + } + if arch != "" { + carch = C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + } + if machine != "" { + cmachine = C.CString(machine) + defer C.free(unsafe.Pointer(cmachine)) + } + if virttype != "" { + cvirttype = C.CString(virttype) + defer C.free(unsafe.Pointer(cvirttype)) + } + cxmlCPUs := make([]*C.char, len(xmlCPUs)) + for i := 0; i < len(xmlCPUs); i++ { + cxmlCPUs[i] = C.CString(xmlCPUs[i]) + defer C.free(unsafe.Pointer(cxmlCPUs[i])) + } + + var err C.virError + ret := C.virConnectBaselineHypervisorCPUWrapper(c.ptr, cemulator, carch, cmachine, cvirttype, + &cxmlCPUs[0], C.uint(len(xmlCPUs)), C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectCompareCPU +func (c *Connect) CompareCPU(xmlDesc string, flags ConnectCompareCPUFlags) (CPUCompareResult, error) { + cxmlDesc := C.CString(xmlDesc) + defer C.free(unsafe.Pointer(cxmlDesc)) + + var err C.virError + ret := C.virConnectCompareCPUWrapper(c.ptr, cxmlDesc, C.uint(flags), &err) + if ret == C.VIR_CPU_COMPARE_ERROR { + return CPU_COMPARE_ERROR, makeError(&err) + } + + return CPUCompareResult(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectCompareHypervisorCPU +func (c *Connect) CompareHypervisorCPU(emulator string, arch string, machine string, virttype string, xmlDesc string, flags ConnectCompareCPUFlags) (CPUCompareResult, error) { + if C.LIBVIR_VERSION_NUMBER < 4004000 { + return CPU_COMPARE_ERROR, makeNotImplementedError("virConnectCompareHypervisorCPU") + } + + var cemulator, carch, cmachine, cvirttype *C.char + if emulator != "" { + cemulator = C.CString(emulator) + defer C.free(unsafe.Pointer(cemulator)) + } + if arch != "" { + carch = C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + } + if machine != "" { + cmachine = C.CString(machine) + defer C.free(unsafe.Pointer(cmachine)) + } + if virttype != "" { + cvirttype = C.CString(virttype) + defer C.free(unsafe.Pointer(cvirttype)) + } + + cxmlDesc := C.CString(xmlDesc) + defer C.free(unsafe.Pointer(cxmlDesc)) + + var err C.virError + ret := C.virConnectCompareHypervisorCPUWrapper(c.ptr, cemulator, carch, cmachine, cvirttype, cxmlDesc, C.uint(flags), &err) + if ret == C.VIR_CPU_COMPARE_ERROR { + return CPU_COMPARE_ERROR, makeError(&err) + } + + return CPUCompareResult(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainXMLFromNative +func (c *Connect) DomainXMLFromNative(nativeFormat string, nativeConfig string, flags uint32) (string, error) { + cnativeFormat := C.CString(nativeFormat) + defer C.free(unsafe.Pointer(cnativeFormat)) + cnativeConfig := C.CString(nativeConfig) + defer C.free(unsafe.Pointer(cnativeConfig)) + + var err C.virError + ret := C.virConnectDomainXMLFromNativeWrapper(c.ptr, cnativeFormat, cnativeConfig, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainXMLToNative +func (c *Connect) DomainXMLToNative(nativeFormat string, domainXml string, flags uint32) (string, error) { + cnativeFormat := C.CString(nativeFormat) + defer C.free(unsafe.Pointer(cnativeFormat)) + cdomainXml := C.CString(domainXml) + defer C.free(unsafe.Pointer(cdomainXml)) + + var err C.virError + ret := C.virConnectDomainXMLToNativeWrapper(c.ptr, cnativeFormat, cdomainXml, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCPUModelNames +func (c *Connect) GetCPUModelNames(arch string, flags uint32) ([]string, error) { + carch := C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + + var cmodels **C.char + var err C.virError + ret := C.virConnectGetCPUModelNamesWrapper(c.ptr, carch, &cmodels, C.uint(flags), &err) + if ret == -1 { + return []string{}, makeError(&err) + } + + models := make([]string, int(ret)) + for i := 0; i < int(ret); i++ { + cmodel := *(**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cmodels)) + (unsafe.Sizeof(*cmodels) * uintptr(i)))) + + defer C.free(unsafe.Pointer(cmodel)) + models[i] = C.GoString(cmodel) + } + defer C.free(unsafe.Pointer(cmodels)) + + return models, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetDomainCapabilities +func (c *Connect) GetDomainCapabilities(emulatorbin string, arch string, machine string, virttype string, flags uint32) (string, error) { + if C.LIBVIR_VERSION_NUMBER < 1002007 { + return "", makeNotImplementedError("virConnectGetDomainCapabilities") + } + var cemulatorbin *C.char + if emulatorbin != "" { + cemulatorbin = C.CString(emulatorbin) + defer C.free(unsafe.Pointer(cemulatorbin)) + } + var carch *C.char + if arch != "" { + carch = C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + } + var cmachine *C.char + if machine != "" { + cmachine = C.CString(machine) + defer C.free(unsafe.Pointer(cmachine)) + } + var cvirttype *C.char + if virttype != "" { + cvirttype = C.CString(virttype) + defer C.free(unsafe.Pointer(cvirttype)) + } + + var err C.virError + ret := C.virConnectGetDomainCapabilitiesWrapper(c.ptr, cemulatorbin, carch, cmachine, cvirttype, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetVersion +func (c *Connect) GetVersion() (uint32, error) { + var hvVer C.ulong + var err C.virError + ret := C.virConnectGetVersionWrapper(c.ptr, &hvVer, &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint32(hvVer), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectFindStoragePoolSources +func (c *Connect) FindStoragePoolSources(pooltype string, srcSpec string, flags uint32) (string, error) { + cpooltype := C.CString(pooltype) + defer C.free(unsafe.Pointer(cpooltype)) + var csrcSpec *C.char + if srcSpec != "" { + csrcSpec := C.CString(srcSpec) + defer C.free(unsafe.Pointer(csrcSpec)) + } + var err C.virError + ret := C.virConnectFindStoragePoolSourcesWrapper(c.ptr, cpooltype, csrcSpec, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestore +func (c *Connect) DomainRestore(srcFile string) error { + cPath := C.CString(srcFile) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + if result := C.virDomainRestoreWrapper(c.ptr, cPath, &err); result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestoreFlags +func (c *Connect) DomainRestoreFlags(srcFile, xmlConf string, flags DomainSaveRestoreFlags) error { + cPath := C.CString(srcFile) + defer C.free(unsafe.Pointer(cPath)) + var cXmlConf *C.char + if xmlConf != "" { + cXmlConf = C.CString(xmlConf) + defer C.free(unsafe.Pointer(cXmlConf)) + } + var err C.virError + if result := C.virDomainRestoreFlagsWrapper(c.ptr, cPath, cXmlConf, C.uint(flags), &err); result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamNew +func (c *Connect) NewStream(flags StreamFlags) (*Stream, error) { + var err C.virError + virStream := C.virStreamNewWrapper(c.ptr, C.uint(flags), &err) + if virStream == nil { + return nil, makeError(&err) + } + + return &Stream{ + ptr: virStream, + }, nil +} + +type DomainStatsState struct { + StateSet bool + State DomainState + ReasonSet bool + Reason int +} + +func getDomainStatsStateFieldInfo(params *DomainStatsState) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "state.state": typedParamsFieldInfo{ + set: ¶ms.StateSet, + i: (*int)(unsafe.Pointer(¶ms.State)), + }, + "state.reason": typedParamsFieldInfo{ + set: ¶ms.ReasonSet, + i: ¶ms.Reason, + }, + } +} + +type DomainStatsCPU struct { + TimeSet bool + Time uint64 + UserSet bool + User uint64 + SystemSet bool + System uint64 +} + +func getDomainStatsCPUFieldInfo(params *DomainStatsCPU) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "cpu.time": typedParamsFieldInfo{ + set: ¶ms.TimeSet, + ul: ¶ms.Time, + }, + "cpu.user": typedParamsFieldInfo{ + set: ¶ms.UserSet, + ul: ¶ms.User, + }, + "cpu.system": typedParamsFieldInfo{ + set: ¶ms.SystemSet, + ul: ¶ms.System, + }, + } +} + +type DomainStatsBalloon struct { + CurrentSet bool + Current uint64 + MaximumSet bool + Maximum uint64 +} + +func getDomainStatsBalloonFieldInfo(params *DomainStatsBalloon) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "balloon.current": typedParamsFieldInfo{ + set: ¶ms.CurrentSet, + ul: ¶ms.Current, + }, + "balloon.maximum": typedParamsFieldInfo{ + set: ¶ms.MaximumSet, + ul: ¶ms.Maximum, + }, + } +} + +type DomainStatsVcpu struct { + StateSet bool + State VcpuState + TimeSet bool + Time uint64 +} + +func getDomainStatsVcpuFieldInfo(idx int, params *DomainStatsVcpu) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("vcpu.%d.state", idx): typedParamsFieldInfo{ + set: ¶ms.StateSet, + i: (*int)(unsafe.Pointer(¶ms.State)), + }, + fmt.Sprintf("vcpu.%d.time", idx): typedParamsFieldInfo{ + set: ¶ms.TimeSet, + ul: ¶ms.Time, + }, + } +} + +type DomainStatsNet struct { + NameSet bool + Name string + RxBytesSet bool + RxBytes uint64 + RxPktsSet bool + RxPkts uint64 + RxErrsSet bool + RxErrs uint64 + RxDropSet bool + RxDrop uint64 + TxBytesSet bool + TxBytes uint64 + TxPktsSet bool + TxPkts uint64 + TxErrsSet bool + TxErrs uint64 + TxDropSet bool + TxDrop uint64 +} + +func getDomainStatsNetFieldInfo(idx int, params *DomainStatsNet) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("net.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("net.%d.rx.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.RxBytesSet, + ul: ¶ms.RxBytes, + }, + fmt.Sprintf("net.%d.rx.pkts", idx): typedParamsFieldInfo{ + set: ¶ms.RxPktsSet, + ul: ¶ms.RxPkts, + }, + fmt.Sprintf("net.%d.rx.errs", idx): typedParamsFieldInfo{ + set: ¶ms.RxErrsSet, + ul: ¶ms.RxErrs, + }, + fmt.Sprintf("net.%d.rx.drop", idx): typedParamsFieldInfo{ + set: ¶ms.RxDropSet, + ul: ¶ms.RxDrop, + }, + fmt.Sprintf("net.%d.tx.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.TxBytesSet, + ul: ¶ms.TxBytes, + }, + fmt.Sprintf("net.%d.tx.pkts", idx): typedParamsFieldInfo{ + set: ¶ms.TxPktsSet, + ul: ¶ms.TxPkts, + }, + fmt.Sprintf("net.%d.tx.errs", idx): typedParamsFieldInfo{ + set: ¶ms.TxErrsSet, + ul: ¶ms.TxErrs, + }, + fmt.Sprintf("net.%d.tx.drop", idx): typedParamsFieldInfo{ + set: ¶ms.TxDropSet, + ul: ¶ms.TxDrop, + }, + } +} + +type DomainStatsBlock struct { + NameSet bool + Name string + BackingIndexSet bool + BackingIndex uint + PathSet bool + Path string + RdReqsSet bool + RdReqs uint64 + RdBytesSet bool + RdBytes uint64 + RdTimesSet bool + RdTimes uint64 + WrReqsSet bool + WrReqs uint64 + WrBytesSet bool + WrBytes uint64 + WrTimesSet bool + WrTimes uint64 + FlReqsSet bool + FlReqs uint64 + FlTimesSet bool + FlTimes uint64 + ErrorsSet bool + Errors uint64 + AllocationSet bool + Allocation uint64 + CapacitySet bool + Capacity uint64 + PhysicalSet bool + Physical uint64 +} + +func getDomainStatsBlockFieldInfo(idx int, params *DomainStatsBlock) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("block.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("block.%d.backingIndex", idx): typedParamsFieldInfo{ + set: ¶ms.BackingIndexSet, + ui: ¶ms.BackingIndex, + }, + fmt.Sprintf("block.%d.path", idx): typedParamsFieldInfo{ + set: ¶ms.PathSet, + s: ¶ms.Path, + }, + fmt.Sprintf("block.%d.rd.reqs", idx): typedParamsFieldInfo{ + set: ¶ms.RdReqsSet, + ul: ¶ms.RdReqs, + }, + fmt.Sprintf("block.%d.rd.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.RdBytesSet, + ul: ¶ms.RdBytes, + }, + fmt.Sprintf("block.%d.rd.times", idx): typedParamsFieldInfo{ + set: ¶ms.RdTimesSet, + ul: ¶ms.RdTimes, + }, + fmt.Sprintf("block.%d.wr.reqs", idx): typedParamsFieldInfo{ + set: ¶ms.WrReqsSet, + ul: ¶ms.WrReqs, + }, + fmt.Sprintf("block.%d.wr.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.WrBytesSet, + ul: ¶ms.WrBytes, + }, + fmt.Sprintf("block.%d.wr.times", idx): typedParamsFieldInfo{ + set: ¶ms.WrTimesSet, + ul: ¶ms.WrTimes, + }, + fmt.Sprintf("block.%d.fl.reqs", idx): typedParamsFieldInfo{ + set: ¶ms.FlReqsSet, + ul: ¶ms.FlReqs, + }, + fmt.Sprintf("block.%d.fl.times", idx): typedParamsFieldInfo{ + set: ¶ms.FlTimesSet, + ul: ¶ms.FlTimes, + }, + fmt.Sprintf("block.%d.errors", idx): typedParamsFieldInfo{ + set: ¶ms.ErrorsSet, + ul: ¶ms.Errors, + }, + fmt.Sprintf("block.%d.allocation", idx): typedParamsFieldInfo{ + set: ¶ms.AllocationSet, + ul: ¶ms.Allocation, + }, + fmt.Sprintf("block.%d.capacity", idx): typedParamsFieldInfo{ + set: ¶ms.CapacitySet, + ul: ¶ms.Capacity, + }, + fmt.Sprintf("block.%d.physical", idx): typedParamsFieldInfo{ + set: ¶ms.PhysicalSet, + ul: ¶ms.Physical, + }, + } +} + +type DomainStatsPerf struct { + CmtSet bool + Cmt uint64 + MbmtSet bool + Mbmt uint64 + MbmlSet bool + Mbml uint64 + CacheMissesSet bool + CacheMisses uint64 + CacheReferencesSet bool + CacheReferences uint64 + InstructionsSet bool + Instructions uint64 + CpuCyclesSet bool + CpuCycles uint64 + BranchInstructionsSet bool + BranchInstructions uint64 + BranchMissesSet bool + BranchMisses uint64 + BusCyclesSet bool + BusCycles uint64 + StalledCyclesFrontendSet bool + StalledCyclesFrontend uint64 + StalledCyclesBackendSet bool + StalledCyclesBackend uint64 + RefCpuCyclesSet bool + RefCpuCycles uint64 + CpuClockSet bool + CpuClock uint64 + TaskClockSet bool + TaskClock uint64 + PageFaultsSet bool + PageFaults uint64 + ContextSwitchesSet bool + ContextSwitches uint64 + CpuMigrationsSet bool + CpuMigrations uint64 + PageFaultsMinSet bool + PageFaultsMin uint64 + PageFaultsMajSet bool + PageFaultsMaj uint64 + AlignmentFaultsSet bool + AlignmentFaults uint64 + EmulationFaultsSet bool + EmulationFaults uint64 +} + +func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "perf.cmt": typedParamsFieldInfo{ + set: ¶ms.CmtSet, + ul: ¶ms.Cmt, + }, + "perf.mbmt": typedParamsFieldInfo{ + set: ¶ms.MbmtSet, + ul: ¶ms.Mbmt, + }, + "perf.mbml": typedParamsFieldInfo{ + set: ¶ms.MbmlSet, + ul: ¶ms.Mbml, + }, + "perf.cache_misses": typedParamsFieldInfo{ + set: ¶ms.CacheMissesSet, + ul: ¶ms.CacheMisses, + }, + "perf.cache_references": typedParamsFieldInfo{ + set: ¶ms.CacheReferencesSet, + ul: ¶ms.CacheReferences, + }, + "perf.instructions": typedParamsFieldInfo{ + set: ¶ms.InstructionsSet, + ul: ¶ms.Instructions, + }, + "perf.cpu_cycles": typedParamsFieldInfo{ + set: ¶ms.CpuCyclesSet, + ul: ¶ms.CpuCycles, + }, + "perf.branch_instructions": typedParamsFieldInfo{ + set: ¶ms.BranchInstructionsSet, + ul: ¶ms.BranchInstructions, + }, + "perf.branch_misses": typedParamsFieldInfo{ + set: ¶ms.BranchMissesSet, + ul: ¶ms.BranchMisses, + }, + "perf.bus_cycles": typedParamsFieldInfo{ + set: ¶ms.BusCyclesSet, + ul: ¶ms.BusCycles, + }, + "perf.stalled_cycles_frontend": typedParamsFieldInfo{ + set: ¶ms.StalledCyclesFrontendSet, + ul: ¶ms.StalledCyclesFrontend, + }, + "perf.stalled_cycles_backend": typedParamsFieldInfo{ + set: ¶ms.StalledCyclesBackendSet, + ul: ¶ms.StalledCyclesBackend, + }, + "perf.ref_cpu_cycles": typedParamsFieldInfo{ + set: ¶ms.RefCpuCyclesSet, + ul: ¶ms.RefCpuCycles, + }, + "perf.cpu_clock": typedParamsFieldInfo{ + set: ¶ms.CpuClockSet, + ul: ¶ms.CpuClock, + }, + "perf.task_clock": typedParamsFieldInfo{ + set: ¶ms.TaskClockSet, + ul: ¶ms.TaskClock, + }, + "perf.page_faults": typedParamsFieldInfo{ + set: ¶ms.PageFaultsSet, + ul: ¶ms.PageFaults, + }, + "perf.context_switches": typedParamsFieldInfo{ + set: ¶ms.ContextSwitchesSet, + ul: ¶ms.ContextSwitches, + }, + "perf.cpu_migrations": typedParamsFieldInfo{ + set: ¶ms.CpuMigrationsSet, + ul: ¶ms.CpuMigrations, + }, + "perf.page_faults_min": typedParamsFieldInfo{ + set: ¶ms.PageFaultsMinSet, + ul: ¶ms.PageFaultsMin, + }, + "perf.page_faults_maj": typedParamsFieldInfo{ + set: ¶ms.PageFaultsMajSet, + ul: ¶ms.PageFaultsMaj, + }, + "perf.alignment_faults": typedParamsFieldInfo{ + set: ¶ms.AlignmentFaultsSet, + ul: ¶ms.AlignmentFaults, + }, + "perf.emulation_faults": typedParamsFieldInfo{ + set: ¶ms.EmulationFaultsSet, + ul: ¶ms.EmulationFaults, + }, + } +} + +type DomainStats struct { + Domain *Domain + State *DomainStatsState + Cpu *DomainStatsCPU + Balloon *DomainStatsBalloon + Vcpu []DomainStatsVcpu + Net []DomainStatsNet + Block []DomainStatsBlock + Perf *DomainStatsPerf +} + +type domainStatsLengths struct { + VcpuCurrentSet bool + VcpuCurrent uint + VcpuMaximumSet bool + VcpuMaximum uint + NetCountSet bool + NetCount uint + BlockCountSet bool + BlockCount uint +} + +func getDomainStatsLengthsFieldInfo(params *domainStatsLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "vcpu.current": typedParamsFieldInfo{ + set: ¶ms.VcpuCurrentSet, + ui: ¶ms.VcpuCurrent, + }, + "vcpu.maximum": typedParamsFieldInfo{ + set: ¶ms.VcpuMaximumSet, + ui: ¶ms.VcpuMaximum, + }, + "net.count": typedParamsFieldInfo{ + set: ¶ms.NetCountSet, + ui: ¶ms.NetCount, + }, + "block.count": typedParamsFieldInfo{ + set: ¶ms.BlockCountSet, + ui: ¶ms.BlockCount, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetAllDomainStats +func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, flags ConnectGetAllDomainStatsFlags) ([]DomainStats, error) { + if C.LIBVIR_VERSION_NUMBER < 1002008 { + return []DomainStats{}, makeNotImplementedError("virConnectGetAllDomainStats") + } + var ret C.int + var cstats *C.virDomainStatsRecordPtr + var err C.virError + if len(doms) > 0 { + cdoms := make([]C.virDomainPtr, len(doms)+1) + for i := 0; i < len(doms); i++ { + cdoms[i] = doms[i].ptr + } + + ret = C.virDomainListGetStatsWrapper(&cdoms[0], C.uint(statsTypes), &cstats, C.uint(flags), &err) + } else { + ret = C.virConnectGetAllDomainStatsWrapper(c.ptr, C.uint(statsTypes), &cstats, C.uint(flags), &err) + } + if ret == -1 { + return []DomainStats{}, makeError(&err) + } + + defer C.virDomainStatsRecordListFreeWrapper(cstats) + + stats := make([]DomainStats, ret) + for i := 0; i < int(ret); i++ { + cdomstats := *(*C.virDomainStatsRecordPtr)(unsafe.Pointer(uintptr(unsafe.Pointer(cstats)) + (unsafe.Sizeof(*cstats) * uintptr(i)))) + + domstats := DomainStats{ + Domain: &Domain{ptr: cdomstats.dom}, + } + + state := &DomainStatsState{} + stateInfo := getDomainStatsStateFieldInfo(state) + + count, gerr := typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), stateInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.State = state + } + + cpu := &DomainStatsCPU{} + cpuInfo := getDomainStatsCPUFieldInfo(cpu) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), cpuInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Cpu = cpu + } + + balloon := &DomainStatsBalloon{} + balloonInfo := getDomainStatsBalloonFieldInfo(balloon) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), balloonInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Balloon = balloon + } + + perf := &DomainStatsPerf{} + perfInfo := getDomainStatsPerfFieldInfo(perf) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), perfInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Perf = perf + } + + lengths := domainStatsLengths{} + lengthsInfo := getDomainStatsLengthsFieldInfo(&lengths) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), lengthsInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + + if !lengths.VcpuMaximumSet && lengths.VcpuCurrentSet { + lengths.VcpuMaximum = lengths.VcpuCurrent + } + + if lengths.VcpuMaximum > 0 { + + domstats.Vcpu = make([]DomainStatsVcpu, lengths.VcpuMaximum) + for j := 0; j < int(lengths.VcpuMaximum); j++ { + vcpu := DomainStatsVcpu{} + vcpuInfo := getDomainStatsVcpuFieldInfo(j, &vcpu) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), vcpuInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count == 0 { + vcpu.StateSet = true + vcpu.State = VCPU_OFFLINE + } + domstats.Vcpu[j] = vcpu + } + } + + if lengths.BlockCountSet && lengths.BlockCount > 0 { + domstats.Block = make([]DomainStatsBlock, lengths.BlockCount) + for j := 0; j < int(lengths.BlockCount); j++ { + block := DomainStatsBlock{} + blockInfo := getDomainStatsBlockFieldInfo(j, &block) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), blockInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Block[j] = block + } + } + } + + if lengths.NetCountSet && lengths.NetCount > 0 { + domstats.Net = make([]DomainStatsNet, lengths.NetCount) + for j := 0; j < int(lengths.NetCount); j++ { + net := DomainStatsNet{} + netInfo := getDomainStatsNetFieldInfo(j, &net) + + count, gerr = typedParamsUnpackLen(cdomstats.params, int(cdomstats.nparams), netInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Net[j] = net + } + } + } + + stats[i] = domstats + } + + for i := 0; i < len(stats); i++ { + C.virDomainRef(stats[i].Domain.ptr) + } + + return stats, nil +} + +type NodeSEVParameters struct { + PDHSet bool + PDH string + CertChainSet bool + CertChain string + CBitPosSet bool + CBitPos uint + ReducedPhysBitsSet bool + ReducedPhysBits uint +} + +func getNodeSEVFieldInfo(params *NodeSEVParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_NODE_SEV_PDH: typedParamsFieldInfo{ + set: ¶ms.PDHSet, + s: ¶ms.PDH, + }, + C.VIR_NODE_SEV_CERT_CHAIN: typedParamsFieldInfo{ + set: ¶ms.CertChainSet, + s: ¶ms.CertChain, + }, + C.VIR_NODE_SEV_CBITPOS: typedParamsFieldInfo{ + set: ¶ms.CBitPosSet, + ui: ¶ms.CBitPos, + }, + C.VIR_NODE_SEV_REDUCED_PHYS_BITS: typedParamsFieldInfo{ + set: ¶ms.ReducedPhysBitsSet, + ui: ¶ms.ReducedPhysBits, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSEVInfo +func (c *Connect) GetSEVInfo(flags uint32) (*NodeSEVParameters, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return nil, makeNotImplementedError("virNodeGetSEVInfo") + } + + params := &NodeSEVParameters{} + info := getNodeSEVFieldInfo(params) + + var cparams *C.virTypedParameter + var nparams C.int + + var err C.virError + ret := C.virNodeGetSEVInfoWrapper(c.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFree(cparams, nparams) + + _, gerr := typedParamsUnpackLen(cparams, int(nparams), info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virNWFilterBindingCreateXML +func (c *Connect) NWFilterBindingCreateXML(xmlConfig string, flags uint32) (*NWFilterBinding, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return nil, makeNotImplementedError("virNWFilterBindingCreateXML") + } + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNWFilterBindingCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilterBinding{ptr: ptr}, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/connect_compat.h b/vendor/github.com/libvirt/libvirt-go/connect_compat.h new file mode 100644 index 00000000000..924b07dddd7 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/connect_compat.h @@ -0,0 +1,200 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_CONNECT_COMPAT_H__ +#define LIBVIRT_GO_CONNECT_COMPAT_H__ + +/* 1.2.1 */ + +#ifndef VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER +#define VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER 1 << 16 +#endif + + +/* 1.2.2 */ + +#ifndef VIR_NODE_CPU_STATS_INTR +#define VIR_NODE_CPU_STATS_INTR "intr" +#endif + + +/* 1.2.6 */ + +#ifndef VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE +#define VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE 1 << 0 +#endif + + +/* 1.2.8 */ + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE 1 << 0 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE 1 << 1 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT 1 << 2 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT 1 << 3 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING 1 << 4 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED 1 << 5 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF 1 << 6 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER 1 << 7 +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS 1U << 31 +#endif + +#ifndef VIR_CONNECT_LIST_STORAGE_POOLS_ZFS +#define VIR_CONNECT_LIST_STORAGE_POOLS_ZFS 1 << 17 +#endif + +#if LIBVIR_VERSION_NUMBER < 1002008 +typedef struct _virDomainStatsRecord virDomainStatsRecord; +typedef virDomainStatsRecord *virDomainStatsRecordPtr; +struct _virDomainStatsRecord { + virDomainPtr dom; + virTypedParameterPtr params; + int nparams; +}; +#endif + + +/* 1.2.9 */ +#ifndef VIR_NODE_ALLOC_PAGES_ADD +#define VIR_NODE_ALLOC_PAGES_ADD 0 +#endif + +#ifndef VIR_NODE_ALLOC_PAGES_SET +#define VIR_NODE_ALLOC_PAGES_SET 1 << 0 +#endif + + +/* 1.2.11 */ + +#ifndef VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED +#define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED 1 +#endif + +#ifndef VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED +#define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED 2 +#endif + +#ifndef VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN +#define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN 0 +#endif + +#ifndef VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED +#define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED 1 +#endif + +#ifndef VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL +#define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL 2 +#endif + + +/* 1.2.12 */ + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING 1 << 30 +#endif + +/* 1.2.14 */ + +#ifndef VIR_CONNECT_BASELINE_CPU_MIGRATABLE +#define VIR_CONNECT_BASELINE_CPU_MIGRATABLE 1 << 1 +#endif + +/* 3.1.0 */ + +#ifndef VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE +#define VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE 1 << 18 +#endif + +#ifndef VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM +#define VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM 1 << 12 +#endif + +/* 3.4.0 */ + +#ifndef VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES +#define VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES 1 << 13 +#endif + +#ifndef VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV +#define VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV 1 << 14 +#endif + +#ifndef VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV +#define VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV 1 << 15 +#endif + + +/* 4.5.0 */ + +#ifndef VIR_NODE_SEV_CBITPOS +#define VIR_NODE_SEV_CBITPOS "cbitpos" +#endif + +#ifndef VIR_NODE_SEV_REDUCED_PHYS_BITS +#define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits" +#endif + +#ifndef VIR_NODE_SEV_PDH +#define VIR_NODE_SEV_PDH "pdh" +#endif + +#ifndef VIR_NODE_SEV_CERT_CHAIN +#define VIR_NODE_SEV_CERT_CHAIN "cert-chain" +#endif + +#if LIBVIR_VERSION_NUMBER < 4005000 +typedef struct _virNWFilterBinding *virNWFilterBindingPtr; +#endif + +#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT +#define VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT 1 << 29 +#endif + +#endif /* LIBVIRT_GO_CONNECT_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/connect_wrapper.go b/vendor/github.com/libvirt/libvirt-go/connect_wrapper.go new file mode 100644 index 00000000000..89727d04a2d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/connect_wrapper.go @@ -0,0 +1,1766 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include "connect_wrapper.h" +#include "callbacks_wrapper.h" + +extern void closeCallback(virConnectPtr, int, long); +void closeCallbackHelper(virConnectPtr conn, int reason, void *opaque) +{ + closeCallback(conn, reason, (long)opaque); +} + +extern int connectAuthCallback(virConnectCredentialPtr, unsigned int, int); +int connectAuthCallbackHelper(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata) +{ + int *callbackID = cbdata; + + return connectAuthCallback(cred, ncred, *callbackID); +} + + +char * +virConnectBaselineCPUWrapper(virConnectPtr conn, + const char **xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virConnectBaselineCPU(conn, xmlCPUs, ncpus, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectBaselineHypervisorCPUWrapper(virConnectPtr conn, + const char *emulator, + const char *arch, + const char *machine, + const char *virttype, + const char **xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4004000 + assert(0); // Caller should have checked version +#else + char * ret = virConnectBaselineHypervisorCPU(conn, emulator, arch, machine, virttype, xmlCPUs, ncpus, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virConnectCloseWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectClose(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectCompareCPUWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectCompareCPU(conn, xmlDesc, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectCompareHypervisorCPUWrapper(virConnectPtr conn, + const char *emulator, + const char *arch, + const char *machine, + const char *virttype, + const char *xmlCPU, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4004000 + assert(0); // Caller should have checked version +#else + int ret = virConnectCompareHypervisorCPU(conn, emulator, arch, machine, virttype, xmlCPU, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +char * +virConnectDomainXMLFromNativeWrapper(virConnectPtr conn, + const char *nativeFormat, + const char *nativeConfig, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virConnectDomainXMLFromNative(conn, nativeFormat, nativeConfig, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectDomainXMLToNativeWrapper(virConnectPtr conn, + const char *nativeFormat, + const char *domainXml, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virConnectDomainXMLToNative(conn, nativeFormat, domainXml, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectFindStoragePoolSourcesWrapper(virConnectPtr conn, + const char *type, + const char *srcSpec, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virConnectFindStoragePoolSources(conn, type, srcSpec, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectGetAllDomainStatsWrapper(virConnectPtr conn, + unsigned int stats, + virDomainStatsRecordPtr **retStats, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002008 + assert(0); // Caller should have checked version +#else + int ret = virConnectGetAllDomainStats(conn, stats, retStats, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virConnectGetCPUModelNamesWrapper(virConnectPtr conn, + const char *arch, + char ** *models, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectGetCPUModelNames(conn, arch, models, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectGetCapabilitiesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = virConnectGetCapabilities(conn); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectGetDomainCapabilitiesWrapper(virConnectPtr conn, + const char *emulatorbin, + const char *arch, + const char *machine, + const char *virttype, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002007 + assert(0); // Caller should have checked version +#else + char * ret = virConnectGetDomainCapabilities(conn, emulatorbin, arch, machine, virttype, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +char * +virConnectGetHostnameWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = virConnectGetHostname(conn); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectGetLibVersionWrapper(virConnectPtr conn, + unsigned long *libVer, + virErrorPtr err) +{ + int ret = virConnectGetLibVersion(conn, libVer); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectGetMaxVcpusWrapper(virConnectPtr conn, + const char *type, + virErrorPtr err) +{ + int ret = virConnectGetMaxVcpus(conn, type); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectGetSysinfoWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virConnectGetSysinfo(conn, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virConnectGetTypeWrapper(virConnectPtr conn, + virErrorPtr err) +{ + const char * ret = virConnectGetType(conn); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virConnectGetURIWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = virConnectGetURI(conn); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectGetVersionWrapper(virConnectPtr conn, + unsigned long *hvVer, + virErrorPtr err) +{ + int ret = virConnectGetVersion(conn, hvVer); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectIsAliveWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectIsAlive(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectIsEncryptedWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectIsEncrypted(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectIsSecureWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectIsSecure(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllDomainsWrapper(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllDomains(conn, domains, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllInterfacesWrapper(virConnectPtr conn, + virInterfacePtr **ifaces, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllInterfaces(conn, ifaces, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllNWFilterBindingsWrapper(virConnectPtr conn, + virNWFilterBindingPtr **bindings, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + int ret = virConnectListAllNWFilterBindings(conn, bindings, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virConnectListAllNWFiltersWrapper(virConnectPtr conn, + virNWFilterPtr **filters, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllNWFilters(conn, filters, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllNetworksWrapper(virConnectPtr conn, + virNetworkPtr **nets, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllNetworks(conn, nets, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllNodeDevicesWrapper(virConnectPtr conn, + virNodeDevicePtr **devices, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllNodeDevices(conn, devices, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllSecretsWrapper(virConnectPtr conn, + virSecretPtr **secrets, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllSecrets(conn, secrets, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListAllStoragePoolsWrapper(virConnectPtr conn, + virStoragePoolPtr **pools, + unsigned int flags, + virErrorPtr err) +{ + int ret = virConnectListAllStoragePools(conn, pools, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListDefinedDomainsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListDefinedDomains(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListDefinedInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListDefinedInterfaces(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListDefinedNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListDefinedNetworks(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListDefinedStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListDefinedStoragePools(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListDomainsWrapper(virConnectPtr conn, + int *ids, + int maxids, + virErrorPtr err) +{ + int ret = virConnectListDomains(conn, ids, maxids); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListInterfaces(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListNWFiltersWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListNWFilters(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListNetworks(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListSecretsWrapper(virConnectPtr conn, + char **uuids, + int maxuuids, + virErrorPtr err) +{ + int ret = virConnectListSecrets(conn, uuids, maxuuids); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectListStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virConnectListStoragePools(conn, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfDefinedDomainsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfDefinedDomains(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfDefinedInterfacesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfDefinedInterfaces(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfDefinedNetworksWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfDefinedNetworks(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfDefinedStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfDefinedStoragePools(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfDomainsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfDomains(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfInterfacesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfInterfaces(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfNWFiltersWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfNWFilters(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfNetworksWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfNetworks(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfSecretsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfSecrets(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectNumOfStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectNumOfStoragePools(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virConnectOpenWrapper(const char *name, + virErrorPtr err) +{ + virConnectPtr ret = virConnectOpen(name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virConnectOpenAuthWrapper(const char *name, + int *credtype, + unsigned int ncredtype, + int callbackID, + unsigned int flags, + virErrorPtr err) +{ + virConnectAuth auth = { + .credtype = credtype, + .ncredtype = ncredtype, + .cb = connectAuthCallbackHelper, + .cbdata = &callbackID, + }; + + virConnectPtr ret = virConnectOpenAuth(name, &auth, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virConnectOpenReadOnlyWrapper(const char *name, + virErrorPtr err) +{ + virConnectPtr ret = virConnectOpenReadOnly(name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectRefWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectRef(conn); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectRegisterCloseCallbackWrapper(virConnectPtr conn, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void*)goCallbackId; + int ret = virConnectRegisterCloseCallback(conn, closeCallbackHelper, id, freeGoCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectSetKeepAliveWrapper(virConnectPtr conn, + int interval, + unsigned int count, + virErrorPtr err) +{ + int ret = virConnectSetKeepAlive(conn, interval, count); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectUnregisterCloseCallbackWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = virConnectUnregisterCloseCallback(conn, closeCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainCreateLinuxWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = virDomainCreateLinux(conn, xmlDesc, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = virDomainCreateXML(conn, xmlDesc, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainCreateXMLWithFilesWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int nfiles, + int *files, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = virDomainCreateXMLWithFiles(conn, xmlDesc, nfiles, files, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainDefineXMLWrapper(virConnectPtr conn, + const char *xml, + virErrorPtr err) +{ + virDomainPtr ret = virDomainDefineXML(conn, xml); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainDefineXMLFlagsWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002012 + assert(0); // Caller should have checked version +#else + virDomainPtr ret = virDomainDefineXMLFlags(conn, xml, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainListGetStatsWrapper(virDomainPtr *doms, + unsigned int stats, + virDomainStatsRecordPtr **retStats, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002008 + assert(0); // Caller should have checked version +#else + int ret = virDomainListGetStats(doms, stats, retStats, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +virDomainPtr +virDomainLookupByIDWrapper(virConnectPtr conn, + int id, + virErrorPtr err) +{ + virDomainPtr ret = virDomainLookupByID(conn, id); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err) +{ + virDomainPtr ret = virDomainLookupByName(conn, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err) +{ + virDomainPtr ret = virDomainLookupByUUID(conn, uuid); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err) +{ + virDomainPtr ret = virDomainLookupByUUIDString(conn, uuidstr); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainRestoreWrapper(virConnectPtr conn, + const char *from, + virErrorPtr err) +{ + int ret = virDomainRestore(conn, from); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainRestoreFlagsWrapper(virConnectPtr conn, + const char *from, + const char *dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainRestoreFlags(conn, from, dxml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSaveImageDefineXMLWrapper(virConnectPtr conn, + const char *file, + const char *dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSaveImageDefineXML(conn, file, dxml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainSaveImageGetXMLDescWrapper(virConnectPtr conn, + const char *file, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainSaveImageGetXMLDesc(conn, file, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +void +virDomainStatsRecordListFreeWrapper(virDomainStatsRecordPtr *stats) +{ +#if LIBVIR_VERSION_NUMBER < 1002008 + assert(0); // Caller should have checked version +#else + virDomainStatsRecordListFree(stats); +#endif +} + + +int +virGetVersionWrapper(unsigned long *libVer, + const char *type, + unsigned long *typeVer, + virErrorPtr err) +{ + int ret = virGetVersion(libVer, type, typeVer); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceChangeBeginWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = virInterfaceChangeBegin(conn, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceChangeCommitWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = virInterfaceChangeCommit(conn, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceChangeRollbackWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = virInterfaceChangeRollback(conn, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virInterfacePtr +virInterfaceDefineXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + virInterfacePtr ret = virInterfaceDefineXML(conn, xml, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virInterfacePtr +virInterfaceLookupByMACStringWrapper(virConnectPtr conn, + const char *macstr, + virErrorPtr err) +{ + virInterfacePtr ret = virInterfaceLookupByMACString(conn, macstr); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virInterfacePtr +virInterfaceLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err) +{ + virInterfacePtr ret = virInterfaceLookupByName(conn, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNWFilterBindingPtr +virNWFilterBindingCreateXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + virNWFilterBindingPtr ret = virNWFilterBindingCreateXML(conn, xml, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +virNWFilterBindingPtr +virNWFilterBindingLookupByPortDevWrapper(virConnectPtr conn, + const char *portdev, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + virNWFilterBindingPtr ret = virNWFilterBindingLookupByPortDev(conn, portdev); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +virNWFilterPtr +virNWFilterDefineXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + virErrorPtr err) +{ + virNWFilterPtr ret = virNWFilterDefineXML(conn, xmlDesc); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNWFilterPtr +virNWFilterLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err) +{ + virNWFilterPtr ret = virNWFilterLookupByName(conn, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNWFilterPtr +virNWFilterLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err) +{ + virNWFilterPtr ret = virNWFilterLookupByUUID(conn, uuid); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNWFilterPtr +virNWFilterLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err) +{ + virNWFilterPtr ret = virNWFilterLookupByUUIDString(conn, uuidstr); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNetworkPtr +virNetworkCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + virErrorPtr err) +{ + virNetworkPtr ret = virNetworkCreateXML(conn, xmlDesc); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNetworkPtr +virNetworkDefineXMLWrapper(virConnectPtr conn, + const char *xml, + virErrorPtr err) +{ + virNetworkPtr ret = virNetworkDefineXML(conn, xml); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNetworkPtr +virNetworkLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err) +{ + virNetworkPtr ret = virNetworkLookupByName(conn, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNetworkPtr +virNetworkLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err) +{ + virNetworkPtr ret = virNetworkLookupByUUID(conn, uuid); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNetworkPtr +virNetworkLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err) +{ + virNetworkPtr ret = virNetworkLookupByUUIDString(conn, uuidstr); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeAllocPagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int *pageSizes, + unsigned long long *pageCounts, + int startCell, + unsigned int cellCount, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002009 + assert(0); // Caller should have checked version +#else + int ret = virNodeAllocPages(conn, npages, pageSizes, pageCounts, startCell, cellCount, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +virNodeDevicePtr +virNodeDeviceCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = virNodeDeviceCreateXML(conn, xmlDesc, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNodeDevicePtr +virNodeDeviceLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err) +{ + virNodeDevicePtr ret = virNodeDeviceLookupByName(conn, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virNodeDevicePtr +virNodeDeviceLookupSCSIHostByWWNWrapper(virConnectPtr conn, + const char *wwnn, + const char *wwpn, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = virNodeDeviceLookupSCSIHostByWWN(conn, wwnn, wwpn, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetCPUMapWrapper(virConnectPtr conn, + unsigned char **cpumap, + unsigned int *online, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeGetCPUMap(conn, cpumap, online, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetCPUStatsWrapper(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeGetCPUStats(conn, cpuNum, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetCellsFreeMemoryWrapper(virConnectPtr conn, + unsigned long long *freeMems, + int startCell, + int maxCells, + virErrorPtr err) +{ + int ret = virNodeGetCellsFreeMemory(conn, freeMems, startCell, maxCells); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +unsigned long long +virNodeGetFreeMemoryWrapper(virConnectPtr conn, + virErrorPtr err) +{ + unsigned long long ret = virNodeGetFreeMemory(conn); + if (ret == 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetFreePagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int *pages, + int startCell, + unsigned int cellCount, + unsigned long long *counts, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002006 + assert(0); // Caller should have checked version +#else + int ret = virNodeGetFreePages(conn, npages, pages, startCell, cellCount, counts, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeGetInfoWrapper(virConnectPtr conn, + virNodeInfoPtr info, + virErrorPtr err) +{ + int ret = virNodeGetInfo(conn, info); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeGetMemoryParameters(conn, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetMemoryStatsWrapper(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeGetMemoryStats(conn, cellNum, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeGetSEVInfoWrapper(virConnectPtr conn, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + int ret = virNodeGetSEVInfo(conn, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeGetSecurityModelWrapper(virConnectPtr conn, + virSecurityModelPtr secmodel, + virErrorPtr err) +{ + int ret = virNodeGetSecurityModel(conn, secmodel); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeListDevicesWrapper(virConnectPtr conn, + const char *cap, + char ** const names, + int maxnames, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeListDevices(conn, cap, names, maxnames, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeNumOfDevicesWrapper(virConnectPtr conn, + const char *cap, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeNumOfDevices(conn, cap, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeSetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeSetMemoryParameters(conn, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeSuspendForDurationWrapper(virConnectPtr conn, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeSuspendForDuration(conn, target, duration, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virSecretPtr +virSecretDefineXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + virSecretPtr ret = virSecretDefineXML(conn, xml, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virSecretPtr +virSecretLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err) +{ + virSecretPtr ret = virSecretLookupByUUID(conn, uuid); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virSecretPtr +virSecretLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err) +{ + virSecretPtr ret = virSecretLookupByUUIDString(conn, uuidstr); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virSecretPtr +virSecretLookupByUsageWrapper(virConnectPtr conn, + int usageType, + const char *usageID, + virErrorPtr err) +{ + virSecretPtr ret = virSecretLookupByUsage(conn, usageType, usageID); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStoragePoolPtr +virStoragePoolCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virStoragePoolPtr ret = virStoragePoolCreateXML(conn, xmlDesc, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStoragePoolPtr +virStoragePoolDefineXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + virStoragePoolPtr ret = virStoragePoolDefineXML(conn, xml, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStoragePoolPtr +virStoragePoolLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err) +{ + virStoragePoolPtr ret = virStoragePoolLookupByName(conn, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStoragePoolPtr +virStoragePoolLookupByTargetPathWrapper(virConnectPtr conn, + const char *path, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4001000 + assert(0); // Caller should have checked version +#else + virStoragePoolPtr ret = virStoragePoolLookupByTargetPath(conn, path); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +virStoragePoolPtr +virStoragePoolLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err) +{ + virStoragePoolPtr ret = virStoragePoolLookupByUUID(conn, uuid); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStoragePoolPtr +virStoragePoolLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err) +{ + virStoragePoolPtr ret = virStoragePoolLookupByUUIDString(conn, uuidstr); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStorageVolPtr +virStorageVolLookupByKeyWrapper(virConnectPtr conn, + const char *key, + virErrorPtr err) +{ + virStorageVolPtr ret = virStorageVolLookupByKey(conn, key); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStorageVolPtr +virStorageVolLookupByPathWrapper(virConnectPtr conn, + const char *path, + virErrorPtr err) +{ + virStorageVolPtr ret = virStorageVolLookupByPath(conn, path); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStreamPtr +virStreamNewWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + virStreamPtr ret = virStreamNew(conn, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +//////////////////////////////////////////////// +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/connect_wrapper.h b/vendor/github.com/libvirt/libvirt-go/connect_wrapper.h new file mode 100644 index 00000000000..5c282d21132 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/connect_wrapper.h @@ -0,0 +1,730 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_CONNECT_WRAPPER_H__ +#define LIBVIRT_GO_CONNECT_WRAPPER_H__ + +#include +#include +#include "connect_compat.h" + +void +closeCallbackHelper(virConnectPtr conn, + int reason, + void *opaque); + +int +virConnectRegisterCloseCallbackHelper(virConnectPtr c, + virConnectCloseFunc cb, + long goCallbackId); + +char * +virConnectBaselineCPUWrapper(virConnectPtr conn, + const char **xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err); + +char * +virConnectBaselineHypervisorCPUWrapper(virConnectPtr conn, + const char *emulator, + const char *arch, + const char *machine, + const char *virttype, + const char **xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err); + +int +virConnectCloseWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectCompareCPUWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virConnectCompareHypervisorCPUWrapper(virConnectPtr conn, + const char *emulator, + const char *arch, + const char *machine, + const char *virttype, + const char *xmlCPU, + unsigned int flags, + virErrorPtr err); + +char * +virConnectDomainXMLFromNativeWrapper(virConnectPtr conn, + const char *nativeFormat, + const char *nativeConfig, + unsigned int flags, + virErrorPtr err); + +char * +virConnectDomainXMLToNativeWrapper(virConnectPtr conn, + const char *nativeFormat, + const char *domainXml, + unsigned int flags, + virErrorPtr err); + +char * +virConnectFindStoragePoolSourcesWrapper(virConnectPtr conn, + const char *type, + const char *srcSpec, + unsigned int flags, + virErrorPtr err); + +int +virConnectGetAllDomainStatsWrapper(virConnectPtr conn, + unsigned int stats, + virDomainStatsRecordPtr **retStats, + unsigned int flags, + virErrorPtr err); + +int +virConnectGetCPUModelNamesWrapper(virConnectPtr conn, + const char *arch, + char ***models, + unsigned int flags, + virErrorPtr err); + +char * +virConnectGetCapabilitiesWrapper(virConnectPtr conn, + virErrorPtr err); + +char * +virConnectGetDomainCapabilitiesWrapper(virConnectPtr conn, + const char *emulatorbin, + const char *arch, + const char *machine, + const char *virttype, + unsigned int flags, + virErrorPtr err); + +char * +virConnectGetHostnameWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectGetLibVersionWrapper(virConnectPtr conn, + unsigned long *libVer, + virErrorPtr err); + +int +virConnectGetMaxVcpusWrapper(virConnectPtr conn, + const char *type, + virErrorPtr err); + +char * +virConnectGetSysinfoWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +const char * +virConnectGetTypeWrapper(virConnectPtr conn, + virErrorPtr err); + +char * +virConnectGetURIWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectGetVersionWrapper(virConnectPtr conn, + unsigned long *hvVer, + virErrorPtr err); + +int +virConnectIsAliveWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectIsEncryptedWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectIsSecureWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectListAllDomainsWrapper(virConnectPtr conn, + virDomainPtr **domains, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllInterfacesWrapper(virConnectPtr conn, + virInterfacePtr **ifaces, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNWFilterBindingsWrapper(virConnectPtr conn, + virNWFilterBindingPtr **bindings, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNWFiltersWrapper(virConnectPtr conn, + virNWFilterPtr **filters, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNetworksWrapper(virConnectPtr conn, + virNetworkPtr **nets, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNodeDevicesWrapper(virConnectPtr conn, + virNodeDevicePtr **devices, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllSecretsWrapper(virConnectPtr conn, + virSecretPtr **secrets, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllStoragePoolsWrapper(virConnectPtr conn, + virStoragePoolPtr **pools, + unsigned int flags, + virErrorPtr err); + +int +virConnectListDefinedDomainsWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDefinedInterfacesWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDefinedNetworksWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDefinedStoragePoolsWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDomainsWrapper(virConnectPtr conn, + int *ids, + int maxids, + virErrorPtr err); + +int +virConnectListInterfacesWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListNWFiltersWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListNetworksWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectListSecretsWrapper(virConnectPtr conn, + char **uuids, + int maxuuids, + virErrorPtr err); + +int +virConnectListStoragePoolsWrapper(virConnectPtr conn, + char **const names, + int maxnames, + virErrorPtr err); + +int +virConnectNumOfDefinedDomainsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDefinedInterfacesWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDefinedNetworksWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDefinedStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDomainsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfInterfacesWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfNWFiltersWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfNetworksWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfSecretsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err); + +virConnectPtr +virConnectOpenWrapper(const char *name, + virErrorPtr err); + +virConnectPtr +virConnectOpenAuthWrapper(const char *name, + int *credtype, + unsigned int ncredtype, + int callbackID, + unsigned int flags, + virErrorPtr err); + +virConnectPtr +virConnectOpenReadOnlyWrapper(const char *name, + virErrorPtr err); + +int +virConnectRefWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectRegisterCloseCallbackWrapper(virConnectPtr conn, + long goCallbackId, + virErrorPtr err); + +int +virConnectSetKeepAliveWrapper(virConnectPtr conn, + int interval, + unsigned int count, + virErrorPtr err); + +int +virConnectUnregisterCloseCallbackWrapper(virConnectPtr conn, + virErrorPtr err); + +virDomainPtr +virDomainCreateLinuxWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainCreateXMLWithFilesWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int nfiles, + int *files, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainDefineXMLWrapper(virConnectPtr conn, + const char *xml, + virErrorPtr err); + +virDomainPtr +virDomainDefineXMLFlagsWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err); + +int +virDomainListGetStatsWrapper(virDomainPtr *doms, + unsigned int stats, + virDomainStatsRecordPtr **retStats, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainLookupByIDWrapper(virConnectPtr conn, + int id, + virErrorPtr err); + +virDomainPtr +virDomainLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err); + +virDomainPtr +virDomainLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err); + +virDomainPtr +virDomainLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err); + +int +virDomainRestoreWrapper(virConnectPtr conn, + const char *from, + virErrorPtr err); + +int +virDomainRestoreFlagsWrapper(virConnectPtr conn, + const char *from, + const char *dxml, + unsigned int flags, + virErrorPtr err); + +int +virDomainSaveImageDefineXMLWrapper(virConnectPtr conn, + const char *file, + const char *dxml, + unsigned int flags, + virErrorPtr err); + +char * +virDomainSaveImageGetXMLDescWrapper(virConnectPtr conn, + const char *file, + unsigned int flags, + virErrorPtr err); + +void +virDomainStatsRecordListFreeWrapper(virDomainStatsRecordPtr *stats); + +int +virGetVersionWrapper(unsigned long *libVer, + const char *type, + unsigned long *typeVer, + virErrorPtr err); + +int +virInterfaceChangeBeginWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceChangeCommitWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceChangeRollbackWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +virInterfacePtr +virInterfaceDefineXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err); + +virInterfacePtr +virInterfaceLookupByMACStringWrapper(virConnectPtr conn, + const char *macstr, + virErrorPtr err); + +virInterfacePtr +virInterfaceLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err); + +virNWFilterBindingPtr +virNWFilterBindingCreateXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err); + +virNWFilterBindingPtr +virNWFilterBindingLookupByPortDevWrapper(virConnectPtr conn, + const char *portdev, + virErrorPtr err); + +virNWFilterPtr +virNWFilterDefineXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + virErrorPtr err); + +virNWFilterPtr +virNWFilterLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err); + +virNWFilterPtr +virNWFilterLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err); + +virNWFilterPtr +virNWFilterLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err); + +virNetworkPtr +virNetworkCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + virErrorPtr err); + +virNetworkPtr +virNetworkDefineXMLWrapper(virConnectPtr conn, + const char *xml, + virErrorPtr err); + +virNetworkPtr +virNetworkLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err); + +virNetworkPtr +virNetworkLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err); + +virNetworkPtr +virNetworkLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err); + +int +virNodeAllocPagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int *pageSizes, + unsigned long long *pageCounts, + int startCell, + unsigned int cellCount, + unsigned int flags, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceLookupSCSIHostByWWNWrapper(virConnectPtr conn, + const char *wwnn, + const char *wwpn, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetCPUMapWrapper(virConnectPtr conn, + unsigned char **cpumap, + unsigned int *online, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetCPUStatsWrapper(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetCellsFreeMemoryWrapper(virConnectPtr conn, + unsigned long long *freeMems, + int startCell, + int maxCells, + virErrorPtr err); + +unsigned long long +virNodeGetFreeMemoryWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virNodeGetFreePagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int *pages, + int startCell, + unsigned int cellCount, + unsigned long long *counts, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetInfoWrapper(virConnectPtr conn, + virNodeInfoPtr info, + virErrorPtr err); + +int +virNodeGetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetMemoryStatsWrapper(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetSEVInfoWrapper(virConnectPtr conn, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetSecurityModelWrapper(virConnectPtr conn, + virSecurityModelPtr secmodel, + virErrorPtr err); + +int +virNodeListDevicesWrapper(virConnectPtr conn, + const char *cap, + char **const names, + int maxnames, + unsigned int flags, + virErrorPtr err); + +int +virNodeNumOfDevicesWrapper(virConnectPtr conn, + const char *cap, + unsigned int flags, + virErrorPtr err); + +int +virNodeSetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeSuspendForDurationWrapper(virConnectPtr conn, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err); + +virSecretPtr +virSecretDefineXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err); + +virSecretPtr +virSecretLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err); + +virSecretPtr +virSecretLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err); + +virSecretPtr +virSecretLookupByUsageWrapper(virConnectPtr conn, + int usageType, + const char *usageID, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolCreateXMLWrapper(virConnectPtr conn, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolDefineXMLWrapper(virConnectPtr conn, + const char *xml, + unsigned int flags, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByNameWrapper(virConnectPtr conn, + const char *name, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByTargetPathWrapper(virConnectPtr conn, + const char *path, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char *uuid, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByUUIDStringWrapper(virConnectPtr conn, + const char *uuidstr, + virErrorPtr err); + +virStorageVolPtr +virStorageVolLookupByKeyWrapper(virConnectPtr conn, + const char *key, + virErrorPtr err); + +virStorageVolPtr +virStorageVolLookupByPathWrapper(virConnectPtr conn, + const char *path, + virErrorPtr err); + +virStreamPtr +virStreamNewWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_CONNECT_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/doc.go b/vendor/github.com/libvirt/libvirt-go/doc.go new file mode 100644 index 00000000000..55d75b0cac3 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/doc.go @@ -0,0 +1,141 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +// Package libvirt provides a Go binding to the libvirt C library +// +// Through conditional compilation it supports libvirt versions 1.2.0 onwards. +// This is done automatically, with no requirement to use magic Go build tags. +// If an API was not available in the particular version of libvirt this package +// was built against, an error will be returned with a code of ERR_NO_SUPPORT. +// This is the same code seen if using a new libvirt library to talk to an old +// libvirtd lacking the API, or if a hypervisor does not support a given feature, +// so an application can easily handle all scenarios together. +// +// The Go binding is a fairly direct mapping of the underling C API which seeks +// to maximise the use of the Go type system to allow strong compiler type +// checking. The following rules describe how APIs/constants are mapped from C +// to Go +// +// For structs, the 'vir' prefix and 'Ptr' suffix are removed from the name. +// e.g. virConnectPtr in C becomes 'Connect' in Go. +// +// For structs which are reference counted at the C level, it is neccessary to +// explicitly release the reference at the Go level. e.g. if a Go method returns +// a '* Domain' struct, it is neccessary to call 'Free' on this when no longer +// required. The use of 'defer' is recommended for this purpose +// +// dom, err := conn.LookupDomainByName("myguest") +// if err != nil { +// ... +// } +// defer dom.Free() +// +// If multiple goroutines are using the same libvirt object struct, it may +// not be possible to determine which goroutine should call 'Free'. In such +// scenarios each new goroutine should call 'Ref' to obtain a private reference +// on the underlying C struct. All goroutines can call 'Free' unconditionally +// with the final one causing the release of the C object. +// +// For methods, the 'vir' prefix and object name prefix are remove from the name. +// The C functions become methods with an object receiver. e.g. +// 'virDomainScreenshot' in C becomes 'Screenshot' with a 'Domain *' receiver. +// +// For methods which accept a 'unsigned int flags' parameter in the C level, +// the corresponding Go parameter will be a named type corresponding to the +// C enum that defines the valid flags. For example, the ListAllDomains +// method takes a 'flags ConnectListAllDomainsFlags' parameter. If there are +// not currently any flags defined for a method in the C API, then the Go +// method parameter will be declared as a "flags uint32". Callers should always +// pass the literal integer value 0 for such parameters, without forcing any +// specific type. This will allow compatibility with future updates to the +// libvirt-go binding which may replace the 'uint32' type with a enum type +// at a later date. +// +// For enums, the VIR_ prefix is removed from the name. The enums get a dedicated +// type defined in Go. e.g. the VIR_NODE_SUSPEND_TARGET_MEM enum constant in C, +// becomes NODE_SUSPEND_TARGET_MEM with a type of NodeSuspendTarget. +// +// Methods accepting or returning virTypedParameter arrays in C will map the +// parameters into a Go struct. The struct will contain two fields for each +// possible parameter. One boolean field with a suffix of 'Set' indicates whether +// the parameter has a value set, and the other custom typed field provides the +// parameter value. This makes it possible to distinguish a parameter with a +// default value of '0' from a parameter which is 0 because it isn't supported by +// the hypervisor. If the C API defines additional typed parameters, then the +// corresponding Go struct will be extended to have further fields. +// e.g. the GetMemoryStats method in Go (which is backed by +// virNodeGetMemoryStats in C) will return a NodeMemoryStats struct containing +// the typed parameter values. +// +// stats, err := conn.GetMemoryParameters() +// if err != nil { +// .... +// } +// if stats.TotalSet { +// fmt.Printf("Total memory: %d KB", stats.Total) +// } +// +// Every method that can fail will include an 'error' object as the last return +// value. This will be an instance of the Error struct if an error occurred. To +// check for specific libvirt error codes, it is neccessary to cast the error. +// +// err := storage_vol.Wipe(0) +// if err != nil { +// lverr, ok := err.(libvirt.Error) +// if ok && lverr.Code == libvirt.ERR_NO_SUPPORT { +// fmt.Println("Wiping storage volumes is not supported"); +// } else { +// fmt.Println("Error wiping storage volume: %s", err) +// } +// } +// +// Example usage +// +// To connect to libvirt +// +// import ( +// libvirt "github.com/libvirt/libvirt-go" +// ) +// conn, err := libvirt.NewConnect("qemu:///system") +// if err != nil { +// ... +// } +// defer conn.Close() +// +// doms, err := conn.ListAllDomains(libvirt.CONNECT_LIST_DOMAINS_ACTIVE) +// if err != nil { +// ... +// } +// +// fmt.Printf("%d running domains:\n", len(doms)) +// for _, dom := range doms { +// name, err := dom.GetName() +// if err == nil { +// fmt.Printf(" %s\n", name) +// } +// dom.Free() +// } +// +package libvirt diff --git a/vendor/github.com/libvirt/libvirt-go/domain.go b/vendor/github.com/libvirt/libvirt-go/domain.go new file mode 100644 index 00000000000..3a3ef5b74ed --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain.go @@ -0,0 +1,4766 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "domain_wrapper.h" +#include "connect_wrapper.h" +*/ +import "C" + +import ( + "fmt" + "os" + "reflect" + "strconv" + "strings" + "unsafe" +) + +const ( + DOMAIN_SEND_KEY_MAX_KEYS = uint32(C.VIR_DOMAIN_SEND_KEY_MAX_KEYS) +) + +type DomainState int + +const ( + DOMAIN_NOSTATE = DomainState(C.VIR_DOMAIN_NOSTATE) + DOMAIN_RUNNING = DomainState(C.VIR_DOMAIN_RUNNING) + DOMAIN_BLOCKED = DomainState(C.VIR_DOMAIN_BLOCKED) + DOMAIN_PAUSED = DomainState(C.VIR_DOMAIN_PAUSED) + DOMAIN_SHUTDOWN = DomainState(C.VIR_DOMAIN_SHUTDOWN) + DOMAIN_CRASHED = DomainState(C.VIR_DOMAIN_CRASHED) + DOMAIN_PMSUSPENDED = DomainState(C.VIR_DOMAIN_PMSUSPENDED) + DOMAIN_SHUTOFF = DomainState(C.VIR_DOMAIN_SHUTOFF) +) + +type DomainMetadataType int + +const ( + DOMAIN_METADATA_DESCRIPTION = DomainMetadataType(C.VIR_DOMAIN_METADATA_DESCRIPTION) + DOMAIN_METADATA_TITLE = DomainMetadataType(C.VIR_DOMAIN_METADATA_TITLE) + DOMAIN_METADATA_ELEMENT = DomainMetadataType(C.VIR_DOMAIN_METADATA_ELEMENT) +) + +type DomainVcpuFlags int + +const ( + DOMAIN_VCPU_CONFIG = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_CONFIG) + DOMAIN_VCPU_CURRENT = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_CURRENT) + DOMAIN_VCPU_LIVE = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_LIVE) + DOMAIN_VCPU_MAXIMUM = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_MAXIMUM) + DOMAIN_VCPU_GUEST = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_GUEST) + DOMAIN_VCPU_HOTPLUGGABLE = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_HOTPLUGGABLE) +) + +type DomainModificationImpact int + +const ( + DOMAIN_AFFECT_CONFIG = DomainModificationImpact(C.VIR_DOMAIN_AFFECT_CONFIG) + DOMAIN_AFFECT_CURRENT = DomainModificationImpact(C.VIR_DOMAIN_AFFECT_CURRENT) + DOMAIN_AFFECT_LIVE = DomainModificationImpact(C.VIR_DOMAIN_AFFECT_LIVE) +) + +type DomainMemoryModFlags int + +const ( + DOMAIN_MEM_CONFIG = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_CONFIG) + DOMAIN_MEM_CURRENT = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_CURRENT) + DOMAIN_MEM_LIVE = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_LIVE) + DOMAIN_MEM_MAXIMUM = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_MAXIMUM) +) + +type DomainDestroyFlags int + +const ( + DOMAIN_DESTROY_DEFAULT = DomainDestroyFlags(C.VIR_DOMAIN_DESTROY_DEFAULT) + DOMAIN_DESTROY_GRACEFUL = DomainDestroyFlags(C.VIR_DOMAIN_DESTROY_GRACEFUL) +) + +type DomainShutdownFlags int + +const ( + DOMAIN_SHUTDOWN_DEFAULT = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_DEFAULT) + DOMAIN_SHUTDOWN_ACPI_POWER_BTN = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) + DOMAIN_SHUTDOWN_GUEST_AGENT = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_GUEST_AGENT) + DOMAIN_SHUTDOWN_INITCTL = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_INITCTL) + DOMAIN_SHUTDOWN_SIGNAL = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_SIGNAL) + DOMAIN_SHUTDOWN_PARAVIRT = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_PARAVIRT) +) + +type DomainUndefineFlagsValues int + +const ( + DOMAIN_UNDEFINE_MANAGED_SAVE = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE) // Also remove any managed save + DOMAIN_UNDEFINE_SNAPSHOTS_METADATA = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA) // If last use of domain, then also remove any snapshot metadata + DOMAIN_UNDEFINE_NVRAM = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_NVRAM) // Also remove any nvram file + DOMAIN_UNDEFINE_KEEP_NVRAM = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_KEEP_NVRAM) // Keep nvram file +) + +type DomainDeviceModifyFlags int + +const ( + DOMAIN_DEVICE_MODIFY_CONFIG = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_CONFIG) + DOMAIN_DEVICE_MODIFY_CURRENT = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_CURRENT) + DOMAIN_DEVICE_MODIFY_LIVE = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_LIVE) + DOMAIN_DEVICE_MODIFY_FORCE = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_FORCE) +) + +type DomainCreateFlags int + +const ( + DOMAIN_NONE = DomainCreateFlags(C.VIR_DOMAIN_NONE) + DOMAIN_START_PAUSED = DomainCreateFlags(C.VIR_DOMAIN_START_PAUSED) + DOMAIN_START_AUTODESTROY = DomainCreateFlags(C.VIR_DOMAIN_START_AUTODESTROY) + DOMAIN_START_BYPASS_CACHE = DomainCreateFlags(C.VIR_DOMAIN_START_BYPASS_CACHE) + DOMAIN_START_FORCE_BOOT = DomainCreateFlags(C.VIR_DOMAIN_START_FORCE_BOOT) + DOMAIN_START_VALIDATE = DomainCreateFlags(C.VIR_DOMAIN_START_VALIDATE) +) + +const DOMAIN_MEMORY_PARAM_UNLIMITED = C.VIR_DOMAIN_MEMORY_PARAM_UNLIMITED + +type DomainEventType int + +const ( + DOMAIN_EVENT_DEFINED = DomainEventType(C.VIR_DOMAIN_EVENT_DEFINED) + DOMAIN_EVENT_UNDEFINED = DomainEventType(C.VIR_DOMAIN_EVENT_UNDEFINED) + DOMAIN_EVENT_STARTED = DomainEventType(C.VIR_DOMAIN_EVENT_STARTED) + DOMAIN_EVENT_SUSPENDED = DomainEventType(C.VIR_DOMAIN_EVENT_SUSPENDED) + DOMAIN_EVENT_RESUMED = DomainEventType(C.VIR_DOMAIN_EVENT_RESUMED) + DOMAIN_EVENT_STOPPED = DomainEventType(C.VIR_DOMAIN_EVENT_STOPPED) + DOMAIN_EVENT_SHUTDOWN = DomainEventType(C.VIR_DOMAIN_EVENT_SHUTDOWN) + DOMAIN_EVENT_PMSUSPENDED = DomainEventType(C.VIR_DOMAIN_EVENT_PMSUSPENDED) + DOMAIN_EVENT_CRASHED = DomainEventType(C.VIR_DOMAIN_EVENT_CRASHED) +) + +type DomainEventWatchdogAction int + +// The action that is to be taken due to the watchdog device firing +const ( + // No action, watchdog ignored + DOMAIN_EVENT_WATCHDOG_NONE = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_NONE) + + // Guest CPUs are paused + DOMAIN_EVENT_WATCHDOG_PAUSE = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_PAUSE) + + // Guest CPUs are reset + DOMAIN_EVENT_WATCHDOG_RESET = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_RESET) + + // Guest is forcibly powered off + DOMAIN_EVENT_WATCHDOG_POWEROFF = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF) + + // Guest is requested to gracefully shutdown + DOMAIN_EVENT_WATCHDOG_SHUTDOWN = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN) + + // No action, a debug message logged + DOMAIN_EVENT_WATCHDOG_DEBUG = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_DEBUG) + + // Inject a non-maskable interrupt into guest + DOMAIN_EVENT_WATCHDOG_INJECTNMI = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI) +) + +type DomainEventIOErrorAction int + +// The action that is to be taken due to an IO error occurring +const ( + // No action, IO error ignored + DOMAIN_EVENT_IO_ERROR_NONE = DomainEventIOErrorAction(C.VIR_DOMAIN_EVENT_IO_ERROR_NONE) + + // Guest CPUs are paused + DOMAIN_EVENT_IO_ERROR_PAUSE = DomainEventIOErrorAction(C.VIR_DOMAIN_EVENT_IO_ERROR_PAUSE) + + // IO error reported to guest OS + DOMAIN_EVENT_IO_ERROR_REPORT = DomainEventIOErrorAction(C.VIR_DOMAIN_EVENT_IO_ERROR_REPORT) +) + +type DomainEventGraphicsPhase int + +// The phase of the graphics client connection +const ( + // Initial socket connection established + DOMAIN_EVENT_GRAPHICS_CONNECT = DomainEventGraphicsPhase(C.VIR_DOMAIN_EVENT_GRAPHICS_CONNECT) + + // Authentication & setup completed + DOMAIN_EVENT_GRAPHICS_INITIALIZE = DomainEventGraphicsPhase(C.VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE) + + // Final socket disconnection + DOMAIN_EVENT_GRAPHICS_DISCONNECT = DomainEventGraphicsPhase(C.VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT) +) + +type DomainEventGraphicsAddressType int + +const ( + // IPv4 address + DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4 = DomainEventGraphicsAddressType(C.VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4) + + // IPv6 address + DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6 = DomainEventGraphicsAddressType(C.VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6) + + // UNIX socket path + DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX = DomainEventGraphicsAddressType(C.VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX) +) + +type DomainBlockJobType int + +const ( + // Placeholder + DOMAIN_BLOCK_JOB_TYPE_UNKNOWN = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN) + + // Block Pull (virDomainBlockPull, or virDomainBlockRebase without + // flags), job ends on completion + DOMAIN_BLOCK_JOB_TYPE_PULL = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_PULL) + + // Block Copy (virDomainBlockCopy, or virDomainBlockRebase with + // flags), job exists as long as mirroring is active + DOMAIN_BLOCK_JOB_TYPE_COPY = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) + + // Block Commit (virDomainBlockCommit without flags), job ends on + // completion + DOMAIN_BLOCK_JOB_TYPE_COMMIT = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT) + + // Active Block Commit (virDomainBlockCommit with flags), job + // exists as long as sync is active + DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) +) + +type DomainRunningReason int + +const ( + DOMAIN_RUNNING_UNKNOWN = DomainRunningReason(C.VIR_DOMAIN_RUNNING_UNKNOWN) + DOMAIN_RUNNING_BOOTED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_BOOTED) /* normal startup from boot */ + DOMAIN_RUNNING_MIGRATED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_MIGRATED) /* migrated from another host */ + DOMAIN_RUNNING_RESTORED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_RESTORED) /* restored from a state file */ + DOMAIN_RUNNING_FROM_SNAPSHOT = DomainRunningReason(C.VIR_DOMAIN_RUNNING_FROM_SNAPSHOT) /* restored from snapshot */ + DOMAIN_RUNNING_UNPAUSED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_UNPAUSED) /* returned from paused state */ + DOMAIN_RUNNING_MIGRATION_CANCELED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_MIGRATION_CANCELED) /* returned from migration */ + DOMAIN_RUNNING_SAVE_CANCELED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_SAVE_CANCELED) /* returned from failed save process */ + DOMAIN_RUNNING_WAKEUP = DomainRunningReason(C.VIR_DOMAIN_RUNNING_WAKEUP) /* returned from pmsuspended due to wakeup event */ + DOMAIN_RUNNING_CRASHED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_CRASHED) /* resumed from crashed */ + DOMAIN_RUNNING_POSTCOPY = DomainRunningReason(C.VIR_DOMAIN_RUNNING_POSTCOPY) /* running in post-copy migration mode */ +) + +type DomainPausedReason int + +const ( + DOMAIN_PAUSED_UNKNOWN = DomainPausedReason(C.VIR_DOMAIN_PAUSED_UNKNOWN) /* the reason is unknown */ + DOMAIN_PAUSED_USER = DomainPausedReason(C.VIR_DOMAIN_PAUSED_USER) /* paused on user request */ + DOMAIN_PAUSED_MIGRATION = DomainPausedReason(C.VIR_DOMAIN_PAUSED_MIGRATION) /* paused for offline migration */ + DOMAIN_PAUSED_SAVE = DomainPausedReason(C.VIR_DOMAIN_PAUSED_SAVE) /* paused for save */ + DOMAIN_PAUSED_DUMP = DomainPausedReason(C.VIR_DOMAIN_PAUSED_DUMP) /* paused for offline core dump */ + DOMAIN_PAUSED_IOERROR = DomainPausedReason(C.VIR_DOMAIN_PAUSED_IOERROR) /* paused due to a disk I/O error */ + DOMAIN_PAUSED_WATCHDOG = DomainPausedReason(C.VIR_DOMAIN_PAUSED_WATCHDOG) /* paused due to a watchdog event */ + DOMAIN_PAUSED_FROM_SNAPSHOT = DomainPausedReason(C.VIR_DOMAIN_PAUSED_FROM_SNAPSHOT) /* paused after restoring from snapshot */ + DOMAIN_PAUSED_SHUTTING_DOWN = DomainPausedReason(C.VIR_DOMAIN_PAUSED_SHUTTING_DOWN) /* paused during shutdown process */ + DOMAIN_PAUSED_SNAPSHOT = DomainPausedReason(C.VIR_DOMAIN_PAUSED_SNAPSHOT) /* paused while creating a snapshot */ + DOMAIN_PAUSED_CRASHED = DomainPausedReason(C.VIR_DOMAIN_PAUSED_CRASHED) /* paused due to a guest crash */ + DOMAIN_PAUSED_STARTING_UP = DomainPausedReason(C.VIR_DOMAIN_PAUSED_STARTING_UP) /* the domainis being started */ + DOMAIN_PAUSED_POSTCOPY = DomainPausedReason(C.VIR_DOMAIN_PAUSED_POSTCOPY) /* paused for post-copy migration */ + DOMAIN_PAUSED_POSTCOPY_FAILED = DomainPausedReason(C.VIR_DOMAIN_PAUSED_POSTCOPY_FAILED) /* paused after failed post-copy */ +) + +type DomainXMLFlags int + +const ( + DOMAIN_XML_SECURE = DomainXMLFlags(C.VIR_DOMAIN_XML_SECURE) /* dump security sensitive information too */ + DOMAIN_XML_INACTIVE = DomainXMLFlags(C.VIR_DOMAIN_XML_INACTIVE) /* dump inactive domain information */ + DOMAIN_XML_UPDATE_CPU = DomainXMLFlags(C.VIR_DOMAIN_XML_UPDATE_CPU) /* update guest CPU requirements according to host CPU */ + DOMAIN_XML_MIGRATABLE = DomainXMLFlags(C.VIR_DOMAIN_XML_MIGRATABLE) /* dump XML suitable for migration */ +) + +type DomainEventDefinedDetailType int + +const ( + DOMAIN_EVENT_DEFINED_ADDED = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_ADDED) + DOMAIN_EVENT_DEFINED_UPDATED = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_UPDATED) + DOMAIN_EVENT_DEFINED_RENAMED = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_RENAMED) + DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT) +) + +type DomainEventUndefinedDetailType int + +const ( + DOMAIN_EVENT_UNDEFINED_REMOVED = DomainEventUndefinedDetailType(C.VIR_DOMAIN_EVENT_UNDEFINED_REMOVED) + DOMAIN_EVENT_UNDEFINED_RENAMED = DomainEventUndefinedDetailType(C.VIR_DOMAIN_EVENT_UNDEFINED_RENAMED) +) + +type DomainEventStartedDetailType int + +const ( + DOMAIN_EVENT_STARTED_BOOTED = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_BOOTED) + DOMAIN_EVENT_STARTED_MIGRATED = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_MIGRATED) + DOMAIN_EVENT_STARTED_RESTORED = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_RESTORED) + DOMAIN_EVENT_STARTED_FROM_SNAPSHOT = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT) + DOMAIN_EVENT_STARTED_WAKEUP = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_WAKEUP) +) + +type DomainEventSuspendedDetailType int + +const ( + DOMAIN_EVENT_SUSPENDED_PAUSED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_PAUSED) + DOMAIN_EVENT_SUSPENDED_MIGRATED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED) + DOMAIN_EVENT_SUSPENDED_IOERROR = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_IOERROR) + DOMAIN_EVENT_SUSPENDED_WATCHDOG = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG) + DOMAIN_EVENT_SUSPENDED_RESTORED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_RESTORED) + DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT) + DOMAIN_EVENT_SUSPENDED_API_ERROR = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR) + DOMAIN_EVENT_SUSPENDED_POSTCOPY = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY) + DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED) +) + +type DomainEventResumedDetailType int + +const ( + DOMAIN_EVENT_RESUMED_UNPAUSED = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_UNPAUSED) + DOMAIN_EVENT_RESUMED_MIGRATED = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_MIGRATED) + DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT) + DOMAIN_EVENT_RESUMED_POSTCOPY = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_POSTCOPY) +) + +type DomainEventStoppedDetailType int + +const ( + DOMAIN_EVENT_STOPPED_SHUTDOWN = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN) + DOMAIN_EVENT_STOPPED_DESTROYED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_DESTROYED) + DOMAIN_EVENT_STOPPED_CRASHED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_CRASHED) + DOMAIN_EVENT_STOPPED_MIGRATED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_MIGRATED) + DOMAIN_EVENT_STOPPED_SAVED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_SAVED) + DOMAIN_EVENT_STOPPED_FAILED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_FAILED) + DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT) +) + +type DomainEventShutdownDetailType int + +const ( + DOMAIN_EVENT_SHUTDOWN_FINISHED = DomainEventShutdownDetailType(C.VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED) + DOMAIN_EVENT_SHUTDOWN_GUEST = DomainEventShutdownDetailType(C.VIR_DOMAIN_EVENT_SHUTDOWN_GUEST) + DOMAIN_EVENT_SHUTDOWN_HOST = DomainEventShutdownDetailType(C.VIR_DOMAIN_EVENT_SHUTDOWN_HOST) +) + +type DomainMemoryStatTags int + +const ( + DOMAIN_MEMORY_STAT_LAST = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_NR) + DOMAIN_MEMORY_STAT_SWAP_IN = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_SWAP_IN) + DOMAIN_MEMORY_STAT_SWAP_OUT = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_SWAP_OUT) + DOMAIN_MEMORY_STAT_MAJOR_FAULT = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT) + DOMAIN_MEMORY_STAT_MINOR_FAULT = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT) + DOMAIN_MEMORY_STAT_UNUSED = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_UNUSED) + DOMAIN_MEMORY_STAT_AVAILABLE = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_AVAILABLE) + DOMAIN_MEMORY_STAT_ACTUAL_BALLOON = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON) + DOMAIN_MEMORY_STAT_RSS = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_RSS) + DOMAIN_MEMORY_STAT_USABLE = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_USABLE) + DOMAIN_MEMORY_STAT_LAST_UPDATE = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE) + DOMAIN_MEMORY_STAT_DISK_CACHES = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_DISK_CACHES) + DOMAIN_MEMORY_STAT_NR = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_NR) +) + +type DomainCPUStatsTags string + +const ( + DOMAIN_CPU_STATS_CPUTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_CPUTIME) + DOMAIN_CPU_STATS_SYSTEMTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_SYSTEMTIME) + DOMAIN_CPU_STATS_USERTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_USERTIME) + DOMAIN_CPU_STATS_VCPUTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_VCPUTIME) +) + +type DomainInterfaceAddressesSource int + +const ( + DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE = DomainInterfaceAddressesSource(C.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE) + DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT = DomainInterfaceAddressesSource(C.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT) + DOMAIN_INTERFACE_ADDRESSES_SRC_ARP = DomainInterfaceAddressesSource(C.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP) +) + +type KeycodeSet int + +const ( + KEYCODE_SET_LINUX = KeycodeSet(C.VIR_KEYCODE_SET_LINUX) + KEYCODE_SET_XT = KeycodeSet(C.VIR_KEYCODE_SET_XT) + KEYCODE_SET_ATSET1 = KeycodeSet(C.VIR_KEYCODE_SET_ATSET1) + KEYCODE_SET_ATSET2 = KeycodeSet(C.VIR_KEYCODE_SET_ATSET2) + KEYCODE_SET_ATSET3 = KeycodeSet(C.VIR_KEYCODE_SET_ATSET3) + KEYCODE_SET_OSX = KeycodeSet(C.VIR_KEYCODE_SET_OSX) + KEYCODE_SET_XT_KBD = KeycodeSet(C.VIR_KEYCODE_SET_XT_KBD) + KEYCODE_SET_USB = KeycodeSet(C.VIR_KEYCODE_SET_USB) + KEYCODE_SET_WIN32 = KeycodeSet(C.VIR_KEYCODE_SET_WIN32) + KEYCODE_SET_RFB = KeycodeSet(C.VIR_KEYCODE_SET_RFB) + KEYCODE_SET_QNUM = KeycodeSet(C.VIR_KEYCODE_SET_QNUM) +) + +type ConnectDomainEventBlockJobStatus int + +const ( + DOMAIN_BLOCK_JOB_COMPLETED = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_COMPLETED) + DOMAIN_BLOCK_JOB_FAILED = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_FAILED) + DOMAIN_BLOCK_JOB_CANCELED = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_CANCELED) + DOMAIN_BLOCK_JOB_READY = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_READY) +) + +type ConnectDomainEventDiskChangeReason int + +const ( + // OldSrcPath is set + DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START = ConnectDomainEventDiskChangeReason(C.VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START) + DOMAIN_EVENT_DISK_DROP_MISSING_ON_START = ConnectDomainEventDiskChangeReason(C.VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START) +) + +type ConnectDomainEventTrayChangeReason int + +const ( + DOMAIN_EVENT_TRAY_CHANGE_OPEN = ConnectDomainEventTrayChangeReason(C.VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN) + DOMAIN_EVENT_TRAY_CHANGE_CLOSE = ConnectDomainEventTrayChangeReason(C.VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE) +) + +type DomainProcessSignal int + +const ( + DOMAIN_PROCESS_SIGNAL_NOP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_NOP) + DOMAIN_PROCESS_SIGNAL_HUP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_HUP) + DOMAIN_PROCESS_SIGNAL_INT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_INT) + DOMAIN_PROCESS_SIGNAL_QUIT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_QUIT) + DOMAIN_PROCESS_SIGNAL_ILL = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_ILL) + DOMAIN_PROCESS_SIGNAL_TRAP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TRAP) + DOMAIN_PROCESS_SIGNAL_ABRT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_ABRT) + DOMAIN_PROCESS_SIGNAL_BUS = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_BUS) + DOMAIN_PROCESS_SIGNAL_FPE = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_FPE) + DOMAIN_PROCESS_SIGNAL_KILL = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_KILL) + + DOMAIN_PROCESS_SIGNAL_USR1 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_USR1) + DOMAIN_PROCESS_SIGNAL_SEGV = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_SEGV) + DOMAIN_PROCESS_SIGNAL_USR2 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_USR2) + DOMAIN_PROCESS_SIGNAL_PIPE = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_PIPE) + DOMAIN_PROCESS_SIGNAL_ALRM = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_ALRM) + DOMAIN_PROCESS_SIGNAL_TERM = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TERM) + DOMAIN_PROCESS_SIGNAL_STKFLT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_STKFLT) + DOMAIN_PROCESS_SIGNAL_CHLD = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_CHLD) + DOMAIN_PROCESS_SIGNAL_CONT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_CONT) + DOMAIN_PROCESS_SIGNAL_STOP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_STOP) + + DOMAIN_PROCESS_SIGNAL_TSTP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TSTP) + DOMAIN_PROCESS_SIGNAL_TTIN = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TTIN) + DOMAIN_PROCESS_SIGNAL_TTOU = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TTOU) + DOMAIN_PROCESS_SIGNAL_URG = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_URG) + DOMAIN_PROCESS_SIGNAL_XCPU = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_XCPU) + DOMAIN_PROCESS_SIGNAL_XFSZ = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_XFSZ) + DOMAIN_PROCESS_SIGNAL_VTALRM = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_VTALRM) + DOMAIN_PROCESS_SIGNAL_PROF = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_PROF) + DOMAIN_PROCESS_SIGNAL_WINCH = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_WINCH) + DOMAIN_PROCESS_SIGNAL_POLL = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_POLL) + + DOMAIN_PROCESS_SIGNAL_PWR = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_PWR) + DOMAIN_PROCESS_SIGNAL_SYS = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_SYS) + DOMAIN_PROCESS_SIGNAL_RT0 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT0) + DOMAIN_PROCESS_SIGNAL_RT1 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT1) + DOMAIN_PROCESS_SIGNAL_RT2 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT2) + DOMAIN_PROCESS_SIGNAL_RT3 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT3) + DOMAIN_PROCESS_SIGNAL_RT4 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT4) + DOMAIN_PROCESS_SIGNAL_RT5 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT5) + DOMAIN_PROCESS_SIGNAL_RT6 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT6) + DOMAIN_PROCESS_SIGNAL_RT7 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT7) + + DOMAIN_PROCESS_SIGNAL_RT8 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT8) + DOMAIN_PROCESS_SIGNAL_RT9 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT9) + DOMAIN_PROCESS_SIGNAL_RT10 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT10) + DOMAIN_PROCESS_SIGNAL_RT11 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT11) + DOMAIN_PROCESS_SIGNAL_RT12 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT12) + DOMAIN_PROCESS_SIGNAL_RT13 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT13) + DOMAIN_PROCESS_SIGNAL_RT14 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT14) + DOMAIN_PROCESS_SIGNAL_RT15 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT15) + DOMAIN_PROCESS_SIGNAL_RT16 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT16) + DOMAIN_PROCESS_SIGNAL_RT17 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT17) + DOMAIN_PROCESS_SIGNAL_RT18 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT18) + + DOMAIN_PROCESS_SIGNAL_RT19 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT19) + DOMAIN_PROCESS_SIGNAL_RT20 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT20) + DOMAIN_PROCESS_SIGNAL_RT21 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT21) + DOMAIN_PROCESS_SIGNAL_RT22 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT22) + DOMAIN_PROCESS_SIGNAL_RT23 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT23) + DOMAIN_PROCESS_SIGNAL_RT24 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT24) + DOMAIN_PROCESS_SIGNAL_RT25 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT25) + DOMAIN_PROCESS_SIGNAL_RT26 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT26) + DOMAIN_PROCESS_SIGNAL_RT27 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT27) + + DOMAIN_PROCESS_SIGNAL_RT28 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT28) + DOMAIN_PROCESS_SIGNAL_RT29 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT29) + DOMAIN_PROCESS_SIGNAL_RT30 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT30) + DOMAIN_PROCESS_SIGNAL_RT31 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT31) + DOMAIN_PROCESS_SIGNAL_RT32 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT32) +) + +type DomainBlockedReason int + +const ( + DOMAIN_BLOCKED_UNKNOWN = DomainBlockedReason(C.VIR_DOMAIN_BLOCKED_UNKNOWN) +) + +type DomainControlState int + +const ( + DOMAIN_CONTROL_OK = DomainControlState(C.VIR_DOMAIN_CONTROL_OK) + DOMAIN_CONTROL_JOB = DomainControlState(C.VIR_DOMAIN_CONTROL_JOB) + DOMAIN_CONTROL_OCCUPIED = DomainControlState(C.VIR_DOMAIN_CONTROL_OCCUPIED) + DOMAIN_CONTROL_ERROR = DomainControlState(C.VIR_DOMAIN_CONTROL_ERROR) +) + +type DomainControlErrorReason int + +const ( + DOMAIN_CONTROL_ERROR_REASON_NONE = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_NONE) + DOMAIN_CONTROL_ERROR_REASON_UNKNOWN = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_UNKNOWN) + DOMAIN_CONTROL_ERROR_REASON_MONITOR = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_MONITOR) + DOMAIN_CONTROL_ERROR_REASON_INTERNAL = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_INTERNAL) +) + +type DomainCrashedReason int + +const ( + DOMAIN_CRASHED_UNKNOWN = DomainCrashedReason(C.VIR_DOMAIN_CRASHED_UNKNOWN) + DOMAIN_CRASHED_PANICKED = DomainCrashedReason(C.VIR_DOMAIN_CRASHED_PANICKED) +) + +type DomainEventCrashedDetailType int + +const ( + DOMAIN_EVENT_CRASHED_PANICKED = DomainEventCrashedDetailType(C.VIR_DOMAIN_EVENT_CRASHED_PANICKED) +) + +type DomainEventPMSuspendedDetailType int + +const ( + DOMAIN_EVENT_PMSUSPENDED_MEMORY = DomainEventPMSuspendedDetailType(C.VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY) + DOMAIN_EVENT_PMSUSPENDED_DISK = DomainEventPMSuspendedDetailType(C.VIR_DOMAIN_EVENT_PMSUSPENDED_DISK) +) + +type DomainNostateReason int + +const ( + DOMAIN_NOSTATE_UNKNOWN = DomainNostateReason(C.VIR_DOMAIN_NOSTATE_UNKNOWN) +) + +type DomainPMSuspendedReason int + +const ( + DOMAIN_PMSUSPENDED_UNKNOWN = DomainPMSuspendedReason(C.VIR_DOMAIN_PMSUSPENDED_UNKNOWN) +) + +type DomainPMSuspendedDiskReason int + +const ( + DOMAIN_PMSUSPENDED_DISK_UNKNOWN = DomainPMSuspendedDiskReason(C.VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN) +) + +type DomainShutdownReason int + +const ( + DOMAIN_SHUTDOWN_UNKNOWN = DomainShutdownReason(C.VIR_DOMAIN_SHUTDOWN_UNKNOWN) + DOMAIN_SHUTDOWN_USER = DomainShutdownReason(C.VIR_DOMAIN_SHUTDOWN_USER) +) + +type DomainShutoffReason int + +const ( + DOMAIN_SHUTOFF_UNKNOWN = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_UNKNOWN) + DOMAIN_SHUTOFF_SHUTDOWN = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_SHUTDOWN) + DOMAIN_SHUTOFF_DESTROYED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_DESTROYED) + DOMAIN_SHUTOFF_CRASHED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_CRASHED) + DOMAIN_SHUTOFF_MIGRATED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_MIGRATED) + DOMAIN_SHUTOFF_SAVED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_SAVED) + DOMAIN_SHUTOFF_FAILED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_FAILED) + DOMAIN_SHUTOFF_FROM_SNAPSHOT = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT) +) + +type DomainBlockCommitFlags int + +const ( + DOMAIN_BLOCK_COMMIT_SHALLOW = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) + DOMAIN_BLOCK_COMMIT_DELETE = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_DELETE) + DOMAIN_BLOCK_COMMIT_ACTIVE = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) + DOMAIN_BLOCK_COMMIT_RELATIVE = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_RELATIVE) + DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES) +) + +type DomainBlockCopyFlags int + +const ( + DOMAIN_BLOCK_COPY_SHALLOW = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_SHALLOW) + DOMAIN_BLOCK_COPY_REUSE_EXT = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_REUSE_EXT) + DOMAIN_BLOCK_COPY_TRANSIENT_JOB = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB) +) + +type DomainBlockRebaseFlags int + +const ( + DOMAIN_BLOCK_REBASE_SHALLOW = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_SHALLOW) + DOMAIN_BLOCK_REBASE_REUSE_EXT = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT) + DOMAIN_BLOCK_REBASE_COPY_RAW = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_COPY_RAW) + DOMAIN_BLOCK_REBASE_COPY = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_COPY) + DOMAIN_BLOCK_REBASE_RELATIVE = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_RELATIVE) + DOMAIN_BLOCK_REBASE_COPY_DEV = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV) + DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES) +) + +type DomainBlockJobAbortFlags int + +const ( + DOMAIN_BLOCK_JOB_ABORT_ASYNC = DomainBlockJobAbortFlags(C.VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC) + DOMAIN_BLOCK_JOB_ABORT_PIVOT = DomainBlockJobAbortFlags(C.VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT) +) + +type DomainBlockJobInfoFlags int + +const ( + DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES = DomainBlockJobInfoFlags(C.VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES) +) + +type DomainBlockJobSetSpeedFlags int + +const ( + DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES = DomainBlockJobSetSpeedFlags(C.VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES) +) + +type DomainBlockPullFlags int + +const ( + DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES = DomainBlockPullFlags(C.VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES) +) + +type DomainBlockResizeFlags int + +const ( + DOMAIN_BLOCK_RESIZE_BYTES = DomainBlockResizeFlags(C.VIR_DOMAIN_BLOCK_RESIZE_BYTES) +) + +type Domain struct { + ptr C.virDomainPtr +} + +type DomainChannelFlags int + +const ( + DOMAIN_CHANNEL_FORCE = DomainChannelFlags(C.VIR_DOMAIN_CHANNEL_FORCE) +) + +type DomainConsoleFlags int + +const ( + DOMAIN_CONSOLE_FORCE = DomainConsoleFlags(C.VIR_DOMAIN_CONSOLE_FORCE) + DOMAIN_CONSOLE_SAFE = DomainConsoleFlags(C.VIR_DOMAIN_CONSOLE_SAFE) +) + +type DomainCoreDumpFormat int + +const ( + DOMAIN_CORE_DUMP_FORMAT_RAW = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) + DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB) + DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO) + DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY) +) + +type DomainDefineFlags int + +const ( + DOMAIN_DEFINE_VALIDATE = DomainDefineFlags(C.VIR_DOMAIN_DEFINE_VALIDATE) +) + +type DomainJobType int + +const ( + DOMAIN_JOB_NONE = DomainJobType(C.VIR_DOMAIN_JOB_NONE) + DOMAIN_JOB_BOUNDED = DomainJobType(C.VIR_DOMAIN_JOB_BOUNDED) + DOMAIN_JOB_UNBOUNDED = DomainJobType(C.VIR_DOMAIN_JOB_UNBOUNDED) + DOMAIN_JOB_COMPLETED = DomainJobType(C.VIR_DOMAIN_JOB_COMPLETED) + DOMAIN_JOB_FAILED = DomainJobType(C.VIR_DOMAIN_JOB_FAILED) + DOMAIN_JOB_CANCELLED = DomainJobType(C.VIR_DOMAIN_JOB_CANCELLED) +) + +type DomainGetJobStatsFlags int + +const ( + DOMAIN_JOB_STATS_COMPLETED = DomainGetJobStatsFlags(C.VIR_DOMAIN_JOB_STATS_COMPLETED) +) + +type DomainNumatuneMemMode int + +const ( + DOMAIN_NUMATUNE_MEM_STRICT = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_STRICT) + DOMAIN_NUMATUNE_MEM_PREFERRED = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_PREFERRED) + DOMAIN_NUMATUNE_MEM_INTERLEAVE = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE) +) + +type DomainOpenGraphicsFlags int + +const ( + DOMAIN_OPEN_GRAPHICS_SKIPAUTH = DomainOpenGraphicsFlags(C.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) +) + +type DomainSetUserPasswordFlags int + +const ( + DOMAIN_PASSWORD_ENCRYPTED = DomainSetUserPasswordFlags(C.VIR_DOMAIN_PASSWORD_ENCRYPTED) +) + +type DomainRebootFlagValues int + +const ( + DOMAIN_REBOOT_DEFAULT = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_DEFAULT) + DOMAIN_REBOOT_ACPI_POWER_BTN = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) + DOMAIN_REBOOT_GUEST_AGENT = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_GUEST_AGENT) + DOMAIN_REBOOT_INITCTL = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_INITCTL) + DOMAIN_REBOOT_SIGNAL = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_SIGNAL) + DOMAIN_REBOOT_PARAVIRT = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_PARAVIRT) +) + +type DomainSaveRestoreFlags int + +const ( + DOMAIN_SAVE_BYPASS_CACHE = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_BYPASS_CACHE) + DOMAIN_SAVE_RUNNING = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_RUNNING) + DOMAIN_SAVE_PAUSED = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_PAUSED) +) + +type DomainSetTimeFlags int + +const ( + DOMAIN_TIME_SYNC = DomainSetTimeFlags(C.VIR_DOMAIN_TIME_SYNC) +) + +type DomainDiskErrorCode int + +const ( + DOMAIN_DISK_ERROR_NONE = DomainDiskErrorCode(C.VIR_DOMAIN_DISK_ERROR_NONE) + DOMAIN_DISK_ERROR_UNSPEC = DomainDiskErrorCode(C.VIR_DOMAIN_DISK_ERROR_UNSPEC) + DOMAIN_DISK_ERROR_NO_SPACE = DomainDiskErrorCode(C.VIR_DOMAIN_DISK_ERROR_NO_SPACE) +) + +type DomainStatsTypes int + +const ( + DOMAIN_STATS_STATE = DomainStatsTypes(C.VIR_DOMAIN_STATS_STATE) + DOMAIN_STATS_CPU_TOTAL = DomainStatsTypes(C.VIR_DOMAIN_STATS_CPU_TOTAL) + DOMAIN_STATS_BALLOON = DomainStatsTypes(C.VIR_DOMAIN_STATS_BALLOON) + DOMAIN_STATS_VCPU = DomainStatsTypes(C.VIR_DOMAIN_STATS_VCPU) + DOMAIN_STATS_INTERFACE = DomainStatsTypes(C.VIR_DOMAIN_STATS_INTERFACE) + DOMAIN_STATS_BLOCK = DomainStatsTypes(C.VIR_DOMAIN_STATS_BLOCK) + DOMAIN_STATS_PERF = DomainStatsTypes(C.VIR_DOMAIN_STATS_PERF) +) + +type DomainCoreDumpFlags int + +const ( + DUMP_CRASH = DomainCoreDumpFlags(C.VIR_DUMP_CRASH) + DUMP_LIVE = DomainCoreDumpFlags(C.VIR_DUMP_LIVE) + DUMP_BYPASS_CACHE = DomainCoreDumpFlags(C.VIR_DUMP_BYPASS_CACHE) + DUMP_RESET = DomainCoreDumpFlags(C.VIR_DUMP_RESET) + DUMP_MEMORY_ONLY = DomainCoreDumpFlags(C.VIR_DUMP_MEMORY_ONLY) +) + +type DomainMemoryFlags int + +const ( + MEMORY_VIRTUAL = DomainMemoryFlags(C.VIR_MEMORY_VIRTUAL) + MEMORY_PHYSICAL = DomainMemoryFlags(C.VIR_MEMORY_PHYSICAL) +) + +type DomainMigrateFlags int + +const ( + MIGRATE_LIVE = DomainMigrateFlags(C.VIR_MIGRATE_LIVE) + MIGRATE_PEER2PEER = DomainMigrateFlags(C.VIR_MIGRATE_PEER2PEER) + MIGRATE_TUNNELLED = DomainMigrateFlags(C.VIR_MIGRATE_TUNNELLED) + MIGRATE_PERSIST_DEST = DomainMigrateFlags(C.VIR_MIGRATE_PERSIST_DEST) + MIGRATE_UNDEFINE_SOURCE = DomainMigrateFlags(C.VIR_MIGRATE_UNDEFINE_SOURCE) + MIGRATE_PAUSED = DomainMigrateFlags(C.VIR_MIGRATE_PAUSED) + MIGRATE_NON_SHARED_DISK = DomainMigrateFlags(C.VIR_MIGRATE_NON_SHARED_DISK) + MIGRATE_NON_SHARED_INC = DomainMigrateFlags(C.VIR_MIGRATE_NON_SHARED_INC) + MIGRATE_CHANGE_PROTECTION = DomainMigrateFlags(C.VIR_MIGRATE_CHANGE_PROTECTION) + MIGRATE_UNSAFE = DomainMigrateFlags(C.VIR_MIGRATE_UNSAFE) + MIGRATE_OFFLINE = DomainMigrateFlags(C.VIR_MIGRATE_OFFLINE) + MIGRATE_COMPRESSED = DomainMigrateFlags(C.VIR_MIGRATE_COMPRESSED) + MIGRATE_ABORT_ON_ERROR = DomainMigrateFlags(C.VIR_MIGRATE_ABORT_ON_ERROR) + MIGRATE_AUTO_CONVERGE = DomainMigrateFlags(C.VIR_MIGRATE_AUTO_CONVERGE) + MIGRATE_RDMA_PIN_ALL = DomainMigrateFlags(C.VIR_MIGRATE_RDMA_PIN_ALL) + MIGRATE_POSTCOPY = DomainMigrateFlags(C.VIR_MIGRATE_POSTCOPY) + MIGRATE_TLS = DomainMigrateFlags(C.VIR_MIGRATE_TLS) +) + +type VcpuState int + +const ( + VCPU_OFFLINE = VcpuState(C.VIR_VCPU_OFFLINE) + VCPU_RUNNING = VcpuState(C.VIR_VCPU_RUNNING) + VCPU_BLOCKED = VcpuState(C.VIR_VCPU_BLOCKED) +) + +type DomainJobOperationType int + +const ( + DOMAIN_JOB_OPERATION_UNKNOWN = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_UNKNOWN) + DOMAIN_JOB_OPERATION_START = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_START) + DOMAIN_JOB_OPERATION_SAVE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SAVE) + DOMAIN_JOB_OPERATION_RESTORE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_RESTORE) + DOMAIN_JOB_OPERATION_MIGRATION_IN = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN) + DOMAIN_JOB_OPERATION_MIGRATION_OUT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT) + DOMAIN_JOB_OPERATION_SNAPSHOT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT) + DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT) + DOMAIN_JOB_OPERATION_DUMP = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_DUMP) +) + +type DomainBlockInfo struct { + Capacity uint64 + Allocation uint64 + Physical uint64 +} + +type DomainInfo struct { + State DomainState + MaxMem uint64 + Memory uint64 + NrVirtCpu uint + CpuTime uint64 +} + +type DomainMemoryStat struct { + Tag int32 + Val uint64 +} + +type DomainVcpuInfo struct { + Number uint32 + State int32 + CpuTime uint64 + Cpu int32 + CpuMap []bool +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFree +func (d *Domain) Free() error { + var err C.virError + ret := C.virDomainFreeWrapper(d.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRef +func (c *Domain) Ref() error { + var err C.virError + ret := C.virDomainRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreate +func (d *Domain) Create() error { + var err C.virError + result := C.virDomainCreateWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFlags +func (d *Domain) CreateWithFlags(flags DomainCreateFlags) error { + var err C.virError + result := C.virDomainCreateWithFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFiles +func (d *Domain) CreateWithFiles(files []os.File, flags DomainCreateFlags) error { + cfiles := make([]C.int, len(files)) + for i := 0; i < len(files); i++ { + cfiles[i] = C.int(files[i].Fd()) + } + var err C.virError + result := C.virDomainCreateWithFilesWrapper(d.ptr, C.uint(len(files)), &cfiles[0], C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDestroy +func (d *Domain) Destroy() error { + var err C.virError + result := C.virDomainDestroyWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdown +func (d *Domain) Shutdown() error { + var err C.virError + result := C.virDomainShutdownWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot +func (d *Domain) Reboot(flags DomainRebootFlagValues) error { + var err C.virError + result := C.virDomainRebootWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsActive +func (d *Domain) IsActive() (bool, error) { + var err C.virError + result := C.virDomainIsActiveWrapper(d.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsPersistent +func (d *Domain) IsPersistent() (bool, error) { + var err C.virError + result := C.virDomainIsPersistentWrapper(d.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsUpdated +func (d *Domain) IsUpdated() (bool, error) { + var err C.virError + result := C.virDomainIsUpdatedWrapper(d.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetAutostart +func (d *Domain) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virDomainSetAutostartWrapper(d.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetAutostart +func (d *Domain) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virDomainGetAutostartWrapper(d.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockInfo +func (d *Domain) GetBlockInfo(disk string, flag uint) (*DomainBlockInfo, error) { + var cinfo C.virDomainBlockInfo + cDisk := C.CString(disk) + defer C.free(unsafe.Pointer(cDisk)) + var err C.virError + result := C.virDomainGetBlockInfoWrapper(d.ptr, cDisk, &cinfo, C.uint(flag), &err) + if result == -1 { + return nil, makeError(&err) + } + + return &DomainBlockInfo{ + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + Physical: uint64(cinfo.physical), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetName +func (d *Domain) GetName() (string, error) { + var err C.virError + name := C.virDomainGetNameWrapper(d.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetState +func (d *Domain) GetState() (DomainState, int, error) { + var cState C.int + var cReason C.int + var err C.virError + result := C.virDomainGetStateWrapper(d.ptr, + (*C.int)(unsafe.Pointer(&cState)), + (*C.int)(unsafe.Pointer(&cReason)), + 0, &err) + if int(result) == -1 { + return 0, 0, makeError(&err) + } + return DomainState(cState), int(cReason), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetID +func (d *Domain) GetID() (uint, error) { + var err C.virError + id := uint(C.virDomainGetIDWrapper(d.ptr, &err)) + if id == ^uint(0) { + return id, makeError(&err) + } + return id, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUID +func (d *Domain) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virDomainGetUUIDWrapper(d.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString +func (d *Domain) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virDomainGetUUIDStringWrapper(d.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInfo +func (d *Domain) GetInfo() (*DomainInfo, error) { + var cinfo C.virDomainInfo + var err C.virError + result := C.virDomainGetInfoWrapper(d.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &DomainInfo{ + State: DomainState(cinfo.state), + MaxMem: uint64(cinfo.maxMem), + Memory: uint64(cinfo.memory), + NrVirtCpu: uint(cinfo.nrVirtCpu), + CpuTime: uint64(cinfo.cpuTime), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetXMLDesc +func (d *Domain) GetXMLDesc(flags DomainXMLFlags) (string, error) { + var err C.virError + result := C.virDomainGetXMLDescWrapper(d.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +type DomainCPUStats struct { + CpuTimeSet bool + CpuTime uint64 + UserTimeSet bool + UserTime uint64 + SystemTimeSet bool + SystemTime uint64 + VcpuTimeSet bool + VcpuTime uint64 +} + +func getCPUStatsFieldInfo(params *DomainCPUStats) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_CPU_STATS_CPUTIME: typedParamsFieldInfo{ + set: ¶ms.CpuTimeSet, + ul: ¶ms.CpuTime, + }, + C.VIR_DOMAIN_CPU_STATS_USERTIME: typedParamsFieldInfo{ + set: ¶ms.UserTimeSet, + ul: ¶ms.UserTime, + }, + C.VIR_DOMAIN_CPU_STATS_SYSTEMTIME: typedParamsFieldInfo{ + set: ¶ms.SystemTimeSet, + ul: ¶ms.SystemTime, + }, + C.VIR_DOMAIN_CPU_STATS_VCPUTIME: typedParamsFieldInfo{ + set: ¶ms.VcpuTimeSet, + ul: ¶ms.VcpuTime, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetCPUStats +func (d *Domain) GetCPUStats(startCpu int, nCpus uint, flags uint32) ([]DomainCPUStats, error) { + var err C.virError + if nCpus == 0 { + if startCpu == -1 { + nCpus = 1 + } else { + ret := C.virDomainGetCPUStatsWrapper(d.ptr, nil, 0, 0, 0, 0, &err) + if ret == -1 { + return []DomainCPUStats{}, makeError(&err) + } + nCpus = uint(ret) + } + } + + ret := C.virDomainGetCPUStatsWrapper(d.ptr, nil, 0, C.int(startCpu), C.uint(nCpus), 0, &err) + if ret == -1 { + return []DomainCPUStats{}, makeError(&err) + } + nparams := uint(ret) + + var cparams []C.virTypedParameter + var nallocparams uint + if startCpu == -1 { + nallocparams = nparams + } else { + nallocparams = nparams * nCpus + } + cparams = make([]C.virTypedParameter, nallocparams) + ret = C.virDomainGetCPUStatsWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), C.uint(nparams), C.int(startCpu), C.uint(nCpus), C.uint(flags), &err) + if ret == -1 { + return []DomainCPUStats{}, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), C.int(nallocparams)) + + stats := make([]DomainCPUStats, nCpus) + for i := 0; i < int(nCpus); i++ { + offset := i * int(nparams) + info := getCPUStatsFieldInfo(&stats[i]) + cparamscpu := cparams[offset : offset+int(ret)] + _, gerr := typedParamsUnpack(cparamscpu, info) + if gerr != nil { + return []DomainCPUStats{}, gerr + } + } + return stats, nil +} + +type DomainInterfaceParameters struct { + BandwidthInAverageSet bool + BandwidthInAverage uint + BandwidthInPeakSet bool + BandwidthInPeak uint + BandwidthInBurstSet bool + BandwidthInBurst uint + BandwidthInFloorSet bool + BandwidthInFloor uint + BandwidthOutAverageSet bool + BandwidthOutAverage uint + BandwidthOutPeakSet bool + BandwidthOutPeak uint + BandwidthOutBurstSet bool + BandwidthOutBurst uint +} + +func getInterfaceParameterFieldInfo(params *DomainInterfaceParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BANDWIDTH_IN_AVERAGE: typedParamsFieldInfo{ + set: ¶ms.BandwidthInAverageSet, + ui: ¶ms.BandwidthInAverage, + }, + C.VIR_DOMAIN_BANDWIDTH_IN_PEAK: typedParamsFieldInfo{ + set: ¶ms.BandwidthInPeakSet, + ui: ¶ms.BandwidthInPeak, + }, + C.VIR_DOMAIN_BANDWIDTH_IN_BURST: typedParamsFieldInfo{ + set: ¶ms.BandwidthInBurstSet, + ui: ¶ms.BandwidthInBurst, + }, + C.VIR_DOMAIN_BANDWIDTH_IN_FLOOR: typedParamsFieldInfo{ + set: ¶ms.BandwidthInFloorSet, + ui: ¶ms.BandwidthInFloor, + }, + C.VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutAverageSet, + ui: ¶ms.BandwidthOutAverage, + }, + C.VIR_DOMAIN_BANDWIDTH_OUT_PEAK: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutPeakSet, + ui: ¶ms.BandwidthOutPeak, + }, + C.VIR_DOMAIN_BANDWIDTH_OUT_BURST: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutBurstSet, + ui: ¶ms.BandwidthOutBurst, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInterfaceParameters +func (d *Domain) GetInterfaceParameters(device string, flags DomainModificationImpact) (*DomainInterfaceParameters, error) { + params := &DomainInterfaceParameters{} + info := getInterfaceParameterFieldInfo(params) + + var nparams C.int + + cdevice := C.CString(device) + defer C.free(unsafe.Pointer(cdevice)) + var err C.virError + ret := C.virDomainGetInterfaceParametersWrapper(d.ptr, cdevice, nil, &nparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetInterfaceParametersWrapper(d.ptr, cdevice, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfaceParameters +func (d *Domain) SetInterfaceParameters(device string, params *DomainInterfaceParameters, flags DomainModificationImpact) error { + info := getInterfaceParameterFieldInfo(params) + + var nparams C.int + + cdevice := C.CString(device) + defer C.free(unsafe.Pointer(cdevice)) + var err C.virError + ret := C.virDomainGetInterfaceParametersWrapper(d.ptr, cdevice, nil, &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetInterfaceParametersWrapper(d.ptr, cdevice, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetInterfaceParametersWrapper(d.ptr, cdevice, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMetadata +func (d *Domain) GetMetadata(tipus DomainMetadataType, uri string, flags DomainModificationImpact) (string, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + + var err C.virError + result := C.virDomainGetMetadataWrapper(d.ptr, C.int(tipus), cUri, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + + } + defer C.free(unsafe.Pointer(result)) + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata +func (d *Domain) SetMetadata(metaDataType DomainMetadataType, metaDataCont, uriKey, uri string, flags DomainModificationImpact) error { + var cMetaDataCont *C.char + var cUriKey *C.char + var cUri *C.char + + if metaDataCont != "" { + cMetaDataCont = C.CString(metaDataCont) + defer C.free(unsafe.Pointer(cMetaDataCont)) + } + + if metaDataType == DOMAIN_METADATA_ELEMENT { + if uriKey != "" { + cUriKey = C.CString(uriKey) + defer C.free(unsafe.Pointer(cUriKey)) + } + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + result := C.virDomainSetMetadataWrapper(d.ptr, C.int(metaDataType), cMetaDataCont, cUriKey, cUri, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefine +func (d *Domain) Undefine() error { + var err C.virError + result := C.virDomainUndefineWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefineFlags +func (d *Domain) UndefineFlags(flags DomainUndefineFlagsValues) error { + var err C.virError + result := C.virDomainUndefineFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMaxMemory +func (d *Domain) SetMaxMemory(memory uint) error { + var err C.virError + result := C.virDomainSetMaxMemoryWrapper(d.ptr, C.ulong(memory), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemory +func (d *Domain) SetMemory(memory uint64) error { + var err C.virError + result := C.virDomainSetMemoryWrapper(d.ptr, C.ulong(memory), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryFlags +func (d *Domain) SetMemoryFlags(memory uint64, flags DomainMemoryModFlags) error { + var err C.virError + result := C.virDomainSetMemoryFlagsWrapper(d.ptr, C.ulong(memory), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryStatsPeriod +func (d *Domain) SetMemoryStatsPeriod(period int, flags DomainMemoryModFlags) error { + var err C.virError + result := C.virDomainSetMemoryStatsPeriodWrapper(d.ptr, C.int(period), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpus +func (d *Domain) SetVcpus(vcpu uint) error { + var err C.virError + result := C.virDomainSetVcpusWrapper(d.ptr, C.uint(vcpu), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpusFlags +func (d *Domain) SetVcpusFlags(vcpu uint, flags DomainVcpuFlags) error { + var err C.virError + result := C.virDomainSetVcpusFlagsWrapper(d.ptr, C.uint(vcpu), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSuspend +func (d *Domain) Suspend() error { + var err C.virError + result := C.virDomainSuspendWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainResume +func (d *Domain) Resume() error { + var err C.virError + result := C.virDomainResumeWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob +func (d *Domain) AbortJob() error { + var err C.virError + result := C.virDomainAbortJobWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDestroyFlags +func (d *Domain) DestroyFlags(flags DomainDestroyFlags) error { + var err C.virError + result := C.virDomainDestroyFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdownFlags +func (d *Domain) ShutdownFlags(flags DomainShutdownFlags) error { + var err C.virError + result := C.virDomainShutdownFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDevice +func (d *Domain) AttachDevice(xml string) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainAttachDeviceWrapper(d.ptr, cXml, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDeviceFlags +func (d *Domain) AttachDeviceFlags(xml string, flags DomainDeviceModifyFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainAttachDeviceFlagsWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDevice +func (d *Domain) DetachDevice(xml string) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainDetachDeviceWrapper(d.ptr, cXml, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceFlags +func (d *Domain) DetachDeviceFlags(xml string, flags DomainDeviceModifyFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainDetachDeviceFlagsWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceAlias +func (d *Domain) DetachDeviceAlias(alias string, flags DomainDeviceModifyFlags) error { + if C.LIBVIR_VERSION_NUMBER < 4004000 { + return makeNotImplementedError("virDomainDetachDeviceAlias") + } + + cAlias := C.CString(alias) + defer C.free(unsafe.Pointer(cAlias)) + var err C.virError + result := C.virDomainDetachDeviceAliasWrapper(d.ptr, cAlias, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDeviceFlags +func (d *Domain) UpdateDeviceFlags(xml string, flags DomainDeviceModifyFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainUpdateDeviceFlagsWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainScreenshot +func (d *Domain) Screenshot(stream *Stream, screen, flags uint32) (string, error) { + var err C.virError + cType := C.virDomainScreenshotWrapper(d.ptr, stream.ptr, C.uint(screen), C.uint(flags), &err) + if cType == nil { + return "", makeError(&err) + } + defer C.free(unsafe.Pointer(cType)) + + mimeType := C.GoString(cType) + return mimeType, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey +func (d *Domain) SendKey(codeset, holdtime uint, keycodes []uint, flags uint32) error { + var err C.virError + result := C.virDomainSendKeyWrapper(d.ptr, C.uint(codeset), C.uint(holdtime), (*C.uint)(unsafe.Pointer(&keycodes[0])), C.int(len(keycodes)), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + + return nil +} + +type DomainBlockStats struct { + RdBytesSet bool + RdBytes int64 + RdReqSet bool + RdReq int64 + RdTotalTimesSet bool + RdTotalTimes int64 + WrBytesSet bool + WrBytes int64 + WrReqSet bool + WrReq int64 + WrTotalTimesSet bool + WrTotalTimes int64 + FlushReqSet bool + FlushReq int64 + FlushTotalTimesSet bool + FlushTotalTimes int64 + ErrsSet bool + Errs int64 +} + +func getBlockStatsFieldInfo(params *DomainBlockStats) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLOCK_STATS_READ_BYTES: typedParamsFieldInfo{ + set: ¶ms.RdBytesSet, + l: ¶ms.RdBytes, + }, + C.VIR_DOMAIN_BLOCK_STATS_READ_REQ: typedParamsFieldInfo{ + set: ¶ms.RdReqSet, + l: ¶ms.RdReq, + }, + C.VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES: typedParamsFieldInfo{ + set: ¶ms.RdTotalTimesSet, + l: ¶ms.RdTotalTimes, + }, + C.VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES: typedParamsFieldInfo{ + set: ¶ms.WrBytesSet, + l: ¶ms.WrBytes, + }, + C.VIR_DOMAIN_BLOCK_STATS_WRITE_REQ: typedParamsFieldInfo{ + set: ¶ms.WrReqSet, + l: ¶ms.WrReq, + }, + C.VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES: typedParamsFieldInfo{ + set: ¶ms.WrTotalTimesSet, + l: ¶ms.WrTotalTimes, + }, + C.VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ: typedParamsFieldInfo{ + set: ¶ms.FlushReqSet, + l: ¶ms.FlushReq, + }, + C.VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES: typedParamsFieldInfo{ + set: ¶ms.FlushTotalTimesSet, + l: ¶ms.FlushTotalTimes, + }, + C.VIR_DOMAIN_BLOCK_STATS_ERRS: typedParamsFieldInfo{ + set: ¶ms.ErrsSet, + l: ¶ms.Errs, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockStatsFlags +func (d *Domain) BlockStatsFlags(disk string, flags uint32) (*DomainBlockStats, error) { + params := &DomainBlockStats{} + info := getBlockStatsFieldInfo(params) + + var nparams C.int + + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockStatsFlagsWrapper(d.ptr, cdisk, nil, &nparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainBlockStatsFlagsWrapper(d.ptr, cdisk, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockStats +func (d *Domain) BlockStats(path string) (*DomainBlockStats, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + + size := C.size_t(unsafe.Sizeof(C.struct__virDomainBlockStats{})) + + cStats := (C.virDomainBlockStatsPtr)(C.malloc(size)) + defer C.free(unsafe.Pointer(cStats)) + + var err C.virError + result := C.virDomainBlockStatsWrapper(d.ptr, cPath, (C.virDomainBlockStatsPtr)(cStats), size, &err) + + if result != 0 { + return nil, makeError(&err) + } + return &DomainBlockStats{ + WrReqSet: true, + WrReq: int64(cStats.wr_req), + RdReqSet: true, + RdReq: int64(cStats.rd_req), + RdBytesSet: true, + RdBytes: int64(cStats.rd_bytes), + WrBytesSet: true, + WrBytes: int64(cStats.wr_bytes), + }, nil +} + +type DomainInterfaceStats struct { + RxBytesSet bool + RxBytes int64 + RxPacketsSet bool + RxPackets int64 + RxErrsSet bool + RxErrs int64 + RxDropSet bool + RxDrop int64 + TxBytesSet bool + TxBytes int64 + TxPacketsSet bool + TxPackets int64 + TxErrsSet bool + TxErrs int64 + TxDropSet bool + TxDrop int64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceStats +func (d *Domain) InterfaceStats(path string) (*DomainInterfaceStats, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + + size := C.size_t(unsafe.Sizeof(C.struct__virDomainInterfaceStats{})) + + cStats := (C.virDomainInterfaceStatsPtr)(C.malloc(size)) + defer C.free(unsafe.Pointer(cStats)) + + var err C.virError + result := C.virDomainInterfaceStatsWrapper(d.ptr, cPath, (C.virDomainInterfaceStatsPtr)(cStats), size, &err) + + if result != 0 { + return nil, makeError(&err) + } + return &DomainInterfaceStats{ + RxBytesSet: true, + RxBytes: int64(cStats.rx_bytes), + RxPacketsSet: true, + RxPackets: int64(cStats.rx_packets), + RxErrsSet: true, + RxErrs: int64(cStats.rx_errs), + RxDropSet: true, + RxDrop: int64(cStats.rx_drop), + TxBytesSet: true, + TxBytes: int64(cStats.tx_bytes), + TxPacketsSet: true, + TxPackets: int64(cStats.tx_packets), + TxErrsSet: true, + TxErrs: int64(cStats.tx_errs), + TxDropSet: true, + TxDrop: int64(cStats.tx_drop), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryStats +func (d *Domain) MemoryStats(nrStats uint32, flags uint32) ([]DomainMemoryStat, error) { + ptr := make([]C.virDomainMemoryStatStruct, nrStats) + + var err C.virError + result := C.virDomainMemoryStatsWrapper( + d.ptr, (C.virDomainMemoryStatPtr)(unsafe.Pointer(&ptr[0])), + C.uint(nrStats), C.uint(flags), &err) + + if result == -1 { + return []DomainMemoryStat{}, makeError(&err) + } + + out := make([]DomainMemoryStat, 0) + for i := 0; i < int(result); i++ { + out = append(out, DomainMemoryStat{ + Tag: int32(ptr[i].tag), + Val: uint64(ptr[i].val), + }) + } + return out, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetConnect +// +// Contrary to the native C API behaviour, the Go API will +// acquire a reference on the returned Connect, which must +// be released by calling Close() +func (d *Domain) DomainGetConnect() (*Connect, error) { + var err C.virError + ptr := C.virDomainGetConnectWrapper(d.ptr, &err) + if ptr == nil { + return nil, makeError(&err) + } + + ret := C.virConnectRefWrapper(ptr, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpus +func (d *Domain) GetVcpus() ([]DomainVcpuInfo, error) { + var cnodeinfo C.virNodeInfo + var err C.virError + ret := C.virNodeGetInfoWrapper(C.virDomainGetConnect(d.ptr), &cnodeinfo, &err) + if ret == -1 { + return []DomainVcpuInfo{}, makeError(&err) + } + + var cdominfo C.virDomainInfo + ret = C.virDomainGetInfoWrapper(d.ptr, &cdominfo, &err) + if ret == -1 { + return []DomainVcpuInfo{}, makeError(&err) + } + + nvcpus := int(cdominfo.nrVirtCpu) + npcpus := int(cnodeinfo.nodes * cnodeinfo.sockets * cnodeinfo.cores * cnodeinfo.threads) + maplen := ((npcpus + 7) / 8) + ccpumaps := make([]C.uchar, maplen*nvcpus) + cinfo := make([]C.virVcpuInfo, nvcpus) + + ret = C.virDomainGetVcpusWrapper(d.ptr, &cinfo[0], C.int(nvcpus), &ccpumaps[0], C.int(maplen), &err) + if ret == -1 { + return []DomainVcpuInfo{}, makeError(&err) + } + + info := make([]DomainVcpuInfo, int(ret)) + for i := 0; i < int(ret); i++ { + affinity := make([]bool, npcpus) + for j := 0; j < npcpus; j++ { + byte := (i * maplen) + (j / 8) + bit := j % 8 + + affinity[j] = (ccpumaps[byte] & (1 << uint(bit))) != 0 + } + + info[i] = DomainVcpuInfo{ + Number: uint32(cinfo[i].number), + State: int32(cinfo[i].state), + CpuTime: uint64(cinfo[i].cpuTime), + Cpu: int32(cinfo[i].cpu), + CpuMap: affinity, + } + } + + return info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags +func (d *Domain) GetVcpusFlags(flags DomainVcpuFlags) (int32, error) { + var err C.virError + result := C.virDomainGetVcpusFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return 0, makeError(&err) + } + return int32(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu +func (d *Domain) PinVcpu(vcpu uint, cpuMap []bool) error { + maplen := (len(cpuMap) + 7) / 8 + ccpumap := make([]C.uchar, maplen) + for i := 0; i < len(cpuMap); i++ { + if cpuMap[i] { + byte := i / 8 + bit := i % 8 + ccpumap[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + result := C.virDomainPinVcpuWrapper(d.ptr, C.uint(vcpu), &ccpumap[0], C.int(maplen), &err) + + if result == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpuFlags +func (d *Domain) PinVcpuFlags(vcpu uint, cpuMap []bool, flags DomainModificationImpact) error { + maplen := (len(cpuMap) + 7) / 8 + ccpumap := make([]C.uchar, maplen) + for i := 0; i < len(cpuMap); i++ { + if cpuMap[i] { + byte := i / 8 + bit := i % 8 + ccpumap[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + result := C.virDomainPinVcpuFlagsWrapper(d.ptr, C.uint(vcpu), &ccpumap[0], C.int(maplen), C.uint(flags), &err) + + if result == -1 { + return makeError(&err) + } + + return nil +} + +type DomainIPAddress struct { + Type int + Addr string + Prefix uint +} + +type DomainInterface struct { + Name string + Hwaddr string + Addrs []DomainIPAddress +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddresses +func (d *Domain) ListAllInterfaceAddresses(src DomainInterfaceAddressesSource) ([]DomainInterface, error) { + if C.LIBVIR_VERSION_NUMBER < 1002014 { + return []DomainInterface{}, makeNotImplementedError("virDomainInterfaceAddresses") + } + + var cList *C.virDomainInterfacePtr + var err C.virError + numIfaces := int(C.virDomainInterfaceAddressesWrapper(d.ptr, (**C.virDomainInterfacePtr)(&cList), C.uint(src), 0, &err)) + if numIfaces == -1 { + return nil, makeError(&err) + } + + ifaces := make([]DomainInterface, numIfaces) + + for i := 0; i < numIfaces; i++ { + var ciface *C.virDomainInterface + ciface = *(**C.virDomainInterface)(unsafe.Pointer(uintptr(unsafe.Pointer(cList)) + (unsafe.Sizeof(ciface) * uintptr(i)))) + + ifaces[i].Name = C.GoString(ciface.name) + ifaces[i].Hwaddr = C.GoString(ciface.hwaddr) + + numAddr := int(ciface.naddrs) + + ifaces[i].Addrs = make([]DomainIPAddress, numAddr) + + for k := 0; k < numAddr; k++ { + var caddr *C.virDomainIPAddress + caddr = (*C.virDomainIPAddress)(unsafe.Pointer(uintptr(unsafe.Pointer(ciface.addrs)) + (unsafe.Sizeof(*caddr) * uintptr(k)))) + ifaces[i].Addrs[k] = DomainIPAddress{} + ifaces[i].Addrs[k].Type = int(caddr._type) + ifaces[i].Addrs[k].Addr = C.GoString(caddr.addr) + ifaces[i].Addrs[k].Prefix = uint(caddr.prefix) + + } + C.virDomainInterfaceFreeWrapper(ciface) + } + C.free(unsafe.Pointer(cList)) + return ifaces, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotCurrent +func (d *Domain) SnapshotCurrent(flags uint32) (*DomainSnapshot, error) { + var err C.virError + result := C.virDomainSnapshotCurrentWrapper(d.ptr, C.uint(flags), &err) + if result == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: result}, nil + +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotNum +func (d *Domain) SnapshotNum(flags DomainSnapshotListFlags) (int, error) { + var err C.virError + result := int(C.virDomainSnapshotNumWrapper(d.ptr, C.uint(flags), &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotLookupByName +func (d *Domain) SnapshotLookupByName(name string, flags uint32) (*DomainSnapshot, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virDomainSnapshotLookupByNameWrapper(d.ptr, cName, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotListNames +func (d *Domain) SnapshotListNames(flags DomainSnapshotListFlags) ([]string, error) { + const maxNames = 1024 + var names [maxNames](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNames := C.virDomainSnapshotListNamesWrapper( + d.ptr, + (**C.char)(namesPtr), + maxNames, C.uint(flags), &err) + if numNames == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNames) + for k := 0; k < int(numNames); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainListAllSnapshots +func (d *Domain) ListAllSnapshots(flags DomainSnapshotListFlags) ([]DomainSnapshot, error) { + var cList *C.virDomainSnapshotPtr + var err C.virError + numVols := C.virDomainListAllSnapshotsWrapper(d.ptr, (**C.virDomainSnapshotPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []DomainSnapshot + slice := *(*[]C.virDomainSnapshotPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, DomainSnapshot{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCommit +func (d *Domain) BlockCommit(disk string, base string, top string, bandwidth uint64, flags DomainBlockCommitFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var cbase *C.char + if base != "" { + cbase = C.CString(base) + defer C.free(unsafe.Pointer(cbase)) + } + var ctop *C.char + if top != "" { + ctop = C.CString(top) + defer C.free(unsafe.Pointer(ctop)) + } + var err C.virError + ret := C.virDomainBlockCommitWrapper(d.ptr, cdisk, cbase, ctop, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +type DomainBlockCopyParameters struct { + BandwidthSet bool + Bandwidth uint64 + GranularitySet bool + Granularity uint + BufSizeSet bool + BufSize uint64 +} + +func getBlockCopyParameterFieldInfo(params *DomainBlockCopyParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLOCK_COPY_BANDWIDTH: typedParamsFieldInfo{ + set: ¶ms.BandwidthSet, + ul: ¶ms.Bandwidth, + }, + C.VIR_DOMAIN_BLOCK_COPY_GRANULARITY: typedParamsFieldInfo{ + set: ¶ms.GranularitySet, + ui: ¶ms.Granularity, + }, + C.VIR_DOMAIN_BLOCK_COPY_BUF_SIZE: typedParamsFieldInfo{ + set: ¶ms.BufSizeSet, + ul: ¶ms.BufSize, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCopy +func (d *Domain) BlockCopy(disk string, destxml string, params *DomainBlockCopyParameters, flags DomainBlockCopyFlags) error { + if C.LIBVIR_VERSION_NUMBER < 1002008 { + return makeNotImplementedError("virDomainBlockCopy") + } + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + cdestxml := C.CString(destxml) + defer C.free(unsafe.Pointer(cdestxml)) + + info := getBlockCopyParameterFieldInfo(params) + + cparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + nparams := len(*cparams) + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.int(nparams)) + + var err C.virError + ret := C.virDomainBlockCopyWrapper(d.ptr, cdisk, cdestxml, (*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.int(nparams), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobAbort +func (d *Domain) BlockJobAbort(disk string, flags DomainBlockJobAbortFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockJobAbortWrapper(d.ptr, cdisk, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobSetSpeed +func (d *Domain) BlockJobSetSpeed(disk string, bandwidth uint64, flags DomainBlockJobSetSpeedFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockJobSetSpeedWrapper(d.ptr, cdisk, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPull +func (d *Domain) BlockPull(disk string, bandwidth uint64, flags DomainBlockPullFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockPullWrapper(d.ptr, cdisk, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase +func (d *Domain) BlockRebase(disk string, base string, bandwidth uint64, flags DomainBlockRebaseFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var cbase *C.char + if base != "" { + cbase := C.CString(base) + defer C.free(unsafe.Pointer(cbase)) + } + var err C.virError + ret := C.virDomainBlockRebaseWrapper(d.ptr, cdisk, cbase, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockResize +func (d *Domain) BlockResize(disk string, size uint64, flags DomainBlockResizeFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockResizeWrapper(d.ptr, cdisk, C.ulonglong(size), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPeek +func (d *Domain) BlockPeek(disk string, offset uint64, size uint64, flags uint32) ([]byte, error) { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + data := make([]byte, size) + var err C.virError + ret := C.virDomainBlockPeekWrapper(d.ptr, cdisk, C.ulonglong(offset), C.size_t(size), + unsafe.Pointer(&data[0]), C.uint(flags), &err) + if ret == -1 { + return []byte{}, makeError(&err) + } + + return data, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryPeek +func (d *Domain) MemoryPeek(start uint64, size uint64, flags DomainMemoryFlags) ([]byte, error) { + data := make([]byte, size) + var err C.virError + ret := C.virDomainMemoryPeekWrapper(d.ptr, C.ulonglong(start), C.size_t(size), + unsafe.Pointer(&data[0]), C.uint(flags), &err) + if ret == -1 { + return []byte{}, makeError(&err) + } + + return data, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate +func (d *Domain) Migrate(dconn *Connect, flags DomainMigrateFlags, dname string, uri string, bandwidth uint64) (*Domain, error) { + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + var curi *C.char + if uri != "" { + curi = C.CString(uri) + defer C.free(unsafe.Pointer(curi)) + } + + var err C.virError + ret := C.virDomainMigrateWrapper(d.ptr, dconn.ptr, C.ulong(flags), cdname, curi, C.ulong(bandwidth), &err) + if ret == nil { + return nil, makeError(&err) + } + + return &Domain{ + ptr: ret, + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate2 +func (d *Domain) Migrate2(dconn *Connect, dxml string, flags DomainMigrateFlags, dname string, uri string, bandwidth uint64) (*Domain, error) { + var cdxml *C.char + if dxml != "" { + cdxml = C.CString(dxml) + defer C.free(unsafe.Pointer(cdxml)) + } + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + var curi *C.char + if uri != "" { + curi = C.CString(uri) + defer C.free(unsafe.Pointer(curi)) + } + + var err C.virError + ret := C.virDomainMigrate2Wrapper(d.ptr, dconn.ptr, cdxml, C.ulong(flags), cdname, curi, C.ulong(bandwidth), &err) + if ret == nil { + return nil, makeError(&err) + } + + return &Domain{ + ptr: ret, + }, nil +} + +type DomainMigrateParameters struct { + URISet bool + URI string + DestNameSet bool + DestName string + DestXMLSet bool + DestXML string + PersistXMLSet bool + PersistXML string + BandwidthSet bool + Bandwidth uint64 + GraphicsURISet bool + GraphicsURI string + ListenAddressSet bool + ListenAddress string + MigrateDisksSet bool + MigrateDisks []string + DisksPortSet bool + DisksPort int + CompressionSet bool + Compression string + CompressionMTLevelSet bool + CompressionMTLevel int + CompressionMTThreadsSet bool + CompressionMTThreads int + CompressionMTDThreadsSet bool + CompressionMTDThreads int + CompressionXBZRLECacheSet bool + CompressionXBZRLECache uint64 + AutoConvergeInitialSet bool + AutoConvergeInitial int + AutoConvergeIncrementSet bool + AutoConvergeIncrement int +} + +func getMigrateParameterFieldInfo(params *DomainMigrateParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_MIGRATE_PARAM_URI: typedParamsFieldInfo{ + set: ¶ms.URISet, + s: ¶ms.URI, + }, + C.VIR_MIGRATE_PARAM_DEST_NAME: typedParamsFieldInfo{ + set: ¶ms.DestNameSet, + s: ¶ms.DestName, + }, + C.VIR_MIGRATE_PARAM_DEST_XML: typedParamsFieldInfo{ + set: ¶ms.DestXMLSet, + s: ¶ms.DestXML, + }, + C.VIR_MIGRATE_PARAM_PERSIST_XML: typedParamsFieldInfo{ + set: ¶ms.PersistXMLSet, + s: ¶ms.PersistXML, + }, + C.VIR_MIGRATE_PARAM_BANDWIDTH: typedParamsFieldInfo{ + set: ¶ms.BandwidthSet, + ul: ¶ms.Bandwidth, + }, + C.VIR_MIGRATE_PARAM_GRAPHICS_URI: typedParamsFieldInfo{ + set: ¶ms.GraphicsURISet, + s: ¶ms.GraphicsURI, + }, + C.VIR_MIGRATE_PARAM_LISTEN_ADDRESS: typedParamsFieldInfo{ + set: ¶ms.ListenAddressSet, + s: ¶ms.ListenAddress, + }, + C.VIR_MIGRATE_PARAM_MIGRATE_DISKS: typedParamsFieldInfo{ + set: ¶ms.MigrateDisksSet, + sl: ¶ms.MigrateDisks, + }, + C.VIR_MIGRATE_PARAM_DISKS_PORT: typedParamsFieldInfo{ + set: ¶ms.DisksPortSet, + i: ¶ms.DisksPort, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION: typedParamsFieldInfo{ + set: ¶ms.CompressionSet, + s: ¶ms.Compression, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL: typedParamsFieldInfo{ + set: ¶ms.CompressionMTLevelSet, + i: ¶ms.CompressionMTLevel, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS: typedParamsFieldInfo{ + set: ¶ms.CompressionMTThreadsSet, + i: ¶ms.CompressionMTThreads, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS: typedParamsFieldInfo{ + set: ¶ms.CompressionMTDThreadsSet, + i: ¶ms.CompressionMTDThreads, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE: typedParamsFieldInfo{ + set: ¶ms.CompressionXBZRLECacheSet, + ul: ¶ms.CompressionXBZRLECache, + }, + C.VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL: typedParamsFieldInfo{ + set: ¶ms.AutoConvergeInitialSet, + i: ¶ms.AutoConvergeInitial, + }, + C.VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT: typedParamsFieldInfo{ + set: ¶ms.AutoConvergeIncrementSet, + i: ¶ms.AutoConvergeIncrement, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate3 +func (d *Domain) Migrate3(dconn *Connect, params *DomainMigrateParameters, flags DomainMigrateFlags) (*Domain, error) { + + info := getMigrateParameterFieldInfo(params) + cparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return nil, gerr + } + nparams := len(*cparams) + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.int(nparams)) + + var err C.virError + ret := C.virDomainMigrate3Wrapper(d.ptr, dconn.ptr, (*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.uint(nparams), C.uint(flags), &err) + if ret == nil { + return nil, makeError(&err) + } + + return &Domain{ + ptr: ret, + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI +func (d *Domain) MigrateToURI(duri string, flags DomainMigrateFlags, dname string, bandwidth uint64) error { + cduri := C.CString(duri) + defer C.free(unsafe.Pointer(cduri)) + + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + + var err C.virError + ret := C.virDomainMigrateToURIWrapper(d.ptr, cduri, C.ulong(flags), cdname, C.ulong(bandwidth), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI2 +func (d *Domain) MigrateToURI2(dconnuri string, miguri string, dxml string, flags DomainMigrateFlags, dname string, bandwidth uint64) error { + var cdconnuri *C.char + if dconnuri != "" { + cdconnuri = C.CString(dconnuri) + defer C.free(unsafe.Pointer(cdconnuri)) + } + var cmiguri *C.char + if miguri != "" { + cmiguri = C.CString(miguri) + defer C.free(unsafe.Pointer(cmiguri)) + } + var cdxml *C.char + if dxml != "" { + cdxml = C.CString(dxml) + defer C.free(unsafe.Pointer(cdxml)) + } + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + + var err C.virError + ret := C.virDomainMigrateToURI2Wrapper(d.ptr, cdconnuri, cmiguri, cdxml, C.ulong(flags), cdname, C.ulong(bandwidth), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI3 +func (d *Domain) MigrateToURI3(dconnuri string, params *DomainMigrateParameters, flags DomainMigrateFlags) error { + var cdconnuri *C.char + if dconnuri != "" { + cdconnuri = C.CString(dconnuri) + defer C.free(unsafe.Pointer(cdconnuri)) + } + + info := getMigrateParameterFieldInfo(params) + cparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + nparams := len(*cparams) + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.int(nparams)) + + var err C.virError + ret := C.virDomainMigrateToURI3Wrapper(d.ptr, cdconnuri, (*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.uint(nparams), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetCompressionCache +func (d *Domain) MigrateGetCompressionCache(flags uint32) (uint64, error) { + var cacheSize C.ulonglong + + var err C.virError + ret := C.virDomainMigrateGetCompressionCacheWrapper(d.ptr, &cacheSize, C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint64(cacheSize), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetCompressionCache +func (d *Domain) MigrateSetCompressionCache(size uint64, flags uint32) error { + var err C.virError + ret := C.virDomainMigrateSetCompressionCacheWrapper(d.ptr, C.ulonglong(size), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxSpeed +func (d *Domain) MigrateGetMaxSpeed(flags uint32) (uint64, error) { + var maxSpeed C.ulong + + var err C.virError + ret := C.virDomainMigrateGetMaxSpeedWrapper(d.ptr, &maxSpeed, C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint64(maxSpeed), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxSpeed +func (d *Domain) MigrateSetMaxSpeed(speed uint64, flags uint32) error { + var err C.virError + ret := C.virDomainMigrateSetMaxSpeedWrapper(d.ptr, C.ulong(speed), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime +func (d *Domain) MigrateSetMaxDowntime(downtime uint64, flags uint32) error { + var err C.virError + ret := C.virDomainMigrateSetMaxDowntimeWrapper(d.ptr, C.ulonglong(downtime), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxDowntime +func (d *Domain) MigrateGetMaxDowntime(flags uint32) (uint64, error) { + var downtimeLen C.ulonglong + + if C.LIBVIR_VERSION_NUMBER < 3007000 { + return 0, makeNotImplementedError("virDomainMigrateGetMaxDowntime") + } + + var err C.virError + ret := C.virDomainMigrateGetMaxDowntimeWrapper(d.ptr, &downtimeLen, C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint64(downtimeLen), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateStartPostCopy +func (d *Domain) MigrateStartPostCopy(flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 1003003 { + return makeNotImplementedError("virDomainMigrateStartPostCopy") + } + + var err C.virError + ret := C.virDomainMigrateStartPostCopyWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainBlkioParameters struct { + WeightSet bool + Weight uint + DeviceWeightSet bool + DeviceWeight string + DeviceReadIopsSet bool + DeviceReadIops string + DeviceWriteIopsSet bool + DeviceWriteIops string + DeviceReadBpsSet bool + DeviceReadBps string + DeviceWriteBpsSet bool + DeviceWriteBps string +} + +func getBlkioParametersFieldInfo(params *DomainBlkioParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLKIO_WEIGHT: typedParamsFieldInfo{ + set: ¶ms.WeightSet, + ui: ¶ms.Weight, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_WEIGHT: typedParamsFieldInfo{ + set: ¶ms.DeviceWeightSet, + s: ¶ms.DeviceWeight, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS: typedParamsFieldInfo{ + set: ¶ms.DeviceReadIopsSet, + s: ¶ms.DeviceReadIops, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS: typedParamsFieldInfo{ + set: ¶ms.DeviceWriteIopsSet, + s: ¶ms.DeviceWriteIops, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_READ_BPS: typedParamsFieldInfo{ + set: ¶ms.DeviceReadBpsSet, + s: ¶ms.DeviceReadBps, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS: typedParamsFieldInfo{ + set: ¶ms.DeviceWriteBpsSet, + s: ¶ms.DeviceWriteBps, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlkioParameters +func (d *Domain) GetBlkioParameters(flags DomainModificationImpact) (*DomainBlkioParameters, error) { + params := &DomainBlkioParameters{} + info := getBlkioParametersFieldInfo(params) + + var nparams C.int + var err C.virError + ret := C.virDomainGetBlkioParametersWrapper(d.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetBlkioParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlkioParameters +func (d *Domain) SetBlkioParameters(params *DomainBlkioParameters, flags DomainModificationImpact) error { + info := getBlkioParametersFieldInfo(params) + + var nparams C.int + + var err C.virError + ret := C.virDomainGetBlkioParametersWrapper(d.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetBlkioParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetBlkioParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +type DomainBlockIoTuneParameters struct { + TotalBytesSecSet bool + TotalBytesSec uint64 + ReadBytesSecSet bool + ReadBytesSec uint64 + WriteBytesSecSet bool + WriteBytesSec uint64 + TotalIopsSecSet bool + TotalIopsSec uint64 + ReadIopsSecSet bool + ReadIopsSec uint64 + WriteIopsSecSet bool + WriteIopsSec uint64 + TotalBytesSecMaxSet bool + TotalBytesSecMax uint64 + ReadBytesSecMaxSet bool + ReadBytesSecMax uint64 + WriteBytesSecMaxSet bool + WriteBytesSecMax uint64 + TotalIopsSecMaxSet bool + TotalIopsSecMax uint64 + ReadIopsSecMaxSet bool + ReadIopsSecMax uint64 + WriteIopsSecMaxSet bool + WriteIopsSecMax uint64 + TotalBytesSecMaxLengthSet bool + TotalBytesSecMaxLength uint64 + ReadBytesSecMaxLengthSet bool + ReadBytesSecMaxLength uint64 + WriteBytesSecMaxLengthSet bool + WriteBytesSecMaxLength uint64 + TotalIopsSecMaxLengthSet bool + TotalIopsSecMaxLength uint64 + ReadIopsSecMaxLengthSet bool + ReadIopsSecMaxLength uint64 + WriteIopsSecMaxLengthSet bool + WriteIopsSecMaxLength uint64 + SizeIopsSecSet bool + SizeIopsSec uint64 + GroupNameSet bool + GroupName string +} + +func getBlockIoTuneParametersFieldInfo(params *DomainBlockIoTuneParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecSet, + ul: ¶ms.TotalBytesSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecSet, + ul: ¶ms.ReadBytesSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecSet, + ul: ¶ms.WriteBytesSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecSet, + ul: ¶ms.TotalIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecSet, + ul: ¶ms.ReadIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecSet, + ul: ¶ms.WriteIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxSet, + ul: ¶ms.TotalBytesSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxSet, + ul: ¶ms.ReadBytesSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxSet, + ul: ¶ms.WriteBytesSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxSet, + ul: ¶ms.TotalIopsSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxSet, + ul: ¶ms.ReadIopsSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxSet, + ul: ¶ms.WriteIopsSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxLengthSet, + ul: ¶ms.TotalBytesSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxLengthSet, + ul: ¶ms.ReadBytesSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxLengthSet, + ul: ¶ms.WriteBytesSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxLengthSet, + ul: ¶ms.TotalIopsSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxLengthSet, + ul: ¶ms.ReadIopsSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxLengthSet, + ul: ¶ms.WriteIopsSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.SizeIopsSecSet, + ul: ¶ms.SizeIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME: typedParamsFieldInfo{ + set: ¶ms.GroupNameSet, + s: ¶ms.GroupName, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockIoTune +func (d *Domain) GetBlockIoTune(disk string, flags DomainModificationImpact) (*DomainBlockIoTuneParameters, error) { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + + params := &DomainBlockIoTuneParameters{} + info := getBlockIoTuneParametersFieldInfo(params) + + var nparams C.int + var err C.virError + ret := C.virDomainGetBlockIoTuneWrapper(d.ptr, cdisk, nil, &nparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetBlockIoTuneWrapper(d.ptr, cdisk, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockIoTune +func (d *Domain) SetBlockIoTune(disk string, params *DomainBlockIoTuneParameters, flags DomainModificationImpact) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + + info := getBlockIoTuneParametersFieldInfo(params) + + var nparams C.int + + var err C.virError + ret := C.virDomainGetBlockIoTuneWrapper(d.ptr, cdisk, nil, &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetBlockIoTuneWrapper(d.ptr, cdisk, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetBlockIoTuneWrapper(d.ptr, cdisk, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +type DomainBlockJobInfo struct { + Type DomainBlockJobType + Bandwidth uint64 + Cur uint64 + End uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockJobInfo +func (d *Domain) GetBlockJobInfo(disk string, flags DomainBlockJobInfoFlags) (*DomainBlockJobInfo, error) { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + + var cinfo C.virDomainBlockJobInfo + + var err C.virError + ret := C.virDomainGetBlockJobInfoWrapper(d.ptr, cdisk, &cinfo, C.uint(flags), &err) + + if ret == -1 { + return nil, makeError(&err) + } + + return &DomainBlockJobInfo{ + Type: DomainBlockJobType(cinfo._type), + Bandwidth: uint64(cinfo.bandwidth), + Cur: uint64(cinfo.cur), + End: uint64(cinfo.end), + }, nil +} + +type DomainControlInfo struct { + State DomainControlState + Details int + StateTime uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetControlInfo +func (d *Domain) GetControlInfo(flags uint32) (*DomainControlInfo, error) { + + var cinfo C.virDomainControlInfo + + var err C.virError + ret := C.virDomainGetControlInfoWrapper(d.ptr, &cinfo, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &DomainControlInfo{ + State: DomainControlState(cinfo.state), + Details: int(cinfo.details), + StateTime: uint64(cinfo.stateTime), + }, nil +} + +type DomainDiskError struct { + Disk string + Error DomainDiskErrorCode +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetDiskErrors +func (d *Domain) GetDiskErrors(flags uint32) ([]DomainDiskError, error) { + var err C.virError + ret := C.virDomainGetDiskErrorsWrapper(d.ptr, nil, 0, 0, &err) + if ret == -1 { + return []DomainDiskError{}, makeError(&err) + } + + maxerrors := ret + cerrors := make([]C.virDomainDiskError, maxerrors) + + ret = C.virDomainGetDiskErrorsWrapper(d.ptr, (*C.virDomainDiskError)(unsafe.Pointer(&cerrors[0])), C.uint(maxerrors), C.uint(flags), &err) + if ret == -1 { + return []DomainDiskError{}, makeError(&err) + } + + errors := make([]DomainDiskError, maxerrors) + + for i, cerror := range cerrors { + errors[i] = DomainDiskError{ + Disk: C.GoString(cerror.disk), + Error: DomainDiskErrorCode(cerror.error), + } + C.free(unsafe.Pointer(cerror.disk)) + } + + return errors, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname +func (d *Domain) GetHostname(flags uint32) (string, error) { + var err C.virError + ret := C.virDomainGetHostnameWrapper(d.ptr, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +type DomainJobInfo struct { + Type DomainJobType + TimeElapsedSet bool + TimeElapsed uint64 + TimeElapsedNetSet bool + TimeElapsedNet uint64 + TimeRemainingSet bool + TimeRemaining uint64 + DowntimeSet bool + Downtime uint64 + DowntimeNetSet bool + DowntimeNet uint64 + SetupTimeSet bool + SetupTime uint64 + DataTotalSet bool + DataTotal uint64 + DataProcessedSet bool + DataProcessed uint64 + DataRemainingSet bool + DataRemaining uint64 + MemTotalSet bool + MemTotal uint64 + MemProcessedSet bool + MemProcessed uint64 + MemRemainingSet bool + MemRemaining uint64 + MemConstantSet bool + MemConstant uint64 + MemNormalSet bool + MemNormal uint64 + MemNormalBytesSet bool + MemNormalBytes uint64 + MemBpsSet bool + MemBps uint64 + MemDirtyRateSet bool + MemDirtyRate uint64 + MemPageSizeSet bool + MemPageSize uint64 + MemIterationSet bool + MemIteration uint64 + DiskTotalSet bool + DiskTotal uint64 + DiskProcessedSet bool + DiskProcessed uint64 + DiskRemainingSet bool + DiskRemaining uint64 + DiskBpsSet bool + DiskBps uint64 + CompressionCacheSet bool + CompressionCache uint64 + CompressionBytesSet bool + CompressionBytes uint64 + CompressionPagesSet bool + CompressionPages uint64 + CompressionCacheMissesSet bool + CompressionCacheMisses uint64 + CompressionOverflowSet bool + CompressionOverflow uint64 + AutoConvergeThrottleSet bool + AutoConvergeThrottle int + OperationSet bool + Operation DomainJobOperationType +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo +func (d *Domain) GetJobInfo() (*DomainJobInfo, error) { + var cinfo C.virDomainJobInfo + + var err C.virError + ret := C.virDomainGetJobInfoWrapper(d.ptr, &cinfo, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &DomainJobInfo{ + Type: DomainJobType(cinfo._type), + TimeElapsedSet: true, + TimeElapsed: uint64(cinfo.timeElapsed), + TimeRemainingSet: true, + TimeRemaining: uint64(cinfo.timeRemaining), + DataTotalSet: true, + DataTotal: uint64(cinfo.dataTotal), + DataProcessedSet: true, + DataProcessed: uint64(cinfo.dataProcessed), + DataRemainingSet: true, + DataRemaining: uint64(cinfo.dataRemaining), + MemTotalSet: true, + MemTotal: uint64(cinfo.memTotal), + MemProcessedSet: true, + MemProcessed: uint64(cinfo.memProcessed), + MemRemainingSet: true, + MemRemaining: uint64(cinfo.memRemaining), + DiskTotalSet: true, + DiskTotal: uint64(cinfo.fileTotal), + DiskProcessedSet: true, + DiskProcessed: uint64(cinfo.fileProcessed), + DiskRemainingSet: true, + DiskRemaining: uint64(cinfo.fileRemaining), + }, nil +} + +func getDomainJobInfoFieldInfo(params *DomainJobInfo) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_JOB_TIME_ELAPSED: typedParamsFieldInfo{ + set: ¶ms.TimeElapsedSet, + ul: ¶ms.TimeElapsed, + }, + C.VIR_DOMAIN_JOB_TIME_ELAPSED_NET: typedParamsFieldInfo{ + set: ¶ms.TimeElapsedNetSet, + ul: ¶ms.TimeElapsedNet, + }, + C.VIR_DOMAIN_JOB_TIME_REMAINING: typedParamsFieldInfo{ + set: ¶ms.TimeRemainingSet, + ul: ¶ms.TimeRemaining, + }, + C.VIR_DOMAIN_JOB_DOWNTIME: typedParamsFieldInfo{ + set: ¶ms.DowntimeSet, + ul: ¶ms.Downtime, + }, + C.VIR_DOMAIN_JOB_DOWNTIME_NET: typedParamsFieldInfo{ + set: ¶ms.DowntimeNetSet, + ul: ¶ms.DowntimeNet, + }, + C.VIR_DOMAIN_JOB_SETUP_TIME: typedParamsFieldInfo{ + set: ¶ms.SetupTimeSet, + ul: ¶ms.SetupTime, + }, + C.VIR_DOMAIN_JOB_DATA_TOTAL: typedParamsFieldInfo{ + set: ¶ms.DataTotalSet, + ul: ¶ms.DataTotal, + }, + C.VIR_DOMAIN_JOB_DATA_PROCESSED: typedParamsFieldInfo{ + set: ¶ms.DataProcessedSet, + ul: ¶ms.DataProcessed, + }, + C.VIR_DOMAIN_JOB_DATA_REMAINING: typedParamsFieldInfo{ + set: ¶ms.DataRemainingSet, + ul: ¶ms.DataRemaining, + }, + C.VIR_DOMAIN_JOB_MEMORY_TOTAL: typedParamsFieldInfo{ + set: ¶ms.MemTotalSet, + ul: ¶ms.MemTotal, + }, + C.VIR_DOMAIN_JOB_MEMORY_PROCESSED: typedParamsFieldInfo{ + set: ¶ms.MemProcessedSet, + ul: ¶ms.MemProcessed, + }, + C.VIR_DOMAIN_JOB_MEMORY_REMAINING: typedParamsFieldInfo{ + set: ¶ms.MemRemainingSet, + ul: ¶ms.MemRemaining, + }, + C.VIR_DOMAIN_JOB_MEMORY_CONSTANT: typedParamsFieldInfo{ + set: ¶ms.MemConstantSet, + ul: ¶ms.MemConstant, + }, + C.VIR_DOMAIN_JOB_MEMORY_NORMAL: typedParamsFieldInfo{ + set: ¶ms.MemNormalSet, + ul: ¶ms.MemNormal, + }, + C.VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES: typedParamsFieldInfo{ + set: ¶ms.MemNormalBytesSet, + ul: ¶ms.MemNormalBytes, + }, + C.VIR_DOMAIN_JOB_MEMORY_BPS: typedParamsFieldInfo{ + set: ¶ms.MemBpsSet, + ul: ¶ms.MemBps, + }, + C.VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE: typedParamsFieldInfo{ + set: ¶ms.MemDirtyRateSet, + ul: ¶ms.MemDirtyRate, + }, + C.VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE: typedParamsFieldInfo{ + set: ¶ms.MemPageSizeSet, + ul: ¶ms.MemPageSize, + }, + C.VIR_DOMAIN_JOB_MEMORY_ITERATION: typedParamsFieldInfo{ + set: ¶ms.MemIterationSet, + ul: ¶ms.MemIteration, + }, + C.VIR_DOMAIN_JOB_DISK_TOTAL: typedParamsFieldInfo{ + set: ¶ms.DiskTotalSet, + ul: ¶ms.DiskTotal, + }, + C.VIR_DOMAIN_JOB_DISK_PROCESSED: typedParamsFieldInfo{ + set: ¶ms.DiskProcessedSet, + ul: ¶ms.DiskProcessed, + }, + C.VIR_DOMAIN_JOB_DISK_REMAINING: typedParamsFieldInfo{ + set: ¶ms.DiskRemainingSet, + ul: ¶ms.DiskRemaining, + }, + C.VIR_DOMAIN_JOB_DISK_BPS: typedParamsFieldInfo{ + set: ¶ms.DiskBpsSet, + ul: ¶ms.DiskBps, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_CACHE: typedParamsFieldInfo{ + set: ¶ms.CompressionCacheSet, + ul: ¶ms.CompressionCache, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_BYTES: typedParamsFieldInfo{ + set: ¶ms.CompressionBytesSet, + ul: ¶ms.CompressionBytes, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_PAGES: typedParamsFieldInfo{ + set: ¶ms.CompressionPagesSet, + ul: ¶ms.CompressionPages, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES: typedParamsFieldInfo{ + set: ¶ms.CompressionCacheMissesSet, + ul: ¶ms.CompressionCacheMisses, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW: typedParamsFieldInfo{ + set: ¶ms.CompressionOverflowSet, + ul: ¶ms.CompressionOverflow, + }, + C.VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE: typedParamsFieldInfo{ + set: ¶ms.AutoConvergeThrottleSet, + i: ¶ms.AutoConvergeThrottle, + }, + C.VIR_DOMAIN_JOB_OPERATION: typedParamsFieldInfo{ + set: ¶ms.OperationSet, + i: (*int)(¶ms.Operation), + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats +func (d *Domain) GetJobStats(flags DomainGetJobStatsFlags) (*DomainJobInfo, error) { + var cparams *C.virTypedParameter + var nparams C.int + var jobtype C.int + var err C.virError + ret := C.virDomainGetJobStatsWrapper(d.ptr, &jobtype, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + defer C.virTypedParamsFree(cparams, nparams) + + params := DomainJobInfo{} + info := getDomainJobInfoFieldInfo(¶ms) + + _, gerr := typedParamsUnpackLen(cparams, int(nparams), info) + if gerr != nil { + return nil, gerr + } + + return ¶ms, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxMemory +func (d *Domain) GetMaxMemory() (uint64, error) { + var err C.virError + ret := C.virDomainGetMaxMemoryWrapper(d.ptr, &err) + if ret == 0 { + return 0, makeError(&err) + } + + return uint64(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxVcpus +func (d *Domain) GetMaxVcpus() (uint, error) { + var err C.virError + ret := C.virDomainGetMaxVcpusWrapper(d.ptr, &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetOSType +func (d *Domain) GetOSType() (string, error) { + var err C.virError + ret := C.virDomainGetOSTypeWrapper(d.ptr, &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +type DomainMemoryParameters struct { + HardLimitSet bool + HardLimit uint64 + SoftLimitSet bool + SoftLimit uint64 + MinGuaranteeSet bool + MinGuarantee uint64 + SwapHardLimitSet bool + SwapHardLimit uint64 +} + +func getDomainMemoryParametersFieldInfo(params *DomainMemoryParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_MEMORY_HARD_LIMIT: typedParamsFieldInfo{ + set: ¶ms.HardLimitSet, + ul: ¶ms.HardLimit, + }, + C.VIR_DOMAIN_MEMORY_SOFT_LIMIT: typedParamsFieldInfo{ + set: ¶ms.SoftLimitSet, + ul: ¶ms.SoftLimit, + }, + C.VIR_DOMAIN_MEMORY_MIN_GUARANTEE: typedParamsFieldInfo{ + set: ¶ms.MinGuaranteeSet, + ul: ¶ms.MinGuarantee, + }, + C.VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT: typedParamsFieldInfo{ + set: ¶ms.SwapHardLimitSet, + ul: ¶ms.SwapHardLimit, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMemoryParameters +func (d *Domain) GetMemoryParameters(flags DomainModificationImpact) (*DomainMemoryParameters, error) { + params := &DomainMemoryParameters{} + info := getDomainMemoryParametersFieldInfo(params) + + var nparams C.int + var err C.virError + ret := C.virDomainGetMemoryParametersWrapper(d.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetMemoryParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryParameters +func (d *Domain) SetMemoryParameters(params *DomainMemoryParameters, flags DomainModificationImpact) error { + info := getDomainMemoryParametersFieldInfo(params) + + var nparams C.int + + var err C.virError + ret := C.virDomainGetMemoryParametersWrapper(d.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetMemoryParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetMemoryParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +type DomainNumaParameters struct { + NodesetSet bool + Nodeset string + ModeSet bool + Mode DomainNumatuneMemMode +} + +func getDomainNumaParametersFieldInfo(params *DomainNumaParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_NUMA_NODESET: typedParamsFieldInfo{ + set: ¶ms.NodesetSet, + s: ¶ms.Nodeset, + }, + C.VIR_DOMAIN_NUMA_MODE: typedParamsFieldInfo{ + set: ¶ms.ModeSet, + i: (*int)(¶ms.Mode), + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetNumaParameters +func (d *Domain) GetNumaParameters(flags DomainModificationImpact) (*DomainNumaParameters, error) { + params := &DomainNumaParameters{} + info := getDomainNumaParametersFieldInfo(params) + + var nparams C.int + var err C.virError + ret := C.virDomainGetNumaParametersWrapper(d.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetNumaParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetNumaParameters +func (d *Domain) SetNumaParameters(params *DomainNumaParameters, flags DomainModificationImpact) error { + info := getDomainNumaParametersFieldInfo(params) + + var nparams C.int + + var err C.virError + ret := C.virDomainGetNumaParametersWrapper(d.ptr, nil, &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + cparams := make([]C.virTypedParameter, nparams) + ret = C.virDomainGetNumaParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetNumaParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +type DomainPerfEvents struct { + CmtSet bool + Cmt bool + MbmtSet bool + Mbmt bool + MbmlSet bool + Mbml bool + CacheMissesSet bool + CacheMisses bool + CacheReferencesSet bool + CacheReferences bool + InstructionsSet bool + Instructions bool + CpuCyclesSet bool + CpuCycles bool + BranchInstructionsSet bool + BranchInstructions bool + BranchMissesSet bool + BranchMisses bool + BusCyclesSet bool + BusCycles bool + StalledCyclesFrontendSet bool + StalledCyclesFrontend bool + StalledCyclesBackendSet bool + StalledCyclesBackend bool + RefCpuCyclesSet bool + RefCpuCycles bool + CpuClockSet bool + CpuClock bool + TaskClockSet bool + TaskClock bool + PageFaultsSet bool + PageFaults bool + ContextSwitchesSet bool + ContextSwitches bool + CpuMigrationsSet bool + CpuMigrations bool + PageFaultsMinSet bool + PageFaultsMin bool + PageFaultsMajSet bool + PageFaultsMaj bool + AlignmentFaultsSet bool + AlignmentFaults bool + EmulationFaultsSet bool + EmulationFaults bool +} + +/* Remember to also update DomainStatsPerf in connect.go when adding to the stuct above */ + +func getDomainPerfEventsFieldInfo(params *DomainPerfEvents) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_PERF_PARAM_CMT: typedParamsFieldInfo{ + set: ¶ms.CmtSet, + b: ¶ms.Cmt, + }, + C.VIR_PERF_PARAM_MBMT: typedParamsFieldInfo{ + set: ¶ms.MbmtSet, + b: ¶ms.Mbmt, + }, + C.VIR_PERF_PARAM_MBML: typedParamsFieldInfo{ + set: ¶ms.MbmlSet, + b: ¶ms.Mbml, + }, + C.VIR_PERF_PARAM_CACHE_MISSES: typedParamsFieldInfo{ + set: ¶ms.CacheMissesSet, + b: ¶ms.CacheMisses, + }, + C.VIR_PERF_PARAM_CACHE_REFERENCES: typedParamsFieldInfo{ + set: ¶ms.CacheReferencesSet, + b: ¶ms.CacheReferences, + }, + C.VIR_PERF_PARAM_INSTRUCTIONS: typedParamsFieldInfo{ + set: ¶ms.InstructionsSet, + b: ¶ms.Instructions, + }, + C.VIR_PERF_PARAM_CPU_CYCLES: typedParamsFieldInfo{ + set: ¶ms.CpuCyclesSet, + b: ¶ms.CpuCycles, + }, + C.VIR_PERF_PARAM_BRANCH_INSTRUCTIONS: typedParamsFieldInfo{ + set: ¶ms.BranchInstructionsSet, + b: ¶ms.BranchInstructions, + }, + C.VIR_PERF_PARAM_BRANCH_MISSES: typedParamsFieldInfo{ + set: ¶ms.BranchMissesSet, + b: ¶ms.BranchMisses, + }, + C.VIR_PERF_PARAM_BUS_CYCLES: typedParamsFieldInfo{ + set: ¶ms.BusCyclesSet, + b: ¶ms.BusCycles, + }, + C.VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND: typedParamsFieldInfo{ + set: ¶ms.StalledCyclesFrontendSet, + b: ¶ms.StalledCyclesFrontend, + }, + C.VIR_PERF_PARAM_STALLED_CYCLES_BACKEND: typedParamsFieldInfo{ + set: ¶ms.StalledCyclesBackendSet, + b: ¶ms.StalledCyclesBackend, + }, + C.VIR_PERF_PARAM_REF_CPU_CYCLES: typedParamsFieldInfo{ + set: ¶ms.RefCpuCyclesSet, + b: ¶ms.RefCpuCycles, + }, + C.VIR_PERF_PARAM_CPU_CLOCK: typedParamsFieldInfo{ + set: ¶ms.CpuClockSet, + b: ¶ms.CpuClock, + }, + C.VIR_PERF_PARAM_TASK_CLOCK: typedParamsFieldInfo{ + set: ¶ms.TaskClockSet, + b: ¶ms.TaskClock, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS: typedParamsFieldInfo{ + set: ¶ms.PageFaultsSet, + b: ¶ms.PageFaults, + }, + C.VIR_PERF_PARAM_CONTEXT_SWITCHES: typedParamsFieldInfo{ + set: ¶ms.ContextSwitchesSet, + b: ¶ms.ContextSwitches, + }, + C.VIR_PERF_PARAM_CPU_MIGRATIONS: typedParamsFieldInfo{ + set: ¶ms.CpuMigrationsSet, + b: ¶ms.CpuMigrations, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS_MIN: typedParamsFieldInfo{ + set: ¶ms.PageFaultsMinSet, + b: ¶ms.PageFaultsMin, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS_MAJ: typedParamsFieldInfo{ + set: ¶ms.PageFaultsMajSet, + b: ¶ms.PageFaultsMaj, + }, + C.VIR_PERF_PARAM_ALIGNMENT_FAULTS: typedParamsFieldInfo{ + set: ¶ms.AlignmentFaultsSet, + b: ¶ms.AlignmentFaults, + }, + C.VIR_PERF_PARAM_EMULATION_FAULTS: typedParamsFieldInfo{ + set: ¶ms.EmulationFaultsSet, + b: ¶ms.EmulationFaults, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetPerfEvents +func (d *Domain) GetPerfEvents(flags DomainModificationImpact) (*DomainPerfEvents, error) { + if C.LIBVIR_VERSION_NUMBER < 1003003 { + return nil, makeNotImplementedError("virDomainGetPerfEvents") + } + + params := &DomainPerfEvents{} + info := getDomainPerfEventsFieldInfo(params) + + var cparams *C.virTypedParameter + var nparams C.int + var err C.virError + ret := C.virDomainGetPerfEventsWrapper(d.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFree(cparams, nparams) + + _, gerr := typedParamsUnpackLen(cparams, int(nparams), info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetPerfEvents +func (d *Domain) SetPerfEvents(params *DomainPerfEvents, flags DomainModificationImpact) error { + if C.LIBVIR_VERSION_NUMBER < 1003003 { + return makeNotImplementedError("virDomainSetPerfEvents") + } + + info := getDomainPerfEventsFieldInfo(params) + + var cparams *C.virTypedParameter + var nparams C.int + var err C.virError + ret := C.virDomainGetPerfEventsWrapper(d.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &nparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + defer C.virTypedParamsFree(cparams, nparams) + + gerr := typedParamsPackLen(cparams, int(nparams), info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetPerfEventsWrapper(d.ptr, cparams, nparams, C.uint(flags), &err) + + return nil +} + +type DomainSchedulerParameters struct { + Type string + CpuSharesSet bool + CpuShares uint64 + GlobalPeriodSet bool + GlobalPeriod uint64 + GlobalQuotaSet bool + GlobalQuota int64 + VcpuPeriodSet bool + VcpuPeriod uint64 + VcpuQuotaSet bool + VcpuQuota int64 + EmulatorPeriodSet bool + EmulatorPeriod uint64 + EmulatorQuotaSet bool + EmulatorQuota int64 + IothreadPeriodSet bool + IothreadPeriod uint64 + IothreadQuotaSet bool + IothreadQuota int64 + WeightSet bool + Weight uint + CapSet bool + Cap uint + ReservationSet bool + Reservation int64 + LimitSet bool + Limit int64 + SharesSet bool + Shares int +} + +func getDomainSchedulerParametersFieldInfo(params *DomainSchedulerParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_SCHEDULER_CPU_SHARES: typedParamsFieldInfo{ + set: ¶ms.CpuSharesSet, + ul: ¶ms.CpuShares, + }, + C.VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD: typedParamsFieldInfo{ + set: ¶ms.GlobalPeriodSet, + ul: ¶ms.GlobalPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA: typedParamsFieldInfo{ + set: ¶ms.GlobalQuotaSet, + l: ¶ms.GlobalQuota, + }, + C.VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD: typedParamsFieldInfo{ + set: ¶ms.EmulatorPeriodSet, + ul: ¶ms.EmulatorPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA: typedParamsFieldInfo{ + set: ¶ms.EmulatorQuotaSet, + l: ¶ms.EmulatorQuota, + }, + C.VIR_DOMAIN_SCHEDULER_VCPU_PERIOD: typedParamsFieldInfo{ + set: ¶ms.VcpuPeriodSet, + ul: ¶ms.VcpuPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_VCPU_QUOTA: typedParamsFieldInfo{ + set: ¶ms.VcpuQuotaSet, + l: ¶ms.VcpuQuota, + }, + C.VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD: typedParamsFieldInfo{ + set: ¶ms.IothreadPeriodSet, + ul: ¶ms.IothreadPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA: typedParamsFieldInfo{ + set: ¶ms.IothreadQuotaSet, + l: ¶ms.IothreadQuota, + }, + C.VIR_DOMAIN_SCHEDULER_WEIGHT: typedParamsFieldInfo{ + set: ¶ms.WeightSet, + ui: ¶ms.Weight, + }, + C.VIR_DOMAIN_SCHEDULER_CAP: typedParamsFieldInfo{ + set: ¶ms.CapSet, + ui: ¶ms.Cap, + }, + C.VIR_DOMAIN_SCHEDULER_RESERVATION: typedParamsFieldInfo{ + set: ¶ms.ReservationSet, + l: ¶ms.Reservation, + }, + C.VIR_DOMAIN_SCHEDULER_LIMIT: typedParamsFieldInfo{ + set: ¶ms.LimitSet, + l: ¶ms.Limit, + }, + C.VIR_DOMAIN_SCHEDULER_SHARES: typedParamsFieldInfo{ + set: ¶ms.SharesSet, + i: ¶ms.Shares, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParameters +func (d *Domain) GetSchedulerParameters() (*DomainSchedulerParameters, error) { + params := &DomainSchedulerParameters{} + info := getDomainSchedulerParametersFieldInfo(params) + + var nparams C.int + var err C.virError + schedtype := C.virDomainGetSchedulerTypeWrapper(d.ptr, &nparams, &err) + if schedtype == nil { + return nil, makeError(&err) + } + + defer C.free(unsafe.Pointer(schedtype)) + if nparams == 0 { + return &DomainSchedulerParameters{ + Type: C.GoString(schedtype), + }, nil + } + + cparams := make([]C.virTypedParameter, nparams) + ret := C.virDomainGetSchedulerParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, &err) + if ret == -1 { + return nil, makeError(&err) + } + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParametersFlags +func (d *Domain) GetSchedulerParametersFlags(flags DomainModificationImpact) (*DomainSchedulerParameters, error) { + params := &DomainSchedulerParameters{} + info := getDomainSchedulerParametersFieldInfo(params) + + var nparams C.int + var err C.virError + schedtype := C.virDomainGetSchedulerTypeWrapper(d.ptr, &nparams, &err) + if schedtype == nil { + return nil, makeError(&err) + } + + defer C.free(unsafe.Pointer(schedtype)) + if nparams == 0 { + return &DomainSchedulerParameters{ + Type: C.GoString(schedtype), + }, nil + } + + cparams := make([]C.virTypedParameter, nparams) + ret := C.virDomainGetSchedulerParametersFlagsWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + _, gerr := typedParamsUnpack(cparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParameters +func (d *Domain) SetSchedulerParameters(params *DomainSchedulerParameters) error { + info := getDomainSchedulerParametersFieldInfo(params) + + var nparams C.int + var err C.virError + schedtype := C.virDomainGetSchedulerTypeWrapper(d.ptr, &nparams, &err) + if schedtype == nil { + return makeError(&err) + } + + defer C.free(unsafe.Pointer(schedtype)) + if nparams == 0 { + return nil + } + + cparams := make([]C.virTypedParameter, nparams) + ret := C.virDomainGetSchedulerParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, &err) + if ret == -1 { + return makeError(&err) + } + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetSchedulerParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, &err) + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParametersFlags +func (d *Domain) SetSchedulerParametersFlags(params *DomainSchedulerParameters, flags DomainModificationImpact) error { + info := getDomainSchedulerParametersFieldInfo(params) + + var nparams C.int + var err C.virError + schedtype := C.virDomainGetSchedulerTypeWrapper(d.ptr, &nparams, &err) + if schedtype == nil { + return makeError(&err) + } + + defer C.free(unsafe.Pointer(schedtype)) + if nparams == 0 { + return nil + } + + cparams := make([]C.virTypedParameter, nparams) + ret := C.virDomainGetSchedulerParametersFlagsWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), &nparams, 0, &err) + if ret == -1 { + return makeError(&err) + } + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams) + + gerr := typedParamsPack(cparams, info) + if gerr != nil { + return gerr + } + + ret = C.virDomainSetSchedulerParametersFlagsWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err) + + return nil +} + +type SecurityLabel struct { + Label string + Enforcing bool +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabel +func (d *Domain) GetSecurityLabel() (*SecurityLabel, error) { + var clabel C.virSecurityLabel + + var err C.virError + ret := C.virDomainGetSecurityLabelWrapper(d.ptr, &clabel, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &SecurityLabel{ + Label: C.GoString((*C.char)(unsafe.Pointer(&clabel.label))), + Enforcing: clabel.enforcing == 1, + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabelList +func (d *Domain) GetSecurityLabelList() ([]SecurityLabel, error) { + var clabels *C.virSecurityLabel + + var err C.virError + ret := C.virDomainGetSecurityLabelListWrapper(d.ptr, (*C.virSecurityLabelPtr)(unsafe.Pointer(&clabels)), &err) + if ret == -1 { + return []SecurityLabel{}, makeError(&err) + } + + labels := make([]SecurityLabel, ret) + for i := 0; i < int(ret); i++ { + var clabel *C.virSecurityLabel + clabel = (*C.virSecurityLabel)(unsafe.Pointer(uintptr(unsafe.Pointer(clabels)) + (unsafe.Sizeof(*clabel) * uintptr(i)))) + labels[i] = SecurityLabel{ + Label: C.GoString((*C.char)(unsafe.Pointer(&clabel.label))), + Enforcing: clabel.enforcing == 1, + } + } + + return labels, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetTime +func (d *Domain) GetTime(flags uint32) (int64, uint, error) { + if C.LIBVIR_VERSION_NUMBER < 1002005 { + return 0, 0, makeNotImplementedError("virDomainGetTime") + } + var secs C.longlong + var nsecs C.uint + var err C.virError + ret := C.virDomainGetTimeWrapper(d.ptr, &secs, &nsecs, C.uint(flags), &err) + if ret == -1 { + return 0, 0, makeError(&err) + } + + return int64(secs), uint(nsecs), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetTime +func (d *Domain) SetTime(secs int64, nsecs uint, flags DomainSetTimeFlags) error { + if C.LIBVIR_VERSION_NUMBER < 1002005 { + return makeNotImplementedError("virDomainSetTime") + } + + var err C.virError + ret := C.virDomainSetTimeWrapper(d.ptr, C.longlong(secs), C.uint(nsecs), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetUserPassword +func (d *Domain) SetUserPassword(user string, password string, flags DomainSetUserPasswordFlags) error { + if C.LIBVIR_VERSION_NUMBER < 1002015 { + return makeNotImplementedError("virDomainSetUserPassword") + } + cuser := C.CString(user) + cpassword := C.CString(password) + + defer C.free(unsafe.Pointer(cuser)) + defer C.free(unsafe.Pointer(cpassword)) + + var err C.virError + ret := C.virDomainSetUserPasswordWrapper(d.ptr, cuser, cpassword, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSave +func (d *Domain) ManagedSave(flags DomainSaveRestoreFlags) error { + var err C.virError + ret := C.virDomainManagedSaveWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasManagedSaveImage +func (d *Domain) HasManagedSaveImage(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainHasManagedSaveImageWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveRemove +func (d *Domain) ManagedSaveRemove(flags uint32) error { + var err C.virError + ret := C.virDomainManagedSaveRemoveWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRename +func (d *Domain) Rename(name string, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 1002019 { + return makeNotImplementedError("virDomainRename") + } + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + var err C.virError + ret := C.virDomainRenameWrapper(d.ptr, cname, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReset +func (d *Domain) Reset(flags uint32) error { + var err C.virError + ret := C.virDomainResetWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendProcessSignal +func (d *Domain) SendProcessSignal(pid int64, signum DomainProcessSignal, flags uint32) error { + var err C.virError + ret := C.virDomainSendProcessSignalWrapper(d.ptr, C.longlong(pid), C.uint(signum), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInjectNMI +func (d *Domain) InjectNMI(flags uint32) error { + var err C.virError + ret := C.virDomainInjectNMIWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump +func (d *Domain) CoreDump(to string, flags DomainCoreDumpFlags) error { + cto := C.CString(to) + defer C.free(unsafe.Pointer(cto)) + + var err C.virError + ret := C.virDomainCoreDumpWrapper(d.ptr, cto, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDumpWithFormat +func (d *Domain) CoreDumpWithFormat(to string, format DomainCoreDumpFormat, flags DomainCoreDumpFlags) error { + if C.LIBVIR_VERSION_NUMBER < 1002003 { + makeNotImplementedError("virDomainCoreDumpWithFormat") + } + cto := C.CString(to) + defer C.free(unsafe.Pointer(cto)) + + var err C.virError + ret := C.virDomainCoreDumpWithFormatWrapper(d.ptr, cto, C.uint(format), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainHasCurrentSnapshot +func (d *Domain) HasCurrentSnapshot(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainHasCurrentSnapshotWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSFreeze +func (d *Domain) FSFreeze(mounts []string, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 1002005 { + return makeNotImplementedError("virDomainFSFreeze") + } + cmounts := make([](*C.char), len(mounts)) + + for i := 0; i < len(mounts); i++ { + cmounts[i] = C.CString(mounts[i]) + defer C.free(unsafe.Pointer(cmounts[i])) + } + + nmounts := len(mounts) + var err C.virError + ret := C.virDomainFSFreezeWrapper(d.ptr, (**C.char)(unsafe.Pointer(&cmounts[0])), C.uint(nmounts), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSThaw +func (d *Domain) FSThaw(mounts []string, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 1002005 { + return makeNotImplementedError("virDomainFSThaw") + } + cmounts := make([](*C.char), len(mounts)) + + for i := 0; i < len(mounts); i++ { + cmounts[i] = C.CString(mounts[i]) + defer C.free(unsafe.Pointer(cmounts[i])) + } + + nmounts := len(mounts) + var err C.virError + ret := C.virDomainFSThawWrapper(d.ptr, (**C.char)(unsafe.Pointer(&cmounts[0])), C.uint(nmounts), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSTrim +func (d *Domain) FSTrim(mount string, minimum uint64, flags uint32) error { + var cmount *C.char + if mount != "" { + cmount := C.CString(mount) + defer C.free(unsafe.Pointer(cmount)) + } + + var err C.virError + ret := C.virDomainFSTrimWrapper(d.ptr, cmount, C.ulonglong(minimum), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainFSInfo struct { + MountPoint string + Name string + FSType string + DevAlias []string +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetFSInfo +func (d *Domain) GetFSInfo(flags uint32) ([]DomainFSInfo, error) { + if C.LIBVIR_VERSION_NUMBER < 1002011 { + return []DomainFSInfo{}, makeNotImplementedError("virDomainGetFSInfo") + } + var cfsinfolist **C.virDomainFSInfo + + var err C.virError + ret := C.virDomainGetFSInfoWrapper(d.ptr, (**C.virDomainFSInfoPtr)(unsafe.Pointer(&cfsinfolist)), C.uint(flags), &err) + if ret == -1 { + return []DomainFSInfo{}, makeError(&err) + } + + fsinfo := make([]DomainFSInfo, int(ret)) + + for i := 0; i < int(ret); i++ { + cfsinfo := (*C.virDomainFSInfo)(*(**C.virDomainFSInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cfsinfolist)) + (unsafe.Sizeof(*cfsinfolist) * uintptr(i))))) + + aliases := make([]string, int(cfsinfo.ndevAlias)) + for j := 0; j < int(cfsinfo.ndevAlias); j++ { + calias := (*C.char)(*(**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cfsinfo.devAlias)) + (unsafe.Sizeof(*cfsinfo) * uintptr(j))))) + aliases[j] = C.GoString(calias) + } + fsinfo[i] = DomainFSInfo{ + MountPoint: C.GoString(cfsinfo.mountpoint), + Name: C.GoString(cfsinfo.name), + FSType: C.GoString(cfsinfo.fstype), + DevAlias: aliases, + } + + C.virDomainFSInfoFreeWrapper(cfsinfo) + } + C.free(unsafe.Pointer(cfsinfolist)) + + return fsinfo, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMSuspendForDuration +func (d *Domain) PMSuspendForDuration(target NodeSuspendTarget, duration uint64, flags uint32) error { + var err C.virError + ret := C.virDomainPMSuspendForDurationWrapper(d.ptr, C.uint(target), C.ulonglong(duration), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMWakeup +func (d *Domain) PMWakeup(flags uint32) error { + var err C.virError + ret := C.virDomainPMWakeupWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAddIOThread +func (d *Domain) AddIOThread(id uint, flags DomainModificationImpact) error { + if C.LIBVIR_VERSION_NUMBER < 1002015 { + return makeNotImplementedError("virDomainAddIOThread") + } + var err C.virError + ret := C.virDomainAddIOThreadWrapper(d.ptr, C.uint(id), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDelIOThread +func (d *Domain) DelIOThread(id uint, flags DomainModificationImpact) error { + if C.LIBVIR_VERSION_NUMBER < 1002015 { + return makeNotImplementedError("virDomainDelIOThread") + } + var err C.virError + ret := C.virDomainDelIOThreadWrapper(d.ptr, C.uint(id), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetEmulatorPinInfo +func (d *Domain) GetEmulatorPinInfo(flags DomainModificationImpact) ([]bool, error) { + var cnodeinfo C.virNodeInfo + var err C.virError + ret := C.virNodeGetInfoWrapper(C.virDomainGetConnect(d.ptr), &cnodeinfo, &err) + if ret == -1 { + return []bool{}, makeError(&err) + } + + ncpus := cnodeinfo.nodes * cnodeinfo.sockets * cnodeinfo.cores * cnodeinfo.threads + maplen := int((ncpus + 7) / 8) + ccpumaps := make([]C.uchar, maplen) + ret = C.virDomainGetEmulatorPinInfoWrapper(d.ptr, &ccpumaps[0], C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return []bool{}, makeError(&err) + } + + cpumaps := make([]bool, ncpus) + for i := 0; i < int(ncpus); i++ { + byte := i / 8 + bit := i % 8 + cpumaps[i] = (ccpumaps[byte] & (1 << uint(bit))) != 0 + } + + return cpumaps, nil +} + +type DomainIOThreadInfo struct { + IOThreadID uint + CpuMap []bool +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetIOThreadInfo +func (d *Domain) GetIOThreadInfo(flags DomainModificationImpact) ([]DomainIOThreadInfo, error) { + if C.LIBVIR_VERSION_NUMBER < 1002014 { + return []DomainIOThreadInfo{}, makeNotImplementedError("virDomaingetIOThreadInfo") + } + var cinfolist **C.virDomainIOThreadInfo + + var err C.virError + ret := C.virDomainGetIOThreadInfoWrapper(d.ptr, (**C.virDomainIOThreadInfoPtr)(unsafe.Pointer(&cinfolist)), C.uint(flags), &err) + if ret == -1 { + return []DomainIOThreadInfo{}, makeError(&err) + } + + info := make([]DomainIOThreadInfo, int(ret)) + + for i := 0; i < int(ret); i++ { + cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) * uintptr(i))))) + + ncpus := int(cinfo.cpumaplen * 8) + cpumap := make([]bool, ncpus) + for j := 0; j < ncpus; j++ { + byte := j / 8 + bit := j % 8 + + cpumapbyte := *(*C.uchar)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfo.cpumap)) + (unsafe.Sizeof(*cinfo.cpumap) * uintptr(byte)))) + cpumap[j] = (cpumapbyte & (1 << uint(bit))) != 0 + } + + info[i] = DomainIOThreadInfo{ + IOThreadID: uint(cinfo.iothread_id), + CpuMap: cpumap, + } + + C.virDomainIOThreadInfoFreeWrapper(cinfo) + } + C.free(unsafe.Pointer(cinfolist)) + + return info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpuPinInfo +func (d *Domain) GetVcpuPinInfo(flags DomainModificationImpact) ([][]bool, error) { + var cnodeinfo C.virNodeInfo + var err C.virError + ret := C.virNodeGetInfoWrapper(C.virDomainGetConnect(d.ptr), &cnodeinfo, &err) + if ret == -1 { + return [][]bool{}, makeError(&err) + } + + var cdominfo C.virDomainInfo + ret = C.virDomainGetInfoWrapper(d.ptr, &cdominfo, &err) + if ret == -1 { + return [][]bool{}, makeError(&err) + } + + nvcpus := int(cdominfo.nrVirtCpu) + npcpus := int(cnodeinfo.nodes * cnodeinfo.sockets * cnodeinfo.cores * cnodeinfo.threads) + maplen := ((npcpus + 7) / 8) + ccpumaps := make([]C.uchar, maplen*nvcpus) + + ret = C.virDomainGetVcpuPinInfoWrapper(d.ptr, C.int(nvcpus), &ccpumaps[0], C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return [][]bool{}, makeError(&err) + } + + cpumaps := make([][]bool, nvcpus) + for i := 0; i < nvcpus; i++ { + cpumaps[i] = make([]bool, npcpus) + for j := 0; j < npcpus; j++ { + byte := (i * maplen) + (j / 8) + bit := j % 8 + + if (ccpumaps[byte] & (1 << uint(bit))) != 0 { + cpumaps[i][j] = true + } + } + } + + return cpumaps, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinEmulator +func (d *Domain) PinEmulator(cpumap []bool, flags DomainModificationImpact) error { + + maplen := (len(cpumap) + 7) / 8 + ccpumaps := make([]C.uchar, maplen) + for i := 0; i < len(cpumap); i++ { + if cpumap[i] { + byte := i / 8 + bit := i % 8 + + ccpumaps[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + ret := C.virDomainPinEmulatorWrapper(d.ptr, &ccpumaps[0], C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinIOThread +func (d *Domain) PinIOThread(iothreadid uint, cpumap []bool, flags DomainModificationImpact) error { + if C.LIBVIR_VERSION_NUMBER < 1002014 { + return makeNotImplementedError("virDomainPinIOThread") + } + + maplen := (len(cpumap) + 7) / 8 + ccpumaps := make([]C.uchar, maplen) + for i := 0; i < len(cpumap); i++ { + if cpumap[i] { + byte := i / 8 + bit := i % 8 + + ccpumaps[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + ret := C.virDomainPinIOThreadWrapper(d.ptr, C.uint(iothreadid), &ccpumaps[0], C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenChannel +func (d *Domain) OpenChannel(name string, stream *Stream, flags DomainChannelFlags) error { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + + var err C.virError + ret := C.virDomainOpenChannelWrapper(d.ptr, cname, stream.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenConsole +func (d *Domain) OpenConsole(devname string, stream *Stream, flags DomainConsoleFlags) error { + var cdevname *C.char + if devname != "" { + cdevname = C.CString(devname) + defer C.free(unsafe.Pointer(cdevname)) + } + + var err C.virError + ret := C.virDomainOpenConsoleWrapper(d.ptr, cdevname, stream.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphics +func (d *Domain) OpenGraphics(idx uint, file os.File, flags DomainOpenGraphicsFlags) error { + var err C.virError + ret := C.virDomainOpenGraphicsWrapper(d.ptr, C.uint(idx), C.int(file.Fd()), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphicsFD +func (d *Domain) OpenGraphicsFD(idx uint, flags DomainOpenGraphicsFlags) (*os.File, error) { + if C.LIBVIR_VERSION_NUMBER < 1002008 { + return nil, makeNotImplementedError("virDomainOpenGraphicsFD") + } + var err C.virError + ret := C.virDomainOpenGraphicsFDWrapper(d.ptr, C.uint(idx), C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + return os.NewFile(uintptr(ret), "graphics"), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotCreateXML +func (d *Domain) CreateSnapshotXML(xml string, flags DomainSnapshotCreateFlags) (*DomainSnapshot, error) { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainSnapshotCreateXMLWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: result}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSave +func (d *Domain) Save(destFile string) error { + cPath := C.CString(destFile) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + result := C.virDomainSaveWrapper(d.ptr, cPath, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveFlags +func (d *Domain) SaveFlags(destFile string, destXml string, flags DomainSaveRestoreFlags) error { + cDestFile := C.CString(destFile) + cDestXml := C.CString(destXml) + defer C.free(unsafe.Pointer(cDestXml)) + defer C.free(unsafe.Pointer(cDestFile)) + var err C.virError + result := C.virDomainSaveFlagsWrapper(d.ptr, cDestFile, cDestXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +type DomainGuestVcpus struct { + Vcpus []bool + Online []bool + Offlinable []bool +} + +func getDomainGuestVcpusParametersFieldInfo(VcpusSet *bool, Vcpus *string, OnlineSet *bool, Online *string, OfflinableSet *bool, Offlinable *string) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "vcpus": typedParamsFieldInfo{ + set: VcpusSet, + s: Vcpus, + }, + "online": typedParamsFieldInfo{ + set: OnlineSet, + s: Online, + }, + "offlinable": typedParamsFieldInfo{ + set: OfflinableSet, + s: Offlinable, + }, + } +} + +func parseCPUString(cpumapstr string) ([]bool, error) { + pieces := strings.Split(cpumapstr, ",") + var cpumap []bool + for _, piece := range pieces { + if len(piece) < 1 { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + invert := false + if piece[0] == '^' { + invert = true + piece = piece[1:] + } + pair := strings.Split(piece, "-") + var start, end int + var err error + if len(pair) == 1 { + start, err = strconv.Atoi(pair[0]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + end, err = strconv.Atoi(pair[0]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + } else if len(pair) == 2 { + start, err = strconv.Atoi(pair[0]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + end, err = strconv.Atoi(pair[1]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + } else { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + if start > end { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + if (end + 1) > len(cpumap) { + newcpumap := make([]bool, end+1) + copy(newcpumap, cpumap) + cpumap = newcpumap + } + + for i := start; i <= end; i++ { + if invert { + cpumap[i] = false + } else { + cpumap[i] = true + } + } + } + + return cpumap, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetGuestVcpus +func (d *Domain) GetGuestVcpus(flags uint32) (*DomainGuestVcpus, error) { + if C.LIBVIR_VERSION_NUMBER < 2000000 { + return nil, makeNotImplementedError("virDomainGetGuestVcpus") + } + + var VcpusSet, OnlineSet, OfflinableSet bool + var VcpusStr, OnlineStr, OfflinableStr string + info := getDomainGuestVcpusParametersFieldInfo(&VcpusSet, &VcpusStr, &OnlineSet, &OnlineStr, &OfflinableSet, &OfflinableStr) + + var cparams C.virTypedParameterPtr + var nparams C.uint + var err C.virError + ret := C.virDomainGetGuestVcpusWrapper(d.ptr, &cparams, &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFree(cparams, C.int(nparams)) + + _, gerr := typedParamsUnpackLen(cparams, int(nparams), info) + if gerr != nil { + return nil, gerr + } + + return &DomainGuestVcpus{}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetGuestVcpus +func (d *Domain) SetGuestVcpus(cpus []bool, state bool, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 2000000 { + return makeNotImplementedError("virDomainSetGuestVcpus") + } + + cpumap := "" + for i := 0; i < len(cpus); i++ { + if cpus[i] { + if cpumap == "" { + cpumap = string(i) + } else { + cpumap += "," + string(i) + } + } + } + + var cstate C.int + if state { + cstate = 1 + } else { + cstate = 0 + } + ccpumap := C.CString(cpumap) + defer C.free(unsafe.Pointer(ccpumap)) + var err C.virError + ret := C.virDomainSetGuestVcpusWrapper(d.ptr, ccpumap, cstate, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpu +func (d *Domain) SetVcpu(cpus []bool, state bool, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 3001000 { + return makeNotImplementedError("virDomainSetVcpu") + } + + cpumap := "" + for i := 0; i < len(cpus); i++ { + if cpus[i] { + if cpumap == "" { + cpumap = string(i) + } else { + cpumap += "," + string(i) + } + } + } + + var cstate C.int + if state { + cstate = 1 + } else { + cstate = 0 + } + ccpumap := C.CString(cpumap) + defer C.free(unsafe.Pointer(ccpumap)) + var err C.virError + ret := C.virDomainSetVcpuWrapper(d.ptr, ccpumap, cstate, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockThreshold +func (d *Domain) SetBlockThreshold(dev string, threshold uint64, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 3002000 { + return makeNotImplementedError("virDomainSetBlockThreshold") + } + + cdev := C.CString(dev) + defer C.free(unsafe.Pointer(cdev)) + var err C.virError + ret := C.virDomainSetBlockThresholdWrapper(d.ptr, cdev, C.ulonglong(threshold), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveDefineXML +func (d *Domain) ManagedSaveDefineXML(xml string, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 3007000 { + return makeNotImplementedError("virDomainManagedSaveDefineXML") + } + + cxml := C.CString(xml) + defer C.free(unsafe.Pointer(cxml)) + var err C.virError + ret := C.virDomainManagedSaveDefineXMLWrapper(d.ptr, cxml, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveGetXMLDesc +func (d *Domain) ManagedSaveGetXMLDesc(flags uint32) (string, error) { + if C.LIBVIR_VERSION_NUMBER < 3007000 { + return "", makeNotImplementedError("virDomainManagedSaveGetXMLDesc") + } + + var err C.virError + ret := C.virDomainManagedSaveGetXMLDescWrapper(d.ptr, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + xml := C.GoString(ret) + C.free(unsafe.Pointer(ret)) + return xml, nil +} + +type DomainLifecycle int + +const ( + DOMAIN_LIFECYCLE_POWEROFF = DomainLifecycle(C.VIR_DOMAIN_LIFECYCLE_POWEROFF) + DOMAIN_LIFECYCLE_REBOOT = DomainLifecycle(C.VIR_DOMAIN_LIFECYCLE_REBOOT) + DOMAIN_LIFECYCLE_CRASH = DomainLifecycle(C.VIR_DOMAIN_LIFECYCLE_CRASH) +) + +type DomainLifecycleAction int + +const ( + DOMAIN_LIFECYCLE_ACTION_DESTROY = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY) + DOMAIN_LIFECYCLE_ACTION_RESTART = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_RESTART) + DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME) + DOMAIN_LIFECYCLE_ACTION_PRESERVE = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) + DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY) + DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART) +) + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetLifecycleAction +func (d *Domain) SetLifecycleAction(lifecycleType uint32, action uint32, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 3009000 { + return makeNotImplementedError("virDomainSetLifecycleAction") + } + + var err C.virError + ret := C.virDomainSetLifecycleActionWrapper(d.ptr, C.uint(lifecycleType), C.uint(action), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainLaunchSecurityParameters struct { + SEVMeasurementSet bool + SEVMeasurement string +} + +func getDomainLaunchSecurityFieldInfo(params *DomainLaunchSecurityParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT: typedParamsFieldInfo{ + set: ¶ms.SEVMeasurementSet, + s: ¶ms.SEVMeasurement, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetLaunchSecurityInfo +func (d *Domain) GetLaunchSecurityInfo(flags uint32) (*DomainLaunchSecurityParameters, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return nil, makeNotImplementedError("virDomainGetLaunchSecurityInfo") + } + + params := &DomainLaunchSecurityParameters{} + info := getDomainLaunchSecurityFieldInfo(params) + + var cparams *C.virTypedParameter + var nparams C.int + + var err C.virError + ret := C.virDomainGetLaunchSecurityInfoWrapper(d.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &nparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFree(cparams, nparams) + + _, gerr := typedParamsUnpackLen(cparams, int(nparams), info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/domain_compat.h b/vendor/github.com/libvirt/libvirt-go/domain_compat.h new file mode 100644 index 00000000000..d20631fc1fc --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_compat.h @@ -0,0 +1,914 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_DOMAIN_COMPAT_H__ +#define LIBVIRT_GO_DOMAIN_COMPAT_H__ + +/* 1.2.2 */ + +#ifndef VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS +#define VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS "device_read_iops_sec" +#endif + +#ifndef VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS +#define VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS "device_write_iops_sec" +#endif + +#ifndef VIR_DOMAIN_BLKIO_DEVICE_READ_BPS +#define VIR_DOMAIN_BLKIO_DEVICE_READ_BPS "device_read_bytes_sec" +#endif + +#ifndef VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS +#define VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS "device_write_bytes_sec" +#endif + + +/* 1.2.3 */ + +#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_RAW +#define VIR_DOMAIN_CORE_DUMP_FORMAT_RAW 0 +#endif + +#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB +#define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB 1 +#endif + +#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO +#define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO 2 +#endif + +#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY +#define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY 3 +#endif + +#ifndef VIR_MIGRATE_AUTO_CONVERGE +#define VIR_MIGRATE_AUTO_CONVERGE 1 << 13 +#endif + + +/* 1.2.5 */ + +#ifndef VIR_DOMAIN_REBOOT_PARAVIRT +#define VIR_DOMAIN_REBOOT_PARAVIRT 1 << 4 +#endif + +#ifndef VIR_DOMAIN_SHUTDOWN_PARAVIRT +#define VIR_DOMAIN_SHUTDOWN_PARAVIRT 1 << 4 +#endif + +#ifndef VIR_DOMAIN_TIME_SYNC +#define VIR_DOMAIN_TIME_SYNC 1 << 0 +#endif + +/* 1.2.6 */ + +#ifndef VIR_DOMAIN_BLOCK_COMMIT_ACTIVE +#define VIR_DOMAIN_BLOCK_COMMIT_ACTIVE 1 << 2 +#endif + +#ifndef VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT +#define VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT 4 +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 +#define VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 16 +#endif + + +/* 1.2.7 */ + +#ifndef VIR_DOMAIN_BLOCK_COMMIT_RELATIVE +#define VIR_DOMAIN_BLOCK_COMMIT_RELATIVE 1 << 3 +#endif + +#ifndef VIR_DOMAIN_BLOCK_REBASE_RELATIVE +#define VIR_DOMAIN_BLOCK_REBASE_RELATIVE 1 << 4 +#endif + + +/* 1.2.8 */ + +#ifndef VIR_DOMAIN_BLOCK_COPY_SHALLOW +#define VIR_DOMAIN_BLOCK_COPY_SHALLOW 1 << 0 +#endif + +#ifndef VIR_DOMAIN_BLOCK_COPY_REUSE_EXT +#define VIR_DOMAIN_BLOCK_COPY_REUSE_EXT 1 << 1 +#endif + +#ifndef VIR_DOMAIN_BLOCK_COPY_BANDWIDTH +#define VIR_DOMAIN_BLOCK_COPY_BANDWIDTH "bandwidth" +#endif + +#ifndef VIR_DOMAIN_BLOCK_COPY_GRANULARITY +#define VIR_DOMAIN_BLOCK_COPY_GRANULARITY "granularity" +#endif + +#ifndef VIR_DOMAIN_BLOCK_COPY_BUF_SIZE +#define VIR_DOMAIN_BLOCK_COPY_BUF_SIZE "buf-size" +#endif + +#ifndef VIR_DOMAIN_STATS_STATE +#define VIR_DOMAIN_STATS_STATE 1 << 0 +#endif + +/* 1.2.9 */ + +#ifndef VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES +#define VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES 1 << 4 +#endif + +#ifndef VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES +#define VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES 1 << 0 +#endif + +#ifndef VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES +#define VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES 1 << 0 +#endif + +#ifndef VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES +#define VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES 1 << 6 +#endif + +#ifndef VIR_DOMAIN_BLOCK_REBASE_COPY_DEV +#define VIR_DOMAIN_BLOCK_REBASE_COPY_DEV 1 << 5 +#endif + +#ifndef VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES +#define VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES 1 << 6 +#endif + +#ifndef VIR_DOMAIN_JOB_DISK_BPS +#define VIR_DOMAIN_JOB_DISK_BPS "disk_bps" +#endif + +#ifndef VIR_DOMAIN_JOB_MEMORY_BPS +#define VIR_DOMAIN_JOB_MEMORY_BPS "memory_bps" +#endif + +#ifndef VIR_DOMAIN_JOB_SETUP_TIME +#define VIR_DOMAIN_JOB_SETUP_TIME "setup_time" +#endif + +#ifndef VIR_DOMAIN_JOB_STATS_COMPLETED +#define VIR_DOMAIN_JOB_STATS_COMPLETED 1 << 0 +#endif + +#ifndef VIR_DOMAIN_STATS_CPU_TOTAL +#define VIR_DOMAIN_STATS_CPU_TOTAL 1 << 1 +#endif + +#ifndef VIR_DOMAIN_STATS_BALLOON +#define VIR_DOMAIN_STATS_BALLOON 1 << 2 +#endif + +#ifndef VIR_DOMAIN_STATS_VCPU +#define VIR_DOMAIN_STATS_VCPU 1 << 3 +#endif + +#ifndef VIR_DOMAIN_STATS_INTERFACE +#define VIR_DOMAIN_STATS_INTERFACE 1 << 4 +#endif + +#ifndef VIR_DOMAIN_STATS_BLOCK +#define VIR_DOMAIN_STATS_BLOCK 1 << 5 +#endif + +#ifndef VIR_DOMAIN_UNDEFINE_NVRAM +#define VIR_DOMAIN_UNDEFINE_NVRAM 1 << 2 +#endif + +#ifndef VIR_MIGRATE_RDMA_PIN_ALL +#define VIR_MIGRATE_RDMA_PIN_ALL 1 << 14 +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_TUNABLE +#define VIR_DOMAIN_EVENT_ID_TUNABLE 17 +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_DISK +#define VIR_DOMAIN_TUNABLE_BLKDEV_DISK "blkdeviotune.disk" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC "blkdeviotune.read_bytes_sec" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC "blkdeviotune.read_iops_sec" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES +#define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES "cputune.cpu_shares" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN +#define VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN "cputune.emulatorpin" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD +#define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD "cputune.emulator_period" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA +#define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA "cputune.emulator_quota" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD +#define VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD "cputune.vcpu_period" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA +#define VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA "cputune.vcpu_quota" +#endif + + + +/* 1.2.11 */ + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX +#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX "blkdeviotune.total_bytes_sec_max" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX +#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX "blkdeviotune.read_bytes_sec_max" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX +#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX "blkdeviotune.write_bytes_sec_max" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX +#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX "blkdeviotune.total_iops_sec_max" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX +#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX "blkdeviotune.read_iops_sec_max" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX +#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX "blkdeviotune.write_iops_sec_max" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC +#define VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC "blkdeviotune.size_iops_sec" +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE +#define VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE 18 +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX +#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX "total_bytes_sec_max" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX +#define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX "read_bytes_sec_max" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX +#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX "write_bytes_sec_max" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX +#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX "total_iops_sec_max" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX +#define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX "read_iops_sec_max" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX +#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX "write_iops_sec_max" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC +#define VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC "size_iops_sec" +#endif + +#if LIBVIR_VERSION_NUMBER < 1002011 +typedef struct _virDomainFSInfo virDomainFSInfo; +typedef virDomainFSInfo *virDomainFSInfoPtr; +struct _virDomainFSInfo { + char *mountpoint; /* path to mount point */ + char *name; /* device name in the guest (e.g. "sda1") */ + char *fstype; /* filesystem type */ + size_t ndevAlias; /* number of elements in devAlias */ + char **devAlias; /* array of disk device aliases */ +}; +#endif + +/* 1.2.12 */ + +#ifndef VIR_DOMAIN_DEFINE_VALIDATE +#define VIR_DOMAIN_DEFINE_VALIDATE 1 << 0 +#endif + +#ifndef VIR_DOMAIN_START_VALIDATE +#define VIR_DOMAIN_START_VALIDATE 1 << 4 +#endif + + +/* 1.2.14 */ + +#ifndef VIR_DOMAIN_CONTROL_ERROR_REASON_NONE +#define VIR_DOMAIN_CONTROL_ERROR_REASON_NONE 0 +#endif + +#ifndef VIR_DOMAIN_CONTROL_ERROR_REASON_UNKNOWN +#define VIR_DOMAIN_CONTROL_ERROR_REASON_UNKNOWN 1 +#endif + +#ifndef VIR_DOMAIN_CONTROL_ERROR_REASON_MONITOR +#define VIR_DOMAIN_CONTROL_ERROR_REASON_MONITOR 2 +#endif + +#ifndef VIR_DOMAIN_CONTROL_ERROR_REASON_INTERNAL +#define VIR_DOMAIN_CONTROL_ERROR_REASON_INTERNAL 3 +#endif + +#ifndef VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE +#define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE 0 +#endif + +#ifndef VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT +#define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT 1 +#endif + +#ifndef VIR_DOMAIN_PAUSED_STARTING_UP +#define VIR_DOMAIN_PAUSED_STARTING_UP 11 +#endif + +#if LIBVIR_VERSION_NUMBER < 1002014 +typedef struct _virDomainIOThreadInfo virDomainIOThreadInfo; +typedef virDomainIOThreadInfo *virDomainIOThreadInfoPtr; +struct _virDomainIOThreadInfo { + unsigned int iothread_id; /* IOThread ID */ + unsigned char *cpumap; /* CPU map for thread. A pointer to an */ + /* array of real CPUs (in 8-bit bytes) */ + int cpumaplen; /* cpumap size */ +}; + +typedef struct _virDomainInterfaceIPAddress virDomainIPAddress; +typedef virDomainIPAddress *virDomainIPAddressPtr; +struct _virDomainInterfaceIPAddress { + int type; /* virIPAddrType */ + char *addr; /* IP address */ + unsigned int prefix; /* IP address prefix */ +}; + +typedef struct _virDomainInterface virDomainInterface; +typedef virDomainInterface *virDomainInterfacePtr; +struct _virDomainInterface { + char *name; /* interface name */ + char *hwaddr; /* hardware address, may be NULL */ + unsigned int naddrs; /* number of items in @addrs */ + virDomainIPAddressPtr addrs; /* array of IP addresses */ +}; +#endif + + +/* 1.2.15 */ + +#ifndef VIR_DOMAIN_JOB_DOWNTIME_NET +#define VIR_DOMAIN_JOB_DOWNTIME_NET "downtime_net" +#endif + +#ifndef VIR_DOMAIN_JOB_TIME_ELAPSED_NET +#define VIR_DOMAIN_JOB_TIME_ELAPSED_NET "time_elapsed_net" +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_DEVICE_ADDED +#define VIR_DOMAIN_EVENT_ID_DEVICE_ADDED 19 +#endif + + +/* 1.2.16 */ + +#ifndef VIR_DOMAIN_PASSWORD_ENCRYPTED +#define VIR_DOMAIN_PASSWORD_ENCRYPTED 1 << 0 +#endif + + +/* 1.2.17 */ + +#ifndef VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI +#define VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI 6 +#endif + +#ifndef VIR_MIGRATE_PARAM_MIGRATE_DISKS +#define VIR_MIGRATE_PARAM_MIGRATE_DISKS "migrate_disks" +#endif + + +/* 1.2.19 */ + +#ifndef VIR_DOMAIN_BANDWIDTH_IN_FLOOR +#define VIR_DOMAIN_BANDWIDTH_IN_FLOOR "inbound.floor" +#endif + +#ifndef VIR_DOMAIN_EVENT_DEFINED_RENAMED +#define VIR_DOMAIN_EVENT_DEFINED_RENAMED 2 +#endif + +#ifndef VIR_DOMAIN_EVENT_UNDEFINED_RENAMED +#define VIR_DOMAIN_EVENT_UNDEFINED_RENAMED 1 +#endif + + +/* 1.3.1 */ + +#ifndef VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE +#define VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE "memory_dirty_rate" +#endif + +#ifndef VIR_DOMAIN_JOB_MEMORY_ITERATION +#define VIR_DOMAIN_JOB_MEMORY_ITERATION "memory_iteration" +#endif + + +/* 1.3.2 */ + +#ifndef VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION +#define VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION 20 +#endif + + +/* 1.3.3 */ + +#ifndef VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT +#define VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT 3 +#endif + +#ifndef VIR_DOMAIN_EVENT_RESUMED_POSTCOPY +#define VIR_DOMAIN_EVENT_RESUMED_POSTCOPY 3 +#endif + +#ifndef VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY +#define VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY 7 +#endif + +#ifndef VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED +#define VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED 8 +#endif + +#ifndef VIR_DOMAIN_PAUSED_POSTCOPY +#define VIR_DOMAIN_PAUSED_POSTCOPY 12 +#endif + +#ifndef VIR_DOMAIN_PAUSED_POSTCOPY_FAILED +#define VIR_DOMAIN_PAUSED_POSTCOPY_FAILED 13 +#endif + +#ifndef VIR_DOMAIN_RUNNING_POSTCOPY +#define VIR_DOMAIN_RUNNING_POSTCOPY 10 +#endif + +#ifndef VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD +#define VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD "global_period" +#endif + +#ifndef VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA +#define VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA "global_quota" +#endif + +#ifndef VIR_DOMAIN_STATS_PERF +#define VIR_DOMAIN_STATS_PERF (1 << 6) +#endif + +#ifndef VIR_MIGRATE_PARAM_DISKS_PORT +#define VIR_MIGRATE_PARAM_DISKS_PORT "disks_port" +#endif + +#ifndef VIR_PERF_PARAM_CMT +#define VIR_PERF_PARAM_CMT "cmt" +#endif + +#ifndef VIR_MIGRATE_POSTCOPY +#define VIR_MIGRATE_POSTCOPY (1 << 15) +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_JOB_COMPLETED +#define VIR_DOMAIN_EVENT_ID_JOB_COMPLETED 21 +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD +#define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD "cputune.global_period" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA +#define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA "cputune.global_quota" +#endif + +/* 1.3.4 */ + +#ifndef VIR_MIGRATE_PARAM_COMPRESSION +#define VIR_MIGRATE_PARAM_COMPRESSION "compression" +#endif + +#ifndef VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS +#define VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS "compression.mt.threads" +#endif + +#ifndef VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS +#define VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS "compression.mt.dthreads" +#endif + +#ifndef VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL +#define VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL "compression.mt.level" +#endif + +#ifndef VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE +#define VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE "compression.xbzrle.cache" +#endif + +#ifndef VIR_MIGRATE_PARAM_PERSIST_XML +#define VIR_MIGRATE_PARAM_PERSIST_XML "persistent_xml" +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED +#define VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED 22 +#endif + + +/* 1.3.5 */ + +#ifndef VIR_PERF_PARAM_MBML +#define VIR_PERF_PARAM_MBML "mbml" +#endif + +#ifndef VIR_PERF_PARAM_MBMT +#define VIR_PERF_PARAM_MBMT "mbmt" +#endif + + +/* 2.0.0 */ + +#ifndef VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE +#define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "auto_converge_throttle" +#endif + +#ifndef VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL +#define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL "auto_converge.initial" +#endif + +#ifndef VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT +#define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT "auto_converge.increment" +#endif + +/* 2.1.0 */ + +#ifndef VIR_DOMAIN_MEMORY_STAT_USABLE +#define VIR_DOMAIN_MEMORY_STAT_USABLE 8 +#endif + +#ifndef VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE +#define VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE 9 +#endif + +/* 2.2.0 */ + +#ifndef VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD +#define VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD "iothread_period" +#endif + +#ifndef VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA +#define VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA "iothread_quota" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD +#define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD "cputune.iothread_period" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA +# define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA "cputune.iothread_quota" +#endif + + +/* 2.3.0 */ + +#ifndef VIR_DOMAIN_UNDEFINE_KEEP_NVRAM +#define VIR_DOMAIN_UNDEFINE_KEEP_NVRAM (1 << 3) +#endif + +#ifndef VIR_PERF_PARAM_CACHE_MISSES +#define VIR_PERF_PARAM_CACHE_MISSES "cache_misses" +#endif + +#ifndef VIR_PERF_PARAM_CACHE_REFERENCES +#define VIR_PERF_PARAM_CACHE_REFERENCES "cache_references" +#endif + +#ifndef VIR_PERF_PARAM_INSTRUCTIONS +#define VIR_PERF_PARAM_INSTRUCTIONS "instructions" +#endif + +#ifndef VIR_PERF_PARAM_CPU_CYCLES +#define VIR_PERF_PARAM_CPU_CYCLES "cpu_cycles" +#endif + + +/* 2.4.0 */ + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH +#define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH "read_bytes_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH +#define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH "read_iops_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH +#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH "total_bytes_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH +#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH "total_iops_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH +#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH "write_bytes_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH +#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH "write_iopcs_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH +#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH "blkdeviotune.total_bytes_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH +#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH "blkdeviotune.read_bytes_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH +#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH "blkdeviotune.write_bytes_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH +#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH "blkdeviotune.total_iops_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH +#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH "blkdeviotune.read_iops_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH +#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH "blkdeviotune.write_iops_sec_max_length" +#endif + +#ifndef VIR_DOMAIN_VCPU_HOTPLUGGABLE +#define VIR_DOMAIN_VCPU_HOTPLUGGABLE (1 << 4) +#endif + +/* 3.0.0 */ + +#ifndef VIR_PERF_PARAM_BRANCH_INSTRUCTIONS +#define VIR_PERF_PARAM_BRANCH_INSTRUCTIONS "branch_instructions" +#endif + +#ifndef VIR_PERF_PARAM_BRANCH_MISSES +#define VIR_PERF_PARAM_BRANCH_MISSES "branch_misses" +#endif + +#ifndef VIR_PERF_PARAM_BUS_CYCLES +#define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles" +#endif + +#ifndef VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND +#define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend" +#endif + +#ifndef VIR_PERF_PARAM_STALLED_CYCLES_BACKEND +#define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend" +#endif + +#ifndef VIR_PERF_PARAM_REF_CPU_CYCLES +#define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles" +#endif + +#ifndef VIR_PERF_PARAM_CPU_CLOCK +#define VIR_PERF_PARAM_CPU_CLOCK "cpu_clock" +#endif + +#ifndef VIR_PERF_PARAM_TASK_CLOCK +#define VIR_PERF_PARAM_TASK_CLOCK "task_clock" +#endif + +#ifndef VIR_PERF_PARAM_PAGE_FAULTS +#define VIR_PERF_PARAM_PAGE_FAULTS "page_faults" +#endif + +#ifndef VIR_PERF_PARAM_CONTEXT_SWITCHES +#define VIR_PERF_PARAM_CONTEXT_SWITCHES "context_switches" +#endif + +#ifndef VIR_PERF_PARAM_CPU_MIGRATIONS +#define VIR_PERF_PARAM_CPU_MIGRATIONS "cpu_migrations" +#endif + +#ifndef VIR_PERF_PARAM_PAGE_FAULTS_MIN +#define VIR_PERF_PARAM_PAGE_FAULTS_MIN "page_faults_min" +#endif + +#ifndef VIR_PERF_PARAM_PAGE_FAULTS_MAJ +#define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj" +#endif + +#ifndef VIR_PERF_PARAM_ALIGNMENT_FAULTS +#define VIR_PERF_PARAM_ALIGNMENT_FAULTS "alignment_faults" +#endif + +#ifndef VIR_PERF_PARAM_EMULATION_FAULTS +#define VIR_PERF_PARAM_EMULATION_FAULTS "emulation_faults" +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_METADATA_CHANGE +#define VIR_DOMAIN_EVENT_ID_METADATA_CHANGE 23 +#endif + +#ifndef VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME +#define VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME "group_name" +#endif + +#ifndef VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME +#define VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME "blkdeviotune.group_name" +#endif + +/* 3.2.0 */ + +#ifndef VIR_MIGRATE_TLS +#define VIR_MIGRATE_TLS 1 << 16 +#endif + +#ifndef VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD +#define VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD 24 +#endif + +/* 3.3.0 */ + +#ifndef VIR_DOMAIN_JOB_OPERATION +#define VIR_DOMAIN_JOB_OPERATION "operation" +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_UNKNOWN +#define VIR_DOMAIN_JOB_OPERATION_UNKNOWN 0 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_START +#define VIR_DOMAIN_JOB_OPERATION_START 1 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_SAVE +#define VIR_DOMAIN_JOB_OPERATION_SAVE 2 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_RESTORE +#define VIR_DOMAIN_JOB_OPERATION_RESTORE 3 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN +#define VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN 4 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT +#define VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT 5 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_SNAPSHOT +#define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT 6 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT +#define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT 7 +#endif + +#ifndef VIR_DOMAIN_JOB_OPERATION_DUMP +#define VIR_DOMAIN_JOB_OPERATION_DUMP 8 +#endif + + +/* 3.4.0 */ + +#ifndef VIR_DOMAIN_EVENT_SHUTDOWN_GUEST +#define VIR_DOMAIN_EVENT_SHUTDOWN_GUEST 1 +#endif + +#ifndef VIR_DOMAIN_EVENT_SHUTDOWN_HOST +#define VIR_DOMAIN_EVENT_SHUTDOWN_HOST 2 +#endif + + +/* 3.5.0 */ + +#ifndef VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB +#define VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB 1 << 2 +#endif + + +/* 3.9.0 */ + +#ifndef VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE +#define VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE "memory_page_size" +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_POWEROFF +#define VIR_DOMAIN_LIFECYCLE_POWEROFF 0 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_REBOOT +#define VIR_DOMAIN_LIFECYCLE_REBOOT 1 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_CRASH +#define VIR_DOMAIN_LIFECYCLE_CRASH 2 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY +#define VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY 0 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_ACTION_RESTART +#define VIR_DOMAIN_LIFECYCLE_ACTION_RESTART 1 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME +#define VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME 2 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE +#define VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE 3 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY +#define VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY 4 +#endif + +#ifndef VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART +#define VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART 5 +#endif + +/* 4.2.0 */ + +#ifndef VIR_KEYCODE_SET_QNUM +#define VIR_KEYCODE_SET_QNUM 9 +#endif + +#ifndef VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP +#define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP 1 +#endif + +/* 4.5.0 */ + + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT "sev-measurement" +#endif + +/* 4.6.0 */ + +#ifndef VIR_DOMAIN_MEMORY_STAT_DISK_CACHES +#define VIR_DOMAIN_MEMORY_STAT_DISK_CACHES 10 +#endif + +#endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/domain_events.go b/vendor/github.com/libvirt/libvirt-go/domain_events.go new file mode 100644 index 00000000000..fe46c5e2483 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_events.go @@ -0,0 +1,1633 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo pkg-config: libvirt +#include "domain_events_wrapper.h" +*/ +import "C" + +type DomainEventGenericCallback func(c *Connect, d *Domain) + +type DomainEventLifecycle struct { + Event DomainEventType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type DomainEventLifecycleCallback func(c *Connect, d *Domain, event *DomainEventLifecycle) + +type DomainEventRTCChange struct { + Utcoffset int64 +} + +type DomainEventRTCChangeCallback func(c *Connect, d *Domain, event *DomainEventRTCChange) + +type DomainEventWatchdog struct { + Action DomainEventWatchdogAction +} + +type DomainEventWatchdogCallback func(c *Connect, d *Domain, event *DomainEventWatchdog) + +type DomainEventIOError struct { + SrcPath string + DevAlias string + Action DomainEventIOErrorAction +} + +type DomainEventIOErrorCallback func(c *Connect, d *Domain, event *DomainEventIOError) + +type DomainEventGraphicsAddress struct { + Family DomainEventGraphicsAddressType + Node string + Service string +} + +type DomainEventGraphicsSubjectIdentity struct { + Type string + Name string +} + +type DomainEventGraphics struct { + Phase DomainEventGraphicsPhase + Local DomainEventGraphicsAddress + Remote DomainEventGraphicsAddress + AuthScheme string + Subject []DomainEventGraphicsSubjectIdentity +} + +type DomainEventGraphicsCallback func(c *Connect, d *Domain, event *DomainEventGraphics) + +type DomainEventIOErrorReason struct { + SrcPath string + DevAlias string + Action DomainEventIOErrorAction + Reason string +} + +type DomainEventIOErrorReasonCallback func(c *Connect, d *Domain, event *DomainEventIOErrorReason) + +type DomainEventBlockJob struct { + Disk string + Type DomainBlockJobType + Status ConnectDomainEventBlockJobStatus +} + +type DomainEventBlockJobCallback func(c *Connect, d *Domain, event *DomainEventBlockJob) + +type DomainEventDiskChange struct { + OldSrcPath string + NewSrcPath string + DevAlias string + Reason ConnectDomainEventDiskChangeReason +} + +type DomainEventDiskChangeCallback func(c *Connect, d *Domain, event *DomainEventDiskChange) + +type DomainEventTrayChange struct { + DevAlias string + Reason ConnectDomainEventTrayChangeReason +} + +type DomainEventTrayChangeCallback func(c *Connect, d *Domain, event *DomainEventTrayChange) + +type DomainEventPMSuspend struct { + Reason int +} + +type DomainEventPMSuspendCallback func(c *Connect, d *Domain, event *DomainEventPMSuspend) + +type DomainEventPMWakeup struct { + Reason int +} + +type DomainEventPMWakeupCallback func(c *Connect, d *Domain, event *DomainEventPMWakeup) + +type DomainEventPMSuspendDisk struct { + Reason int +} + +type DomainEventPMSuspendDiskCallback func(c *Connect, d *Domain, event *DomainEventPMSuspendDisk) + +type DomainEventBalloonChange struct { + Actual uint64 +} + +type DomainEventBalloonChangeCallback func(c *Connect, d *Domain, event *DomainEventBalloonChange) + +type DomainEventDeviceRemoved struct { + DevAlias string +} + +type DomainEventDeviceRemovedCallback func(c *Connect, d *Domain, event *DomainEventDeviceRemoved) + +type DomainEventTunableCpuPin struct { + VcpuPinSet bool + VcpuPin [][]bool + EmulatorPinSet bool + EmulatorPin []bool + IOThreadPinSet bool + IOThreadPin [][]bool +} + +type DomainEventTunable struct { + CpuSched *DomainSchedulerParameters + CpuPin *DomainEventTunableCpuPin + BlkdevDiskSet bool + BlkdevDisk string + BlkdevTune *DomainBlockIoTuneParameters +} + +type DomainEventTunableCallback func(c *Connect, d *Domain, event *DomainEventTunable) + +type DomainEventAgentLifecycle struct { + State ConnectDomainEventAgentLifecycleState + Reason ConnectDomainEventAgentLifecycleReason +} + +type DomainEventAgentLifecycleCallback func(c *Connect, d *Domain, event *DomainEventAgentLifecycle) + +type DomainEventDeviceAdded struct { + DevAlias string +} + +type DomainEventDeviceAddedCallback func(c *Connect, d *Domain, event *DomainEventDeviceAdded) + +type DomainEventMigrationIteration struct { + Iteration int +} + +type DomainEventMigrationIterationCallback func(c *Connect, d *Domain, event *DomainEventMigrationIteration) + +type DomainEventJobCompleted struct { + Info DomainJobInfo +} + +type DomainEventJobCompletedCallback func(c *Connect, d *Domain, event *DomainEventJobCompleted) + +type DomainEventDeviceRemovalFailed struct { + DevAlias string +} + +type DomainEventDeviceRemovalFailedCallback func(c *Connect, d *Domain, event *DomainEventDeviceRemovalFailed) + +type DomainEventMetadataChange struct { + Type int + NSURI string +} + +type DomainEventMetadataChangeCallback func(c *Connect, d *Domain, event *DomainEventMetadataChange) + +type DomainEventBlockThreshold struct { + Dev string + Path string + Threshold uint64 + Excess uint64 +} + +type DomainEventBlockThresholdCallback func(c *Connect, d *Domain, event *DomainEventBlockThreshold) + +//export domainEventLifecycleCallback +func domainEventLifecycleCallback(c C.virConnectPtr, d C.virDomainPtr, + event int, detail int, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventLifecycle{ + Event: DomainEventType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) +} + +//export domainEventGenericCallback +func domainEventGenericCallback(c C.virConnectPtr, d C.virDomainPtr, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain) +} + +//export domainEventRTCChangeCallback +func domainEventRTCChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + utcoffset int64, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventRTCChange{ + Utcoffset: utcoffset, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventRTCChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventWatchdogCallback +func domainEventWatchdogCallback(c C.virConnectPtr, d C.virDomainPtr, + action int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventWatchdog{ + Action: DomainEventWatchdogAction(action), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventWatchdogCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventIOErrorCallback +func domainEventIOErrorCallback(c C.virConnectPtr, d C.virDomainPtr, + srcPath *C.char, devAlias *C.char, action int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventIOError{ + SrcPath: C.GoString(srcPath), + DevAlias: C.GoString(devAlias), + Action: DomainEventIOErrorAction(action), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventIOErrorCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventGraphicsCallback +func domainEventGraphicsCallback(c C.virConnectPtr, d C.virDomainPtr, + phase int, + local C.virDomainEventGraphicsAddressPtr, + remote C.virDomainEventGraphicsAddressPtr, + authScheme *C.char, + subject C.virDomainEventGraphicsSubjectPtr, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + subjectGo := make([]DomainEventGraphicsSubjectIdentity, 0) + nidentities := int(subject.nidentity) + identities := (*[1 << 30]C.virDomainEventGraphicsSubjectIdentity)(unsafe.Pointer(&subject.identities))[:nidentities:nidentities] + for _, identity := range identities { + subjectGo = append(subjectGo, + DomainEventGraphicsSubjectIdentity{ + Type: C.GoString(identity._type), + Name: C.GoString(identity.name), + }, + ) + } + + eventDetails := &DomainEventGraphics{ + Phase: DomainEventGraphicsPhase(phase), + Local: DomainEventGraphicsAddress{ + Family: DomainEventGraphicsAddressType(local.family), + Node: C.GoString(local.node), + Service: C.GoString(local.service), + }, + Remote: DomainEventGraphicsAddress{ + Family: DomainEventGraphicsAddressType(remote.family), + Node: C.GoString(remote.node), + Service: C.GoString(remote.service), + }, + AuthScheme: C.GoString(authScheme), + Subject: subjectGo, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventGraphicsCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventIOErrorReasonCallback +func domainEventIOErrorReasonCallback(c C.virConnectPtr, d C.virDomainPtr, + srcPath *C.char, devAlias *C.char, action int, reason *C.char, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventIOErrorReason{ + SrcPath: C.GoString(srcPath), + DevAlias: C.GoString(devAlias), + Action: DomainEventIOErrorAction(action), + Reason: C.GoString(reason), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventIOErrorReasonCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventBlockJobCallback +func domainEventBlockJobCallback(c C.virConnectPtr, d C.virDomainPtr, + disk *C.char, _type int, status int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventBlockJob{ + Disk: C.GoString(disk), + Type: DomainBlockJobType(_type), + Status: ConnectDomainEventBlockJobStatus(status), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventBlockJobCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDiskChangeCallback +func domainEventDiskChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + oldSrcPath *C.char, newSrcPath *C.char, devAlias *C.char, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDiskChange{ + OldSrcPath: C.GoString(oldSrcPath), + NewSrcPath: C.GoString(newSrcPath), + DevAlias: C.GoString(devAlias), + Reason: ConnectDomainEventDiskChangeReason(reason), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDiskChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventTrayChangeCallback +func domainEventTrayChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + devAlias *C.char, reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventTrayChange{ + DevAlias: C.GoString(devAlias), + Reason: ConnectDomainEventTrayChangeReason(reason), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventTrayChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventPMSuspendCallback +func domainEventPMSuspendCallback(c C.virConnectPtr, d C.virDomainPtr, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventPMSuspend{ + Reason: reason, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventPMSuspendCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventPMWakeupCallback +func domainEventPMWakeupCallback(c C.virConnectPtr, d C.virDomainPtr, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventPMWakeup{ + Reason: reason, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventPMWakeupCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventPMSuspendDiskCallback +func domainEventPMSuspendDiskCallback(c C.virConnectPtr, d C.virDomainPtr, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventPMSuspendDisk{ + Reason: reason, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventPMSuspendDiskCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventBalloonChangeCallback +func domainEventBalloonChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + actual uint64, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventBalloonChange{ + Actual: actual, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventBalloonChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDeviceRemovedCallback +func domainEventDeviceRemovedCallback(c C.virConnectPtr, d C.virDomainPtr, + devAlias *C.char, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDeviceRemoved{ + DevAlias: C.GoString(devAlias), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDeviceRemovedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventMetadataChangeCallback +func domainEventMetadataChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + mtype int, nsuri *C.char, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventMetadataChange{ + Type: (int)(mtype), + NSURI: C.GoString(nsuri), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventMetadataChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +func getDomainTuneSchedulerParametersFieldInfo(params *DomainSchedulerParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES: typedParamsFieldInfo{ + set: ¶ms.CpuSharesSet, + ul: ¶ms.CpuShares, + }, + C.VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD: typedParamsFieldInfo{ + set: ¶ms.GlobalPeriodSet, + ul: ¶ms.GlobalPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA: typedParamsFieldInfo{ + set: ¶ms.GlobalQuotaSet, + l: ¶ms.GlobalQuota, + }, + C.VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD: typedParamsFieldInfo{ + set: ¶ms.EmulatorPeriodSet, + ul: ¶ms.EmulatorPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA: typedParamsFieldInfo{ + set: ¶ms.EmulatorQuotaSet, + l: ¶ms.EmulatorQuota, + }, + C.VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD: typedParamsFieldInfo{ + set: ¶ms.VcpuPeriodSet, + ul: ¶ms.VcpuPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA: typedParamsFieldInfo{ + set: ¶ms.VcpuQuotaSet, + l: ¶ms.VcpuQuota, + }, + C.VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD: typedParamsFieldInfo{ + set: ¶ms.IothreadPeriodSet, + ul: ¶ms.IothreadPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA: typedParamsFieldInfo{ + set: ¶ms.IothreadQuotaSet, + l: ¶ms.IothreadQuota, + }, + } +} + +func getTuneBlockIoTuneParametersFieldInfo(params *DomainBlockIoTuneParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecSet, + ul: ¶ms.TotalBytesSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecSet, + ul: ¶ms.ReadBytesSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecSet, + ul: ¶ms.WriteBytesSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecSet, + ul: ¶ms.TotalIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecSet, + ul: ¶ms.ReadIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecSet, + ul: ¶ms.WriteIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxSet, + ul: ¶ms.TotalBytesSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxSet, + ul: ¶ms.ReadBytesSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxSet, + ul: ¶ms.WriteBytesSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxSet, + ul: ¶ms.TotalIopsSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxSet, + ul: ¶ms.ReadIopsSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxSet, + ul: ¶ms.WriteIopsSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxLengthSet, + ul: ¶ms.TotalBytesSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxLengthSet, + ul: ¶ms.ReadBytesSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxLengthSet, + ul: ¶ms.WriteBytesSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxLengthSet, + ul: ¶ms.TotalIopsSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxLengthSet, + ul: ¶ms.ReadIopsSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxLengthSet, + ul: ¶ms.WriteIopsSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.SizeIopsSecSet, + ul: ¶ms.SizeIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME: typedParamsFieldInfo{ + set: ¶ms.GroupNameSet, + s: ¶ms.GroupName, + }, + } +} + +type domainEventTunablePinTemp struct { + VcpuPinSet bool + VcpuPin []string + EmulatorPinSet bool + EmulatorPin string + IOThreadPinSet bool + IOThreadPin []string +} + +func getDomainPinTempFieldInfo(numvcpu int, numiothread int, params *domainEventTunablePinTemp) map[string]typedParamsFieldInfo { + ret := map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN: typedParamsFieldInfo{ + set: ¶ms.EmulatorPinSet, + s: ¶ms.EmulatorPin, + }, + } + for i := 0; i < numvcpu; i++ { + ret[fmt.Sprintf("cputune.vcpupin%d", i)] = typedParamsFieldInfo{ + s: ¶ms.VcpuPin[i], + } + } + for i := 0; i < numiothread; i++ { + ret[fmt.Sprintf("cputune.iothreadpin%d", i)] = typedParamsFieldInfo{ + s: ¶ms.IOThreadPin[i], + } + } + + return ret +} + +func countPinInfo(cparams C.virTypedParameterPtr, nparams C.int) (int, int) { + maxvcpus := 0 + maxiothreads := 0 + for i := 0; i < int(nparams); i++ { + var cparam *C.virTypedParameter + cparam = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + unsafe.Sizeof(*cparam)*uintptr(i))) + name := C.GoString((*C.char)(unsafe.Pointer(&cparam.field))) + + var vcpu int + _, err := fmt.Scanf(name, "cputune.vcpupin%d", &vcpu) + if err == nil { + if vcpu > maxvcpus { + maxvcpus = vcpu + } + } + + var iothread int + _, err = fmt.Scanf(name, "cputune.iothreadpin%d", &iothread) + if err == nil { + if iothread > maxiothreads { + maxiothreads = iothread + } + } + } + + return maxvcpus + 1, maxiothreads + 1 +} + +func domainEventTunableGetPin(params C.virTypedParameterPtr, nparams C.int) *DomainEventTunableCpuPin { + var pin domainEventTunablePinTemp + numvcpus, numiothreads := countPinInfo(params, nparams) + pinInfo := getDomainPinTempFieldInfo(numvcpus, numiothreads, &pin) + + num, err := typedParamsUnpackLen(params, int(nparams), pinInfo) + if num == 0 || err != nil { + return nil + } + + info := &DomainEventTunableCpuPin{} + + if pin.VcpuPinSet { + info.VcpuPinSet = true + info.VcpuPin = make([][]bool, len(pin.VcpuPin)) + + for i := 0; i < len(pin.VcpuPin); i++ { + bits, err := parseCPUString(pin.VcpuPin[i]) + if err == nil { + info.VcpuPin[i] = bits + } + } + } + + if pin.EmulatorPinSet { + bits, err := parseCPUString(pin.EmulatorPin) + if err == nil { + info.EmulatorPinSet = true + info.EmulatorPin = bits + } + } + + if pin.IOThreadPinSet { + info.IOThreadPinSet = true + info.IOThreadPin = make([][]bool, len(pin.IOThreadPin)) + + for i := 0; i < len(pin.IOThreadPin); i++ { + bits, err := parseCPUString(pin.IOThreadPin[i]) + if err == nil { + info.IOThreadPin[i] = bits + } + } + } + + return info +} + +//export domainEventTunableCallback +func domainEventTunableCallback(c C.virConnectPtr, d C.virDomainPtr, params C.virTypedParameterPtr, nparams C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventTunable{} + + pin := domainEventTunableGetPin(params, nparams) + if pin != nil { + eventDetails.CpuPin = pin + } + + var sched DomainSchedulerParameters + schedInfo := getDomainTuneSchedulerParametersFieldInfo(&sched) + + num, _ := typedParamsUnpackLen(params, int(nparams), schedInfo) + if num > 0 { + eventDetails.CpuSched = &sched + } + + blknameInfo := map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_BLKDEV_DISK: typedParamsFieldInfo{ + set: &eventDetails.BlkdevDiskSet, + s: &eventDetails.BlkdevDisk, + }, + } + typedParamsUnpackLen(params, int(nparams), blknameInfo) + + var blktune DomainBlockIoTuneParameters + blktuneInfo := getTuneBlockIoTuneParametersFieldInfo(&blktune) + + num, _ = typedParamsUnpackLen(params, int(nparams), blktuneInfo) + if num > 0 { + eventDetails.BlkdevTune = &blktune + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventTunableCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventAgentLifecycleCallback +func domainEventAgentLifecycleCallback(c C.virConnectPtr, d C.virDomainPtr, state C.int, reason C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventAgentLifecycle{ + State: ConnectDomainEventAgentLifecycleState(state), + Reason: ConnectDomainEventAgentLifecycleReason(reason), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventAgentLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDeviceAddedCallback +func domainEventDeviceAddedCallback(c C.virConnectPtr, d C.virDomainPtr, devalias *C.char, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDeviceAdded{ + DevAlias: C.GoString(devalias), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDeviceAddedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventMigrationIterationCallback +func domainEventMigrationIterationCallback(c C.virConnectPtr, d C.virDomainPtr, iteration C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventMigrationIteration{ + Iteration: int(iteration), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventMigrationIterationCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventJobCompletedCallback +func domainEventJobCompletedCallback(c C.virConnectPtr, d C.virDomainPtr, params C.virTypedParameterPtr, nparams C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventJobCompleted{} + info := getDomainJobInfoFieldInfo(&eventDetails.Info) + + typedParamsUnpackLen(params, int(nparams), info) + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventJobCompletedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDeviceRemovalFailedCallback +func domainEventDeviceRemovalFailedCallback(c C.virConnectPtr, d C.virDomainPtr, devalias *C.char, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDeviceRemovalFailed{ + DevAlias: C.GoString(devalias), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDeviceRemovalFailedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventBlockThresholdCallback +func domainEventBlockThresholdCallback(c C.virConnectPtr, d C.virDomainPtr, dev *C.char, path *C.char, threshold C.ulonglong, excess C.ulonglong, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventBlockThreshold{ + Dev: C.GoString(dev), + Path: C.GoString(path), + Threshold: uint64(threshold), + Excess: uint64(excess), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventBlockThresholdCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +func (c *Connect) DomainEventLifecycleRegister(dom *Domain, callback DomainEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventLifecycleCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_LIFECYCLE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventRebootRegister(dom *Domain, callback DomainEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventGenericCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_REBOOT, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventRTCChangeRegister(dom *Domain, callback DomainEventRTCChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventRTCChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_RTC_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventWatchdogRegister(dom *Domain, callback DomainEventWatchdogCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventWatchdogCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_WATCHDOG, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventIOErrorRegister(dom *Domain, callback DomainEventIOErrorCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventIOErrorCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_IO_ERROR, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventGraphicsRegister(dom *Domain, callback DomainEventGraphicsCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventGraphicsCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_GRAPHICS, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventIOErrorReasonRegister(dom *Domain, callback DomainEventIOErrorReasonCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventIOErrorReasonCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventControlErrorRegister(dom *Domain, callback DomainEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventGenericCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_CONTROL_ERROR, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBlockJobRegister(dom *Domain, callback DomainEventBlockJobCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBlockJobCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BLOCK_JOB, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDiskChangeRegister(dom *Domain, callback DomainEventDiskChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDiskChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DISK_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventTrayChangeRegister(dom *Domain, callback DomainEventTrayChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventTrayChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_TRAY_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventPMWakeupRegister(dom *Domain, callback DomainEventPMWakeupCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventPMWakeupCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_PMWAKEUP, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventPMSuspendRegister(dom *Domain, callback DomainEventPMSuspendCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventPMSuspendCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_PMSUSPEND, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBalloonChangeRegister(dom *Domain, callback DomainEventBalloonChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBalloonChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventPMSuspendDiskRegister(dom *Domain, callback DomainEventPMSuspendDiskCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventPMSuspendDiskCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeviceRemovedRegister(dom *Domain, callback DomainEventDeviceRemovedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDeviceRemovedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBlockJob2Register(dom *Domain, callback DomainEventBlockJobCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBlockJobCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventTunableRegister(dom *Domain, callback DomainEventTunableCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventTunableCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_TUNABLE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventAgentLifecycleRegister(dom *Domain, callback DomainEventAgentLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventAgentLifecycleCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeviceAddedRegister(dom *Domain, callback DomainEventDeviceAddedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDeviceAddedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DEVICE_ADDED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventMigrationIterationRegister(dom *Domain, callback DomainEventMigrationIterationCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventMigrationIterationCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventJobCompletedRegister(dom *Domain, callback DomainEventJobCompletedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventJobCompletedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeviceRemovalFailedRegister(dom *Domain, callback DomainEventDeviceRemovalFailedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDeviceRemovalFailedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventMetadataChangeRegister(dom *Domain, callback DomainEventMetadataChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventMetadataChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_METADATA_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBlockThresholdRegister(dom *Domain, callback DomainEventBlockThresholdCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBlockThresholdCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyWrapper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectDomainEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e DomainEventLifecycle) String() string { + var detail, event string + switch e.Event { + case DOMAIN_EVENT_DEFINED: + event = "defined" + switch DomainEventDefinedDetailType(e.Detail) { + case DOMAIN_EVENT_DEFINED_ADDED: + detail = "added" + case DOMAIN_EVENT_DEFINED_UPDATED: + detail = "updated" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_UNDEFINED: + event = "undefined" + switch DomainEventUndefinedDetailType(e.Detail) { + case DOMAIN_EVENT_UNDEFINED_REMOVED: + detail = "removed" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_STARTED: + event = "started" + switch DomainEventStartedDetailType(e.Detail) { + case DOMAIN_EVENT_STARTED_BOOTED: + detail = "booted" + case DOMAIN_EVENT_STARTED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_STARTED_RESTORED: + detail = "restored" + case DOMAIN_EVENT_STARTED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_SUSPENDED: + event = "suspended" + switch DomainEventSuspendedDetailType(e.Detail) { + case DOMAIN_EVENT_SUSPENDED_PAUSED: + detail = "paused" + case DOMAIN_EVENT_SUSPENDED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_SUSPENDED_IOERROR: + detail = "I/O error" + case DOMAIN_EVENT_SUSPENDED_WATCHDOG: + detail = "watchdog" + case DOMAIN_EVENT_SUSPENDED_RESTORED: + detail = "restored" + case DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_RESUMED: + event = "resumed" + switch DomainEventResumedDetailType(e.Detail) { + case DOMAIN_EVENT_RESUMED_UNPAUSED: + detail = "unpaused" + case DOMAIN_EVENT_RESUMED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_STOPPED: + event = "stopped" + switch DomainEventStoppedDetailType(e.Detail) { + case DOMAIN_EVENT_STOPPED_SHUTDOWN: + detail = "shutdown" + case DOMAIN_EVENT_STOPPED_DESTROYED: + detail = "destroyed" + case DOMAIN_EVENT_STOPPED_CRASHED: + detail = "crashed" + case DOMAIN_EVENT_STOPPED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_STOPPED_SAVED: + detail = "saved" + case DOMAIN_EVENT_STOPPED_FAILED: + detail = "failed" + case DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_SHUTDOWN: + event = "shutdown" + switch DomainEventShutdownDetailType(e.Detail) { + case DOMAIN_EVENT_SHUTDOWN_FINISHED: + detail = "finished" + default: + detail = "unknown" + } + + default: + event = "unknown" + } + + return fmt.Sprintf("Domain event=%q detail=%q", event, detail) +} + +func (e DomainEventRTCChange) String() string { + return fmt.Sprintf("RTC change offset=%d", e.Utcoffset) +} + +func (e DomainEventWatchdog) String() string { + return fmt.Sprintf("Watchdog action=%d", e.Action) +} + +func (e DomainEventIOError) String() string { + return fmt.Sprintf("I/O error path=%q alias=%q action=%d", + e.SrcPath, e.DevAlias, e.Action) +} + +func (e DomainEventGraphics) String() string { + var phase string + switch e.Phase { + case DOMAIN_EVENT_GRAPHICS_CONNECT: + phase = "connected" + case DOMAIN_EVENT_GRAPHICS_INITIALIZE: + phase = "initialized" + case DOMAIN_EVENT_GRAPHICS_DISCONNECT: + phase = "disconnected" + default: + phase = "unknown" + } + + return fmt.Sprintf("Graphics phase=%q", phase) +} + +func (e DomainEventIOErrorReason) String() string { + return fmt.Sprintf("IO error path=%q alias=%q action=%d reason=%q", + e.SrcPath, e.DevAlias, e.Action, e.Reason) +} + +func (e DomainEventBlockJob) String() string { + return fmt.Sprintf("Block job disk=%q status=%d type=%d", + e.Disk, e.Status, e.Type) +} + +func (e DomainEventDiskChange) String() string { + return fmt.Sprintf("Disk change old=%q new=%q alias=%q reason=%d", + e.OldSrcPath, e.NewSrcPath, e.DevAlias, e.Reason) +} + +func (e DomainEventTrayChange) String() string { + return fmt.Sprintf("Tray change dev=%q reason=%d", + e.DevAlias, e.Reason) +} + +func (e DomainEventBalloonChange) String() string { + return fmt.Sprintf("Ballon change %d", e.Actual) +} + +func (e DomainEventDeviceRemoved) String() string { + return fmt.Sprintf("Device %q removed ", e.DevAlias) +} diff --git a/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go b/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go new file mode 100644 index 00000000000..5d74feed650 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go @@ -0,0 +1,259 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include "domain_events_wrapper.h" +#include "callbacks_wrapper.h" +#include + +extern void domainEventLifecycleCallback(virConnectPtr, virDomainPtr, int, int, int); +void domainEventLifecycleCallbackHelper(virConnectPtr c, virDomainPtr d, + int event, int detail, void *data) +{ + domainEventLifecycleCallback(c, d, event, detail, (int)(intptr_t)data); +} + +extern void domainEventGenericCallback(virConnectPtr, virDomainPtr, int); +void domainEventGenericCallbackHelper(virConnectPtr c, virDomainPtr d, void *data) +{ + domainEventGenericCallback(c, d, (int)(intptr_t)data); +} + +extern void domainEventRTCChangeCallback(virConnectPtr, virDomainPtr, long long, int); +void domainEventRTCChangeCallbackHelper(virConnectPtr c, virDomainPtr d, + long long utcoffset, void *data) +{ + domainEventRTCChangeCallback(c, d, utcoffset, (int)(intptr_t)data); +} + +extern void domainEventWatchdogCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventWatchdogCallbackHelper(virConnectPtr c, virDomainPtr d, + int action, void *data) +{ + domainEventWatchdogCallback(c, d, action, (int)(intptr_t)data); +} + +extern void domainEventIOErrorCallback(virConnectPtr, virDomainPtr, const char *, const char *, int, int); +void domainEventIOErrorCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *srcPath, const char *devAlias, + int action, void *data) +{ + domainEventIOErrorCallback(c, d, srcPath, devAlias, action, (int)(intptr_t)data); +} + +extern void domainEventGraphicsCallback(virConnectPtr, virDomainPtr, int, const virDomainEventGraphicsAddress *, + const virDomainEventGraphicsAddress *, const char *, + const virDomainEventGraphicsSubject *, int); +void domainEventGraphicsCallbackHelper(virConnectPtr c, virDomainPtr d, + int phase, const virDomainEventGraphicsAddress *local, + const virDomainEventGraphicsAddress *remote, + const char *authScheme, + const virDomainEventGraphicsSubject *subject, void *data) +{ + domainEventGraphicsCallback(c, d, phase, local, remote, authScheme, subject, (int)(intptr_t)data); +} + +extern void domainEventIOErrorReasonCallback(virConnectPtr, virDomainPtr, const char *, const char *, + int, const char *, int); +void domainEventIOErrorReasonCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *srcPath, const char *devAlias, + int action, const char *reason, void *data) +{ + domainEventIOErrorReasonCallback(c, d, srcPath, devAlias, action, reason, (int)(intptr_t)data); +} + +extern void domainEventBlockJobCallback(virConnectPtr, virDomainPtr, const char *, int, int, int); +void domainEventBlockJobCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *disk, int type, int status, void *data) +{ + domainEventBlockJobCallback(c, d, disk, type, status, (int)(intptr_t)data); +} + +extern void domainEventDiskChangeCallback(virConnectPtr, virDomainPtr, const char *, const char *, + const char *, int, int); +void domainEventDiskChangeCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *oldSrcPath, const char *newSrcPath, + const char *devAlias, int reason, void *data) +{ + domainEventDiskChangeCallback(c, d, oldSrcPath, newSrcPath, devAlias, reason, (int)(intptr_t)data); +} + +extern void domainEventTrayChangeCallback(virConnectPtr, virDomainPtr, const char *, int, int); +void domainEventTrayChangeCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *devAlias, int reason, void *data) +{ + domainEventTrayChangeCallback(c, d, devAlias, reason, (int)(intptr_t)data); +} + +extern void domainEventPMSuspendCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventPMSuspendCallbackHelper(virConnectPtr c, virDomainPtr d, + int reason, void *data) +{ + domainEventPMSuspendCallback(c, d, reason, (int)(intptr_t)data); +} + +extern void domainEventPMWakeupCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventPMWakeupCallbackHelper(virConnectPtr c, virDomainPtr d, + int reason, void *data) +{ + domainEventPMWakeupCallback(c, d, reason, (int)(intptr_t)data); +} + +extern void domainEventPMSuspendDiskCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventPMSuspendDiskCallbackHelper(virConnectPtr c, virDomainPtr d, + int reason, void *data) +{ + domainEventPMSuspendDiskCallback(c, d, reason, (int)(intptr_t)data); +} + +extern void domainEventBalloonChangeCallback(virConnectPtr, virDomainPtr, unsigned long long, int); +void domainEventBalloonChangeCallbackHelper(virConnectPtr c, virDomainPtr d, + unsigned long long actual, void *data) +{ + domainEventBalloonChangeCallback(c, d, actual, (int)(intptr_t)data); +} + +extern void domainEventDeviceRemovedCallback(virConnectPtr, virDomainPtr, const char *, int); +void domainEventDeviceRemovedCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *devAlias, void *data) +{ + domainEventDeviceRemovedCallback(c, d, devAlias, (int)(intptr_t)data); +} + +extern void domainEventTunableCallback(virConnectPtr, virDomainPtr, virTypedParameterPtr, int, int); +void domainEventTunableCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque) +{ + domainEventTunableCallback(conn, dom, params, nparams, (int)(intptr_t)opaque); +} + +extern void domainEventAgentLifecycleCallback(virConnectPtr, virDomainPtr, int, int, int); +void domainEventAgentLifecycleCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int state, + int reason, + void *opaque) +{ + domainEventAgentLifecycleCallback(conn, dom, state, reason, (int)(intptr_t)opaque); +} + +extern void domainEventDeviceAddedCallback(virConnectPtr, virDomainPtr, const char *, int); +void domainEventDeviceAddedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque) +{ + domainEventDeviceAddedCallback(conn, dom, devAlias, (int)(intptr_t)opaque); +} + +extern void domainEventMigrationIterationCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventMigrationIterationCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int iteration, + void *opaque) +{ + domainEventMigrationIterationCallback(conn, dom, iteration, (int)(intptr_t)opaque); +} + +extern void domainEventJobCompletedCallback(virConnectPtr, virDomainPtr, virTypedParameterPtr, int, int); +void domainEventJobCompletedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque) +{ + domainEventJobCompletedCallback(conn, dom, params, nparams, (int)(intptr_t)opaque); +} + +extern void domainEventDeviceRemovalFailedCallback(virConnectPtr, virDomainPtr, const char *, int); +void domainEventDeviceRemovalFailedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque) +{ + domainEventDeviceRemovalFailedCallback(conn, dom, devAlias, (int)(intptr_t)opaque); +} + +extern void domainEventMetadataChangeCallback(virConnectPtr, virDomainPtr, int, const char *, int); +void domainEventMetadataChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int type, + const char *nsuri, + void *opaque) +{ + domainEventMetadataChangeCallback(conn, dom, type, nsuri, (int)(intptr_t)opaque); +} + +extern void domainEventBlockThresholdCallback(virConnectPtr, virDomainPtr, const char *, const char *, unsigned long long, unsigned long long, int); +void domainEventBlockThresholdCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *dev, + const char *path, + unsigned long long threshold, + unsigned long long excess, + void *opaque) +{ + domainEventBlockThresholdCallback(conn, dom, dev, path, threshold, excess, (int)(intptr_t)opaque); +} + +int +virConnectDomainEventRegisterAnyWrapper(virConnectPtr c, + virDomainPtr d, + int eventID, + virConnectDomainEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void*)goCallbackId; + int ret = virConnectDomainEventRegisterAny(c, d, eventID, cb, id, freeGoCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virConnectDomainEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = virConnectDomainEventDeregisterAny(conn, callbackID); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h b/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h new file mode 100644 index 00000000000..1670acdd655 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h @@ -0,0 +1,207 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ + +#include +#include +#include "domain_compat.h" + +void +domainEventLifecycleCallbackHelper(virConnectPtr c, + virDomainPtr d, + int event, + int detail, + void *data); + +void +domainEventGenericCallbackHelper(virConnectPtr c, + virDomainPtr d, + void *data); + +void +domainEventRTCChangeCallbackHelper(virConnectPtr c, + virDomainPtr d, + long long utcoffset, + void *data); + +void +domainEventWatchdogCallbackHelper(virConnectPtr c, + virDomainPtr d, + int action, + void *data); + +void +domainEventIOErrorCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *srcPath, + const char *devAlias, + int action, + void *data); + +void +domainEventGraphicsCallbackHelper(virConnectPtr c, + virDomainPtr d, + int phase, + const virDomainEventGraphicsAddress *local, + const virDomainEventGraphicsAddress *remote, + const char *authScheme, + const virDomainEventGraphicsSubject *subject, + void *data); + +void +domainEventIOErrorReasonCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *srcPath, + const char *devAlias, + int action, + const char *reason, + void *data); + +void +domainEventBlockJobCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *disk, + int type, + int status, + void *data); + +void +domainEventDiskChangeCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *oldSrcPath, + const char *newSrcPath, + const char *devAlias, + int reason, + void *data); + +void +domainEventTrayChangeCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *devAlias, + int reason, + void *data); + +void +domainEventPMSuspendCallbackHelper(virConnectPtr c, + virDomainPtr d, + int reason, + void *data); + +void +domainEventPMWakeupCallbackHelper(virConnectPtr c, + virDomainPtr d, + int reason, + void *data); + +void +domainEventPMSuspendDiskCallbackHelper(virConnectPtr c, + virDomainPtr d, + int reason, + void *data); + +void +domainEventBalloonChangeCallbackHelper(virConnectPtr c, + virDomainPtr d, + unsigned long long actual, + void *data); + +void +domainEventDeviceRemovedCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *devAlias, + void *data); + +void +domainEventTunableCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque); + +void +domainEventAgentLifecycleCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int state, + int reason, + void *opaque); + +void +domainEventDeviceAddedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque); + +void +domainEventMigrationIterationCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int iteration, + void *opaque); + +void +domainEventJobCompletedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque); + +void +domainEventDeviceRemovalFailedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque); + +void +domainEventMetadataChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int type, + const char *nsuri, + void *opaque); + +void +domainEventBlockThresholdCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *dev, + const char *path, + unsigned long long threshold, + unsigned long long excess, + void *opaque); + +int +virConnectDomainEventRegisterAnyWrapper(virConnectPtr c, + virDomainPtr d, + int eventID, + virConnectDomainEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); +int +virConnectDomainEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot.go b/vendor/github.com/libvirt/libvirt-go/domain_snapshot.go new file mode 100644 index 00000000000..65fbbb5c95b --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_snapshot.go @@ -0,0 +1,240 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "domain_snapshot_wrapper.h" +*/ +import "C" + +import ( + "reflect" + "unsafe" +) + +type DomainSnapshotCreateFlags int + +const ( + DOMAIN_SNAPSHOT_CREATE_REDEFINE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) + DOMAIN_SNAPSHOT_CREATE_CURRENT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT) + DOMAIN_SNAPSHOT_CREATE_NO_METADATA = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA) + DOMAIN_SNAPSHOT_CREATE_HALT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_HALT) + DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) + DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) + DOMAIN_SNAPSHOT_CREATE_QUIESCE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) + DOMAIN_SNAPSHOT_CREATE_ATOMIC = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC) + DOMAIN_SNAPSHOT_CREATE_LIVE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_LIVE) +) + +type DomainSnapshotListFlags int + +const ( + DOMAIN_SNAPSHOT_LIST_ROOTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ROOTS) + DOMAIN_SNAPSHOT_LIST_DESCENDANTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS) + DOMAIN_SNAPSHOT_LIST_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_LEAVES) + DOMAIN_SNAPSHOT_LIST_NO_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES) + DOMAIN_SNAPSHOT_LIST_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_METADATA) + DOMAIN_SNAPSHOT_LIST_NO_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA) + DOMAIN_SNAPSHOT_LIST_INACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE) + DOMAIN_SNAPSHOT_LIST_ACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE) + DOMAIN_SNAPSHOT_LIST_DISK_ONLY = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY) + DOMAIN_SNAPSHOT_LIST_INTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL) + DOMAIN_SNAPSHOT_LIST_EXTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL) +) + +type DomainSnapshotRevertFlags int + +const ( + DOMAIN_SNAPSHOT_REVERT_RUNNING = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) + DOMAIN_SNAPSHOT_REVERT_PAUSED = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED) + DOMAIN_SNAPSHOT_REVERT_FORCE = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_FORCE) +) + +type DomainSnapshotDeleteFlags int + +const ( + DOMAIN_SNAPSHOT_DELETE_CHILDREN = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) + DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY) + DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) +) + +type DomainSnapshot struct { + ptr C.virDomainSnapshotPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotFree +func (s *DomainSnapshot) Free() error { + var err C.virError + ret := C.virDomainSnapshotFreeWrapper(s.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotRef +func (c *DomainSnapshot) Ref() error { + var err C.virError + ret := C.virDomainSnapshotRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotDelete +func (s *DomainSnapshot) Delete(flags DomainSnapshotDeleteFlags) error { + var err C.virError + result := C.virDomainSnapshotDeleteWrapper(s.ptr, C.uint(flags), &err) + if result != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainRevertToSnapshot +func (s *DomainSnapshot) RevertToSnapshot(flags DomainSnapshotRevertFlags) error { + var err C.virError + result := C.virDomainRevertToSnapshotWrapper(s.ptr, C.uint(flags), &err) + if result != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotIsCurrent +func (s *DomainSnapshot) IsCurrent(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainSnapshotIsCurrentWrapper(s.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotHasMetadata +func (s *DomainSnapshot) HasMetadata(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainSnapshotHasMetadataWrapper(s.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotGetXMLDesc +func (s *DomainSnapshot) GetXMLDesc(flags DomainXMLFlags) (string, error) { + var err C.virError + result := C.virDomainSnapshotGetXMLDescWrapper(s.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotGetName +func (s *DomainSnapshot) GetName() (string, error) { + var err C.virError + name := C.virDomainSnapshotGetNameWrapper(s.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotGetParent +func (s *DomainSnapshot) GetParent(flags uint32) (*DomainSnapshot, error) { + var err C.virError + ptr := C.virDomainSnapshotGetParentWrapper(s.ptr, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotNumChildren +func (s *DomainSnapshot) NumChildren(flags DomainSnapshotListFlags) (int, error) { + var err C.virError + result := int(C.virDomainSnapshotNumChildrenWrapper(s.ptr, C.uint(flags), &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotListChildrenNames +func (s *DomainSnapshot) ListChildrenNames(flags DomainSnapshotListFlags) ([]string, error) { + const maxNames = 1024 + var names [maxNames](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNames := C.virDomainSnapshotListChildrenNamesWrapper( + s.ptr, + (**C.char)(namesPtr), + maxNames, C.uint(flags), &err) + if numNames == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNames) + for k := 0; k < int(numNames); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotListAllChildren +func (d *DomainSnapshot) ListAllChildren(flags DomainSnapshotListFlags) ([]DomainSnapshot, error) { + var cList *C.virDomainSnapshotPtr + var err C.virError + numVols := C.virDomainSnapshotListAllChildrenWrapper(d.ptr, (**C.virDomainSnapshotPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []DomainSnapshot + slice := *(*[]C.virDomainSnapshotPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, DomainSnapshot{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go b/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go new file mode 100644 index 00000000000..a061dee077e --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go @@ -0,0 +1,215 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "domain_snapshot_wrapper.h" + + +int +virDomainRevertToSnapshotWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainRevertToSnapshot(snapshot, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotDeleteWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotDelete(snapshot, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotFreeWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + int ret = virDomainSnapshotFree(snapshot); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virDomainSnapshotGetConnectWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + virConnectPtr ret = virDomainSnapshotGetConnect(snapshot); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainSnapshotGetDomainWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + virDomainPtr ret = virDomainSnapshotGetDomain(snapshot); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virDomainSnapshotGetNameWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + const char * ret = virDomainSnapshotGetName(snapshot); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainSnapshotPtr +virDomainSnapshotGetParentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = virDomainSnapshotGetParent(snapshot, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainSnapshotGetXMLDescWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainSnapshotGetXMLDesc(snapshot, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotHasMetadataWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotHasMetadata(snapshot, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotIsCurrentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotIsCurrent(snapshot, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotListAllChildrenWrapper(virDomainSnapshotPtr snapshot, + virDomainSnapshotPtr **snaps, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotListAllChildren(snapshot, snaps, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotListChildrenNamesWrapper(virDomainSnapshotPtr snapshot, + char **names, + int nameslen, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotListChildrenNames(snapshot, names, nameslen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotNumChildrenWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotNumChildren(snapshot, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotRefWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + int ret = virDomainSnapshotRef(snapshot); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h b/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h new file mode 100644 index 00000000000..fcf8036b409 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h @@ -0,0 +1,102 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_DOMAIN_SNAPSHOT_WRAPPER_H__ +#define LIBVIRT_GO_DOMAIN_SNAPSHOT_WRAPPER_H__ + +#include +#include + + +int +virDomainRevertToSnapshotWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotDeleteWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotFreeWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +virConnectPtr +virDomainSnapshotGetConnectWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +virDomainPtr +virDomainSnapshotGetDomainWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +const char * +virDomainSnapshotGetNameWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotGetParentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +char * +virDomainSnapshotGetXMLDescWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotHasMetadataWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotIsCurrentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotListAllChildrenWrapper(virDomainSnapshotPtr snapshot, + virDomainSnapshotPtr **snaps, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotListChildrenNamesWrapper(virDomainSnapshotPtr snapshot, + char **names, + int nameslen, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotNumChildrenWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotRefWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_DOMAIN_SNAPSHOT_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go b/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go new file mode 100644 index 00000000000..b42dd42f7c3 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go @@ -0,0 +1,2330 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "domain_wrapper.h" + +int +virDomainAbortJobWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainAbortJob(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainAddIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002015 + assert(0); // Caller should have checked version +#else + int ret = virDomainAddIOThread(domain, iothread_id, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainAttachDeviceWrapper(virDomainPtr domain, + const char *xml, + virErrorPtr err) +{ + int ret = virDomainAttachDevice(domain, xml); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainAttachDeviceFlagsWrapper(virDomainPtr domain, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainAttachDeviceFlags(domain, xml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockCommitWrapper(virDomainPtr dom, + const char *disk, + const char *base, + const char *top, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockCommit(dom, disk, base, top, bandwidth, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockCopyWrapper(virDomainPtr dom, + const char *disk, + const char *destxml, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002008 + assert(0); // Caller should have checked version +#else + int ret = virDomainBlockCopy(dom, disk, destxml, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainBlockJobAbortWrapper(virDomainPtr dom, + const char *disk, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockJobAbort(dom, disk, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockJobSetSpeedWrapper(virDomainPtr dom, + const char *disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockJobSetSpeed(dom, disk, bandwidth, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockPeekWrapper(virDomainPtr dom, + const char *disk, + unsigned long long offset, + size_t size, + void *buffer, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockPeek(dom, disk, offset, size, buffer, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockPullWrapper(virDomainPtr dom, + const char *disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockPull(dom, disk, bandwidth, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockRebaseWrapper(virDomainPtr dom, + const char *disk, + const char *base, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockRebase(dom, disk, base, bandwidth, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockResizeWrapper(virDomainPtr dom, + const char *disk, + unsigned long long size, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockResize(dom, disk, size, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockStatsWrapper(virDomainPtr dom, + const char *disk, + virDomainBlockStatsPtr stats, + size_t size, + virErrorPtr err) +{ + int ret = virDomainBlockStats(dom, disk, stats, size); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainBlockStatsFlagsWrapper(virDomainPtr dom, + const char *disk, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainBlockStatsFlags(dom, disk, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainCoreDumpWrapper(virDomainPtr domain, + const char *to, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainCoreDump(domain, to, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainCoreDumpWithFormatWrapper(virDomainPtr domain, + const char *to, + unsigned int dumpformat, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002003 + assert(0); // Caller should have checked version +#else + int ret = virDomainCoreDumpWithFormat(domain, to, dumpformat, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainCreateWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainCreate(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainCreateWithFilesWrapper(virDomainPtr domain, + unsigned int nfiles, + int *files, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainCreateWithFiles(domain, nfiles, files, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainCreateWithFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainCreateWithFlags(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainDelIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002015 + assert(0); // Caller should have checked version +#else + int ret = virDomainDelIOThread(domain, iothread_id, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainDestroyWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainDestroy(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainDestroyFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainDestroyFlags(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainDetachDeviceWrapper(virDomainPtr domain, + const char *xml, + virErrorPtr err) +{ + int ret = virDomainDetachDevice(domain, xml); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainDetachDeviceAliasWrapper(virDomainPtr domain, + const char *alias, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4004000 + assert(0); // Caller should have checked version +#else + int ret = virDomainDetachDeviceAlias(domain, alias, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainDetachDeviceFlagsWrapper(virDomainPtr domain, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainDetachDeviceFlags(domain, xml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainFSFreezeWrapper(virDomainPtr dom, + const char **mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002005 + assert(0); // Caller should have checked version +#else + int ret = virDomainFSFreeze(dom, mountpoints, nmountpoints, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +void +virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info) +{ +#if LIBVIR_VERSION_NUMBER < 1002011 + assert(0); // Caller should have checked version +#else + virDomainFSInfoFree(info); +#endif +} + + +int +virDomainFSThawWrapper(virDomainPtr dom, + const char **mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002005 + assert(0); // Caller should have checked version +#else + int ret = virDomainFSThaw(dom, mountpoints, nmountpoints, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainFSTrimWrapper(virDomainPtr dom, + const char *mountPoint, + unsigned long long minimum, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainFSTrim(dom, mountPoint, minimum, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainFreeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainFree(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetAutostartWrapper(virDomainPtr domain, + int *autostart, + virErrorPtr err) +{ + int ret = virDomainGetAutostart(domain, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetBlkioParameters(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetBlockInfoWrapper(virDomainPtr domain, + const char *disk, + virDomainBlockInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetBlockInfo(domain, disk, info, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetBlockIoTuneWrapper(virDomainPtr dom, + const char *disk, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetBlockIoTune(dom, disk, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetBlockJobInfoWrapper(virDomainPtr dom, + const char *disk, + virDomainBlockJobInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetBlockJobInfo(dom, disk, info, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetCPUStatsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + unsigned int nparams, + int start_cpu, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetCPUStats(domain, params, nparams, start_cpu, ncpus, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virDomainGetConnectWrapper(virDomainPtr dom, + virErrorPtr err) +{ + virConnectPtr ret = virDomainGetConnect(dom); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetControlInfoWrapper(virDomainPtr domain, + virDomainControlInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetControlInfo(domain, info, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetDiskErrorsWrapper(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetDiskErrors(dom, errors, maxerrors, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetEmulatorPinInfoWrapper(virDomainPtr domain, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetEmulatorPinInfo(domain, cpumap, maplen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetFSInfoWrapper(virDomainPtr dom, + virDomainFSInfoPtr **info, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002011 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetFSInfo(dom, info, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainGetGuestVcpusWrapper(virDomainPtr domain, + virTypedParameterPtr *params, + unsigned int *nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 2000000 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetGuestVcpus(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +char * +virDomainGetHostnameWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainGetHostname(domain, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +unsigned int +virDomainGetIDWrapper(virDomainPtr domain, + virErrorPtr err) +{ + unsigned int ret = virDomainGetID(domain); + if (ret == (unsigned int)-1) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetIOThreadInfoWrapper(virDomainPtr dom, + virDomainIOThreadInfoPtr **info, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002014 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetIOThreadInfo(dom, info, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainGetInfoWrapper(virDomainPtr domain, + virDomainInfoPtr info, + virErrorPtr err) +{ + int ret = virDomainGetInfo(domain, info); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetInterfaceParametersWrapper(virDomainPtr domain, + const char *device, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetInterfaceParameters(domain, device, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetJobInfoWrapper(virDomainPtr domain, + virDomainJobInfoPtr info, + virErrorPtr err) +{ + int ret = virDomainGetJobInfo(domain, info); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetJobStatsWrapper(virDomainPtr domain, + int *type, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetJobStats(domain, type, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetLaunchSecurityInfo(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +unsigned long +virDomainGetMaxMemoryWrapper(virDomainPtr domain, + virErrorPtr err) +{ + unsigned long ret = virDomainGetMaxMemory(domain); + if (ret == 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetMaxVcpusWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainGetMaxVcpus(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetMemoryParameters(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainGetMetadataWrapper(virDomainPtr domain, + int type, + const char *uri, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainGetMetadata(domain, type, uri, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virDomainGetNameWrapper(virDomainPtr domain, + virErrorPtr err) +{ + const char * ret = virDomainGetName(domain); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetNumaParameters(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainGetOSTypeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + char * ret = virDomainGetOSType(domain); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1003003 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetPerfEvents(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainGetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + virErrorPtr err) +{ + int ret = virDomainGetSchedulerParameters(domain, params, nparams); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetSchedulerParametersFlags(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainGetSchedulerTypeWrapper(virDomainPtr domain, + int *nparams, + virErrorPtr err) +{ + char * ret = virDomainGetSchedulerType(domain, nparams); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetSecurityLabelWrapper(virDomainPtr domain, + virSecurityLabelPtr seclabel, + virErrorPtr err) +{ + int ret = virDomainGetSecurityLabel(domain, seclabel); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetSecurityLabelListWrapper(virDomainPtr domain, + virSecurityLabelPtr *seclabels, + virErrorPtr err) +{ + int ret = virDomainGetSecurityLabelList(domain, seclabels); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetStateWrapper(virDomainPtr domain, + int *state, + int *reason, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetState(domain, state, reason, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetTimeWrapper(virDomainPtr dom, + long long *seconds, + unsigned int *nseconds, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002005 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetTime(dom, seconds, nseconds, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainGetUUIDWrapper(virDomainPtr domain, + unsigned char *uuid, + virErrorPtr err) +{ + int ret = virDomainGetUUID(domain, uuid); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetUUIDStringWrapper(virDomainPtr domain, + char *buf, + virErrorPtr err) +{ + int ret = virDomainGetUUIDString(domain, buf); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetVcpuPinInfoWrapper(virDomainPtr domain, + int ncpumaps, + unsigned char *cpumaps, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetVcpuPinInfo(domain, ncpumaps, cpumaps, maplen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetVcpusWrapper(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen, + virErrorPtr err) +{ + int ret = virDomainGetVcpus(domain, info, maxinfo, cpumaps, maplen); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainGetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainGetVcpusFlags(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainGetXMLDesc(domain, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainHasCurrentSnapshotWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainHasCurrentSnapshot(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainHasManagedSaveImageWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainHasManagedSaveImage(dom, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainInjectNMIWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainInjectNMI(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainInterfaceAddressesWrapper(virDomainPtr dom, + virDomainInterfacePtr **ifaces, + unsigned int source, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002014 + assert(0); // Caller should have checked version +#else + int ret = virDomainInterfaceAddresses(dom, ifaces, source, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +void +virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface) +{ +#if LIBVIR_VERSION_NUMBER < 1002014 + assert(0); // Caller should have checked version +#else + virDomainInterfaceFree(iface); +#endif +} + + +int +virDomainInterfaceStatsWrapper(virDomainPtr dom, + const char *device, + virDomainInterfaceStatsPtr stats, + size_t size, + virErrorPtr err) +{ + int ret = virDomainInterfaceStats(dom, device, stats, size); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +void +virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info) +{ +#if LIBVIR_VERSION_NUMBER < 1002014 + assert(0); // Caller should have checked version +#else + virDomainIOThreadInfoFree(info); +#endif +} + + +int +virDomainIsActiveWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = virDomainIsActive(dom); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainIsPersistentWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = virDomainIsPersistent(dom); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainIsUpdatedWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = virDomainIsUpdated(dom); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainListAllSnapshotsWrapper(virDomainPtr domain, + virDomainSnapshotPtr **snaps, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainListAllSnapshots(domain, snaps, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainManagedSaveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainManagedSave(dom, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain, + const char *dxml, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3007000 + assert(0); // Caller should have checked version +#else + int ret = virDomainManagedSaveDefineXML(domain, dxml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +char * +virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3007000 + assert(0); // Caller should have checked version +#else + char * ret = virDomainManagedSaveGetXMLDesc(domain, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainManagedSaveRemoveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainManagedSaveRemove(dom, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMemoryPeekWrapper(virDomainPtr dom, + unsigned long long start, + size_t size, + void *buffer, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMemoryPeek(dom, start, size, buffer, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMemoryStatsWrapper(virDomainPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMemoryStats(dom, stats, nr_stats, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainMigrateWrapper(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth, + virErrorPtr err) +{ + virDomainPtr ret = virDomainMigrate(domain, dconn, flags, dname, uri, bandwidth); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainMigrate2Wrapper(virDomainPtr domain, + virConnectPtr dconn, + const char *dxml, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth, + virErrorPtr err) +{ + virDomainPtr ret = virDomainMigrate2(domain, dconn, dxml, flags, dname, uri, bandwidth); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainMigrate3Wrapper(virDomainPtr domain, + virConnectPtr dconn, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = virDomainMigrate3(domain, dconn, params, nparams, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateGetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long *cacheSize, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMigrateGetCompressionCache(domain, cacheSize, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long *downtime, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3007000 + assert(0); // Caller should have checked version +#else + int ret = virDomainMigrateGetMaxDowntime(domain, downtime, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainMigrateGetMaxSpeedWrapper(virDomainPtr domain, + unsigned long *bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMigrateGetMaxSpeed(domain, bandwidth, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateSetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long cacheSize, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMigrateSetCompressionCache(domain, cacheSize, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateSetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long downtime, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMigrateSetMaxDowntime(domain, downtime, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateSetMaxSpeedWrapper(virDomainPtr domain, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMigrateSetMaxSpeed(domain, bandwidth, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateStartPostCopyWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1003003 + assert(0); // Caller should have checked version +#else + int ret = virDomainMigrateStartPostCopy(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainMigrateToURIWrapper(virDomainPtr domain, + const char *duri, + unsigned long flags, + const char *dname, + unsigned long bandwidth, + virErrorPtr err) +{ + int ret = virDomainMigrateToURI(domain, duri, flags, dname, bandwidth); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateToURI2Wrapper(virDomainPtr domain, + const char *dconnuri, + const char *miguri, + const char *dxml, + unsigned long flags, + const char *dname, + unsigned long bandwidth, + virErrorPtr err) +{ + int ret = virDomainMigrateToURI2(domain, dconnuri, miguri, dxml, flags, dname, bandwidth); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainMigrateToURI3Wrapper(virDomainPtr domain, + const char *dconnuri, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainMigrateToURI3(domain, dconnuri, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainOpenChannelWrapper(virDomainPtr dom, + const char *name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainOpenChannel(dom, name, st, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainOpenConsoleWrapper(virDomainPtr dom, + const char *dev_name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainOpenConsole(dom, dev_name, st, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainOpenGraphicsWrapper(virDomainPtr dom, + unsigned int idx, + int fd, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainOpenGraphics(dom, idx, fd, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainOpenGraphicsFDWrapper(virDomainPtr dom, + unsigned int idx, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002008 + assert(0); // Caller should have checked version +#else + int ret = virDomainOpenGraphicsFD(dom, idx, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainPMSuspendForDurationWrapper(virDomainPtr dom, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainPMSuspendForDuration(dom, target, duration, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainPMWakeupWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainPMWakeup(dom, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainPinEmulatorWrapper(virDomainPtr domain, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainPinEmulator(domain, cpumap, maplen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainPinIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002014 + assert(0); // Caller should have checked version +#else + int ret = virDomainPinIOThread(domain, iothread_id, cpumap, maplen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainPinVcpuWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen, + virErrorPtr err) +{ + int ret = virDomainPinVcpu(domain, vcpu, cpumap, maplen); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainPinVcpuFlagsWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainPinVcpuFlags(domain, vcpu, cpumap, maplen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainRebootWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainReboot(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainRefWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainRef(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainRenameWrapper(virDomainPtr dom, + const char *new_name, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002019 + assert(0); // Caller should have checked version +#else + int ret = virDomainRename(dom, new_name, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainResetWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainReset(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainResumeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainResume(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSaveWrapper(virDomainPtr domain, + const char *to, + virErrorPtr err) +{ + int ret = virDomainSave(domain, to); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSaveFlagsWrapper(virDomainPtr domain, + const char *to, + const char *dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSaveFlags(domain, to, dxml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virDomainScreenshotWrapper(virDomainPtr domain, + virStreamPtr stream, + unsigned int screen, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainScreenshot(domain, stream, screen, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSendKeyWrapper(virDomainPtr domain, + unsigned int codeset, + unsigned int holdtime, + unsigned int *keycodes, + int nkeycodes, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSendKey(domain, codeset, holdtime, keycodes, nkeycodes, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSendProcessSignalWrapper(virDomainPtr domain, + long long pid_value, + unsigned int signum, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSendProcessSignal(domain, pid_value, signum, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetAutostartWrapper(virDomainPtr domain, + int autostart, + virErrorPtr err) +{ + int ret = virDomainSetAutostart(domain, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetBlkioParameters(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetBlockIoTuneWrapper(virDomainPtr dom, + const char *disk, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetBlockIoTune(dom, disk, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetBlockThresholdWrapper(virDomainPtr domain, + const char *dev, + unsigned long long threshold, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3002000 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetBlockThreshold(domain, dev, threshold, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetGuestVcpusWrapper(virDomainPtr domain, + const char *cpumap, + int state, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 2000000 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetGuestVcpus(domain, cpumap, state, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetInterfaceParametersWrapper(virDomainPtr domain, + const char *device, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetInterfaceParameters(domain, device, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetLifecycleActionWrapper(virDomainPtr domain, + unsigned int type, + unsigned int action, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3009000 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetLifecycleAction(domain, type, action, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetMaxMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err) +{ + int ret = virDomainSetMaxMemory(domain, memory); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err) +{ + int ret = virDomainSetMemory(domain, memory); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetMemoryFlagsWrapper(virDomainPtr domain, + unsigned long memory, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetMemoryFlags(domain, memory, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetMemoryParameters(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetMemoryStatsPeriodWrapper(virDomainPtr domain, + int period, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetMemoryStatsPeriod(domain, period, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetMetadataWrapper(virDomainPtr domain, + int type, + const char *metadata, + const char *key, + const char *uri, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetMetadata(domain, type, metadata, key, uri, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetNumaParameters(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1003003 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetPerfEvents(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + virErrorPtr err) +{ + int ret = virDomainSetSchedulerParameters(domain, params, nparams); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetSchedulerParametersFlags(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetTimeWrapper(virDomainPtr dom, + long long seconds, + unsigned int nseconds, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002005 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetTime(dom, seconds, nseconds, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetUserPasswordWrapper(virDomainPtr dom, + const char *user, + const char *password, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002016 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetUserPassword(dom, user, password, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetVcpuWrapper(virDomainPtr domain, + const char *vcpumap, + int state, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3001000 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetVcpu(domain, vcpumap, state, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainSetVcpusWrapper(virDomainPtr domain, + unsigned int nvcpus, + virErrorPtr err) +{ + int ret = virDomainSetVcpus(domain, nvcpus); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int nvcpus, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSetVcpusFlags(domain, nvcpus, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainShutdownWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainShutdown(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainShutdownFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainShutdownFlags(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virDomainSnapshotPtr +virDomainSnapshotCreateXMLWrapper(virDomainPtr domain, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = virDomainSnapshotCreateXML(domain, xmlDesc, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainSnapshotPtr +virDomainSnapshotCurrentWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = virDomainSnapshotCurrent(domain, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotListNamesWrapper(virDomainPtr domain, + char **names, + int nameslen, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotListNames(domain, names, nameslen, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virDomainSnapshotPtr +virDomainSnapshotLookupByNameWrapper(virDomainPtr domain, + const char *name, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = virDomainSnapshotLookupByName(domain, name, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSnapshotNumWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainSnapshotNum(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainSuspendWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainSuspend(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainUndefineWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = virDomainUndefine(domain); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainUndefineFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainUndefineFlags(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainUpdateDeviceFlagsWrapper(virDomainPtr domain, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainUpdateDeviceFlags(domain, xml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h b/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h new file mode 100644 index 00000000000..7bd82826d22 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h @@ -0,0 +1,986 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_DOMAIN_WRAPPER_H__ +#define LIBVIRT_GO_DOMAIN_WRAPPER_H__ + +#include +#include +#include "domain_compat.h" + +int +virDomainAbortJobWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainAddIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err); + +int +virDomainAttachDeviceWrapper(virDomainPtr domain, + const char *xml, + virErrorPtr err); + +int +virDomainAttachDeviceFlagsWrapper(virDomainPtr domain, + const char *xml, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockCommitWrapper(virDomainPtr dom, + const char *disk, + const char *base, + const char *top, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockCopyWrapper(virDomainPtr dom, + const char *disk, + const char *destxml, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockJobAbortWrapper(virDomainPtr dom, + const char *disk, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockJobSetSpeedWrapper(virDomainPtr dom, + const char *disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockPeekWrapper(virDomainPtr dom, + const char *disk, + unsigned long long offset, + size_t size, + void *buffer, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockPullWrapper(virDomainPtr dom, + const char *disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockRebaseWrapper(virDomainPtr dom, + const char *disk, + const char *base, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockResizeWrapper(virDomainPtr dom, + const char *disk, + unsigned long long size, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockStatsWrapper(virDomainPtr dom, + const char *disk, + virDomainBlockStatsPtr stats, + size_t size, + virErrorPtr err); + +int +virDomainBlockStatsFlagsWrapper(virDomainPtr dom, + const char *disk, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainCoreDumpWrapper(virDomainPtr domain, + const char *to, + unsigned int flags, + virErrorPtr err); + +int +virDomainCoreDumpWithFormatWrapper(virDomainPtr domain, + const char *to, + unsigned int dumpformat, + unsigned int flags, + virErrorPtr err); + +int +virDomainCreateWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainCreateWithFilesWrapper(virDomainPtr domain, + unsigned int nfiles, + int *files, + unsigned int flags, + virErrorPtr err); + +int +virDomainCreateWithFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainDelIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err); + +int +virDomainDestroyWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainDestroyFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainDetachDeviceWrapper(virDomainPtr domain, + const char *xml, + virErrorPtr err); + +int +virDomainDetachDeviceAliasWrapper(virDomainPtr domain, + const char *alias, + unsigned int flags, + virErrorPtr err); + +int +virDomainDetachDeviceFlagsWrapper(virDomainPtr domain, + const char *xml, + unsigned int flags, + virErrorPtr err); + +int +virDomainFSFreezeWrapper(virDomainPtr dom, + const char **mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err); + +void +virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info); + +int +virDomainFSThawWrapper(virDomainPtr dom, + const char **mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err); + +int +virDomainFSTrimWrapper(virDomainPtr dom, + const char *mountPoint, + unsigned long long minimum, + unsigned int flags, + virErrorPtr err); + +int +virDomainFreeWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetAutostartWrapper(virDomainPtr domain, + int *autostart, + virErrorPtr err); + +int +virDomainGetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetBlockInfoWrapper(virDomainPtr domain, + const char *disk, + virDomainBlockInfoPtr info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetBlockIoTuneWrapper(virDomainPtr dom, + const char *disk, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetBlockJobInfoWrapper(virDomainPtr dom, + const char *disk, + virDomainBlockJobInfoPtr info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetCPUStatsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + unsigned int nparams, + int start_cpu, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err); + +virConnectPtr +virDomainGetConnectWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainGetControlInfoWrapper(virDomainPtr domain, + virDomainControlInfoPtr info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetDiskErrorsWrapper(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetEmulatorPinInfoWrapper(virDomainPtr domain, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetFSInfoWrapper(virDomainPtr dom, + virDomainFSInfoPtr **info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetGuestVcpusWrapper(virDomainPtr domain, + virTypedParameterPtr *params, + unsigned int *nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetHostnameWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +unsigned int +virDomainGetIDWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetIOThreadInfoWrapper(virDomainPtr dom, + virDomainIOThreadInfoPtr **info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetInfoWrapper(virDomainPtr domain, + virDomainInfoPtr info, + virErrorPtr err); + +int +virDomainGetInterfaceParametersWrapper(virDomainPtr domain, + const char *device, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetJobInfoWrapper(virDomainPtr domain, + virDomainJobInfoPtr info, + virErrorPtr err); + +int +virDomainGetJobStatsWrapper(virDomainPtr domain, + int *type, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +unsigned long +virDomainGetMaxMemoryWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetMaxVcpusWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetMetadataWrapper(virDomainPtr domain, + int type, + const char *uri, + unsigned int flags, + virErrorPtr err); + +const char * +virDomainGetNameWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetOSTypeWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + virErrorPtr err); + +int +virDomainGetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int *nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetSchedulerTypeWrapper(virDomainPtr domain, + int *nparams, + virErrorPtr err); + +int +virDomainGetSecurityLabelWrapper(virDomainPtr domain, + virSecurityLabelPtr seclabel, + virErrorPtr err); + +int +virDomainGetSecurityLabelListWrapper(virDomainPtr domain, + virSecurityLabelPtr *seclabels, + virErrorPtr err); + +int +virDomainGetStateWrapper(virDomainPtr domain, + int *state, + int *reason, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetTimeWrapper(virDomainPtr dom, + long long *seconds, + unsigned int *nseconds, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetUUIDWrapper(virDomainPtr domain, + unsigned char *uuid, + virErrorPtr err); + +int +virDomainGetUUIDStringWrapper(virDomainPtr domain, + char *buf, + virErrorPtr err); + +int +virDomainGetVcpuPinInfoWrapper(virDomainPtr domain, + int ncpumaps, + unsigned char *cpumaps, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetVcpusWrapper(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen, + virErrorPtr err); + +int +virDomainGetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainHasCurrentSnapshotWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainHasManagedSaveImageWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainInjectNMIWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainInterfaceAddressesWrapper(virDomainPtr dom, + virDomainInterfacePtr **ifaces, + unsigned int source, + unsigned int flags, + virErrorPtr err); + +void +virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface); + +int +virDomainInterfaceStatsWrapper(virDomainPtr dom, + const char *device, + virDomainInterfaceStatsPtr stats, + size_t size, + virErrorPtr err); + +void +virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info); + +int +virDomainIsActiveWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainIsPersistentWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainIsUpdatedWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainListAllSnapshotsWrapper(virDomainPtr domain, + virDomainSnapshotPtr **snaps, + unsigned int flags, + virErrorPtr err); + +int +virDomainManagedSaveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain, + const char *dxml, + unsigned int flags, + virErrorPtr err); + +char * +virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainManagedSaveRemoveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainMemoryPeekWrapper(virDomainPtr dom, + unsigned long long start, + size_t size, + void *buffer, + unsigned int flags, + virErrorPtr err); + +int +virDomainMemoryStatsWrapper(virDomainPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainMigrateWrapper(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth, + virErrorPtr err); + +virDomainPtr +virDomainMigrate2Wrapper(virDomainPtr domain, + virConnectPtr dconn, + const char *dxml, + unsigned long flags, + const char *dname, + const char *uri, + unsigned long bandwidth, + virErrorPtr err); + +virDomainPtr +virDomainMigrate3Wrapper(virDomainPtr domain, + virConnectPtr dconn, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateGetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long *cacheSize, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long *downtime, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateGetMaxSpeedWrapper(virDomainPtr domain, + unsigned long *bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateSetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long cacheSize, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateSetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long downtime, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateSetMaxSpeedWrapper(virDomainPtr domain, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateStartPostCopyWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateToURIWrapper(virDomainPtr domain, + const char *duri, + unsigned long flags, + const char *dname, + unsigned long bandwidth, + virErrorPtr err); + +int +virDomainMigrateToURI2Wrapper(virDomainPtr domain, + const char *dconnuri, + const char *miguri, + const char *dxml, + unsigned long flags, + const char *dname, + unsigned long bandwidth, + virErrorPtr err); + +int +virDomainMigrateToURI3Wrapper(virDomainPtr domain, + const char *dconnuri, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenChannelWrapper(virDomainPtr dom, + const char *name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenConsoleWrapper(virDomainPtr dom, + const char *dev_name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenGraphicsWrapper(virDomainPtr dom, + unsigned int idx, + int fd, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenGraphicsFDWrapper(virDomainPtr dom, + unsigned int idx, + unsigned int flags, + virErrorPtr err); + +int +virDomainPMSuspendForDurationWrapper(virDomainPtr dom, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err); + +int +virDomainPMWakeupWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainPinEmulatorWrapper(virDomainPtr domain, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainPinIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainPinVcpuWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen, + virErrorPtr err); + +int +virDomainPinVcpuFlagsWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainRebootWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainRefWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainRenameWrapper(virDomainPtr dom, + const char *new_name, + unsigned int flags, + virErrorPtr err); + +int +virDomainResetWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainResumeWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainSaveWrapper(virDomainPtr domain, + const char *to, + virErrorPtr err); + +int +virDomainSaveFlagsWrapper(virDomainPtr domain, + const char *to, + const char *dxml, + unsigned int flags, + virErrorPtr err); + +char * +virDomainScreenshotWrapper(virDomainPtr domain, + virStreamPtr stream, + unsigned int screen, + unsigned int flags, + virErrorPtr err); + +int +virDomainSendKeyWrapper(virDomainPtr domain, + unsigned int codeset, + unsigned int holdtime, + unsigned int *keycodes, + int nkeycodes, + unsigned int flags, + virErrorPtr err); + +int +virDomainSendProcessSignalWrapper(virDomainPtr domain, + long long pid_value, + unsigned int signum, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetAutostartWrapper(virDomainPtr domain, + int autostart, + virErrorPtr err); + +int +virDomainSetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetBlockIoTuneWrapper(virDomainPtr dom, + const char *disk, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetBlockThresholdWrapper(virDomainPtr domain, + const char *dev, + unsigned long long threshold, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetGuestVcpusWrapper(virDomainPtr domain, + const char *cpumap, + int state, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetInterfaceParametersWrapper(virDomainPtr domain, + const char *device, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetLifecycleActionWrapper(virDomainPtr domain, + unsigned int type, + unsigned int action, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMaxMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err); + +int +virDomainSetMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err); + +int +virDomainSetMemoryFlagsWrapper(virDomainPtr domain, + unsigned long memory, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMemoryStatsPeriodWrapper(virDomainPtr domain, + int period, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMetadataWrapper(virDomainPtr domain, + int type, + const char *metadata, + const char *key, + const char *uri, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + virErrorPtr err); + +int +virDomainSetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetTimeWrapper(virDomainPtr dom, + long long seconds, + unsigned int nseconds, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetUserPasswordWrapper(virDomainPtr dom, + const char *user, + const char *password, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetVcpuWrapper(virDomainPtr domain, + const char *vcpumap, + int state, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetVcpusWrapper(virDomainPtr domain, + unsigned int nvcpus, + virErrorPtr err); + +int +virDomainSetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int nvcpus, + unsigned int flags, + virErrorPtr err); + +int +virDomainShutdownWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainShutdownFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotCreateXMLWrapper(virDomainPtr domain, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotCurrentWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotListNamesWrapper(virDomainPtr domain, + char **names, + int nameslen, + unsigned int flags, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotLookupByNameWrapper(virDomainPtr domain, + const char *name, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotNumWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainSuspendWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainUndefineWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainUndefineFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainUpdateDeviceFlagsWrapper(virDomainPtr domain, + const char *xml, + unsigned int flags, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_DOMAIN_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/error.go b/vendor/github.com/libvirt/libvirt-go/error.go new file mode 100644 index 00000000000..1cfdf922e11 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/error.go @@ -0,0 +1,604 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include "error_compat.h" + +void ignoreErrorFunc(void *userData, virErrorPtr error) { + // no-op +} +*/ +import "C" + +import ( + "fmt" +) + +func init() { + C.virSetErrorFunc(nil, (C.virErrorFunc)(C.ignoreErrorFunc)) + C.virInitialize() +} + +type ErrorLevel int + +const ( + ERR_NONE = ErrorLevel(C.VIR_ERR_NONE) + ERR_WARNING = ErrorLevel(C.VIR_ERR_WARNING) + ERR_ERROR = ErrorLevel(C.VIR_ERR_ERROR) +) + +type ErrorNumber int + +const ( + ERR_OK = ErrorNumber(C.VIR_ERR_OK) + + // internal error + ERR_INTERNAL_ERROR = ErrorNumber(C.VIR_ERR_INTERNAL_ERROR) + + // memory allocation failure + ERR_NO_MEMORY = ErrorNumber(C.VIR_ERR_NO_MEMORY) + + // no support for this function + ERR_NO_SUPPORT = ErrorNumber(C.VIR_ERR_NO_SUPPORT) + + // could not resolve hostname + ERR_UNKNOWN_HOST = ErrorNumber(C.VIR_ERR_UNKNOWN_HOST) + + // can't connect to hypervisor + ERR_NO_CONNECT = ErrorNumber(C.VIR_ERR_NO_CONNECT) + + // invalid connection object + ERR_INVALID_CONN = ErrorNumber(C.VIR_ERR_INVALID_CONN) + + // invalid domain object + ERR_INVALID_DOMAIN = ErrorNumber(C.VIR_ERR_INVALID_DOMAIN) + + // invalid function argument + ERR_INVALID_ARG = ErrorNumber(C.VIR_ERR_INVALID_ARG) + + // a command to hypervisor failed + ERR_OPERATION_FAILED = ErrorNumber(C.VIR_ERR_OPERATION_FAILED) + + // a HTTP GET command to failed + ERR_GET_FAILED = ErrorNumber(C.VIR_ERR_GET_FAILED) + + // a HTTP POST command to failed + ERR_POST_FAILED = ErrorNumber(C.VIR_ERR_POST_FAILED) + + // unexpected HTTP error code + ERR_HTTP_ERROR = ErrorNumber(C.VIR_ERR_HTTP_ERROR) + + // failure to serialize an S-Expr + ERR_SEXPR_SERIAL = ErrorNumber(C.VIR_ERR_SEXPR_SERIAL) + + // could not open Xen hypervisor control + ERR_NO_XEN = ErrorNumber(C.VIR_ERR_NO_XEN) + + // failure doing an hypervisor call + ERR_XEN_CALL = ErrorNumber(C.VIR_ERR_XEN_CALL) + + // unknown OS type + ERR_OS_TYPE = ErrorNumber(C.VIR_ERR_OS_TYPE) + + // missing kernel information + ERR_NO_KERNEL = ErrorNumber(C.VIR_ERR_NO_KERNEL) + + // missing root device information + ERR_NO_ROOT = ErrorNumber(C.VIR_ERR_NO_ROOT) + + // missing source device information + ERR_NO_SOURCE = ErrorNumber(C.VIR_ERR_NO_SOURCE) + + // missing target device information + ERR_NO_TARGET = ErrorNumber(C.VIR_ERR_NO_TARGET) + + // missing domain name information + ERR_NO_NAME = ErrorNumber(C.VIR_ERR_NO_NAME) + + // missing domain OS information + ERR_NO_OS = ErrorNumber(C.VIR_ERR_NO_OS) + + // missing domain devices information + ERR_NO_DEVICE = ErrorNumber(C.VIR_ERR_NO_DEVICE) + + // could not open Xen Store control + ERR_NO_XENSTORE = ErrorNumber(C.VIR_ERR_NO_XENSTORE) + + // too many drivers registered + ERR_DRIVER_FULL = ErrorNumber(C.VIR_ERR_DRIVER_FULL) + + // not supported by the drivers (DEPRECATED) + ERR_CALL_FAILED = ErrorNumber(C.VIR_ERR_CALL_FAILED) + + // an XML description is not well formed or broken + ERR_XML_ERROR = ErrorNumber(C.VIR_ERR_XML_ERROR) + + // the domain already exist + ERR_DOM_EXIST = ErrorNumber(C.VIR_ERR_DOM_EXIST) + + // operation forbidden on read-only connections + ERR_OPERATION_DENIED = ErrorNumber(C.VIR_ERR_OPERATION_DENIED) + + // failed to open a conf file + ERR_OPEN_FAILED = ErrorNumber(C.VIR_ERR_OPEN_FAILED) + + // failed to read a conf file + ERR_READ_FAILED = ErrorNumber(C.VIR_ERR_READ_FAILED) + + // failed to parse a conf file + ERR_PARSE_FAILED = ErrorNumber(C.VIR_ERR_PARSE_FAILED) + + // failed to parse the syntax of a conf file + ERR_CONF_SYNTAX = ErrorNumber(C.VIR_ERR_CONF_SYNTAX) + + // failed to write a conf file + ERR_WRITE_FAILED = ErrorNumber(C.VIR_ERR_WRITE_FAILED) + + // detail of an XML error + ERR_XML_DETAIL = ErrorNumber(C.VIR_ERR_XML_DETAIL) + + // invalid network object + ERR_INVALID_NETWORK = ErrorNumber(C.VIR_ERR_INVALID_NETWORK) + + // the network already exist + ERR_NETWORK_EXIST = ErrorNumber(C.VIR_ERR_NETWORK_EXIST) + + // general system call failure + ERR_SYSTEM_ERROR = ErrorNumber(C.VIR_ERR_SYSTEM_ERROR) + + // some sort of RPC error + ERR_RPC = ErrorNumber(C.VIR_ERR_RPC) + + // error from a GNUTLS call + ERR_GNUTLS_ERROR = ErrorNumber(C.VIR_ERR_GNUTLS_ERROR) + + // failed to start network + WAR_NO_NETWORK = ErrorNumber(C.VIR_WAR_NO_NETWORK) + + // domain not found or unexpectedly disappeared + ERR_NO_DOMAIN = ErrorNumber(C.VIR_ERR_NO_DOMAIN) + + // network not found + ERR_NO_NETWORK = ErrorNumber(C.VIR_ERR_NO_NETWORK) + + // invalid MAC address + ERR_INVALID_MAC = ErrorNumber(C.VIR_ERR_INVALID_MAC) + + // authentication failed + ERR_AUTH_FAILED = ErrorNumber(C.VIR_ERR_AUTH_FAILED) + + // invalid storage pool object + ERR_INVALID_STORAGE_POOL = ErrorNumber(C.VIR_ERR_INVALID_STORAGE_POOL) + + // invalid storage vol object + ERR_INVALID_STORAGE_VOL = ErrorNumber(C.VIR_ERR_INVALID_STORAGE_VOL) + + // failed to start storage + WAR_NO_STORAGE = ErrorNumber(C.VIR_WAR_NO_STORAGE) + + // storage pool not found + ERR_NO_STORAGE_POOL = ErrorNumber(C.VIR_ERR_NO_STORAGE_POOL) + + // storage volume not found + ERR_NO_STORAGE_VOL = ErrorNumber(C.VIR_ERR_NO_STORAGE_VOL) + + // failed to start node driver + WAR_NO_NODE = ErrorNumber(C.VIR_WAR_NO_NODE) + + // invalid node device object + ERR_INVALID_NODE_DEVICE = ErrorNumber(C.VIR_ERR_INVALID_NODE_DEVICE) + + // node device not found + ERR_NO_NODE_DEVICE = ErrorNumber(C.VIR_ERR_NO_NODE_DEVICE) + + // security model not found + ERR_NO_SECURITY_MODEL = ErrorNumber(C.VIR_ERR_NO_SECURITY_MODEL) + + // operation is not applicable at this time + ERR_OPERATION_INVALID = ErrorNumber(C.VIR_ERR_OPERATION_INVALID) + + // failed to start interface driver + WAR_NO_INTERFACE = ErrorNumber(C.VIR_WAR_NO_INTERFACE) + + // interface driver not running + ERR_NO_INTERFACE = ErrorNumber(C.VIR_ERR_NO_INTERFACE) + + // invalid interface object + ERR_INVALID_INTERFACE = ErrorNumber(C.VIR_ERR_INVALID_INTERFACE) + + // more than one matching interface found + ERR_MULTIPLE_INTERFACES = ErrorNumber(C.VIR_ERR_MULTIPLE_INTERFACES) + + // failed to start nwfilter driver + WAR_NO_NWFILTER = ErrorNumber(C.VIR_WAR_NO_NWFILTER) + + // invalid nwfilter object + ERR_INVALID_NWFILTER = ErrorNumber(C.VIR_ERR_INVALID_NWFILTER) + + // nw filter pool not found + ERR_NO_NWFILTER = ErrorNumber(C.VIR_ERR_NO_NWFILTER) + + // nw filter pool not found + ERR_BUILD_FIREWALL = ErrorNumber(C.VIR_ERR_BUILD_FIREWALL) + + // failed to start secret storage + WAR_NO_SECRET = ErrorNumber(C.VIR_WAR_NO_SECRET) + + // invalid secret + ERR_INVALID_SECRET = ErrorNumber(C.VIR_ERR_INVALID_SECRET) + + // secret not found + ERR_NO_SECRET = ErrorNumber(C.VIR_ERR_NO_SECRET) + + // unsupported configuration construct + ERR_CONFIG_UNSUPPORTED = ErrorNumber(C.VIR_ERR_CONFIG_UNSUPPORTED) + + // timeout occurred during operation + ERR_OPERATION_TIMEOUT = ErrorNumber(C.VIR_ERR_OPERATION_TIMEOUT) + + // a migration worked, but making the VM persist on the dest host failed + ERR_MIGRATE_PERSIST_FAILED = ErrorNumber(C.VIR_ERR_MIGRATE_PERSIST_FAILED) + + // a synchronous hook script failed + ERR_HOOK_SCRIPT_FAILED = ErrorNumber(C.VIR_ERR_HOOK_SCRIPT_FAILED) + + // invalid domain snapshot + ERR_INVALID_DOMAIN_SNAPSHOT = ErrorNumber(C.VIR_ERR_INVALID_DOMAIN_SNAPSHOT) + + // domain snapshot not found + ERR_NO_DOMAIN_SNAPSHOT = ErrorNumber(C.VIR_ERR_NO_DOMAIN_SNAPSHOT) + + // stream pointer not valid + ERR_INVALID_STREAM = ErrorNumber(C.VIR_ERR_INVALID_STREAM) + + // valid API use but unsupported by the given driver + ERR_ARGUMENT_UNSUPPORTED = ErrorNumber(C.VIR_ERR_ARGUMENT_UNSUPPORTED) + + // storage pool probe failed + ERR_STORAGE_PROBE_FAILED = ErrorNumber(C.VIR_ERR_STORAGE_PROBE_FAILED) + + // storage pool already built + ERR_STORAGE_POOL_BUILT = ErrorNumber(C.VIR_ERR_STORAGE_POOL_BUILT) + + // force was not requested for a risky domain snapshot revert + ERR_SNAPSHOT_REVERT_RISKY = ErrorNumber(C.VIR_ERR_SNAPSHOT_REVERT_RISKY) + + // operation on a domain was canceled/aborted by user + ERR_OPERATION_ABORTED = ErrorNumber(C.VIR_ERR_OPERATION_ABORTED) + + // authentication cancelled + ERR_AUTH_CANCELLED = ErrorNumber(C.VIR_ERR_AUTH_CANCELLED) + + // The metadata is not present + ERR_NO_DOMAIN_METADATA = ErrorNumber(C.VIR_ERR_NO_DOMAIN_METADATA) + + // Migration is not safe + ERR_MIGRATE_UNSAFE = ErrorNumber(C.VIR_ERR_MIGRATE_UNSAFE) + + // integer overflow + ERR_OVERFLOW = ErrorNumber(C.VIR_ERR_OVERFLOW) + + // action prevented by block copy job + ERR_BLOCK_COPY_ACTIVE = ErrorNumber(C.VIR_ERR_BLOCK_COPY_ACTIVE) + + // The requested operation is not supported + ERR_OPERATION_UNSUPPORTED = ErrorNumber(C.VIR_ERR_OPERATION_UNSUPPORTED) + + // error in ssh transport driver + ERR_SSH = ErrorNumber(C.VIR_ERR_SSH) + + // guest agent is unresponsive, not running or not usable + ERR_AGENT_UNRESPONSIVE = ErrorNumber(C.VIR_ERR_AGENT_UNRESPONSIVE) + + // resource is already in use + ERR_RESOURCE_BUSY = ErrorNumber(C.VIR_ERR_RESOURCE_BUSY) + + // operation on the object/resource was denied + ERR_ACCESS_DENIED = ErrorNumber(C.VIR_ERR_ACCESS_DENIED) + + // error from a dbus service + ERR_DBUS_SERVICE = ErrorNumber(C.VIR_ERR_DBUS_SERVICE) + + // the storage vol already exists + ERR_STORAGE_VOL_EXIST = ErrorNumber(C.VIR_ERR_STORAGE_VOL_EXIST) + + // given CPU is incompatible with host CPU + ERR_CPU_INCOMPATIBLE = ErrorNumber(C.VIR_ERR_CPU_INCOMPATIBLE) + + // XML document doesn't validate against schema + ERR_XML_INVALID_SCHEMA = ErrorNumber(C.VIR_ERR_XML_INVALID_SCHEMA) + + // Finish API succeeded but it is expected to return NULL */ + ERR_MIGRATE_FINISH_OK = ErrorNumber(C.VIR_ERR_MIGRATE_FINISH_OK) + + // authentication unavailable + ERR_AUTH_UNAVAILABLE = ErrorNumber(C.VIR_ERR_AUTH_UNAVAILABLE) + + // Server was not found + ERR_NO_SERVER = ErrorNumber(C.VIR_ERR_NO_SERVER) + + // Client was not found + ERR_NO_CLIENT = ErrorNumber(C.VIR_ERR_NO_CLIENT) + + // guest agent replies with wrong id to guest sync command + ERR_AGENT_UNSYNCED = ErrorNumber(C.VIR_ERR_AGENT_UNSYNCED) + + // error in libssh transport driver + ERR_LIBSSH = ErrorNumber(C.VIR_ERR_LIBSSH) + + // libvirt fail to find the desired device + ERR_DEVICE_MISSING = ErrorNumber(C.VIR_ERR_DEVICE_MISSING) + + // Invalid nwfilter binding object + ERR_INVALID_NWFILTER_BINDING = ErrorNumber(C.VIR_ERR_INVALID_NWFILTER_BINDING) + + // Requested nwfilter binding does not exist + ERR_NO_NWFILTER_BINDING = ErrorNumber(C.VIR_ERR_NO_NWFILTER_BINDING) +) + +type ErrorDomain int + +const ( + FROM_NONE = ErrorDomain(C.VIR_FROM_NONE) + + // Error at Xen hypervisor layer + FROM_XEN = ErrorDomain(C.VIR_FROM_XEN) + + // Error at connection with xend daemon + FROM_XEND = ErrorDomain(C.VIR_FROM_XEND) + + // Error at connection with xen store + FROM_XENSTORE = ErrorDomain(C.VIR_FROM_XENSTORE) + + // Error in the S-Expression code + FROM_SEXPR = ErrorDomain(C.VIR_FROM_SEXPR) + + // Error in the XML code + FROM_XML = ErrorDomain(C.VIR_FROM_XML) + + // Error when operating on a domain + FROM_DOM = ErrorDomain(C.VIR_FROM_DOM) + + // Error in the XML-RPC code + FROM_RPC = ErrorDomain(C.VIR_FROM_RPC) + + // Error in the proxy code; unused since 0.8.6 + FROM_PROXY = ErrorDomain(C.VIR_FROM_PROXY) + + // Error in the configuration file handling + FROM_CONF = ErrorDomain(C.VIR_FROM_CONF) + + // Error at the QEMU daemon + FROM_QEMU = ErrorDomain(C.VIR_FROM_QEMU) + + // Error when operating on a network + FROM_NET = ErrorDomain(C.VIR_FROM_NET) + + // Error from test driver + FROM_TEST = ErrorDomain(C.VIR_FROM_TEST) + + // Error from remote driver + FROM_REMOTE = ErrorDomain(C.VIR_FROM_REMOTE) + + // Error from OpenVZ driver + FROM_OPENVZ = ErrorDomain(C.VIR_FROM_OPENVZ) + + // Error at Xen XM layer + FROM_XENXM = ErrorDomain(C.VIR_FROM_XENXM) + + // Error in the Linux Stats code + FROM_STATS_LINUX = ErrorDomain(C.VIR_FROM_STATS_LINUX) + + // Error from Linux Container driver + FROM_LXC = ErrorDomain(C.VIR_FROM_LXC) + + // Error from storage driver + FROM_STORAGE = ErrorDomain(C.VIR_FROM_STORAGE) + + // Error from network config + FROM_NETWORK = ErrorDomain(C.VIR_FROM_NETWORK) + + // Error from domain config + FROM_DOMAIN = ErrorDomain(C.VIR_FROM_DOMAIN) + + // Error at the UML driver + FROM_UML = ErrorDomain(C.VIR_FROM_UML) + + // Error from node device monitor + FROM_NODEDEV = ErrorDomain(C.VIR_FROM_NODEDEV) + + // Error from xen inotify layer + FROM_XEN_INOTIFY = ErrorDomain(C.VIR_FROM_XEN_INOTIFY) + + // Error from security framework + FROM_SECURITY = ErrorDomain(C.VIR_FROM_SECURITY) + + // Error from VirtualBox driver + FROM_VBOX = ErrorDomain(C.VIR_FROM_VBOX) + + // Error when operating on an interface + FROM_INTERFACE = ErrorDomain(C.VIR_FROM_INTERFACE) + + // The OpenNebula driver no longer exists. Retained for ABI/API compat only + FROM_ONE = ErrorDomain(C.VIR_FROM_ONE) + + // Error from ESX driver + FROM_ESX = ErrorDomain(C.VIR_FROM_ESX) + + // Error from IBM power hypervisor + FROM_PHYP = ErrorDomain(C.VIR_FROM_PHYP) + + // Error from secret storage + FROM_SECRET = ErrorDomain(C.VIR_FROM_SECRET) + + // Error from CPU driver + FROM_CPU = ErrorDomain(C.VIR_FROM_CPU) + + // Error from XenAPI + FROM_XENAPI = ErrorDomain(C.VIR_FROM_XENAPI) + + // Error from network filter driver + FROM_NWFILTER = ErrorDomain(C.VIR_FROM_NWFILTER) + + // Error from Synchronous hooks + FROM_HOOK = ErrorDomain(C.VIR_FROM_HOOK) + + // Error from domain snapshot + FROM_DOMAIN_SNAPSHOT = ErrorDomain(C.VIR_FROM_DOMAIN_SNAPSHOT) + + // Error from auditing subsystem + FROM_AUDIT = ErrorDomain(C.VIR_FROM_AUDIT) + + // Error from sysinfo/SMBIOS + FROM_SYSINFO = ErrorDomain(C.VIR_FROM_SYSINFO) + + // Error from I/O streams + FROM_STREAMS = ErrorDomain(C.VIR_FROM_STREAMS) + + // Error from VMware driver + FROM_VMWARE = ErrorDomain(C.VIR_FROM_VMWARE) + + // Error from event loop impl + FROM_EVENT = ErrorDomain(C.VIR_FROM_EVENT) + + // Error from libxenlight driver + FROM_LIBXL = ErrorDomain(C.VIR_FROM_LIBXL) + + // Error from lock manager + FROM_LOCKING = ErrorDomain(C.VIR_FROM_LOCKING) + + // Error from Hyper-V driver + FROM_HYPERV = ErrorDomain(C.VIR_FROM_HYPERV) + + // Error from capabilities + FROM_CAPABILITIES = ErrorDomain(C.VIR_FROM_CAPABILITIES) + + // Error from URI handling + FROM_URI = ErrorDomain(C.VIR_FROM_URI) + + // Error from auth handling + FROM_AUTH = ErrorDomain(C.VIR_FROM_AUTH) + + // Error from DBus + FROM_DBUS = ErrorDomain(C.VIR_FROM_DBUS) + + // Error from Parallels + FROM_PARALLELS = ErrorDomain(C.VIR_FROM_PARALLELS) + + // Error from Device + FROM_DEVICE = ErrorDomain(C.VIR_FROM_DEVICE) + + // Error from libssh2 connection transport + FROM_SSH = ErrorDomain(C.VIR_FROM_SSH) + + // Error from lockspace + FROM_LOCKSPACE = ErrorDomain(C.VIR_FROM_LOCKSPACE) + + // Error from initctl device communication + FROM_INITCTL = ErrorDomain(C.VIR_FROM_INITCTL) + + // Error from identity code + FROM_IDENTITY = ErrorDomain(C.VIR_FROM_IDENTITY) + + // Error from cgroups + FROM_CGROUP = ErrorDomain(C.VIR_FROM_CGROUP) + + // Error from access control manager + FROM_ACCESS = ErrorDomain(C.VIR_FROM_ACCESS) + + // Error from systemd code + FROM_SYSTEMD = ErrorDomain(C.VIR_FROM_SYSTEMD) + + // Error from bhyve driver + FROM_BHYVE = ErrorDomain(C.VIR_FROM_BHYVE) + + // Error from crypto code + FROM_CRYPTO = ErrorDomain(C.VIR_FROM_CRYPTO) + + // Error from firewall + FROM_FIREWALL = ErrorDomain(C.VIR_FROM_FIREWALL) + + // Erorr from polkit code + FROM_POLKIT = ErrorDomain(C.VIR_FROM_POLKIT) + + // Error from thread utils + FROM_THREAD = ErrorDomain(C.VIR_FROM_THREAD) + + // Error from admin backend + FROM_ADMIN = ErrorDomain(C.VIR_FROM_ADMIN) + + // Error from log manager + FROM_LOGGING = ErrorDomain(C.VIR_FROM_LOGGING) + + // Error from Xen xl config code + FROM_XENXL = ErrorDomain(C.VIR_FROM_XENXL) + + // Error from perf + FROM_PERF = ErrorDomain(C.VIR_FROM_PERF) + + // Error from libssh + FROM_LIBSSH = ErrorDomain(C.VIR_FROM_LIBSSH) + + // Error from resoruce control + FROM_RESCTRL = ErrorDomain(C.VIR_FROM_RESCTRL) +) + +type Error struct { + Code ErrorNumber + Domain ErrorDomain + Message string + Level ErrorLevel +} + +func (err Error) Error() string { + return fmt.Sprintf("virError(Code=%d, Domain=%d, Message='%s')", + err.Code, err.Domain, err.Message) +} + +func makeError(err *C.virError) Error { + ret := Error{ + Code: ErrorNumber(err.code), + Domain: ErrorDomain(err.domain), + Message: C.GoString(err.message), + Level: ErrorLevel(err.level), + } + C.virResetError(err) + return ret +} + +func makeNotImplementedError(apiname string) Error { + return Error{ + Code: ERR_NO_SUPPORT, + Domain: FROM_NONE, + Message: fmt.Sprintf("Function '%s' not available in the libvirt library used during Go build", apiname), + Level: ERR_ERROR, + } +} diff --git a/vendor/github.com/libvirt/libvirt-go/error_compat.h b/vendor/github.com/libvirt/libvirt-go/error_compat.h new file mode 100644 index 00000000000..0e416803842 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/error_compat.h @@ -0,0 +1,166 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_ERROR_COMPAT_H__ +#define LIBVIRT_GO_ERROR_COMPAT_H__ + +/* 1.2.2 */ + +#ifndef VIR_FROM_BHYVE +#define VIR_FROM_BHYVE 57 +#endif + + +/* 1.2.3 */ + +#ifndef VIR_FROM_CRYPTO +#define VIR_FROM_CRYPTO 58 +#endif + + +/* 1.2.4 */ + +#ifndef VIR_FROM_FIREWALL +#define VIR_FROM_FIREWALL 59 +#endif + + +/* 1.2.6 */ + +#ifndef VIR_ERR_CPU_INCOMPATIBLE +#define VIR_ERR_CPU_INCOMPATIBLE 91 +#endif + + +/* 1.2.9 */ + +#ifndef VIR_FROM_POLKIT +#define VIR_FROM_POLKIT 60 +#endif + + +/* 1.2.12 */ + +#ifndef VIR_ERR_XML_INVALID_SCHEMA +#define VIR_ERR_XML_INVALID_SCHEMA 92 +#endif + + +/* 1.2.14 */ + +#ifndef VIR_FROM_THREAD +#define VIR_FROM_THREAD 61 +#endif + + +/* 1.2.17 */ + +#ifndef VIR_FROM_ADMIN +#define VIR_FROM_ADMIN 62 +#endif + + +/* 1.2.18 */ + +#ifndef VIR_ERR_MIGRATE_FINISH_OK +#define VIR_ERR_MIGRATE_FINISH_OK 93 +#endif + + +/* 1.3.0 */ + +#ifndef VIR_FROM_LOGGING +#define VIR_FROM_LOGGING 63 +#endif + +/* 1.3.2 */ + +#ifndef VIR_FROM_XENXL +#define VIR_FROM_XENXL 64 +#endif + + +/* 1.3.3 */ + +#ifndef VIR_FROM_PERF +#define VIR_FROM_PERF 65 +#endif + +#ifndef VIR_ERR_AUTH_UNAVAILABLE +#define VIR_ERR_AUTH_UNAVAILABLE 94 +#endif + +#ifndef VIR_ERR_NO_SERVER +#define VIR_ERR_NO_SERVER 95 +#endif + + +/* 1.3.5 */ + +#ifndef VIR_ERR_NO_CLIENT +#define VIR_ERR_NO_CLIENT 96 +#endif + + +/* 2.3.0 */ + +#ifndef VIR_ERR_AGENT_UNSYNCED +#define VIR_ERR_AGENT_UNSYNCED 97 +#endif + +/* 2.5.0 */ + +#ifndef VIR_ERR_LIBSSH +#define VIR_ERR_LIBSSH 98 +#endif + +#ifndef VIR_FROM_LIBSSH +#define VIR_FROM_LIBSSH 66 +#endif + +/* 3.7.0 */ + +#ifndef VIR_FROM_RESCTRL +#define VIR_FROM_RESCTRL 67 +#endif + +/* 4.1.0 */ + +#ifndef VIR_ERR_DEVICE_MISSING +#define VIR_ERR_DEVICE_MISSING 99 +#endif + +/* 4.5.0 */ + +#ifndef VIR_ERR_INVALID_NWFILTER_BINDING +#define VIR_ERR_INVALID_NWFILTER_BINDING 100 +#endif + +#ifndef VIR_ERR_NO_NWFILTER_BINDING +#define VIR_ERR_NO_NWFILTER_BINDING 101 +#endif + +#endif /* LIBVIRT_GO_ERROR_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/events.go b/vendor/github.com/libvirt/libvirt-go/events.go new file mode 100644 index 00000000000..bf2c1f4ecd4 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/events.go @@ -0,0 +1,258 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "events_wrapper.h" +*/ +import "C" + +type EventHandleType int + +const ( + EVENT_HANDLE_READABLE = EventHandleType(C.VIR_EVENT_HANDLE_READABLE) + EVENT_HANDLE_WRITABLE = EventHandleType(C.VIR_EVENT_HANDLE_WRITABLE) + EVENT_HANDLE_ERROR = EventHandleType(C.VIR_EVENT_HANDLE_ERROR) + EVENT_HANDLE_HANGUP = EventHandleType(C.VIR_EVENT_HANDLE_HANGUP) +) + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRegisterDefaultImpl +func EventRegisterDefaultImpl() error { + var err C.virError + if i := int(C.virEventRegisterDefaultImplWrapper(&err)); i != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRunDefaultImpl +func EventRunDefaultImpl() error { + var err C.virError + if i := int(C.virEventRunDefaultImplWrapper(&err)); i != 0 { + return makeError(&err) + } + return nil +} + +type EventHandleCallback func(watch int, file int, events EventHandleType) + +//export eventHandleCallback +func eventHandleCallback(watch int, fd int, events int, callbackID int) { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(EventHandleCallback) + if !ok { + panic("Incorrect event handle callback data") + } + + callback(watch, fd, (EventHandleType)(events)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventAddHandle +func EventAddHandle(fd int, events EventHandleType, callback EventHandleCallback) (int, error) { + callbackID := registerCallbackId(callback) + + var err C.virError + ret := C.virEventAddHandleWrapper((C.int)(fd), (C.int)(events), (C.int)(callbackID), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateHandle +func EventUpdateHandle(watch int, events EventHandleType) { + C.virEventUpdateHandle((C.int)(watch), (C.int)(events)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveHandle +func EventRemoveHandle(watch int) error { + var err C.virError + ret := C.virEventRemoveHandleWrapper((C.int)(watch), &err) + if ret < 0 { + return makeError(&err) + } + + return nil +} + +type EventTimeoutCallback func(timer int) + +//export eventTimeoutCallback +func eventTimeoutCallback(timer int, callbackID int) { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(EventTimeoutCallback) + if !ok { + panic("Incorrect event timeout callback data") + } + + callback(timer) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventAddTimeout +func EventAddTimeout(freq int, callback EventTimeoutCallback) (int, error) { + callbackID := registerCallbackId(callback) + + var err C.virError + ret := C.virEventAddTimeoutWrapper((C.int)(freq), (C.int)(callbackID), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateTimeout +func EventUpdateTimeout(timer int, freq int) { + C.virEventUpdateTimeout((C.int)(timer), (C.int)(freq)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveTimeout +func EventRemoveTimeout(timer int) error { + var err C.virError + ret := C.virEventRemoveTimeoutWrapper((C.int)(timer), &err) + if ret < 0 { + return makeError(&err) + } + + return nil +} + +type EventHandleCallbackInfo struct { + callback uintptr + opaque uintptr + free uintptr +} + +type EventTimeoutCallbackInfo struct { + callback uintptr + opaque uintptr + free uintptr +} + +func (i *EventHandleCallbackInfo) Invoke(watch int, fd int, event EventHandleType) { + C.eventHandleCallbackInvoke(C.int(watch), C.int(fd), C.int(event), C.uintptr_t(i.callback), C.uintptr_t(i.opaque)) +} + +func (i *EventTimeoutCallbackInfo) Invoke(timer int) { + C.eventTimeoutCallbackInvoke(C.int(timer), C.uintptr_t(i.callback), C.uintptr_t(i.opaque)) +} + +func (i *EventHandleCallbackInfo) Free() { + C.eventHandleCallbackFree(C.uintptr_t(i.free), C.uintptr_t(i.opaque)) +} + +func (i *EventTimeoutCallbackInfo) Free() { + C.eventTimeoutCallbackFree(C.uintptr_t(i.free), C.uintptr_t(i.opaque)) +} + +type EventLoop interface { + AddHandleFunc(fd int, event EventHandleType, callback *EventHandleCallbackInfo) int + UpdateHandleFunc(watch int, event EventHandleType) + RemoveHandleFunc(watch int) int + AddTimeoutFunc(freq int, callback *EventTimeoutCallbackInfo) int + UpdateTimeoutFunc(timer int, freq int) + RemoveTimeoutFunc(timer int) int +} + +var eventLoopImpl EventLoop + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRegisterImpl +func EventRegisterImpl(impl EventLoop) { + eventLoopImpl = impl + C.virEventRegisterImplWrapper() +} + +//export eventAddHandleFunc +func eventAddHandleFunc(fd C.int, event C.int, callback uintptr, opaque uintptr, free uintptr) C.int { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + cbinfo := &EventHandleCallbackInfo{ + callback: callback, + opaque: opaque, + free: free, + } + + return C.int(eventLoopImpl.AddHandleFunc(int(fd), EventHandleType(event), cbinfo)) +} + +//export eventUpdateHandleFunc +func eventUpdateHandleFunc(watch C.int, event C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.UpdateHandleFunc(int(watch), EventHandleType(event)) +} + +//export eventRemoveHandleFunc +func eventRemoveHandleFunc(watch C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.RemoveHandleFunc(int(watch)) +} + +//export eventAddTimeoutFunc +func eventAddTimeoutFunc(freq C.int, callback uintptr, opaque uintptr, free uintptr) C.int { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + cbinfo := &EventTimeoutCallbackInfo{ + callback: callback, + opaque: opaque, + free: free, + } + + return C.int(eventLoopImpl.AddTimeoutFunc(int(freq), cbinfo)) +} + +//export eventUpdateTimeoutFunc +func eventUpdateTimeoutFunc(timer C.int, freq C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.UpdateTimeoutFunc(int(timer), int(freq)) +} + +//export eventRemoveTimeoutFunc +func eventRemoveTimeoutFunc(timer C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.RemoveTimeoutFunc(int(timer)) +} diff --git a/vendor/github.com/libvirt/libvirt-go/events_wrapper.go b/vendor/github.com/libvirt/libvirt-go/events_wrapper.go new file mode 100644 index 00000000000..68145893182 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/events_wrapper.go @@ -0,0 +1,193 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include "events_wrapper.h" + +void eventHandleCallback(int watch, int fd, int events, int callbackID); + +static void eventAddHandleHelper(int watch, int fd, int events, void *opaque) +{ + eventHandleCallback(watch, fd, events, (int)(intptr_t)opaque); +} + +void eventTimeoutCallback(int timer, int callbackID); + +static void eventAddTimeoutHelper(int timer, void *opaque) +{ + eventTimeoutCallback(timer, (int)(intptr_t)opaque); +} + +int eventAddHandleFunc(int fd, int event, uintptr_t callback, uintptr_t opaque, uintptr_t freecb); +void eventUpdateHandleFunc(int watch, int event); +int eventRemoveHandleFunc(int watch); +int eventAddTimeoutFunc(int freq, uintptr_t callback, uintptr_t opaque, uintptr_t freecb); +void eventUpdateTimeoutFunc(int timer, int freq); +int eventRemoveTimeoutFunc(int timer); + +int eventAddHandleFuncHelper(int fd, int event, virEventHandleCallback callback, void *opaque, virFreeCallback freecb) +{ + return eventAddHandleFunc(fd, event, (uintptr_t)callback, (uintptr_t)opaque, (uintptr_t)freecb); +} + +void eventUpdateHandleFuncHelper(int watch, int event) +{ + eventUpdateHandleFunc(watch, event); +} + +int eventRemoveHandleFuncHelper(int watch) +{ + return eventRemoveHandleFunc(watch); +} + +int eventAddTimeoutFuncHelper(int freq, virEventTimeoutCallback callback, void *opaque, virFreeCallback freecb) +{ + return eventAddTimeoutFunc(freq, (uintptr_t)callback, (uintptr_t)opaque, (uintptr_t)freecb); +} + +void eventUpdateTimeoutFuncHelper(int timer, int freq) +{ + eventUpdateTimeoutFunc(timer, freq); +} + +int eventRemoveTimeoutFuncHelper(int timer) +{ + return eventRemoveTimeoutFunc(timer); +} + + +void virEventRegisterImplWrapper(void) +{ + virEventRegisterImpl(eventAddHandleFuncHelper, + eventUpdateHandleFuncHelper, + eventRemoveHandleFuncHelper, + eventAddTimeoutFuncHelper, + eventUpdateTimeoutFuncHelper, + eventRemoveTimeoutFuncHelper); +} + +void eventHandleCallbackInvoke(int watch, int fd, int events, uintptr_t callback, uintptr_t opaque) +{ + ((virEventHandleCallback)callback)(watch, fd, events, (void *)opaque); +} + +void eventTimeoutCallbackInvoke(int timer, uintptr_t callback, uintptr_t opaque) +{ + ((virEventTimeoutCallback)callback)(timer, (void *)opaque); +} + + +void eventHandleCallbackFree(uintptr_t callback, uintptr_t opaque) +{ + ((virFreeCallback)callback)((void *)opaque); +} + +void eventTimeoutCallbackFree(uintptr_t callback, uintptr_t opaque) +{ + ((virFreeCallback)callback)((void *)opaque); +} + + +int +virEventAddHandleWrapper(int fd, + int events, + int callbackID, + virErrorPtr err) +{ + int ret = virEventAddHandle(fd, events, eventAddHandleHelper, (void *)(intptr_t)callbackID, NULL); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virEventAddTimeoutWrapper(int timeout, + int callbackID, + virErrorPtr err) +{ + int ret = virEventAddTimeout(timeout, eventAddTimeoutHelper, (void *)(intptr_t)callbackID, NULL); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virEventRegisterDefaultImplWrapper(virErrorPtr err) +{ + int ret = virEventRegisterDefaultImpl(); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virEventRemoveHandleWrapper(int watch, + virErrorPtr err) +{ + int ret = virEventRemoveHandle(watch); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virEventRemoveTimeoutWrapper(int timer, + virErrorPtr err) +{ + int ret = virEventRemoveTimeout(timer); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virEventRunDefaultImplWrapper(virErrorPtr err) +{ + int ret = virEventRunDefaultImpl(); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/events_wrapper.h b/vendor/github.com/libvirt/libvirt-go/events_wrapper.h new file mode 100644 index 00000000000..62ea9c8a0bd --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/events_wrapper.h @@ -0,0 +1,82 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_EVENTS_WRAPPER_H__ + +#include +#include + +void +virEventRegisterImplWrapper(void); + +void +eventHandleCallbackInvoke(int watch, + int fd, + int events, + uintptr_t callback, + uintptr_t opaque); + +void +eventTimeoutCallbackInvoke(int timer, + uintptr_t callback, + uintptr_t opaque); + +void +eventHandleCallbackFree(uintptr_t callback, + uintptr_t opaque); + +void +eventTimeoutCallbackFree(uintptr_t callback, + uintptr_t opaque); + +int +virEventAddHandleWrapper(int fd, + int events, + int callbackID, + virErrorPtr err); + +int +virEventAddTimeoutWrapper(int timeout, + int callbackID, + virErrorPtr err); + +int +virEventRegisterDefaultImplWrapper(virErrorPtr err); + +int +virEventRemoveHandleWrapper(int watch, + virErrorPtr err); + +int +virEventRemoveTimeoutWrapper(int timer, + virErrorPtr err); + +int +virEventRunDefaultImplWrapper(virErrorPtr err); + + +#endif /* LIBVIRT_GO_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/interface.go b/vendor/github.com/libvirt/libvirt-go/interface.go new file mode 100644 index 00000000000..9b6ebb2b721 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/interface.go @@ -0,0 +1,145 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "interface_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +type InterfaceXMLFlags int + +const ( + INTERFACE_XML_INACTIVE = InterfaceXMLFlags(C.VIR_INTERFACE_XML_INACTIVE) +) + +type Interface struct { + ptr C.virInterfacePtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceCreate +func (n *Interface) Create(flags uint32) error { + var err C.virError + result := C.virInterfaceCreateWrapper(n.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDestroy +func (n *Interface) Destroy(flags uint32) error { + var err C.virError + result := C.virInterfaceDestroyWrapper(n.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceIsActive +func (n *Interface) IsActive() (bool, error) { + var err C.virError + result := C.virInterfaceIsActiveWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceGetMACString +func (n *Interface) GetMACString() (string, error) { + var err C.virError + result := C.virInterfaceGetMACStringWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + mac := C.GoString(result) + return mac, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceGetName +func (n *Interface) GetName() (string, error) { + var err C.virError + result := C.virInterfaceGetNameWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + name := C.GoString(result) + return name, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceGetXMLDesc +func (n *Interface) GetXMLDesc(flags InterfaceXMLFlags) (string, error) { + var err C.virError + result := C.virInterfaceGetXMLDescWrapper(n.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceUndefine +func (n *Interface) Undefine() error { + var err C.virError + result := C.virInterfaceUndefineWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceFree +func (n *Interface) Free() error { + var err C.virError + ret := C.virInterfaceFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceRef +func (c *Interface) Ref() error { + var err C.virError + ret := C.virInterfaceRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/interface_wrapper.go b/vendor/github.com/libvirt/libvirt-go/interface_wrapper.go new file mode 100644 index 00000000000..a33aea9e4ba --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/interface_wrapper.go @@ -0,0 +1,158 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "interface_wrapper.h" + + +int +virInterfaceCreateWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + int ret = virInterfaceCreate(iface, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceDestroyWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + int ret = virInterfaceDestroy(iface, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceFreeWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = virInterfaceFree(iface); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virInterfaceGetConnectWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + virConnectPtr ret = virInterfaceGetConnect(iface); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virInterfaceGetMACStringWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + const char * ret = virInterfaceGetMACString(iface); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virInterfaceGetNameWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + const char * ret = virInterfaceGetName(iface); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virInterfaceGetXMLDescWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virInterfaceGetXMLDesc(iface, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceIsActiveWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = virInterfaceIsActive(iface); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceRefWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = virInterfaceRef(iface); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virInterfaceUndefineWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = virInterfaceUndefine(iface); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/interface_wrapper.h b/vendor/github.com/libvirt/libvirt-go/interface_wrapper.h new file mode 100644 index 00000000000..b7cef761351 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/interface_wrapper.h @@ -0,0 +1,76 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_INTERFACE_WRAPPER_H__ +#define LIBVIRT_GO_INTERFACE_WRAPPER_H__ + +#include +#include + +int +virInterfaceCreateWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceDestroyWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceFreeWrapper(virInterfacePtr iface, + virErrorPtr err); + +virConnectPtr +virInterfaceGetConnectWrapper(virInterfacePtr iface, + virErrorPtr err); + +const char * +virInterfaceGetMACStringWrapper(virInterfacePtr iface, + virErrorPtr err); + +const char * +virInterfaceGetNameWrapper(virInterfacePtr iface, + virErrorPtr err); + +char * +virInterfaceGetXMLDescWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceIsActiveWrapper(virInterfacePtr iface, + virErrorPtr err); + +int +virInterfaceRefWrapper(virInterfacePtr iface, + virErrorPtr err); + +int +virInterfaceUndefineWrapper(virInterfacePtr iface, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_INTERFACE_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/lxc.go b/vendor/github.com/libvirt/libvirt-go/lxc.go new file mode 100644 index 00000000000..1578cab9695 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/lxc.go @@ -0,0 +1,155 @@ +// +build !without_lxc + +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +// Can't rely on pkg-config for libvirt-lxc since it was not +// installed until 2.6.0 onwards +#cgo LDFLAGS: -lvirt-lxc +#include +#include +#include "lxc_wrapper.h" +*/ +import "C" + +import ( + "os" + "unsafe" +) + +func (d *Domain) LxcOpenNamespace(flags uint32) ([]os.File, error) { + var cfdlist *C.int + + var err C.virError + ret := C.virDomainLxcOpenNamespaceWrapper(d.ptr, &cfdlist, C.uint(flags), &err) + if ret == -1 { + return []os.File{}, makeError(&err) + } + fdlist := make([]os.File, ret) + for i := 0; i < int(ret); i++ { + var cfd C.int + cfd = *(*C.int)(unsafe.Pointer(uintptr(unsafe.Pointer(cfdlist)) + (unsafe.Sizeof(cfd) * uintptr(i)))) + fdlist[i] = *os.NewFile(uintptr(cfd), "namespace") + } + defer C.free(unsafe.Pointer(cfdlist)) + return fdlist, nil +} + +func (d *Domain) LxcEnterNamespace(fdlist []os.File, flags uint32) ([]os.File, error) { + var coldfdlist *C.int + var ncoldfdlist C.uint + cfdlist := make([]C.int, len(fdlist)) + for i := 0; i < len(fdlist); i++ { + cfdlist[i] = C.int(fdlist[i].Fd()) + } + + var err C.virError + ret := C.virDomainLxcEnterNamespaceWrapper(d.ptr, C.uint(len(fdlist)), &cfdlist[0], &ncoldfdlist, &coldfdlist, C.uint(flags), &err) + if ret == -1 { + return []os.File{}, makeError(&err) + } + oldfdlist := make([]os.File, ncoldfdlist) + for i := 0; i < int(ncoldfdlist); i++ { + var cfd C.int + cfd = *(*C.int)(unsafe.Pointer(uintptr(unsafe.Pointer(coldfdlist)) + (unsafe.Sizeof(cfd) * uintptr(i)))) + oldfdlist[i] = *os.NewFile(uintptr(cfd), "namespace") + } + defer C.free(unsafe.Pointer(coldfdlist)) + return oldfdlist, nil +} + +func DomainLxcEnterSecurityLabel(model *NodeSecurityModel, label *SecurityLabel, flags uint32) (*SecurityLabel, error) { + var cmodel C.virSecurityModel + var clabel C.virSecurityLabel + var coldlabel C.virSecurityLabel + + cmodelstrlen := len(model.Model) + if cmodelstrlen > (C.VIR_SECURITY_MODEL_BUFLEN - 1) { + cmodelstrlen = C.VIR_SECURITY_MODEL_BUFLEN - 1 + } + cmodelstr := C.CString(model.Model) + defer C.free(unsafe.Pointer(cmodelstr)) + + cdoistrlen := len(model.Doi) + if cdoistrlen >= (C.VIR_SECURITY_DOI_BUFLEN - 1) { + cdoistrlen = C.VIR_SECURITY_DOI_BUFLEN - 1 + } + cdoistr := C.CString(model.Doi) + defer C.free(unsafe.Pointer(cdoistr)) + + C.memcpy(unsafe.Pointer(&cmodel.model), unsafe.Pointer(cmodelstr), C.size_t(cmodelstrlen)) + C.memcpy(unsafe.Pointer(&cmodel.doi), unsafe.Pointer(cdoistr), C.size_t(cdoistrlen)) + + clabelstrlen := len(label.Label) + if clabelstrlen > (C.VIR_SECURITY_LABEL_BUFLEN - 1) { + clabelstrlen = C.VIR_SECURITY_LABEL_BUFLEN - 1 + } + clabelstr := C.CString(label.Label) + defer C.free(unsafe.Pointer(clabelstr)) + + C.memcpy(unsafe.Pointer(&clabel.label), unsafe.Pointer(clabelstr), C.size_t(clabelstrlen)) + if label.Enforcing { + clabel.enforcing = 1 + } else { + clabel.enforcing = 0 + } + + var err C.virError + ret := C.virDomainLxcEnterSecurityLabelWrapper(&cmodel, &clabel, &coldlabel, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + var oldlabel SecurityLabel + + oldlabel.Label = C.GoString((*C.char)(unsafe.Pointer(&coldlabel.label))) + if coldlabel.enforcing != 0 { + oldlabel.Enforcing = true + } else { + oldlabel.Enforcing = false + } + + return &oldlabel, nil +} + +func (d *Domain) DomainLxcEnterCGroup(flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 2000000 { + return makeNotImplementedError("virDomainLxcEnterCGroup") + } + + var err C.virError + ret := C.virDomainLxcEnterCGroupWrapper(d.ptr, C.uint(flags), &err) + + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go b/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go new file mode 100644 index 00000000000..fa3d91036e5 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go @@ -0,0 +1,101 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +// Can't rely on pkg-config for libvirt-lxc since it was not +// installed until 2.6.0 onwards +#cgo LDFLAGS: -lvirt-lxc +#include +#include "lxc_wrapper.h" + +int +virDomainLxcEnterCGroupWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 2000000 + assert(0); // Caller should have checked version +#else + int ret = virDomainLxcEnterCGroup(domain, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virDomainLxcEnterNamespaceWrapper(virDomainPtr domain, + unsigned int nfdlist, + int *fdlist, + unsigned int *noldfdlist, + int **oldfdlist, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainLxcEnterNamespace(domain, nfdlist, fdlist, noldfdlist, oldfdlist, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainLxcEnterSecurityLabelWrapper(virSecurityModelPtr model, + virSecurityLabelPtr label, + virSecurityLabelPtr oldlabel, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainLxcEnterSecurityLabel(model, label, oldlabel, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainLxcOpenNamespaceWrapper(virDomainPtr domain, + int **fdlist, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainLxcOpenNamespace(domain, fdlist, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h b/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h new file mode 100644 index 00000000000..b3afd6e5b8c --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h @@ -0,0 +1,63 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_LXC_COMPAT_H__ +#define LIBVIRT_GO_LXC_COMPAT_H__ + +#include +#include +#include + + +int +virDomainLxcEnterCGroupWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainLxcEnterNamespaceWrapper(virDomainPtr domain, + unsigned int nfdlist, + int *fdlist, + unsigned int *noldfdlist, + int **oldfdlist, + unsigned int flags, + virErrorPtr err); + +int +virDomainLxcEnterSecurityLabelWrapper(virSecurityModelPtr model, + virSecurityLabelPtr label, + virSecurityLabelPtr oldlabel, + unsigned int flags, + virErrorPtr err); + +int +virDomainLxcOpenNamespaceWrapper(virDomainPtr domain, + int **fdlist, + unsigned int flags, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_LXC_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/network.go b/vendor/github.com/libvirt/libvirt-go/network.go new file mode 100644 index 00000000000..99954aa5ce0 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network.go @@ -0,0 +1,335 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "network_wrapper.h" +*/ +import "C" + +import ( + "reflect" + "time" + "unsafe" +) + +type IPAddrType int + +const ( + IP_ADDR_TYPE_IPV4 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV4) + IP_ADDR_TYPE_IPV6 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV6) +) + +type NetworkXMLFlags int + +const ( + NETWORK_XML_INACTIVE = NetworkXMLFlags(C.VIR_NETWORK_XML_INACTIVE) +) + +type NetworkUpdateCommand int + +const ( + NETWORK_UPDATE_COMMAND_NONE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_NONE) + NETWORK_UPDATE_COMMAND_MODIFY = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_MODIFY) + NETWORK_UPDATE_COMMAND_DELETE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_DELETE) + NETWORK_UPDATE_COMMAND_ADD_LAST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_LAST) + NETWORK_UPDATE_COMMAND_ADD_FIRST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST) +) + +type NetworkUpdateSection int + +const ( + NETWORK_SECTION_NONE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_NONE) + NETWORK_SECTION_BRIDGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_BRIDGE) + NETWORK_SECTION_DOMAIN = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DOMAIN) + NETWORK_SECTION_IP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP) + NETWORK_SECTION_IP_DHCP_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_HOST) + NETWORK_SECTION_IP_DHCP_RANGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_RANGE) + NETWORK_SECTION_FORWARD = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD) + NETWORK_SECTION_FORWARD_INTERFACE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_INTERFACE) + NETWORK_SECTION_FORWARD_PF = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_PF) + NETWORK_SECTION_PORTGROUP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_PORTGROUP) + NETWORK_SECTION_DNS_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_HOST) + NETWORK_SECTION_DNS_TXT = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_TXT) + NETWORK_SECTION_DNS_SRV = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_SRV) +) + +type NetworkUpdateFlags int + +const ( + NETWORK_UPDATE_AFFECT_CURRENT = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CURRENT) + NETWORK_UPDATE_AFFECT_LIVE = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_LIVE) + NETWORK_UPDATE_AFFECT_CONFIG = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CONFIG) +) + +type NetworkEventLifecycleType int + +const ( + NETWORK_EVENT_DEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_DEFINED) + NETWORK_EVENT_UNDEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_UNDEFINED) + NETWORK_EVENT_STARTED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STARTED) + NETWORK_EVENT_STOPPED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STOPPED) +) + +type NetworkEventID int + +const ( + NETWORK_EVENT_ID_LIFECYCLE = NetworkEventID(C.VIR_NETWORK_EVENT_ID_LIFECYCLE) +) + +type Network struct { + ptr C.virNetworkPtr +} + +type NetworkDHCPLease struct { + Iface string + ExpiryTime time.Time + Type IPAddrType + Mac string + Iaid string + IPaddr string + Prefix uint + Hostname string + Clientid string +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkFree +func (n *Network) Free() error { + var err C.virError + ret := C.virNetworkFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkRef +func (c *Network) Ref() error { + var err C.virError + ret := C.virNetworkRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreate +func (n *Network) Create() error { + var err C.virError + result := C.virNetworkCreateWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDestroy +func (n *Network) Destroy() error { + var err C.virError + result := C.virNetworkDestroyWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsActive +func (n *Network) IsActive() (bool, error) { + var err C.virError + result := C.virNetworkIsActiveWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsPersistent +func (n *Network) IsPersistent() (bool, error) { + var err C.virError + result := C.virNetworkIsPersistentWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetAutostart +func (n *Network) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virNetworkGetAutostartWrapper(n.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkSetAutostart +func (n *Network) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virNetworkSetAutostartWrapper(n.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetName +func (n *Network) GetName() (string, error) { + var err C.virError + name := C.virNetworkGetNameWrapper(n.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUID +func (n *Network) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNetworkGetUUIDWrapper(n.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUIDString +func (n *Network) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNetworkGetUUIDStringWrapper(n.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetBridgeName +func (n *Network) GetBridgeName() (string, error) { + var err C.virError + result := C.virNetworkGetBridgeNameWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + bridge := C.GoString(result) + C.free(unsafe.Pointer(result)) + return bridge, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetXMLDesc +func (n *Network) GetXMLDesc(flags NetworkXMLFlags) (string, error) { + var err C.virError + result := C.virNetworkGetXMLDescWrapper(n.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkUndefine +func (n *Network) Undefine() error { + var err C.virError + result := C.virNetworkUndefineWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkUpdate +func (n *Network) Update(cmd NetworkUpdateCommand, section NetworkUpdateSection, parentIndex int, xml string, flags NetworkUpdateFlags) error { + cxml := C.CString(xml) + defer C.free(unsafe.Pointer(cxml)) + var err C.virError + result := C.virNetworkUpdateWrapper(n.ptr, C.uint(cmd), C.uint(section), C.int(parentIndex), cxml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetDHCPLeases +func (n *Network) GetDHCPLeases() ([]NetworkDHCPLease, error) { + if C.LIBVIR_VERSION_NUMBER < 1002006 { + return []NetworkDHCPLease{}, makeNotImplementedError("virNetworkGetDHCPLeases") + } + var cLeases *C.virNetworkDHCPLeasePtr + var err C.virError + numLeases := C.virNetworkGetDHCPLeasesWrapper(n.ptr, nil, (**C.virNetworkDHCPLeasePtr)(&cLeases), C.uint(0), &err) + if numLeases == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cLeases)), + Len: int(numLeases), + Cap: int(numLeases), + } + var leases []NetworkDHCPLease + slice := *(*[]C.virNetworkDHCPLeasePtr)(unsafe.Pointer(&hdr)) + for _, clease := range slice { + leases = append(leases, NetworkDHCPLease{ + Iface: C.GoString(clease.iface), + ExpiryTime: time.Unix(int64(clease.expirytime), 0), + Type: IPAddrType(clease._type), + Mac: C.GoString(clease.mac), + Iaid: C.GoString(clease.iaid), + IPaddr: C.GoString(clease.ipaddr), + Prefix: uint(clease.prefix), + Hostname: C.GoString(clease.hostname), + Clientid: C.GoString(clease.clientid), + }) + C.virNetworkDHCPLeaseFreeWrapper(clease) + } + C.free(unsafe.Pointer(cLeases)) + return leases, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/network_compat.h b/vendor/github.com/libvirt/libvirt-go/network_compat.h new file mode 100644 index 00000000000..08f0778a37d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network_compat.h @@ -0,0 +1,86 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NETWORK_COMPAT_H__ +#define LIBVIRT_GO_NETWORK_COMPAT_H__ + +/* 1.2.1 */ + +#ifndef VIR_NETWORK_EVENT_DEFINED +#define VIR_NETWORK_EVENT_DEFINED 0 +#endif + +#ifndef VIR_NETWORK_EVENT_UNDEFINED +#define VIR_NETWORK_EVENT_UNDEFINED 1 +#endif + +#ifndef VIR_NETWORK_EVENT_STARTED +#define VIR_NETWORK_EVENT_STARTED 2 +#endif + +#ifndef VIR_NETWORK_EVENT_STOPPED +#define VIR_NETWORK_EVENT_STOPPED 3 +#endif + +#ifndef VIR_NETWORK_EVENT_ID_LIFECYCLE +#define VIR_NETWORK_EVENT_ID_LIFECYCLE 0 +#endif + + +#if LIBVIR_VERSION_NUMBER < 1002001 +typedef void (*virConnectNetworkEventGenericCallback)(virConnectPtr conn, + virNetworkPtr net, + void *opaque); +#endif + + +/* 1.2.5 */ + +#ifndef VIR_IP_ADDR_TYPE_IPV4 +#define VIR_IP_ADDR_TYPE_IPV4 0 +#endif + +#ifndef VIR_IP_ADDR_TYPE_IPV6 +#define VIR_IP_ADDR_TYPE_IPV6 1 +#endif + +#if LIBVIR_VERSION_NUMBER < 1002006 +typedef struct _virNetworkDHCPLease virNetworkDHCPLease; +typedef virNetworkDHCPLease *virNetworkDHCPLeasePtr; +struct _virNetworkDHCPLease { + char *iface; /* Network interface name */ + long long expirytime; /* Seconds since epoch */ + int type; /* virIPAddrType */ + char *mac; /* MAC address */ + char *iaid; /* IAID */ + char *ipaddr; /* IP address */ + unsigned int prefix; /* IP address prefix */ + char *hostname; /* Hostname */ + char *clientid; /* Client ID or DUID */ +}; +#endif + +#endif /* LIBVIRT_GO_NETWORK_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/network_events.go b/vendor/github.com/libvirt/libvirt-go/network_events.go new file mode 100644 index 00000000000..2d9bddc3cf0 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network_events.go @@ -0,0 +1,125 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo pkg-config: libvirt +#include "network_events_wrapper.h" +*/ +import "C" + +type NetworkEventLifecycle struct { + Event NetworkEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type NetworkEventLifecycleCallback func(c *Connect, n *Network, event *NetworkEventLifecycle) + +//export networkEventLifecycleCallback +func networkEventLifecycleCallback(c C.virConnectPtr, n C.virNetworkPtr, + event int, detail int, + goCallbackId int) { + + network := &Network{ptr: n} + connection := &Connect{ptr: c} + + eventDetails := &NetworkEventLifecycle{ + Event: NetworkEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NetworkEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, network, eventDetails) +} + +func (c *Connect) NetworkEventLifecycleRegister(net *Network, callback NetworkEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + if C.LIBVIR_VERSION_NUMBER < 1002001 { + return 0, makeNotImplementedError("virConnectNetworkEventRegisterAny") + } + + callbackPtr := unsafe.Pointer(C.networkEventLifecycleCallbackHelper) + var cnet C.virNetworkPtr + if net != nil { + cnet = net.ptr + } + var err C.virError + ret := C.virConnectNetworkEventRegisterAnyWrapper(c.ptr, cnet, + C.VIR_NETWORK_EVENT_ID_LIFECYCLE, + C.virConnectNetworkEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NetworkEventDeregister(callbackId int) error { + if C.LIBVIR_VERSION_NUMBER < 1002001 { + return makeNotImplementedError("virConnectNetworkEventDeregisterAny") + } + // Deregister the callback + var err C.virError + ret := int(C.virConnectNetworkEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e NetworkEventLifecycle) String() string { + var event string + switch e.Event { + case NETWORK_EVENT_DEFINED: + event = "defined" + + case NETWORK_EVENT_UNDEFINED: + event = "undefined" + + case NETWORK_EVENT_STARTED: + event = "started" + + case NETWORK_EVENT_STOPPED: + event = "stopped" + + default: + event = "unknown" + } + + return fmt.Sprintf("Network event=%q", event) +} diff --git a/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go b/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go new file mode 100644 index 00000000000..4e424baa58d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go @@ -0,0 +1,79 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include "network_events_wrapper.h" +#include "callbacks_wrapper.h" + +extern void networkEventLifecycleCallback(virConnectPtr, virNetworkPtr, int, int, int); +void networkEventLifecycleCallbackHelper(virConnectPtr c, virNetworkPtr d, + int event, int detail, void *data) +{ + networkEventLifecycleCallback(c, d, event, detail, (int)(intptr_t)data); +} + +int +virConnectNetworkEventRegisterAnyWrapper(virConnectPtr c, + virNetworkPtr d, + int eventID, + virConnectNetworkEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void* id = (void*)goCallbackId; +#if LIBVIR_VERSION_NUMBER < 1002001 + assert(0); // Caller should have checked version +#else + int ret = virConnectNetworkEventRegisterAny(c, d, eventID, cb, id, freeGoCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + +int virConnectNetworkEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002001 + assert(0); // Caller should have checked version +#else + int ret = virConnectNetworkEventDeregisterAny(conn, callbackID); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h b/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h new file mode 100644 index 00000000000..789837a185a --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h @@ -0,0 +1,55 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NETWORK_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_NETWORK_EVENTS_WRAPPER_H__ + +#include +#include +#include "network_compat.h" + +void +networkEventLifecycleCallbackHelper(virConnectPtr c, + virNetworkPtr d, + int event, + int detail, + void* data); + +int +virConnectNetworkEventRegisterAnyWrapper(virConnectPtr c, + virNetworkPtr d, + int eventID, + virConnectNetworkEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + +int +virConnectNetworkEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NETWORK_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/network_wrapper.go b/vendor/github.com/libvirt/libvirt-go/network_wrapper.go new file mode 100644 index 00000000000..2fc443f21d8 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network_wrapper.go @@ -0,0 +1,267 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "network_wrapper.h" + +int +virNetworkCreateWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = virNetworkCreate(network); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +void +virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease) +{ +#if LIBVIR_VERSION_NUMBER < 1002006 + assert(0); // Caller should have checked version +#else + virNetworkDHCPLeaseFree(lease); +#endif +} + + +int +virNetworkDestroyWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = virNetworkDestroy(network); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkFreeWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = virNetworkFree(network); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkGetAutostartWrapper(virNetworkPtr network, + int *autostart, + virErrorPtr err) +{ + int ret = virNetworkGetAutostart(network, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virNetworkGetBridgeNameWrapper(virNetworkPtr network, + virErrorPtr err) +{ + char * ret = virNetworkGetBridgeName(network); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virNetworkGetConnectWrapper(virNetworkPtr net, + virErrorPtr err) +{ + virConnectPtr ret = virNetworkGetConnect(net); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkGetDHCPLeasesWrapper(virNetworkPtr network, + const char *mac, + virNetworkDHCPLeasePtr **leases, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002006 + assert(0); // Caller should have checked version +#else + int ret = virNetworkGetDHCPLeases(network, mac, leases, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +const char * +virNetworkGetNameWrapper(virNetworkPtr network, + virErrorPtr err) +{ + const char * ret = virNetworkGetName(network); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkGetUUIDWrapper(virNetworkPtr network, + unsigned char *uuid, + virErrorPtr err) +{ + int ret = virNetworkGetUUID(network, uuid); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkGetUUIDStringWrapper(virNetworkPtr network, + char *buf, + virErrorPtr err) +{ + int ret = virNetworkGetUUIDString(network, buf); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virNetworkGetXMLDescWrapper(virNetworkPtr network, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virNetworkGetXMLDesc(network, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkIsActiveWrapper(virNetworkPtr net, + virErrorPtr err) +{ + int ret = virNetworkIsActive(net); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkIsPersistentWrapper(virNetworkPtr net, + virErrorPtr err) +{ + int ret = virNetworkIsPersistent(net); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkRefWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = virNetworkRef(network); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkSetAutostartWrapper(virNetworkPtr network, + int autostart, + virErrorPtr err) +{ + int ret = virNetworkSetAutostart(network, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkUndefineWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = virNetworkUndefine(network); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNetworkUpdateWrapper(virNetworkPtr network, + unsigned int command, + unsigned int section, + int parentIndex, + const char *xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNetworkUpdate(network, command, section, parentIndex, xml, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/network_wrapper.h b/vendor/github.com/libvirt/libvirt-go/network_wrapper.h new file mode 100644 index 00000000000..405bf89a267 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/network_wrapper.h @@ -0,0 +1,119 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NETWORK_WRAPPER_H__ +#define LIBVIRT_GO_NETWORK_WRAPPER_H__ + +#include +#include +#include "network_compat.h" + +int +virNetworkCreateWrapper(virNetworkPtr network, + virErrorPtr err); + +void +virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease); + +int +virNetworkDestroyWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkFreeWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkGetAutostartWrapper(virNetworkPtr network, + int *autostart, + virErrorPtr err); + +char * +virNetworkGetBridgeNameWrapper(virNetworkPtr network, + virErrorPtr err); + +virConnectPtr +virNetworkGetConnectWrapper(virNetworkPtr net, + virErrorPtr err); + +int +virNetworkGetDHCPLeasesWrapper(virNetworkPtr network, + const char *mac, + virNetworkDHCPLeasePtr **leases, + unsigned int flags, + virErrorPtr err); + +const char * +virNetworkGetNameWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkGetUUIDWrapper(virNetworkPtr network, + unsigned char *uuid, + virErrorPtr err); + +int +virNetworkGetUUIDStringWrapper(virNetworkPtr network, + char *buf, + virErrorPtr err); + +char * +virNetworkGetXMLDescWrapper(virNetworkPtr network, + unsigned int flags, + virErrorPtr err); + +int +virNetworkIsActiveWrapper(virNetworkPtr net, + virErrorPtr err); + +int +virNetworkIsPersistentWrapper(virNetworkPtr net, + virErrorPtr err); + +int +virNetworkRefWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkSetAutostartWrapper(virNetworkPtr network, + int autostart, + virErrorPtr err); + +int +virNetworkUndefineWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkUpdateWrapper(virNetworkPtr network, + unsigned int command, + unsigned int section, + int parentIndex, + const char *xml, + unsigned int flags, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NETWORK_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/node_device.go b/vendor/github.com/libvirt/libvirt-go/node_device.go new file mode 100644 index 00000000000..474f288ca77 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device.go @@ -0,0 +1,192 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "node_device_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NodeDeviceEventID int + +const ( + NODE_DEVICE_EVENT_ID_LIFECYCLE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE) + NODE_DEVICE_EVENT_ID_UPDATE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_UPDATE) +) + +type NodeDeviceEventLifecycleType int + +const ( + NODE_DEVICE_EVENT_CREATED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_CREATED) + NODE_DEVICE_EVENT_DELETED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_DELETED) +) + +type NodeDevice struct { + ptr C.virNodeDevicePtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceFree +func (n *NodeDevice) Free() error { + var err C.virError + ret := C.virNodeDeviceFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceRef +func (c *NodeDevice) Ref() error { + var err C.virError + ret := C.virNodeDeviceRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDestroy +func (n *NodeDevice) Destroy() error { + var err C.virError + result := C.virNodeDeviceDestroyWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReset +func (n *NodeDevice) Reset() error { + var err C.virError + result := C.virNodeDeviceResetWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDettach +func (n *NodeDevice) Detach() error { + var err C.virError + result := C.virNodeDeviceDettachWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDetachFlags +func (n *NodeDevice) DetachFlags(driverName string, flags uint32) error { + cDriverName := C.CString(driverName) + defer C.free(unsafe.Pointer(cDriverName)) + var err C.virError + result := C.virNodeDeviceDetachFlagsWrapper(n.ptr, cDriverName, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach +func (n *NodeDevice) ReAttach() error { + var err C.virError + result := C.virNodeDeviceReAttachWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetName +func (n *NodeDevice) GetName() (string, error) { + var err C.virError + name := C.virNodeDeviceGetNameWrapper(n.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetXMLDesc +func (n *NodeDevice) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virNodeDeviceGetXMLDescWrapper(n.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetParent +func (n *NodeDevice) GetParent() (string, error) { + var err C.virError + result := C.virNodeDeviceGetParentWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + defer C.free(unsafe.Pointer(result)) + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceNumOfCaps +func (p *NodeDevice) NumOfCaps() (int, error) { + var err C.virError + result := int(C.virNodeDeviceNumOfCapsWrapper(p.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceListCaps +func (p *NodeDevice) ListCaps() ([]string, error) { + const maxCaps = 1024 + var names [maxCaps](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numCaps := C.virNodeDeviceListCapsWrapper( + p.ptr, + (**C.char)(namesPtr), + maxCaps, &err) + if numCaps == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numCaps) + for k := 0; k < int(numCaps); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_compat.h b/vendor/github.com/libvirt/libvirt-go/node_device_compat.h new file mode 100644 index 00000000000..3202039758c --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device_compat.h @@ -0,0 +1,55 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NODE_DEVICE_COMPAT_H__ +#define LIBVIRT_GO_NODE_DEVICE_COMPAT_H__ + +/* 2.2.0 */ + +#ifndef VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE +#define VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE 0 +#endif + +#ifndef VIR_NODE_DEVICE_EVENT_ID_UPDATE +#define VIR_NODE_DEVICE_EVENT_ID_UPDATE 1 +#endif + +#ifndef VIR_NODE_DEVICE_EVENT_CREATED +#define VIR_NODE_DEVICE_EVENT_CREATED 0 +#endif + +#ifndef VIR_NODE_DEVICE_EVENT_DELETED +#define VIR_NODE_DEVICE_EVENT_DELETED 1 +#endif + +#if LIBVIR_VERSION_NUMBER < 2002000 +typedef void (*virConnectNodeDeviceEventGenericCallback)(virConnectPtr conn, + virNodeDevicePtr dev, + void *opaque); +#endif + + +#endif /* LIBVIRT_GO_NODE_DEVICE_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_events.go b/vendor/github.com/libvirt/libvirt-go/node_device_events.go new file mode 100644 index 00000000000..7920a424382 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device_events.go @@ -0,0 +1,156 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo pkg-config: libvirt +#include "node_device_events_wrapper.h" +*/ +import "C" + +type NodeDeviceEventGenericCallback func(c *Connect, d *NodeDevice) + +type NodeDeviceEventLifecycle struct { + Event NodeDeviceEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type NodeDeviceEventLifecycleCallback func(c *Connect, n *NodeDevice, event *NodeDeviceEventLifecycle) + +//export nodeDeviceEventLifecycleCallback +func nodeDeviceEventLifecycleCallback(c C.virConnectPtr, s C.virNodeDevicePtr, + event int, detail int, + goCallbackId int) { + + node_device := &NodeDevice{ptr: s} + connection := &Connect{ptr: c} + + eventDetails := &NodeDeviceEventLifecycle{ + Event: NodeDeviceEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NodeDeviceEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, node_device, eventDetails) +} + +//export nodeDeviceEventGenericCallback +func nodeDeviceEventGenericCallback(c C.virConnectPtr, d C.virNodeDevicePtr, + goCallbackId int) { + + node_device := &NodeDevice{ptr: d} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NodeDeviceEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, node_device) +} + +func (c *Connect) NodeDeviceEventLifecycleRegister(device *NodeDevice, callback NodeDeviceEventLifecycleCallback) (int, error) { + if C.LIBVIR_VERSION_NUMBER < 2002000 { + return 0, makeNotImplementedError("virConnectNodeDeviceEventRegisterAny") + } + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.nodeDeviceEventLifecycleCallbackHelper) + var cdevice C.virNodeDevicePtr + if device != nil { + cdevice = device.ptr + } + var err C.virError + ret := C.virConnectNodeDeviceEventRegisterAnyWrapper(c.ptr, cdevice, + C.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE, + C.virConnectNodeDeviceEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NodeDeviceEventUpdateRegister(device *NodeDevice, callback NodeDeviceEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.nodeDeviceEventGenericCallbackHelper) + var cdevice C.virNodeDevicePtr + if device != nil { + cdevice = device.ptr + } + var err C.virError + ret := C.virConnectNodeDeviceEventRegisterAnyWrapper(c.ptr, cdevice, + C.VIR_NODE_DEVICE_EVENT_ID_UPDATE, + C.virConnectNodeDeviceEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NodeDeviceEventDeregister(callbackId int) error { + if C.LIBVIR_VERSION_NUMBER < 2002000 { + return makeNotImplementedError("virConnectNodeDeviceEventDeregisterAny") + } + // Deregister the callback + var err C.virError + ret := int(C.virConnectNodeDeviceEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e NodeDeviceEventLifecycle) String() string { + var event string + switch e.Event { + case NODE_DEVICE_EVENT_CREATED: + event = "created" + + case NODE_DEVICE_EVENT_DELETED: + event = "deleted" + + default: + event = "unknown" + } + + return fmt.Sprintf("NodeDevice event=%q", event) +} diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go b/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go new file mode 100644 index 00000000000..8b2e624e6ba --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go @@ -0,0 +1,88 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include "node_device_events_wrapper.h" +#include "callbacks_wrapper.h" + +extern void nodeDeviceEventLifecycleCallback(virConnectPtr, virNodeDevicePtr, int, int, int); +void nodeDeviceEventLifecycleCallbackHelper(virConnectPtr c, virNodeDevicePtr d, + int event, int detail, void *data) +{ + nodeDeviceEventLifecycleCallback(c, d, event, detail, (int)(intptr_t)data); +} + +extern void nodeDeviceEventGenericCallback(virConnectPtr, virNodeDevicePtr, int); +void nodeDeviceEventGenericCallbackHelper(virConnectPtr c, virNodeDevicePtr d, void *data) +{ + nodeDeviceEventGenericCallback(c, d, (int)(intptr_t)data); +} + + +int +virConnectNodeDeviceEventRegisterAnyWrapper(virConnectPtr c, + virNodeDevicePtr d, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void* id = (void*)goCallbackId; +#if LIBVIR_VERSION_NUMBER < 2002000 + assert(0); // Caller should have checked version +#else + int ret = virConnectNodeDeviceEventRegisterAny(c, d, eventID, cb, id, freeGoCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virConnectNodeDeviceEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 2002000 + assert(0); // Caller should have checked version +#else + int ret = virConnectNodeDeviceEventDeregisterAny(conn, callbackID); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h b/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h new file mode 100644 index 00000000000..fb691d2c5db --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h @@ -0,0 +1,60 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NODE_DEVICE_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_NODE_DEVICE_EVENTS_WRAPPER_H__ + +#include +#include +#include "node_device_compat.h" + +void +nodeDeviceEventLifecycleCallbackHelper(virConnectPtr c, + virNodeDevicePtr d, + int event, + int detail, + void* data); + +void +nodeDeviceEventGenericCallbackHelper(virConnectPtr c, + virNodeDevicePtr d, + void* data); + +int +virConnectNodeDeviceEventRegisterAnyWrapper(virConnectPtr c, + virNodeDevicePtr d, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + +int +virConnectNodeDeviceEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NODE_DEVICE_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go b/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go new file mode 100644 index 00000000000..c4e173a37f2 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go @@ -0,0 +1,184 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "node_device_wrapper.h" + + +int +virNodeDeviceDestroyWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceDestroy(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceDetachFlagsWrapper(virNodeDevicePtr dev, + const char *driverName, + unsigned int flags, + virErrorPtr err) +{ + int ret = virNodeDeviceDetachFlags(dev, driverName, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceDettachWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceDettach(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceFreeWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceFree(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virNodeDeviceGetNameWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + const char * ret = virNodeDeviceGetName(dev); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virNodeDeviceGetParentWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + const char * ret = virNodeDeviceGetParent(dev); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virNodeDeviceGetXMLDescWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virNodeDeviceGetXMLDesc(dev, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceListCapsWrapper(virNodeDevicePtr dev, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virNodeDeviceListCaps(dev, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceNumOfCapsWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceNumOfCaps(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceReAttachWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceReAttach(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceRefWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceRef(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNodeDeviceResetWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = virNodeDeviceReset(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h b/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h new file mode 100644 index 00000000000..7670415c504 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h @@ -0,0 +1,88 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NODE_DEVICE_WRAPPER_H__ +#define LIBVIRT_GO_NODE_DEVICE_WRAPPER_H__ + +#include +#include +#include "node_device_compat.h" + + +int +virNodeDeviceDestroyWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceDetachFlagsWrapper(virNodeDevicePtr dev, + const char *driverName, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceDettachWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceFreeWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +const char * +virNodeDeviceGetNameWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +const char * +virNodeDeviceGetParentWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +char * +virNodeDeviceGetXMLDescWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceListCapsWrapper(virNodeDevicePtr dev, + char **const names, + int maxnames, + virErrorPtr err); + +int +virNodeDeviceNumOfCapsWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceReAttachWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceRefWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceResetWrapper(virNodeDevicePtr dev, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NODE_DEVICE_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter.go b/vendor/github.com/libvirt/libvirt-go/nwfilter.go new file mode 100644 index 00000000000..0b55c4123ad --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter.go @@ -0,0 +1,118 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "nwfilter_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NWFilter struct { + ptr C.virNWFilterPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterFree +func (f *NWFilter) Free() error { + var err C.virError + ret := C.virNWFilterFreeWrapper(f.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterRef +func (c *NWFilter) Ref() error { + var err C.virError + ret := C.virNWFilterRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetName +func (f *NWFilter) GetName() (string, error) { + var err C.virError + name := C.virNWFilterGetNameWrapper(f.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterUndefine +func (f *NWFilter) Undefine() error { + var err C.virError + result := C.virNWFilterUndefineWrapper(f.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetUUID +func (f *NWFilter) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNWFilterGetUUIDWrapper(f.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetUUIDString +func (f *NWFilter) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNWFilterGetUUIDStringWrapper(f.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetXMLDesc +func (f *NWFilter) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virNWFilterGetXMLDescWrapper(f.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go new file mode 100644 index 00000000000..e36c1de2e23 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go @@ -0,0 +1,125 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "nwfilter_binding_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NWFilterBinding struct { + ptr C.virNWFilterBindingPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingFree +func (f *NWFilterBinding) Free() error { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return makeNotImplementedError("virNWFilterBindingFree") + } + var err C.virError + ret := C.virNWFilterBindingFreeWrapper(f.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingRef +func (c *NWFilterBinding) Ref() error { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return makeNotImplementedError("virNWFilterBindingRef") + } + var err C.virError + ret := C.virNWFilterBindingRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingDelete +func (f *NWFilterBinding) Delete() error { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return makeNotImplementedError("virNWFilterBindingDelete") + } + var err C.virError + result := C.virNWFilterBindingDeleteWrapper(f.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetPortDev +func (f *NWFilterBinding) GetPortDev() (string, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return "", makeNotImplementedError("virNWFilterBindingGetPortDev") + } + var err C.virError + result := C.virNWFilterBindingGetPortDevWrapper(f.ptr, &err) + if result == nil { + return "", makeError(&err) + } + name := C.GoString(result) + C.free(unsafe.Pointer(result)) + return name, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetFilterName +func (f *NWFilterBinding) GetFilterName() (string, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return "", makeNotImplementedError("virNWFilterBindingGetFilterName") + } + var err C.virError + result := C.virNWFilterBindingGetFilterNameWrapper(f.ptr, &err) + if result == nil { + return "", makeError(&err) + } + name := C.GoString(result) + C.free(unsafe.Pointer(result)) + return name, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetXMLDesc +func (f *NWFilterBinding) GetXMLDesc(flags uint32) (string, error) { + if C.LIBVIR_VERSION_NUMBER < 4005000 { + return "", makeNotImplementedError("virNWFilterBindingGetXMLDesc") + } + var err C.virError + result := C.virNWFilterBindingGetXMLDescWrapper(f.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h new file mode 100644 index 00000000000..1d6fd161f60 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h @@ -0,0 +1,33 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NWFILTER_BINDING_COMPAT_H__ +#define LIBVIRT_GO_NWFILTER_BINDING_COMPAT_H__ + +#if LIBVIR_VERSION_NUMBER < 4005000 +typedef struct _virNWFilterBinding *virNWFilterBindingPtr; +#endif + +#endif /* LIBVIRT_GO_NWFILTER_BINDING_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go new file mode 100644 index 00000000000..b0950b5dbbb --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go @@ -0,0 +1,132 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "nwfilter_binding_wrapper.h" + + +int +virNWFilterBindingDeleteWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + int ret = virNWFilterBindingDelete(binding); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNWFilterBindingFreeWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + int ret = virNWFilterBindingFree(binding); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +const char * +virNWFilterBindingGetFilterNameWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + const char * ret = virNWFilterBindingGetFilterName(binding); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +const char * +virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + const char * ret = virNWFilterBindingGetPortDev(binding); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +char * +virNWFilterBindingGetXMLDescWrapper(virNWFilterBindingPtr binding, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + char * ret = virNWFilterBindingGetXMLDesc(binding, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNWFilterBindingRefWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4005000 + assert(0); // Caller should have checked version +#else + int ret = virNWFilterBindingRef(binding); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h new file mode 100644 index 00000000000..0bcbfb70a84 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h @@ -0,0 +1,60 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NWFILTER_BINDING_WRAPPER_H__ +#define LIBVIRT_GO_NWFILTER_BINDING_WRAPPER_H__ + +#include +#include +#include "nwfilter_binding_compat.h" + + +int +virNWFilterBindingDeleteWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +int +virNWFilterBindingFreeWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +const char * +virNWFilterBindingGetFilterNameWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +const char * +virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +char * +virNWFilterBindingGetXMLDescWrapper(virNWFilterBindingPtr binding, + unsigned int flags, + virErrorPtr err); + +int +virNWFilterBindingRefWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NWFILTER_BINDING_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go b/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go new file mode 100644 index 00000000000..809e527842c --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go @@ -0,0 +1,122 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "nwfilter_wrapper.h" + + +int +virNWFilterFreeWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = virNWFilterFree(nwfilter); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virNWFilterGetNameWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + const char * ret = virNWFilterGetName(nwfilter); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNWFilterGetUUIDWrapper(virNWFilterPtr nwfilter, + unsigned char *uuid, + virErrorPtr err) +{ + int ret = virNWFilterGetUUID(nwfilter, uuid); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNWFilterGetUUIDStringWrapper(virNWFilterPtr nwfilter, + char *buf, + virErrorPtr err) +{ + int ret = virNWFilterGetUUIDString(nwfilter, buf); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virNWFilterGetXMLDescWrapper(virNWFilterPtr nwfilter, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virNWFilterGetXMLDesc(nwfilter, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virNWFilterRefWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = virNWFilterRef(nwfilter); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virNWFilterUndefineWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = virNWFilterUndefine(nwfilter); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h b/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h new file mode 100644 index 00000000000..9a0651cc818 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h @@ -0,0 +1,65 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NWFILTER_WRAPPER_H__ +#define LIBVIRT_GO_NWFILTER_WRAPPER_H__ + +#include +#include + + +int +virNWFilterFreeWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +const char * +virNWFilterGetNameWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +int +virNWFilterGetUUIDWrapper(virNWFilterPtr nwfilter, + unsigned char *uuid, + virErrorPtr err); + +int +virNWFilterGetUUIDStringWrapper(virNWFilterPtr nwfilter, + char *buf, + virErrorPtr err); + +char * +virNWFilterGetXMLDescWrapper(virNWFilterPtr nwfilter, + unsigned int flags, + virErrorPtr err); + +int +virNWFilterRefWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +int +virNWFilterUndefineWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NWFILTER_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/qemu.go b/vendor/github.com/libvirt/libvirt-go/qemu.go new file mode 100644 index 00000000000..a2f8507ff8b --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/qemu.go @@ -0,0 +1,189 @@ +// +build !without_qemu + +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +// Can't rely on pkg-config for libvirt-qemu since it was not +// installed until 2.6.0 onwards +#cgo LDFLAGS: -lvirt-qemu +#include +#include "qemu_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +/* + * QMP has two different kinds of ways to talk to QEMU. One is legacy (HMP, + * or 'human' monitor protocol. The default is QMP, which is all-JSON. + * + * QMP json commands are of the format: + * {"execute" : "query-cpus"} + * + * whereas the same command in 'HMP' would be: + * 'info cpus' + */ + +type DomainQemuMonitorCommandFlags int + +const ( + DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT = DomainQemuMonitorCommandFlags(C.VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT) + DOMAIN_QEMU_MONITOR_COMMAND_HMP = DomainQemuMonitorCommandFlags(C.VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP) +) + +type DomainQemuAgentCommandTimeout int + +const ( + DOMAIN_QEMU_AGENT_COMMAND_MIN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN) + DOMAIN_QEMU_AGENT_COMMAND_BLOCK = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) + DOMAIN_QEMU_AGENT_COMMAND_DEFAULT = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT) + DOMAIN_QEMU_AGENT_COMMAND_NOWAIT = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT) + DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN) +) + +type DomainQemuMonitorEventFlags int + +const ( + CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX = DomainQemuMonitorEventFlags(C.VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX) + CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE = DomainQemuMonitorEventFlags(C.VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE) +) + +func (d *Domain) QemuMonitorCommand(command string, flags DomainQemuMonitorCommandFlags) (string, error) { + var cResult *C.char + cCommand := C.CString(command) + defer C.free(unsafe.Pointer(cCommand)) + var err C.virError + result := C.virDomainQemuMonitorCommandWrapper(d.ptr, cCommand, &cResult, C.uint(flags), &err) + + if result != 0 { + return "", makeError(&err) + } + + rstring := C.GoString(cResult) + C.free(unsafe.Pointer(cResult)) + return rstring, nil +} + +func (d *Domain) QemuAgentCommand(command string, timeout DomainQemuAgentCommandTimeout, flags uint32) (string, error) { + cCommand := C.CString(command) + defer C.free(unsafe.Pointer(cCommand)) + var err C.virError + result := C.virDomainQemuAgentCommandWrapper(d.ptr, cCommand, C.int(timeout), C.uint(flags), &err) + + if result == nil { + return "", makeError(&err) + } + + rstring := C.GoString(result) + C.free(unsafe.Pointer(result)) + return rstring, nil +} + +func (c *Connect) DomainQemuAttach(pid uint32, flags uint32) (*Domain, error) { + var err C.virError + ptr := C.virDomainQemuAttachWrapper(c.ptr, C.uint(pid), C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +type DomainQemuMonitorEvent struct { + Event string + Seconds int64 + Micros uint + Details string +} + +type DomainQemuMonitorEventCallback func(c *Connect, d *Domain, event *DomainQemuMonitorEvent) + +//export domainQemuMonitorEventCallback +func domainQemuMonitorEventCallback(c C.virConnectPtr, d C.virDomainPtr, + event *C.char, seconds C.longlong, micros C.uint, details *C.char, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainQemuMonitorEvent{ + Event: C.GoString(event), + Seconds: int64(seconds), + Micros: uint(micros), + Details: C.GoString(details), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainQemuMonitorEventCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +func (c *Connect) DomainQemuMonitorEventRegister(dom *Domain, event string, callback DomainQemuMonitorEventCallback, flags DomainQemuMonitorEventFlags) (int, error) { + if C.LIBVIR_VERSION_NUMBER < 1002003 { + return 0, makeNotImplementedError("virConnectDomainQemuMonitorEventRegister") + } + + cEvent := C.CString(event) + defer C.free(unsafe.Pointer(cEvent)) + goCallBackId := registerCallbackId(callback) + + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainQemuMonitorEventRegisterWrapper(c.ptr, cdom, + cEvent, + C.long(goCallBackId), + C.uint(flags), &err) + if ret < 0 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainQemuEventDeregister(callbackId int) error { + if C.LIBVIR_VERSION_NUMBER < 1002003 { + return makeNotImplementedError("virConnectDomainQemuMonitorEventDeregister") + } + + // Deregister the callback + var err C.virError + ret := int(C.virConnectDomainQemuMonitorEventDeregisterWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/qemu_compat.h b/vendor/github.com/libvirt/libvirt-go/qemu_compat.h new file mode 100644 index 00000000000..7756d7f84ef --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/qemu_compat.h @@ -0,0 +1,57 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_QEMU_COMPAT_H__ +#define LIBVIRT_GO_QEMU_COMPAT_H__ + +/* 1.2.3 */ + +#if LIBVIR_VERSION_NUMBER < 1002003 +typedef void (*virConnectDomainQemuMonitorEventCallback)(virConnectPtr conn, + virDomainPtr dom, + const char *event, + long long seconds, + unsigned int micros, + const char *details, + void *opaque); +#endif + +#ifndef VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX +#define VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX (1 << 0) +#endif + +#ifndef VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE +#define VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE (1 << 1) +#endif + +/* 1.2.15 */ + +#ifndef VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN +#define VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN 60 +#endif + + +#endif /* LIBVIRT_GO_QEMU_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go b/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go new file mode 100644 index 00000000000..20089d220f1 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go @@ -0,0 +1,133 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +// Can't rely on pkg-config for libvirt-qemu since it was not +// installed until 2.6.0 onwards +#cgo LDFLAGS: -lvirt-qemu +#include +#include +#include "qemu_wrapper.h" +#include "callbacks_wrapper.h" + + +extern void domainQemuMonitorEventCallback(virConnectPtr, virDomainPtr, const char *, long long, unsigned int, const char *, int); +void domainQemuMonitorEventCallbackHelper(virConnectPtr c, virDomainPtr d, + const char *event, long long secs, + unsigned int micros, const char *details, void *data) +{ + domainQemuMonitorEventCallback(c, d, event, secs, micros, details, (int)(intptr_t)data); +} + + +int +virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002003 + assert(0); // Caller should have checked version +#else + int ret = virConnectDomainQemuMonitorEventDeregister(conn, callbackID); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr conn, + virDomainPtr dom, + const char *event, + long goCallbackId, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 1002003 + assert(0); // Caller should have checked version +#else + void *id = (void*)goCallbackId; + int ret = virConnectDomainQemuMonitorEventRegister(conn, dom, event, domainQemuMonitorEventCallbackHelper, + id, freeGoCallbackHelper, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +char * +virDomainQemuAgentCommandWrapper(virDomainPtr domain, + const char *cmd, + int timeout, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virDomainQemuAgentCommand(domain, cmd, timeout, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virDomainPtr +virDomainQemuAttachWrapper(virConnectPtr conn, + unsigned int pid_value, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = virDomainQemuAttach(conn, pid_value, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virDomainQemuMonitorCommandWrapper(virDomainPtr domain, + const char *cmd, + char **result, + unsigned int flags, + virErrorPtr err) +{ + int ret = virDomainQemuMonitorCommand(domain, cmd, result, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h b/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h new file mode 100644 index 00000000000..df389c4f191 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h @@ -0,0 +1,78 @@ + /* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ + +#include +#include +#include +#include "qemu_compat.h" + +void +domainQemuMonitorEventCallbackHelper(virConnectPtr c, + virDomainPtr d, + const char *event, + long long secs, + unsigned int micros, + const char *details, + void *data); + +int +virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr conn, + virDomainPtr dom, + const char *event, + long goCallbackId, + unsigned int flags, + virErrorPtr err); + +char * +virDomainQemuAgentCommandWrapper(virDomainPtr domain, + const char *cmd, + int timeout, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainQemuAttachWrapper(virConnectPtr conn, + unsigned int pid_value, + unsigned int flags, + virErrorPtr err); + +int +virDomainQemuMonitorCommandWrapper(virDomainPtr domain, + const char *cmd, + char **result, + unsigned int flags, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_DOMAIN_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/secret.go b/vendor/github.com/libvirt/libvirt-go/secret.go new file mode 100644 index 00000000000..c4ef44bd5cb --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret.go @@ -0,0 +1,184 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "secret_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +type SecretUsageType int + +const ( + SECRET_USAGE_TYPE_NONE = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_NONE) + SECRET_USAGE_TYPE_VOLUME = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_VOLUME) + SECRET_USAGE_TYPE_CEPH = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_CEPH) + SECRET_USAGE_TYPE_ISCSI = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_ISCSI) + SECRET_USAGE_TYPE_TLS = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_TLS) +) + +type SecretEventLifecycleType int + +const ( + SECRET_EVENT_DEFINED = SecretEventLifecycleType(C.VIR_SECRET_EVENT_DEFINED) + SECRET_EVENT_UNDEFINED = SecretEventLifecycleType(C.VIR_SECRET_EVENT_UNDEFINED) +) + +type SecretEventID int + +const ( + SECRET_EVENT_ID_LIFECYCLE = SecretEventID(C.VIR_SECRET_EVENT_ID_LIFECYCLE) + SECRET_EVENT_ID_VALUE_CHANGED = SecretEventID(C.VIR_SECRET_EVENT_ID_VALUE_CHANGED) +) + +type Secret struct { + ptr C.virSecretPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretFree +func (s *Secret) Free() error { + var err C.virError + ret := C.virSecretFreeWrapper(s.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretRef +func (c *Secret) Ref() error { + var err C.virError + ret := C.virSecretRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretUndefine +func (s *Secret) Undefine() error { + var err C.virError + result := C.virSecretUndefineWrapper(s.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUUID +func (s *Secret) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virSecretGetUUIDWrapper(s.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUUIDString +func (s *Secret) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virSecretGetUUIDStringWrapper(s.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageID +func (s *Secret) GetUsageID() (string, error) { + var err C.virError + result := C.virSecretGetUsageIDWrapper(s.ptr, &err) + if result == nil { + return "", makeError(&err) + } + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageType +func (s *Secret) GetUsageType() (SecretUsageType, error) { + var err C.virError + result := SecretUsageType(C.virSecretGetUsageTypeWrapper(s.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetXMLDesc +func (s *Secret) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virSecretGetXMLDescWrapper(s.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetValue +func (s *Secret) GetValue(flags uint32) ([]byte, error) { + var cvalue_size C.size_t + + var err C.virError + cvalue := C.virSecretGetValueWrapper(s.ptr, &cvalue_size, C.uint(flags), &err) + if cvalue == nil { + return nil, makeError(&err) + } + defer C.free(unsafe.Pointer(cvalue)) + ret := C.GoBytes(unsafe.Pointer(cvalue), C.int(cvalue_size)) + return ret, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretSetValue +func (s *Secret) SetValue(value []byte, flags uint32) error { + cvalue := make([]C.uchar, len(value)) + + for i := 0; i < len(value); i++ { + cvalue[i] = C.uchar(value[i]) + } + + var err C.virError + result := C.virSecretSetValueWrapper(s.ptr, &cvalue[0], C.size_t(len(value)), C.uint(flags), &err) + + if result == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/secret_compat.h b/vendor/github.com/libvirt/libvirt-go/secret_compat.h new file mode 100644 index 00000000000..ba38c68d38f --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret_compat.h @@ -0,0 +1,61 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_SECRET_COMPAT_H__ +#define LIBVIRT_GO_SECRET_COMPAT_H__ + +/* 3.0.0 */ + +#ifndef VIR_SECRET_EVENT_DEFINED +#define VIR_SECRET_EVENT_DEFINED 0 +#endif + +#ifndef VIR_SECRET_EVENT_UNDEFINED +#define VIR_SECRET_EVENT_UNDEFINED 1 +#endif + +#ifndef VIR_SECRET_EVENT_ID_LIFECYCLE +#define VIR_SECRET_EVENT_ID_LIFECYCLE 0 +#endif + +#ifndef VIR_SECRET_EVENT_ID_VALUE_CHANGED +#define VIR_SECRET_EVENT_ID_VALUE_CHANGED 1 +#endif + + +#if LIBVIR_VERSION_NUMBER < 3000000 +typedef void (*virConnectSecretEventGenericCallback)(virConnectPtr conn, + virSecretPtr secret, + void *opaque); +#endif + +/* 2.2.1 */ + +#ifndef VIR_SECRET_USAGE_TYPE_TLS +#define VIR_SECRET_USAGE_TYPE_TLS 4 +#endif + +#endif /* LIBVIRT_GO_SECRET_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/secret_events.go b/vendor/github.com/libvirt/libvirt-go/secret_events.go new file mode 100644 index 00000000000..d928e9858b0 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret_events.go @@ -0,0 +1,159 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo pkg-config: libvirt +#include "secret_events_wrapper.h" +*/ +import "C" + +type SecretEventLifecycle struct { + Event SecretEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type SecretEventLifecycleCallback func(c *Connect, n *Secret, event *SecretEventLifecycle) + +type SecretEventGenericCallback func(c *Connect, n *Secret) + +//export secretEventLifecycleCallback +func secretEventLifecycleCallback(c C.virConnectPtr, n C.virSecretPtr, + event int, detail int, + goCallbackId int) { + + secret := &Secret{ptr: n} + connection := &Connect{ptr: c} + + eventDetails := &SecretEventLifecycle{ + Event: SecretEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(SecretEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, secret, eventDetails) +} + +//export secretEventGenericCallback +func secretEventGenericCallback(c C.virConnectPtr, n C.virSecretPtr, + goCallbackId int) { + + secret := &Secret{ptr: n} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(SecretEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, secret) +} + +func (c *Connect) SecretEventLifecycleRegister(secret *Secret, callback SecretEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + if C.LIBVIR_VERSION_NUMBER < 3000000 { + return 0, makeNotImplementedError("virConnectSecretEventRegisterAny") + } + + callbackPtr := unsafe.Pointer(C.secretEventLifecycleCallbackHelper) + var csecret C.virSecretPtr + if secret != nil { + csecret = secret.ptr + } + var err C.virError + ret := C.virConnectSecretEventRegisterAnyWrapper(c.ptr, csecret, + C.VIR_SECRET_EVENT_ID_LIFECYCLE, + C.virConnectSecretEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) SecretEventValueChangedRegister(secret *Secret, callback SecretEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + if C.LIBVIR_VERSION_NUMBER < 3000000 { + return 0, makeNotImplementedError("virConnectSecretEventRegisterAny") + } + + callbackPtr := unsafe.Pointer(C.secretEventGenericCallbackHelper) + var csecret C.virSecretPtr + if secret != nil { + csecret = secret.ptr + } + var err C.virError + ret := C.virConnectSecretEventRegisterAnyWrapper(c.ptr, csecret, + C.VIR_SECRET_EVENT_ID_VALUE_CHANGED, + C.virConnectSecretEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) SecretEventDeregister(callbackId int) error { + if C.LIBVIR_VERSION_NUMBER < 3000000 { + return makeNotImplementedError("virConnectSecretEventDeregisterAny") + } + // Deregister the callback + var err C.virError + ret := int(C.virConnectSecretEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e SecretEventLifecycle) String() string { + var event string + switch e.Event { + case SECRET_EVENT_DEFINED: + event = "defined" + + case SECRET_EVENT_UNDEFINED: + event = "undefined" + + default: + event = "unknown" + } + + return fmt.Sprintf("Secret event=%q", event) +} diff --git a/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go b/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go new file mode 100644 index 00000000000..a543e7f577f --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go @@ -0,0 +1,88 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include "secret_events_wrapper.h" +#include "callbacks_wrapper.h" + +extern void secretEventLifecycleCallback(virConnectPtr, virSecretPtr, int, int, int); +void secretEventLifecycleCallbackHelper(virConnectPtr c, virSecretPtr d, + int event, int detail, void *data) +{ + secretEventLifecycleCallback(c, d, event, detail, (int)(intptr_t)data); +} + +extern void secretEventGenericCallback(virConnectPtr, virSecretPtr, int); +void secretEventGenericCallbackHelper(virConnectPtr c, virSecretPtr d, + void *data) +{ + secretEventGenericCallback(c, d, (int)(intptr_t)data); +} + + +int +virConnectSecretEventRegisterAnyWrapper(virConnectPtr c, + virSecretPtr d, + int eventID, + virConnectSecretEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void* id = (void*)goCallbackId; +#if LIBVIR_VERSION_NUMBER < 3000000 + assert(0); // Caller should have checked version +#else + int ret = virConnectSecretEventRegisterAny(c, d, eventID, cb, id, freeGoCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + +int virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3000000 + assert(0); // Caller should have checked version +#else + int ret = virConnectSecretEventDeregisterAny(conn, callbackID); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h b/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h new file mode 100644 index 00000000000..5101bc0b963 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h @@ -0,0 +1,58 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__ + +#include +#include +#include "secret_compat.h" + +void +secretEventLifecycleCallbackHelper(virConnectPtr c, + virSecretPtr d, + int event, + int detail, + void* data); + +void secretEventGenericCallbackHelper(virConnectPtr c, + virSecretPtr d, + void* data); + +int +virConnectSecretEventRegisterAnyWrapper(virConnectPtr c, + virSecretPtr d, + int eventID, + virConnectSecretEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + +int +virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +#endif /* LIBVIRT_GO_SECRET_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/secret_wrapper.go b/vendor/github.com/libvirt/libvirt-go/secret_wrapper.go new file mode 100644 index 00000000000..96f60f6f9c6 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret_wrapper.go @@ -0,0 +1,175 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "secret_wrapper.h" + + +int +virSecretFreeWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = virSecretFree(secret); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virSecretGetConnectWrapper(virSecretPtr secret, + virErrorPtr err) +{ + virConnectPtr ret = virSecretGetConnect(secret); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virSecretGetUUIDWrapper(virSecretPtr secret, + unsigned char *uuid, + virErrorPtr err) +{ + int ret = virSecretGetUUID(secret, uuid); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virSecretGetUUIDStringWrapper(virSecretPtr secret, + char *buf, + virErrorPtr err) +{ + int ret = virSecretGetUUIDString(secret, buf); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virSecretGetUsageIDWrapper(virSecretPtr secret, + virErrorPtr err) +{ + const char * ret = virSecretGetUsageID(secret); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virSecretGetUsageTypeWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = virSecretGetUsageType(secret); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +unsigned char * +virSecretGetValueWrapper(virSecretPtr secret, + size_t *value_size, + unsigned int flags, + virErrorPtr err) +{ + unsigned char * ret = virSecretGetValue(secret, value_size, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virSecretGetXMLDescWrapper(virSecretPtr secret, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virSecretGetXMLDesc(secret, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virSecretRefWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = virSecretRef(secret); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virSecretSetValueWrapper(virSecretPtr secret, + const unsigned char *value, + size_t value_size, + unsigned int flags, + virErrorPtr err) +{ + int ret = virSecretSetValue(secret, value, value_size, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virSecretUndefineWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = virSecretUndefine(secret); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/secret_wrapper.h b/vendor/github.com/libvirt/libvirt-go/secret_wrapper.h new file mode 100644 index 00000000000..eca6f0a4c34 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/secret_wrapper.h @@ -0,0 +1,86 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_SECRET_WRAPPER_H__ +#define LIBVIRT_GO_SECRET_WRAPPER_H__ + +#include +#include +#include "secret_compat.h" + +int +virSecretFreeWrapper(virSecretPtr secret, + virErrorPtr err); + +virConnectPtr +virSecretGetConnectWrapper(virSecretPtr secret, + virErrorPtr err); + +int +virSecretGetUUIDWrapper(virSecretPtr secret, + unsigned char *uuid, + virErrorPtr err); + +int +virSecretGetUUIDStringWrapper(virSecretPtr secret, + char *buf, + virErrorPtr err); + +const char * +virSecretGetUsageIDWrapper(virSecretPtr secret, + virErrorPtr err); + +int +virSecretGetUsageTypeWrapper(virSecretPtr secret, + virErrorPtr err); + +unsigned char * +virSecretGetValueWrapper(virSecretPtr secret, + size_t *value_size, + unsigned int flags, + virErrorPtr err); + +char * +virSecretGetXMLDescWrapper(virSecretPtr secret, + unsigned int flags, + virErrorPtr err); + +int +virSecretRefWrapper(virSecretPtr secret, + virErrorPtr err); + +int +virSecretSetValueWrapper(virSecretPtr secret, + const unsigned char *value, + size_t value_size, + unsigned int flags, + virErrorPtr err); + +int +virSecretUndefineWrapper(virSecretPtr secret, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_SECRET_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool.go b/vendor/github.com/libvirt/libvirt-go/storage_pool.go new file mode 100644 index 00000000000..9bfcc79a92b --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool.go @@ -0,0 +1,394 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "storage_pool_wrapper.h" +*/ +import "C" + +import ( + "reflect" + "unsafe" +) + +type StoragePoolState int + +const ( + STORAGE_POOL_INACTIVE = StoragePoolState(C.VIR_STORAGE_POOL_INACTIVE) // Not running + STORAGE_POOL_BUILDING = StoragePoolState(C.VIR_STORAGE_POOL_BUILDING) // Initializing pool,not available + STORAGE_POOL_RUNNING = StoragePoolState(C.VIR_STORAGE_POOL_RUNNING) // Running normally + STORAGE_POOL_DEGRADED = StoragePoolState(C.VIR_STORAGE_POOL_DEGRADED) // Running degraded + STORAGE_POOL_INACCESSIBLE = StoragePoolState(C.VIR_STORAGE_POOL_INACCESSIBLE) // Running,but not accessible +) + +type StoragePoolBuildFlags int + +const ( + STORAGE_POOL_BUILD_NEW = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_NEW) // Regular build from scratch + STORAGE_POOL_BUILD_REPAIR = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_REPAIR) // Repair / reinitialize + STORAGE_POOL_BUILD_RESIZE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_RESIZE) // Extend existing pool + STORAGE_POOL_BUILD_NO_OVERWRITE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_NO_OVERWRITE) // Do not overwrite existing pool + STORAGE_POOL_BUILD_OVERWRITE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_OVERWRITE) // Overwrite data +) + +type StoragePoolCreateFlags int + +const ( + STORAGE_POOL_CREATE_NORMAL = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_NORMAL) + STORAGE_POOL_CREATE_WITH_BUILD = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD) + STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE) + STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE) +) + +type StoragePoolDeleteFlags int + +const ( + STORAGE_POOL_DELETE_NORMAL = StoragePoolDeleteFlags(C.VIR_STORAGE_POOL_DELETE_NORMAL) + STORAGE_POOL_DELETE_ZEROED = StoragePoolDeleteFlags(C.VIR_STORAGE_POOL_DELETE_ZEROED) +) + +type StoragePoolEventID int + +const ( + STORAGE_POOL_EVENT_ID_LIFECYCLE = StoragePoolEventID(C.VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE) + STORAGE_POOL_EVENT_ID_REFRESH = StoragePoolEventID(C.VIR_STORAGE_POOL_EVENT_ID_REFRESH) +) + +type StoragePoolEventLifecycleType int + +const ( + STORAGE_POOL_EVENT_DEFINED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_DEFINED) + STORAGE_POOL_EVENT_UNDEFINED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_UNDEFINED) + STORAGE_POOL_EVENT_STARTED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_STARTED) + STORAGE_POOL_EVENT_STOPPED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_STOPPED) + STORAGE_POOL_EVENT_CREATED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_CREATED) + STORAGE_POOL_EVENT_DELETED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_DELETED) +) + +type StoragePool struct { + ptr C.virStoragePoolPtr +} + +type StoragePoolInfo struct { + State StoragePoolState + Capacity uint64 + Allocation uint64 + Available uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolBuild +func (p *StoragePool) Build(flags StoragePoolBuildFlags) error { + var err C.virError + result := C.virStoragePoolBuildWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolCreate +func (p *StoragePool) Create(flags StoragePoolCreateFlags) error { + var err C.virError + result := C.virStoragePoolCreateWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDelete +func (p *StoragePool) Delete(flags StoragePoolDeleteFlags) error { + var err C.virError + result := C.virStoragePoolDeleteWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDestroy +func (p *StoragePool) Destroy() error { + var err C.virError + result := C.virStoragePoolDestroyWrapper(p.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolFree +func (p *StoragePool) Free() error { + var err C.virError + ret := C.virStoragePoolFreeWrapper(p.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolRef +func (c *StoragePool) Ref() error { + var err C.virError + ret := C.virStoragePoolRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetAutostart +func (p *StoragePool) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virStoragePoolGetAutostartWrapper(p.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetInfo +func (p *StoragePool) GetInfo() (*StoragePoolInfo, error) { + var cinfo C.virStoragePoolInfo + var err C.virError + result := C.virStoragePoolGetInfoWrapper(p.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &StoragePoolInfo{ + State: StoragePoolState(cinfo.state), + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + Available: uint64(cinfo.available), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetName +func (p *StoragePool) GetName() (string, error) { + var err C.virError + name := C.virStoragePoolGetNameWrapper(p.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetUUID +func (p *StoragePool) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virStoragePoolGetUUIDWrapper(p.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetUUIDString +func (p *StoragePool) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virStoragePoolGetUUIDStringWrapper(p.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetXMLDesc +func (p *StoragePool) GetXMLDesc(flags StorageXMLFlags) (string, error) { + var err C.virError + result := C.virStoragePoolGetXMLDescWrapper(p.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolIsActive +func (p *StoragePool) IsActive() (bool, error) { + var err C.virError + result := C.virStoragePoolIsActiveWrapper(p.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolIsPersistent +func (p *StoragePool) IsPersistent() (bool, error) { + var err C.virError + result := C.virStoragePoolIsPersistentWrapper(p.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolSetAutostart +func (p *StoragePool) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virStoragePoolSetAutostartWrapper(p.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolRefresh +func (p *StoragePool) Refresh(flags uint32) error { + var err C.virError + result := C.virStoragePoolRefreshWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolUndefine +func (p *StoragePool) Undefine() error { + var err C.virError + result := C.virStoragePoolUndefineWrapper(p.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXML +func (p *StoragePool) StorageVolCreateXML(xmlConfig string, flags StorageVolCreateFlags) (*StorageVol, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStorageVolCreateXMLWrapper(p.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXMLFrom +func (p *StoragePool) StorageVolCreateXMLFrom(xmlConfig string, clonevol *StorageVol, flags StorageVolCreateFlags) (*StorageVol, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStorageVolCreateXMLFromWrapper(p.ptr, cXml, clonevol.ptr, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByName +func (p *StoragePool) LookupStorageVolByName(name string) (*StorageVol, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virStorageVolLookupByNameWrapper(p.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolNumOfVolumes +func (p *StoragePool) NumOfStorageVolumes() (int, error) { + var err C.virError + result := int(C.virStoragePoolNumOfVolumesWrapper(p.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolListVolumes +func (p *StoragePool) ListStorageVolumes() ([]string, error) { + const maxVols = 1024 + var names [maxVols](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numStorageVols := C.virStoragePoolListVolumesWrapper( + p.ptr, + (**C.char)(namesPtr), + maxVols, &err) + if numStorageVols == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numStorageVols) + for k := 0; k < int(numStorageVols); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolListAllVolumes +func (p *StoragePool) ListAllStorageVolumes(flags uint32) ([]StorageVol, error) { + var cList *C.virStorageVolPtr + var err C.virError + numVols := C.virStoragePoolListAllVolumesWrapper(p.ptr, (**C.virStorageVolPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []StorageVol + slice := *(*[]C.virStorageVolPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, StorageVol{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h b/vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h new file mode 100644 index 00000000000..4df1a0d7b61 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h @@ -0,0 +1,92 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STORAGE_POOL_COMPAT_H__ +#define LIBVIRT_GO_STORAGE_POOL_COMPAT_H__ + +/* 1.3.1 */ + +#ifndef VIR_STORAGE_POOL_CREATE_NORMAL +#define VIR_STORAGE_POOL_CREATE_NORMAL 0 +#endif + +#ifndef VIR_STORAGE_POOL_CREATE_WITH_BUILD +#define VIR_STORAGE_POOL_CREATE_WITH_BUILD 1 << 0 +#endif + +#ifndef VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE +#define VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE 1 << 1 +#endif + +#ifndef VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE +#define VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE 1 << 2 +#endif + + +/* 2.0.0 */ + +#ifndef VIVIR_STORAGE_POOL_EVENT_DEFINED +#define VIR_STORAGE_POOL_EVENT_DEFINED 0 +#endif + +#ifndef VIR_STORAGE_POOL_EVENT_UNDEFINED +#define VIR_STORAGE_POOL_EVENT_UNDEFINED 1 +#endif + +#ifndef VIR_STORAGE_POOL_EVENT_STARTED +#define VIR_STORAGE_POOL_EVENT_STARTED 2 +#endif + +#ifndef VIR_STORAGE_POOL_EVENT_STOPPED +#define VIR_STORAGE_POOL_EVENT_STOPPED 3 +#endif + +#ifndef VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE +#define VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE 0 +#endif + +#ifndef VIR_STORAGE_POOL_EVENT_ID_REFRESH +#define VIR_STORAGE_POOL_EVENT_ID_REFRESH 1 +#endif + +#if LIBVIR_VERSION_NUMBER < 2000000 +typedef void (*virConnectStoragePoolEventGenericCallback)(virConnectPtr conn, + virStoragePoolPtr pool, + void *opaque); +#endif + +/* 3.8.0 */ + +#ifndef VIR_STORAGE_POOL_EVENT_CREATED +#define VIR_STORAGE_POOL_EVENT_CREATED 4 +#endif + +#ifndef VIR_STORAGE_POOL_EVENT_DELETED +#define VIR_STORAGE_POOL_EVENT_DELETED 5 +#endif + + +#endif /* LIBVIRT_GO_STORAGE_POOL_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_events.go b/vendor/github.com/libvirt/libvirt-go/storage_pool_events.go new file mode 100644 index 00000000000..fd1b997994a --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool_events.go @@ -0,0 +1,174 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo pkg-config: libvirt +#include "storage_pool_events_wrapper.h" +*/ +import "C" + +type StoragePoolEventLifecycle struct { + Event StoragePoolEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type StoragePoolEventLifecycleCallback func(c *Connect, n *StoragePool, event *StoragePoolEventLifecycle) + +type StoragePoolEventGenericCallback func(c *Connect, n *StoragePool) + +//export storagePoolEventLifecycleCallback +func storagePoolEventLifecycleCallback(c C.virConnectPtr, s C.virStoragePoolPtr, + event int, detail int, + goCallbackId int) { + + storage_pool := &StoragePool{ptr: s} + connection := &Connect{ptr: c} + + eventDetails := &StoragePoolEventLifecycle{ + Event: StoragePoolEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(StoragePoolEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, storage_pool, eventDetails) +} + +//export storagePoolEventGenericCallback +func storagePoolEventGenericCallback(c C.virConnectPtr, s C.virStoragePoolPtr, + goCallbackId int) { + + storage_pool := &StoragePool{ptr: s} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(StoragePoolEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, storage_pool) +} + +func (c *Connect) StoragePoolEventLifecycleRegister(pool *StoragePool, callback StoragePoolEventLifecycleCallback) (int, error) { + if C.LIBVIR_VERSION_NUMBER < 2000000 { + return 0, makeNotImplementedError("virConnectStoragePoolEventRegisterAny") + } + + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.storagePoolEventLifecycleCallbackHelper) + var cpool C.virStoragePoolPtr + if pool != nil { + cpool = pool.ptr + } + var err C.virError + ret := C.virConnectStoragePoolEventRegisterAnyWrapper(c.ptr, cpool, + C.VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE, + C.virConnectStoragePoolEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) StoragePoolEventRefreshRegister(pool *StoragePool, callback StoragePoolEventGenericCallback) (int, error) { + if C.LIBVIR_VERSION_NUMBER < 2000000 { + return 0, makeNotImplementedError("virConnectStoragePoolEventRegisterAny") + } + + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.storagePoolEventGenericCallbackHelper) + var cpool C.virStoragePoolPtr + if pool != nil { + cpool = pool.ptr + } + var err C.virError + ret := C.virConnectStoragePoolEventRegisterAnyWrapper(c.ptr, cpool, + C.VIR_STORAGE_POOL_EVENT_ID_REFRESH, + C.virConnectStoragePoolEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) StoragePoolEventDeregister(callbackId int) error { + if C.LIBVIR_VERSION_NUMBER < 2000000 { + return makeNotImplementedError("virConnectStoragePoolEventDeregisterAny") + } + + // Deregister the callback + var err C.virError + ret := int(C.virConnectStoragePoolEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e StoragePoolEventLifecycle) String() string { + var event string + switch e.Event { + case STORAGE_POOL_EVENT_DEFINED: + event = "defined" + + case STORAGE_POOL_EVENT_UNDEFINED: + event = "undefined" + + case STORAGE_POOL_EVENT_STARTED: + event = "started" + + case STORAGE_POOL_EVENT_STOPPED: + event = "stopped" + + case STORAGE_POOL_EVENT_CREATED: + event = "created" + + case STORAGE_POOL_EVENT_DELETED: + event = "deleted" + + default: + event = "unknown" + } + + return fmt.Sprintf("StoragePool event=%q", event) +} diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go b/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go new file mode 100644 index 00000000000..c55103812ec --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go @@ -0,0 +1,89 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "storage_pool_events_wrapper.h" +#include "callbacks_wrapper.h" +#include + +extern void storagePoolEventLifecycleCallback(virConnectPtr, virStoragePoolPtr, int, int, int); +void storagePoolEventLifecycleCallbackHelper(virConnectPtr c, virStoragePoolPtr d, + int event, int detail, void *data) +{ + storagePoolEventLifecycleCallback(c, d, event, detail, (int)(intptr_t)data); +} + +extern void storagePoolEventGenericCallback(virConnectPtr, virStoragePoolPtr, int); +void storagePoolEventGenericCallbackHelper(virConnectPtr c, virStoragePoolPtr d, + void *data) +{ + storagePoolEventGenericCallback(c, d, (int)(intptr_t)data); +} + + +int +virConnectStoragePoolEventRegisterAnyWrapper(virConnectPtr c, + virStoragePoolPtr d, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 2000000 + assert(0); // Caller should have checked version +#else + void* id = (void*)goCallbackId; + int ret = virConnectStoragePoolEventRegisterAny(c, d, eventID, cb, id, freeGoCallbackHelper); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virConnectStoragePoolEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 2000000 + assert(0); // Caller shouuld have checked version +#else + int ret = virConnectStoragePoolEventDeregisterAny(conn, callbackID); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h b/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h new file mode 100644 index 00000000000..7007f1c0a84 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h @@ -0,0 +1,59 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STORAGE_POOL_EVENTS_WRAPPER_H__ +#define LIBVIRT_GO_STORAGE_POOL_EVENTS_WRAPPER_H__ + +#include +#include +#include "storage_pool_compat.h" + +void +storagePoolEventLifecycleCallbackHelper(virConnectPtr c, + virStoragePoolPtr d, + int event, + int detail, + void* data); + +void +storagePoolEventGenericCallbackHelper(virConnectPtr c, + virStoragePoolPtr d, + void* data); + +int +virConnectStoragePoolEventRegisterAnyWrapper(virConnectPtr c, + virStoragePoolPtr d, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + +int +virConnectStoragePoolEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +#endif /* LIBVIRT_GO_STORAGE_POOL_EVENTS_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go b/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go new file mode 100644 index 00000000000..8534f7c8cf4 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go @@ -0,0 +1,343 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "storage_pool_wrapper.h" + +int +virStoragePoolBuildWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStoragePoolBuild(pool, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolCreateWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStoragePoolCreate(pool, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolDeleteWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStoragePoolDelete(pool, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolDestroyWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolDestroy(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolFreeWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolFree(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolGetAutostartWrapper(virStoragePoolPtr pool, + int *autostart, + virErrorPtr err) +{ + int ret = virStoragePoolGetAutostart(pool, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virStoragePoolGetConnectWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + virConnectPtr ret = virStoragePoolGetConnect(pool); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolGetInfoWrapper(virStoragePoolPtr pool, + virStoragePoolInfoPtr info, + virErrorPtr err) +{ + int ret = virStoragePoolGetInfo(pool, info); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virStoragePoolGetNameWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + const char * ret = virStoragePoolGetName(pool); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolGetUUIDWrapper(virStoragePoolPtr pool, + unsigned char *uuid, + virErrorPtr err) +{ + int ret = virStoragePoolGetUUID(pool, uuid); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolGetUUIDStringWrapper(virStoragePoolPtr pool, + char *buf, + virErrorPtr err) +{ + int ret = virStoragePoolGetUUIDString(pool, buf); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +char * +virStoragePoolGetXMLDescWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + char * ret = virStoragePoolGetXMLDesc(pool, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolIsActiveWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolIsActive(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolIsPersistentWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolIsPersistent(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolListAllVolumesWrapper(virStoragePoolPtr pool, + virStorageVolPtr **vols, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStoragePoolListAllVolumes(pool, vols, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolListVolumesWrapper(virStoragePoolPtr pool, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = virStoragePoolListVolumes(pool, names, maxnames); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolNumOfVolumesWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolNumOfVolumes(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolRefWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolRef(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolRefreshWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStoragePoolRefresh(pool, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolSetAutostartWrapper(virStoragePoolPtr pool, + int autostart, + virErrorPtr err) +{ + int ret = virStoragePoolSetAutostart(pool, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStoragePoolUndefineWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = virStoragePoolUndefine(pool); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virStorageVolPtr +virStorageVolCreateXMLWrapper(virStoragePoolPtr pool, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virStorageVolPtr ret = virStorageVolCreateXML(pool, xmlDesc, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStorageVolPtr +virStorageVolCreateXMLFromWrapper(virStoragePoolPtr pool, + const char *xmlDesc, + virStorageVolPtr clonevol, + unsigned int flags, + virErrorPtr err) +{ + virStorageVolPtr ret = virStorageVolCreateXMLFrom(pool, xmlDesc, clonevol, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +virStorageVolPtr +virStorageVolLookupByNameWrapper(virStoragePoolPtr pool, + const char *name, + virErrorPtr err) +{ + virStorageVolPtr ret = virStorageVolLookupByName(pool, name); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h b/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h new file mode 100644 index 00000000000..acd121bfb21 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h @@ -0,0 +1,150 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STORAGE_POOL_WRAPPER_H__ +#define LIBVIRT_GO_STORAGE_POOL_WRAPPER_H__ + +#include +#include +#include "storage_pool_compat.h" + +int +virStoragePoolBuildWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolCreateWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolDeleteWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolDestroyWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolFreeWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolGetAutostartWrapper(virStoragePoolPtr pool, + int *autostart, + virErrorPtr err); + +virConnectPtr +virStoragePoolGetConnectWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolGetInfoWrapper(virStoragePoolPtr pool, + virStoragePoolInfoPtr info, + virErrorPtr err); + +const char * +virStoragePoolGetNameWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolGetUUIDWrapper(virStoragePoolPtr pool, + unsigned char *uuid, + virErrorPtr err); + +int +virStoragePoolGetUUIDStringWrapper(virStoragePoolPtr pool, + char *buf, + virErrorPtr err); + +char * +virStoragePoolGetXMLDescWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolIsActiveWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolIsPersistentWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolListAllVolumesWrapper(virStoragePoolPtr pool, + virStorageVolPtr **vols, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolListVolumesWrapper(virStoragePoolPtr pool, + char **const names, + int maxnames, + virErrorPtr err); + +int +virStoragePoolNumOfVolumesWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolRefWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolRefreshWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolSetAutostartWrapper(virStoragePoolPtr pool, + int autostart, + virErrorPtr err); + +int +virStoragePoolUndefineWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +virStorageVolPtr +virStorageVolCreateXMLWrapper(virStoragePoolPtr pool, + const char *xmlDesc, + unsigned int flags, + virErrorPtr err); + +virStorageVolPtr +virStorageVolCreateXMLFromWrapper(virStoragePoolPtr pool, + const char *xmlDesc, + virStorageVolPtr clonevol, + unsigned int flags, + virErrorPtr err); + +virStorageVolPtr +virStorageVolLookupByNameWrapper(virStoragePoolPtr pool, + const char *name, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_STORAGE_POOL_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume.go b/vendor/github.com/libvirt/libvirt-go/storage_volume.go new file mode 100644 index 00000000000..bb10813df90 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_volume.go @@ -0,0 +1,290 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "storage_volume_wrapper.h" +*/ +import "C" + +import ( + "unsafe" +) + +type StorageVolCreateFlags int + +const ( + STORAGE_VOL_CREATE_PREALLOC_METADATA = StorageVolCreateFlags(C.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA) + STORAGE_VOL_CREATE_REFLINK = StorageVolCreateFlags(C.VIR_STORAGE_VOL_CREATE_REFLINK) +) + +type StorageVolDeleteFlags int + +const ( + STORAGE_VOL_DELETE_NORMAL = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_NORMAL) // Delete metadata only (fast) + STORAGE_VOL_DELETE_ZEROED = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_ZEROED) // Clear all data to zeros (slow) + STORAGE_VOL_DELETE_WITH_SNAPSHOTS = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS) // Force removal of volume, even if in use +) + +type StorageVolResizeFlags int + +const ( + STORAGE_VOL_RESIZE_ALLOCATE = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_ALLOCATE) // force allocation of new size + STORAGE_VOL_RESIZE_DELTA = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_DELTA) // size is relative to current + STORAGE_VOL_RESIZE_SHRINK = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_SHRINK) // allow decrease in capacity +) + +type StorageVolType int + +const ( + STORAGE_VOL_FILE = StorageVolType(C.VIR_STORAGE_VOL_FILE) // Regular file based volumes + STORAGE_VOL_BLOCK = StorageVolType(C.VIR_STORAGE_VOL_BLOCK) // Block based volumes + STORAGE_VOL_DIR = StorageVolType(C.VIR_STORAGE_VOL_DIR) // Directory-passthrough based volume + STORAGE_VOL_NETWORK = StorageVolType(C.VIR_STORAGE_VOL_NETWORK) //Network volumes like RBD (RADOS Block Device) + STORAGE_VOL_NETDIR = StorageVolType(C.VIR_STORAGE_VOL_NETDIR) // Network accessible directory that can contain other network volumes + STORAGE_VOL_PLOOP = StorageVolType(C.VIR_STORAGE_VOL_PLOOP) // Ploop directory based volumes +) + +type StorageVolWipeAlgorithm int + +const ( + STORAGE_VOL_WIPE_ALG_ZERO = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_ZERO) // 1-pass, all zeroes + STORAGE_VOL_WIPE_ALG_NNSA = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_NNSA) // 4-pass NNSA Policy Letter NAP-14.1-C (XVI-8) + STORAGE_VOL_WIPE_ALG_DOD = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_DOD) // 4-pass DoD 5220.22-M section 8-306 procedure + STORAGE_VOL_WIPE_ALG_BSI = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_BSI) // 9-pass method recommended by the German Center of Security in Information Technologies + STORAGE_VOL_WIPE_ALG_GUTMANN = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_GUTMANN) // The canonical 35-pass sequence + STORAGE_VOL_WIPE_ALG_SCHNEIER = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER) // 7-pass method described by Bruce Schneier in "Applied Cryptography" (1996) + STORAGE_VOL_WIPE_ALG_PFITZNER7 = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7) // 7-pass random + STORAGE_VOL_WIPE_ALG_PFITZNER33 = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33) // 33-pass random + STORAGE_VOL_WIPE_ALG_RANDOM = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_RANDOM) // 1-pass random + STORAGE_VOL_WIPE_ALG_TRIM = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_TRIM) // Trim the underlying storage +) + +type StorageXMLFlags int + +const ( + STORAGE_XML_INACTIVE = StorageXMLFlags(C.VIR_STORAGE_XML_INACTIVE) +) + +type StorageVolInfoFlags int + +const ( + STORAGE_VOL_USE_ALLOCATION = StorageVolInfoFlags(C.VIR_STORAGE_VOL_USE_ALLOCATION) + STORAGE_VOL_GET_PHYSICAL = StorageVolInfoFlags(C.VIR_STORAGE_VOL_GET_PHYSICAL) +) + +type StorageVolUploadFlags int + +const ( + STORAGE_VOL_UPLOAD_SPARSE_STREAM = StorageVolUploadFlags(C.VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM) +) + +type StorageVolDownloadFlags int + +const ( + STORAGE_VOL_DOWNLOAD_SPARSE_STREAM = StorageVolDownloadFlags(C.VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM) +) + +type StorageVol struct { + ptr C.virStorageVolPtr +} + +type StorageVolInfo struct { + Type StorageVolType + Capacity uint64 + Allocation uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolDelete +func (v *StorageVol) Delete(flags StorageVolDeleteFlags) error { + var err C.virError + result := C.virStorageVolDeleteWrapper(v.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolFree +func (v *StorageVol) Free() error { + var err C.virError + ret := C.virStorageVolFreeWrapper(v.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolRef +func (c *StorageVol) Ref() error { + var err C.virError + ret := C.virStorageVolRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetInfo +func (v *StorageVol) GetInfo() (*StorageVolInfo, error) { + var cinfo C.virStorageVolInfo + var err C.virError + result := C.virStorageVolGetInfoWrapper(v.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &StorageVolInfo{ + Type: StorageVolType(cinfo._type), + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetInfoFlags +func (v *StorageVol) GetInfoFlags(flags StorageVolInfoFlags) (*StorageVolInfo, error) { + if C.LIBVIR_VERSION_NUMBER < 3000000 { + return nil, makeNotImplementedError("virStorageVolGetInfoFlags") + } + + var cinfo C.virStorageVolInfo + var err C.virError + result := C.virStorageVolGetInfoFlagsWrapper(v.ptr, &cinfo, C.uint(flags), &err) + if result == -1 { + return nil, makeError(&err) + } + return &StorageVolInfo{ + Type: StorageVolType(cinfo._type), + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetKey +func (v *StorageVol) GetKey() (string, error) { + var err C.virError + key := C.virStorageVolGetKeyWrapper(v.ptr, &err) + if key == nil { + return "", makeError(&err) + } + return C.GoString(key), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetName +func (v *StorageVol) GetName() (string, error) { + var err C.virError + name := C.virStorageVolGetNameWrapper(v.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetPath +func (v *StorageVol) GetPath() (string, error) { + var err C.virError + result := C.virStorageVolGetPathWrapper(v.ptr, &err) + if result == nil { + return "", makeError(&err) + } + path := C.GoString(result) + C.free(unsafe.Pointer(result)) + return path, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetXMLDesc +func (v *StorageVol) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virStorageVolGetXMLDescWrapper(v.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolResize +func (v *StorageVol) Resize(capacity uint64, flags StorageVolResizeFlags) error { + var err C.virError + result := C.virStorageVolResizeWrapper(v.ptr, C.ulonglong(capacity), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolWipe +func (v *StorageVol) Wipe(flags uint32) error { + var err C.virError + result := C.virStorageVolWipeWrapper(v.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolWipePattern +func (v *StorageVol) WipePattern(algorithm StorageVolWipeAlgorithm, flags uint32) error { + var err C.virError + result := C.virStorageVolWipePatternWrapper(v.ptr, C.uint(algorithm), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolUpload +func (v *StorageVol) Upload(stream *Stream, offset, length uint64, flags StorageVolUploadFlags) error { + var err C.virError + if C.virStorageVolUploadWrapper(v.ptr, stream.ptr, C.ulonglong(offset), + C.ulonglong(length), C.uint(flags), &err) == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolDownload +func (v *StorageVol) Download(stream *Stream, offset, length uint64, flags StorageVolDownloadFlags) error { + var err C.virError + if C.virStorageVolDownloadWrapper(v.ptr, stream.ptr, C.ulonglong(offset), + C.ulonglong(length), C.uint(flags), &err) == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByVolume +func (v *StorageVol) LookupPoolByVolume() (*StoragePool, error) { + var err C.virError + poolPtr := C.virStoragePoolLookupByVolumeWrapper(v.ptr, &err) + if poolPtr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: poolPtr}, nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h b/vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h new file mode 100644 index 00000000000..bd3cee9ac7d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h @@ -0,0 +1,78 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STORAGE_VOLUME_COMPAT_H__ +#define LIBVIRT_GO_STORAGE_VOLUME_COMPAT_H__ + +/* 3.0.0 */ + +#ifndef VIR_STORAGE_VOL_USE_ALLOCATION +#define VIR_STORAGE_VOL_USE_ALLOCATION 0 +#endif + +#ifndef VIR_STORAGE_VOL_GET_PHYSICAL +#define VIR_STORAGE_VOL_GET_PHYSICAL 1 << 0 +#endif + + +/* 1.2.13 */ + +#ifndef VIR_STORAGE_VOL_CREATE_REFLINK +#define VIR_STORAGE_VOL_CREATE_REFLINK 1<< 1 +#endif + + +/* 1.2.21 */ + +#ifndef VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS +#define VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS 1 << 1 +#endif + + +/* 1.3.2 */ + +#ifndef VIR_STORAGE_VOL_WIPE_ALG_TRIM +#define VIR_STORAGE_VOL_WIPE_ALG_TRIM 9 +#endif + + +/* 1.3.4 */ + +#ifndef VIR_STORAGE_VOL_PLOOP +#define VIR_STORAGE_VOL_PLOOP 5 +#endif + +/* 3.4.0 */ + +#ifndef VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM +#define VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM (1 << 0) +#endif + +#ifndef VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM +#define VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM (1 << 0) +#endif + +#endif /* LIBVIRT_GO_STORAGE_VOLUME_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go b/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go new file mode 100644 index 00000000000..d41a8a7cfed --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go @@ -0,0 +1,249 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "storage_volume_wrapper.h" + +virStoragePoolPtr +virStoragePoolLookupByVolumeWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + virStoragePoolPtr ret = virStoragePoolLookupByVolume(vol); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolDeleteWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStorageVolDelete(vol, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolDownloadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStorageVolDownload(vol, stream, offset, length, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolFreeWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + int ret = virStorageVolFree(vol); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +virConnectPtr +virStorageVolGetConnectWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + virConnectPtr ret = virStorageVolGetConnect(vol); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolGetInfoWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + virErrorPtr err) +{ + int ret = virStorageVolGetInfo(vol, info); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3000000 + assert(0); // Caller should have checked version +#else + int ret = virStorageVolGetInfoFlags(vol, info, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +const char * +virStorageVolGetKeyWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + const char *ret = virStorageVolGetKey(vol); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +const char * +virStorageVolGetNameWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + const char *ret = virStorageVolGetName(vol); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virStorageVolGetPathWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + char *ret = virStorageVolGetPath(vol); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +char * +virStorageVolGetXMLDescWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + char *ret = virStorageVolGetXMLDesc(vol, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolRefWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + int ret = virStorageVolRef(vol); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolResizeWrapper(virStorageVolPtr vol, + unsigned long long capacity, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStorageVolResize(vol, capacity, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolUploadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStorageVolUpload(vol, stream, offset, length, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolWipeWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStorageVolWipe(vol, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStorageVolWipePatternWrapper(virStorageVolPtr vol, + unsigned int algorithm, + unsigned int flags, + virErrorPtr err) +{ + int ret = virStorageVolWipePattern(vol, algorithm, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h b/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h new file mode 100644 index 00000000000..b3ed2a9fc7d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h @@ -0,0 +1,116 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STORAGE_VOLUME_WRAPPER_H__ +#define LIBVIRT_GO_STORAGE_VOLUME_WRAPPER_H__ + +#include +#include +#include "storage_volume_compat.h" + +virStoragePoolPtr +virStoragePoolLookupByVolumeWrapper(virStorageVolPtr vol, + virErrorPtr err); + +int +virStorageVolDeleteWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolDownloadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolFreeWrapper(virStorageVolPtr vol, + virErrorPtr err); + +virConnectPtr +virStorageVolGetConnectWrapper(virStorageVolPtr vol, + virErrorPtr err); + +int +virStorageVolGetInfoWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + virErrorPtr err); + +int +virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + unsigned int flags, + virErrorPtr err); + +const char * +virStorageVolGetKeyWrapper(virStorageVolPtr vol, + virErrorPtr err); + +const char * +virStorageVolGetNameWrapper(virStorageVolPtr vol, + virErrorPtr err); + +char * +virStorageVolGetPathWrapper(virStorageVolPtr vol, + virErrorPtr err); + +char * +virStorageVolGetXMLDescWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolRefWrapper(virStorageVolPtr vol, + virErrorPtr err); + +int +virStorageVolResizeWrapper(virStorageVolPtr vol, + unsigned long long capacity, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolUploadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolWipeWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolWipePatternWrapper(virStorageVolPtr vol, + unsigned int algorithm, + unsigned int flags, + virErrorPtr err); + +#endif /* LIBVIRT_GO_STORAGE_VOLUME_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/stream.go b/vendor/github.com/libvirt/libvirt-go/stream.go new file mode 100644 index 00000000000..4010b11cc8c --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/stream.go @@ -0,0 +1,418 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include "stream_wrapper.h" +*/ +import "C" +import ( + "io" + "unsafe" +) + +type StreamFlags int + +const ( + STREAM_NONBLOCK = StreamFlags(C.VIR_STREAM_NONBLOCK) +) + +type StreamEventType int + +const ( + STREAM_EVENT_READABLE = StreamEventType(C.VIR_STREAM_EVENT_READABLE) + STREAM_EVENT_WRITABLE = StreamEventType(C.VIR_STREAM_EVENT_WRITABLE) + STREAM_EVENT_ERROR = StreamEventType(C.VIR_STREAM_EVENT_ERROR) + STREAM_EVENT_HANGUP = StreamEventType(C.VIR_STREAM_EVENT_HANGUP) +) + +type StreamRecvFlagsValues int + +const ( + STREAM_RECV_STOP_AT_HOLE = StreamRecvFlagsValues(C.VIR_STREAM_RECV_STOP_AT_HOLE) +) + +type Stream struct { + ptr C.virStreamPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamAbort +func (v *Stream) Abort() error { + var err C.virError + result := C.virStreamAbortWrapper(v.ptr, &err) + if result == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamFinish +func (v *Stream) Finish() error { + var err C.virError + result := C.virStreamFinishWrapper(v.ptr, &err) + if result == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamFree +func (v *Stream) Free() error { + var err C.virError + ret := C.virStreamFreeWrapper(v.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRef +func (c *Stream) Ref() error { + var err C.virError + ret := C.virStreamRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecv +func (v *Stream) Recv(p []byte) (int, error) { + var err C.virError + n := C.virStreamRecvWrapper(v.ptr, (*C.char)(unsafe.Pointer(&p[0])), C.size_t(len(p)), &err) + if n < 0 { + return 0, makeError(&err) + } + if n == 0 { + return 0, io.EOF + } + + return int(n), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvFlags +func (v *Stream) RecvFlags(p []byte, flags StreamRecvFlagsValues) (int, error) { + if C.LIBVIR_VERSION_NUMBER < 3004000 { + return 0, makeNotImplementedError("virStreamRecvFlags") + } + + var err C.virError + n := C.virStreamRecvFlagsWrapper(v.ptr, (*C.char)(unsafe.Pointer(&p[0])), C.size_t(len(p)), C.uint(flags), &err) + if n < 0 { + return 0, makeError(&err) + } + if n == 0 { + return 0, io.EOF + } + + return int(n), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvHole +func (v *Stream) RecvHole(flags uint) (int64, error) { + if C.LIBVIR_VERSION_NUMBER < 3004000 { + return 0, makeNotImplementedError("virStreamSparseRecvHole") + } + + var len C.longlong + var err C.virError + ret := C.virStreamRecvHoleWrapper(v.ptr, &len, C.uint(flags), &err) + if ret < 0 { + return 0, makeError(&err) + } + + return int64(len), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSend +func (v *Stream) Send(p []byte) (int, error) { + var err C.virError + n := C.virStreamSendWrapper(v.ptr, (*C.char)(unsafe.Pointer(&p[0])), C.size_t(len(p)), &err) + if n < 0 { + return 0, makeError(&err) + } + if n == 0 { + return 0, io.EOF + } + + return int(n), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSendHole +func (v *Stream) SendHole(len int64, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 3004000 { + return makeNotImplementedError("virStreamSendHole") + } + + var err C.virError + ret := C.virStreamSendHoleWrapper(v.ptr, C.longlong(len), C.uint(flags), &err) + if ret < 0 { + return makeError(&err) + } + + return nil +} + +type StreamSinkFunc func(*Stream, []byte) (int, error) +type StreamSinkHoleFunc func(*Stream, int64) error + +//export streamSinkCallback +func streamSinkCallback(stream C.virStreamPtr, cdata *C.char, nbytes C.size_t, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSinkFunc) + if !ok { + panic("Incorrect stream sink func callback") + } + + data := make([]byte, int(nbytes)) + for i := 0; i < int(nbytes); i++ { + cdatabyte := (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cdata)) + (unsafe.Sizeof(*cdata) * uintptr(i)))) + data[i] = (byte)(*cdatabyte) + } + + retnbytes, err := callback(&Stream{ptr: stream}, data) + if err != nil { + return -1 + } + + return retnbytes +} + +//export streamSinkHoleCallback +func streamSinkHoleCallback(stream C.virStreamPtr, length C.longlong, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSinkHoleFunc) + if !ok { + panic("Incorrect stream sink hole func callback") + } + + err := callback(&Stream{ptr: stream}, int64(length)) + if err != nil { + return -1 + } + + return 0 +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvAll +func (v *Stream) RecvAll(handler StreamSinkFunc) error { + + callbackID := registerCallbackId(handler) + + var err C.virError + ret := C.virStreamRecvAllWrapper(v.ptr, (C.int)(callbackID), &err) + freeCallbackId(callbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSparseRecvAll +func (v *Stream) SparseRecvAll(handler StreamSinkFunc, holeHandler StreamSinkHoleFunc) error { + if C.LIBVIR_VERSION_NUMBER < 3004000 { + return makeNotImplementedError("virStreamSparseSendAll") + } + + callbackID := registerCallbackId(handler) + holeCallbackID := registerCallbackId(holeHandler) + + var err C.virError + ret := C.virStreamSparseRecvAllWrapper(v.ptr, (C.int)(callbackID), (C.int)(holeCallbackID), &err) + freeCallbackId(callbackID) + freeCallbackId(holeCallbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type StreamSourceFunc func(*Stream, int) ([]byte, error) +type StreamSourceHoleFunc func(*Stream) (bool, int64, error) +type StreamSourceSkipFunc func(*Stream, int64) error + +//export streamSourceCallback +func streamSourceCallback(stream C.virStreamPtr, cdata *C.char, nbytes C.size_t, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSourceFunc) + if !ok { + panic("Incorrect stream sink func callback") + } + + data, err := callback(&Stream{ptr: stream}, (int)(nbytes)) + if err != nil { + return -1 + } + + nretbytes := int(nbytes) + if len(data) < nretbytes { + nretbytes = len(data) + } + + for i := 0; i < nretbytes; i++ { + cdatabyte := (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cdata)) + (unsafe.Sizeof(*cdata) * uintptr(i)))) + *cdatabyte = (C.char)(data[i]) + } + + return nretbytes +} + +//export streamSourceHoleCallback +func streamSourceHoleCallback(stream C.virStreamPtr, cinData *C.int, clength *C.longlong, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSourceHoleFunc) + if !ok { + panic("Incorrect stream sink hole func callback") + } + + inData, length, err := callback(&Stream{ptr: stream}) + if err != nil { + return -1 + } + + if inData { + *cinData = 1 + } else { + *cinData = 0 + } + *clength = C.longlong(length) + + return 0 +} + +//export streamSourceSkipCallback +func streamSourceSkipCallback(stream C.virStreamPtr, length C.longlong, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSourceSkipFunc) + if !ok { + panic("Incorrect stream sink skip func callback") + } + + err := callback(&Stream{ptr: stream}, int64(length)) + if err != nil { + return -1 + } + + return 0 +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSendAll +func (v *Stream) SendAll(handler StreamSourceFunc) error { + + callbackID := registerCallbackId(handler) + + var err C.virError + ret := C.virStreamSendAllWrapper(v.ptr, (C.int)(callbackID), &err) + freeCallbackId(callbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSparseSendAll +func (v *Stream) SparseSendAll(handler StreamSourceFunc, holeHandler StreamSourceHoleFunc, skipHandler StreamSourceSkipFunc) error { + if C.LIBVIR_VERSION_NUMBER < 3004000 { + return makeNotImplementedError("virStreamSparseSendAll") + } + + callbackID := registerCallbackId(handler) + holeCallbackID := registerCallbackId(holeHandler) + skipCallbackID := registerCallbackId(skipHandler) + + var err C.virError + ret := C.virStreamSparseSendAllWrapper(v.ptr, (C.int)(callbackID), (C.int)(holeCallbackID), (C.int)(skipCallbackID), &err) + freeCallbackId(callbackID) + freeCallbackId(holeCallbackID) + freeCallbackId(skipCallbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type StreamEventCallback func(*Stream, StreamEventType) + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamEventAddCallback +func (v *Stream) EventAddCallback(events StreamEventType, callback StreamEventCallback) error { + callbackID := registerCallbackId(callback) + + var err C.virError + ret := C.virStreamEventAddCallbackWrapper(v.ptr, (C.int)(events), (C.int)(callbackID), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +//export streamEventCallback +func streamEventCallback(st C.virStreamPtr, events int, callbackID int) { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamEventCallback) + if !ok { + panic("Incorrect stream event func callback") + } + + callback(&Stream{ptr: st}, StreamEventType(events)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamEventUpdateCallback +func (v *Stream) EventUpdateCallback(events StreamEventType) error { + var err C.virError + ret := C.virStreamEventUpdateCallbackWrapper(v.ptr, (C.int)(events), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamEventRemoveCallback +func (v *Stream) EventRemoveCallback() error { + var err C.virError + ret := C.virStreamEventRemoveCallbackWrapper(v.ptr, &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/stream_compat.h b/vendor/github.com/libvirt/libvirt-go/stream_compat.h new file mode 100644 index 00000000000..92befd58e5d --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/stream_compat.h @@ -0,0 +1,36 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STREAM_COMPAT_H__ +#define LIBVIRT_GO_STREAM_COMPAT_H__ + +/* 3.4.0 */ + +#ifndef VIR_STREAM_RECV_STOP_AT_HOLE +#define VIR_STREAM_RECV_STOP_AT_HOLE (1 << 0) +#endif + +#endif /* LIBVIRT_GO_STREAM_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/stream_wrapper.go b/vendor/github.com/libvirt/libvirt-go/stream_wrapper.go new file mode 100644 index 00000000000..e563a742858 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/stream_wrapper.go @@ -0,0 +1,331 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include "stream_wrapper.h" + +int streamSourceCallback(virStreamPtr st, char *cdata, size_t nbytes, int callbackID); +int streamSourceHoleCallback(virStreamPtr st, int *inData, long long *length, int callbackID); +int streamSourceSkipCallback(virStreamPtr st, long long length, int callbackID); + +int streamSinkCallback(virStreamPtr st, const char *cdata, size_t nbytes, int callbackID); +int streamSinkHoleCallback(virStreamPtr st, long long length, int callbackID); + +struct CallbackData { + int callbackID; + int holeCallbackID; + int skipCallbackID; +}; + +static int streamSourceCallbackHelper(virStreamPtr st, char *data, size_t nbytes, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSourceCallback(st, data, nbytes, cbdata->callbackID); +} + +static int streamSourceHoleCallbackHelper(virStreamPtr st, int *inData, long long *length, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSourceHoleCallback(st, inData, length, cbdata->holeCallbackID); +} + +static int streamSourceSkipCallbackHelper(virStreamPtr st, long long length, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSourceSkipCallback(st, length, cbdata->skipCallbackID); +} + +static int streamSinkCallbackHelper(virStreamPtr st, const char *data, size_t nbytes, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSinkCallback(st, data, nbytes, cbdata->callbackID); +} + +static int streamSinkHoleCallbackHelper(virStreamPtr st, long long length, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSinkHoleCallback(st, length, cbdata->holeCallbackID); +} + +int +virStreamAbortWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = virStreamAbort(stream); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +void +streamEventCallback(virStreamPtr st, int events, int callbackID); + +static void +streamEventCallbackHelper(virStreamPtr st, int events, void *opaque) +{ + streamEventCallback(st, events, (int)(intptr_t)opaque); +} + +int +virStreamEventAddCallbackWrapper(virStreamPtr stream, + int events, + int callbackID, + virErrorPtr err) +{ + int ret = virStreamEventAddCallback(stream, events, streamEventCallbackHelper, (void *)(intptr_t)callbackID, NULL); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamEventRemoveCallbackWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = virStreamEventRemoveCallback(stream); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamEventUpdateCallbackWrapper(virStreamPtr stream, + int events, + virErrorPtr err) +{ + int ret = virStreamEventUpdateCallback(stream, events); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamFinishWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = virStreamFinish(stream); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamFreeWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = virStreamFree(stream); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamRecvWrapper(virStreamPtr stream, + char *data, + size_t nbytes, + virErrorPtr err) +{ + int ret = virStreamRecv(stream, data, nbytes); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamRecvAllWrapper(virStreamPtr stream, + int callbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID }; + int ret = virStreamRecvAll(stream, streamSinkCallbackHelper, &cbdata); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamRecvFlagsWrapper(virStreamPtr stream, + char *data, + size_t nbytes, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3004000 + assert(0); // Caller should have checked version +#else + int ret = virStreamRecvFlags(stream, data, nbytes, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virStreamRecvHoleWrapper(virStreamPtr stream, + long long *length, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3004000 + assert(0); // Caller should have checked version +#else + int ret = virStreamRecvHole(stream, length, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virStreamRefWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = virStreamRef(stream); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamSendWrapper(virStreamPtr stream, + const char *data, + size_t nbytes, + virErrorPtr err) +{ + int ret = virStreamSend(stream, data, nbytes); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamSendAllWrapper(virStreamPtr stream, + int callbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID }; + int ret = virStreamSendAll(stream, streamSourceCallbackHelper, &cbdata); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +} + + +int +virStreamSendHoleWrapper(virStreamPtr stream, + long long length, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 3004000 + assert(0); // Caller should have checked version +#else + int ret = virStreamSendHole(stream, length, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virStreamSparseRecvAllWrapper(virStreamPtr stream, + int callbackID, + int holeCallbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID, .holeCallbackID = holeCallbackID }; +#if LIBVIR_VERSION_NUMBER < 3004000 + assert(0); // Caller should have checked version +#else + int ret = virStreamSparseRecvAll(stream, streamSinkCallbackHelper, streamSinkHoleCallbackHelper, &cbdata); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virStreamSparseSendAllWrapper(virStreamPtr stream, + int callbackID, + int holeCallbackID, + int skipCallbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID, .holeCallbackID = holeCallbackID, .skipCallbackID = skipCallbackID }; +#if LIBVIR_VERSION_NUMBER < 3004000 + assert(0); // Caller should have checked version +#else + int ret = virStreamSparseSendAll(stream, streamSourceCallbackHelper, streamSourceHoleCallbackHelper, streamSourceSkipCallbackHelper, &cbdata); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +*/ +import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/stream_wrapper.h b/vendor/github.com/libvirt/libvirt-go/stream_wrapper.h new file mode 100644 index 00000000000..b9c6e57cd62 --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/stream_wrapper.h @@ -0,0 +1,120 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STREAM_WRAPPER_H__ +#define LIBVIRT_GO_STREAM_WRAPPER_H__ + +#include +#include +#include "stream_compat.h" + +int +virStreamAbortWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamEventAddCallbackWrapper(virStreamPtr st, + int events, + int callbackID, + virErrorPtr err); + +int +virStreamEventRemoveCallbackWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamEventUpdateCallbackWrapper(virStreamPtr stream, + int events, + virErrorPtr err); + +int +virStreamFinishWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamFreeWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamRecvWrapper(virStreamPtr stream, + char *data, + size_t nbytes, + virErrorPtr err); + +int +virStreamRecvAllWrapper(virStreamPtr st, + int callbackID, + virErrorPtr err); + +int +virStreamRecvFlagsWrapper(virStreamPtr st, + char *data, + size_t nbytes, + unsigned int flags, + virErrorPtr err); + +int +virStreamRecvHoleWrapper(virStreamPtr, + long long *length, + unsigned int flags, + virErrorPtr err); + +int +virStreamRefWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamSendWrapper(virStreamPtr stream, + const char *data, + size_t nbytes, + virErrorPtr err); + +int +virStreamSendAllWrapper(virStreamPtr st, + int callbackID, + virErrorPtr err); + +int +virStreamSendHoleWrapper(virStreamPtr st, + long long length, + unsigned int flags, + virErrorPtr err); + +int +virStreamSparseRecvAllWrapper(virStreamPtr st, + int callbackID, + int holeCallbackID, + virErrorPtr err); + +int +virStreamSparseSendAllWrapper(virStreamPtr st, + int callbackID, + int holeCallbackID, + int skipCallbackID, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_STREAM_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/typedparams.go b/vendor/github.com/libvirt/libvirt-go/typedparams.go new file mode 100644 index 00000000000..e8ceae07e1e --- /dev/null +++ b/vendor/github.com/libvirt/libvirt-go/typedparams.go @@ -0,0 +1,262 @@ +/* + * This file is part of the libvirt-go project + * + * 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. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +*/ +import "C" + +import ( + "fmt" + "unsafe" +) + +type typedParamsFieldInfo struct { + set *bool + i *int + ui *uint + l *int64 + ul *uint64 + b *bool + d *float64 + s *string + sl *[]string +} + +func typedParamsUnpackLen(cparams *C.virTypedParameter, nparams int, infomap map[string]typedParamsFieldInfo) (uint, error) { + count := uint(0) + for i := 0; i < nparams; i++ { + var cparam *C.virTypedParameter + cparam = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + unsafe.Sizeof(*cparam)*uintptr(i))) + name := C.GoString((*C.char)(unsafe.Pointer(&cparam.field))) + info, ok := infomap[name] + if !ok { + // Ignore unknown keys so that we don't break if + // run against a newer libvirt that returns more + // parameters than we currently have code to + // consume + continue + } + switch cparam._type { + case C.VIR_TYPED_PARAM_INT: + if info.i == nil { + return 0, fmt.Errorf("field %s expects an int", name) + } + *info.i = int(*(*C.int)(unsafe.Pointer(&cparam.value))) + *info.set = true + case C.VIR_TYPED_PARAM_UINT: + if info.ui == nil { + return 0, fmt.Errorf("field %s expects a uint", name) + } + *info.ui = uint(*(*C.uint)(unsafe.Pointer(&cparam.value))) + *info.set = true + case C.VIR_TYPED_PARAM_LLONG: + if info.l == nil { + return 0, fmt.Errorf("field %s expects an int64", name) + } + *info.l = int64(*(*C.longlong)(unsafe.Pointer(&cparam.value))) + *info.set = true + case C.VIR_TYPED_PARAM_ULLONG: + if info.ul == nil { + return 0, fmt.Errorf("field %s expects a uint64", name) + } + *info.ul = uint64(*(*C.ulonglong)(unsafe.Pointer(&cparam.value))) + *info.set = true + case C.VIR_TYPED_PARAM_DOUBLE: + if info.d == nil { + return 0, fmt.Errorf("field %s expects a float64", name) + } + *info.d = float64(*(*C.double)(unsafe.Pointer(&cparam.value))) + *info.set = true + case C.VIR_TYPED_PARAM_BOOLEAN: + if info.b == nil { + return 0, fmt.Errorf("field %s expects a bool", name) + } + *info.b = *(*C.char)(unsafe.Pointer(&cparam.value)) == 1 + *info.set = true + case C.VIR_TYPED_PARAM_STRING: + if info.s != nil { + *info.s = C.GoString(*(**C.char)(unsafe.Pointer(&cparam.value))) + *info.set = true + } else if info.sl != nil { + *info.sl = append(*info.sl, C.GoString(*(**C.char)(unsafe.Pointer(&cparam.value)))) + *info.set = true + } else { + return 0, fmt.Errorf("field %s expects a string/string list", name) + } + } + count++ + } + + return count, nil +} + +func typedParamsUnpack(cparams []C.virTypedParameter, infomap map[string]typedParamsFieldInfo) (uint, error) { + return typedParamsUnpackLen(&cparams[0], len(cparams), infomap) +} + +func typedParamsPackLen(cparams *C.virTypedParameter, nparams int, infomap map[string]typedParamsFieldInfo) error { + stringOffsets := make(map[string]uint) + + for i := 0; i < nparams; i++ { + var cparam *C.virTypedParameter + cparam = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + unsafe.Sizeof(*cparam)*uintptr(i))) + name := C.GoString((*C.char)(unsafe.Pointer(&cparam.field))) + info, ok := infomap[name] + if !ok { + // Ignore unknown keys so that we don't break if + // run against a newer libvirt that returns more + // parameters than we currently have code to + // consume + continue + } + if !*info.set { + continue + } + switch cparam._type { + case C.VIR_TYPED_PARAM_INT: + if info.i == nil { + return fmt.Errorf("field %s expects an int", name) + } + *(*C.int)(unsafe.Pointer(&cparam.value)) = C.int(*info.i) + case C.VIR_TYPED_PARAM_UINT: + if info.ui == nil { + return fmt.Errorf("field %s expects a uint", name) + } + *(*C.uint)(unsafe.Pointer(&cparam.value)) = C.uint(*info.ui) + case C.VIR_TYPED_PARAM_LLONG: + if info.l == nil { + return fmt.Errorf("field %s expects an int64", name) + } + *(*C.longlong)(unsafe.Pointer(&cparam.value)) = C.longlong(*info.l) + case C.VIR_TYPED_PARAM_ULLONG: + if info.ul == nil { + return fmt.Errorf("field %s expects a uint64", name) + } + *(*C.ulonglong)(unsafe.Pointer(&cparam.value)) = C.ulonglong(*info.ul) + case C.VIR_TYPED_PARAM_DOUBLE: + if info.d == nil { + return fmt.Errorf("field %s expects a float64", name) + } + *(*C.double)(unsafe.Pointer(&cparam.value)) = C.double(*info.d) + case C.VIR_TYPED_PARAM_BOOLEAN: + if info.b == nil { + return fmt.Errorf("field %s expects a bool", name) + } + if *info.b { + *(*C.char)(unsafe.Pointer(&cparam.value)) = 1 + } else { + *(*C.char)(unsafe.Pointer(&cparam.value)) = 0 + } + case C.VIR_TYPED_PARAM_STRING: + if info.s != nil { + *(**C.char)(unsafe.Pointer(&cparam.value)) = C.CString(*info.s) + } else if info.sl != nil { + count := stringOffsets[name] + *(**C.char)(unsafe.Pointer(&cparam.value)) = C.CString((*info.sl)[count]) + stringOffsets[name] = count + 1 + } else { + return fmt.Errorf("field %s expects a string", name) + } + } + } + + return nil +} + +func typedParamsPack(cparams []C.virTypedParameter, infomap map[string]typedParamsFieldInfo) error { + return typedParamsPackLen(&cparams[0], len(cparams), infomap) +} + +func typedParamsPackNew(infomap map[string]typedParamsFieldInfo) (*[]C.virTypedParameter, error) { + nparams := 0 + for _, value := range infomap { + if !*value.set { + continue + } + + if value.sl != nil { + nparams += len(*value.sl) + } else { + nparams++ + } + } + + cparams := make([]C.virTypedParameter, nparams) + nparams = 0 + for key, value := range infomap { + if !*value.set { + continue + } + + cfield := C.CString(key) + defer C.free(unsafe.Pointer(cfield)) + clen := len(key) + 1 + if clen > C.VIR_TYPED_PARAM_FIELD_LENGTH { + clen = C.VIR_TYPED_PARAM_FIELD_LENGTH + } + if value.sl != nil { + for i := 0; i < len(*value.sl); i++ { + cparam := &cparams[nparams] + cparam._type = C.VIR_TYPED_PARAM_STRING + C.memcpy(unsafe.Pointer(&cparam.field[0]), unsafe.Pointer(cfield), C.size_t(clen)) + nparams++ + } + } else { + cparam := &cparams[nparams] + if value.i != nil { + cparam._type = C.VIR_TYPED_PARAM_INT + } else if value.ui != nil { + cparam._type = C.VIR_TYPED_PARAM_UINT + } else if value.l != nil { + cparam._type = C.VIR_TYPED_PARAM_LLONG + } else if value.ul != nil { + cparam._type = C.VIR_TYPED_PARAM_ULLONG + } else if value.b != nil { + cparam._type = C.VIR_TYPED_PARAM_BOOLEAN + } else if value.d != nil { + cparam._type = C.VIR_TYPED_PARAM_DOUBLE + } else if value.s != nil { + cparam._type = C.VIR_TYPED_PARAM_STRING + } + C.memcpy(unsafe.Pointer(&cparam.field[0]), unsafe.Pointer(cfield), C.size_t(clen)) + nparams++ + } + } + + err := typedParamsPack(cparams, infomap) + if err != nil { + C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), C.int(nparams)) + return nil, err + } + return &cparams, nil +} diff --git a/vendor/github.com/openshift/hive/LICENSE b/vendor/github.com/openshift/hive/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/vendor/github.com/openshift/hive/LICENSE @@ -0,0 +1,201 @@ + 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/openshift/hive/contrib/pkg/aws_tag_deprovision/BUILD.bazel b/vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/BUILD.bazel new file mode 100644 index 00000000000..dee988cd12e --- /dev/null +++ b/vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["aws_tag_deprovision.go"], + importmap = "installer/vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision", + importpath = "github.com/openshift/hive/contrib/pkg/aws_tag_deprovision", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/autoscaling:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/iam:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/s3:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/s3/s3manager:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", + "//vendor/github.com/spf13/cobra:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", + ], +) diff --git a/vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/aws_tag_deprovision.go b/vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/aws_tag_deprovision.go new file mode 100644 index 00000000000..1064b7e61d3 --- /dev/null +++ b/vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision/aws_tag_deprovision.go @@ -0,0 +1,1383 @@ +/* +Copyright 2018 The Kubernetes 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 aws_tag_deprovision + +import ( + "fmt" + "os" + "strings" + "time" + + "k8s.io/apimachinery/pkg/util/wait" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/autoscaling" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/elb" + "github.com/aws/aws-sdk-go/service/iam" + "github.com/aws/aws-sdk-go/service/route53" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3manager" + + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" +) + +const ( + secondsToSleep = 10 +) + +// awsFilter holds the key/value pairs for the tags we will be matching against +type awsFilter map[string]string + +// awsObjectWithTags is a generic way to represent an AWS object and its tags so that +// filtering objects client-side can be done in a generic way +type awsObjectWithTags struct { + Name string + Tags map[string]string +} + +// deleteFunc type is the interface a function needs to implement to be called as a goroutine. +// The (bool, error) return type mimics wait.ExponentialBackoff where the bool indicates successful +// completion, and the error is for unrecoverable errors. +type deleteFunc func(awsClient *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger) (bool, error) + +// ClusterUninstaller holds the various options for the cluster we want to delete +type ClusterUninstaller struct { + Filters awsFilter // filter(s) we will be searching for + Logger log.FieldLogger + LogLevel string + Region string + ClusterName string +} + +// NewDeprovisionAWSWithTagsCommand is the entrypoint to create the 'aws-tag-deprovision' subcommand +func NewDeprovisionAWSWithTagsCommand() *cobra.Command { + opt := &ClusterUninstaller{} + opt.Filters = awsFilter{} + cmd := &cobra.Command{ + Use: "aws-tag-deprovision key=value", + Short: "Deprovision AWS assets (as created by openshift-installer) with a given tag", + Run: func(cmd *cobra.Command, args []string) { + if err := opt.complete(args); err != nil { + log.WithError(err).Error("Cannot complete command") + return + } + if err := opt.validate(); err != nil { + log.WithError(err).Error("Invalid command options") + return + } + if err := opt.Run(); err != nil { + log.WithError(err).Error("Runtime error") + } + }, + } + flags := cmd.Flags() + flags.StringVar(&opt.LogLevel, "loglevel", "info", "log level, one of: debug, info, warn, error, fatal, panic") + flags.StringVar(&opt.Region, "region", "us-east-1", "AWS region to use") + flags.StringVar(&opt.ClusterName, "cluster-name", "", "Name that cluster was installed with") + return cmd +} + +func (o *ClusterUninstaller) complete(args []string) error { + for _, arg := range args { + err := parseFilter(o.Filters, arg) + if err != nil { + return fmt.Errorf("cannot parse filter %s: %v", arg, err) + } + } + + // Set log level + level, err := log.ParseLevel(o.LogLevel) + if err != nil { + log.WithError(err).Error("cannot parse log level") + return err + } + + o.Logger = log.NewEntry(&log.Logger{ + Out: os.Stdout, + Formatter: &log.TextFormatter{ + FullTimestamp: true, + }, + Hooks: make(log.LevelHooks), + Level: level, + }) + + return nil +} + +func (o *ClusterUninstaller) validate() error { + if len(o.Filters) == 0 { + return fmt.Errorf("you must specify at least one tag filter") + } + if len(o.ClusterName) == 0 { + return fmt.Errorf("you must specify cluster-name") + } + return nil +} + +// populateDeleteFuncs is the list of functions that will be launched as goroutines +func populateDeleteFuncs(funcs map[string]deleteFunc) { + funcs["deleteVPCs"] = deleteVPCs + funcs["deleteLBs"] = deleteLBs + funcs["deleteEIPs"] = deleteEIPs + funcs["deleteNATGateways"] = deleteNATGateways + funcs["deleteInstances"] = deleteInstances + funcs["deleteIAMresources"] = deleteIAMresources + funcs["deleteSecurityGroups"] = deleteSecurityGroups + funcs["deleteInternetGateways"] = deleteInternetGateways + funcs["deleteSubnets"] = deleteSubnets + funcs["deleteS3Buckets"] = deleteS3Buckets + funcs["deleteRoute53"] = deleteRoute53 +} + +// Run is the entrypoint to start the uninstall process +func (o *ClusterUninstaller) Run() error { + deleteFuncs := map[string]deleteFunc{} + populateDeleteFuncs(deleteFuncs) + returnChannel := make(chan string) + + awsSession, err := getAWSSession(o.Region) + if err != nil { + return err + } + + // launch goroutines + for name, function := range deleteFuncs { + go deleteRunner(name, function, awsSession, o.Filters, o.ClusterName, o.Logger, returnChannel) + } + + // wait for them to finish + for i := 0; i < len(deleteFuncs); i++ { + select { + case res := <-returnChannel: + o.Logger.Debugf("goroutine %v complete", res) + } + } + + return nil +} + +func deleteRunner(deleteFuncName string, dFunction deleteFunc, awsSession *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger, channel chan string) { + backoffSettings := wait.Backoff{ + Duration: time.Second * 10, + Factor: 1.3, + Steps: 100, + } + + err := wait.ExponentialBackoff(backoffSettings, func() (bool, error) { + return dFunction(awsSession, filters, clusterName, logger) + }) + + if err != nil { + logger.Fatalf("Unrecoverable error/timed out: %v", err) + os.Exit(1) + } + + // record that the goroutine has run to completion + channel <- deleteFuncName + return +} + +func getAWSSession(region string) (*session.Session, error) { + awsConfig := &aws.Config{Region: aws.String(region)} + + // Relying on appropriate AWS ENV vars (eg AWS_PROFILE, AWS_ACCESS_KEY_ID, etc) + s, err := session.NewSession(awsConfig) + if err != nil { + return nil, err + } + + return s, nil +} + +func parseFilter(filterMap awsFilter, str string) error { + parts := strings.SplitN(str, "=", 2) + if len(parts) != 2 { + return fmt.Errorf("incorrectly formatted filter") + } + + filterMap[parts[0]] = parts[1] + + return nil +} + +func createEC2Filters(filters awsFilter) []*ec2.Filter { + awsFilter := []*ec2.Filter{} + for key, val := range filters { + awsFilter = append(awsFilter, &ec2.Filter{ + Name: aws.String(fmt.Sprintf("tag:%s", key)), + Values: []*string{aws.String(val)}, + }) + } + + return awsFilter +} + +// tagsToMap takes various types of AWS-object tags and returns a map-representation +func tagsToMap(tags interface{}) (map[string]string, error) { + x := map[string]string{} + + switch v := tags.(type) { + case []*autoscaling.TagDescription: + for _, tag := range v { + x[*tag.Key] = *tag.Value + } + case *elb.TagDescription: + for _, tag := range v.Tags { + x[*tag.Key] = *tag.Value + } + case []*s3.Tag: + for _, tag := range v { + x[*tag.Key] = *tag.Value + } + case []*route53.Tag: + for _, tag := range v { + x[*tag.Key] = *tag.Value + } + default: + return x, fmt.Errorf("unable to convert type: %v", v) + } + + return x, nil +} + +// lbToAWSObjects will create awsObjectWithTags given a list of load balancers +func lbToAWSObjects(lbList []*elb.LoadBalancerDescription, elbClient *elb.ELB) ([]awsObjectWithTags, error) { + lbObjects := []awsObjectWithTags{} + + describeTagsInput := elb.DescribeTagsInput{} + // populate the list of LBs we want tags for + for _, lb := range lbList { + describeTagsInput.LoadBalancerNames = append(describeTagsInput.LoadBalancerNames, lb.LoadBalancerName) + } + + lbTagResults, err := elbClient.DescribeTags(&describeTagsInput) + if err != nil { + return lbObjects, fmt.Errorf("Error fetching tags for load balancers: %v", err) + } + + for _, lb := range lbTagResults.TagDescriptions { + tagsAsMap, err := tagsToMap(lb) + if err != nil { + return lbObjects, err + } + lbObjects = append(lbObjects, awsObjectWithTags{ + Name: *lb.LoadBalancerName, + Tags: tagsAsMap, + }) + + } + return lbObjects, nil +} + +// deleteLBs finds all load balancers matching 'filters' and attempts to delete them +func deleteLBs(awsSession *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting load balancers") + defer logger.Debugf("Exiting deleting load balancers") + elbClient := elb.New(awsSession) + + // No support for filters so we'll have to filter locally + describeLoadBalancersInput := elb.DescribeLoadBalancersInput{} + + for { + results, err := elbClient.DescribeLoadBalancers(&describeLoadBalancersInput) + if err != nil { + logger.Errorf("Error listing load balancers: %v", err) + return false, nil + } + + lbObjects, err := lbToAWSObjects(results.LoadBalancerDescriptions, elbClient) + if err != nil { + return false, nil + } + + filteredResults := filterObjects(lbObjects, filters) + logger.Debugf("from %d total load balancers, %d match filters", len(lbObjects), len(filteredResults)) + if len(filteredResults) == 0 { + // no items left to delete + break + } + + // now delete + for _, lb := range filteredResults { + logger.Debugf("Deleting load balancer: %v", lb.Name) + _, err := elbClient.DeleteLoadBalancer(&elb.DeleteLoadBalancerInput{ + LoadBalancerName: aws.String(lb.Name), + }) + if err != nil { + logger.Debugf("Error deleting load balancer %v: %v", lb.Name, err) + } else { + logger.WithField("name", lb.Name).Info("Deleted load balancer") + } + } + return false, nil + } + return true, nil +} + +// rtHasMainAssociation will check whether a given route table has an association marked 'Main' +func rtHasMainAssociation(rt *ec2.RouteTable) bool { + for _, association := range rt.Associations { + if *association.Main == true { + return true + } + } + return false +} + +// deleteRouteTablesWithVPC will attempt to delete all route tables associated with a given VPC +func deleteRouteTablesWithVPC(vpc *ec2.Vpc, ec2Client *ec2.EC2, logger log.FieldLogger) error { + var anyError error + describeRouteTablesInput := ec2.DescribeRouteTablesInput{} + describeRouteTablesInput.Filters = []*ec2.Filter{ + { + Name: aws.String("vpc-id"), + Values: []*string{vpc.VpcId}, + }, + } + + results, err := ec2Client.DescribeRouteTables(&describeRouteTablesInput) + if err != nil { + logger.Debugf("error describing route tables: %v", err) + return err + } + for _, rt := range results.RouteTables { + err := disassociateRouteTable(rt, ec2Client, logger) + if err != nil { + logger.Debugf("error disassociating from route table: %v", err) + return err + } + + err = deleteRoutesFromTable(rt, ec2Client, logger) + if err != nil { + logger.Debugf("error deleting routes from route table: %v", err) + return err + } + + if rtHasMainAssociation(rt) { + // can't delete route table with the 'Main' association + // it will get cleaned up as part of deleting the VPC + continue + } + // there is a certain order that route tables need to be deleted, just try to delete + // all of them and eventually they will all be deleted + logger.Debugf("deleting route table: %v", *rt.RouteTableId) + _, err = ec2Client.DeleteRouteTable(&ec2.DeleteRouteTableInput{ + RouteTableId: rt.RouteTableId, + }) + if err != nil { + logger.Debugf("error deleting route table: %v", err) + anyError = err + } else { + logger.WithField("id", *rt.RouteTableId).Info("Deleted route table") + } + } + + return anyError +} + +// deleteVPCs will delete any VPCs that match the provided filters/tags +func deleteVPCs(awsSession *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting VPCs") + defer logger.Debug("Exiting deleting VPCs") + ec2Client := getEC2Client(awsSession) + + describeVpcsInput := ec2.DescribeVpcsInput{} + describeVpcsInput.Filters = createEC2Filters(filters) + for { + results, err := ec2Client.DescribeVpcs(&describeVpcsInput) + if err != nil { + logger.Errorf("Error listing VPCs: %v", err) + return false, nil + } + + if len(results.Vpcs) == 0 { + break + } + + for _, vpc := range results.Vpcs { + // first delete route tables associated with the VPC (not all of them are tagged) + err := deleteRouteTablesWithVPC(vpc, ec2Client, logger) + if err != nil { + logger.Debugf("error deleting route tables: %v", err) + return false, nil + } + + logger.Debugf("deleting VPC: %v", *vpc.VpcId) + _, err = ec2Client.DeleteVpc(&ec2.DeleteVpcInput{ + VpcId: vpc.VpcId, + }) + if err != nil { + logger.Debugf("error deleting VPC %v: %v", *vpc.VpcId, err) + return false, nil + } else { + logger.WithField("id", *vpc.VpcId).Info("Deleted VPC") + } + } + + return false, nil + } + + return true, nil +} + +// getEC2Client is just a wrapper for creating an EC2 client +func getEC2Client(awsSession *session.Session) *ec2.EC2 { + return ec2.New(awsSession) +} + +// deleteNATGateways will attempt to delete all NAT Gateways that match the provided filters +func deleteNATGateways(awsSession *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + + logger.Debugf("Deleting NAT Gateways") + defer logger.Debugf("Exiting deleting NAT Gateways") + + ec2Client := getEC2Client(awsSession) + describeNatGatewaysInput := ec2.DescribeNatGatewaysInput{} + describeNatGatewaysInput.Filter = createEC2Filters(filters) + + // NAT Gateways take a while to really disappear so only find the ones not already being deleted + describeNatGatewaysInput.Filter = append(describeNatGatewaysInput.Filter, &ec2.Filter{ + Name: aws.String("state"), + Values: []*string{aws.String("available")}, + }) + + for { + results, err := ec2Client.DescribeNatGateways(&describeNatGatewaysInput) + if err != nil { + logger.Debugf("error listing NAT gateways: %v", err) + return false, nil + } + + if len(results.NatGateways) == 0 { + break + } + + for _, nat := range results.NatGateways { + logger.Debugf("deleting NAT Gateway: %v", *nat.NatGatewayId) + _, err := ec2Client.DeleteNatGateway(&ec2.DeleteNatGatewayInput{ + NatGatewayId: nat.NatGatewayId, + }) + if err != nil { + logger.Debugf("error deleting NAT gateway: %v", err) + continue + } else { + logger.WithField("id", *nat.NatGatewayId).Info("Deleted NAT Gateway") + } + } + + return false, nil + } + + return true, nil +} + +// deleteNetworkIface will attempt to delete a specific network interface +func deleteNetworkIface(iface *string, ec2Client *ec2.EC2, logger log.FieldLogger) error { + + result, err := ec2Client.DescribeNetworkInterfaces(&ec2.DescribeNetworkInterfacesInput{ + NetworkInterfaceIds: []*string{iface}, + }) + if err != nil { + logger.Debugf("error listing network interface: %v", err) + return err + } + + if len(result.NetworkInterfaces) == 0 { + // must have already been deleted + return nil + } + + for _, i := range result.NetworkInterfaces { + logger.Debugf("deleting network interface: %v", *i.NetworkInterfaceId) + _, err := ec2Client.DeleteNetworkInterface(&ec2.DeleteNetworkInterfaceInput{ + NetworkInterfaceId: i.NetworkInterfaceId, + }) + if err != nil { + logger.Debugf("error deleting network iface: %v", err) + return err + } else { + logger.WithField("id", *i.NetworkInterfaceId).Info("Deleted network interface") + } + } + + return nil +} + +// deleteEIPs will attempt to delete any elastic IPs matching the provided filters +func deleteEIPs(awsSession *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting EIPs") + defer logger.Debug("Exiting deleting EIPs") + ec2Client := getEC2Client(awsSession) + + describeAddressesInput := ec2.DescribeAddressesInput{} + describeAddressesInput.Filters = createEC2Filters(filters) + + for { + results, err := ec2Client.DescribeAddresses(&describeAddressesInput) + if err != nil { + logger.Debugf("error querying elastic IPs: %v", err) + return false, nil + } + + if len(results.Addresses) == 0 { + // nothing left to delete + break + } + + for _, eip := range results.Addresses { + // delete any network interface associated with the EIP (they are untagged) + if eip.NetworkInterfaceId != nil { + logger.Debugf("deleting EIP: %v", *eip.NetworkInterfaceId) + err := deleteNetworkIface(eip.NetworkInterfaceId, ec2Client, logger) + if err != nil { + logger.Debugf("error deleting network iface: %v", err) + continue + } + } + + _, err := ec2Client.ReleaseAddress(&ec2.ReleaseAddressInput{ + AllocationId: eip.AllocationId, + }) + if err != nil { + logger.Debugf("error deleting EIP: %v", err) + continue + } else { + logger.WithField("ip", *eip.PublicIp).Info("Deleted Elastic IP") + } + + } + + return false, nil + } + + return true, nil +} + +// deletePoliciesFromRole will attempt to delete any role policies from a provided role +func deletePoliciesFromRole(role *string, iamClient *iam.IAM) error { + results, err := iamClient.ListRolePolicies(&iam.ListRolePoliciesInput{ + RoleName: role, + }) + if err != nil { + return err + } + + for _, policy := range results.PolicyNames { + _, err := iamClient.DeleteRolePolicy(&iam.DeleteRolePolicyInput{ + RoleName: role, + PolicyName: policy, + }) + if err != nil { + return err + } + } + + return nil +} + +// deleteRolesFromInstanceProfile will attempt to delete any roles associated with a given instance profile +func deleteRolesFromInstanceProfile(ip *iam.InstanceProfile, iamClient *iam.IAM, logger log.FieldLogger) error { + for _, role := range ip.Roles { + logger.Debugf("deleting role %v from instance profile %v", *role.RoleName, *ip.InstanceProfileName) + + // empty the role + logger.Debugf("deleting policies from role: %v", *role.RoleName) + err := deletePoliciesFromRole(role.RoleName, iamClient) + if err != nil { + logger.Debugf("error deleting policies from role: %v", err) + return err + } else { + logger.Infof("Deleted all policies from role: %v", *role.RoleName) + } + + // detach role from instance profile + _, err = iamClient.RemoveRoleFromInstanceProfile(&iam.RemoveRoleFromInstanceProfileInput{ + InstanceProfileName: ip.InstanceProfileName, + RoleName: role.RoleName, + }) + if err != nil { + logger.Debugf("error removing role from instance profile: %v", err) + return err + } else { + logger.Infof("Removed role %v from instance profile %v", *role.RoleName, *ip.InstanceProfileName) + } + + // now delete the role + // need to loop because this is the only time we'll have the name of the role + // now that it has been detached from the instance profile + for { + _, err = iamClient.DeleteRole(&iam.DeleteRoleInput{ + RoleName: role.RoleName, + }) + if err != nil { + logger.Debugf("error deleting role %v from instance profile %v: %v", *role.RoleName, ip.InstanceProfileName, err) + } else { + logger.WithField("name", *role.RoleName).Info("Deleted role") + break + } + + time.Sleep(time.Second * secondsToSleep) + } + } + + return nil +} + +// deleteInstanceProfile will attempt to delete the provided instance profile +func deleteInstanceProfile(instanceProfileID *string, iamClient *iam.IAM, logger log.FieldLogger) error { + ipList, err := iamClient.ListInstanceProfiles(&iam.ListInstanceProfilesInput{}) + if err != nil { + logger.Debugf("error listing instance profiles: %v", err) + return err + } + + var matchedIP *iam.InstanceProfile + for _, ip := range ipList.InstanceProfiles { + if *ip.InstanceProfileId == *instanceProfileID { + matchedIP = ip + } + } + + if matchedIP == nil { + // nothing found, so already deleted? + return nil + } + + // first delete any roles out of the instance profile + err = deleteRolesFromInstanceProfile(matchedIP, iamClient, logger) + if err != nil { + return fmt.Errorf("error deleting roles from instance profile: %v", err) + } + + logger.Debugf("deleting instance profile: %v", *matchedIP.InstanceProfileName) + _, err = iamClient.DeleteInstanceProfile(&iam.DeleteInstanceProfileInput{ + InstanceProfileName: matchedIP.InstanceProfileName, + }) + if err != nil { + logger.Debugf("error deleting instance profile: %v", err) + return err + } else if err == nil { + logger.WithField("name", *matchedIP.InstanceProfileName).Info("Deleted instance profile") + } + + return nil +} + +// tryDeleteRoleProfileByName attempts to delete roles and profiles with given name ($CLUSTER_NAME-bootstrap|master|worker-role|profile) +func tryDeleteRoleProfileByName(roleName string, profileName string, session *session.Session, logger log.FieldLogger) error { + logger.Debugf("deleting role: %s", roleName) + describeRoleInput := iam.GetRoleInput{} + describeRoleInput.RoleName = &roleName + iamClient := iam.New(session) + if _, err := iamClient.GetRole(&describeRoleInput); err != nil && err.(awserr.Error).Code() != iam.ErrCodeNoSuchEntityException { + return err + } + + // empty the role + logger.Debugf("deleting policies from role: %s", roleName) + if err := deletePoliciesFromRole(&roleName, iamClient); err != nil && err.(awserr.Error).Code() != iam.ErrCodeNoSuchEntityException { + logger.Debugf("error deleting policies from role: %v", err) + return err + } + describeProfileInput := iam.GetInstanceProfileInput{} + describeProfileInput.InstanceProfileName = &profileName + if _, err := iamClient.GetInstanceProfile(&describeProfileInput); err != nil && err.(awserr.Error).Code() != iam.ErrCodeNoSuchEntityException { + return err + } + + // detach role from profile + logger.Debugf("detaching role from profile: %s", profileName) + _, err := iamClient.RemoveRoleFromInstanceProfile(&iam.RemoveRoleFromInstanceProfileInput{ + InstanceProfileName: &profileName, + RoleName: &roleName, + }) + if err != nil && err.(awserr.Error).Code() != iam.ErrCodeNoSuchEntityException { + logger.Debugf("error removing role from instance profile: %v", err) + return err + } + if err == nil { + logger.Infof("Removed role %v from instance profile %v", roleName, profileName) + } + // delete profile + logger.Debugf("deleting instance profile: %v", profileName) + _, err = iamClient.DeleteInstanceProfile(&iam.DeleteInstanceProfileInput{ + InstanceProfileName: &profileName, + }) + if err != nil && err.(awserr.Error).Code() != iam.ErrCodeNoSuchEntityException { + logger.Debugf("error deleting instance profile %s: %v", profileName, err) + return err + } + if err == nil { + logger.Infof("deleted profile %s", profileName) + } + // now we can delete role + logger.Debugf("deleted policies from role %s", roleName) + deleteRoleInput := iam.DeleteRoleInput{} + deleteRoleInput.RoleName = &roleName + if _, err := iamClient.DeleteRole(&deleteRoleInput); err != nil && err.(awserr.Error).Code() != iam.ErrCodeNoSuchEntityException { + logger.Debugf("error deleting role %s: %v", roleName, err) + return err + } + if err == nil { + logger.Infof("deleted role %s", roleName) + } + return nil +} + +// deleteIAMresources will delete any IAM resources created by the installer that are not associated with a running instance +// Currently openshift/installer creates 3 roles per cluster, 1 for master|worker|bootstrap and identified by the +// cluster name used to install the cluster. +func deleteIAMresources(session *session.Session, filter awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debugf("Deleting IAM resources") + defer logger.Debugf("Exiting deleting IAM resources") + installer_type := []string{"master", "worker", "bootstrap"} + for _, t := range installer_type { + // Naming of IAM resources expected from https://github.com/openshift/installer as follows: + // $CLUSTER_NAME-master-role $CLUSTER_NAME-worker-role $CLUSTER_NAME-bootstrap-role + // $CLUSTER_NAME-master-profile $CLUSTER_NAME-worker-profile $CLUSTER_NAME-bootstrap-profile + roleName := fmt.Sprintf("%s-%s-role", clusterName, t) + instanceProfileName := fmt.Sprintf("%s-%s-profile", clusterName, t) + if err := tryDeleteRoleProfileByName(roleName, instanceProfileName, session, logger); err != nil { + logger.Debugf("error deleting instance profile %s: %v", instanceProfileName, err) + return false, nil + } + } + return true, nil +} + +// deleteInstances will find any running instances that match the given filter and terminate them +// and any instance profiles attached to the instance(s) +func deleteInstances(session *session.Session, filter awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debugf("Deleting instances") + defer logger.Debugf("Exiting deleting instances") + + ec2Client := getEC2Client(session) + iamClient := iam.New(session) + + describeInstancesInput := ec2.DescribeInstancesInput{} + describeInstancesInput.Filters = createEC2Filters(filter) + + // only fetch instances in 'running' state since they take a while to really get cleaned up + describeInstancesInput.Filters = append(describeInstancesInput.Filters, &ec2.Filter{ + Name: aws.String("instance-state-name"), + Values: []*string{aws.String("running")}, + }) + + for { + results, err := ec2Client.DescribeInstances(&describeInstancesInput) + if err != nil { + logger.Debugf("error listing instances: %v", err) + return false, nil + } + + if len(results.Reservations) == 0 { + break + } + + for _, reservation := range results.Reservations { + for _, instance := range reservation.Instances { + // first delete any instance profiles (they are not tagged) + if instance.IamInstanceProfile != nil { + err := deleteInstanceProfile(instance.IamInstanceProfile.Id, iamClient, logger) + if err != nil { + logger.Debugf("error deleting instance profile: %v", err) + continue + } + } + + // now delete the instance + logger.Debugf("deleting instance: %v", *instance.InstanceId) + _, err = ec2Client.TerminateInstances(&ec2.TerminateInstancesInput{ + InstanceIds: []*string{instance.InstanceId}, + }) + if err != nil { + logger.Debugf("error deleting instance: %v", err) + continue + } else { + logger.WithField("id", *instance.InstanceId).Info("Deleted instance") + } + } + } + + return false, nil + } + + return true, nil +} + +// deleteSecurityGroupRules will attempt to delete all the rules defined in the given security group +// since some security groups have self-referencing rules that complicate being able to delete the security group +func deleteSecurityGroupRules(sg *ec2.SecurityGroup, ec2Client *ec2.EC2, logger log.FieldLogger) error { + + if len(sg.IpPermissions) > 0 { + _, err := ec2Client.RevokeSecurityGroupIngress(&ec2.RevokeSecurityGroupIngressInput{ + GroupId: sg.GroupId, + IpPermissions: sg.IpPermissions, + }) + if err != nil { + logger.Debugf("error removing ingress permissions: %v", err) + } + } + + if len(sg.IpPermissionsEgress) > 0 { + _, err := ec2Client.RevokeSecurityGroupEgress(&ec2.RevokeSecurityGroupEgressInput{ + GroupId: sg.GroupId, + IpPermissions: sg.IpPermissionsEgress, + }) + if err != nil { + logger.Debugf("error removing egress permissions: %v", err) + } + } + + return nil +} + +// deleteSecurityGroups will attempt to delete all security groups matching the given filter +func deleteSecurityGroups(session *session.Session, filter awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debugf("Deleting security groups") + defer logger.Debugf("Exiting deleting security groups") + + ec2Client := getEC2Client(session) + describeSecurityGroupsInput := ec2.DescribeSecurityGroupsInput{} + describeSecurityGroupsInput.Filters = createEC2Filters(filter) + + for { + results, err := ec2Client.DescribeSecurityGroups(&describeSecurityGroupsInput) + if err != nil { + logger.Debugf("error listing security groups %v", err) + return false, nil + } + + if len(results.SecurityGroups) == 0 { + break + } + + for _, sg := range results.SecurityGroups { + // first delete rules (can get circular dependencies otherwise) + deleteSecurityGroupRules(sg, ec2Client, logger) + _, err := ec2Client.DeleteSecurityGroup(&ec2.DeleteSecurityGroupInput{ + GroupId: sg.GroupId, + }) + if err != nil { + logger.Debugf("error deleting security group: %v", err) + continue + } else { + logger.WithField("id", *sg.GroupId).Info("Deleted security group") + } + } + + return false, nil + } + + return true, nil +} + +// detachInternetGateways will attempt to detach an internet gateway from the associated VPC(s) +func detachInternetGateways(gw *ec2.InternetGateway, ec2Client *ec2.EC2, logger log.FieldLogger) error { + for _, vpc := range gw.Attachments { + logger.Debugf("detaching Internet GW %v from VPC %v", *gw.InternetGatewayId, *vpc.VpcId) + _, err := ec2Client.DetachInternetGateway(&ec2.DetachInternetGatewayInput{ + InternetGatewayId: gw.InternetGatewayId, + VpcId: vpc.VpcId, + }) + + if err != nil { + return fmt.Errorf("error detaching internet gateway: %v", err) + } else if err == nil { + logger.Infof("Detached Internet GW %v from VPC %v", *gw.InternetGatewayId, *vpc.VpcId) + } + } + + return nil +} + +// deleteInternetGateways will attemp to delete any Internet Gateways matching the given filter +func deleteInternetGateways(session *session.Session, filter awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debugf("Deleting internet gateways") + defer logger.Debugf("Exiting deleting internet gateways") + + ec2Client := getEC2Client(session) + + describeInternetGatewaysInput := ec2.DescribeInternetGatewaysInput{} + describeInternetGatewaysInput.Filters = createEC2Filters(filter) + + for { + results, err := ec2Client.DescribeInternetGateways(&describeInternetGatewaysInput) + if err != nil { + logger.Debugf("error listing internet gateways: %v", err) + return false, nil + } + + if len(results.InternetGateways) == 0 { + break + } + + for _, gw := range results.InternetGateways { + logger.Debugf("deleting internet gateway: %v", *gw.InternetGatewayId) + + err := detachInternetGateways(gw, ec2Client, logger) + if err != nil { + logger.Debugf("error detaching igw: %v", err) + continue + } + + _, err = ec2Client.DeleteInternetGateway(&ec2.DeleteInternetGatewayInput{ + InternetGatewayId: gw.InternetGatewayId, + }) + if err != nil { + logger.Debugf("error deleting internet gateway: %v", err) + } else { + logger.WithField("id", *gw.InternetGatewayId).Info("Deleted internet gateway") + } + } + + return false, nil + } + + return true, nil +} + +// disassociateRouteTable will attempt to disassociate all except the 'Main' associations defined +// for the given Route Table +func disassociateRouteTable(rt *ec2.RouteTable, ec2Client *ec2.EC2, logger log.FieldLogger) error { + for _, association := range rt.Associations { + if *association.Main { + // can't remove the 'Main' association + continue + } + logger.Debugf("disassociating route table association %v", *association.RouteTableAssociationId) + _, err := ec2Client.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{ + AssociationId: association.RouteTableAssociationId, + }) + if err != nil { + logger.Debugf("error disassociating from route table: %v", err) + return err + } else if err == nil { + logger.WithField("id", *association.RouteTableAssociationId).Info("Disassociated route table association") + } + } + + return nil +} + +// deleteRoutesFromTable will attempt to remove all routes defined in a given route table +func deleteRoutesFromTable(rt *ec2.RouteTable, ec2Client *ec2.EC2, logger log.FieldLogger) error { + for _, route := range rt.Routes { + // can't delete the 'local' route + if route.GatewayId != nil && *route.GatewayId == "local" { + continue + } + logger.Debugf("deleting route %v from RT %v", *route.DestinationCidrBlock, *rt.RouteTableId) + _, err := ec2Client.DeleteRoute(&ec2.DeleteRouteInput{ + RouteTableId: rt.RouteTableId, + DestinationCidrBlock: route.DestinationCidrBlock, + }) + if err != nil { + logger.Debugf("error deleting route from route table: %v", err) + return err + } else { + logger.Infof("Deleted route %v from route table %v", *route.DestinationCidrBlock, *rt.RouteTableId) + } + } + return nil +} + +// deleteSubnets will attempt to delete all Subnets matching the given filter +func deleteSubnets(session *session.Session, filter awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting subnets") + defer logger.Debug("Exiting deleting subnets") + + ec2Client := getEC2Client(session) + + describeSubnetsInput := ec2.DescribeSubnetsInput{} + describeSubnetsInput.Filters = createEC2Filters(filter) + + for { + results, err := ec2Client.DescribeSubnets(&describeSubnetsInput) + if err != nil { + logger.Debugf("error listing subnets: %v", err) + return false, nil + } + + if len(results.Subnets) == 0 { + break + } + + for _, subnet := range results.Subnets { + _, err := ec2Client.DeleteSubnet(&ec2.DeleteSubnetInput{ + SubnetId: subnet.SubnetId, + }) + if err != nil { + logger.Debugf("error deleting subnet: %v", err) + } else { + logger.WithField("id", *subnet.SubnetId).Info("Deleted subnet") + } + } + + return false, nil + } + + return true, nil +} + +// bucketsToAWSObjects will convert a list of S3 Buckets to awsObjectsWithTags (for easier filtering) +func bucketsToAWSObjects(buckets []*s3.Bucket, s3Client *s3.S3, logger log.FieldLogger) ([]awsObjectWithTags, error) { + bucketObjects := []awsObjectWithTags{} + + for _, bucket := range buckets { + tags, err := s3Client.GetBucketTagging(&s3.GetBucketTaggingInput{ + Bucket: bucket.Name, + }) + if err != nil { + logger.Debugf("error getting tags for bucket %s: %v, skipping...", bucket.Name, err) + continue + } + + tagsAsMap, err := tagsToMap(tags.TagSet) + if err != nil { + return bucketObjects, err + } + bucketObjects = append(bucketObjects, awsObjectWithTags{ + Name: *bucket.Name, + Tags: tagsAsMap, + }) + } + + return bucketObjects, nil +} + +// filterObjects will do client-side filtering given an appropriately filled out list of awsObjectWithTags +func filterObjects(awsObjects []awsObjectWithTags, filters awsFilter) []awsObjectWithTags { + objectsWithTags := []awsObjectWithTags{} + filteredObjects := []awsObjectWithTags{} + + // first find the objects that have all the desired tags + for _, object := range awsObjects { + allTagsFound := true + for key := range filters { + if _, ok := object.Tags[key]; !ok { + // doesn't have one of the tags we're looking for so skip it + allTagsFound = false + break + } + } + if allTagsFound { + objectsWithTags = append(objectsWithTags, object) + } + } + + // now check that the values match + for _, object := range objectsWithTags { + valuesMatch := true + for key, val := range filters { + if object.Tags[key] != val { + valuesMatch = false + break + } + } + if valuesMatch { + filteredObjects = append(filteredObjects, object) + } + } + return filteredObjects +} + +// deleteS3Buckets will attempt to delete (and empty) any S3 bucket matching the provided filter +func deleteS3Buckets(session *session.Session, filter awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debugf("Deleting S3 buckets") + defer logger.Debugf("Exiting deleting buckets") + + s3Client := s3.New(session) + + listBucketsInput := s3.ListBucketsInput{} + + for { + results, err := s3Client.ListBuckets(&listBucketsInput) + if err != nil { + logger.Debugf("error listing s3 buckets: %v", err) + return false, nil + } + + awsObjects, err := bucketsToAWSObjects(results.Buckets, s3Client, logger) + if err != nil { + return false, fmt.Errorf("error converting buckets to internal objects: %v", err) + } + + filteredObjects := filterObjects(awsObjects, filter) + logger.Debugf("from %d total s3 buckets, %d match filters", len(awsObjects), len(filteredObjects)) + if len(filteredObjects) == 0 { + break + } + + for _, bucket := range filteredObjects { + logger.Debugf("deleting bucket: %v", bucket.Name) + + // first empty the bucket + iter := s3manager.NewDeleteListIterator(s3Client, &s3.ListObjectsInput{ + Bucket: aws.String(bucket.Name), + }) + err := s3manager.NewBatchDeleteWithClient(s3Client).Delete(aws.BackgroundContext(), iter) + if err != nil { + logger.Debugf("error emptying bucket %v: %v", bucket.Name, err) + continue + } else { + logger.WithField("name", bucket.Name).Info("Emptied bucket") + } + + // now delete the bucket + _, err = s3Client.DeleteBucket(&s3.DeleteBucketInput{ + Bucket: aws.String(bucket.Name), + }) + if err != nil { + logger.Debugf("error deleting bucket %v: %v", bucket.Name, err) + continue + } else { + logger.WithField("name", bucket.Name).Info("Deleted bucket") + } + } + + return false, nil + } + + return true, nil +} + +// r53ZonesToAWSObjects will create a list of awsObjectsWithTags for the provided list of route53.HostedZone s +func r53ZonesToAWSObjects(zones []*route53.HostedZone, r53Client *route53.Route53) ([]awsObjectWithTags, error) { + zonesAsAWSObjects := []awsObjectWithTags{} + + for _, zone := range zones { + result, err := r53Client.ListTagsForResource(&route53.ListTagsForResourceInput{ + ResourceType: aws.String("hostedzone"), + ResourceId: zone.Id, + }) + if err != nil { + return zonesAsAWSObjects, err + } + + tagsToMap, err := tagsToMap(result.ResourceTagSet.Tags) + if err != nil { + return zonesAsAWSObjects, err + } + + zonesAsAWSObjects = append(zonesAsAWSObjects, awsObjectWithTags{ + Name: *zone.Id, + Tags: tagsToMap, + }) + + } + + return zonesAsAWSObjects, nil +} + +// deleteEntriesFromSharedR53Zone will find route53 entries for the shared (ie non-terraform-managed) route53 zone +// and remove them. +// Provide the terraform-created private zone, and the manually created public/shared zone, and it will find any +// entries in the public/shared zone that match entries in the private zone, and delete them +func deleteEntriesFromSharedR53Zone(zoneID string, sharedZoneID string, r53Client *route53.Route53, logger log.FieldLogger) error { + + zoneEntries, err := r53Client.ListResourceRecordSets(&route53.ListResourceRecordSetsInput{ + HostedZoneId: aws.String(zoneID), + }) + if err != nil { + return err + } + + sharedZoneEntries, err := r53Client.ListResourceRecordSets(&route53.ListResourceRecordSetsInput{ + HostedZoneId: aws.String(sharedZoneID), + }) + if err != nil { + return err + } + + for _, entry := range zoneEntries.ResourceRecordSets { + // only interested in deleting 'A' records + if *entry.Type != "A" { + continue + } + for _, sharedEntry := range sharedZoneEntries.ResourceRecordSets { + if *sharedEntry.Name == *entry.Name && *sharedEntry.Type == *entry.Type { + _, err := r53Client.ChangeResourceRecordSets(&route53.ChangeResourceRecordSetsInput{ + HostedZoneId: aws.String(sharedZoneID), + ChangeBatch: &route53.ChangeBatch{ + Changes: []*route53.Change{ + { + Action: aws.String("DELETE"), + ResourceRecordSet: &route53.ResourceRecordSet{ + Name: sharedEntry.Name, + Type: sharedEntry.Type, + AliasTarget: sharedEntry.AliasTarget, + }, + }, + }, + }, + }) + if err != nil { + return err + } else { + logger.Infof("Deleted record %v from r53 zone %v", *sharedEntry.Name, sharedZoneID) + } + } + } + } + + return nil +} + +// getSharedHostedZone will find the zoneID of the non-terraform-managed public route53 zone given the +// terraform-managed private zoneID +func getSharedHostedZone(zoneID string, allZones []*route53.HostedZone) (string, error) { + // given the ID, get the name of the zone + zoneName := "" + for _, zone := range allZones { + if *zone.Id == zoneID { + zoneName = *zone.Name + break + } + } + + // now find the shared zone that matches by name + for _, zone := range allZones { + // skip the actual terraform-managed zone (we're looking for the shared zone) + if *zone.Id == zoneID { + continue + } + + if *zone.Name == zoneName { + return *zone.Id, nil + } + } + + // else we didn't find it + return "", fmt.Errorf("could not find shared zone with name: %v", zoneName) +} + +// emptyAndDeleteRoute53Zone will delete all the entries in the given route53 zone and delete the zone itself +func emptyAndDeleteRoute53Zone(zoneID string, r53Client *route53.Route53, logger log.FieldLogger) error { + + // first need to delete all non SOA and NS records + results, err := r53Client.ListResourceRecordSets(&route53.ListResourceRecordSetsInput{ + HostedZoneId: aws.String(zoneID), + }) + if err != nil { + return err + } + + for _, entry := range results.ResourceRecordSets { + if *entry.Type == "SOA" || *entry.Type == "NS" { + // can't delete SOA and NS types + continue + } + _, err := r53Client.ChangeResourceRecordSets(&route53.ChangeResourceRecordSetsInput{ + HostedZoneId: aws.String(zoneID), + ChangeBatch: &route53.ChangeBatch{ + Changes: []*route53.Change{ + { + Action: aws.String("DELETE"), + ResourceRecordSet: &route53.ResourceRecordSet{ + Name: entry.Name, + Type: entry.Type, + TTL: entry.TTL, + ResourceRecords: entry.ResourceRecords, + AliasTarget: entry.AliasTarget, + }, + }, + }, + }, + }) + if err != nil { + return err + } else { + logger.Infof("Deleted record %v from r53 zone %v", *entry.Name, zoneID) + } + } + + // now delete zone + _, err = r53Client.DeleteHostedZone(&route53.DeleteHostedZoneInput{ + Id: aws.String(zoneID), + }) + if err != nil { + return err + } else { + logger.WithField("id", zoneID).Info("Deleted route53 zone") + } + + return nil +} + +// deleteRoute53 will attempt to delete any route53 zone matching the given filter. +// it will also attempt to delete any entries in the shared/public route53 zone +func deleteRoute53(session *session.Session, filters awsFilter, clusterName string, logger log.FieldLogger) (bool, error) { + logger.Debugf("Deleting Route53 zones") + defer logger.Debugf("Exiting deleting Route53 zones") + + r53Client := route53.New(session) + + listHostedZonesInput := route53.ListHostedZonesInput{} + + for { + allZones, err := r53Client.ListHostedZones(&listHostedZonesInput) + if err != nil { + logger.Debugf("error listing route53 zones: %v", err) + return false, nil + } + + awsZones, err := r53ZonesToAWSObjects(allZones.HostedZones, r53Client) + if err != nil { + logger.Debugf("error converting r53Zones to native AWS objects: %v", err) + return false, fmt.Errorf("error converting route53 zones to internal AWS objects: %v", err) + } + + filteredZones := filterObjects(awsZones, filters) + logger.Debugf("from %d total r53 zones, %d match filters", len(awsZones), len(filteredZones)) + if len(filteredZones) == 0 { + break + } + + for _, zone := range filteredZones { + // first find the shared hostedzone (will have same name as the tagged zone) + sharedZoneID, err := getSharedHostedZone(zone.Name, allZones.HostedZones) + if err != nil { + logger.Debugf("%v", err) + return false, nil + } + + // first need to delete any 'A' entries from the shared-non-private Route53 zone + // (eg. newcluster.subdomain.domain.com newcluster-api.subdomain.domain.com and + // *.newcluster.subdomain.domain.com) + err = deleteEntriesFromSharedR53Zone(zone.Name, sharedZoneID, r53Client, logger) + if err != nil { + logger.Debugf("error deleting entries from shared r53 zone: %v", err) + return false, nil + } + + // finally can delete the tagged hosted zone + err = emptyAndDeleteRoute53Zone(zone.Name, r53Client, logger) + if err != nil { + logger.Debugf("error deleting zone %v: %v", zone.Name, err) + return false, nil + } + } + return false, nil + } + // all done deleting r53 entries/zones + return true, nil +} diff --git a/vendor/github.com/Sirupsen/logrus/BUILD.bazel b/vendor/github.com/sirupsen/logrus/BUILD.bazel similarity index 86% rename from vendor/github.com/Sirupsen/logrus/BUILD.bazel rename to vendor/github.com/sirupsen/logrus/BUILD.bazel index 3726e8827d3..8d5b5a03882 100644 --- a/vendor/github.com/Sirupsen/logrus/BUILD.bazel +++ b/vendor/github.com/sirupsen/logrus/BUILD.bazel @@ -19,8 +19,8 @@ go_library( "text_formatter.go", "writer.go", ], - importmap = "installer/vendor/github.com/Sirupsen/logrus", - importpath = "github.com/Sirupsen/logrus", + importmap = "installer/vendor/github.com/sirupsen/logrus", + importpath = "github.com/sirupsen/logrus", visibility = ["//visibility:public"], deps = select({ "@io_bazel_rules_go//go/platform:solaris": [ diff --git a/vendor/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/sirupsen/logrus/LICENSE similarity index 100% rename from vendor/github.com/Sirupsen/logrus/LICENSE rename to vendor/github.com/sirupsen/logrus/LICENSE diff --git a/vendor/github.com/Sirupsen/logrus/doc.go b/vendor/github.com/sirupsen/logrus/doc.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/doc.go rename to vendor/github.com/sirupsen/logrus/doc.go diff --git a/vendor/github.com/Sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/entry.go rename to vendor/github.com/sirupsen/logrus/entry.go diff --git a/vendor/github.com/Sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/exported.go rename to vendor/github.com/sirupsen/logrus/exported.go diff --git a/vendor/github.com/Sirupsen/logrus/formatter.go b/vendor/github.com/sirupsen/logrus/formatter.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/formatter.go rename to vendor/github.com/sirupsen/logrus/formatter.go diff --git a/vendor/github.com/Sirupsen/logrus/hooks.go b/vendor/github.com/sirupsen/logrus/hooks.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/hooks.go rename to vendor/github.com/sirupsen/logrus/hooks.go diff --git a/vendor/github.com/Sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/json_formatter.go rename to vendor/github.com/sirupsen/logrus/json_formatter.go diff --git a/vendor/github.com/Sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/logger.go rename to vendor/github.com/sirupsen/logrus/logger.go diff --git a/vendor/github.com/Sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/logrus.go rename to vendor/github.com/sirupsen/logrus/logrus.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_bsd.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_bsd.go rename to vendor/github.com/sirupsen/logrus/terminal_bsd.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/vendor/github.com/sirupsen/logrus/terminal_linux.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_linux.go rename to vendor/github.com/sirupsen/logrus/terminal_linux.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/vendor/github.com/sirupsen/logrus/terminal_notwindows.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_notwindows.go rename to vendor/github.com/sirupsen/logrus/terminal_notwindows.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go b/vendor/github.com/sirupsen/logrus/terminal_solaris.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_solaris.go rename to vendor/github.com/sirupsen/logrus/terminal_solaris.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/vendor/github.com/sirupsen/logrus/terminal_windows.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_windows.go rename to vendor/github.com/sirupsen/logrus/terminal_windows.go diff --git a/vendor/github.com/Sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/text_formatter.go rename to vendor/github.com/sirupsen/logrus/text_formatter.go diff --git a/vendor/github.com/Sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/writer.go rename to vendor/github.com/sirupsen/logrus/writer.go diff --git a/vendor/github.com/spf13/cobra/BUILD.bazel b/vendor/github.com/spf13/cobra/BUILD.bazel new file mode 100644 index 00000000000..06040507833 --- /dev/null +++ b/vendor/github.com/spf13/cobra/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "args.go", + "bash_completions.go", + "cobra.go", + "command.go", + "command_notwin.go", + "command_win.go", + "zsh_completions.go", + ], + importmap = "installer/vendor/github.com/spf13/cobra", + importpath = "github.com/spf13/cobra", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + ] + select({ + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/github.com/inconshreveable/mousetrap:go_default_library", + ], + "//conditions:default": [], + }), +) diff --git a/vendor/github.com/spf13/cobra/LICENSE.txt b/vendor/github.com/spf13/cobra/LICENSE.txt new file mode 100644 index 00000000000..298f0e2665e --- /dev/null +++ b/vendor/github.com/spf13/cobra/LICENSE.txt @@ -0,0 +1,174 @@ + 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. diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go new file mode 100644 index 00000000000..94a6ca2737e --- /dev/null +++ b/vendor/github.com/spf13/cobra/args.go @@ -0,0 +1,98 @@ +package cobra + +import ( + "fmt" +) + +type PositionalArgs func(cmd *Command, args []string) error + +// Legacy arg validation has the following behaviour: +// - root commands with no subcommands can take arbitrary arguments +// - root commands with subcommands will do subcommand validity checking +// - subcommands will always accept arbitrary arguments +func legacyArgs(cmd *Command, args []string) error { + // no subcommand, always take args + if !cmd.HasSubCommands() { + return nil + } + + // root command with subcommands, do subcommand checking + if !cmd.HasParent() && len(args) > 0 { + return fmt.Errorf("unknown command %q for %q%s", args[0], cmd.CommandPath(), cmd.findSuggestions(args[0])) + } + return nil +} + +// NoArgs returns an error if any args are included +func NoArgs(cmd *Command, args []string) error { + if len(args) > 0 { + return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath()) + } + return nil +} + +// OnlyValidArgs returns an error if any args are not in the list of ValidArgs +func OnlyValidArgs(cmd *Command, args []string) error { + if len(cmd.ValidArgs) > 0 { + for _, v := range args { + if !stringInSlice(v, cmd.ValidArgs) { + return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0])) + } + } + } + return nil +} + +func stringInSlice(a string, list []string) bool { + for _, b := range list { + if b == a { + return true + } + } + return false +} + +// ArbitraryArgs never returns an error +func ArbitraryArgs(cmd *Command, args []string) error { + return nil +} + +// MinimumNArgs returns an error if there is not at least N args +func MinimumNArgs(n int) PositionalArgs { + return func(cmd *Command, args []string) error { + if len(args) < n { + return fmt.Errorf("requires at least %d arg(s), only received %d", n, len(args)) + } + return nil + } +} + +// MaximumNArgs returns an error if there are more than N args +func MaximumNArgs(n int) PositionalArgs { + return func(cmd *Command, args []string) error { + if len(args) > n { + return fmt.Errorf("accepts at most %d arg(s), received %d", n, len(args)) + } + return nil + } +} + +// ExactArgs returns an error if there are not exactly n args +func ExactArgs(n int) PositionalArgs { + return func(cmd *Command, args []string) error { + if len(args) != n { + return fmt.Errorf("accepts %d arg(s), received %d", n, len(args)) + } + return nil + } +} + +// RangeArgs returns an error if the number of args is not within the expected range +func RangeArgs(min int, max int) PositionalArgs { + return func(cmd *Command, args []string) error { + if len(args) < min || len(args) > max { + return fmt.Errorf("accepts between %d and %d arg(s), received %d", min, max, len(args)) + } + return nil + } +} diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go new file mode 100644 index 00000000000..c19fe7a068b --- /dev/null +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -0,0 +1,537 @@ +package cobra + +import ( + "bytes" + "fmt" + "io" + "os" + "sort" + "strings" + + "github.com/spf13/pflag" +) + +// Annotations for Bash completion. +const ( + BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extensions" + BashCompCustom = "cobra_annotation_bash_completion_custom" + BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag" + BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" +) + +func writePreamble(buf *bytes.Buffer, name string) { + buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) + buf.WriteString(` +__debug() +{ + if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then + echo "$*" >> "${BASH_COMP_DEBUG_FILE}" + fi +} + +# Homebrew on Macs have version 1.3 of bash-completion which doesn't include +# _init_completion. This is a very minimal version of that function. +__my_init_completion() +{ + COMPREPLY=() + _get_comp_words_by_ref "$@" cur prev words cword +} + +__index_of_word() +{ + local w word=$1 + shift + index=0 + for w in "$@"; do + [[ $w = "$word" ]] && return + index=$((index+1)) + done + index=-1 +} + +__contains_word() +{ + local w word=$1; shift + for w in "$@"; do + [[ $w = "$word" ]] && return + done + return 1 +} + +__handle_reply() +{ + __debug "${FUNCNAME[0]}" + case $cur in + -*) + if [[ $(type -t compopt) = "builtin" ]]; then + compopt -o nospace + fi + local allflags + if [ ${#must_have_one_flag[@]} -ne 0 ]; then + allflags=("${must_have_one_flag[@]}") + else + allflags=("${flags[*]} ${two_word_flags[*]}") + fi + COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") ) + if [[ $(type -t compopt) = "builtin" ]]; then + [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace + fi + + # complete after --flag=abc + if [[ $cur == *=* ]]; then + if [[ $(type -t compopt) = "builtin" ]]; then + compopt +o nospace + fi + + local index flag + flag="${cur%%=*}" + __index_of_word "${flag}" "${flags_with_completion[@]}" + COMPREPLY=() + if [[ ${index} -ge 0 ]]; then + PREFIX="" + cur="${cur#*=}" + ${flags_completion[${index}]} + if [ -n "${ZSH_VERSION}" ]; then + # zsh completion needs --flag= prefix + eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )" + fi + fi + fi + return 0; + ;; + esac + + # check if we are handling a flag with special work handling + local index + __index_of_word "${prev}" "${flags_with_completion[@]}" + if [[ ${index} -ge 0 ]]; then + ${flags_completion[${index}]} + return + fi + + # we are parsing a flag and don't have a special handler, no completion + if [[ ${cur} != "${words[cword]}" ]]; then + return + fi + + local completions + completions=("${commands[@]}") + if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then + completions=("${must_have_one_noun[@]}") + fi + if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then + completions+=("${must_have_one_flag[@]}") + fi + COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") ) + + if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then + COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") ) + fi + + if [[ ${#COMPREPLY[@]} -eq 0 ]]; then + declare -F __custom_func >/dev/null && __custom_func + fi + + # available in bash-completion >= 2, not always present on macOS + if declare -F __ltrim_colon_completions >/dev/null; then + __ltrim_colon_completions "$cur" + fi +} + +# The arguments should be in the form "ext1|ext2|extn" +__handle_filename_extension_flag() +{ + local ext="$1" + _filedir "@(${ext})" +} + +__handle_subdirs_in_dir_flag() +{ + local dir="$1" + pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 +} + +__handle_flag() +{ + __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" + + # if a command required a flag, and we found it, unset must_have_one_flag() + local flagname=${words[c]} + local flagvalue + # if the word contained an = + if [[ ${words[c]} == *"="* ]]; then + flagvalue=${flagname#*=} # take in as flagvalue after the = + flagname=${flagname%%=*} # strip everything after the = + flagname="${flagname}=" # but put the = back + fi + __debug "${FUNCNAME[0]}: looking for ${flagname}" + if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then + must_have_one_flag=() + fi + + # if you set a flag which only applies to this command, don't show subcommands + if __contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then + commands=() + fi + + # keep flag value with flagname as flaghash + if [ -n "${flagvalue}" ] ; then + flaghash[${flagname}]=${flagvalue} + elif [ -n "${words[ $((c+1)) ]}" ] ; then + flaghash[${flagname}]=${words[ $((c+1)) ]} + else + flaghash[${flagname}]="true" # pad "true" for bool flag + fi + + # skip the argument to a two word flag + if __contains_word "${words[c]}" "${two_word_flags[@]}"; then + c=$((c+1)) + # if we are looking for a flags value, don't show commands + if [[ $c -eq $cword ]]; then + commands=() + fi + fi + + c=$((c+1)) + +} + +__handle_noun() +{ + __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" + + if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then + must_have_one_noun=() + elif __contains_word "${words[c]}" "${noun_aliases[@]}"; then + must_have_one_noun=() + fi + + nouns+=("${words[c]}") + c=$((c+1)) +} + +__handle_command() +{ + __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" + + local next_command + if [[ -n ${last_command} ]]; then + next_command="_${last_command}_${words[c]//:/__}" + else + if [[ $c -eq 0 ]]; then + next_command="_$(basename "${words[c]//:/__}")" + else + next_command="_${words[c]//:/__}" + fi + fi + c=$((c+1)) + __debug "${FUNCNAME[0]}: looking for ${next_command}" + declare -F "$next_command" >/dev/null && $next_command +} + +__handle_word() +{ + if [[ $c -ge $cword ]]; then + __handle_reply + return + fi + __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" + if [[ "${words[c]}" == -* ]]; then + __handle_flag + elif __contains_word "${words[c]}" "${commands[@]}"; then + __handle_command + elif [[ $c -eq 0 ]] && __contains_word "$(basename "${words[c]}")" "${commands[@]}"; then + __handle_command + else + __handle_noun + fi + __handle_word +} + +`) +} + +func writePostscript(buf *bytes.Buffer, name string) { + name = strings.Replace(name, ":", "__", -1) + buf.WriteString(fmt.Sprintf("__start_%s()\n", name)) + buf.WriteString(fmt.Sprintf(`{ + local cur prev words cword + declare -A flaghash 2>/dev/null || : + if declare -F _init_completion >/dev/null 2>&1; then + _init_completion -s || return + else + __my_init_completion -n "=" || return + fi + + local c=0 + local flags=() + local two_word_flags=() + local local_nonpersistent_flags=() + local flags_with_completion=() + local flags_completion=() + local commands=("%s") + local must_have_one_flag=() + local must_have_one_noun=() + local last_command + local nouns=() + + __handle_word +} + +`, name)) + buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then + complete -o default -F __start_%s %s +else + complete -o default -o nospace -F __start_%s %s +fi + +`, name, name, name, name)) + buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n") +} + +func writeCommands(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" commands=()\n") + for _, c := range cmd.Commands() { + if !c.IsAvailableCommand() || c == cmd.helpCommand { + continue + } + buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name())) + } + buf.WriteString("\n") +} + +func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string) { + for key, value := range annotations { + switch key { + case BashCompFilenameExt: + buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + + var ext string + if len(value) > 0 { + ext = "__handle_filename_extension_flag " + strings.Join(value, "|") + } else { + ext = "_filedir" + } + buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + case BashCompCustom: + buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + if len(value) > 0 { + handlers := strings.Join(value, "; ") + buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) + } else { + buf.WriteString(" flags_completion+=(:)\n") + } + case BashCompSubdirsInDir: + buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + + var ext string + if len(value) == 1 { + ext = "__handle_subdirs_in_dir_flag " + value[0] + } else { + ext = "_filedir -d" + } + buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + } + } +} + +func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag) { + name := flag.Shorthand + format := " " + if len(flag.NoOptDefVal) == 0 { + format += "two_word_" + } + format += "flags+=(\"-%s\")\n" + buf.WriteString(fmt.Sprintf(format, name)) + writeFlagHandler(buf, "-"+name, flag.Annotations) +} + +func writeFlag(buf *bytes.Buffer, flag *pflag.Flag) { + name := flag.Name + format := " flags+=(\"--%s" + if len(flag.NoOptDefVal) == 0 { + format += "=" + } + format += "\")\n" + buf.WriteString(fmt.Sprintf(format, name)) + writeFlagHandler(buf, "--"+name, flag.Annotations) +} + +func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { + name := flag.Name + format := " local_nonpersistent_flags+=(\"--%s" + if len(flag.NoOptDefVal) == 0 { + format += "=" + } + format += "\")\n" + buf.WriteString(fmt.Sprintf(format, name)) +} + +func writeFlags(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(` flags=() + two_word_flags=() + local_nonpersistent_flags=() + flags_with_completion=() + flags_completion=() + +`) + localNonPersistentFlags := cmd.LocalNonPersistentFlags() + cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { + if nonCompletableFlag(flag) { + return + } + writeFlag(buf, flag) + if len(flag.Shorthand) > 0 { + writeShortFlag(buf, flag) + } + if localNonPersistentFlags.Lookup(flag.Name) != nil { + writeLocalNonPersistentFlag(buf, flag) + } + }) + cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { + if nonCompletableFlag(flag) { + return + } + writeFlag(buf, flag) + if len(flag.Shorthand) > 0 { + writeShortFlag(buf, flag) + } + }) + + buf.WriteString("\n") +} + +func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" must_have_one_flag=()\n") + flags := cmd.NonInheritedFlags() + flags.VisitAll(func(flag *pflag.Flag) { + if nonCompletableFlag(flag) { + return + } + for key := range flag.Annotations { + switch key { + case BashCompOneRequiredFlag: + format := " must_have_one_flag+=(\"--%s" + if flag.Value.Type() != "bool" { + format += "=" + } + format += "\")\n" + buf.WriteString(fmt.Sprintf(format, flag.Name)) + + if len(flag.Shorthand) > 0 { + buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)) + } + } + } + }) +} + +func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" must_have_one_noun=()\n") + sort.Sort(sort.StringSlice(cmd.ValidArgs)) + for _, value := range cmd.ValidArgs { + buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) + } +} + +func writeArgAliases(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" noun_aliases=()\n") + sort.Sort(sort.StringSlice(cmd.ArgAliases)) + for _, value := range cmd.ArgAliases { + buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value)) + } +} + +func gen(buf *bytes.Buffer, cmd *Command) { + for _, c := range cmd.Commands() { + if !c.IsAvailableCommand() || c == cmd.helpCommand { + continue + } + gen(buf, c) + } + commandName := cmd.CommandPath() + commandName = strings.Replace(commandName, " ", "_", -1) + commandName = strings.Replace(commandName, ":", "__", -1) + buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName)) + buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName)) + writeCommands(buf, cmd) + writeFlags(buf, cmd) + writeRequiredFlag(buf, cmd) + writeRequiredNouns(buf, cmd) + writeArgAliases(buf, cmd) + buf.WriteString("}\n\n") +} + +// GenBashCompletion generates bash completion file and writes to the passed writer. +func (c *Command) GenBashCompletion(w io.Writer) error { + buf := new(bytes.Buffer) + writePreamble(buf, c.Name()) + if len(c.BashCompletionFunction) > 0 { + buf.WriteString(c.BashCompletionFunction + "\n") + } + gen(buf, c) + writePostscript(buf, c.Name()) + + _, err := buf.WriteTo(w) + return err +} + +func nonCompletableFlag(flag *pflag.Flag) bool { + return flag.Hidden || len(flag.Deprecated) > 0 +} + +// GenBashCompletionFile generates bash completion file. +func (c *Command) GenBashCompletionFile(filename string) error { + outFile, err := os.Create(filename) + if err != nil { + return err + } + defer outFile.Close() + + return c.GenBashCompletion(outFile) +} + +// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag, if it exists. +func (c *Command) MarkFlagRequired(name string) error { + return MarkFlagRequired(c.Flags(), name) +} + +// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag, if it exists. +func (c *Command) MarkPersistentFlagRequired(name string) error { + return MarkFlagRequired(c.PersistentFlags(), name) +} + +// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag in the flag set, if it exists. +func MarkFlagRequired(flags *pflag.FlagSet, name string) error { + return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) +} + +// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. +// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. +func (c *Command) MarkFlagFilename(name string, extensions ...string) error { + return MarkFlagFilename(c.Flags(), name, extensions...) +} + +// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. +// Generated bash autocompletion will call the bash function f for the flag. +func (c *Command) MarkFlagCustom(name string, f string) error { + return MarkFlagCustom(c.Flags(), name, f) +} + +// MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the named persistent flag, if it exists. +// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. +func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { + return MarkFlagFilename(c.PersistentFlags(), name, extensions...) +} + +// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists. +// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. +func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { + return flags.SetAnnotation(name, BashCompFilenameExt, extensions) +} + +// MarkFlagCustom adds the BashCompCustom annotation to the named flag in the flag set, if it exists. +// Generated bash autocompletion will call the bash function f for the flag. +func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { + return flags.SetAnnotation(name, BashCompCustom, []string{f}) +} diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go new file mode 100644 index 00000000000..8928cefc2fa --- /dev/null +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -0,0 +1,190 @@ +// Copyright © 2013 Steve Francia . +// +// 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. + +// Commands similar to git, go tools and other modern CLI tools +// inspired by go, go-Commander, gh and subcommand + +package cobra + +import ( + "fmt" + "io" + "reflect" + "strconv" + "strings" + "text/template" + "unicode" +) + +var templateFuncs = template.FuncMap{ + "trim": strings.TrimSpace, + "trimRightSpace": trimRightSpace, + "trimTrailingWhitespaces": trimRightSpace, + "appendIfNotPresent": appendIfNotPresent, + "rpad": rpad, + "gt": Gt, + "eq": Eq, +} + +var initializers []func() + +// EnablePrefixMatching allows to set automatic prefix matching. Automatic prefix matching can be a dangerous thing +// to automatically enable in CLI tools. +// Set this to true to enable it. +var EnablePrefixMatching = false + +// EnableCommandSorting controls sorting of the slice of commands, which is turned on by default. +// To disable sorting, set it to false. +var EnableCommandSorting = true + +// MousetrapHelpText enables an information splash screen on Windows +// if the CLI is started from explorer.exe. +// To disable the mousetrap, just set this variable to blank string (""). +// Works only on Microsoft Windows. +var MousetrapHelpText string = `This is a command line tool. + +You need to open cmd.exe and run it from there. +` + +// AddTemplateFunc adds a template function that's available to Usage and Help +// template generation. +func AddTemplateFunc(name string, tmplFunc interface{}) { + templateFuncs[name] = tmplFunc +} + +// AddTemplateFuncs adds multiple template functions that are available to Usage and +// Help template generation. +func AddTemplateFuncs(tmplFuncs template.FuncMap) { + for k, v := range tmplFuncs { + templateFuncs[k] = v + } +} + +// OnInitialize takes a series of func() arguments and appends them to a slice of func(). +func OnInitialize(y ...func()) { + initializers = append(initializers, y...) +} + +// FIXME Gt is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. + +// Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans, +// Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as +// ints and then compared. +func Gt(a interface{}, b interface{}) bool { + var left, right int64 + av := reflect.ValueOf(a) + + switch av.Kind() { + case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: + left = int64(av.Len()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + left = av.Int() + case reflect.String: + left, _ = strconv.ParseInt(av.String(), 10, 64) + } + + bv := reflect.ValueOf(b) + + switch bv.Kind() { + case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: + right = int64(bv.Len()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + right = bv.Int() + case reflect.String: + right, _ = strconv.ParseInt(bv.String(), 10, 64) + } + + return left > right +} + +// FIXME Eq is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. + +// Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic. +func Eq(a interface{}, b interface{}) bool { + av := reflect.ValueOf(a) + bv := reflect.ValueOf(b) + + switch av.Kind() { + case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: + panic("Eq called on unsupported type") + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return av.Int() == bv.Int() + case reflect.String: + return av.String() == bv.String() + } + return false +} + +func trimRightSpace(s string) string { + return strings.TrimRightFunc(s, unicode.IsSpace) +} + +// FIXME appendIfNotPresent is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. + +// appendIfNotPresent will append stringToAppend to the end of s, but only if it's not yet present in s. +func appendIfNotPresent(s, stringToAppend string) string { + if strings.Contains(s, stringToAppend) { + return s + } + return s + " " + stringToAppend +} + +// rpad adds padding to the right of a string. +func rpad(s string, padding int) string { + template := fmt.Sprintf("%%-%ds", padding) + return fmt.Sprintf(template, s) +} + +// tmpl executes the given template text on data, writing the result to w. +func tmpl(w io.Writer, text string, data interface{}) error { + t := template.New("top") + t.Funcs(templateFuncs) + template.Must(t.Parse(text)) + return t.Execute(w, data) +} + +// ld compares two strings and returns the levenshtein distance between them. +func ld(s, t string, ignoreCase bool) int { + if ignoreCase { + s = strings.ToLower(s) + t = strings.ToLower(t) + } + d := make([][]int, len(s)+1) + for i := range d { + d[i] = make([]int, len(t)+1) + } + for i := range d { + d[i][0] = i + } + for j := range d[0] { + d[0][j] = j + } + for j := 1; j <= len(t); j++ { + for i := 1; i <= len(s); i++ { + if s[i-1] == t[j-1] { + d[i][j] = d[i-1][j-1] + } else { + min := d[i-1][j] + if d[i][j-1] < min { + min = d[i][j-1] + } + if d[i-1][j-1] < min { + min = d[i-1][j-1] + } + d[i][j] = min + 1 + } + } + + } + return d[len(s)][len(t)] +} diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go new file mode 100644 index 00000000000..58e6ceb0778 --- /dev/null +++ b/vendor/github.com/spf13/cobra/command.go @@ -0,0 +1,1409 @@ +// Copyright © 2013 Steve Francia . +// +// 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 cobra is a commander providing a simple interface to create powerful modern CLI interfaces. +// In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. +package cobra + +import ( + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "sort" + "strings" + + flag "github.com/spf13/pflag" +) + +// Command is just that, a command for your application. +// E.g. 'go run ...' - 'run' is the command. Cobra requires +// you to define the usage and description as part of your command +// definition to ensure usability. +type Command struct { + // Use is the one-line usage message. + Use string + + // Aliases is an array of aliases that can be used instead of the first word in Use. + Aliases []string + + // SuggestFor is an array of command names for which this command will be suggested - + // similar to aliases but only suggests. + SuggestFor []string + + // Short is the short description shown in the 'help' output. + Short string + + // Long is the long message shown in the 'help ' output. + Long string + + // Example is examples of how to use the command. + Example string + + // ValidArgs is list of all valid non-flag arguments that are accepted in bash completions + ValidArgs []string + + // Expected arguments + Args PositionalArgs + + // ArgAliases is List of aliases for ValidArgs. + // These are not suggested to the user in the bash completion, + // but accepted if entered manually. + ArgAliases []string + + // BashCompletionFunction is custom functions used by the bash autocompletion generator. + BashCompletionFunction string + + // Deprecated defines, if this command is deprecated and should print this string when used. + Deprecated string + + // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + Hidden bool + + // Annotations are key/value pairs that can be used by applications to identify or + // group commands. + Annotations map[string]string + + // The *Run functions are executed in the following order: + // * PersistentPreRun() + // * PreRun() + // * Run() + // * PostRun() + // * PersistentPostRun() + // All functions get the same args, the arguments after the command name. + // + // PersistentPreRun: children of this command will inherit and execute. + PersistentPreRun func(cmd *Command, args []string) + // PersistentPreRunE: PersistentPreRun but returns an error. + PersistentPreRunE func(cmd *Command, args []string) error + // PreRun: children of this command will not inherit. + PreRun func(cmd *Command, args []string) + // PreRunE: PreRun but returns an error. + PreRunE func(cmd *Command, args []string) error + // Run: Typically the actual work function. Most commands will only implement this. + Run func(cmd *Command, args []string) + // RunE: Run but returns an error. + RunE func(cmd *Command, args []string) error + // PostRun: run after the Run command. + PostRun func(cmd *Command, args []string) + // PostRunE: PostRun but returns an error. + PostRunE func(cmd *Command, args []string) error + // PersistentPostRun: children of this command will inherit and execute after PostRun. + PersistentPostRun func(cmd *Command, args []string) + // PersistentPostRunE: PersistentPostRun but returns an error. + PersistentPostRunE func(cmd *Command, args []string) error + + // SilenceErrors is an option to quiet errors down stream. + SilenceErrors bool + + // SilenceUsage is an option to silence usage when an error occurs. + SilenceUsage bool + + // DisableFlagParsing disables the flag parsing. + // If this is true all flags will be passed to the command as arguments. + DisableFlagParsing bool + + // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + // will be printed by generating docs for this command. + DisableAutoGenTag bool + + // DisableSuggestions disables the suggestions based on Levenshtein distance + // that go along with 'unknown command' messages. + DisableSuggestions bool + // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + // Must be > 0. + SuggestionsMinimumDistance int + + // TraverseChildren parses flags on all parents before executing child command. + TraverseChildren bool + + // commands is the list of commands supported by this program. + commands []*Command + // parent is a parent command for this command. + parent *Command + // Max lengths of commands' string lengths for use in padding. + commandsMaxUseLen int + commandsMaxCommandPathLen int + commandsMaxNameLen int + // commandsAreSorted defines, if command slice are sorted or not. + commandsAreSorted bool + + // args is actual args parsed from flags. + args []string + // flagErrorBuf contains all error messages from pflag. + flagErrorBuf *bytes.Buffer + // flags is full set of flags. + flags *flag.FlagSet + // pflags contains persistent flags. + pflags *flag.FlagSet + // lflags contains local flags. + lflags *flag.FlagSet + // iflags contains inherited flags. + iflags *flag.FlagSet + // parentsPflags is all persistent flags of cmd's parents. + parentsPflags *flag.FlagSet + // globNormFunc is the global normalization function + // that we can use on every pflag set and children commands + globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName + + // output is an output writer defined by user. + output io.Writer + // usageFunc is usage func defined by user. + usageFunc func(*Command) error + // usageTemplate is usage template defined by user. + usageTemplate string + // flagErrorFunc is func defined by user and it's called when the parsing of + // flags returns an error. + flagErrorFunc func(*Command, error) error + // helpTemplate is help template defined by user. + helpTemplate string + // helpFunc is help func defined by user. + helpFunc func(*Command, []string) + // helpCommand is command with usage 'help'. If it's not defined by user, + // cobra uses default help command. + helpCommand *Command +} + +// SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden +// particularly useful when testing. +func (c *Command) SetArgs(a []string) { + c.args = a +} + +// SetOutput sets the destination for usage and error messages. +// If output is nil, os.Stderr is used. +func (c *Command) SetOutput(output io.Writer) { + c.output = output +} + +// SetUsageFunc sets usage function. Usage can be defined by application. +func (c *Command) SetUsageFunc(f func(*Command) error) { + c.usageFunc = f +} + +// SetUsageTemplate sets usage template. Can be defined by Application. +func (c *Command) SetUsageTemplate(s string) { + c.usageTemplate = s +} + +// SetFlagErrorFunc sets a function to generate an error when flag parsing +// fails. +func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) { + c.flagErrorFunc = f +} + +// SetHelpFunc sets help function. Can be defined by Application. +func (c *Command) SetHelpFunc(f func(*Command, []string)) { + c.helpFunc = f +} + +// SetHelpCommand sets help command. +func (c *Command) SetHelpCommand(cmd *Command) { + c.helpCommand = cmd +} + +// SetHelpTemplate sets help template to be used. Application can use it to set custom template. +func (c *Command) SetHelpTemplate(s string) { + c.helpTemplate = s +} + +// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. +// The user should not have a cyclic dependency on commands. +func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) { + c.Flags().SetNormalizeFunc(n) + c.PersistentFlags().SetNormalizeFunc(n) + c.globNormFunc = n + + for _, command := range c.commands { + command.SetGlobalNormalizationFunc(n) + } +} + +// OutOrStdout returns output to stdout. +func (c *Command) OutOrStdout() io.Writer { + return c.getOut(os.Stdout) +} + +// OutOrStderr returns output to stderr +func (c *Command) OutOrStderr() io.Writer { + return c.getOut(os.Stderr) +} + +func (c *Command) getOut(def io.Writer) io.Writer { + if c.output != nil { + return c.output + } + if c.HasParent() { + return c.parent.getOut(def) + } + return def +} + +// UsageFunc returns either the function set by SetUsageFunc for this command +// or a parent, or it returns a default usage function. +func (c *Command) UsageFunc() (f func(*Command) error) { + if c.usageFunc != nil { + return c.usageFunc + } + if c.HasParent() { + return c.Parent().UsageFunc() + } + return func(c *Command) error { + c.mergePersistentFlags() + err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c) + if err != nil { + c.Println(err) + } + return err + } +} + +// Usage puts out the usage for the command. +// Used when a user provides invalid input. +// Can be defined by user by overriding UsageFunc. +func (c *Command) Usage() error { + return c.UsageFunc()(c) +} + +// HelpFunc returns either the function set by SetHelpFunc for this command +// or a parent, or it returns a function with default help behavior. +func (c *Command) HelpFunc() func(*Command, []string) { + if c.helpFunc != nil { + return c.helpFunc + } + if c.HasParent() { + return c.Parent().HelpFunc() + } + return func(c *Command, a []string) { + c.mergePersistentFlags() + err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c) + if err != nil { + c.Println(err) + } + } +} + +// Help puts out the help for the command. +// Used when a user calls help [command]. +// Can be defined by user by overriding HelpFunc. +func (c *Command) Help() error { + c.HelpFunc()(c, []string{}) + return nil +} + +// UsageString return usage string. +func (c *Command) UsageString() string { + tmpOutput := c.output + bb := new(bytes.Buffer) + c.SetOutput(bb) + c.Usage() + c.output = tmpOutput + return bb.String() +} + +// FlagErrorFunc returns either the function set by SetFlagErrorFunc for this +// command or a parent, or it returns a function which returns the original +// error. +func (c *Command) FlagErrorFunc() (f func(*Command, error) error) { + if c.flagErrorFunc != nil { + return c.flagErrorFunc + } + + if c.HasParent() { + return c.parent.FlagErrorFunc() + } + return func(c *Command, err error) error { + return err + } +} + +var minUsagePadding = 25 + +// UsagePadding return padding for the usage. +func (c *Command) UsagePadding() int { + if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen { + return minUsagePadding + } + return c.parent.commandsMaxUseLen +} + +var minCommandPathPadding = 11 + +// CommandPathPadding return padding for the command path. +func (c *Command) CommandPathPadding() int { + if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen { + return minCommandPathPadding + } + return c.parent.commandsMaxCommandPathLen +} + +var minNamePadding = 11 + +// NamePadding returns padding for the name. +func (c *Command) NamePadding() int { + if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen { + return minNamePadding + } + return c.parent.commandsMaxNameLen +} + +// UsageTemplate returns usage template for the command. +func (c *Command) UsageTemplate() string { + if c.usageTemplate != "" { + return c.usageTemplate + } + + if c.HasParent() { + return c.parent.UsageTemplate() + } + return `Usage:{{if .Runnable}} + {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} + {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} + +Aliases: + {{.NameAndAliases}}{{end}}{{if .HasExample}} + +Examples: +{{.Example}}{{end}}{{if .HasAvailableSubCommands}} + +Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} + +Flags: +{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} + +Global Flags: +{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} + +Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} + {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} + +Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} +` +} + +// HelpTemplate return help template for the command. +func (c *Command) HelpTemplate() string { + if c.helpTemplate != "" { + return c.helpTemplate + } + + if c.HasParent() { + return c.parent.HelpTemplate() + } + return `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}} + +{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` +} + +func hasNoOptDefVal(name string, fs *flag.FlagSet) bool { + flag := fs.Lookup(name) + if flag == nil { + return false + } + return flag.NoOptDefVal != "" +} + +func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool { + if len(name) == 0 { + return false + } + + flag := fs.ShorthandLookup(name[:1]) + if flag == nil { + return false + } + return flag.NoOptDefVal != "" +} + +func stripFlags(args []string, c *Command) []string { + if len(args) == 0 { + return args + } + c.mergePersistentFlags() + + commands := []string{} + flags := c.Flags() + +Loop: + for len(args) > 0 { + s := args[0] + args = args[1:] + switch { + case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags): + // If '--flag arg' then + // delete arg from args. + fallthrough // (do the same as below) + case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags): + // If '-f arg' then + // delete 'arg' from args or break the loop if len(args) <= 1. + if len(args) <= 1 { + break Loop + } else { + args = args[1:] + continue + } + case s != "" && !strings.HasPrefix(s, "-"): + commands = append(commands, s) + } + } + + return commands +} + +// argsMinusFirstX removes only the first x from args. Otherwise, commands that look like +// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]). +func argsMinusFirstX(args []string, x string) []string { + for i, y := range args { + if x == y { + ret := []string{} + ret = append(ret, args[:i]...) + ret = append(ret, args[i+1:]...) + return ret + } + } + return args +} + +func isFlagArg(arg string) bool { + return ((len(arg) >= 3 && arg[1] == '-') || + (len(arg) >= 2 && arg[0] == '-' && arg[1] != '-')) +} + +// Find the target command given the args and command tree +// Meant to be run on the highest node. Only searches down. +func (c *Command) Find(args []string) (*Command, []string, error) { + var innerfind func(*Command, []string) (*Command, []string) + + innerfind = func(c *Command, innerArgs []string) (*Command, []string) { + argsWOflags := stripFlags(innerArgs, c) + if len(argsWOflags) == 0 { + return c, innerArgs + } + nextSubCmd := argsWOflags[0] + + cmd := c.findNext(nextSubCmd) + if cmd != nil { + return innerfind(cmd, argsMinusFirstX(innerArgs, nextSubCmd)) + } + return c, innerArgs + } + + commandFound, a := innerfind(c, args) + if commandFound.Args == nil { + return commandFound, a, legacyArgs(commandFound, stripFlags(a, commandFound)) + } + return commandFound, a, nil +} + +func (c *Command) findSuggestions(arg string) string { + if c.DisableSuggestions { + return "" + } + if c.SuggestionsMinimumDistance <= 0 { + c.SuggestionsMinimumDistance = 2 + } + suggestionsString := "" + if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 { + suggestionsString += "\n\nDid you mean this?\n" + for _, s := range suggestions { + suggestionsString += fmt.Sprintf("\t%v\n", s) + } + } + return suggestionsString +} + +func (c *Command) findNext(next string) *Command { + matches := make([]*Command, 0) + for _, cmd := range c.commands { + if cmd.Name() == next || cmd.HasAlias(next) { + return cmd + } + if EnablePrefixMatching && cmd.hasNameOrAliasPrefix(next) { + matches = append(matches, cmd) + } + } + + if len(matches) == 1 { + return matches[0] + } + return nil +} + +// Traverse the command tree to find the command, and parse args for +// each parent. +func (c *Command) Traverse(args []string) (*Command, []string, error) { + flags := []string{} + inFlag := false + + for i, arg := range args { + switch { + // A long flag with a space separated value + case strings.HasPrefix(arg, "--") && !strings.Contains(arg, "="): + // TODO: this isn't quite right, we should really check ahead for 'true' or 'false' + inFlag = !hasNoOptDefVal(arg[2:], c.Flags()) + flags = append(flags, arg) + continue + // A short flag with a space separated value + case strings.HasPrefix(arg, "-") && !strings.Contains(arg, "=") && len(arg) == 2 && !shortHasNoOptDefVal(arg[1:], c.Flags()): + inFlag = true + flags = append(flags, arg) + continue + // The value for a flag + case inFlag: + inFlag = false + flags = append(flags, arg) + continue + // A flag without a value, or with an `=` separated value + case isFlagArg(arg): + flags = append(flags, arg) + continue + } + + cmd := c.findNext(arg) + if cmd == nil { + return c, args, nil + } + + if err := c.ParseFlags(flags); err != nil { + return nil, args, err + } + return cmd.Traverse(args[i+1:]) + } + return c, args, nil +} + +// SuggestionsFor provides suggestions for the typedName. +func (c *Command) SuggestionsFor(typedName string) []string { + suggestions := []string{} + for _, cmd := range c.commands { + if cmd.IsAvailableCommand() { + levenshteinDistance := ld(typedName, cmd.Name(), true) + suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance + suggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName)) + if suggestByLevenshtein || suggestByPrefix { + suggestions = append(suggestions, cmd.Name()) + } + for _, explicitSuggestion := range cmd.SuggestFor { + if strings.EqualFold(typedName, explicitSuggestion) { + suggestions = append(suggestions, cmd.Name()) + } + } + } + } + return suggestions +} + +// VisitParents visits all parents of the command and invokes fn on each parent. +func (c *Command) VisitParents(fn func(*Command)) { + if c.HasParent() { + fn(c.Parent()) + c.Parent().VisitParents(fn) + } +} + +// Root finds root command. +func (c *Command) Root() *Command { + if c.HasParent() { + return c.Parent().Root() + } + return c +} + +// ArgsLenAtDash will return the length of f.Args at the moment when a -- was +// found during arg parsing. This allows your program to know which args were +// before the -- and which came after. (Description from +// https://godoc.org/github.com/spf13/pflag#FlagSet.ArgsLenAtDash). +func (c *Command) ArgsLenAtDash() int { + return c.Flags().ArgsLenAtDash() +} + +func (c *Command) execute(a []string) (err error) { + if c == nil { + return fmt.Errorf("Called Execute() on a nil Command") + } + + if len(c.Deprecated) > 0 { + c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated) + } + + // initialize help flag as the last point possible to allow for user + // overriding + c.InitDefaultHelpFlag() + + err = c.ParseFlags(a) + if err != nil { + return c.FlagErrorFunc()(c, err) + } + + // If help is called, regardless of other flags, return we want help. + // Also say we need help if the command isn't runnable. + helpVal, err := c.Flags().GetBool("help") + if err != nil { + // should be impossible to get here as we always declare a help + // flag in InitDefaultHelpFlag() + c.Println("\"help\" flag declared as non-bool. Please correct your code") + return err + } + + if helpVal || !c.Runnable() { + return flag.ErrHelp + } + + c.preRun() + + argWoFlags := c.Flags().Args() + if c.DisableFlagParsing { + argWoFlags = a + } + + if err := c.ValidateArgs(argWoFlags); err != nil { + return err + } + + for p := c; p != nil; p = p.Parent() { + if p.PersistentPreRunE != nil { + if err := p.PersistentPreRunE(c, argWoFlags); err != nil { + return err + } + break + } else if p.PersistentPreRun != nil { + p.PersistentPreRun(c, argWoFlags) + break + } + } + if c.PreRunE != nil { + if err := c.PreRunE(c, argWoFlags); err != nil { + return err + } + } else if c.PreRun != nil { + c.PreRun(c, argWoFlags) + } + + if err := c.validateRequiredFlags(); err != nil { + return err + } + if c.RunE != nil { + if err := c.RunE(c, argWoFlags); err != nil { + return err + } + } else { + c.Run(c, argWoFlags) + } + if c.PostRunE != nil { + if err := c.PostRunE(c, argWoFlags); err != nil { + return err + } + } else if c.PostRun != nil { + c.PostRun(c, argWoFlags) + } + for p := c; p != nil; p = p.Parent() { + if p.PersistentPostRunE != nil { + if err := p.PersistentPostRunE(c, argWoFlags); err != nil { + return err + } + break + } else if p.PersistentPostRun != nil { + p.PersistentPostRun(c, argWoFlags) + break + } + } + + return nil +} + +func (c *Command) preRun() { + for _, x := range initializers { + x() + } +} + +// Execute uses the args (os.Args[1:] by default) +// and run through the command tree finding appropriate matches +// for commands and then corresponding flags. +func (c *Command) Execute() error { + _, err := c.ExecuteC() + return err +} + +// ExecuteC executes the command. +func (c *Command) ExecuteC() (cmd *Command, err error) { + // Regardless of what command execute is called on, run on Root only + if c.HasParent() { + return c.Root().ExecuteC() + } + + // windows hook + if preExecHookFn != nil { + preExecHookFn(c) + } + + // initialize help as the last point possible to allow for user + // overriding + c.InitDefaultHelpCmd() + + var args []string + + // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 + if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { + args = os.Args[1:] + } else { + args = c.args + } + + var flags []string + if c.TraverseChildren { + cmd, flags, err = c.Traverse(args) + } else { + cmd, flags, err = c.Find(args) + } + if err != nil { + // If found parse to a subcommand and then failed, talk about the subcommand + if cmd != nil { + c = cmd + } + if !c.SilenceErrors { + c.Println("Error:", err.Error()) + c.Printf("Run '%v --help' for usage.\n", c.CommandPath()) + } + return c, err + } + + err = cmd.execute(flags) + if err != nil { + // Always show help if requested, even if SilenceErrors is in + // effect + if err == flag.ErrHelp { + cmd.HelpFunc()(cmd, args) + return cmd, nil + } + + // If root command has SilentErrors flagged, + // all subcommands should respect it + if !cmd.SilenceErrors && !c.SilenceErrors { + c.Println("Error:", err.Error()) + } + + // If root command has SilentUsage flagged, + // all subcommands should respect it + if !cmd.SilenceUsage && !c.SilenceUsage { + c.Println(cmd.UsageString()) + } + } + return cmd, err +} + +func (c *Command) ValidateArgs(args []string) error { + if c.Args == nil { + return nil + } + return c.Args(c, args) +} + +func (c *Command) validateRequiredFlags() error { + flags := c.Flags() + missingFlagNames := []string{} + flags.VisitAll(func(pflag *flag.Flag) { + requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag] + if !found { + return + } + if (requiredAnnotation[0] == "true") && !pflag.Changed { + missingFlagNames = append(missingFlagNames, pflag.Name) + } + }) + + if len(missingFlagNames) > 0 { + return fmt.Errorf(`Required flag(s) "%s" have/has not been set`, strings.Join(missingFlagNames, `", "`)) + } + return nil +} + +// InitDefaultHelpFlag adds default help flag to c. +// It is called automatically by executing the c or by calling help and usage. +// If c already has help flag, it will do nothing. +func (c *Command) InitDefaultHelpFlag() { + c.mergePersistentFlags() + if c.Flags().Lookup("help") == nil { + usage := "help for " + if c.Name() == "" { + usage += "this command" + } else { + usage += c.Name() + } + c.Flags().BoolP("help", "h", false, usage) + } +} + +// InitDefaultHelpCmd adds default help command to c. +// It is called automatically by executing the c or by calling help and usage. +// If c already has help command or c has no subcommands, it will do nothing. +func (c *Command) InitDefaultHelpCmd() { + if !c.HasSubCommands() { + return + } + + if c.helpCommand == nil { + c.helpCommand = &Command{ + Use: "help [command]", + Short: "Help about any command", + Long: `Help provides help for any command in the application. +Simply type ` + c.Name() + ` help [path to command] for full details.`, + + Run: func(c *Command, args []string) { + cmd, _, e := c.Root().Find(args) + if cmd == nil || e != nil { + c.Printf("Unknown help topic %#q\n", args) + c.Root().Usage() + } else { + cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown + cmd.Help() + } + }, + } + } + c.RemoveCommand(c.helpCommand) + c.AddCommand(c.helpCommand) +} + +// ResetCommands used for testing. +func (c *Command) ResetCommands() { + c.parent = nil + c.commands = nil + c.helpCommand = nil + c.parentsPflags = nil +} + +// Sorts commands by their names. +type commandSorterByName []*Command + +func (c commandSorterByName) Len() int { return len(c) } +func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] } +func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() } + +// Commands returns a sorted slice of child commands. +func (c *Command) Commands() []*Command { + // do not sort commands if it already sorted or sorting was disabled + if EnableCommandSorting && !c.commandsAreSorted { + sort.Sort(commandSorterByName(c.commands)) + c.commandsAreSorted = true + } + return c.commands +} + +// AddCommand adds one or more commands to this parent command. +func (c *Command) AddCommand(cmds ...*Command) { + for i, x := range cmds { + if cmds[i] == c { + panic("Command can't be a child of itself") + } + cmds[i].parent = c + // update max lengths + usageLen := len(x.Use) + if usageLen > c.commandsMaxUseLen { + c.commandsMaxUseLen = usageLen + } + commandPathLen := len(x.CommandPath()) + if commandPathLen > c.commandsMaxCommandPathLen { + c.commandsMaxCommandPathLen = commandPathLen + } + nameLen := len(x.Name()) + if nameLen > c.commandsMaxNameLen { + c.commandsMaxNameLen = nameLen + } + // If global normalization function exists, update all children + if c.globNormFunc != nil { + x.SetGlobalNormalizationFunc(c.globNormFunc) + } + c.commands = append(c.commands, x) + c.commandsAreSorted = false + } +} + +// RemoveCommand removes one or more commands from a parent command. +func (c *Command) RemoveCommand(cmds ...*Command) { + commands := []*Command{} +main: + for _, command := range c.commands { + for _, cmd := range cmds { + if command == cmd { + command.parent = nil + continue main + } + } + commands = append(commands, command) + } + c.commands = commands + // recompute all lengths + c.commandsMaxUseLen = 0 + c.commandsMaxCommandPathLen = 0 + c.commandsMaxNameLen = 0 + for _, command := range c.commands { + usageLen := len(command.Use) + if usageLen > c.commandsMaxUseLen { + c.commandsMaxUseLen = usageLen + } + commandPathLen := len(command.CommandPath()) + if commandPathLen > c.commandsMaxCommandPathLen { + c.commandsMaxCommandPathLen = commandPathLen + } + nameLen := len(command.Name()) + if nameLen > c.commandsMaxNameLen { + c.commandsMaxNameLen = nameLen + } + } +} + +// Print is a convenience method to Print to the defined output, fallback to Stderr if not set. +func (c *Command) Print(i ...interface{}) { + fmt.Fprint(c.OutOrStderr(), i...) +} + +// Println is a convenience method to Println to the defined output, fallback to Stderr if not set. +func (c *Command) Println(i ...interface{}) { + c.Print(fmt.Sprintln(i...)) +} + +// Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. +func (c *Command) Printf(format string, i ...interface{}) { + c.Print(fmt.Sprintf(format, i...)) +} + +// CommandPath returns the full path to this command. +func (c *Command) CommandPath() string { + if c.HasParent() { + return c.Parent().CommandPath() + " " + c.Name() + } + return c.Name() +} + +// UseLine puts out the full usage for a given command (including parents). +func (c *Command) UseLine() string { + var useline string + if c.HasParent() { + useline = c.parent.CommandPath() + " " + c.Use + } else { + useline = c.Use + } + if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") { + useline += " [flags]" + } + return useline +} + +// DebugFlags used to determine which flags have been assigned to which commands +// and which persist. +func (c *Command) DebugFlags() { + c.Println("DebugFlags called on", c.Name()) + var debugflags func(*Command) + + debugflags = func(x *Command) { + if x.HasFlags() || x.HasPersistentFlags() { + c.Println(x.Name()) + } + if x.HasFlags() { + x.flags.VisitAll(func(f *flag.Flag) { + if x.HasPersistentFlags() && x.persistentFlag(f.Name) != nil { + c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [LP]") + } else { + c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [L]") + } + }) + } + if x.HasPersistentFlags() { + x.pflags.VisitAll(func(f *flag.Flag) { + if x.HasFlags() { + if x.flags.Lookup(f.Name) == nil { + c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") + } + } else { + c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") + } + }) + } + c.Println(x.flagErrorBuf) + if x.HasSubCommands() { + for _, y := range x.commands { + debugflags(y) + } + } + } + + debugflags(c) +} + +// Name returns the command's name: the first word in the use line. +func (c *Command) Name() string { + name := c.Use + i := strings.Index(name, " ") + if i >= 0 { + name = name[:i] + } + return name +} + +// HasAlias determines if a given string is an alias of the command. +func (c *Command) HasAlias(s string) bool { + for _, a := range c.Aliases { + if a == s { + return true + } + } + return false +} + +// hasNameOrAliasPrefix returns true if the Name or any of aliases start +// with prefix +func (c *Command) hasNameOrAliasPrefix(prefix string) bool { + if strings.HasPrefix(c.Name(), prefix) { + return true + } + for _, alias := range c.Aliases { + if strings.HasPrefix(alias, prefix) { + return true + } + } + return false +} + +// NameAndAliases returns a list of the command name and all aliases +func (c *Command) NameAndAliases() string { + return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ") +} + +// HasExample determines if the command has example. +func (c *Command) HasExample() bool { + return len(c.Example) > 0 +} + +// Runnable determines if the command is itself runnable. +func (c *Command) Runnable() bool { + return c.Run != nil || c.RunE != nil +} + +// HasSubCommands determines if the command has children commands. +func (c *Command) HasSubCommands() bool { + return len(c.commands) > 0 +} + +// IsAvailableCommand determines if a command is available as a non-help command +// (this includes all non deprecated/hidden commands). +func (c *Command) IsAvailableCommand() bool { + if len(c.Deprecated) != 0 || c.Hidden { + return false + } + + if c.HasParent() && c.Parent().helpCommand == c { + return false + } + + if c.Runnable() || c.HasAvailableSubCommands() { + return true + } + + return false +} + +// IsAdditionalHelpTopicCommand determines if a command is an additional +// help topic command; additional help topic command is determined by the +// fact that it is NOT runnable/hidden/deprecated, and has no sub commands that +// are runnable/hidden/deprecated. +// Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. +func (c *Command) IsAdditionalHelpTopicCommand() bool { + // if a command is runnable, deprecated, or hidden it is not a 'help' command + if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden { + return false + } + + // if any non-help sub commands are found, the command is not a 'help' command + for _, sub := range c.commands { + if !sub.IsAdditionalHelpTopicCommand() { + return false + } + } + + // the command either has no sub commands, or no non-help sub commands + return true +} + +// HasHelpSubCommands determines if a command has any available 'help' sub commands +// that need to be shown in the usage/help default template under 'additional help +// topics'. +func (c *Command) HasHelpSubCommands() bool { + // return true on the first found available 'help' sub command + for _, sub := range c.commands { + if sub.IsAdditionalHelpTopicCommand() { + return true + } + } + + // the command either has no sub commands, or no available 'help' sub commands + return false +} + +// HasAvailableSubCommands determines if a command has available sub commands that +// need to be shown in the usage/help default template under 'available commands'. +func (c *Command) HasAvailableSubCommands() bool { + // return true on the first found available (non deprecated/help/hidden) + // sub command + for _, sub := range c.commands { + if sub.IsAvailableCommand() { + return true + } + } + + // the command either has no sub comamnds, or no available (non deprecated/help/hidden) + // sub commands + return false +} + +// HasParent determines if the command is a child command. +func (c *Command) HasParent() bool { + return c.parent != nil +} + +// GlobalNormalizationFunc returns the global normalization function or nil if doesn't exists. +func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName { + return c.globNormFunc +} + +// Flags returns the complete FlagSet that applies +// to this command (local and persistent declared here and by all parents). +func (c *Command) Flags() *flag.FlagSet { + if c.flags == nil { + c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + if c.flagErrorBuf == nil { + c.flagErrorBuf = new(bytes.Buffer) + } + c.flags.SetOutput(c.flagErrorBuf) + } + + return c.flags +} + +// LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. +func (c *Command) LocalNonPersistentFlags() *flag.FlagSet { + persistentFlags := c.PersistentFlags() + + out := flag.NewFlagSet(c.Name(), flag.ContinueOnError) + c.LocalFlags().VisitAll(func(f *flag.Flag) { + if persistentFlags.Lookup(f.Name) == nil { + out.AddFlag(f) + } + }) + return out +} + +// LocalFlags returns the local FlagSet specifically set in the current command. +func (c *Command) LocalFlags() *flag.FlagSet { + c.mergePersistentFlags() + + if c.lflags == nil { + c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + if c.flagErrorBuf == nil { + c.flagErrorBuf = new(bytes.Buffer) + } + c.lflags.SetOutput(c.flagErrorBuf) + } + c.lflags.SortFlags = c.Flags().SortFlags + if c.globNormFunc != nil { + c.lflags.SetNormalizeFunc(c.globNormFunc) + } + + addToLocal := func(f *flag.Flag) { + if c.lflags.Lookup(f.Name) == nil && c.parentsPflags.Lookup(f.Name) == nil { + c.lflags.AddFlag(f) + } + } + c.Flags().VisitAll(addToLocal) + c.PersistentFlags().VisitAll(addToLocal) + return c.lflags +} + +// InheritedFlags returns all flags which were inherited from parents commands. +func (c *Command) InheritedFlags() *flag.FlagSet { + c.mergePersistentFlags() + + if c.iflags == nil { + c.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + if c.flagErrorBuf == nil { + c.flagErrorBuf = new(bytes.Buffer) + } + c.iflags.SetOutput(c.flagErrorBuf) + } + + local := c.LocalFlags() + if c.globNormFunc != nil { + c.iflags.SetNormalizeFunc(c.globNormFunc) + } + + c.parentsPflags.VisitAll(func(f *flag.Flag) { + if c.iflags.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil { + c.iflags.AddFlag(f) + } + }) + return c.iflags +} + +// NonInheritedFlags returns all flags which were not inherited from parent commands. +func (c *Command) NonInheritedFlags() *flag.FlagSet { + return c.LocalFlags() +} + +// PersistentFlags returns the persistent FlagSet specifically set in the current command. +func (c *Command) PersistentFlags() *flag.FlagSet { + if c.pflags == nil { + c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + if c.flagErrorBuf == nil { + c.flagErrorBuf = new(bytes.Buffer) + } + c.pflags.SetOutput(c.flagErrorBuf) + } + return c.pflags +} + +// ResetFlags is used in testing. +func (c *Command) ResetFlags() { + c.flagErrorBuf = new(bytes.Buffer) + c.flagErrorBuf.Reset() + c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + c.flags.SetOutput(c.flagErrorBuf) + c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + c.pflags.SetOutput(c.flagErrorBuf) + + c.lflags = nil + c.iflags = nil + c.parentsPflags = nil +} + +// HasFlags checks if the command contains any flags (local plus persistent from the entire structure). +func (c *Command) HasFlags() bool { + return c.Flags().HasFlags() +} + +// HasPersistentFlags checks if the command contains persistent flags. +func (c *Command) HasPersistentFlags() bool { + return c.PersistentFlags().HasFlags() +} + +// HasLocalFlags checks if the command has flags specifically declared locally. +func (c *Command) HasLocalFlags() bool { + return c.LocalFlags().HasFlags() +} + +// HasInheritedFlags checks if the command has flags inherited from its parent command. +func (c *Command) HasInheritedFlags() bool { + return c.InheritedFlags().HasFlags() +} + +// HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire +// structure) which are not hidden or deprecated. +func (c *Command) HasAvailableFlags() bool { + return c.Flags().HasAvailableFlags() +} + +// HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. +func (c *Command) HasAvailablePersistentFlags() bool { + return c.PersistentFlags().HasAvailableFlags() +} + +// HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden +// or deprecated. +func (c *Command) HasAvailableLocalFlags() bool { + return c.LocalFlags().HasAvailableFlags() +} + +// HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are +// not hidden or deprecated. +func (c *Command) HasAvailableInheritedFlags() bool { + return c.InheritedFlags().HasAvailableFlags() +} + +// Flag climbs up the command tree looking for matching flag. +func (c *Command) Flag(name string) (flag *flag.Flag) { + flag = c.Flags().Lookup(name) + + if flag == nil { + flag = c.persistentFlag(name) + } + + return +} + +// Recursively find matching persistent flag. +func (c *Command) persistentFlag(name string) (flag *flag.Flag) { + if c.HasPersistentFlags() { + flag = c.PersistentFlags().Lookup(name) + } + + if flag == nil { + c.updateParentsPflags() + flag = c.parentsPflags.Lookup(name) + } + return +} + +// ParseFlags parses persistent flag tree and local flags. +func (c *Command) ParseFlags(args []string) error { + if c.DisableFlagParsing { + return nil + } + + if c.flagErrorBuf == nil { + c.flagErrorBuf = new(bytes.Buffer) + } + beforeErrorBufLen := c.flagErrorBuf.Len() + c.mergePersistentFlags() + err := c.Flags().Parse(args) + // Print warnings if they occurred (e.g. deprecated flag messages). + if c.flagErrorBuf.Len()-beforeErrorBufLen > 0 && err == nil { + c.Print(c.flagErrorBuf.String()) + } + + return err +} + +// Parent returns a commands parent command. +func (c *Command) Parent() *Command { + return c.parent +} + +// mergePersistentFlags merges c.PersistentFlags() to c.Flags() +// and adds missing persistent flags of all parents. +func (c *Command) mergePersistentFlags() { + c.updateParentsPflags() + c.Flags().AddFlagSet(c.PersistentFlags()) + c.Flags().AddFlagSet(c.parentsPflags) +} + +// updateParentsPflags updates c.parentsPflags by adding +// new persistent flags of all parents. +// If c.parentsPflags == nil, it makes new. +func (c *Command) updateParentsPflags() { + if c.parentsPflags == nil { + c.parentsPflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) + c.parentsPflags.SetOutput(c.flagErrorBuf) + c.parentsPflags.SortFlags = false + } + + if c.globNormFunc != nil { + c.parentsPflags.SetNormalizeFunc(c.globNormFunc) + } + + c.Root().PersistentFlags().AddFlagSet(flag.CommandLine) + + c.VisitParents(func(parent *Command) { + c.parentsPflags.AddFlagSet(parent.PersistentFlags()) + }) +} diff --git a/vendor/github.com/spf13/cobra/command_notwin.go b/vendor/github.com/spf13/cobra/command_notwin.go new file mode 100644 index 00000000000..6159c1cc19d --- /dev/null +++ b/vendor/github.com/spf13/cobra/command_notwin.go @@ -0,0 +1,5 @@ +// +build !windows + +package cobra + +var preExecHookFn func(*Command) diff --git a/vendor/github.com/spf13/cobra/command_win.go b/vendor/github.com/spf13/cobra/command_win.go new file mode 100644 index 00000000000..edec728e4f5 --- /dev/null +++ b/vendor/github.com/spf13/cobra/command_win.go @@ -0,0 +1,20 @@ +// +build windows + +package cobra + +import ( + "os" + "time" + + "github.com/inconshreveable/mousetrap" +) + +var preExecHookFn = preExecHook + +func preExecHook(c *Command) { + if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { + c.Print(MousetrapHelpText) + time.Sleep(5 * time.Second) + os.Exit(1) + } +} diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go new file mode 100644 index 00000000000..889c22e273c --- /dev/null +++ b/vendor/github.com/spf13/cobra/zsh_completions.go @@ -0,0 +1,126 @@ +package cobra + +import ( + "bytes" + "fmt" + "io" + "os" + "strings" +) + +// GenZshCompletionFile generates zsh completion file. +func (c *Command) GenZshCompletionFile(filename string) error { + outFile, err := os.Create(filename) + if err != nil { + return err + } + defer outFile.Close() + + return c.GenZshCompletion(outFile) +} + +// GenZshCompletion generates a zsh completion file and writes to the passed writer. +func (c *Command) GenZshCompletion(w io.Writer) error { + buf := new(bytes.Buffer) + + writeHeader(buf, c) + maxDepth := maxDepth(c) + writeLevelMapping(buf, maxDepth) + writeLevelCases(buf, maxDepth, c) + + _, err := buf.WriteTo(w) + return err +} + +func writeHeader(w io.Writer, cmd *Command) { + fmt.Fprintf(w, "#compdef %s\n\n", cmd.Name()) +} + +func maxDepth(c *Command) int { + if len(c.Commands()) == 0 { + return 0 + } + maxDepthSub := 0 + for _, s := range c.Commands() { + subDepth := maxDepth(s) + if subDepth > maxDepthSub { + maxDepthSub = subDepth + } + } + return 1 + maxDepthSub +} + +func writeLevelMapping(w io.Writer, numLevels int) { + fmt.Fprintln(w, `_arguments \`) + for i := 1; i <= numLevels; i++ { + fmt.Fprintf(w, ` '%d: :->level%d' \`, i, i) + fmt.Fprintln(w) + } + fmt.Fprintf(w, ` '%d: :%s'`, numLevels+1, "_files") + fmt.Fprintln(w) +} + +func writeLevelCases(w io.Writer, maxDepth int, root *Command) { + fmt.Fprintln(w, "case $state in") + defer fmt.Fprintln(w, "esac") + + for i := 1; i <= maxDepth; i++ { + fmt.Fprintf(w, " level%d)\n", i) + writeLevel(w, root, i) + fmt.Fprintln(w, " ;;") + } + fmt.Fprintln(w, " *)") + fmt.Fprintln(w, " _arguments '*: :_files'") + fmt.Fprintln(w, " ;;") +} + +func writeLevel(w io.Writer, root *Command, i int) { + fmt.Fprintf(w, " case $words[%d] in\n", i) + defer fmt.Fprintln(w, " esac") + + commands := filterByLevel(root, i) + byParent := groupByParent(commands) + + for p, c := range byParent { + names := names(c) + fmt.Fprintf(w, " %s)\n", p) + fmt.Fprintf(w, " _arguments '%d: :(%s)'\n", i, strings.Join(names, " ")) + fmt.Fprintln(w, " ;;") + } + fmt.Fprintln(w, " *)") + fmt.Fprintln(w, " _arguments '*: :_files'") + fmt.Fprintln(w, " ;;") + +} + +func filterByLevel(c *Command, l int) []*Command { + cs := make([]*Command, 0) + if l == 0 { + cs = append(cs, c) + return cs + } + for _, s := range c.Commands() { + cs = append(cs, filterByLevel(s, l-1)...) + } + return cs +} + +func groupByParent(commands []*Command) map[string][]*Command { + m := make(map[string][]*Command) + for _, c := range commands { + parent := c.Parent() + if parent == nil { + continue + } + m[parent.Name()] = append(m[parent.Name()], c) + } + return m +} + +func names(commands []*Command) []string { + ns := make([]string, len(commands)) + for i, c := range commands { + ns[i] = c.Name() + } + return ns +} From c6f02bae8894f9520a6269e5ef3c5a4e7963f891 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Tue, 25 Sep 2018 11:18:45 -0700 Subject: [PATCH 2/5] pkg/cluster/config: add missing ami fetch --- pkg/types/config/cluster.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/types/config/cluster.go b/pkg/types/config/cluster.go index 7699298ff02..b8338f851ad 100644 --- a/pkg/types/config/cluster.go +++ b/pkg/types/config/cluster.go @@ -1,12 +1,15 @@ package config import ( + "context" "encoding/json" "fmt" + "time" "github.com/coreos/tectonic-config/config/tectonic-network" "gopkg.in/yaml.v2" + "github.com/openshift/installer/pkg/rhcos" "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/config/aws" "github.com/openshift/installer/pkg/types/config/libvirt" @@ -175,6 +178,13 @@ func ConvertInstallConfigToTFVars(cfg *types.InstallConfig, bootstrapIgn string, } if cfg.Platform.AWS != nil { + ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second) + defer cancel() + ami, err := rhcos.AMI(ctx, rhcos.DefaultChannel, cluster.AWS.Region) + if err != nil { + return nil, fmt.Errorf("failed to determine default AMI: %v", err) + } + cluster.Platform = PlatformAWS cluster.AWS = aws.AWS{ Endpoints: aws.EndpointsAll, // Default value for endpoints. @@ -184,7 +194,8 @@ func ConvertInstallConfigToTFVars(cfg *types.InstallConfig, bootstrapIgn string, External: aws.External{ VPCID: cfg.Platform.AWS.VPCID, }, - VPCCIDRBlock: cfg.Platform.AWS.VPCCIDRBlock, + VPCCIDRBlock: cfg.Platform.AWS.VPCCIDRBlock, + EC2AMIOverride: ami, } } else if cfg.Platform.Libvirt != nil { cluster.Platform = PlatformLibvirt From 008b619bca2090101ae81d1f1517264366277249 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Tue, 25 Sep 2018 11:20:34 -0700 Subject: [PATCH 3/5] fix logrus import --- installer/cmd/tectonic/BUILD.bazel | 2 +- installer/cmd/tectonic/main.go | 2 +- installer/pkg/workflow/BUILD.bazel | 2 +- installer/pkg/workflow/destroy.go | 2 +- installer/pkg/workflow/workflow.go | 2 +- pkg/types/config/BUILD.bazel | 2 +- pkg/types/config/validate.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/installer/cmd/tectonic/BUILD.bazel b/installer/cmd/tectonic/BUILD.bazel index 7a3944e2a22..46edb574ed0 100644 --- a/installer/cmd/tectonic/BUILD.bazel +++ b/installer/cmd/tectonic/BUILD.bazel @@ -7,7 +7,7 @@ go_library( visibility = ["//visibility:private"], deps = [ "//installer/pkg/workflow:go_default_library", - "//vendor/github.com/Sirupsen/logrus:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", "//vendor/gopkg.in/alecthomas/kingpin.v2:go_default_library", ], ) diff --git a/installer/cmd/tectonic/main.go b/installer/cmd/tectonic/main.go index 85eca882bc3..b880720c0eb 100644 --- a/installer/cmd/tectonic/main.go +++ b/installer/cmd/tectonic/main.go @@ -3,7 +3,7 @@ package main import ( "os" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "gopkg.in/alecthomas/kingpin.v2" "github.com/openshift/installer/installer/pkg/workflow" diff --git a/installer/pkg/workflow/BUILD.bazel b/installer/pkg/workflow/BUILD.bazel index b3f677adaec..d4a2f06ec38 100644 --- a/installer/pkg/workflow/BUILD.bazel +++ b/installer/pkg/workflow/BUILD.bazel @@ -16,7 +16,7 @@ go_library( "//installer/pkg/config-generator:go_default_library", "//pkg/terraform:go_default_library", "//pkg/types/config:go_default_library", - "//vendor/github.com/Sirupsen/logrus:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", "//vendor/gopkg.in/yaml.v2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/installer/pkg/workflow/destroy.go b/installer/pkg/workflow/destroy.go index 99dc46ba811..3c7c6e2354b 100644 --- a/installer/pkg/workflow/destroy.go +++ b/installer/pkg/workflow/destroy.go @@ -6,8 +6,8 @@ import ( "path/filepath" "time" - log "github.com/Sirupsen/logrus" "github.com/openshift/installer/pkg/terraform" + log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" diff --git a/installer/pkg/workflow/workflow.go b/installer/pkg/workflow/workflow.go index 1a1f9d40ecc..f700533b8c8 100644 --- a/installer/pkg/workflow/workflow.go +++ b/installer/pkg/workflow/workflow.go @@ -1,8 +1,8 @@ package workflow import ( - log "github.com/Sirupsen/logrus" "github.com/openshift/installer/pkg/types/config" + log "github.com/sirupsen/logrus" ) // metadata is the state store of the current workflow execution. diff --git a/pkg/types/config/BUILD.bazel b/pkg/types/config/BUILD.bazel index 1ea55a5dcfc..7e02f51a847 100644 --- a/pkg/types/config/BUILD.bazel +++ b/pkg/types/config/BUILD.bazel @@ -16,9 +16,9 @@ go_library( "//pkg/types:go_default_library", "//pkg/types/config/aws:go_default_library", "//pkg/types/config/libvirt:go_default_library", - "//vendor/github.com/Sirupsen/logrus:go_default_library", "//vendor/github.com/coreos/ignition/config/v2_2:go_default_library", "//vendor/github.com/coreos/tectonic-config/config/tectonic-network:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", "//vendor/gopkg.in/yaml.v2:go_default_library", ], ) diff --git a/pkg/types/config/validate.go b/pkg/types/config/validate.go index 4e57b3d43d3..440513d3a1c 100644 --- a/pkg/types/config/validate.go +++ b/pkg/types/config/validate.go @@ -10,9 +10,9 @@ import ( "github.com/openshift/installer/installer/pkg/validate" "github.com/openshift/installer/pkg/types/config/aws" - log "github.com/Sirupsen/logrus" ignconfig "github.com/coreos/ignition/config/v2_2" "github.com/coreos/tectonic-config/config/tectonic-network" + log "github.com/sirupsen/logrus" ) const ( From 78c31183c88c43107ec026b0d00fd884ab17cf74 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Tue, 25 Sep 2018 09:35:30 -0700 Subject: [PATCH 4/5] pkg: add ClusterMetadata asset,type that can be used for destroy --- pkg/asset/BUILD.bazel | 2 +- pkg/asset/cluster/BUILD.bazel | 1 + pkg/asset/cluster/cluster.go | 9 +++-- pkg/asset/metadata/BUILD.bazel | 18 +++++++++ pkg/asset/metadata/doc.go | 2 + pkg/asset/metadata/metadata.go | 74 ++++++++++++++++++++++++++++++++++ pkg/asset/metadata/stock.go | 31 ++++++++++++++ pkg/asset/stock/BUILD.bazel | 1 + pkg/asset/stock/stock.go | 8 +++- pkg/asset/store.go | 2 +- pkg/types/BUILD.bazel | 1 + pkg/types/clustermetadata.go | 26 ++++++++++++ 12 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 pkg/asset/metadata/BUILD.bazel create mode 100644 pkg/asset/metadata/doc.go create mode 100644 pkg/asset/metadata/metadata.go create mode 100644 pkg/asset/metadata/stock.go create mode 100644 pkg/types/clustermetadata.go diff --git a/pkg/asset/BUILD.bazel b/pkg/asset/BUILD.bazel index 4ecfea4281d..6efbeb1c2ed 100644 --- a/pkg/asset/BUILD.bazel +++ b/pkg/asset/BUILD.bazel @@ -13,7 +13,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//vendor/github.com/AlecAivazis/survey:go_default_library", - "//vendor/github.com/Sirupsen/logrus:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", ], ) diff --git a/pkg/asset/cluster/BUILD.bazel b/pkg/asset/cluster/BUILD.bazel index c0fc52d15c5..8fa808439e1 100644 --- a/pkg/asset/cluster/BUILD.bazel +++ b/pkg/asset/cluster/BUILD.bazel @@ -17,5 +17,6 @@ go_library( "//pkg/asset/kubeconfig:go_default_library", "//pkg/terraform:go_default_library", "//pkg/types/config:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", ], ) diff --git a/pkg/asset/cluster/cluster.go b/pkg/asset/cluster/cluster.go index dcf0f96a260..5764374a0e9 100644 --- a/pkg/asset/cluster/cluster.go +++ b/pkg/asset/cluster/cluster.go @@ -7,6 +7,8 @@ import ( "os" "path/filepath" + log "github.com/sirupsen/logrus" + "github.com/openshift/installer/pkg/asset" "github.com/openshift/installer/pkg/terraform" "github.com/openshift/installer/pkg/types/config" @@ -42,7 +44,7 @@ func (c *Cluster) Dependencies() []asset.Asset { func (c *Cluster) Generate(parents map[asset.Asset]*asset.State) (*asset.State, error) { dir, err := terraform.BaseLocation() if err != nil { - return nil, err + return nil, fmt.Errorf("error finding baselocation for terraform: %v", err) } state, ok := parents[c.tfvars] @@ -68,7 +70,7 @@ func (c *Cluster) Generate(parents map[asset.Asset]*asset.State) (*asset.State, templateDir, err := terraform.FindStepTemplates(dir, terraform.InfraStep, tfvars.Platform) if err != nil { - return nil, err + return nil, fmt.Errorf("error finding terraform templates: %v", err) } // This runs the terraform in a temp directory, the tfstate file will be returned @@ -79,7 +81,8 @@ func (c *Cluster) Generate(parents map[asset.Asset]*asset.State) (*asset.State, stateFile, err := terraform.Apply(tmpDir, terraform.InfraStep, templateDir) if err != nil { - return nil, err + // we should try to fetch the terraform state file. + log.Errorf("terraform failed: %v", err) } data, err := ioutil.ReadFile(stateFile) diff --git a/pkg/asset/metadata/BUILD.bazel b/pkg/asset/metadata/BUILD.bazel new file mode 100644 index 00000000000..0e9e4cbc3c8 --- /dev/null +++ b/pkg/asset/metadata/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "metadata.go", + "stock.go", + ], + importpath = "github.com/openshift/installer/pkg/asset/metadata", + visibility = ["//visibility:public"], + deps = [ + "//pkg/asset:go_default_library", + "//pkg/asset/cluster:go_default_library", + "//pkg/asset/installconfig:go_default_library", + "//pkg/types:go_default_library", + ], +) diff --git a/pkg/asset/metadata/doc.go b/pkg/asset/metadata/doc.go new file mode 100644 index 00000000000..7ca2d310e36 --- /dev/null +++ b/pkg/asset/metadata/doc.go @@ -0,0 +1,2 @@ +// Package metadata contains asset targets that generates the metadata.yaml +package metadata diff --git a/pkg/asset/metadata/metadata.go b/pkg/asset/metadata/metadata.go new file mode 100644 index 00000000000..eb1d969cd3d --- /dev/null +++ b/pkg/asset/metadata/metadata.go @@ -0,0 +1,74 @@ +package metadata + +import ( + "encoding/json" + "fmt" + + "github.com/openshift/installer/pkg/asset" + "github.com/openshift/installer/pkg/asset/installconfig" + "github.com/openshift/installer/pkg/types" +) + +const ( + // MetadataFilename is name of the file where clustermetadata is stored. + MetadataFilename = "metadata.json" + metadataAssetName = "Cluster Metadata" +) + +// Metadata depends on cluster and installconfig, +type Metadata struct { + installConfig asset.Asset + cluster asset.Asset +} + +var _ asset.Asset = (*Metadata)(nil) + +// Name returns the human-friendly name of the asset. +func (m *Metadata) Name() string { + return metadataAssetName +} + +// Dependencies returns the dependency of the MetaData. +func (m *Metadata) Dependencies() []asset.Asset { + return []asset.Asset{m.installConfig, m.cluster} +} + +// Generate generates the metadata.yaml file. +func (m *Metadata) Generate(parents map[asset.Asset]*asset.State) (*asset.State, error) { + installCfg, err := installconfig.GetInstallConfig(m.installConfig, parents) + if err != nil { + return nil, err + } + + cm := &types.ClusterMetadata{ + ClusterName: installCfg.Name, + } + switch { + case installCfg.Platform.AWS != nil: + cm.ClusterPlatformMetadata.AWS = &types.ClusterAWSPlatformMetadata{ + Region: installCfg.Platform.AWS.Region, + Identifier: map[string]string{ + "tectonicClusterID": installCfg.ClusterID, + }, + } + case installCfg.Platform.Libvirt != nil: + cm.ClusterPlatformMetadata.Libvirt = &types.ClusterLibvirtPlatformMetadata{ + URI: installCfg.Platform.Libvirt.URI, + } + default: + return nil, fmt.Errorf("no known platform") + } + + data, err := json.Marshal(cm) + if err != nil { + return nil, err + } + return &asset.State{ + Contents: []asset.Content{ + { + Name: MetadataFilename, + Data: []byte(data), + }, + }, + }, nil +} diff --git a/pkg/asset/metadata/stock.go b/pkg/asset/metadata/stock.go new file mode 100644 index 00000000000..e4e142fc902 --- /dev/null +++ b/pkg/asset/metadata/stock.go @@ -0,0 +1,31 @@ +package metadata + +import ( + "github.com/openshift/installer/pkg/asset" + "github.com/openshift/installer/pkg/asset/cluster" + "github.com/openshift/installer/pkg/asset/installconfig" +) + +// Stock is the stock of the cluster assets that can be generated. +type Stock interface { + // Metadata is the asset that generates the metadata.json file + Metadata() asset.Asset +} + +// StockImpl is the implementation of the cluster asset stock. +type StockImpl struct { + metadata asset.Asset +} + +var _ Stock = (*StockImpl)(nil) + +// EstablishStock establishes the stock of assets in the specified directory. +func (s *StockImpl) EstablishStock(installConfigStock installconfig.Stock, clusterStock cluster.Stock) { + s.metadata = &Metadata{ + installConfig: installConfigStock.InstallConfig(), + cluster: clusterStock.Cluster(), + } +} + +// Metadata returns the terraform tfvar asset. +func (s *StockImpl) Metadata() asset.Asset { return s.metadata } diff --git a/pkg/asset/stock/BUILD.bazel b/pkg/asset/stock/BUILD.bazel index 605f83aa8ee..de805fe0bc8 100644 --- a/pkg/asset/stock/BUILD.bazel +++ b/pkg/asset/stock/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "//pkg/asset/installconfig:go_default_library", "//pkg/asset/kubeconfig:go_default_library", "//pkg/asset/manifests:go_default_library", + "//pkg/asset/metadata:go_default_library", "//pkg/asset/tls:go_default_library", ], ) diff --git a/pkg/asset/stock/stock.go b/pkg/asset/stock/stock.go index 7ca887cfd18..7ebda974cdd 100644 --- a/pkg/asset/stock/stock.go +++ b/pkg/asset/stock/stock.go @@ -6,6 +6,7 @@ import ( "github.com/openshift/installer/pkg/asset/installconfig" "github.com/openshift/installer/pkg/asset/kubeconfig" "github.com/openshift/installer/pkg/asset/manifests" + "github.com/openshift/installer/pkg/asset/metadata" "github.com/openshift/installer/pkg/asset/tls" ) @@ -17,6 +18,7 @@ type Stock struct { ignitionStock clusterStock manifestsStock + metadataStock } type installConfigStock struct { @@ -43,6 +45,10 @@ type manifestsStock struct { manifests.StockImpl } +type metadataStock struct { + metadata.StockImpl +} + var _ installconfig.Stock = (*Stock)(nil) // EstablishStock establishes the stock of assets. @@ -55,6 +61,6 @@ func EstablishStock() *Stock { s.ignitionStock.EstablishStock(s, s, s, s) s.clusterStock.EstablishStock(s, s, s) s.manifestsStock.EstablishStock(&s.installConfigStock, s, s) - + s.metadataStock.EstablishStock(s, s) return s } diff --git a/pkg/asset/store.go b/pkg/asset/store.go index 0964b1d084a..81106efc60b 100644 --- a/pkg/asset/store.go +++ b/pkg/asset/store.go @@ -1,7 +1,7 @@ package asset import ( - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // Store is a store for the states of assets. diff --git a/pkg/types/BUILD.bazel b/pkg/types/BUILD.bazel index 05748e49200..4a6b7aaf5bb 100644 --- a/pkg/types/BUILD.bazel +++ b/pkg/types/BUILD.bazel @@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ + "clustermetadata.go", "doc.go", "installconfig.go", "machinepools.go", diff --git a/pkg/types/clustermetadata.go b/pkg/types/clustermetadata.go new file mode 100644 index 00000000000..332bdd66ab4 --- /dev/null +++ b/pkg/types/clustermetadata.go @@ -0,0 +1,26 @@ +package types + +// ClusterMetadata contains information +// regarding the cluster that was created by installer. +type ClusterMetadata struct { + ClusterName string `json:"clusterName"` + ClusterPlatformMetadata `json:",inline"` +} + +// ClusterPlatformMetadata contains metadata for platfrom. +type ClusterPlatformMetadata struct { + AWS *ClusterAWSPlatformMetadata `json:"aws,omitempty"` + Libvirt *ClusterLibvirtPlatformMetadata `json:"libvirt,omitempty"` +} + +// ClusterAWSPlatformMetadata contains AWS metadata. +type ClusterAWSPlatformMetadata struct { + Region string `json:"region"` + // Most AWS resources are tagged with these tags as identifier. + Identifier map[string]string `json:"identifier"` +} + +// ClusterLibvirtPlatformMetadata contains libvirt metadata. +type ClusterLibvirtPlatformMetadata struct { + URI string `json:"uri"` +} From 998ba3069416a0b1d7dc681aaff60d46c7b2b651 Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Tue, 25 Sep 2018 09:36:09 -0700 Subject: [PATCH 5/5] cmd,pkg/destroy: add non-terraform destroy libvirt destroyer impl is working but has been commented out because: `bazel build tarball` cannot build with `github.com/libvirt-go/libvirt` as one of the dependencies, due to some missing cgo dependencies. `go build cmd/openshift-install` works perfectly fine. revisit add libvirt destroyer when bazel is dropped. --- cmd/openshift-install/BUILD.bazel | 3 +- cmd/openshift-install/main.go | 49 +++- pkg/destroy/BUILD.bazel | 14 + pkg/destroy/destroyer.go | 79 ++++++ pkg/destroy/doc.go | 2 + pkg/destroy/libvirt/BUILD.bazel | 13 + .../libvirt/libvirt_prefix_deprovision.go | 241 ++++++++++++++++++ 7 files changed, 386 insertions(+), 15 deletions(-) create mode 100644 pkg/destroy/BUILD.bazel create mode 100644 pkg/destroy/destroyer.go create mode 100644 pkg/destroy/doc.go create mode 100644 pkg/destroy/libvirt/BUILD.bazel create mode 100644 pkg/destroy/libvirt/libvirt_prefix_deprovision.go diff --git a/cmd/openshift-install/BUILD.bazel b/cmd/openshift-install/BUILD.bazel index 4ae24c7cd18..94ddec3025f 100644 --- a/cmd/openshift-install/BUILD.bazel +++ b/cmd/openshift-install/BUILD.bazel @@ -8,7 +8,8 @@ go_library( deps = [ "//pkg/asset:go_default_library", "//pkg/asset/stock:go_default_library", - "//vendor/github.com/Sirupsen/logrus:go_default_library", + "//pkg/destroy:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", "//vendor/gopkg.in/alecthomas/kingpin.v2:go_default_library", ], ) diff --git a/cmd/openshift-install/main.go b/cmd/openshift-install/main.go index 1d9e1b6be44..e964b1b2046 100644 --- a/cmd/openshift-install/main.go +++ b/cmd/openshift-install/main.go @@ -3,11 +3,12 @@ package main import ( "os" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "gopkg.in/alecthomas/kingpin.v2" "github.com/openshift/installer/pkg/asset" "github.com/openshift/installer/pkg/asset/stock" + "github.com/openshift/installer/pkg/destroy" ) var ( @@ -16,12 +17,20 @@ var ( manifestsCommand = kingpin.Command("manifests", "Generate the Kubernetes manifests") clusterCommand = kingpin.Command("cluster", "Create an OpenShift cluster") + destroyCommand = kingpin.Command("destroy-cluster", "Destroy an OpenShift cluster") + dirFlag = kingpin.Flag("dir", "assets directory").Default(".").String() logLevel = kingpin.Flag("log-level", "log level (e.g. \"debug\")").Default("warn").Enum("debug", "info", "warn", "error", "fatal", "panic") ) func main() { command := kingpin.Parse() + l, err := log.ParseLevel(*logLevel) + if err != nil { + // By definition we should never enter this condition since kingpin should be guarding against incorrect values. + log.Fatalf("invalid log-level: %v", err) + } + log.SetLevel(l) assetStock := stock.EstablishStock() @@ -45,27 +54,39 @@ func main() { assetStock.TFVars(), assetStock.KubeconfigAdmin(), assetStock.Cluster(), + assetStock.Metadata(), } } - l, err := log.ParseLevel(*logLevel) - if err != nil { - // By definition we should never enter this condition since kingpin should be guarding against incorrect values. - log.Fatalf("invalid log-level: %v", err) - } - log.SetLevel(l) + switch command { + case installConfigCommand.FullCommand(), + ignitionConfigsCommand.FullCommand(), + manifestsCommand.FullCommand(), + clusterCommand.FullCommand(): + assetStore := &asset.StoreImpl{} + for _, asset := range targetAssets { + st, err := assetStore.Fetch(asset) + if err != nil { + log.Fatalf("failed to generate asset: %v", err) + os.Exit(1) + } - assetStore := &asset.StoreImpl{} - for _, asset := range targetAssets { - st, err := assetStore.Fetch(asset) + if err := st.PersistToFile(*dirFlag); err != nil { + log.Fatalf("failed to write target to disk: %v", err) + os.Exit(1) + } + } + case destroyCommand.FullCommand(): + destroyer, err := destroy.NewDestroyer(l, *dirFlag) if err != nil { - log.Fatalf("failed to generate asset: %v", err) + log.Fatalf("failed to create destroyer: %v", err) os.Exit(1) } - - if err := st.PersistToFile(*dirFlag); err != nil { - log.Fatalf("failed to write target to disk: %v", err) + if err := destroyer.Run(); err != nil { + log.Fatalf("destroy failed: %v", err) os.Exit(1) } + } + } diff --git a/pkg/destroy/BUILD.bazel b/pkg/destroy/BUILD.bazel new file mode 100644 index 00000000000..0a1eb5b3a84 --- /dev/null +++ b/pkg/destroy/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["destroyer.go"], + importpath = "github.com/openshift/installer/pkg/destroy", + visibility = ["//visibility:public"], + deps = [ + "//pkg/asset/metadata:go_default_library", + "//pkg/types:go_default_library", + "//vendor/github.com/openshift/hive/contrib/pkg/aws_tag_deprovision:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", + ], +) diff --git a/pkg/destroy/destroyer.go b/pkg/destroy/destroyer.go new file mode 100644 index 00000000000..fd7f68507ce --- /dev/null +++ b/pkg/destroy/destroyer.go @@ -0,0 +1,79 @@ +package destroy + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + + atd "github.com/openshift/hive/contrib/pkg/aws_tag_deprovision" + log "github.com/sirupsen/logrus" + + "github.com/openshift/installer/pkg/asset/metadata" + "github.com/openshift/installer/pkg/types" +) + +// Destroyer allows multiple implementations of destroy +// for different platforms. +type Destroyer interface { + Run() error +} + +// NewDestroyer returns Destroyer based on `metadata.json` in `rootDir`. +func NewDestroyer(level log.Level, rootDir string) (Destroyer, error) { + raw, err := ioutil.ReadFile(filepath.Join(rootDir, metadata.MetadataFilename)) + if err != nil { + return nil, err + } + + var cmetadata types.ClusterMetadata + if err := json.Unmarshal(raw, &cmetadata); err != nil { + return nil, err + } + + var ret Destroyer + switch { + case cmetadata.ClusterPlatformMetadata.AWS != nil: + ret = NewAWSDestroyer(level, &cmetadata) + case cmetadata.ClusterPlatformMetadata.Libvirt != nil: + // ret = NewLibvirtDestroyer(level, &cmetadata) + return nil, fmt.Errorf("libvirt destroyer is not yet supported") + default: + return nil, fmt.Errorf("couldn't find Destroyer for %q", metadata.MetadataFilename) + } + return ret, nil +} + +// // NewLibvirtDestroyer returns libvirt Uninstaller from ClusterMetadata. +// func NewLibvirtDestroyer(level log.Level, metadata *types.ClusterMetadata) *lpd.ClusterUninstaller { +// return &lpd.ClusterUninstaller{ +// LibvirtURI: metadata.ClusterPlatformMetadata.Libvirt.URI, +// Filter: lpd.AlwaysTrueFilter(), //TODO: change to ClusterNamePrefixFilter when all resources are prefixed. +// Logger: log.NewEntry(&log.Logger{ +// Out: os.Stdout, +// Formatter: &log.TextFormatter{ +// FullTimestamp: true, +// }, +// Hooks: make(log.LevelHooks), +// Level: level, +// }), +// } +// } + +// NewAWSDestroyer returns aws Uninstaller from ClusterMetadata. +func NewAWSDestroyer(level log.Level, metadata *types.ClusterMetadata) *atd.ClusterUninstaller { + return &atd.ClusterUninstaller{ + Filters: metadata.ClusterPlatformMetadata.AWS.Identifier, + Region: metadata.ClusterPlatformMetadata.AWS.Region, + ClusterName: metadata.ClusterName, + Logger: log.NewEntry(&log.Logger{ + Out: os.Stdout, + Formatter: &log.TextFormatter{ + FullTimestamp: true, + }, + Hooks: make(log.LevelHooks), + Level: level, + }), + } +} diff --git a/pkg/destroy/doc.go b/pkg/destroy/doc.go new file mode 100644 index 00000000000..e2da89cdab9 --- /dev/null +++ b/pkg/destroy/doc.go @@ -0,0 +1,2 @@ +// Package destroy contains tools for destroying clusters based on their metadata. +package destroy diff --git a/pkg/destroy/libvirt/BUILD.bazel b/pkg/destroy/libvirt/BUILD.bazel new file mode 100644 index 00000000000..a77a1b74374 --- /dev/null +++ b/pkg/destroy/libvirt/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["libvirt_prefix_deprovision.go"], + importpath = "github.com/openshift/installer/pkg/destroy/libvirt", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/libvirt/libvirt-go:go_default_library", + "//vendor/github.com/sirupsen/logrus:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", + ], +) diff --git a/pkg/destroy/libvirt/libvirt_prefix_deprovision.go b/pkg/destroy/libvirt/libvirt_prefix_deprovision.go new file mode 100644 index 00000000000..5453c553bd6 --- /dev/null +++ b/pkg/destroy/libvirt/libvirt_prefix_deprovision.go @@ -0,0 +1,241 @@ +package libvirt + +import ( + "os" + "strings" + "time" + + libvirt "github.com/libvirt/libvirt-go" + log "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/util/wait" +) + +// filterFunc allows filtering based on names. +// returns true, when the name should be handled. +type filterFunc func(name string) bool + +// ClusterNamePrefixFilter returns true for name +// that are prefixed with clustername. +// `clustername` cannot be empty. +var ClusterNamePrefixFilter = func(clustername string) filterFunc { + if clustername == "" { + panic("clustername cannot be empty") + } + return func(name string) bool { + return strings.HasPrefix(name, clustername) + } +} + +// AlwaysTrueFilter returns true for all +// name except `default`. +var AlwaysTrueFilter = func() filterFunc { + return func(name string) bool { + if name == "default" { + return false + } + return true + } +} + +// deleteFunc type is the interface a function needs to implement to be called as a goroutine. +// The (bool, error) return type mimics wait.ExponentialBackoff where the bool indicates successful +// completion, and the error is for unrecoverable errors. +type deleteFunc func(conn *libvirt.Connect, filter filterFunc, logger log.FieldLogger) (bool, error) + +// ClusterUninstaller holds the various options for the cluster we want to delete. +type ClusterUninstaller struct { + LibvirtURI string + Filter filterFunc + Logger log.FieldLogger +} + +// Run is the entrypoint to start the uninstall process +func (o *ClusterUninstaller) Run() error { + deleteFuncs := map[string]deleteFunc{} + populateDeleteFuncs(deleteFuncs) + returnChannel := make(chan string) + + conn, err := libvirt.NewConnect(o.LibvirtURI) + if err != nil { + return err + } + + // launch goroutines + for name, function := range deleteFuncs { + go deleteRunner(name, function, conn, o.Filter, o.Logger, returnChannel) + } + + // wait for them to finish + for i := 0; i < len(deleteFuncs); i++ { + select { + case res := <-returnChannel: + o.Logger.Debugf("goroutine %v complete", res) + } + } + + return nil +} + +func deleteRunner(deleteFuncName string, dFunction deleteFunc, conn *libvirt.Connect, filter filterFunc, logger log.FieldLogger, channel chan string) { + backoffSettings := wait.Backoff{ + Duration: time.Second * 10, + Factor: 1.3, + Steps: 100, + } + + err := wait.ExponentialBackoff(backoffSettings, func() (bool, error) { + return dFunction(conn, filter, logger) + }) + + if err != nil { + logger.Fatalf("Unrecoverable error/timed out: %v", err) + os.Exit(1) + } + + // record that the goroutine has run to completion + channel <- deleteFuncName + return +} + +// populateDeleteFuncs is the list of functions that will be launched as goroutines +func populateDeleteFuncs(funcs map[string]deleteFunc) { + funcs["deleteDomains"] = deleteDomains + funcs["deleteVolumes"] = deleteVolumes + funcs["deleteNetwork"] = deleteNetwork +} + +func deleteDomains(conn *libvirt.Connect, filter filterFunc, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting libvirt domains") + defer logger.Debugf("Exiting deleting libvirt domains") + + domains, err := conn.ListAllDomains(0) + if err != nil { + logger.Errorf("Error listing domains: %v", err) + return false, nil + } + + for _, domain := range domains { + defer domain.Free() + dName, err := domain.GetName() + if err != nil { + logger.Errorf("Error getting name for domain: %v", err) + return false, nil + } + if !filter(dName) { + continue + } + + if err := domain.Destroy(); err != nil { + logger.Errorf("Error destroying domain %s: %v", dName, err) + return false, nil + } + + if err := domain.Undefine(); err != nil { + logger.Errorf("Error un-defining domain %s: %v", dName, err) + return false, nil + } + logger.WithField("domain", dName).Info("Deleted domain") + } + return true, nil +} + +func deleteVolumes(conn *libvirt.Connect, filter filterFunc, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting libvirt volumes") + defer logger.Debugf("Exiting deleting libvirt volumes") + + pools, err := conn.ListStoragePools() + if err != nil { + logger.Errorf("Error listing storage pools: %v", err) + return false, nil + } + + tpool := "default" + for _, pname := range pools { + // pool name that returns true from filter, override default. + if filter(pname) { + tpool = pname + } + } + pool, err := conn.LookupStoragePoolByName(tpool) + if err != nil { + logger.Errorf("Error getting storage pool %s: %v", tpool, err) + return false, nil + } + defer pool.Free() + + switch tpool { + case "default": + // delete all vols that return true from filter. + vols, err := pool.ListAllStorageVolumes(0) + if err != nil { + logger.Errorf("Error listing storage volumes in %s: %v", tpool, err) + return false, nil + } + + for _, vol := range vols { + defer vol.Free() + vName, err := vol.GetName() + if err != nil { + logger.Errorf("Error getting name for volume: %v", err) + return false, nil + } + if !filter(vName) { + continue + } + if err := vol.Delete(0); err != nil { + logger.Errorf("Error deleting volume %s: %v", vName, err) + return false, nil + } + logger.WithField("volume", vName).Info("Deleted volume") + } + default: + // blow away entire pool. + if err := pool.Destroy(); err != nil { + logger.Errorf("Error destroying pool %s: %v", tpool, err) + return false, nil + } + + if err := pool.Undefine(); err != nil { + logger.Errorf("Error undefining pool %s: %v", tpool, err) + return false, nil + } + logger.WithField("pool", tpool).Info("Deleted pool") + } + + return true, nil +} + +func deleteNetwork(conn *libvirt.Connect, filter filterFunc, logger log.FieldLogger) (bool, error) { + logger.Debug("Deleting libvirt network") + defer logger.Debugf("Exiting deleting libvirt network") + + networks, err := conn.ListNetworks() + if err != nil { + logger.Errorf("Error listing networks: %v", err) + return false, nil + } + + for _, nName := range networks { + if !filter(nName) { + continue + } + network, err := conn.LookupNetworkByName(nName) + if err != nil { + logger.Errorf("Error getting network %s: %v", nName, err) + return false, nil + } + defer network.Free() + + if err := network.Destroy(); err != nil { + logger.Errorf("Error destroying network %s: %v", nName, err) + return false, nil + } + + if err := network.Undefine(); err != nil { + logger.Errorf("Error undefining network %s: %v", nName, err) + return false, nil + } + logger.WithField("network", nName).Info("Deleted network") + } + return true, nil +}