aws-sdk 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE.txt +1 -1
- data/lib/aws-sdk.rb +3 -1
- data/lib/aws.rb +1 -1
- data/lib/aws/api_config/AutoScaling-2011-01-01.yml +31 -2
- data/lib/aws/api_config/CloudFormation-2010-05-15.yml +16 -8
- data/lib/aws/api_config/CloudFront-2012-05-05.yml +1 -1
- data/lib/aws/api_config/CloudSearch-2011-02-01.yml +1 -1
- data/lib/aws/api_config/CloudWatch-2010-08-01.yml +1 -1
- data/lib/aws/api_config/DataPipeline-2012-10-29.yml +1 -1
- data/lib/aws/api_config/DynamoDB-2011-12-05.yml +1 -1
- data/lib/aws/api_config/{EC2-2012-07-20.yml → EC2-2012-12-01.yml} +26 -2
- data/lib/aws/api_config/ELB-2012-06-01.yml +1 -1
- data/lib/aws/api_config/EMR-2009-03-31.yml +1 -1
- data/lib/aws/api_config/ElastiCache-2012-03-09.yml +1 -1
- data/lib/aws/api_config/ElasticBeanstalk-2010-12-01.yml +1 -1
- data/lib/aws/api_config/ElasticTranscoder-2012-09-25.yml +1036 -0
- data/lib/aws/api_config/Glacier-2012-06-01.yml +7 -11
- data/lib/aws/api_config/IAM-2010-05-08.yml +1 -1
- data/lib/aws/api_config/ImportExport-2010-06-01.yml +1 -1
- data/lib/aws/api_config/{RDS-2012-07-31.yml → RDS-2012-09-17.yml} +247 -7
- data/lib/aws/api_config/Route53-2012-02-29.yml +1 -1
- data/lib/aws/api_config/SNS-2010-03-31.yml +1 -1
- data/lib/aws/api_config/SQS-2012-11-05.yml +1 -1
- data/lib/aws/api_config/STS-2011-06-15.yml +1 -1
- data/lib/aws/api_config/SimpleDB-2009-04-15.yml +1 -1
- data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +1 -1
- data/lib/aws/api_config/SimpleWorkflow-2012-01-25.yml +1 -1
- data/lib/aws/api_config/StorageGateway-2012-06-30.yml +1 -1
- data/lib/aws/auto_scaling.rb +1 -1
- data/lib/aws/auto_scaling/activity.rb +1 -1
- data/lib/aws/auto_scaling/activity_collection.rb +1 -1
- data/lib/aws/auto_scaling/client.rb +19 -6
- data/lib/aws/auto_scaling/config.rb +1 -1
- data/lib/aws/auto_scaling/errors.rb +1 -1
- data/lib/aws/auto_scaling/group.rb +2 -2
- data/lib/aws/auto_scaling/group_collection.rb +1 -1
- data/lib/aws/auto_scaling/group_options.rb +1 -1
- data/lib/aws/auto_scaling/instance.rb +1 -1
- data/lib/aws/auto_scaling/instance_collection.rb +1 -1
- data/lib/aws/auto_scaling/launch_configuration.rb +1 -1
- data/lib/aws/auto_scaling/launch_configuration_collection.rb +2 -2
- data/lib/aws/auto_scaling/notification_configuration.rb +1 -1
- data/lib/aws/auto_scaling/notification_configuration_collection.rb +1 -1
- data/lib/aws/auto_scaling/request.rb +1 -1
- data/lib/aws/auto_scaling/scaling_policy.rb +1 -1
- data/lib/aws/auto_scaling/scaling_policy_collection.rb +1 -1
- data/lib/aws/auto_scaling/scaling_policy_options.rb +1 -1
- data/lib/aws/auto_scaling/scheduled_action.rb +1 -1
- data/lib/aws/auto_scaling/scheduled_action_collection.rb +1 -1
- data/lib/aws/auto_scaling/tag.rb +1 -1
- data/lib/aws/auto_scaling/tag_collection.rb +1 -1
- data/lib/aws/cloud_formation.rb +1 -1
- data/lib/aws/cloud_formation/client.rb +154 -52
- data/lib/aws/cloud_formation/config.rb +1 -1
- data/lib/aws/cloud_formation/errors.rb +1 -1
- data/lib/aws/cloud_formation/request.rb +1 -1
- data/lib/aws/cloud_formation/stack.rb +1 -2
- data/lib/aws/cloud_formation/stack_collection.rb +7 -4
- data/lib/aws/cloud_formation/stack_event.rb +1 -1
- data/lib/aws/cloud_formation/stack_event_collection.rb +1 -1
- data/lib/aws/cloud_formation/stack_options.rb +1 -1
- data/lib/aws/cloud_formation/stack_output.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource_collection.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +1 -1
- data/lib/aws/cloud_formation/stack_summary_collection.rb +1 -1
- data/lib/aws/cloud_front.rb +2 -2
- data/lib/aws/cloud_front/client.rb +5 -5
- data/lib/aws/cloud_front/config.rb +1 -1
- data/lib/aws/cloud_front/errors.rb +1 -1
- data/lib/aws/cloud_front/request.rb +1 -1
- data/lib/aws/cloud_search.rb +42 -1
- data/lib/aws/cloud_search/client.rb +5 -5
- data/lib/aws/cloud_search/config.rb +1 -1
- data/lib/aws/cloud_search/errors.rb +1 -1
- data/lib/aws/cloud_search/request.rb +1 -1
- data/lib/aws/cloud_watch.rb +43 -1
- data/lib/aws/cloud_watch/alarm.rb +1 -1
- data/lib/aws/cloud_watch/alarm_collection.rb +1 -1
- data/lib/aws/cloud_watch/alarm_history_item.rb +1 -1
- data/lib/aws/cloud_watch/alarm_history_item_collection.rb +1 -1
- data/lib/aws/cloud_watch/client.rb +5 -5
- data/lib/aws/cloud_watch/config.rb +1 -1
- data/lib/aws/cloud_watch/errors.rb +1 -1
- data/lib/aws/cloud_watch/metric.rb +1 -1
- data/lib/aws/cloud_watch/metric_alarm_collection.rb +1 -1
- data/lib/aws/cloud_watch/metric_collection.rb +1 -1
- data/lib/aws/cloud_watch/metric_statistics.rb +1 -1
- data/lib/aws/cloud_watch/request.rb +1 -1
- data/lib/aws/core.rb +6 -10
- data/lib/aws/core/async_handle.rb +1 -1
- data/lib/aws/core/autoloader.rb +1 -1
- data/lib/aws/core/cacheable.rb +1 -1
- data/lib/aws/core/client.rb +2 -2
- data/lib/aws/core/collection.rb +1 -1
- data/lib/aws/core/collection/simple.rb +1 -1
- data/lib/aws/core/collection/with_limit_and_next_token.rb +1 -1
- data/lib/aws/core/collection/with_next_token.rb +1 -1
- data/lib/aws/core/configuration.rb +5 -2
- data/lib/aws/core/credential_providers.rb +23 -4
- data/lib/aws/core/data.rb +1 -1
- data/lib/aws/core/http/curb_handler.rb +1 -1
- data/lib/aws/core/http/handler.rb +1 -1
- data/lib/aws/core/http/net_http_handler.rb +19 -14
- data/lib/aws/core/http/request.rb +1 -1
- data/lib/aws/core/http/response.rb +7 -4
- data/lib/aws/core/indifferent_hash.rb +1 -1
- data/lib/aws/core/inflection.rb +1 -1
- data/lib/aws/core/json_client.rb +1 -1
- data/lib/aws/core/json_parser.rb +1 -1
- data/lib/aws/core/json_request_builder.rb +1 -1
- data/lib/aws/core/json_response_parser.rb +1 -1
- data/lib/aws/core/lazy_error_classes.rb +1 -1
- data/lib/aws/core/log_formatter.rb +1 -1
- data/lib/aws/core/managed_file.rb +1 -1
- data/lib/aws/core/meta_utils.rb +1 -1
- data/lib/aws/core/model.rb +1 -1
- data/lib/aws/core/naming.rb +1 -1
- data/lib/aws/core/option_grammar.rb +1 -1
- data/lib/aws/core/options/json_serializer.rb +1 -1
- data/lib/aws/core/options/validator.rb +1 -1
- data/lib/aws/core/options/xml_serializer.rb +2 -2
- data/lib/aws/core/page_result.rb +1 -1
- data/lib/aws/core/policy.rb +1 -1
- data/lib/aws/core/query_client.rb +1 -1
- data/lib/aws/core/query_error_parser.rb +1 -1
- data/lib/aws/core/query_request_builder.rb +1 -1
- data/lib/aws/core/query_response_parser.rb +1 -1
- data/lib/aws/core/resource.rb +1 -1
- data/lib/aws/core/resource_cache.rb +1 -1
- data/lib/aws/core/response.rb +1 -1
- data/lib/aws/core/response_cache.rb +1 -1
- data/lib/aws/core/rest_error_parser.rb +1 -1
- data/lib/aws/core/rest_json_client.rb +1 -1
- data/lib/aws/core/rest_request_builder.rb +4 -4
- data/lib/aws/core/rest_response_parser.rb +13 -4
- data/lib/aws/core/rest_xml_client.rb +1 -1
- data/lib/aws/core/service_interface.rb +1 -1
- data/lib/aws/core/signature/version_2.rb +1 -1
- data/lib/aws/core/signature/version_3.rb +1 -1
- data/lib/aws/core/signature/version_3_https.rb +1 -1
- data/lib/aws/core/signature/version_4.rb +1 -1
- data/lib/aws/core/signer.rb +1 -1
- data/lib/aws/core/uri_escape.rb +1 -1
- data/lib/aws/core/xml/frame.rb +1 -1
- data/lib/aws/core/xml/frame_stack.rb +1 -1
- data/lib/aws/core/xml/grammar.rb +1 -1
- data/lib/aws/core/xml/parser.rb +1 -1
- data/lib/aws/core/xml/root_frame.rb +1 -1
- data/lib/aws/core/xml/sax_handlers/libxml.rb +1 -1
- data/lib/aws/core/xml/sax_handlers/nokogiri.rb +1 -1
- data/lib/aws/core/xml/sax_handlers/ox.rb +1 -1
- data/lib/aws/core/xml/sax_handlers/rexml.rb +1 -1
- data/lib/aws/core/xml/stub.rb +1 -1
- data/lib/aws/data_pipeline.rb +42 -1
- data/lib/aws/data_pipeline/client.rb +91 -144
- data/lib/aws/data_pipeline/config.rb +1 -1
- data/lib/aws/data_pipeline/errors.rb +1 -1
- data/lib/aws/data_pipeline/request.rb +1 -1
- data/lib/aws/dynamo_db.rb +1 -1
- data/lib/aws/dynamo_db/attribute_collection.rb +1 -1
- data/lib/aws/dynamo_db/batch_get.rb +1 -1
- data/lib/aws/dynamo_db/batch_write.rb +1 -1
- data/lib/aws/dynamo_db/binary.rb +1 -1
- data/lib/aws/dynamo_db/client.rb +5 -5
- data/lib/aws/dynamo_db/config.rb +1 -1
- data/lib/aws/dynamo_db/errors.rb +1 -1
- data/lib/aws/dynamo_db/expectations.rb +1 -1
- data/lib/aws/dynamo_db/item.rb +1 -1
- data/lib/aws/dynamo_db/item_collection.rb +11 -11
- data/lib/aws/dynamo_db/item_data.rb +1 -1
- data/lib/aws/dynamo_db/keys.rb +1 -1
- data/lib/aws/dynamo_db/primary_key_element.rb +1 -1
- data/lib/aws/dynamo_db/request.rb +1 -1
- data/lib/aws/dynamo_db/resource.rb +1 -1
- data/lib/aws/dynamo_db/table.rb +1 -1
- data/lib/aws/dynamo_db/table_collection.rb +1 -1
- data/lib/aws/dynamo_db/types.rb +1 -1
- data/lib/aws/ec2.rb +1 -1
- data/lib/aws/ec2/attachment.rb +1 -1
- data/lib/aws/ec2/attachment_collection.rb +1 -1
- data/lib/aws/ec2/availability_zone.rb +1 -1
- data/lib/aws/ec2/availability_zone_collection.rb +1 -1
- data/lib/aws/ec2/block_device_mappings.rb +1 -1
- data/lib/aws/ec2/client.rb +26 -5
- data/lib/aws/ec2/collection.rb +1 -1
- data/lib/aws/ec2/config.rb +1 -1
- data/lib/aws/ec2/config_transform.rb +1 -1
- data/lib/aws/ec2/customer_gateway.rb +1 -1
- data/lib/aws/ec2/customer_gateway_collection.rb +1 -1
- data/lib/aws/ec2/dhcp_options.rb +1 -1
- data/lib/aws/ec2/dhcp_options_collection.rb +1 -1
- data/lib/aws/ec2/elastic_ip.rb +1 -1
- data/lib/aws/ec2/elastic_ip_collection.rb +1 -1
- data/lib/aws/ec2/errors.rb +1 -1
- data/lib/aws/ec2/export_task.rb +1 -1
- data/lib/aws/ec2/export_task_collection.rb +1 -1
- data/lib/aws/ec2/filtered_collection.rb +1 -1
- data/lib/aws/ec2/has_permissions.rb +1 -1
- data/lib/aws/ec2/image.rb +1 -1
- data/lib/aws/ec2/image_collection.rb +1 -1
- data/lib/aws/ec2/instance.rb +1 -1
- data/lib/aws/ec2/instance_collection.rb +2 -2
- data/lib/aws/ec2/internet_gateway.rb +1 -1
- data/lib/aws/ec2/internet_gateway/attachment.rb +1 -1
- data/lib/aws/ec2/internet_gateway_collection.rb +1 -1
- data/lib/aws/ec2/key_pair.rb +1 -1
- data/lib/aws/ec2/key_pair_collection.rb +1 -1
- data/lib/aws/ec2/network_acl.rb +1 -1
- data/lib/aws/ec2/network_acl/association.rb +1 -1
- data/lib/aws/ec2/network_acl/entry.rb +1 -1
- data/lib/aws/ec2/network_acl_collection.rb +1 -1
- data/lib/aws/ec2/network_interface.rb +1 -1
- data/lib/aws/ec2/network_interface/attachment.rb +1 -1
- data/lib/aws/ec2/network_interface_collection.rb +1 -1
- data/lib/aws/ec2/permission_collection.rb +1 -1
- data/lib/aws/ec2/region.rb +27 -19
- data/lib/aws/ec2/region_collection.rb +1 -1
- data/lib/aws/ec2/request.rb +1 -1
- data/lib/aws/ec2/reserved_instances.rb +1 -1
- data/lib/aws/ec2/reserved_instances_collection.rb +1 -1
- data/lib/aws/ec2/reserved_instances_offering.rb +1 -1
- data/lib/aws/ec2/reserved_instances_offering_collection.rb +1 -1
- data/lib/aws/ec2/resource.rb +1 -1
- data/lib/aws/ec2/resource_tag_collection.rb +1 -1
- data/lib/aws/ec2/route_table.rb +1 -1
- data/lib/aws/ec2/route_table/association.rb +1 -1
- data/lib/aws/ec2/route_table/route.rb +7 -1
- data/lib/aws/ec2/route_table_collection.rb +1 -1
- data/lib/aws/ec2/security_group.rb +15 -5
- data/lib/aws/ec2/security_group/ip_permission.rb +6 -2
- data/lib/aws/ec2/security_group/ip_permission_collection.rb +1 -1
- data/lib/aws/ec2/security_group_collection.rb +1 -1
- data/lib/aws/ec2/snapshot.rb +1 -1
- data/lib/aws/ec2/snapshot_collection.rb +1 -1
- data/lib/aws/ec2/subnet.rb +1 -1
- data/lib/aws/ec2/subnet_collection.rb +1 -1
- data/lib/aws/ec2/tag.rb +1 -1
- data/lib/aws/ec2/tag_collection.rb +1 -1
- data/lib/aws/ec2/tagged_collection.rb +1 -1
- data/lib/aws/ec2/tagged_item.rb +1 -1
- data/lib/aws/ec2/volume.rb +1 -1
- data/lib/aws/ec2/volume_collection.rb +1 -1
- data/lib/aws/ec2/vpc.rb +1 -1
- data/lib/aws/ec2/vpc_collection.rb +1 -1
- data/lib/aws/ec2/vpn_connection.rb +1 -1
- data/lib/aws/ec2/vpn_connection/telemetry.rb +1 -1
- data/lib/aws/ec2/vpn_connection_collection.rb +1 -1
- data/lib/aws/ec2/vpn_gateway.rb +1 -1
- data/lib/aws/ec2/vpn_gateway/attachment.rb +1 -1
- data/lib/aws/ec2/vpn_gateway_collection.rb +1 -1
- data/lib/aws/elastic_beanstalk.rb +1 -1
- data/lib/aws/elastic_beanstalk/client.rb +5 -5
- data/lib/aws/elastic_beanstalk/config.rb +1 -1
- data/lib/aws/elastic_beanstalk/errors.rb +1 -1
- data/lib/aws/elastic_beanstalk/request.rb +1 -1
- data/lib/aws/elastic_transcoder.rb +30 -0
- data/lib/aws/elastic_transcoder/client.rb +672 -0
- data/lib/aws/elastic_transcoder/config.rb +18 -0
- data/lib/aws/elastic_transcoder/errors.rb +23 -0
- data/lib/aws/elastic_transcoder/request.rb +30 -0
- data/lib/aws/elasticache.rb +1 -1
- data/lib/aws/elasticache/client.rb +5 -6
- data/lib/aws/elasticache/config.rb +1 -1
- data/lib/aws/elasticache/errors.rb +1 -1
- data/lib/aws/elasticache/request.rb +1 -1
- data/lib/aws/elb.rb +1 -1
- data/lib/aws/elb/availability_zone_collection.rb +1 -1
- data/lib/aws/elb/backend_server_policy_collection.rb +1 -1
- data/lib/aws/elb/client.rb +5 -5
- data/lib/aws/elb/config.rb +1 -1
- data/lib/aws/elb/errors.rb +1 -1
- data/lib/aws/elb/instance_collection.rb +1 -1
- data/lib/aws/elb/listener.rb +1 -1
- data/lib/aws/elb/listener_collection.rb +1 -1
- data/lib/aws/elb/listener_opts.rb +1 -1
- data/lib/aws/elb/load_balancer.rb +1 -1
- data/lib/aws/elb/load_balancer_collection.rb +1 -1
- data/lib/aws/elb/load_balancer_policy.rb +1 -1
- data/lib/aws/elb/load_balancer_policy_collection.rb +1 -1
- data/lib/aws/elb/request.rb +8 -2
- data/lib/aws/emr.rb +1 -1
- data/lib/aws/emr/client.rb +5 -5
- data/lib/aws/emr/config.rb +1 -1
- data/lib/aws/emr/errors.rb +1 -1
- data/lib/aws/emr/instance_group.rb +1 -1
- data/lib/aws/emr/instance_group_collection.rb +1 -1
- data/lib/aws/emr/job_flow.rb +1 -1
- data/lib/aws/emr/job_flow_collection.rb +1 -1
- data/lib/aws/emr/request.rb +1 -1
- data/lib/aws/errors.rb +1 -1
- data/lib/aws/glacier.rb +29 -1
- data/lib/aws/glacier/archive.rb +3 -1
- data/lib/aws/glacier/archive_collection.rb +19 -14
- data/lib/aws/glacier/client.rb +5 -5
- data/lib/aws/glacier/config.rb +1 -1
- data/lib/aws/glacier/errors.rb +1 -1
- data/lib/aws/glacier/request.rb +1 -1
- data/lib/aws/glacier/resource.rb +1 -1
- data/lib/aws/glacier/vault.rb +10 -2
- data/lib/aws/glacier/vault_collection.rb +1 -1
- data/lib/aws/glacier/vault_notification_configuration.rb +3 -1
- data/lib/aws/iam.rb +1 -1
- data/lib/aws/iam/access_key.rb +1 -1
- data/lib/aws/iam/access_key_collection.rb +1 -1
- data/lib/aws/iam/account_alias_collection.rb +1 -1
- data/lib/aws/iam/client.rb +5 -5
- data/lib/aws/iam/collection.rb +1 -1
- data/lib/aws/iam/config.rb +1 -1
- data/lib/aws/iam/errors.rb +1 -1
- data/lib/aws/iam/group.rb +1 -1
- data/lib/aws/iam/group_collection.rb +1 -1
- data/lib/aws/iam/group_policy_collection.rb +1 -1
- data/lib/aws/iam/group_user_collection.rb +1 -1
- data/lib/aws/iam/login_profile.rb +1 -1
- data/lib/aws/iam/mfa_device.rb +1 -1
- data/lib/aws/iam/mfa_device_collection.rb +1 -1
- data/lib/aws/iam/policy.rb +1 -1
- data/lib/aws/iam/policy_collection.rb +1 -1
- data/lib/aws/iam/request.rb +1 -1
- data/lib/aws/iam/resource.rb +5 -14
- data/lib/aws/iam/server_certificate.rb +1 -1
- data/lib/aws/iam/server_certificate_collection.rb +1 -1
- data/lib/aws/iam/signing_certificate.rb +1 -1
- data/lib/aws/iam/signing_certificate_collection.rb +1 -1
- data/lib/aws/iam/user.rb +1 -1
- data/lib/aws/iam/user_collection.rb +1 -1
- data/lib/aws/iam/user_group_collection.rb +1 -1
- data/lib/aws/iam/user_policy.rb +1 -1
- data/lib/aws/iam/user_policy_collection.rb +1 -1
- data/lib/aws/iam/virtual_mfa_device.rb +1 -1
- data/lib/aws/iam/virtual_mfa_device_collection.rb +1 -1
- data/lib/aws/import_export.rb +1 -1
- data/lib/aws/import_export/client.rb +5 -5
- data/lib/aws/import_export/config.rb +1 -1
- data/lib/aws/import_export/errors.rb +1 -1
- data/lib/aws/import_export/request.rb +1 -1
- data/lib/aws/rails.rb +1 -1
- data/lib/aws/rds.rb +1 -1
- data/lib/aws/rds/client.rb +193 -7
- data/lib/aws/rds/config.rb +1 -1
- data/lib/aws/rds/db_instance.rb +5 -1
- data/lib/aws/rds/db_instance_collection.rb +1 -1
- data/lib/aws/rds/db_snapshot.rb +1 -1
- data/lib/aws/rds/db_snapshot_collection.rb +1 -1
- data/lib/aws/rds/errors.rb +1 -1
- data/lib/aws/rds/request.rb +1 -1
- data/lib/aws/record.rb +1 -1
- data/lib/aws/record/abstract_base.rb +119 -63
- data/lib/aws/record/attributes.rb +1 -1
- data/lib/aws/record/conversion.rb +1 -1
- data/lib/aws/record/dirty_tracking.rb +1 -1
- data/lib/aws/record/errors.rb +1 -1
- data/lib/aws/record/exceptions.rb +2 -2
- data/lib/aws/record/hash_model.rb +1 -1
- data/lib/aws/record/hash_model/attributes.rb +1 -1
- data/lib/aws/record/hash_model/finder_methods.rb +1 -1
- data/lib/aws/record/hash_model/scope.rb +1 -1
- data/lib/aws/record/model.rb +1 -1
- data/lib/aws/record/model/attributes.rb +1 -1
- data/lib/aws/record/model/finder_methods.rb +1 -1
- data/lib/aws/record/model/scope.rb +1 -1
- data/lib/aws/record/naming.rb +1 -1
- data/lib/aws/record/scope.rb +2 -2
- data/lib/aws/record/validations.rb +21 -3
- data/lib/aws/record/validator.rb +11 -2
- data/lib/aws/record/validators/acceptance.rb +2 -2
- data/lib/aws/record/validators/block.rb +2 -2
- data/lib/aws/record/validators/confirmation.rb +1 -1
- data/lib/aws/record/validators/count.rb +1 -1
- data/lib/aws/record/validators/exclusion.rb +2 -2
- data/lib/aws/record/validators/format.rb +2 -2
- data/lib/aws/record/validators/inclusion.rb +2 -2
- data/lib/aws/record/validators/length.rb +2 -2
- data/lib/aws/record/validators/method.rb +1 -1
- data/lib/aws/record/validators/numericality.rb +2 -2
- data/lib/aws/record/validators/presence.rb +2 -2
- data/lib/aws/route_53.rb +17 -3
- data/lib/aws/route_53/change_batch.rb +159 -0
- data/lib/aws/route_53/change_info.rb +72 -0
- data/lib/aws/route_53/client.rb +5 -5
- data/lib/aws/route_53/config.rb +1 -1
- data/lib/aws/route_53/errors.rb +1 -1
- data/lib/aws/route_53/hosted_zone.rb +111 -0
- data/lib/aws/route_53/hosted_zone_collection.rb +100 -0
- data/lib/aws/route_53/request.rb +1 -1
- data/lib/aws/route_53/resource_record_set.rb +212 -0
- data/lib/aws/route_53/resource_record_set_collection.rb +110 -0
- data/lib/aws/s3.rb +3 -2
- data/lib/aws/s3/access_control_list.rb +1 -1
- data/lib/aws/s3/acl_object.rb +1 -1
- data/lib/aws/s3/acl_options.rb +1 -1
- data/lib/aws/s3/bucket.rb +114 -1
- data/lib/aws/s3/bucket_collection.rb +1 -1
- data/lib/aws/s3/bucket_lifecycle_configuration.rb +1 -1
- data/lib/aws/s3/bucket_tag_collection.rb +1 -1
- data/lib/aws/s3/bucket_version_collection.rb +1 -1
- data/lib/aws/s3/cipher_io.rb +1 -1
- data/lib/aws/s3/client.rb +148 -98
- data/lib/aws/s3/client/xml.rb +10 -1
- data/lib/aws/s3/config.rb +1 -1
- data/lib/aws/s3/cors_rule.rb +1 -1
- data/lib/aws/s3/cors_rule_collection.rb +1 -1
- data/lib/aws/s3/data_options.rb +1 -1
- data/lib/aws/s3/encryption_utils.rb +1 -1
- data/lib/aws/s3/errors.rb +1 -1
- data/lib/aws/s3/multipart_upload.rb +1 -1
- data/lib/aws/s3/multipart_upload_collection.rb +1 -1
- data/lib/aws/s3/object_collection.rb +1 -1
- data/lib/aws/s3/object_metadata.rb +1 -1
- data/lib/aws/s3/object_upload_collection.rb +1 -1
- data/lib/aws/s3/object_version.rb +1 -1
- data/lib/aws/s3/object_version_collection.rb +1 -1
- data/lib/aws/s3/paginated_collection.rb +1 -1
- data/lib/aws/s3/policy.rb +1 -1
- data/lib/aws/s3/prefix_and_delimiter_collection.rb +1 -1
- data/lib/aws/s3/prefixed_collection.rb +1 -1
- data/lib/aws/s3/presigned_post.rb +1 -1
- data/lib/aws/s3/request.rb +4 -2
- data/lib/aws/s3/s3_object.rb +77 -83
- data/lib/aws/s3/tree.rb +1 -1
- data/lib/aws/s3/tree/branch_node.rb +1 -1
- data/lib/aws/s3/tree/child_collection.rb +1 -1
- data/lib/aws/s3/tree/leaf_node.rb +1 -1
- data/lib/aws/s3/tree/node.rb +1 -1
- data/lib/aws/s3/tree/parent.rb +1 -1
- data/lib/aws/s3/uploaded_part.rb +1 -1
- data/lib/aws/s3/uploaded_part_collection.rb +1 -1
- data/lib/aws/s3/website_configuration.rb +60 -0
- data/lib/aws/simple_db.rb +1 -1
- data/lib/aws/simple_db/attribute.rb +1 -1
- data/lib/aws/simple_db/attribute_collection.rb +1 -1
- data/lib/aws/simple_db/client.rb +5 -5
- data/lib/aws/simple_db/config.rb +1 -1
- data/lib/aws/simple_db/consistent_read_option.rb +1 -1
- data/lib/aws/simple_db/delete_attributes.rb +1 -1
- data/lib/aws/simple_db/domain.rb +1 -1
- data/lib/aws/simple_db/domain_collection.rb +1 -1
- data/lib/aws/simple_db/domain_metadata.rb +1 -1
- data/lib/aws/simple_db/errors.rb +1 -1
- data/lib/aws/simple_db/expect_condition_option.rb +1 -1
- data/lib/aws/simple_db/item.rb +1 -1
- data/lib/aws/simple_db/item_collection.rb +1 -1
- data/lib/aws/simple_db/item_data.rb +1 -1
- data/lib/aws/simple_db/put_attributes.rb +1 -1
- data/lib/aws/simple_db/request.rb +1 -1
- data/lib/aws/simple_email_service.rb +1 -1
- data/lib/aws/simple_email_service/client.rb +5 -5
- data/lib/aws/simple_email_service/config.rb +1 -1
- data/lib/aws/simple_email_service/email_address_collection.rb +1 -1
- data/lib/aws/simple_email_service/errors.rb +1 -1
- data/lib/aws/simple_email_service/identity.rb +1 -1
- data/lib/aws/simple_email_service/identity_collection.rb +1 -1
- data/lib/aws/simple_email_service/quotas.rb +1 -1
- data/lib/aws/simple_email_service/request.rb +1 -1
- data/lib/aws/simple_workflow.rb +1 -1
- data/lib/aws/simple_workflow/activity_task.rb +1 -1
- data/lib/aws/simple_workflow/activity_task_collection.rb +1 -1
- data/lib/aws/simple_workflow/activity_type.rb +1 -1
- data/lib/aws/simple_workflow/activity_type_collection.rb +1 -1
- data/lib/aws/simple_workflow/client.rb +5 -5
- data/lib/aws/simple_workflow/config.rb +1 -1
- data/lib/aws/simple_workflow/count.rb +1 -1
- data/lib/aws/simple_workflow/decision_task.rb +4 -2
- data/lib/aws/simple_workflow/decision_task_collection.rb +1 -1
- data/lib/aws/simple_workflow/domain.rb +1 -1
- data/lib/aws/simple_workflow/domain_collection.rb +1 -1
- data/lib/aws/simple_workflow/errors.rb +1 -1
- data/lib/aws/simple_workflow/history_event.rb +1 -1
- data/lib/aws/simple_workflow/history_event_collection.rb +1 -1
- data/lib/aws/simple_workflow/option_formatters.rb +1 -1
- data/lib/aws/simple_workflow/request.rb +1 -1
- data/lib/aws/simple_workflow/resource.rb +1 -1
- data/lib/aws/simple_workflow/type.rb +1 -1
- data/lib/aws/simple_workflow/type_collection.rb +1 -1
- data/lib/aws/simple_workflow/workflow_execution.rb +1 -1
- data/lib/aws/simple_workflow/workflow_execution_collection.rb +1 -1
- data/lib/aws/simple_workflow/workflow_type.rb +1 -1
- data/lib/aws/simple_workflow/workflow_type_collection.rb +1 -1
- data/lib/aws/sns.rb +1 -1
- data/lib/aws/sns/client.rb +5 -5
- data/lib/aws/sns/config.rb +1 -1
- data/lib/aws/sns/errors.rb +1 -1
- data/lib/aws/sns/has_delivery_policy.rb +1 -1
- data/lib/aws/sns/policy.rb +1 -1
- data/lib/aws/sns/request.rb +1 -1
- data/lib/aws/sns/subscription.rb +1 -1
- data/lib/aws/sns/subscription_collection.rb +1 -1
- data/lib/aws/sns/topic.rb +1 -1
- data/lib/aws/sns/topic_collection.rb +1 -1
- data/lib/aws/sns/topic_subscription_collection.rb +1 -1
- data/lib/aws/sqs.rb +1 -1
- data/lib/aws/sqs/client.rb +5 -5
- data/lib/aws/sqs/config.rb +1 -1
- data/lib/aws/sqs/errors.rb +1 -1
- data/lib/aws/sqs/policy.rb +1 -1
- data/lib/aws/sqs/queue.rb +2 -2
- data/lib/aws/sqs/queue_collection.rb +1 -1
- data/lib/aws/sqs/received_message.rb +1 -1
- data/lib/aws/sqs/received_sns_message.rb +6 -2
- data/lib/aws/sqs/request.rb +1 -1
- data/lib/aws/storage_gateway.rb +1 -1
- data/lib/aws/storage_gateway/client.rb +5 -5
- data/lib/aws/storage_gateway/config.rb +1 -1
- data/lib/aws/storage_gateway/errors.rb +1 -1
- data/lib/aws/storage_gateway/request.rb +1 -1
- data/lib/aws/sts.rb +1 -1
- data/lib/aws/sts/client.rb +5 -5
- data/lib/aws/sts/config.rb +1 -1
- data/lib/aws/sts/errors.rb +1 -1
- data/lib/aws/sts/federated_session.rb +1 -1
- data/lib/aws/sts/policy.rb +1 -1
- data/lib/aws/sts/request.rb +1 -1
- data/lib/aws/sts/session.rb +1 -1
- data/lib/aws/version.rb +2 -2
- data/lib/net/http/connection_pool.rb +1 -1
- data/lib/net/http/connection_pool/connection.rb +1 -1
- data/lib/net/http/connection_pool/session.rb +1 -1
- data/rails/init.rb +1 -1
- metadata +18 -6
- data/lib/aws/core/http/httparty_handler.rb +0 -115
data/lib/aws/rds/config.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
data/lib/aws/rds/db_instance.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
|
@@ -45,6 +45,8 @@ module AWS
|
|
|
45
45
|
#
|
|
46
46
|
# @attr_reader [Boolean] multi_az
|
|
47
47
|
#
|
|
48
|
+
# @attr_reader [Integer] iops
|
|
49
|
+
#
|
|
48
50
|
# @attr_reader [String] engine_version
|
|
49
51
|
#
|
|
50
52
|
# @attr_reader [Boolean] auto_minor_version_upgrade
|
|
@@ -116,6 +118,8 @@ module AWS
|
|
|
116
118
|
|
|
117
119
|
attribute :multi_az, :static => true, :alias => :multi_az?
|
|
118
120
|
|
|
121
|
+
attribute :iops, :static => true
|
|
122
|
+
|
|
119
123
|
attribute :preferred_backup_window, :static => true
|
|
120
124
|
|
|
121
125
|
attribute :preferred_maintenance_window, :static => true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
data/lib/aws/rds/db_snapshot.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
data/lib/aws/rds/errors.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
data/lib/aws/rds/request.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
data/lib/aws/record.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2011-
|
|
1
|
+
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
4
4
|
# may not use this file except in compliance with the License. A copy of
|
|
@@ -25,7 +25,7 @@ require 'aws/record/exceptions'
|
|
|
25
25
|
module AWS
|
|
26
26
|
module Record
|
|
27
27
|
module AbstractBase
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
def self.extended base
|
|
30
30
|
|
|
31
31
|
base.send(:extend, ClassMethods)
|
|
@@ -45,50 +45,50 @@ module AWS
|
|
|
45
45
|
# Constructs a new record.
|
|
46
46
|
#
|
|
47
47
|
# @param [Hash] attributes Attributes that should be bulk assigned
|
|
48
|
-
# to this record. You can also specify the shard (i.e. domain
|
|
48
|
+
# to this record. You can also specify the shard (i.e. domain
|
|
49
49
|
# or table) this record should persist to via +:shard+).
|
|
50
50
|
#
|
|
51
51
|
# @option attributes [String] :shard The domain/table this record
|
|
52
52
|
# should persist to. If this is omitted, it will persist to the
|
|
53
53
|
# class default shard (which defaults to the class name).
|
|
54
54
|
#
|
|
55
|
-
# @return [Model,HashModel] Returns a new (non-persisted) record.
|
|
55
|
+
# @return [Model,HashModel] Returns a new (non-persisted) record.
|
|
56
56
|
# Call {#save} to persist changes to AWS.
|
|
57
57
|
#
|
|
58
58
|
def initialize attributes = {}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
attributes = attributes.dup
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
# supporting :domain for backwards compatability, :shard is prefered
|
|
63
63
|
@_shard = attributes.delete(:domain)
|
|
64
64
|
@_shard ||= attributes.delete('domain')
|
|
65
65
|
@_shard ||= attributes.delete(:shard)
|
|
66
66
|
@_shard ||= attributes.delete('shard')
|
|
67
67
|
@_shard = self.class.shard_name(@_shard)
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
@_data = {}
|
|
70
70
|
assign_default_values
|
|
71
71
|
bulk_assign(attributes)
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
end
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
# @return [String] Returns the name of the shard this record
|
|
76
|
-
# is persisted to or will be persisted to. Defaults to the
|
|
76
|
+
# is persisted to or will be persisted to. Defaults to the
|
|
77
77
|
# domain/table named after this record class.
|
|
78
78
|
def shard
|
|
79
79
|
@_shard
|
|
80
80
|
end
|
|
81
81
|
alias_method :domain, :shard # for backwards compatability
|
|
82
|
-
|
|
83
|
-
# The id for each record is auto-generated. The default strategy
|
|
82
|
+
|
|
83
|
+
# The id for each record is auto-generated. The default strategy
|
|
84
84
|
# generates uuid strings.
|
|
85
85
|
# @return [String] Returns the id string (uuid) for this record. Retuns
|
|
86
86
|
# nil if this is a new record that has not been persisted yet.
|
|
87
87
|
def id
|
|
88
88
|
@_id
|
|
89
89
|
end
|
|
90
|
-
|
|
91
|
-
# @return [Hash] A hash with attribute names as hash keys (strings) and
|
|
90
|
+
|
|
91
|
+
# @return [Hash] A hash with attribute names as hash keys (strings) and
|
|
92
92
|
# attribute values (of mixed types) as hash values.
|
|
93
93
|
def attributes
|
|
94
94
|
attributes = Core::IndifferentHash.new
|
|
@@ -97,20 +97,20 @@ module AWS
|
|
|
97
97
|
hash.merge(attr_name => __send__(attr_name))
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
# Acts like {#update} but does not call {#save}.
|
|
102
102
|
#
|
|
103
103
|
# record.attributes = { :name => 'abc', :age => 20 }
|
|
104
104
|
#
|
|
105
105
|
# @param [Hash] attributes A hash of attributes to set on this record
|
|
106
|
-
# without calling save.
|
|
106
|
+
# without calling save.
|
|
107
107
|
#
|
|
108
108
|
# @return [Hash] Returns the attribute hash that was passed in.
|
|
109
109
|
#
|
|
110
110
|
def attributes= attributes
|
|
111
111
|
bulk_assign(attributes)
|
|
112
112
|
end
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
# Persistence indicates if the record has been saved previously or not.
|
|
115
115
|
#
|
|
116
116
|
# @example
|
|
@@ -123,28 +123,32 @@ module AWS
|
|
|
123
123
|
def persisted?
|
|
124
124
|
!!@_persisted
|
|
125
125
|
end
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
# @return [Boolean] Returns true if this record has not been persisted
|
|
128
128
|
# to SimpleDB.
|
|
129
129
|
def new_record?
|
|
130
130
|
!persisted?
|
|
131
131
|
end
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
# @param [Hash] opts Pass :validate => false to skip validations
|
|
133
134
|
# @return [Boolean] Returns true if this record has no validation errors.
|
|
134
|
-
def valid?
|
|
135
|
-
|
|
135
|
+
def valid? opts = {}
|
|
136
|
+
opts = {} if opts.nil?
|
|
137
|
+
opts = {:validate => true}.merge(opts)
|
|
138
|
+
run_validations if opts[:validate]
|
|
136
139
|
errors.empty?
|
|
137
140
|
end
|
|
138
|
-
|
|
141
|
+
|
|
139
142
|
def errors
|
|
140
143
|
@errors ||= Errors.new
|
|
141
144
|
end
|
|
142
|
-
|
|
145
|
+
|
|
143
146
|
# Creates new records, updates existing records.
|
|
147
|
+
# @param [Hash] opts Pass :validate => false to skip validations
|
|
144
148
|
# @return [Boolean] Returns true if the record saved without errors,
|
|
145
149
|
# false otherwise.
|
|
146
|
-
def save
|
|
147
|
-
if valid?
|
|
150
|
+
def save opts = {}
|
|
151
|
+
if valid?(opts)
|
|
148
152
|
persisted? ? update : create
|
|
149
153
|
clear_changes!
|
|
150
154
|
true
|
|
@@ -152,17 +156,17 @@ module AWS
|
|
|
152
156
|
false
|
|
153
157
|
end
|
|
154
158
|
end
|
|
155
|
-
|
|
159
|
+
|
|
156
160
|
# Creates new records, updates exsting records. If there is a validation
|
|
157
161
|
# error then an exception is raised.
|
|
158
|
-
# @raise [InvalidRecordError] Raised when the record has validation
|
|
162
|
+
# @raise [InvalidRecordError] Raised when the record has validation
|
|
159
163
|
# errors and can not be saved.
|
|
160
164
|
# @return [true] Returns true after a successful save.
|
|
161
165
|
def save!
|
|
162
166
|
raise InvalidRecordError.new(self) unless save
|
|
163
167
|
true
|
|
164
168
|
end
|
|
165
|
-
|
|
169
|
+
|
|
166
170
|
# Bulk assigns the attributes and then saves the record.
|
|
167
171
|
# @param [Hash] attribute_hash A hash of attribute names (keys) and
|
|
168
172
|
# attribute values to assign to this record.
|
|
@@ -171,9 +175,9 @@ module AWS
|
|
|
171
175
|
bulk_assign(attribute_hash)
|
|
172
176
|
save
|
|
173
177
|
end
|
|
174
|
-
|
|
178
|
+
|
|
175
179
|
# Bulk assigns the attributes and then saves the record. Raises
|
|
176
|
-
# an exception (AWS::Record::InvalidRecordError) if the record is not
|
|
180
|
+
# an exception (AWS::Record::InvalidRecordError) if the record is not
|
|
177
181
|
# valid.
|
|
178
182
|
# @param (see #update_attributes)
|
|
179
183
|
# @return [true]
|
|
@@ -184,7 +188,7 @@ module AWS
|
|
|
184
188
|
raise InvalidRecordError.new(self)
|
|
185
189
|
end
|
|
186
190
|
end
|
|
187
|
-
|
|
191
|
+
|
|
188
192
|
# Deletes the record.
|
|
189
193
|
# @return [true]
|
|
190
194
|
def delete
|
|
@@ -200,13 +204,13 @@ module AWS
|
|
|
200
204
|
end
|
|
201
205
|
end
|
|
202
206
|
alias_method :destroy, :delete
|
|
203
|
-
|
|
207
|
+
|
|
204
208
|
# @return [Boolean] Returns true if this instance object has been deleted.
|
|
205
209
|
def deleted?
|
|
206
210
|
persisted? ? !!@_deleted : false
|
|
207
211
|
end
|
|
208
|
-
|
|
209
|
-
# If you define a custom setter, you use #[]= to set the value
|
|
212
|
+
|
|
213
|
+
# If you define a custom setter, you use #[]= to set the value
|
|
210
214
|
# on the record.
|
|
211
215
|
#
|
|
212
216
|
# class Book < AWS::Record::Model
|
|
@@ -225,8 +229,8 @@ module AWS
|
|
|
225
229
|
protected
|
|
226
230
|
def []= attribute_name, new_value
|
|
227
231
|
self.class.attribute_for(attribute_name) do |attribute|
|
|
228
|
-
|
|
229
|
-
if_tracking_changes do
|
|
232
|
+
|
|
233
|
+
if_tracking_changes do
|
|
230
234
|
original_value = type_cast(attribute, attribute_was(attribute.name))
|
|
231
235
|
incoming_value = type_cast(attribute, new_value)
|
|
232
236
|
if original_value == incoming_value
|
|
@@ -235,12 +239,12 @@ module AWS
|
|
|
235
239
|
attribute_will_change!(attribute.name)
|
|
236
240
|
end
|
|
237
241
|
end
|
|
238
|
-
|
|
242
|
+
|
|
239
243
|
@_data[attribute.name] = new_value
|
|
240
|
-
|
|
244
|
+
|
|
241
245
|
end
|
|
242
246
|
end
|
|
243
|
-
|
|
247
|
+
|
|
244
248
|
# Returns the typecasted value for the named attribute.
|
|
245
249
|
#
|
|
246
250
|
# book = Book.new(:title => 'My Book')
|
|
@@ -274,7 +278,7 @@ module AWS
|
|
|
274
278
|
type_cast(attribute, @_data[attribute.name])
|
|
275
279
|
end
|
|
276
280
|
end
|
|
277
|
-
|
|
281
|
+
|
|
278
282
|
protected
|
|
279
283
|
def create
|
|
280
284
|
populate_id
|
|
@@ -291,26 +295,26 @@ module AWS
|
|
|
291
295
|
increment_optimistic_lock_value
|
|
292
296
|
update_storage
|
|
293
297
|
end
|
|
294
|
-
|
|
298
|
+
|
|
295
299
|
protected
|
|
296
300
|
def populate_id
|
|
297
301
|
@_id = UUIDTools::UUID.random_create.to_s
|
|
298
302
|
end
|
|
299
|
-
|
|
303
|
+
|
|
300
304
|
protected
|
|
301
305
|
def touch_timestamps *attributes
|
|
302
306
|
now = Time.now
|
|
303
307
|
attributes.each do |attr_name|
|
|
304
|
-
if
|
|
305
|
-
self.class.attributes[attr_name] and
|
|
306
|
-
!attribute_changed?(attr_name)
|
|
308
|
+
if
|
|
309
|
+
self.class.attributes[attr_name] and
|
|
310
|
+
!attribute_changed?(attr_name)
|
|
307
311
|
# don't touch timestamps the user modified
|
|
308
312
|
then
|
|
309
313
|
__send__("#{attr_name}=", now)
|
|
310
314
|
end
|
|
311
315
|
end
|
|
312
316
|
end
|
|
313
|
-
|
|
317
|
+
|
|
314
318
|
protected
|
|
315
319
|
def increment_optimistic_lock_value
|
|
316
320
|
if_locks_optimistically do |lock_attr|
|
|
@@ -321,14 +325,14 @@ module AWS
|
|
|
321
325
|
end
|
|
322
326
|
end
|
|
323
327
|
end
|
|
324
|
-
|
|
328
|
+
|
|
325
329
|
protected
|
|
326
330
|
def if_locks_optimistically &block
|
|
327
331
|
if opt_lock_attr = self.class.optimistic_locking_attr
|
|
328
332
|
yield(opt_lock_attr)
|
|
329
333
|
end
|
|
330
334
|
end
|
|
331
|
-
|
|
335
|
+
|
|
332
336
|
protected
|
|
333
337
|
def opt_lock_conditions
|
|
334
338
|
conditions = {}
|
|
@@ -341,14 +345,14 @@ module AWS
|
|
|
341
345
|
end
|
|
342
346
|
conditions
|
|
343
347
|
end
|
|
344
|
-
|
|
348
|
+
|
|
345
349
|
private
|
|
346
350
|
def assign_default_values
|
|
347
351
|
# populate default attribute values
|
|
348
352
|
ignore_changes do
|
|
349
353
|
self.class.attributes.values.each do |attribute|
|
|
350
354
|
begin
|
|
351
|
-
# copy default values down so methods like #gsub! don't
|
|
355
|
+
# copy default values down so methods like #gsub! don't
|
|
352
356
|
# modify the default values for other objects
|
|
353
357
|
@_data[attribute.name] = attribute.default_value.clone
|
|
354
358
|
rescue TypeError
|
|
@@ -357,7 +361,7 @@ module AWS
|
|
|
357
361
|
end
|
|
358
362
|
end
|
|
359
363
|
end
|
|
360
|
-
|
|
364
|
+
|
|
361
365
|
private
|
|
362
366
|
def bulk_assign hash
|
|
363
367
|
flatten_date_parts(hash).each_pair do |attr_name, attr_value|
|
|
@@ -375,7 +379,7 @@ module AWS
|
|
|
375
379
|
# This method converts these attributes back into a single
|
|
376
380
|
# value and converts them to Date and DateTime objects.
|
|
377
381
|
def flatten_date_parts attributes
|
|
378
|
-
|
|
382
|
+
|
|
379
383
|
multi_attributes = Set.new
|
|
380
384
|
|
|
381
385
|
hash = attributes.inject({}) do |hash,(key,value)|
|
|
@@ -398,7 +402,7 @@ module AWS
|
|
|
398
402
|
|
|
399
403
|
hash[key] = case values.size
|
|
400
404
|
when 0 then nil
|
|
401
|
-
when 2
|
|
405
|
+
when 2
|
|
402
406
|
now = Time.now
|
|
403
407
|
Time.local(now.year, now.month, now.day, values[0], values[1], 0, 0)
|
|
404
408
|
when 3 then Date.new(*values)
|
|
@@ -410,7 +414,7 @@ module AWS
|
|
|
410
414
|
hash
|
|
411
415
|
|
|
412
416
|
end
|
|
413
|
-
|
|
417
|
+
|
|
414
418
|
private
|
|
415
419
|
def type_cast attribute, raw
|
|
416
420
|
if attribute.set?
|
|
@@ -455,7 +459,7 @@ module AWS
|
|
|
455
459
|
# @private
|
|
456
460
|
protected
|
|
457
461
|
def hydrate id, data
|
|
458
|
-
|
|
462
|
+
|
|
459
463
|
# @todo need to do something about partial hyrdation of attributes
|
|
460
464
|
|
|
461
465
|
@_id = id
|
|
@@ -464,7 +468,7 @@ module AWS
|
|
|
464
468
|
# want these values to hang around when hydrating persisted values
|
|
465
469
|
# (those values may have been blanked out before save).
|
|
466
470
|
self.class.attributes.values.each do |attribute|
|
|
467
|
-
@_data[attribute.name] = nil
|
|
471
|
+
@_data[attribute.name] = nil
|
|
468
472
|
end
|
|
469
473
|
|
|
470
474
|
ignore_changes do
|
|
@@ -474,12 +478,12 @@ module AWS
|
|
|
474
478
|
@_persisted = true
|
|
475
479
|
|
|
476
480
|
end
|
|
477
|
-
|
|
481
|
+
|
|
478
482
|
protected
|
|
479
483
|
def create_storage
|
|
480
484
|
raise NotImplementedError
|
|
481
485
|
end
|
|
482
|
-
|
|
486
|
+
|
|
483
487
|
protected
|
|
484
488
|
def update_storage
|
|
485
489
|
raise NotImplementedError
|
|
@@ -496,7 +500,7 @@ module AWS
|
|
|
496
500
|
|
|
497
501
|
# Allows you to override the default shard name for this class.
|
|
498
502
|
# The shard name defaults to the class name.
|
|
499
|
-
# @param [String] name
|
|
503
|
+
# @param [String] name
|
|
500
504
|
def set_shard_name name
|
|
501
505
|
@_shard_name = name
|
|
502
506
|
end
|
|
@@ -524,7 +528,7 @@ module AWS
|
|
|
524
528
|
# Adds a scoped finder to this class.
|
|
525
529
|
#
|
|
526
530
|
# class Book < AWS::Record::Model
|
|
527
|
-
# scope :top_10, order(:popularity, :desc).limit(10)
|
|
531
|
+
# scope :top_10, order(:popularity, :desc).limit(10)
|
|
528
532
|
# end
|
|
529
533
|
#
|
|
530
534
|
# Book.top_10.to_a
|
|
@@ -539,14 +543,14 @@ module AWS
|
|
|
539
543
|
# class Book < AWS::Record::Model
|
|
540
544
|
# scope :by_author, lambda {|name| where(:author => name) }
|
|
541
545
|
# end
|
|
542
|
-
#
|
|
546
|
+
#
|
|
543
547
|
# # top 10 books by the author 'John Doe'
|
|
544
548
|
# Book.by_author('John Doe').top_10
|
|
545
|
-
#
|
|
549
|
+
#
|
|
546
550
|
# @param [Symbol] name The name of the scope. Scope names should be
|
|
547
551
|
# method-safe and should not conflict with any other class methods.
|
|
548
552
|
#
|
|
549
|
-
# @param [Scope] scope
|
|
553
|
+
# @param [Scope] scope
|
|
550
554
|
#
|
|
551
555
|
def scope name, scope = nil, &block
|
|
552
556
|
|
|
@@ -556,6 +560,46 @@ module AWS
|
|
|
556
560
|
|
|
557
561
|
end
|
|
558
562
|
|
|
563
|
+
# Creates an object (or multiple if you pass an array of attributes).
|
|
564
|
+
# The {#save} method is called on the object(s) after construction.
|
|
565
|
+
# The object(s) are returned wether or not the object(s) are valid.
|
|
566
|
+
#
|
|
567
|
+
# class Book < AWS::Record::Model
|
|
568
|
+
# string_attr :title
|
|
569
|
+
# end
|
|
570
|
+
#
|
|
571
|
+
# book = Book.create(:title => "The big book of tests")
|
|
572
|
+
# book.persisted?
|
|
573
|
+
# #=> true
|
|
574
|
+
#
|
|
575
|
+
# books = Book.create([{:title => 'abc'}, {:title => 'xyz'}])
|
|
576
|
+
# books.each(&:persisted?)
|
|
577
|
+
# #=> [true, true]
|
|
578
|
+
#
|
|
579
|
+
def create attributes = {}
|
|
580
|
+
create_impl(attributes, :create, :save)
|
|
581
|
+
end
|
|
582
|
+
|
|
583
|
+
# Creates an object (or multiple if you pass an array of attributes).
|
|
584
|
+
# The {#save!} method is called on the object(s) after construction.
|
|
585
|
+
# If the object(s) are not valid, then an error is raised.
|
|
586
|
+
#
|
|
587
|
+
# class Book < AWS::Record::Model
|
|
588
|
+
# string_attr :title
|
|
589
|
+
# validates_presence_of :title
|
|
590
|
+
# end
|
|
591
|
+
#
|
|
592
|
+
# book = Book.create!(:title => "The big book of tests")
|
|
593
|
+
# book.persisted?
|
|
594
|
+
# #=> true
|
|
595
|
+
#
|
|
596
|
+
# book = Book.create!()
|
|
597
|
+
# #=> raises AWS::Record::InvalidRecordError
|
|
598
|
+
#
|
|
599
|
+
def create! attributes = {}
|
|
600
|
+
create_impl(attributes, :create!, :save!)
|
|
601
|
+
end
|
|
602
|
+
|
|
559
603
|
# @private
|
|
560
604
|
def new_scope
|
|
561
605
|
self::Scope.new(self)
|
|
@@ -639,6 +683,18 @@ module AWS
|
|
|
639
683
|
|
|
640
684
|
end
|
|
641
685
|
|
|
686
|
+
private
|
|
687
|
+
|
|
688
|
+
def create_impl attributes = {}, create_method = :create, save_method = :save
|
|
689
|
+
if attributes.is_a?(Array)
|
|
690
|
+
attributes.map {|attr| send(create_method, attributes) }
|
|
691
|
+
else
|
|
692
|
+
obj = new(attributes)
|
|
693
|
+
obj.send(save_method)
|
|
694
|
+
obj
|
|
695
|
+
end
|
|
696
|
+
end
|
|
697
|
+
|
|
642
698
|
end
|
|
643
699
|
end
|
|
644
700
|
end
|