hexsha
stringlengths 40
40
| size
int64 2
1.01M
| content
stringlengths 2
1.01M
| avg_line_length
float64 1.5
100
| max_line_length
int64 2
1k
| alphanum_fraction
float64 0.25
1
|
---|---|---|---|---|---|
26af36079dcbbe40e3dc159d764bc3d3a64c2ed6
| 2,725 |
# encoding: utf-8
# Copyright 2016-2020 Aerospike, Inc.
#
# Portions may be licensed to Aerospike, Inc. under one or more contributor
# license agreements.
#
# 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.
require 'msgpack'
require 'aerospike/utils/pool'
module Aerospike
private
class Unpacker
@@pool = Pool.new
@@pool.create_proc = Proc.new { Unpacker.new }
def self.use
unpacker = @@pool.poll
unpacker.reset
yield unpacker
ensure
@@pool.offer(unpacker)
end
MsgPackExt = Struct.new(:type, :data)
MsgPackExt::TYPES = [
# Map Create Flags: List Create Flags:
0x00, # UNORDERED UNORDERED
0x01, # K_ORDERED ORDERED
0x03, # KV_ORDERED
0x08, # PRESERVE_ORDER
]
def initialize
@unpacker = MessagePack::Unpacker.new
MsgPackExt::TYPES.each do |type|
@unpacker.register_type(type) { |data| MsgPackExt.new(type, data) }
end
end
def unpack(bytes)
obj = @unpacker.feed(bytes).read
case obj
when Array then unpack_list(obj)
when Hash then unpack_map(obj)
else obj
end
end
def reset
@unpacker.reset
end
private
def unpack_list(array)
list = normalize_strings_in_array(array)
unless list.empty?
list.shift if MsgPackExt === list.first
end
list
end
def unpack_map(hash)
hash = normalize_strings_in_map(hash)
unless hash.empty?
(key, _) = hash.first
hash.shift if MsgPackExt === key
end
hash
end
def normalize_elem(elem)
case elem
when String
ptype = elem.ord
value = elem[1..-1]
if (ptype == ParticleType::STRING)
value.encode!(Aerospike.encoding)
end
value
when Array
unpack_list(elem)
when Hash
unpack_map(elem)
else
elem
end
end
def normalize_strings_in_array(arr)
arr.map! { |elem| normalize_elem(elem) }
end
def normalize_strings_in_map(hash)
hash.inject({}) do |h, (k,v)|
h.update({ normalize_elem(k) => normalize_elem(v) })
end
end
end
end
| 23.491379 | 79 | 0.62422 |
3988e5e21e390cd834b88472b1781c4a51353229
| 145 |
module ApplicationCable
class Connection < ActionCable::Connection::Base
# identified_by :current_user
def connect
end
end
end
| 14.5 | 50 | 0.731034 |
0847d0e8d3305912897637970179004e41a350db
| 1,505 |
# frozen_string_literal: true
class Fisk
module Instructions
# Instruction CVTTPS2PI
forms = []
operands = []
encodings = []
# cvttps2pi: mm, xmm
operands << OPERAND_TYPES[35]
operands << OPERAND_TYPES[24]
encodings << Class.new(Fisk::Encoding) {
def encode buffer, operands
add_rex(buffer, operands,
false,
0,
operands[0].rex_value,
0,
operands[1].rex_value)
add_opcode buffer, 0x0F, 0
add_opcode buffer, 0x2C, 0
add_modrm(buffer,
3,
operands[0].op_value,
operands[1].op_value, operands)
end
def bytesize; 3; end
}.new
forms << Form.new(operands, encodings)
operands = []
encodings = []
# cvttps2pi: mm, m64
operands << OPERAND_TYPES[35]
operands << OPERAND_TYPES[18]
encodings << Class.new(Fisk::Encoding) {
def encode buffer, operands
add_rex(buffer, operands,
false,
0,
operands[0].rex_value,
operands[1].rex_value,
operands[1].rex_value)
add_opcode buffer, 0x0F, 0
add_opcode buffer, 0x2C, 0
add_modrm(buffer,
0,
operands[0].op_value,
operands[1].op_value, operands)
end
def bytesize; 3; end
}.new
forms << Form.new(operands, encodings)
CVTTPS2PI = Instruction.new("CVTTPS2PI", forms)
end
end
| 25.948276 | 51 | 0.546844 |
e9e261345efcc6271c5bd482bd52a063c493a826
| 250 |
def edit
# if current_admin_user.has_access? <%=ids["edit"]%>
unless @<%= instance_name %>.deleted?
@int_page_type = 2
else
no_access_to_edit(<%= items_path %>)
end
# else
# no_access
# end
end
| 20.833333 | 56 | 0.548 |
284603a17ce00925f86afb78bcfd12b3e55dbad5
| 1,093 |
Pod::Spec.new do |s|
s.name = 'libPusher'
s.version = '1.5'
s.license = 'MIT'
s.summary = 'An Objective-C client for the Pusher.com service'
s.homepage = 'https://github.com/lukeredpath/libPusher'
s.author = 'Luke Redpath'
s.source = { :git => 'https://github.com/lukeredpath/libPusher.git', :tag => 'v1.5' }
s.requires_arc = true
s.header_dir = 'Pusher'
s.default_subspec = 'Core'
s.ios.deployment_target = '5.0'
s.osx.deployment_target = '10.8'
s.subspec 'Core' do |subspec|
subspec.dependency 'SocketRocket', "0.3.1-beta2"
subspec.source_files = 'Library/**/*.{h,m}'
subspec.private_header_files = 'Library/Private Headers/*'
subspec.xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => 'kPTPusherClientLibraryVersion=@\"1.5\"'
}
end
s.subspec 'ReactiveExtensions' do |subspec|
subspec.dependency 'ReactiveCocoa', '~> 2.1'
subspec.source_files = 'ReactiveExtensions/*'
subspec.private_header_files = '*_Internal.h'
end
end
| 33.121212 | 96 | 0.612077 |
e27ec2718fc6cb310b3b95aef5de2f93157e476e
| 1,126 |
# frozen_string_literal: true
module Capybara
module Pagemap
# Button build methods for clickable DOM elements
module Button
# :nodoc
module ClassMethods
def define_button(name, xpath)
node_definitions[name] = { type: :button, value: xpath }
end
end
def button_validator_for(node)
!send("#{node}_button").nil?
end
def button_method_missing(method_name, *_, &_block)
return unless /(?<key>.*)_button$/ =~ method_name && self.class.node_definitions[key.to_sym] && self.class.node_definitions[key.to_sym][:type] == :button
build_button(key.to_sym)
send(method_name)
end
def button_respond_to_missing?(method_name, _include_private = false)
/(?<key>.*)_button$/ =~ method_name && self.class.node_definitions[key.to_sym]
end
private
def build_button(key_name)
instance_eval <<-RUBY
def #{key_name}_button
@#{key_name}_button ||= page.find(:xpath, self.class.node_definitions[:#{key_name}][:value])
end
RUBY
end
end
end
end
| 28.15 | 161 | 0.627886 |
abcb05708e4c35cfc8756fafc65da85c467ef6e0
| 2,310 |
# frozen_string_literal: true
module PdrBot
module Op
module Chat
class Sync < Telegram::AppManager::BaseOperation
class Contract < Dry::Validation::Contract
params do
# Chat params
required(:id).filled(:integer)
optional(:type).filled(included_in?: PdrBot::Chat::Types.values)
optional(:title).filled(:string)
optional(:username).filled(:string)
optional(:first_name).filled(:string)
optional(:last_name).filled(:string)
optional(:description).filled(:string)
optional(:invite_link).filled(:string)
end
end
DEFAULT_CHAD_APPROVED_STATE = true
pass :prepare_params
step :validate
step :find_or_create_chat
def prepare_params(_ctx, params:, **)
params[:type] = PdrBot::Chat::Types.value(params[:type])
end
def validate(ctx, params:, **)
ctx[:validation_result] = Contract.new.call(params)
ctx[:params] = ctx[:validation_result].to_h
handle_validation_errors(ctx)
end
def find_or_create_chat(ctx, params:, **)
ctx[:chat] = PdrBot::ChatRepository.new.find(params[:id])
unless ctx[:chat].present?
ctx[:chat] = create_new_chat(chat_params(params))
report_new_chat(ctx[:chat])
end
ctx[:chat]
end
private
def chat_params(params)
{
id: params[:id],
approved: DEFAULT_CHAD_APPROVED_STATE,
type: params[:type],
title: params[:title],
username: params[:username],
first_name: params[:first_name],
last_name: params[:last_name],
description: params[:description],
invite_link: params[:invite_link]
}
end
def create_new_chat(params)
PdrBot::ChatRepository.new.create(params)
end
def report_new_chat(chat)
Telegram::AppManager::Message.new(
I18n.t('.pdr_bot.new_chat_registered', chat_info: chat.to_hash).sample,
bot: Telegram.bots[:admin_bot],
chat_id: ENV['TELEGRAM_APP_OWNER_ID']
).send
end
end
end
end
end
| 28.875 | 83 | 0.571861 |
28dd41f5dabe4f3c326b6f7c14c776ad15dadf75
| 49 |
module GamescriptCreator
VERSION = "0.1.0"
end
| 12.25 | 24 | 0.734694 |
082595d6badda24f35d926b643f7b054a45e1ad0
| 1,320 |
require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "login with valid information followed by logout" do
get login_path
post login_path, params: { session: { email: @user.email,
password: 'password' } }
assert is_logged_in?
assert_redirected_to @user
follow_redirect!
assert_template 'users/show'
assert_select "a[href=?]", login_path, count: 0
assert_select "a[href=?]", logout_path
assert_select "a[href=?]", user_path(@user)
delete logout_path
assert_not is_logged_in?
assert_redirected_to root_url
# 2番目のウィンドウでログアウトをクリックするユーザーをシミュレートする
delete logout_path
follow_redirect!
assert_select "a[href=?]", login_path
assert_select "a[href=?]", logout_path, count: 0
assert_select "a[href=?]", user_path(@user), count: 0
end
test "login with remembering" do
log_in_as(@user, remember_me: '1')
assert_equal cookies['remember_token'], assigns(:user).remember_token
end
test "login without remembering" do
# クッキーを保存してログイン
log_in_as(@user, remember_me: '1')
delete logout_path
# クッキーを削除してログイン
log_in_as(@user, remember_me: '0')
assert_empty cookies['remember_token']
end
end
| 29.333333 | 73 | 0.67803 |
080e849e8fee3576db0c4c843707a2990334de06
| 10,110 |
shared_examples_for "rails_3_reset_password_model" do
# ----------------- PLUGIN CONFIGURATION -----------------------
describe User, "loaded plugin configuration" do
before(:all) do
sorcery_reload!([:reset_password], :reset_password_mailer => ::SorceryMailer)
end
after(:each) do
User.sorcery_config.reset!
end
context "API" do
before(:all) do
create_new_user
end
specify { @user.should respond_to(:deliver_reset_password_instructions!) }
specify { @user.should respond_to(:change_password!) }
it "should respond to .load_from_reset_password_token" do
User.should respond_to(:load_from_reset_password_token)
end
end
it "should allow configuration option 'reset_password_token_attribute_name'" do
sorcery_model_property_set(:reset_password_token_attribute_name, :my_code)
User.sorcery_config.reset_password_token_attribute_name.should equal(:my_code)
end
it "should allow configuration option 'reset_password_mailer'" do
sorcery_model_property_set(:reset_password_mailer, TestUser)
User.sorcery_config.reset_password_mailer.should equal(TestUser)
end
it "should enable configuration option 'reset_password_mailer_disabled'" do
sorcery_model_property_set(:reset_password_mailer_disabled, :my_reset_password_mailer_disabled)
User.sorcery_config.reset_password_mailer_disabled.should equal(:my_reset_password_mailer_disabled)
end
it "if mailer is nil and mailer is enabled, throw exception!" do
expect{sorcery_reload!([:reset_password], :reset_password_mailer_disabled => false)}.to raise_error(ArgumentError)
end
it "if mailer is disabled and mailer is nil, do NOT throw exception" do
expect{sorcery_reload!([:reset_password], :reset_password_mailer_disabled => true)}.to_not raise_error
end
it "should allow configuration option 'reset_password_email_method_name'" do
sorcery_model_property_set(:reset_password_email_method_name, :my_mailer_method)
User.sorcery_config.reset_password_email_method_name.should equal(:my_mailer_method)
end
it "should allow configuration option 'reset_password_expiration_period'" do
sorcery_model_property_set(:reset_password_expiration_period, 16)
User.sorcery_config.reset_password_expiration_period.should equal(16)
end
it "should allow configuration option 'reset_password_email_sent_at_attribute_name'" do
sorcery_model_property_set(:reset_password_email_sent_at_attribute_name, :blabla)
User.sorcery_config.reset_password_email_sent_at_attribute_name.should equal(:blabla)
end
it "should allow configuration option 'reset_password_time_between_emails'" do
sorcery_model_property_set(:reset_password_time_between_emails, 16)
User.sorcery_config.reset_password_time_between_emails.should equal(16)
end
end
# ----------------- PLUGIN ACTIVATED -----------------------
describe User, "when activated with sorcery" do
before(:all) do
sorcery_reload!([:reset_password], :reset_password_mailer => ::SorceryMailer)
end
before(:each) do
User.delete_all
end
after(:each) do
Timecop.return
end
it "load_from_reset_password_token should return user when token is found" do
create_new_user
@user.deliver_reset_password_instructions!
@user = User.find(@user.id) if defined?(DataMapper) && @user.class.ancestors.include?(DataMapper::Resource)
User.load_from_reset_password_token(@user.reset_password_token).should == @user
end
it "load_from_reset_password_token should NOT return user when token is NOT found" do
create_new_user
@user.deliver_reset_password_instructions!
User.load_from_reset_password_token("a").should == nil
end
it "load_from_reset_password_token should return user when token is found and not expired" do
create_new_user
sorcery_model_property_set(:reset_password_expiration_period, 500)
@user.deliver_reset_password_instructions!
@user = User.find(@user.id) if defined?(DataMapper) && @user.class.ancestors.include?(DataMapper::Resource)
User.load_from_reset_password_token(@user.reset_password_token).should == @user
end
it "load_from_reset_password_token should NOT return user when token is found and expired" do
create_new_user
sorcery_model_property_set(:reset_password_expiration_period, 0.1)
@user.deliver_reset_password_instructions!
Timecop.travel(Time.now.in_time_zone+0.5)
User.load_from_reset_password_token(@user.reset_password_token).should == nil
end
it "load_from_reset_password_token should always be valid if expiration period is nil" do
create_new_user
sorcery_model_property_set(:reset_password_expiration_period, nil)
@user.deliver_reset_password_instructions!
@user = User.find(@user.id) if defined?(DataMapper) && @user.class.ancestors.include?(DataMapper::Resource)
User.load_from_reset_password_token(@user.reset_password_token).should == @user
end
it "load_from_reset_password_token should return nil if token is blank" do
User.load_from_reset_password_token(nil).should == nil
User.load_from_reset_password_token("").should == nil
end
it "'deliver_reset_password_instructions!' should generate a reset_password_token" do
create_new_user
@user.reset_password_token.should be_nil
@user.deliver_reset_password_instructions!
@user.reset_password_token.should_not be_nil
end
it "the reset_password_token should be random" do
create_new_user
sorcery_model_property_set(:reset_password_time_between_emails, 0)
@user.deliver_reset_password_instructions!
old_password_code = @user.reset_password_token
@user.deliver_reset_password_instructions!
@user.reset_password_token.should_not == old_password_code
end
context "mailer is enabled" do
it "should send an email on reset" do
create_new_user
old_size = ActionMailer::Base.deliveries.size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size + 1
end
it "should call send_reset_password_email! on reset" do
create_new_user
@user.should_receive(:send_reset_password_email!).once
@user.deliver_reset_password_instructions!
end
it "should not send an email if time between emails has not passed since last email" do
create_new_user
sorcery_model_property_set(:reset_password_time_between_emails, 10000)
old_size = ActionMailer::Base.deliveries.size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size + 1
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size + 1
end
it "should send an email if time between emails has passed since last email" do
create_new_user
sorcery_model_property_set(:reset_password_time_between_emails, 0.5)
old_size = ActionMailer::Base.deliveries.size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size + 1
Timecop.travel(Time.now.in_time_zone+0.5)
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size + 2
end
end
context "mailer is disabled" do
before(:all) do
sorcery_reload!([:reset_password], :reset_password_mailer_disabled => true, :reset_password_mailer => ::SorceryMailer)
end
it "should send an email on reset" do
create_new_user
old_size = ActionMailer::Base.deliveries.size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size
end
it "should not call send_reset_password_email! on reset" do
create_new_user
@user.should_receive(:send_reset_password_email!).never
@user.deliver_reset_password_instructions!
end
it "should not send an email if time between emails has not passed since last email" do
create_new_user
sorcery_model_property_set(:reset_password_time_between_emails, 10000)
old_size = ActionMailer::Base.deliveries.size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size
end
it "should send an email if time between emails has passed since last email" do
create_new_user
sorcery_model_property_set(:reset_password_time_between_emails, 0.5)
old_size = ActionMailer::Base.deliveries.size
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size
Timecop.travel(Time.now.in_time_zone+0.5)
@user.deliver_reset_password_instructions!
ActionMailer::Base.deliveries.size.should == old_size
end
end
it "when change_password! is called, should delete reset_password_token" do
create_new_user
@user.deliver_reset_password_instructions!
@user.reset_password_token.should_not be_nil
@user.change_password!("blabulsdf")
@user.save!
@user.reset_password_token.should be_nil
end
it "should return false if time between emails has not passed since last email" do
create_new_user
sorcery_model_property_set(:reset_password_time_between_emails, 10000)
@user.deliver_reset_password_instructions!
@user.deliver_reset_password_instructions!.should == false
end
it "should encrypt properly on reset" do
create_new_user
@user.deliver_reset_password_instructions!
@user.change_password!("blagu")
Sorcery::CryptoProviders::BCrypt.matches?(@user.crypted_password,"blagu",@user.salt).should be_true
end
end
end
| 41.097561 | 126 | 0.73729 |
bb9d68f7dda65c0013b05a9e3d1f820579eb04c8
| 1,999 |
require './test/app_helper'
require './test/vcr_helper'
class AppRoutesTracksTest < Minitest::Test
include Rack::Test::Methods
def app
Xapi::App
end
def test_all_the_tracks
get '/tracks'
tracks = JSON.parse(last_response.body)['tracks'].map { |track| track['slug'] }
Approvals.verify(tracks, name: 'get_tracks')
end
def test_all_the_todos
get '/tracks'
tracks = JSON.parse(last_response.body)['tracks'].find { |track|
track['slug'] == 'fruit'
}['todo'].sort
Approvals.verify(tracks, name: 'get_fruit_todo')
end
def test_a_track
get '/tracks/fake'
Approvals.verify(last_response.body, format: :json, name: 'get_track_fake')
end
def test_track_does_not_exist
get '/tracks/unknown'
assert_equal last_response.status, 404
Approvals.verify(last_response.body, format: :json, name: 'get_invalid_track')
end
def test_error_on_missing_language
get '/tracks/unknown/language'
assert_equal 404, last_response.status
end
def test_error_on_missing_language_with_readme
get '/tracks/unknown/language/readme'
assert_equal 404, last_response.status
end
def test_error_on_nonexistent_problem
get '/tracks/fake/unknown'
assert_equal 404, last_response.status
end
def test_error_on_nonexistent_problem_with_readme
get '/tracks/fake/unknown/readme'
assert_equal 404, last_response.status
end
def test_get_specific_problem
get '/tracks/fake/three'
options = { format: :json, name: 'get_specific_problem' }
Approvals.verify(last_response.body, options)
end
def test_get_specific_problem_readme
get '/tracks/fake/three/readme'
options = { format: :json, name: 'get_specific_problem_readme' }
Approvals.verify(last_response.body, options)
end
def test_get_specific_problem_tests
get '/tracks/ruby/three/tests'
options = { format: :json, name: 'get_specific_problem_tests' }
Approvals.verify(last_response.body, options)
end
end
| 25.303797 | 83 | 0.726863 |
0305b8ae89bfac1364cfd6b00fddafc545d41f81
| 132 |
class AddCoverImageToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :cover_image, :string
end
end
| 22 | 60 | 0.765152 |
79092b3b64ae19d3684d44a83a3c48bd1d57a3fc
| 4,808 |
require 'spec_helper'
describe 'Subscribe', js: true, type: :feature do
context 'without team_id' do
before do
visit '/upgrade'
end
it 'requires a team' do
expect(find('#messages')).to have_text('Missing or invalid team ID and/or game.')
find('#subscribe', visible: false)
end
end
context 'without game' do
let!(:team) { Fabricate(:team) }
before do
visit "/upgrade?team_id=#{team.team_id}"
end
it 'requires a game' do
expect(find('#messages')).to have_text('Missing or invalid team ID and/or game.')
find('#subscribe', visible: false)
end
end
context 'for a premium team' do
let!(:team) { Fabricate(:team, premium: true) }
before do
visit "/upgrade?team_id=#{team.team_id}&game=#{team.game.name}"
end
it 'displays an error' do
expect(find('#messages')).to have_text("Team #{team.name} already has a premium #{team.game.name} subscription, thank you for your support.")
find('#subscribe', visible: false)
end
end
shared_examples 'upgrades to premium' do
it 'upgrades to premium' do
visit "/upgrade?team_id=#{team.team_id}&game=#{team.game.name}"
expect(find('#messages')).to have_text("Upgrade team #{team.name} to premium #{team.game.name} for $29.99 a year!")
find('#subscribe', visible: true)
expect(Stripe::Customer).to receive(:create).and_return('id' => 'customer_id')
find('#subscribeButton').click
sleep 1
expect_any_instance_of(Team).to receive(:inform!).with(Team::UPGRADED_TEXT, 'thanks')
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
Capybara.within_frame stripe_iframe do
page.execute_script("$('input#email').val('[email protected]');")
page.execute_script("$('input#card_number').val('4242 4242 4242 4242');")
page.execute_script("$('input#cc-exp').val('12/16');")
page.execute_script("$('input#cc-csc').val('123');")
page.execute_script("$('#submitButton').click();")
end
sleep 5
expect(find('#messages')).to have_text("Team #{team.name} successfully upgraded to premium #{team.game.name}. Thank you for your support!")
find('#subscribe', visible: false)
team.reload
expect(team.premium).to be true
expect(team.stripe_customer_id).to eq 'customer_id'
end
end
context 'with a stripe key' do
before do
ENV['STRIPE_API_PUBLISHABLE_KEY'] = 'pk_test_804U1vUeVeTxBl8znwriXskf'
end
after do
ENV.delete 'STRIPE_API_PUBLISHABLE_KEY'
end
context 'a team' do
let!(:team) { Fabricate(:team) }
it_behaves_like 'upgrades to premium'
end
context 'a team with two games' do
let!(:team) { Fabricate(:team) }
let!(:team2) { Fabricate(:team, team_id: team.team_id, game: Fabricate(:game)) }
it_behaves_like 'upgrades to premium'
end
context 'a second team with two games' do
let!(:team2) { Fabricate(:team) }
let!(:team) { Fabricate(:team, team_id: team2.team_id, game: Fabricate(:game)) }
it_behaves_like 'upgrades to premium'
end
context 'with a coupon' do
let!(:team) { Fabricate(:team) }
it 'applies the coupon' do
coupon = double(Stripe::Coupon, id: 'coupon-id', amount_off: 1200)
expect(Stripe::Coupon).to receive(:retrieve).with('coupon-id').and_return(coupon)
visit "/upgrade?team_id=#{team.team_id}&game=#{team.game.name}&coupon=coupon-id"
expect(find('#messages')).to have_text("Upgrade team #{team.name} to premium #{team.game.name} for $17.99 for the first year and $29.99 thereafter with coupon coupon-id!")
find('#subscribe', visible: true)
expect(Stripe::Customer).to receive(:create).with(hash_including(coupon: 'coupon-id')).and_return('id' => 'customer_id')
expect_any_instance_of(Team).to receive(:inform!).with(Team::UPGRADED_TEXT, 'thanks')
find('#subscribeButton').click
sleep 1
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
Capybara.within_frame stripe_iframe do
page.execute_script("$('input#email').val('[email protected]');")
page.execute_script("$('input#card_number').val('4242 4242 4242 4242');")
page.execute_script("$('input#cc-exp').val('12/16');")
page.execute_script("$('input#cc-csc').val('123');")
page.execute_script("$('#submitButton').click();")
end
sleep 5
expect(find('#messages')).to have_text("Team #{team.name} successfully upgraded to premium #{team.game.name}. Thank you for your support!")
find('#subscribe', visible: false)
team.reload
expect(team.premium).to be true
expect(team.stripe_customer_id).to eq 'customer_id'
end
end
end
end
| 39.089431 | 179 | 0.644135 |
5db86ebb0c00b0fca3ca3883e6156129287306cc
| 533 |
#!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'open3'
require 'puppet'
def apt_get(action)
cmd_string = "apt-get #{action}"
cmd_string << ' -y' if action == 'upgrade'
stdout, stderr, status = Open3.capture3(cmd_string)
raise Puppet::Error, stderr if status != 0
{ status: stdout.strip }
end
params = JSON.parse(STDIN.read)
action = params['action']
begin
result = apt_get(action)
puts result.to_json
exit 0
rescue Puppet::Error => e
puts({ status: 'failure', error: e.message }.to_json)
exit 1
end
| 21.32 | 55 | 0.692308 |
bf80af34a0b70945cd6b5d4927aa6b3c42f6dcb6
| 667 |
# frozen_string_literal: true
module Learning
module Books
module Schemas
BookSchema = Dry::Schema.Params do
required(:attributes).hash do
required(:title).filled(Types::StrippedString, max_size?: 100)
optional(:author).value(Types::StrippedString, max_size?: 100)
optional(:url).value(Types::StrippedString)
required(:status).filled.value(included_in?: LEARNING_BOOK_STATUSES.keys.map(&:to_s))
required(:feeling).filled(Types::Feeling)
optional(:notes).value(Types::StrippedString)
optional(:created_at).maybe(Types::Params::DateTime)
end
end
end
end
end
| 33.35 | 95 | 0.664168 |
62ee73b0d6a2930cf3512dd5f7cecea5c612d927
| 1,366 |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
User.create!(name: "Example User", email: "[email protected]",
password: "foobar", password_confirmation: "foobar",
admin: true, activated: true, activated_at: Time.zone.now)
99.times do |n|
name = Faker::Name.name
email = "example-#{n+1}@railstutorial.org"
password = "password"
User.create!(name: name, email: email,
password: password, password_confirmation: password,
activated: true, activated_at: Time.zone.now)
end
# マイクロポスト
users = User.order(:created_at).take(6)
50.times do
content = Faker::Lorem.sentence(5)
users.each { |user| user.microposts.create!(content: content) }
end
# リレーションシップ
users = User.all
user = users.first
following = users[2..50]
followers = users[3..40]
following.each { |followed| user.follow(followed) }
followers.each { |follower| follower.follow(user) }
# ふぁぼ
user1 = User.first
users = User.all[2..8]
micropost = user.microposts.first
users.each { |user| user.like(micropost) }
| 32.52381 | 111 | 0.692533 |
0173d8f12489fffa17260010498a6e93b16ddf41
| 2,369 |
name 'Kibana'
description 'Installs/Configures Kibana'
version '1.0'
maintainer '@WalmartLabs'
license 'Copyright Walmart, All rights reserved.'
grouping 'default',
:access => 'global',
:packages => ['base', 'mgmt.catalog', 'mgmt.manifest', 'catalog', 'manifest', 'bom'],
:namespace => true
attribute 'src_url',
:description => 'Source URL',
:required => 'required',
:default => 'https://download.elastic.co/kibana/kibana/',
:format => {
:help => 'location of the redis source distribution',
:category => '1.Global',
:order => 2
}
attribute 'version',
:description => 'Version',
:required => 'required',
:default => '4.1.2',
:format => {
:important => true,
:help => 'Version of ElasticSearch',
:category => '2.Global',
:order => 1,
:form => { 'field' => 'select', 'options_for_select' => [['4.1.2', '4.1.2'], ['4.2.2', '4.2.2'], ['4.3.2', '4.3.2'], ['4.5.1', '4.5.1'], ['4.5.4', '4.5.4'], ['4.6.1', '4.6.1']] }
}
attribute 'install_path',
:description => 'Installation Directory',
:required => 'required',
:default => '/app/kibana',
:format => {
:important => true,
:help => 'Install directory of ElasticSearch',
:category => '2.Global',
:order => 1
}
attribute 'port',
:description => 'Kibana Port',
:required => 'required',
:default => '5601',
:format => {
:important => true,
:help => 'Kibana service Port',
:category => '2.Global',
:order => 1
}
attribute 'elasticsearch_cluster_url',
:description => 'ElasticSearch Cluster FQDN including PORT - http://eserver:9200',
:required => 'required',
:default => 'http://testcluster.com:9200/',
:format => {
:important => true,
:help => 'Name of the elastic search cluster',
:category => '2.Cluster',
:order => 1
}
recipe 'start', 'Start Kibana'
recipe 'stop', 'Stop Kibana'
recipe 'restart', 'Restart Kibana'
| 33.842857 | 193 | 0.476572 |
216f0d14e07e05b88f8667e98a7e22886c2274bc
| 4,283 |
Then /^the page should contain the text "([^\"]*)"$/ do |text|
@page.text.should include text
end
Then /^the page should contain the html "([^\"]*)"$/ do |html|
@page.html.should include html
end
Then /^the page should have the title "([^\"]*)"$/ do |title|
@page.title.should include title
end
Then /^I should be able to wait for a block to return true$/ do
@page.google_search_id
@page.wait_until(10, "too long to display page") do
@page.text.include? 'Success'
end
end
When /^I handle the alert$/ do
@msg = @page.alert do
@page.alert_button
end
end
When /^I handle the possible alert$/ do
@msg = @page.alert do
@page.alert_button_element.focus
end
end
When /^I handle the alert that reloads the page$/ do
@msg = @page.alert do
@page.alert_button_that_reloads
end
end
Then /^I should be able to get the alert\'s message$/ do
@msg.should == "I am an alert"
end
Then /^I should be able to verify the popup didn\'t have a message$/ do
@msg.should be_nil
end
When /^I handle the confirm$/ do
@msg = @page.confirm(true) do
@page.confirm_button
end
end
When /^I handle the possible confirm$/ do
@msg = @page.confirm(true) do
@page.confirm_button_element.focus
end
end
When /^I handle the confirm that reloads the page$/ do
@msg = @page.confirm(true) do
@page.confirm_button_that_reloads
end
end
Then /^I should be able to get the confirm message$/ do
@msg.should == 'set the value'
end
When /^I handle the prompt$/ do
@msg = @page.prompt("Cheezy") do
@page.prompt_button
end
end
When /^I handle the possible prompt$/ do
@msg = @page.prompt("Cheezy") do
@page.prompt_button_element.focus
end
end
Then /^I should be able to get the message and default value$/ do
@msg[:message].should == "enter your name"
@msg[:default_value].should == 'John Doe'
end
When /^I open a second window$/ do
@page.open_window
end
When /^I open a third window$/ do
@page.open_another_window
end
#class SecondPage
#include PageObject
#end
Then /^I should be able to attach to a page object using title$/ do
@second_page = SecondPage.new(@browser)
@second_page.attach_to_window(:title => "Success")
@second_page.title.should == "Success"
end
Then /^I should be able to attach to a page object using url$/ do
@second_page = SecondPage.new(@browser)
@second_page.attach_to_window(:url => "success.html")
@second_page.current_url.should include 'success.html'
end
Then /^I should be able to reload the page$/ do
@page.reload_page
end
When /^I press the back button$/ do
@page.go_back
end
When /^I press the forward button$/ do
@page.go_forward
end
Then /^the page should have the expected title$/ do
@page.should have_expected_title
end
Then /^the page should have the expected element$/ do
expect(@page).to have_expected_element
end
Then /^the page can assert the (\w*) element is present$/ do |element_name|
expect(@page.send("has_#{element_name}?")).to eq(true)
expect(@page.send("has_no_#{element_name}?")).to eq(false)
expect { @page.send("assert_has_#{element_name}") }.to_not raise_error
expect { @page.send("assert_has_no_#{element_name}") }.to raise_error(Capybara::ExpectationNotMet)
expect(@page).to be_loaded
end
Then /^the page can assert the (\w*) element is NOT present$/ do |element_name|
expect(@page.send("has_#{element_name}?")).to eq(false)
expect(@page.send("has_no_#{element_name}?")).to eq(true)
expect { @page.send("assert_has_#{element_name}") }.to raise_error(Capybara::ExpectationNotMet)
expect { @page.send("assert_has_no_#{element_name}") }.to_not raise_error
end
Then /^the page should not have the expected element$/ do
class FakePage
include CapybaraPageObject::PageObject
expected_element(:blah)
element(:blah, id: "blah")
end
expect{FakePage.new.has_expected_element?}
.to raise_error(Capybara::ExpectationNotMet)
expect{FakePage.new.loaded?}
.to raise_error(Capybara::ExpectationNotMet)
end
Then /^the page should raise an exception when expected eleemnt is not specified$/ do
class FakeExpectedElementPage
include CapybaraPageObject::PageObject
end
expect{FakeExpectedElementPage.new.loaded?}
.to raise_error("Must set expected_element to use the `loaded?` method")
end
| 25.801205 | 100 | 0.713986 |
b9dc84abe3c7a4661d9fd6fd9a771d3c2898878c
| 708 |
require 'fog/openstack/models/collection'
require 'fog/network/openstack/models/network_ip_availability'
module Fog
module Network
class OpenStack
class NetworkIpAvailabilities < Fog::OpenStack::Collection
model Fog::Network::OpenStack::NetworkIpAvailability
def all
load_response(service.list_network_ip_availabilities, 'network_ip_availabilities')
end
def get(network_id)
if network_ip_availability = service.get_network_ip_availability(network_id).body['network_ip_availability']
new(network_ip_availability)
end
rescue Fog::Network::OpenStack::NotFound
nil
end
end
end
end
end
| 28.32 | 118 | 0.701977 |
bbe51c981665e4dcda011b881264fb5ac50fb24f
| 1,513 |
module StylesheetsHelper
# Internet Exploder hacks.
# <% ie6 do %>
# css for ie6 here
# <% end %>
def ie6(&block)
wrap '* html', &block
end
# <% ie7 do %>
# css for ie7 here
# <% end %>
def ie7(&block)
wrap '* + html', &block
end
# <% ie do %>
# css for ie here
# <% end %>
def ie(&block)
ie6(&block) + ie7(&block)
end
# Self-clearing. For example:
#
# <%= self_clear 'div#foo', 'img.bar', 'p ul' %>
#
# You can pass a hash as the final argument with these options:
# :clear => 'left' | 'right' | 'both' (default)
def self_clear(*selectors)
options = selectors.extract_options!
clear = options[:clear] || 'both'
selector_template = lambda { |proc| selectors.map{ |s| proc.call s }.join ', ' }
p = lambda { |selector| "#{selector}:after" }
q = lambda { |selector| "* html #{selector}" }
r = lambda { |selector| "*:first-child+html #{selector}" }
<<-END
#{selector_template.call p} {
content: ".";
display: block;
height: 0;
clear: #{clear};
visibility: hidden;
}
#{selector_template.call q} {
height: 1%;
}
#{selector_template.call r} {
min-height: 1px;
}
END
end
private
# Wraps the block's output with +with+ and braces.
# css_dryer will then de-nest the result when it
# post-processes the result of the ERB evaluation.
def wrap(with, &block)
@output_buffer << "#{with} {"
yield
@output_buffer << '}'
end
end
| 21.309859 | 84 | 0.563781 |
bf3ec552b610804305dd0f3bec7a39b40e36cbf1
| 1,900 |
class Osm2pgsql < Formula
desc "OpenStreetMap data to PostgreSQL converter"
homepage "https://osm2pgsql.org"
url "https://github.com/openstreetmap/osm2pgsql/archive/1.5.1.tar.gz"
sha256 "4df0d332e5d77a9d363f2f06f199da0ac23a0dc7890b3472ea1b5123ac363f6e"
license "GPL-2.0-only"
head "https://github.com/openstreetmap/osm2pgsql.git", branch: "master"
bottle do
sha256 arm64_big_sur: "ece6fdfa41191aa1f7f5c82b6c197e668e5550cfae6d72271bf0253f3a4d166f"
sha256 big_sur: "3b55656f6199e13de0705586978e4fd6bbc24b8a4125d0380f7331ac171f5a2f"
sha256 catalina: "f400b7edec6fcd957360a69c43212868a3a7a0dcd3b8c0a96a9cd1d3b725ec90"
sha256 mojave: "e9b3b5a2cac886bb1afbfb9586cdda65c01a50248727a04c5e93ca2bd7e686f7"
sha256 x86_64_linux: "bb9666b44020e017f3867c7a2d71d739988f0953a12eca0200c65955db994f5c" # linuxbrew-core
end
depends_on "cmake" => :build
depends_on "lua" => :build
depends_on "boost"
depends_on "geos"
depends_on "luajit-openresty"
depends_on "postgresql"
depends_on "proj@7"
def install
# This is essentially a CMake disrespects superenv problem
# rather than an upstream issue to handle.
lua_version = Formula["lua"].version.to_s.match(/\d\.\d/)
inreplace "cmake/FindLua.cmake", /set\(LUA_VERSIONS5( \d\.\d)+\)/,
"set(LUA_VERSIONS5 #{lua_version})"
# Use Proj 6.0.0 compatibility headers
# https://github.com/openstreetmap/osm2pgsql/issues/922
# and https://github.com/osmcode/libosmium/issues/277
ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"
mkdir "build" do
system "cmake", "-DWITH_LUAJIT=ON", "..", *std_cmake_args
system "make", "install"
end
end
test do
assert_match "Connecting to database failed: could not connect to server",
shell_output("#{bin}/osm2pgsql /dev/null 2>&1", 1)
end
end
| 39.583333 | 109 | 0.728947 |
39d79aa539bc968bd0932aef49398d19c1e27407
| 84,220 |
# frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
require 'aws-sdk-core/plugins/logging.rb'
require 'aws-sdk-core/plugins/param_converter.rb'
require 'aws-sdk-core/plugins/param_validator.rb'
require 'aws-sdk-core/plugins/user_agent.rb'
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
require 'aws-sdk-core/plugins/retry_errors.rb'
require 'aws-sdk-core/plugins/global_configuration.rb'
require 'aws-sdk-core/plugins/regional_endpoint.rb'
require 'aws-sdk-core/plugins/endpoint_discovery.rb'
require 'aws-sdk-core/plugins/endpoint_pattern.rb'
require 'aws-sdk-core/plugins/response_paging.rb'
require 'aws-sdk-core/plugins/stub_responses.rb'
require 'aws-sdk-core/plugins/idempotency_token.rb'
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
require 'aws-sdk-core/plugins/transfer_encoding.rb'
require 'aws-sdk-core/plugins/http_checksum.rb'
require 'aws-sdk-core/plugins/signature_v4.rb'
require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
Aws::Plugins::GlobalConfiguration.add_identifier(:cloudwatchevents)
module Aws::CloudWatchEvents
# An API client for CloudWatchEvents. To construct a client, you need to configure a `:region` and `:credentials`.
#
# client = Aws::CloudWatchEvents::Client.new(
# region: region_name,
# credentials: credentials,
# # ...
# )
#
# For details on configuring region and credentials see
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
#
# See {#initialize} for a full list of supported configuration options.
class Client < Seahorse::Client::Base
include Aws::ClientStubs
@identifier = :cloudwatchevents
set_api(ClientApi::API)
add_plugin(Seahorse::Client::Plugins::ContentLength)
add_plugin(Aws::Plugins::CredentialsConfiguration)
add_plugin(Aws::Plugins::Logging)
add_plugin(Aws::Plugins::ParamConverter)
add_plugin(Aws::Plugins::ParamValidator)
add_plugin(Aws::Plugins::UserAgent)
add_plugin(Aws::Plugins::HelpfulSocketErrors)
add_plugin(Aws::Plugins::RetryErrors)
add_plugin(Aws::Plugins::GlobalConfiguration)
add_plugin(Aws::Plugins::RegionalEndpoint)
add_plugin(Aws::Plugins::EndpointDiscovery)
add_plugin(Aws::Plugins::EndpointPattern)
add_plugin(Aws::Plugins::ResponsePaging)
add_plugin(Aws::Plugins::StubResponses)
add_plugin(Aws::Plugins::IdempotencyToken)
add_plugin(Aws::Plugins::JsonvalueConverter)
add_plugin(Aws::Plugins::ClientMetricsPlugin)
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
add_plugin(Aws::Plugins::TransferEncoding)
add_plugin(Aws::Plugins::HttpChecksum)
add_plugin(Aws::Plugins::SignatureV4)
add_plugin(Aws::Plugins::Protocols::JsonRpc)
# @overload initialize(options)
# @param [Hash] options
# @option options [required, Aws::CredentialProvider] :credentials
# Your AWS credentials. This can be an instance of any one of the
# following classes:
#
# * `Aws::Credentials` - Used for configuring static, non-refreshing
# credentials.
#
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
# from an EC2 IMDS on an EC2 instance.
#
# * `Aws::SharedCredentials` - Used for loading credentials from a
# shared file, such as `~/.aws/config`.
#
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
#
# When `:credentials` are not configured directly, the following
# locations will be searched for credentials:
#
# * `Aws.config[:credentials]`
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
# * `~/.aws/credentials`
# * `~/.aws/config`
# * EC2 IMDS instance profile - When used by default, the timeouts are
# very aggressive. Construct and pass an instance of
# `Aws::InstanceProfileCredentails` to enable retries and extended
# timeouts.
#
# @option options [required, String] :region
# The AWS region to connect to. The configured `:region` is
# used to determine the service `:endpoint`. When not passed,
# a default `:region` is searched for in the following locations:
#
# * `Aws.config[:region]`
# * `ENV['AWS_REGION']`
# * `ENV['AMAZON_REGION']`
# * `ENV['AWS_DEFAULT_REGION']`
# * `~/.aws/credentials`
# * `~/.aws/config`
#
# @option options [String] :access_key_id
#
# @option options [Boolean] :active_endpoint_cache (false)
# When set to `true`, a thread polling for endpoints will be running in
# the background every 60 secs (default). Defaults to `false`.
#
# @option options [Boolean] :adaptive_retry_wait_to_fill (true)
# Used only in `adaptive` retry mode. When true, the request will sleep
# until there is sufficent client side capacity to retry the request.
# When false, the request will raise a `RetryCapacityNotAvailableError` and will
# not retry instead of sleeping.
#
# @option options [Boolean] :client_side_monitoring (false)
# When `true`, client-side metrics will be collected for all API requests from
# this client.
#
# @option options [String] :client_side_monitoring_client_id ("")
# Allows you to provide an identifier for this client which will be attached to
# all generated client side metrics. Defaults to an empty string.
#
# @option options [String] :client_side_monitoring_host ("127.0.0.1")
# Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
# side monitoring agent is running on, where client metrics will be published via UDP.
#
# @option options [Integer] :client_side_monitoring_port (31000)
# Required for publishing client metrics. The port that the client side monitoring
# agent is running on, where client metrics will be published via UDP.
#
# @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
# Allows you to provide a custom client-side monitoring publisher class. By default,
# will use the Client Side Monitoring Agent Publisher.
#
# @option options [Boolean] :convert_params (true)
# When `true`, an attempt is made to coerce request parameters into
# the required types.
#
# @option options [Boolean] :correct_clock_skew (true)
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
# a clock skew correction and retry requests with skewed client clocks.
#
# @option options [Boolean] :disable_host_prefix_injection (false)
# Set to true to disable SDK automatically adding host prefix
# to default service endpoint when available.
#
# @option options [String] :endpoint
# The client endpoint is normally constructed from the `:region`
# option. You should only configure an `:endpoint` when connecting
# to test or custom endpoints. This should be a valid HTTP(S) URI.
#
# @option options [Integer] :endpoint_cache_max_entries (1000)
# Used for the maximum size limit of the LRU cache storing endpoints data
# for endpoint discovery enabled operations. Defaults to 1000.
#
# @option options [Integer] :endpoint_cache_max_threads (10)
# Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
#
# @option options [Integer] :endpoint_cache_poll_interval (60)
# When :endpoint_discovery and :active_endpoint_cache is enabled,
# Use this option to config the time interval in seconds for making
# requests fetching endpoints information. Defaults to 60 sec.
#
# @option options [Boolean] :endpoint_discovery (false)
# When set to `true`, endpoint discovery will be enabled for operations when available.
#
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
# The log formatter.
#
# @option options [Symbol] :log_level (:info)
# The log level to send messages to the `:logger` at.
#
# @option options [Logger] :logger
# The Logger instance to send log messages to. If this option
# is not set, logging will be disabled.
#
# @option options [Integer] :max_attempts (3)
# An integer representing the maximum number attempts that will be made for
# a single request, including the initial attempt. For example,
# setting this value to 5 will result in a request being retried up to
# 4 times. Used in `standard` and `adaptive` retry modes.
#
# @option options [String] :profile ("default")
# Used when loading credentials from the shared credentials file
# at HOME/.aws/credentials. When not specified, 'default' is used.
#
# @option options [Proc] :retry_backoff
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
# This option is only used in the `legacy` retry mode.
#
# @option options [Float] :retry_base_delay (0.3)
# The base delay in seconds used by the default backoff function. This option
# is only used in the `legacy` retry mode.
#
# @option options [Symbol] :retry_jitter (:none)
# A delay randomiser function used by the default backoff function.
# Some predefined functions can be referenced by name - :none, :equal, :full,
# otherwise a Proc that takes and returns a number. This option is only used
# in the `legacy` retry mode.
#
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
#
# @option options [Integer] :retry_limit (3)
# The maximum number of times to retry failed requests. Only
# ~ 500 level server errors and certain ~ 400 level client errors
# are retried. Generally, these are throttling errors, data
# checksum errors, networking errors, timeout errors, auth errors,
# endpoint discovery, and errors from expired credentials.
# This option is only used in the `legacy` retry mode.
#
# @option options [Integer] :retry_max_delay (0)
# The maximum number of seconds to delay between retries (0 for no limit)
# used by the default backoff function. This option is only used in the
# `legacy` retry mode.
#
# @option options [String] :retry_mode ("legacy")
# Specifies which retry algorithm to use. Values are:
#
# * `legacy` - The pre-existing retry behavior. This is default value if
# no retry mode is provided.
#
# * `standard` - A standardized set of retry rules across the AWS SDKs.
# This includes support for retry quotas, which limit the number of
# unsuccessful retries a client can make.
#
# * `adaptive` - An experimental retry mode that includes all the
# functionality of `standard` mode along with automatic client side
# throttling. This is a provisional mode that may change behavior
# in the future.
#
#
# @option options [String] :secret_access_key
#
# @option options [String] :session_token
#
# @option options [Boolean] :simple_json (false)
# Disables request parameter conversion, validation, and formatting.
# Also disable response data type conversions. This option is useful
# when you want to ensure the highest level of performance by
# avoiding overhead of walking request parameters and response data
# structures.
#
# When `:simple_json` is enabled, the request parameters hash must
# be formatted exactly as the DynamoDB API expects.
#
# @option options [Boolean] :stub_responses (false)
# Causes the client to return stubbed responses. By default
# fake responses are generated and returned. You can specify
# the response data to return or errors to raise by calling
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
#
# ** Please note ** When response stubbing is enabled, no HTTP
# requests are made, and retries are disabled.
#
# @option options [Boolean] :validate_params (true)
# When `true`, request parameters are validated before
# sending the request.
#
# @option options [URI::HTTP,String] :http_proxy A proxy to send
# requests through. Formatted like 'http://proxy.com:123'.
#
# @option options [Float] :http_open_timeout (15) The number of
# seconds to wait when opening a HTTP session before raising a
# `Timeout::Error`.
#
# @option options [Integer] :http_read_timeout (60) The default
# number of seconds to wait for response data. This value can
# safely be set per-request on the session.
#
# @option options [Float] :http_idle_timeout (5) The number of
# seconds a connection is allowed to sit idle before it is
# considered stale. Stale connections are closed and removed
# from the pool before making a request.
#
# @option options [Float] :http_continue_timeout (1) The number of
# seconds to wait for a 100-continue response before sending the
# request body. This option has no effect unless the request has
# "Expect" header set to "100-continue". Defaults to `nil` which
# disables this behaviour. This value can safely be set per
# request on the session.
#
# @option options [Boolean] :http_wire_trace (false) When `true`,
# HTTP debug output will be sent to the `:logger`.
#
# @option options [Boolean] :ssl_verify_peer (true) When `true`,
# SSL peer certificates are verified when establishing a
# connection.
#
# @option options [String] :ssl_ca_bundle Full path to the SSL
# certificate authority bundle file that should be used when
# verifying peer certificates. If you do not pass
# `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
# will be used if available.
#
# @option options [String] :ssl_ca_directory Full path of the
# directory that contains the unbundled SSL certificate
# authority files for verifying peer certificates. If you do
# not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
# system default will be used if available.
#
def initialize(*args)
super
end
# @!group API Operations
# Activates a partner event source that has been deactivated. Once
# activated, your matching event bus will start receiving events from
# the event source.
#
# @option params [required, String] :name
# The name of the partner event source to activate.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.activate_event_source({
# name: "EventSourceName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ActivateEventSource AWS API Documentation
#
# @overload activate_event_source(params = {})
# @param [Hash] params ({})
def activate_event_source(params = {}, options = {})
req = build_request(:activate_event_source, params)
req.send_request(options)
end
# Creates a new event bus within your account. This can be a custom
# event bus which you can use to receive events from your custom
# applications and services, or it can be a partner event bus which can
# be matched to a partner event source.
#
# @option params [required, String] :name
# The name of the new event bus.
#
# Event bus names cannot contain the / character. You can't use the
# name `default` for a custom event bus, as this name is already used
# for your account's default event bus.
#
# If this is a partner event bus, the name must exactly match the name
# of the partner event source that this event bus is matched to.
#
# @option params [String] :event_source_name
# If you are creating a partner event bus, this specifies the partner
# event source that the new event bus will be matched with.
#
# @option params [Array<Types::Tag>] :tags
# Tags to associate with the event bus.
#
# @return [Types::CreateEventBusResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreateEventBusResponse#event_bus_arn #event_bus_arn} => String
#
# @example Request syntax with placeholder values
#
# resp = client.create_event_bus({
# name: "EventBusName", # required
# event_source_name: "EventSourceName",
# tags: [
# {
# key: "TagKey", # required
# value: "TagValue", # required
# },
# ],
# })
#
# @example Response structure
#
# resp.event_bus_arn #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/CreateEventBus AWS API Documentation
#
# @overload create_event_bus(params = {})
# @param [Hash] params ({})
def create_event_bus(params = {}, options = {})
req = build_request(:create_event_bus, params)
req.send_request(options)
end
# Called by an SaaS partner to create a partner event source. This
# operation is not used by AWS customers.
#
# Each partner event source can be used by one AWS account to create a
# matching partner event bus in that AWS account. A SaaS partner must
# create one partner event source for each AWS account that wants to
# receive those event types.
#
# A partner event source creates events based on resources within the
# SaaS partner's service or application.
#
# An AWS account that creates a partner event bus that matches the
# partner event source can use that event bus to receive events from the
# partner, and then process them using AWS Events rules and targets.
#
# Partner event source names follow this format:
#
# ` partner_name/event_namespace/event_name `
#
# *partner\_name* is determined during partner registration and
# identifies the partner to AWS customers. *event\_namespace* is
# determined by the partner and is a way for the partner to categorize
# their events. *event\_name* is determined by the partner, and should
# uniquely identify an event-generating resource within the partner
# system. The combination of *event\_namespace* and *event\_name* should
# help AWS customers decide whether to create an event bus to receive
# these events.
#
# @option params [required, String] :name
# The name of the partner event source. This name must be unique and
# must be in the format ` partner_name/event_namespace/event_name `. The
# AWS account that wants to use this partner event source must create a
# partner event bus with a name that matches the name of the partner
# event source.
#
# @option params [required, String] :account
# The AWS account ID that is permitted to create a matching partner
# event bus for this partner event source.
#
# @return [Types::CreatePartnerEventSourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreatePartnerEventSourceResponse#event_source_arn #event_source_arn} => String
#
# @example Request syntax with placeholder values
#
# resp = client.create_partner_event_source({
# name: "EventSourceName", # required
# account: "AccountId", # required
# })
#
# @example Response structure
#
# resp.event_source_arn #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/CreatePartnerEventSource AWS API Documentation
#
# @overload create_partner_event_source(params = {})
# @param [Hash] params ({})
def create_partner_event_source(params = {}, options = {})
req = build_request(:create_partner_event_source, params)
req.send_request(options)
end
# You can use this operation to temporarily stop receiving events from
# the specified partner event source. The matching event bus is not
# deleted.
#
# When you deactivate a partner event source, the source goes into
# PENDING state. If it remains in PENDING state for more than two weeks,
# it is deleted.
#
# To activate a deactivated partner event source, use
# ActivateEventSource.
#
# @option params [required, String] :name
# The name of the partner event source to deactivate.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.deactivate_event_source({
# name: "EventSourceName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeactivateEventSource AWS API Documentation
#
# @overload deactivate_event_source(params = {})
# @param [Hash] params ({})
def deactivate_event_source(params = {}, options = {})
req = build_request(:deactivate_event_source, params)
req.send_request(options)
end
# Deletes the specified custom event bus or partner event bus. All rules
# associated with this event bus need to be deleted. You can't delete
# your account's default event bus.
#
# @option params [required, String] :name
# The name of the event bus to delete.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_event_bus({
# name: "EventBusName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteEventBus AWS API Documentation
#
# @overload delete_event_bus(params = {})
# @param [Hash] params ({})
def delete_event_bus(params = {}, options = {})
req = build_request(:delete_event_bus, params)
req.send_request(options)
end
# This operation is used by SaaS partners to delete a partner event
# source. This operation is not used by AWS customers.
#
# When you delete an event source, the status of the corresponding
# partner event bus in the AWS customer account becomes DELETED.
#
# @option params [required, String] :name
# The name of the event source to delete.
#
# @option params [required, String] :account
# The AWS account ID of the AWS customer that the event source was
# created for.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_partner_event_source({
# name: "EventSourceName", # required
# account: "AccountId", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeletePartnerEventSource AWS API Documentation
#
# @overload delete_partner_event_source(params = {})
# @param [Hash] params ({})
def delete_partner_event_source(params = {}, options = {})
req = build_request(:delete_partner_event_source, params)
req.send_request(options)
end
# Deletes the specified rule.
#
# Before you can delete the rule, you must remove all targets, using
# RemoveTargets.
#
# When you delete a rule, incoming events might continue to match to the
# deleted rule. Allow a short period of time for changes to take effect.
#
# Managed rules are rules created and managed by another AWS service on
# your behalf. These rules are created by those other AWS services to
# support functionality in those services. You can delete these rules
# using the `Force` option, but you should do so only if you are sure
# the other service is not still using that rule.
#
# @option params [required, String] :name
# The name of the rule.
#
# @option params [String] :event_bus_name
# The event bus associated with the rule. If you omit this, the default
# event bus is used.
#
# @option params [Boolean] :force
# If this is a managed rule, created by an AWS service on your behalf,
# you must specify `Force` as `True` to delete the rule. This parameter
# is ignored for rules that are not managed rules. You can check whether
# a rule is a managed rule by using `DescribeRule` or `ListRules` and
# checking the `ManagedBy` field of the response.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_rule({
# name: "RuleName", # required
# event_bus_name: "EventBusName",
# force: false,
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule AWS API Documentation
#
# @overload delete_rule(params = {})
# @param [Hash] params ({})
def delete_rule(params = {}, options = {})
req = build_request(:delete_rule, params)
req.send_request(options)
end
# Displays details about an event bus in your account. This can include
# the external AWS accounts that are permitted to write events to your
# default event bus, and the associated policy. For custom event buses
# and partner event buses, it displays the name, ARN, policy, state, and
# creation time.
#
# To enable your account to receive events from other accounts on its
# default event bus, use PutPermission.
#
# For more information about partner event buses, see CreateEventBus.
#
# @option params [String] :name
# The name of the event bus to show details for. If you omit this, the
# default event bus is displayed.
#
# @return [Types::DescribeEventBusResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeEventBusResponse#name #name} => String
# * {Types::DescribeEventBusResponse#arn #arn} => String
# * {Types::DescribeEventBusResponse#policy #policy} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_event_bus({
# name: "EventBusName",
# })
#
# @example Response structure
#
# resp.name #=> String
# resp.arn #=> String
# resp.policy #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBus AWS API Documentation
#
# @overload describe_event_bus(params = {})
# @param [Hash] params ({})
def describe_event_bus(params = {}, options = {})
req = build_request(:describe_event_bus, params)
req.send_request(options)
end
# This operation lists details about a partner event source that is
# shared with your account.
#
# @option params [required, String] :name
# The name of the partner event source to display the details of.
#
# @return [Types::DescribeEventSourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeEventSourceResponse#arn #arn} => String
# * {Types::DescribeEventSourceResponse#created_by #created_by} => String
# * {Types::DescribeEventSourceResponse#creation_time #creation_time} => Time
# * {Types::DescribeEventSourceResponse#expiration_time #expiration_time} => Time
# * {Types::DescribeEventSourceResponse#name #name} => String
# * {Types::DescribeEventSourceResponse#state #state} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_event_source({
# name: "EventSourceName", # required
# })
#
# @example Response structure
#
# resp.arn #=> String
# resp.created_by #=> String
# resp.creation_time #=> Time
# resp.expiration_time #=> Time
# resp.name #=> String
# resp.state #=> String, one of "PENDING", "ACTIVE", "DELETED"
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventSource AWS API Documentation
#
# @overload describe_event_source(params = {})
# @param [Hash] params ({})
def describe_event_source(params = {}, options = {})
req = build_request(:describe_event_source, params)
req.send_request(options)
end
# An SaaS partner can use this operation to list details about a partner
# event source that they have created. AWS customers do not use this
# operation. Instead, AWS customers can use DescribeEventSource to see
# details about a partner event source that is shared with them.
#
# @option params [required, String] :name
# The name of the event source to display.
#
# @return [Types::DescribePartnerEventSourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribePartnerEventSourceResponse#arn #arn} => String
# * {Types::DescribePartnerEventSourceResponse#name #name} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_partner_event_source({
# name: "EventSourceName", # required
# })
#
# @example Response structure
#
# resp.arn #=> String
# resp.name #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribePartnerEventSource AWS API Documentation
#
# @overload describe_partner_event_source(params = {})
# @param [Hash] params ({})
def describe_partner_event_source(params = {}, options = {})
req = build_request(:describe_partner_event_source, params)
req.send_request(options)
end
# Describes the specified rule.
#
# DescribeRule does not list the targets of a rule. To see the targets
# associated with a rule, use ListTargetsByRule.
#
# @option params [required, String] :name
# The name of the rule.
#
# @option params [String] :event_bus_name
# The event bus associated with the rule. If you omit this, the default
# event bus is used.
#
# @return [Types::DescribeRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeRuleResponse#name #name} => String
# * {Types::DescribeRuleResponse#arn #arn} => String
# * {Types::DescribeRuleResponse#event_pattern #event_pattern} => String
# * {Types::DescribeRuleResponse#schedule_expression #schedule_expression} => String
# * {Types::DescribeRuleResponse#state #state} => String
# * {Types::DescribeRuleResponse#description #description} => String
# * {Types::DescribeRuleResponse#role_arn #role_arn} => String
# * {Types::DescribeRuleResponse#managed_by #managed_by} => String
# * {Types::DescribeRuleResponse#event_bus_name #event_bus_name} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_rule({
# name: "RuleName", # required
# event_bus_name: "EventBusName",
# })
#
# @example Response structure
#
# resp.name #=> String
# resp.arn #=> String
# resp.event_pattern #=> String
# resp.schedule_expression #=> String
# resp.state #=> String, one of "ENABLED", "DISABLED"
# resp.description #=> String
# resp.role_arn #=> String
# resp.managed_by #=> String
# resp.event_bus_name #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule AWS API Documentation
#
# @overload describe_rule(params = {})
# @param [Hash] params ({})
def describe_rule(params = {}, options = {})
req = build_request(:describe_rule, params)
req.send_request(options)
end
# Disables the specified rule. A disabled rule won't match any events,
# and won't self-trigger if it has a schedule expression.
#
# When you disable a rule, incoming events might continue to match to
# the disabled rule. Allow a short period of time for changes to take
# effect.
#
# @option params [required, String] :name
# The name of the rule.
#
# @option params [String] :event_bus_name
# The event bus associated with the rule. If you omit this, the default
# event bus is used.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.disable_rule({
# name: "RuleName", # required
# event_bus_name: "EventBusName",
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule AWS API Documentation
#
# @overload disable_rule(params = {})
# @param [Hash] params ({})
def disable_rule(params = {}, options = {})
req = build_request(:disable_rule, params)
req.send_request(options)
end
# Enables the specified rule. If the rule does not exist, the operation
# fails.
#
# When you enable a rule, incoming events might not immediately start
# matching to a newly enabled rule. Allow a short period of time for
# changes to take effect.
#
# @option params [required, String] :name
# The name of the rule.
#
# @option params [String] :event_bus_name
# The event bus associated with the rule. If you omit this, the default
# event bus is used.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.enable_rule({
# name: "RuleName", # required
# event_bus_name: "EventBusName",
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule AWS API Documentation
#
# @overload enable_rule(params = {})
# @param [Hash] params ({})
def enable_rule(params = {}, options = {})
req = build_request(:enable_rule, params)
req.send_request(options)
end
# Lists all the event buses in your account, including the default event
# bus, custom event buses, and partner event buses.
#
# @option params [String] :name_prefix
# Specifying this limits the results to only those event buses with
# names that start with the specified prefix.
#
# @option params [String] :next_token
# The token returned by a previous call to retrieve the next set of
# results.
#
# @option params [Integer] :limit
# Specifying this limits the number of results returned by this
# operation. The operation also returns a NextToken which you can use in
# a subsequent operation to retrieve the next set of results.
#
# @return [Types::ListEventBusesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListEventBusesResponse#event_buses #event_buses} => Array<Types::EventBus>
# * {Types::ListEventBusesResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_event_buses({
# name_prefix: "EventBusName",
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.event_buses #=> Array
# resp.event_buses[0].name #=> String
# resp.event_buses[0].arn #=> String
# resp.event_buses[0].policy #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListEventBuses AWS API Documentation
#
# @overload list_event_buses(params = {})
# @param [Hash] params ({})
def list_event_buses(params = {}, options = {})
req = build_request(:list_event_buses, params)
req.send_request(options)
end
# You can use this to see all the partner event sources that have been
# shared with your AWS account. For more information about partner event
# sources, see CreateEventBus.
#
# @option params [String] :name_prefix
# Specifying this limits the results to only those partner event sources
# with names that start with the specified prefix.
#
# @option params [String] :next_token
# The token returned by a previous call to retrieve the next set of
# results.
#
# @option params [Integer] :limit
# Specifying this limits the number of results returned by this
# operation. The operation also returns a NextToken which you can use in
# a subsequent operation to retrieve the next set of results.
#
# @return [Types::ListEventSourcesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListEventSourcesResponse#event_sources #event_sources} => Array<Types::EventSource>
# * {Types::ListEventSourcesResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_event_sources({
# name_prefix: "EventSourceNamePrefix",
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.event_sources #=> Array
# resp.event_sources[0].arn #=> String
# resp.event_sources[0].created_by #=> String
# resp.event_sources[0].creation_time #=> Time
# resp.event_sources[0].expiration_time #=> Time
# resp.event_sources[0].name #=> String
# resp.event_sources[0].state #=> String, one of "PENDING", "ACTIVE", "DELETED"
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListEventSources AWS API Documentation
#
# @overload list_event_sources(params = {})
# @param [Hash] params ({})
def list_event_sources(params = {}, options = {})
req = build_request(:list_event_sources, params)
req.send_request(options)
end
# An SaaS partner can use this operation to display the AWS account ID
# that a particular partner event source name is associated with. This
# operation is not used by AWS customers.
#
# @option params [required, String] :event_source_name
# The name of the partner event source to display account information
# about.
#
# @option params [String] :next_token
# The token returned by a previous call to this operation. Specifying
# this retrieves the next set of results.
#
# @option params [Integer] :limit
# Specifying this limits the number of results returned by this
# operation. The operation also returns a NextToken which you can use in
# a subsequent operation to retrieve the next set of results.
#
# @return [Types::ListPartnerEventSourceAccountsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListPartnerEventSourceAccountsResponse#partner_event_source_accounts #partner_event_source_accounts} => Array<Types::PartnerEventSourceAccount>
# * {Types::ListPartnerEventSourceAccountsResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_partner_event_source_accounts({
# event_source_name: "EventSourceName", # required
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.partner_event_source_accounts #=> Array
# resp.partner_event_source_accounts[0].account #=> String
# resp.partner_event_source_accounts[0].creation_time #=> Time
# resp.partner_event_source_accounts[0].expiration_time #=> Time
# resp.partner_event_source_accounts[0].state #=> String, one of "PENDING", "ACTIVE", "DELETED"
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListPartnerEventSourceAccounts AWS API Documentation
#
# @overload list_partner_event_source_accounts(params = {})
# @param [Hash] params ({})
def list_partner_event_source_accounts(params = {}, options = {})
req = build_request(:list_partner_event_source_accounts, params)
req.send_request(options)
end
# An SaaS partner can use this operation to list all the partner event
# source names that they have created. This operation is not used by AWS
# customers.
#
# @option params [required, String] :name_prefix
# If you specify this, the results are limited to only those partner
# event sources that start with the string you specify.
#
# @option params [String] :next_token
# The token returned by a previous call to this operation. Specifying
# this retrieves the next set of results.
#
# @option params [Integer] :limit
# pecifying this limits the number of results returned by this
# operation. The operation also returns a NextToken which you can use in
# a subsequent operation to retrieve the next set of results.
#
# @return [Types::ListPartnerEventSourcesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListPartnerEventSourcesResponse#partner_event_sources #partner_event_sources} => Array<Types::PartnerEventSource>
# * {Types::ListPartnerEventSourcesResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_partner_event_sources({
# name_prefix: "PartnerEventSourceNamePrefix", # required
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.partner_event_sources #=> Array
# resp.partner_event_sources[0].arn #=> String
# resp.partner_event_sources[0].name #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListPartnerEventSources AWS API Documentation
#
# @overload list_partner_event_sources(params = {})
# @param [Hash] params ({})
def list_partner_event_sources(params = {}, options = {})
req = build_request(:list_partner_event_sources, params)
req.send_request(options)
end
# Lists the rules for the specified target. You can see which of the
# rules in Amazon EventBridge can invoke a specific target in your
# account.
#
# @option params [required, String] :target_arn
# The Amazon Resource Name (ARN) of the target resource.
#
# @option params [String] :event_bus_name
# Limits the results to show only the rules associated with the
# specified event bus.
#
# @option params [String] :next_token
# The token returned by a previous call to retrieve the next set of
# results.
#
# @option params [Integer] :limit
# The maximum number of results to return.
#
# @return [Types::ListRuleNamesByTargetResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListRuleNamesByTargetResponse#rule_names #rule_names} => Array<String>
# * {Types::ListRuleNamesByTargetResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_rule_names_by_target({
# target_arn: "TargetArn", # required
# event_bus_name: "EventBusName",
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.rule_names #=> Array
# resp.rule_names[0] #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget AWS API Documentation
#
# @overload list_rule_names_by_target(params = {})
# @param [Hash] params ({})
def list_rule_names_by_target(params = {}, options = {})
req = build_request(:list_rule_names_by_target, params)
req.send_request(options)
end
# Lists your Amazon EventBridge rules. You can either list all the rules
# or you can provide a prefix to match to the rule names.
#
# ListRules does not list the targets of a rule. To see the targets
# associated with a rule, use ListTargetsByRule.
#
# @option params [String] :name_prefix
# The prefix matching the rule name.
#
# @option params [String] :event_bus_name
# Limits the results to show only the rules associated with the
# specified event bus.
#
# @option params [String] :next_token
# The token returned by a previous call to retrieve the next set of
# results.
#
# @option params [Integer] :limit
# The maximum number of results to return.
#
# @return [Types::ListRulesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListRulesResponse#rules #rules} => Array<Types::Rule>
# * {Types::ListRulesResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_rules({
# name_prefix: "RuleName",
# event_bus_name: "EventBusName",
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.rules #=> Array
# resp.rules[0].name #=> String
# resp.rules[0].arn #=> String
# resp.rules[0].event_pattern #=> String
# resp.rules[0].state #=> String, one of "ENABLED", "DISABLED"
# resp.rules[0].description #=> String
# resp.rules[0].schedule_expression #=> String
# resp.rules[0].role_arn #=> String
# resp.rules[0].managed_by #=> String
# resp.rules[0].event_bus_name #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules AWS API Documentation
#
# @overload list_rules(params = {})
# @param [Hash] params ({})
def list_rules(params = {}, options = {})
req = build_request(:list_rules, params)
req.send_request(options)
end
# Displays the tags associated with an EventBridge resource. In
# EventBridge, rules and event buses can be tagged.
#
# @option params [required, String] :resource_arn
# The ARN of the EventBridge resource for which you want to view tags.
#
# @return [Types::ListTagsForResourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListTagsForResourceResponse#tags #tags} => Array<Types::Tag>
#
# @example Request syntax with placeholder values
#
# resp = client.list_tags_for_resource({
# resource_arn: "Arn", # required
# })
#
# @example Response structure
#
# resp.tags #=> Array
# resp.tags[0].key #=> String
# resp.tags[0].value #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTagsForResource AWS API Documentation
#
# @overload list_tags_for_resource(params = {})
# @param [Hash] params ({})
def list_tags_for_resource(params = {}, options = {})
req = build_request(:list_tags_for_resource, params)
req.send_request(options)
end
# Lists the targets assigned to the specified rule.
#
# @option params [required, String] :rule
# The name of the rule.
#
# @option params [String] :event_bus_name
# The event bus associated with the rule. If you omit this, the default
# event bus is used.
#
# @option params [String] :next_token
# The token returned by a previous call to retrieve the next set of
# results.
#
# @option params [Integer] :limit
# The maximum number of results to return.
#
# @return [Types::ListTargetsByRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListTargetsByRuleResponse#targets #targets} => Array<Types::Target>
# * {Types::ListTargetsByRuleResponse#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_targets_by_rule({
# rule: "RuleName", # required
# event_bus_name: "EventBusName",
# next_token: "NextToken",
# limit: 1,
# })
#
# @example Response structure
#
# resp.targets #=> Array
# resp.targets[0].id #=> String
# resp.targets[0].arn #=> String
# resp.targets[0].role_arn #=> String
# resp.targets[0].input #=> String
# resp.targets[0].input_path #=> String
# resp.targets[0].input_transformer.input_paths_map #=> Hash
# resp.targets[0].input_transformer.input_paths_map["InputTransformerPathKey"] #=> String
# resp.targets[0].input_transformer.input_template #=> String
# resp.targets[0].kinesis_parameters.partition_key_path #=> String
# resp.targets[0].run_command_parameters.run_command_targets #=> Array
# resp.targets[0].run_command_parameters.run_command_targets[0].key #=> String
# resp.targets[0].run_command_parameters.run_command_targets[0].values #=> Array
# resp.targets[0].run_command_parameters.run_command_targets[0].values[0] #=> String
# resp.targets[0].ecs_parameters.task_definition_arn #=> String
# resp.targets[0].ecs_parameters.task_count #=> Integer
# resp.targets[0].ecs_parameters.launch_type #=> String, one of "EC2", "FARGATE"
# resp.targets[0].ecs_parameters.network_configuration.awsvpc_configuration.subnets #=> Array
# resp.targets[0].ecs_parameters.network_configuration.awsvpc_configuration.subnets[0] #=> String
# resp.targets[0].ecs_parameters.network_configuration.awsvpc_configuration.security_groups #=> Array
# resp.targets[0].ecs_parameters.network_configuration.awsvpc_configuration.security_groups[0] #=> String
# resp.targets[0].ecs_parameters.network_configuration.awsvpc_configuration.assign_public_ip #=> String, one of "ENABLED", "DISABLED"
# resp.targets[0].ecs_parameters.platform_version #=> String
# resp.targets[0].ecs_parameters.group #=> String
# resp.targets[0].batch_parameters.job_definition #=> String
# resp.targets[0].batch_parameters.job_name #=> String
# resp.targets[0].batch_parameters.array_properties.size #=> Integer
# resp.targets[0].batch_parameters.retry_strategy.attempts #=> Integer
# resp.targets[0].sqs_parameters.message_group_id #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule AWS API Documentation
#
# @overload list_targets_by_rule(params = {})
# @param [Hash] params ({})
def list_targets_by_rule(params = {}, options = {})
req = build_request(:list_targets_by_rule, params)
req.send_request(options)
end
# Sends custom events to Amazon EventBridge so that they can be matched
# to rules.
#
# @option params [required, Array<Types::PutEventsRequestEntry>] :entries
# The entry that defines an event in your system. You can specify
# several parameters for the entry such as the source and type of the
# event, resources associated with the event, and so on.
#
# @return [Types::PutEventsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::PutEventsResponse#failed_entry_count #failed_entry_count} => Integer
# * {Types::PutEventsResponse#entries #entries} => Array<Types::PutEventsResultEntry>
#
# @example Request syntax with placeholder values
#
# resp = client.put_events({
# entries: [ # required
# {
# time: Time.now,
# source: "String",
# resources: ["EventResource"],
# detail_type: "String",
# detail: "String",
# event_bus_name: "NonPartnerEventBusName",
# },
# ],
# })
#
# @example Response structure
#
# resp.failed_entry_count #=> Integer
# resp.entries #=> Array
# resp.entries[0].event_id #=> String
# resp.entries[0].error_code #=> String
# resp.entries[0].error_message #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents AWS API Documentation
#
# @overload put_events(params = {})
# @param [Hash] params ({})
def put_events(params = {}, options = {})
req = build_request(:put_events, params)
req.send_request(options)
end
# This is used by SaaS partners to write events to a customer's partner
# event bus. AWS customers do not use this operation.
#
# @option params [required, Array<Types::PutPartnerEventsRequestEntry>] :entries
# The list of events to write to the event bus.
#
# @return [Types::PutPartnerEventsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::PutPartnerEventsResponse#failed_entry_count #failed_entry_count} => Integer
# * {Types::PutPartnerEventsResponse#entries #entries} => Array<Types::PutPartnerEventsResultEntry>
#
# @example Request syntax with placeholder values
#
# resp = client.put_partner_events({
# entries: [ # required
# {
# time: Time.now,
# source: "EventSourceName",
# resources: ["EventResource"],
# detail_type: "String",
# detail: "String",
# },
# ],
# })
#
# @example Response structure
#
# resp.failed_entry_count #=> Integer
# resp.entries #=> Array
# resp.entries[0].event_id #=> String
# resp.entries[0].error_code #=> String
# resp.entries[0].error_message #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPartnerEvents AWS API Documentation
#
# @overload put_partner_events(params = {})
# @param [Hash] params ({})
def put_partner_events(params = {}, options = {})
req = build_request(:put_partner_events, params)
req.send_request(options)
end
# Running `PutPermission` permits the specified AWS account or AWS
# organization to put events to the specified *event bus*. CloudWatch
# Events rules in your account are triggered by these events arriving to
# an event bus in your account.
#
# For another account to send events to your account, that external
# account must have an EventBridge rule with your account's event bus
# as a target.
#
# To enable multiple AWS accounts to put events to your event bus, run
# `PutPermission` once for each of these accounts. Or, if all the
# accounts are members of the same AWS organization, you can run
# `PutPermission` once specifying `Principal` as "*" and specifying
# the AWS organization ID in `Condition`, to grant permissions to all
# accounts in that organization.
#
# If you grant permissions using an organization, then accounts in that
# organization must specify a `RoleArn` with proper permissions when
# they use `PutTarget` to add your account's event bus as a target. For
# more information, see [Sending and Receiving Events Between AWS
# Accounts][1] in the *Amazon EventBridge User Guide*.
#
# The permission policy on the default event bus cannot exceed 10 KB in
# size.
#
#
#
# [1]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html
#
# @option params [String] :event_bus_name
# The event bus associated with the rule. If you omit this, the default
# event bus is used.
#
# @option params [required, String] :action
# The action that you are enabling the other account to perform.
# Currently, this must be `events:PutEvents`.
#
# @option params [required, String] :principal
# The 12-digit AWS account ID that you are permitting to put events to
# your default event bus. Specify "*" to permit any account to put
# events to your default event bus.
#
# If you specify "*" without specifying `Condition`, avoid creating
# rules that may match undesirable events. To create more secure rules,
# make sure that the event pattern for each rule contains an `account`
# field with a specific account ID from which to receive events. Rules
# with an account field do not match any events sent from other
# accounts.
#
# @option params [required, String] :statement_id
# An identifier string for the external account that you are granting
# permissions to. If you later want to revoke the permission for this
# external account, specify this `StatementId` when you run
# RemovePermission.
#
# @option params [Types::Condition] :condition
# This parameter enables you to limit the permission to accounts that
# fulfill a certain condition, such as being a member of a certain AWS
# organization. For more information about AWS Organizations, see [What
# Is AWS Organizations][1] in the *AWS Organizations User Guide*.
#
# If you specify `Condition` with an AWS organization ID, and specify
# "*" as the value for `Principal`, you grant permission to all the
# accounts in the named organization.
#
# The `Condition` is a JSON string which must contain `Type`, `Key`, and
# `Value` fields.
#
#
#
# [1]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.put_permission({
# event_bus_name: "NonPartnerEventBusName",
# action: "Action", # required
# principal: "Principal", # required
# statement_id: "StatementId", # required
# condition: {
# type: "String", # required
# key: "String", # required
# value: "String", # required
# },
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermission AWS API Documentation
#
# @overload put_permission(params = {})
# @param [Hash] params ({})
def put_permission(params = {}, options = {})
req = build_request(:put_permission, params)
req.send_request(options)
end
# Creates or updates the specified rule. Rules are enabled by default,
# or based on value of the state. You can disable a rule using
# DisableRule.
#
# A single rule watches for events from a single event bus. Events
# generated by AWS services go to your account's default event bus.
# Events generated by SaaS partner services or applications go to the
# matching partner event bus. If you have custom applications or
# services, you can specify whether their events go to your default
# event bus or a custom event bus that you have created. For more
# information, see CreateEventBus.
#
# If you are updating an existing rule, the rule is replaced with what
# you specify in this `PutRule` command. If you omit arguments in
# `PutRule`, the old values for those arguments are not kept. Instead,
# they are replaced with null values.
#
# When you create or update a rule, incoming events might not
# immediately start matching to new or updated rules. Allow a short
# period of time for changes to take effect.
#
# A rule must contain at least an EventPattern or ScheduleExpression.
# Rules with EventPatterns are triggered when a matching event is
# observed. Rules with ScheduleExpressions self-trigger based on the
# given schedule. A rule can have both an EventPattern and a
# ScheduleExpression, in which case the rule triggers on matching events
# as well as on a schedule.
#
# When you initially create a rule, you can optionally assign one or
# more tags to the rule. Tags can help you organize and categorize your
# resources. You can also use them to scope user permissions, by
# granting a user permission to access or change only rules with certain
# tag values. To use the `PutRule` operation and assign tags, you must
# have both the `events:PutRule` and `events:TagResource` permissions.
#
# If you are updating an existing rule, any tags you specify in the
# `PutRule` operation are ignored. To update the tags of an existing
# rule, use TagResource and UntagResource.
#
# Most services in AWS treat : or / as the same character in Amazon
# Resource Names (ARNs). However, EventBridge uses an exact match in
# event patterns and rules. Be sure to use the correct ARN characters
# when creating event patterns so that they match the ARN syntax in the
# event you want to match.
#
# In EventBridge, it is possible to create rules that lead to infinite
# loops, where a rule is fired repeatedly. For example, a rule might
# detect that ACLs have changed on an S3 bucket, and trigger software to
# change them to the desired state. If the rule is not written
# carefully, the subsequent change to the ACLs fires the rule again,
# creating an infinite loop.
#
# To prevent this, write the rules so that the triggered actions do not
# re-fire the same rule. For example, your rule could fire only if ACLs
# are found to be in a bad state, instead of after any change.
#
# An infinite loop can quickly cause higher than expected charges. We
# recommend that you use budgeting, which alerts you when charges exceed
# your specified limit. For more information, see [Managing Your Costs
# with Budgets][1].
#
#
#
# [1]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.html
#
# @option params [required, String] :name
# The name of the rule that you are creating or updating.
#
# @option params [String] :schedule_expression
# The scheduling expression. For example, "cron(0 20 * * ? *)" or
# "rate(5 minutes)".
#
# @option params [String] :event_pattern
# The event pattern. For more information, see [Events and Event
# Patterns][1] in the *Amazon EventBridge User Guide*.
#
#
#
# [1]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
#
# @option params [String] :state
# Indicates whether the rule is enabled or disabled.
#
# @option params [String] :description
# A description of the rule.
#
# @option params [String] :role_arn
# The Amazon Resource Name (ARN) of the IAM role associated with the
# rule.
#
# @option params [Array<Types::Tag>] :tags
# The list of key-value pairs to associate with the rule.
#
# @option params [String] :event_bus_name
# The event bus to associate with this rule. If you omit this, the
# default event bus is used.
#
# @return [Types::PutRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::PutRuleResponse#rule_arn #rule_arn} => String
#
# @example Request syntax with placeholder values
#
# resp = client.put_rule({
# name: "RuleName", # required
# schedule_expression: "ScheduleExpression",
# event_pattern: "EventPattern",
# state: "ENABLED", # accepts ENABLED, DISABLED
# description: "RuleDescription",
# role_arn: "RoleArn",
# tags: [
# {
# key: "TagKey", # required
# value: "TagValue", # required
# },
# ],
# event_bus_name: "EventBusName",
# })
#
# @example Response structure
#
# resp.rule_arn #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule AWS API Documentation
#
# @overload put_rule(params = {})
# @param [Hash] params ({})
def put_rule(params = {}, options = {})
req = build_request(:put_rule, params)
req.send_request(options)
end
# Adds the specified targets to the specified rule, or updates the
# targets if they are already associated with the rule.
#
# Targets are the resources that are invoked when a rule is triggered.
#
# You can configure the following as targets for Events:
#
# * EC2 instances
#
# * SSM Run Command
#
# * SSM Automation
#
# * AWS Lambda functions
#
# * Data streams in Amazon Kinesis Data Streams
#
# * Data delivery streams in Amazon Kinesis Data Firehose
#
# * Amazon ECS tasks
#
# * AWS Step Functions state machines
#
# * AWS Batch jobs
#
# * AWS CodeBuild projects
#
# * Pipelines in AWS CodePipeline
#
# * Amazon Inspector assessment templates
#
# * Amazon SNS topics
#
# * Amazon SQS queues, including FIFO queues
#
# * The default event bus of another AWS account
#
# Creating rules with built-in targets is supported only in the AWS
# Management Console. The built-in targets are `EC2 CreateSnapshot API
# call`, `EC2 RebootInstances API call`, `EC2 StopInstances API call`,
# and `EC2 TerminateInstances API call`.
#
# For some target types, `PutTargets` provides target-specific
# parameters. If the target is a Kinesis data stream, you can optionally
# specify which shard the event goes to by using the `KinesisParameters`
# argument. To invoke a command on multiple EC2 instances with one rule,
# you can use the `RunCommandParameters` field.
#
# To be able to make API calls against the resources that you own,
# Amazon CloudWatch Events needs the appropriate permissions. For AWS
# Lambda and Amazon SNS resources, EventBridge relies on resource-based
# policies. For EC2 instances, Kinesis data streams, and AWS Step
# Functions state machines, EventBridge relies on IAM roles that you
# specify in the `RoleARN` argument in `PutTargets`. For more
# information, see [Authentication and Access Control][1] in the *Amazon
# EventBridge User Guide*.
#
# If another AWS account is in the same region and has granted you
# permission (using `PutPermission`), you can send events to that
# account. Set that account's event bus as a target of the rules in
# your account. To send the matched events to the other account, specify
# that account's event bus as the `Arn` value when you run
# `PutTargets`. If your account sends events to another account, your
# account is charged for each sent event. Each event sent to another
# account is charged as a custom event. The account receiving the event
# is not charged. For more information, see [Amazon CloudWatch
# Pricing][2].
#
# <note markdown="1"> `Input`, `InputPath`, and `InputTransformer` are not available with
# `PutTarget` if the target is an event bus of a different AWS account.
#
# </note>
#
# If you are setting the event bus of another account as the target, and
# that account granted permission to your account through an
# organization instead of directly by the account ID, then you must
# specify a `RoleArn` with proper permissions in the `Target` structure.
# For more information, see [Sending and Receiving Events Between AWS
# Accounts][3] in the *Amazon EventBridge User Guide*.
#
# For more information about enabling cross-account events, see
# PutPermission.
#
# **Input**, **InputPath**, and **InputTransformer** are mutually
# exclusive and optional parameters of a target. When a rule is
# triggered due to a matched event:
#
# * If none of the following arguments are specified for a target, then
# the entire event is passed to the target in JSON format (unless the
# target is Amazon EC2 Run Command or Amazon ECS task, in which case
# nothing from the event is passed to the target).
#
# * If **Input** is specified in the form of valid JSON, then the
# matched event is overridden with this constant.
#
# * If **InputPath** is specified in the form of JSONPath (for example,
# `$.detail`), then only the part of the event specified in the path
# is passed to the target (for example, only the detail part of the
# event is passed).
#
# * If **InputTransformer** is specified, then one or more specified
# JSONPaths are extracted from the event and used as values in a
# template that you specify as the input to the target.
#
# When you specify `InputPath` or `InputTransformer`, you must use JSON
# dot notation, not bracket notation.
#
# When you add targets to a rule and the associated rule triggers soon
# after, new or updated targets might not be immediately invoked. Allow
# a short period of time for changes to take effect.
#
# This action can partially fail if too many requests are made at the
# same time. If that happens, `FailedEntryCount` is non-zero in the
# response and each entry in `FailedEntries` provides the ID of the
# failed target and the error code.
#
#
#
# [1]: https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html
# [2]: https://aws.amazon.com/cloudwatch/pricing/
# [3]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html
#
# @option params [required, String] :rule
# The name of the rule.
#
# @option params [String] :event_bus_name
# The name of the event bus associated with the rule. If you omit this,
# the default event bus is used.
#
# @option params [required, Array<Types::Target>] :targets
# The targets to update or add to the rule.
#
# @return [Types::PutTargetsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::PutTargetsResponse#failed_entry_count #failed_entry_count} => Integer
# * {Types::PutTargetsResponse#failed_entries #failed_entries} => Array<Types::PutTargetsResultEntry>
#
# @example Request syntax with placeholder values
#
# resp = client.put_targets({
# rule: "RuleName", # required
# event_bus_name: "EventBusName",
# targets: [ # required
# {
# id: "TargetId", # required
# arn: "TargetArn", # required
# role_arn: "RoleArn",
# input: "TargetInput",
# input_path: "TargetInputPath",
# input_transformer: {
# input_paths_map: {
# "InputTransformerPathKey" => "TargetInputPath",
# },
# input_template: "TransformerInput", # required
# },
# kinesis_parameters: {
# partition_key_path: "TargetPartitionKeyPath", # required
# },
# run_command_parameters: {
# run_command_targets: [ # required
# {
# key: "RunCommandTargetKey", # required
# values: ["RunCommandTargetValue"], # required
# },
# ],
# },
# ecs_parameters: {
# task_definition_arn: "Arn", # required
# task_count: 1,
# launch_type: "EC2", # accepts EC2, FARGATE
# network_configuration: {
# awsvpc_configuration: {
# subnets: ["String"], # required
# security_groups: ["String"],
# assign_public_ip: "ENABLED", # accepts ENABLED, DISABLED
# },
# },
# platform_version: "String",
# group: "String",
# },
# batch_parameters: {
# job_definition: "String", # required
# job_name: "String", # required
# array_properties: {
# size: 1,
# },
# retry_strategy: {
# attempts: 1,
# },
# },
# sqs_parameters: {
# message_group_id: "MessageGroupId",
# },
# },
# ],
# })
#
# @example Response structure
#
# resp.failed_entry_count #=> Integer
# resp.failed_entries #=> Array
# resp.failed_entries[0].target_id #=> String
# resp.failed_entries[0].error_code #=> String
# resp.failed_entries[0].error_message #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets AWS API Documentation
#
# @overload put_targets(params = {})
# @param [Hash] params ({})
def put_targets(params = {}, options = {})
req = build_request(:put_targets, params)
req.send_request(options)
end
# Revokes the permission of another AWS account to be able to put events
# to the specified event bus. Specify the account to revoke by the
# `StatementId` value that you associated with the account when you
# granted it permission with `PutPermission`. You can find the
# `StatementId` by using DescribeEventBus.
#
# @option params [required, String] :statement_id
# The statement ID corresponding to the account that is no longer
# allowed to put events to the default event bus.
#
# @option params [String] :event_bus_name
# The name of the event bus to revoke permissions for. If you omit this,
# the default event bus is used.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.remove_permission({
# statement_id: "StatementId", # required
# event_bus_name: "NonPartnerEventBusName",
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermission AWS API Documentation
#
# @overload remove_permission(params = {})
# @param [Hash] params ({})
def remove_permission(params = {}, options = {})
req = build_request(:remove_permission, params)
req.send_request(options)
end
# Removes the specified targets from the specified rule. When the rule
# is triggered, those targets are no longer be invoked.
#
# When you remove a target, when the associated rule triggers, removed
# targets might continue to be invoked. Allow a short period of time for
# changes to take effect.
#
# This action can partially fail if too many requests are made at the
# same time. If that happens, `FailedEntryCount` is non-zero in the
# response and each entry in `FailedEntries` provides the ID of the
# failed target and the error code.
#
# @option params [required, String] :rule
# The name of the rule.
#
# @option params [String] :event_bus_name
# The name of the event bus associated with the rule.
#
# @option params [required, Array<String>] :ids
# The IDs of the targets to remove from the rule.
#
# @option params [Boolean] :force
# If this is a managed rule, created by an AWS service on your behalf,
# you must specify `Force` as `True` to remove targets. This parameter
# is ignored for rules that are not managed rules. You can check whether
# a rule is a managed rule by using `DescribeRule` or `ListRules` and
# checking the `ManagedBy` field of the response.
#
# @return [Types::RemoveTargetsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::RemoveTargetsResponse#failed_entry_count #failed_entry_count} => Integer
# * {Types::RemoveTargetsResponse#failed_entries #failed_entries} => Array<Types::RemoveTargetsResultEntry>
#
# @example Request syntax with placeholder values
#
# resp = client.remove_targets({
# rule: "RuleName", # required
# event_bus_name: "EventBusName",
# ids: ["TargetId"], # required
# force: false,
# })
#
# @example Response structure
#
# resp.failed_entry_count #=> Integer
# resp.failed_entries #=> Array
# resp.failed_entries[0].target_id #=> String
# resp.failed_entries[0].error_code #=> String
# resp.failed_entries[0].error_message #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets AWS API Documentation
#
# @overload remove_targets(params = {})
# @param [Hash] params ({})
def remove_targets(params = {}, options = {})
req = build_request(:remove_targets, params)
req.send_request(options)
end
# Assigns one or more tags (key-value pairs) to the specified
# EventBridge resource. Tags can help you organize and categorize your
# resources. You can also use them to scope user permissions by granting
# a user permission to access or change only resources with certain tag
# values. In EventBridge, rules and event buses can be tagged.
#
# Tags don't have any semantic meaning to AWS and are interpreted
# strictly as strings of characters.
#
# You can use the `TagResource` action with a resource that already has
# tags. If you specify a new tag key, this tag is appended to the list
# of tags associated with the resource. If you specify a tag key that is
# already associated with the resource, the new tag value that you
# specify replaces the previous value for that tag.
#
# You can associate as many as 50 tags with a resource.
#
# @option params [required, String] :resource_arn
# The ARN of the EventBridge resource that you're adding tags to.
#
# @option params [required, Array<Types::Tag>] :tags
# The list of key-value pairs to associate with the resource.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.tag_resource({
# resource_arn: "Arn", # required
# tags: [ # required
# {
# key: "TagKey", # required
# value: "TagValue", # required
# },
# ],
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TagResource AWS API Documentation
#
# @overload tag_resource(params = {})
# @param [Hash] params ({})
def tag_resource(params = {}, options = {})
req = build_request(:tag_resource, params)
req.send_request(options)
end
# Tests whether the specified event pattern matches the provided event.
#
# Most services in AWS treat : or / as the same character in Amazon
# Resource Names (ARNs). However, EventBridge uses an exact match in
# event patterns and rules. Be sure to use the correct ARN characters
# when creating event patterns so that they match the ARN syntax in the
# event you want to match.
#
# @option params [required, String] :event_pattern
# The event pattern. For more information, see [Events and Event
# Patterns][1] in the *Amazon EventBridge User Guide*.
#
#
#
# [1]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
#
# @option params [required, String] :event
# The event, in JSON format, to test against the event pattern.
#
# @return [Types::TestEventPatternResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::TestEventPatternResponse#result #result} => Boolean
#
# @example Request syntax with placeholder values
#
# resp = client.test_event_pattern({
# event_pattern: "EventPattern", # required
# event: "String", # required
# })
#
# @example Response structure
#
# resp.result #=> Boolean
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern AWS API Documentation
#
# @overload test_event_pattern(params = {})
# @param [Hash] params ({})
def test_event_pattern(params = {}, options = {})
req = build_request(:test_event_pattern, params)
req.send_request(options)
end
# Removes one or more tags from the specified EventBridge resource. In
# CloudWatch Events, rules and event buses can be tagged.
#
# @option params [required, String] :resource_arn
# The ARN of the EventBridge resource from which you are removing tags.
#
# @option params [required, Array<String>] :tag_keys
# The list of tag keys to remove from the resource.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.untag_resource({
# resource_arn: "Arn", # required
# tag_keys: ["TagKey"], # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/UntagResource AWS API Documentation
#
# @overload untag_resource(params = {})
# @param [Hash] params ({})
def untag_resource(params = {}, options = {})
req = build_request(:untag_resource, params)
req.send_request(options)
end
# @!endgroup
# @param params ({})
# @api private
def build_request(operation_name, params = {})
handlers = @handlers.for(operation_name)
context = Seahorse::Client::RequestContext.new(
operation_name: operation_name,
operation: config.api.operation(operation_name),
client: self,
params: params,
config: config)
context[:gem_name] = 'aws-sdk-cloudwatchevents'
context[:gem_version] = '1.32.0'
Seahorse::Client::Request.new(handlers, context)
end
# @api private
# @deprecated
def waiter_names
[]
end
class << self
# @api private
attr_reader :identifier
# @api private
def errors_module
Errors
end
end
end
end
| 42.17326 | 167 | 0.658573 |
f8c9797d304f32a4bf25914fdd7ca4cf424c8223
| 9,663 |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
# Creates Seed Data for the organization
# qty is Arborscape, Diaper Storage Unit, PDX Diaperbank
base_items = File.read(Rails.root.join("db", "base_items.json"))
items_by_category = JSON.parse(base_items)
# Creates the Base Items
items_by_category.each do |category, entries|
entries.each do |entry|
BaseItem.find_or_create_by!(name: entry["name"], category: category, partner_key: entry["key"])
end
end
pdx_org = Organization.find_or_create_by!(short_name: "diaper_bank") do |organization|
organization.name = "Pawnee Diaper Bank"
organization.street = "P.O. Box 22613"
organization.city = "Pawnee"
organization.state = "Indiana"
organization.zipcode = "12345"
organization.email = "[email protected]"
end
Organization.seed_items(pdx_org)
sf_org = Organization.find_or_create_by!(short_name: "sf_bank") do |organization|
organization.name = "SF Diaper Bank"
organization.street = "P.O. Box 12345"
organization.city = "San Francisco"
organization.state = "CA"
organization.zipcode = "90210"
organization.email = "[email protected]"
end
Organization.seed_items(sf_org)
# super admin
user = User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization_admin: false, super_admin: true
# org admins
user = User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization: pdx_org, organization_admin: true
user2 = User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization: sf_org, organization_admin: true
# regular users
User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization: pdx_org, organization_admin: false
User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization: sf_org, organization_admin: false
# test users
User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization: pdx_org, organization_admin: false, super_admin: true
User.create email: '[email protected]', password: 'password', password_confirmation: 'password', organization: sf_org, organization_admin: true
DonationSite.find_or_create_by!(name: "Pawnee Hardware") do |location|
location.address = "1234 SE Some Ave., Pawnee, OR 12345"
location.organization = pdx_org
end
DonationSite.find_or_create_by!(name: "Parks Department") do |location|
location.address = "2345 NE Some St., Pawnee, OR 12345"
location.organization = pdx_org
end
DonationSite.find_or_create_by!(name: "Waffle House") do |location|
location.address = "3456 Some Bay., Pawnee, OR 12345"
location.organization = pdx_org
end
DonationSite.find_or_create_by!(name: "Eagleton Country Club") do |location|
location.address = "4567 Some Blvd., Pawnee, OR 12345"
location.organization = pdx_org
end
Partner.find_or_create_by!(name: "Pawnee Parent Service", email: "[email protected]", status: :approved) do |partner|
partner.organization = pdx_org
end
Partner.find_or_create_by!(name: "Pawnee Homeless Shelter", email: "[email protected]", status: :invited) do |partner|
partner.organization = pdx_org
end
Partner.find_or_create_by!(name: "Pawnee Pregnancy Center", email: "[email protected]", status: :invited) do |partner|
partner.organization = pdx_org
end
inv_arbor = StorageLocation.find_or_create_by!(name: "Bulk Storage Location") do |inventory|
inventory.address = "Unknown"
inventory.organization = pdx_org
end
inv_pdxdb = StorageLocation.find_or_create_by!(name: "Pawnee Main Bank (Office)") do |inventory|
inventory.address = "Unknown"
inventory.organization = pdx_org
end
def seed_quantity(item_name, organization_id, storage_location_id, quantity)
return if (quantity == 0)
item_id = Item.find_by(name: item_name, organization_id: organization_id).id
InventoryItem.find_or_create_by(item_id: item_id, storage_location_id: storage_location_id) {|h|
h.quantity = quantity
}
end
# qty is Arborscape, Diaper Storage Unit, PDX Diaperbank
items_by_category.each do |_category, entries|
entries.each do |entry|
seed_quantity(entry['name'], pdx_org, inv_arbor.id, entry['qty'][0])
seed_quantity(entry['name'], pdx_org, inv_pdxdb.id, entry['qty'][2])
end
end
BarcodeItem.find_or_create_by!(value: "10037867880046") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 5)")
barcode.quantity = 108
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "10037867880053") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 6)")
barcode.quantity = 92
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "10037867880039") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 4)")
barcode.quantity = 124
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "803516626364") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 1)")
barcode.quantity = 40
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "036000406535") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 1)")
barcode.quantity = 44
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "037000863427") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 1)")
barcode.quantity = 35
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "041260379000") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 3)")
barcode.quantity = 160
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "074887711700") do |barcode|
barcode.item = Item.find_by(name: "Wipes (Baby)")
barcode.quantity = 8
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "036000451306") do |barcode|
barcode.item = Item.find_by(name: "Kids Pull-Ups (4T-5T)")
barcode.quantity = 56
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "037000862246") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 4)")
barcode.quantity = 92
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "041260370236") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 4)")
barcode.quantity = 68
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "036000407679") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 4)")
barcode.quantity = 24
barcode.organization = pdx_org
end
BarcodeItem.find_or_create_by!(value: "311917152226") do |barcode|
barcode.item = Item.find_by(name: "Kids (Size 4)")
barcode.quantity = 82
barcode.organization = pdx_org
end
DiaperDriveParticipant.create! business_name: "A Good Place to Collect Diapers",
contact_name: "fred",
email: "[email protected]",
organization: pdx_org
DiaperDriveParticipant.create! business_name: "A Mediocre Place to Collect Diapers",
contact_name: "wilma",
email: "[email protected]",
organization: pdx_org
def random_record(klass)
# FIXME: This produces a deprecation warning. Could replace it with: .order(Arel.sql('random()'))
klass.limit(1).order("random()").first
end
20.times.each do
source = Donation::SOURCES.values.sample
# Depending on which source it uses, additional data may need to be provided.
donation = case source
when Donation::SOURCES[:diaper_drive]
Donation.create! source: source, diaper_drive_participant: random_record(DiaperDriveParticipant), storage_location: random_record(StorageLocation), organization: pdx_org, issued_at: Time.now
when Donation::SOURCES[:donation_site]
Donation.create! source: source, donation_site: random_record(DonationSite), storage_location: random_record(StorageLocation), organization: pdx_org, issued_at: Time.now
else
Donation.create! source: source, storage_location: random_record(StorageLocation), organization: pdx_org, issued_at: Time.now
end
rand(1..5).times.each do
LineItem.create! quantity: rand(1..500), item: random_record(Item), itemizable: donation
end
end
20.times.each do
distribution = Distribution.create!(storage_location: random_record(StorageLocation),
partner: random_record(Partner),
organization: pdx_org,
issued_at: (Date.today + rand(15).days)
)
rand(1..5).times.each do
LineItem.create! quantity: rand(1..500), item: random_record(Item), itemizable: distribution
end
end
20.times.each do |count|
status = count > 15 ? 'fulfilled' : 'pending'
Request.create(
partner: random_record(Partner),
organization: random_record(Organization),
request_items: [{ "item_id" => Item.all.pluck(:id).sample, "quantity" => 3},
{ "item_id" => Item.all.pluck(:id).sample, "quantity" => 2}
],
comments: "Urgent",
status: status
)
end
Flipper::Adapters::ActiveRecord::Feature.find_or_create_by(key: "new_logo")
| 41.472103 | 205 | 0.722136 |
3382736d357a2cbbc48179e6a3c431d3aec76379
| 418 |
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
describe "reloads" do
before do
@session = Webrat::TestSession.new
@session.response_body = "Hello world"
end
it "should reload the page with http referer" do
@session.should_receive(:get).with("/", {})
@session.should_receive(:get).with("/", {}, {"HTTP_REFERER"=>"/"})
@session.visit("/")
@session.reloads
end
end
| 26.125 | 70 | 0.657895 |
bbb64cb9ebcae97983677e930f0e0cb6428ae29e
| 459 |
module Msf
module Encoding
###
#
# This class provides basic XOR encoding facilities and is used
# by XOR encoders.
#
###
class Xor
#
# Encodes a block using XOR.
#
def Xor.encode_block(key, block, block_size = 4, block_pack = 'V')
offset = 0
oblock = ''
while (offset < block.length)
cblock = block[offset, block_size].unpack(block_pack)[0]
cblock ^= key
oblock += [ cblock ].pack(block_pack)
end
return oblock
end
end
end end
| 14.806452 | 67 | 0.666667 |
e8296a6c9713e9eca230f020e27a1d04e7baed10
| 3,914 |
# Category.class_eval do
# has_many :calendar_events, :through => :categorizations, :source => :categorizable, :source_type => 'CalendarEvent'
# end
class CalendarEvent < ActiveRecord::Base
has_many :assets, :through => :asset_assignments
has_many :asset_assignments, :foreign_key => :content_id # TODO shouldn't that be :dependent => :delete_all?
has_many :categories, :through => :categorizations
has_many :categorizations, :as => :categorizable, :dependent => :destroy, :include => :category
belongs_to :section
alias :calendar :section
belongs_to :user
has_permalink :title, :url_attribute => :permalink, :sync_url => true, :only_when_blank => true, :scope => :section_id
acts_as_taggable
filters_attributes :sanitize => :body_html, :except => [:body, :cached_tag_list]
filtered_column :body
validates_presence_of :start_date
validates_presence_of :end_date, :if => :require_end_date?
validates_presence_of :title
validates_presence_of :user_id
validates_presence_of :section_id
validates_uniqueness_of :permalink, :scope => :section_id
named_scope :by_categories, Proc.new { |*category_ids|
{
:conditions => ['categorizations.category_id IN (?)', category_ids],
:include => :categorizations,
:order => 'start_date DESC'
}
}
named_scope :elapsed, lambda {
t = Time.now
{
:conditions => ['start_date <= ? AND (end_date IS NULL OR end_date <= ?)', t, t],
:order => 'start_date DESC'
}
}
named_scope :upcoming, Proc.new { |start_date, end_date|
t = Time.now
start_date ||= t
end_date ||= start_date.end_of_day + 1.month
{
:conditions => ['(start_date BETWEEN ? AND ?)
OR (start_date <= ? AND end_date >= ?)',
start_date, end_date, start_date, start_date],
:order => 'start_date DESC'
}
}
named_scope :recently_added, lambda {
t = Time.now
{
:conditions => ['start_date >= ? OR end_date >= ?', t, t],
:order => 'calendar_events.id DESC'
}
}
# FIXME ... published_at <= Time.zone.now - i.e. events can theoretically be
# published in the future
named_scope :published, :conditions => 'published_at IS NOT NULL'
named_scope :drafts, lambda {
{ :conditions => ['published_at IS NULL'] } }
named_scope :search, Proc.new { |query, filter|
{
:conditions => ["#{CalendarEvent.sanitize_filter(filter)} LIKE ?", "%#{query}%"],
:order => 'start_date DESC'
}
}
cattr_accessor :require_end_date
@@require_end_date = true
if Rails.plugin?(:adva_safemode)
class Jail < Safemode::Jail
allow :start_date, :end_date, :title, :user, :section, :tags, :assets, :categories, :permalink, :body, :body_html
allow :all_day?, :host, :draft?, :published?, :require_end_date?
end
end
class << self
def find_published_by_params(params)
scope = params[:section].events.published
scope = %w(elapsed recently_added).include?(params[:scope]) ? scope.send(params[:scope]) : scope.upcoming(params[:timespan])
events = if %w(title body).include?(params[:filter])
scope.search(params[:query], params[:filter])
elsif params[:filter] == 'tags' and params[:query].present?
scope.tagged(params[:query])
else
params[:category_id] ? scope.by_categories(params[:category_id]) : scope
end
end
end
def require_end_date?
@@require_end_date.present?
end
def draft?
published_at.nil?
end
def published?
!published_at.nil? and published_at <= Time.zone.now
end
def just_published?
published? and published_at_changed?
end
def self.sanitize_filter(filter)
%w(title body).include?(filter.to_s) ? filter.to_s : 'title'
end
def validate
errors.add(:end_date, 'must be after start date') if ! self.start_date.nil? and ! self.end_date.nil? and self.end_date < self.start_date
end
end
| 30.818898 | 140 | 0.667348 |
f8c471f9a0ee3583a58aa010afd8e279784b7829
| 1,238 |
require_relative 'boot'
require 'rails'
# Pick the frameworks you want:
require 'active_model/railtie'
require 'active_job/railtie'
require 'active_record/railtie'
require 'active_storage/engine'
require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'action_mailbox/engine'
require 'action_text/engine'
require 'action_view/railtie'
require 'action_cable/engine'
require 'sprockets/railtie'
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module App
class Application < Rails::Application
config.load_defaults 6.0
# ----
# 追加事項(タイムゾーン)
config.time_zone = 'Tokyo'
config.i18n.load_path +=
Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
# 追加事項(ロケールファイル読みこみ先)
config.i18n.default_locale = :ja
# 追加事項(ジェネレーター設定)
config.generators do |g|
g.test_framework :rspec,
controller_specs: false,
view_specs: false,
helper_specs: false,
routing_specs: false
end
# ----
config.generators.system_tests = nil
end
end
| 25.791667 | 72 | 0.675283 |
086a2c32842401300b4d9001904c79fa8bb6dc73
| 2,421 |
class Litani < Formula
include Language::Python::Virtualenv
desc "Metabuild system"
homepage "https://awslabs.github.io/aws-build-accumulator/"
url "https://github.com/awslabs/aws-build-accumulator.git",
tag: "1.25.0",
revision: "ee931df881f3a7a935691c910d60864513d3f0fb"
license "Apache-2.0"
bottle do
root_url "https://github.com/gromgit/homebrew-core-mojave/releases/download/litani"
sha256 cellar: :any_skip_relocation, mojave: "132adeefc84c8115fa9b56ff62a15f5264d5c9b81294cd38ac14efadb5509ba5"
end
depends_on "coreutils" => :build
depends_on "mandoc" => :build
depends_on "scdoc" => :build
depends_on "gnuplot"
depends_on "graphviz"
depends_on "ninja"
depends_on "[email protected]"
resource "Jinja2" do
url "https://files.pythonhosted.org/packages/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz"
sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
end
resource "MarkupSafe" do
url "https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz"
sha256 "7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz"
sha256 "607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"
end
def install
ENV.prepend_path "PATH", libexec/"vendor/bin"
venv = virtualenv_create(libexec/"vendor", "python3")
venv.pip_install resources
libexec.install Dir["*"] - ["test", "examples"]
(bin/"litani").write_env_script libexec/"litani", PATH: "\"#{libexec}/vendor/bin:${PATH}\""
cd libexec/"doc" do
system libexec/"vendor/bin/python3", "configure"
system "ninja", "--verbose"
end
man1.install libexec.glob("doc/out/man/*.1")
man5.install libexec.glob("doc/out/man/*.5")
man7.install libexec.glob("doc/out/man/*.7")
doc.install libexec/"doc/out/html/index.html"
rm_rf libexec/"doc"
end
test do
system bin/"litani", "init", "--project-name", "test-installation"
system bin/"litani", "add-job",
"--command", "/usr/bin/true",
"--pipeline-name", "test-installation",
"--ci-stage", "test"
system bin/"litani", "run-build"
end
end
| 36.134328 | 140 | 0.720363 |
f77ca64e20bf230bc881e44466a9743ad27fdf70
| 2,620 |
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_03_20_155123) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
enable_extension "unaccent"
create_table "foods", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name"
t.string "emoji"
t.string "months", default: [], array: true
t.boolean "local", default: false
t.float "pef"
t.float "co2"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "ciqual_code"
t.integer "ciqual_grp_code"
t.integer "ciqual_ssgrp_code"
t.integer "ciqual_ssssgrp_code"
end
create_table "ingredients", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "recipe_id", null: false
t.string "name"
t.integer "quantity"
t.string "unit"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "food_id", null: false
t.index ["food_id"], name: "index_ingredients_on_food_id"
t.index ["recipe_id"], name: "index_ingredients_on_recipe_id"
end
create_table "pg_search_documents", force: :cascade do |t|
t.text "content"
t.string "searchable_type"
t.bigint "searchable_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["searchable_type", "searchable_id"], name: "index_pg_search_documents_on_searchable"
end
create_table "recipes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "title"
t.text "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "author"
t.string "license"
t.string "source_url"
t.integer "total_minutes"
end
add_foreign_key "ingredients", "foods"
add_foreign_key "ingredients", "recipes"
end
| 37.971014 | 100 | 0.71374 |
abce55f8e95b9d6e51ec605511335f7ff19665de
| 138 |
class RemoveTaskTitleFromFiledPlanTitle < ActiveRecord::Migration
def change
remove_column :filed_plan_tasks, :task_title
end
end
| 23 | 65 | 0.818841 |
7a1b44d38bfeee5f3ede9e14da491d075ed9215c
| 845 |
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'quantified/version'
Gem::Specification.new do |s|
s.name = "quantified"
s.version = Quantified::VERSION
s.license = 'MIT'
s.platform = Gem::Platform::RUBY
s.authors = ["James MacAulay", "Willem van Bergen"]
s.email = ["[email protected]"]
s.homepage = "https://github.com/Shopify/quantified"
s.summary = "Pretty quantifiable measurements which feel like ActiveSupport::Duration."
s.description = s.summary
s.add_development_dependency('rake')
s.add_development_dependency('test-unit')
s.files = `git ls-files`.split($/)
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ['lib']
end
| 33.8 | 93 | 0.654438 |
bff84cde4aadd5e2c88f5037e9a0f93f416c9654
| 1,950 |
#
# This file is a template that is designed to give you a starting point for extending Betty
# Copy this file to what you want to extend Betty with. Personally I wrote this as a precursor to
# extending Betty to supporting git development so my first step would be
#
# cp lib/_template.rb lib/git.rb
#
module Template
#
# If you need unit conversions or other meta methods you'd want to locate them here at the top to be consistent with the code base
# See process.rb for examples or convert.rb
#
# You need a self.interpret method which grabs the command and deals with it
#
def self.interpret(command)
responses = []
#
# The guts generally boil down to one or more regular expression matcher against the user's command
#
# Remember to use \s+ as a token delimiter and use () for grouping
#
if command.match(/^$/)
search_term = $1.gsub(' ', '%20')
#
# Build a hash of the possible responses to the user (Note :url is a new idea that I'm floating here)
#
# Your typical options are :command, :say, :explanation
# :command represents the command you want to give the user
# :say is something to be said out loud
# :explanation is what we're teaching the user
# :url is an web url where more details are available
#
# Use Command.browser(url) as a way to open a url
#
responses << {
:command => "",
:explanation => ""
}
end
#
# Return responses
#
responses
end
#
# The help structure
#
def self.help
commands = []
commands << {
:category => "",
:description => '',
:usage => [""]
}
commands
end
end
# this last line is where the magic actually happens; you need to take the executors and assign it to something that does the work
# here it is commented out since this is, well, a template
#$executors << Some Class Goes Here
| 28.676471 | 132 | 0.644615 |
21af48eb580dfb745286059dbf334c0d52d01163
| 252,987 |
# frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::Connect
# @api private
module ClientApi
include Seahorse::Model
ARN = Shapes::StringShape.new(name: 'ARN')
AfterContactWorkTimeLimit = Shapes::IntegerShape.new(name: 'AfterContactWorkTimeLimit')
AgentFirstName = Shapes::StringShape.new(name: 'AgentFirstName')
AgentLastName = Shapes::StringShape.new(name: 'AgentLastName')
AgentStatus = Shapes::StructureShape.new(name: 'AgentStatus')
AgentStatusDescription = Shapes::StringShape.new(name: 'AgentStatusDescription')
AgentStatusId = Shapes::StringShape.new(name: 'AgentStatusId')
AgentStatusName = Shapes::StringShape.new(name: 'AgentStatusName')
AgentStatusOrderNumber = Shapes::IntegerShape.new(name: 'AgentStatusOrderNumber')
AgentStatusState = Shapes::StringShape.new(name: 'AgentStatusState')
AgentStatusSummary = Shapes::StructureShape.new(name: 'AgentStatusSummary')
AgentStatusSummaryList = Shapes::ListShape.new(name: 'AgentStatusSummaryList')
AgentStatusType = Shapes::StringShape.new(name: 'AgentStatusType')
AgentStatusTypes = Shapes::ListShape.new(name: 'AgentStatusTypes')
AgentUsername = Shapes::StringShape.new(name: 'AgentUsername')
AliasArn = Shapes::StringShape.new(name: 'AliasArn')
AssociateApprovedOriginRequest = Shapes::StructureShape.new(name: 'AssociateApprovedOriginRequest')
AssociateBotRequest = Shapes::StructureShape.new(name: 'AssociateBotRequest')
AssociateInstanceStorageConfigRequest = Shapes::StructureShape.new(name: 'AssociateInstanceStorageConfigRequest')
AssociateInstanceStorageConfigResponse = Shapes::StructureShape.new(name: 'AssociateInstanceStorageConfigResponse')
AssociateLambdaFunctionRequest = Shapes::StructureShape.new(name: 'AssociateLambdaFunctionRequest')
AssociateLexBotRequest = Shapes::StructureShape.new(name: 'AssociateLexBotRequest')
AssociateQueueQuickConnectsRequest = Shapes::StructureShape.new(name: 'AssociateQueueQuickConnectsRequest')
AssociateRoutingProfileQueuesRequest = Shapes::StructureShape.new(name: 'AssociateRoutingProfileQueuesRequest')
AssociateSecurityKeyRequest = Shapes::StructureShape.new(name: 'AssociateSecurityKeyRequest')
AssociateSecurityKeyResponse = Shapes::StructureShape.new(name: 'AssociateSecurityKeyResponse')
AssociationId = Shapes::StringShape.new(name: 'AssociationId')
Attribute = Shapes::StructureShape.new(name: 'Attribute')
AttributeName = Shapes::StringShape.new(name: 'AttributeName')
AttributeValue = Shapes::StringShape.new(name: 'AttributeValue')
Attributes = Shapes::MapShape.new(name: 'Attributes')
AttributesList = Shapes::ListShape.new(name: 'AttributesList')
AutoAccept = Shapes::BooleanShape.new(name: 'AutoAccept')
Boolean = Shapes::BooleanShape.new(name: 'Boolean')
BotName = Shapes::StringShape.new(name: 'BotName')
BucketName = Shapes::StringShape.new(name: 'BucketName')
Channel = Shapes::StringShape.new(name: 'Channel')
Channels = Shapes::ListShape.new(name: 'Channels')
ChatContent = Shapes::StringShape.new(name: 'ChatContent')
ChatContentType = Shapes::StringShape.new(name: 'ChatContentType')
ChatMessage = Shapes::StructureShape.new(name: 'ChatMessage')
ClientToken = Shapes::StringShape.new(name: 'ClientToken')
CommonNameLength127 = Shapes::StringShape.new(name: 'CommonNameLength127')
Comparison = Shapes::StringShape.new(name: 'Comparison')
Concurrency = Shapes::IntegerShape.new(name: 'Concurrency')
ContactFlow = Shapes::StructureShape.new(name: 'ContactFlow')
ContactFlowContent = Shapes::StringShape.new(name: 'ContactFlowContent')
ContactFlowDescription = Shapes::StringShape.new(name: 'ContactFlowDescription')
ContactFlowId = Shapes::StringShape.new(name: 'ContactFlowId')
ContactFlowName = Shapes::StringShape.new(name: 'ContactFlowName')
ContactFlowNotPublishedException = Shapes::StructureShape.new(name: 'ContactFlowNotPublishedException')
ContactFlowSummary = Shapes::StructureShape.new(name: 'ContactFlowSummary')
ContactFlowSummaryList = Shapes::ListShape.new(name: 'ContactFlowSummaryList')
ContactFlowType = Shapes::StringShape.new(name: 'ContactFlowType')
ContactFlowTypes = Shapes::ListShape.new(name: 'ContactFlowTypes')
ContactId = Shapes::StringShape.new(name: 'ContactId')
ContactNotFoundException = Shapes::StructureShape.new(name: 'ContactNotFoundException')
ContactReferences = Shapes::MapShape.new(name: 'ContactReferences')
CreateAgentStatusRequest = Shapes::StructureShape.new(name: 'CreateAgentStatusRequest')
CreateAgentStatusResponse = Shapes::StructureShape.new(name: 'CreateAgentStatusResponse')
CreateContactFlowRequest = Shapes::StructureShape.new(name: 'CreateContactFlowRequest')
CreateContactFlowResponse = Shapes::StructureShape.new(name: 'CreateContactFlowResponse')
CreateHoursOfOperationRequest = Shapes::StructureShape.new(name: 'CreateHoursOfOperationRequest')
CreateHoursOfOperationResponse = Shapes::StructureShape.new(name: 'CreateHoursOfOperationResponse')
CreateInstanceRequest = Shapes::StructureShape.new(name: 'CreateInstanceRequest')
CreateInstanceResponse = Shapes::StructureShape.new(name: 'CreateInstanceResponse')
CreateIntegrationAssociationRequest = Shapes::StructureShape.new(name: 'CreateIntegrationAssociationRequest')
CreateIntegrationAssociationResponse = Shapes::StructureShape.new(name: 'CreateIntegrationAssociationResponse')
CreateQueueRequest = Shapes::StructureShape.new(name: 'CreateQueueRequest')
CreateQueueResponse = Shapes::StructureShape.new(name: 'CreateQueueResponse')
CreateQuickConnectRequest = Shapes::StructureShape.new(name: 'CreateQuickConnectRequest')
CreateQuickConnectResponse = Shapes::StructureShape.new(name: 'CreateQuickConnectResponse')
CreateRoutingProfileRequest = Shapes::StructureShape.new(name: 'CreateRoutingProfileRequest')
CreateRoutingProfileResponse = Shapes::StructureShape.new(name: 'CreateRoutingProfileResponse')
CreateUseCaseRequest = Shapes::StructureShape.new(name: 'CreateUseCaseRequest')
CreateUseCaseResponse = Shapes::StructureShape.new(name: 'CreateUseCaseResponse')
CreateUserHierarchyGroupRequest = Shapes::StructureShape.new(name: 'CreateUserHierarchyGroupRequest')
CreateUserHierarchyGroupResponse = Shapes::StructureShape.new(name: 'CreateUserHierarchyGroupResponse')
CreateUserRequest = Shapes::StructureShape.new(name: 'CreateUserRequest')
CreateUserResponse = Shapes::StructureShape.new(name: 'CreateUserResponse')
Credentials = Shapes::StructureShape.new(name: 'Credentials')
CurrentMetric = Shapes::StructureShape.new(name: 'CurrentMetric')
CurrentMetricData = Shapes::StructureShape.new(name: 'CurrentMetricData')
CurrentMetricDataCollections = Shapes::ListShape.new(name: 'CurrentMetricDataCollections')
CurrentMetricName = Shapes::StringShape.new(name: 'CurrentMetricName')
CurrentMetricResult = Shapes::StructureShape.new(name: 'CurrentMetricResult')
CurrentMetricResults = Shapes::ListShape.new(name: 'CurrentMetricResults')
CurrentMetrics = Shapes::ListShape.new(name: 'CurrentMetrics')
Delay = Shapes::IntegerShape.new(name: 'Delay')
DeleteHoursOfOperationRequest = Shapes::StructureShape.new(name: 'DeleteHoursOfOperationRequest')
DeleteInstanceRequest = Shapes::StructureShape.new(name: 'DeleteInstanceRequest')
DeleteIntegrationAssociationRequest = Shapes::StructureShape.new(name: 'DeleteIntegrationAssociationRequest')
DeleteQuickConnectRequest = Shapes::StructureShape.new(name: 'DeleteQuickConnectRequest')
DeleteUseCaseRequest = Shapes::StructureShape.new(name: 'DeleteUseCaseRequest')
DeleteUserHierarchyGroupRequest = Shapes::StructureShape.new(name: 'DeleteUserHierarchyGroupRequest')
DeleteUserRequest = Shapes::StructureShape.new(name: 'DeleteUserRequest')
DescribeAgentStatusRequest = Shapes::StructureShape.new(name: 'DescribeAgentStatusRequest')
DescribeAgentStatusResponse = Shapes::StructureShape.new(name: 'DescribeAgentStatusResponse')
DescribeContactFlowRequest = Shapes::StructureShape.new(name: 'DescribeContactFlowRequest')
DescribeContactFlowResponse = Shapes::StructureShape.new(name: 'DescribeContactFlowResponse')
DescribeHoursOfOperationRequest = Shapes::StructureShape.new(name: 'DescribeHoursOfOperationRequest')
DescribeHoursOfOperationResponse = Shapes::StructureShape.new(name: 'DescribeHoursOfOperationResponse')
DescribeInstanceAttributeRequest = Shapes::StructureShape.new(name: 'DescribeInstanceAttributeRequest')
DescribeInstanceAttributeResponse = Shapes::StructureShape.new(name: 'DescribeInstanceAttributeResponse')
DescribeInstanceRequest = Shapes::StructureShape.new(name: 'DescribeInstanceRequest')
DescribeInstanceResponse = Shapes::StructureShape.new(name: 'DescribeInstanceResponse')
DescribeInstanceStorageConfigRequest = Shapes::StructureShape.new(name: 'DescribeInstanceStorageConfigRequest')
DescribeInstanceStorageConfigResponse = Shapes::StructureShape.new(name: 'DescribeInstanceStorageConfigResponse')
DescribeQueueRequest = Shapes::StructureShape.new(name: 'DescribeQueueRequest')
DescribeQueueResponse = Shapes::StructureShape.new(name: 'DescribeQueueResponse')
DescribeQuickConnectRequest = Shapes::StructureShape.new(name: 'DescribeQuickConnectRequest')
DescribeQuickConnectResponse = Shapes::StructureShape.new(name: 'DescribeQuickConnectResponse')
DescribeRoutingProfileRequest = Shapes::StructureShape.new(name: 'DescribeRoutingProfileRequest')
DescribeRoutingProfileResponse = Shapes::StructureShape.new(name: 'DescribeRoutingProfileResponse')
DescribeUserHierarchyGroupRequest = Shapes::StructureShape.new(name: 'DescribeUserHierarchyGroupRequest')
DescribeUserHierarchyGroupResponse = Shapes::StructureShape.new(name: 'DescribeUserHierarchyGroupResponse')
DescribeUserHierarchyStructureRequest = Shapes::StructureShape.new(name: 'DescribeUserHierarchyStructureRequest')
DescribeUserHierarchyStructureResponse = Shapes::StructureShape.new(name: 'DescribeUserHierarchyStructureResponse')
DescribeUserRequest = Shapes::StructureShape.new(name: 'DescribeUserRequest')
DescribeUserResponse = Shapes::StructureShape.new(name: 'DescribeUserResponse')
Description = Shapes::StringShape.new(name: 'Description')
DestinationNotAllowedException = Shapes::StructureShape.new(name: 'DestinationNotAllowedException')
Dimensions = Shapes::StructureShape.new(name: 'Dimensions')
DirectoryAlias = Shapes::StringShape.new(name: 'DirectoryAlias')
DirectoryId = Shapes::StringShape.new(name: 'DirectoryId')
DirectoryType = Shapes::StringShape.new(name: 'DirectoryType')
DirectoryUserId = Shapes::StringShape.new(name: 'DirectoryUserId')
DisassociateApprovedOriginRequest = Shapes::StructureShape.new(name: 'DisassociateApprovedOriginRequest')
DisassociateBotRequest = Shapes::StructureShape.new(name: 'DisassociateBotRequest')
DisassociateInstanceStorageConfigRequest = Shapes::StructureShape.new(name: 'DisassociateInstanceStorageConfigRequest')
DisassociateLambdaFunctionRequest = Shapes::StructureShape.new(name: 'DisassociateLambdaFunctionRequest')
DisassociateLexBotRequest = Shapes::StructureShape.new(name: 'DisassociateLexBotRequest')
DisassociateQueueQuickConnectsRequest = Shapes::StructureShape.new(name: 'DisassociateQueueQuickConnectsRequest')
DisassociateRoutingProfileQueuesRequest = Shapes::StructureShape.new(name: 'DisassociateRoutingProfileQueuesRequest')
DisassociateSecurityKeyRequest = Shapes::StructureShape.new(name: 'DisassociateSecurityKeyRequest')
DisplayName = Shapes::StringShape.new(name: 'DisplayName')
DuplicateResourceException = Shapes::StructureShape.new(name: 'DuplicateResourceException')
Email = Shapes::StringShape.new(name: 'Email')
EncryptionConfig = Shapes::StructureShape.new(name: 'EncryptionConfig')
EncryptionType = Shapes::StringShape.new(name: 'EncryptionType')
Filters = Shapes::StructureShape.new(name: 'Filters')
FunctionArn = Shapes::StringShape.new(name: 'FunctionArn')
FunctionArnsList = Shapes::ListShape.new(name: 'FunctionArnsList')
GetContactAttributesRequest = Shapes::StructureShape.new(name: 'GetContactAttributesRequest')
GetContactAttributesResponse = Shapes::StructureShape.new(name: 'GetContactAttributesResponse')
GetCurrentMetricDataRequest = Shapes::StructureShape.new(name: 'GetCurrentMetricDataRequest')
GetCurrentMetricDataResponse = Shapes::StructureShape.new(name: 'GetCurrentMetricDataResponse')
GetFederationTokenRequest = Shapes::StructureShape.new(name: 'GetFederationTokenRequest')
GetFederationTokenResponse = Shapes::StructureShape.new(name: 'GetFederationTokenResponse')
GetMetricDataRequest = Shapes::StructureShape.new(name: 'GetMetricDataRequest')
GetMetricDataResponse = Shapes::StructureShape.new(name: 'GetMetricDataResponse')
Grouping = Shapes::StringShape.new(name: 'Grouping')
Groupings = Shapes::ListShape.new(name: 'Groupings')
HierarchyGroup = Shapes::StructureShape.new(name: 'HierarchyGroup')
HierarchyGroupId = Shapes::StringShape.new(name: 'HierarchyGroupId')
HierarchyGroupName = Shapes::StringShape.new(name: 'HierarchyGroupName')
HierarchyGroupSummary = Shapes::StructureShape.new(name: 'HierarchyGroupSummary')
HierarchyGroupSummaryList = Shapes::ListShape.new(name: 'HierarchyGroupSummaryList')
HierarchyLevel = Shapes::StructureShape.new(name: 'HierarchyLevel')
HierarchyLevelId = Shapes::StringShape.new(name: 'HierarchyLevelId')
HierarchyLevelName = Shapes::StringShape.new(name: 'HierarchyLevelName')
HierarchyLevelUpdate = Shapes::StructureShape.new(name: 'HierarchyLevelUpdate')
HierarchyPath = Shapes::StructureShape.new(name: 'HierarchyPath')
HierarchyStructure = Shapes::StructureShape.new(name: 'HierarchyStructure')
HierarchyStructureUpdate = Shapes::StructureShape.new(name: 'HierarchyStructureUpdate')
HistoricalMetric = Shapes::StructureShape.new(name: 'HistoricalMetric')
HistoricalMetricData = Shapes::StructureShape.new(name: 'HistoricalMetricData')
HistoricalMetricDataCollections = Shapes::ListShape.new(name: 'HistoricalMetricDataCollections')
HistoricalMetricName = Shapes::StringShape.new(name: 'HistoricalMetricName')
HistoricalMetricResult = Shapes::StructureShape.new(name: 'HistoricalMetricResult')
HistoricalMetricResults = Shapes::ListShape.new(name: 'HistoricalMetricResults')
HistoricalMetrics = Shapes::ListShape.new(name: 'HistoricalMetrics')
Hours = Shapes::IntegerShape.new(name: 'Hours')
Hours24Format = Shapes::IntegerShape.new(name: 'Hours24Format')
HoursOfOperation = Shapes::StructureShape.new(name: 'HoursOfOperation')
HoursOfOperationConfig = Shapes::StructureShape.new(name: 'HoursOfOperationConfig')
HoursOfOperationConfigList = Shapes::ListShape.new(name: 'HoursOfOperationConfigList')
HoursOfOperationDays = Shapes::StringShape.new(name: 'HoursOfOperationDays')
HoursOfOperationDescription = Shapes::StringShape.new(name: 'HoursOfOperationDescription')
HoursOfOperationId = Shapes::StringShape.new(name: 'HoursOfOperationId')
HoursOfOperationName = Shapes::StringShape.new(name: 'HoursOfOperationName')
HoursOfOperationSummary = Shapes::StructureShape.new(name: 'HoursOfOperationSummary')
HoursOfOperationSummaryList = Shapes::ListShape.new(name: 'HoursOfOperationSummaryList')
HoursOfOperationTimeSlice = Shapes::StructureShape.new(name: 'HoursOfOperationTimeSlice')
InboundCallsEnabled = Shapes::BooleanShape.new(name: 'InboundCallsEnabled')
Instance = Shapes::StructureShape.new(name: 'Instance')
InstanceAttributeType = Shapes::StringShape.new(name: 'InstanceAttributeType')
InstanceAttributeValue = Shapes::StringShape.new(name: 'InstanceAttributeValue')
InstanceId = Shapes::StringShape.new(name: 'InstanceId')
InstanceStatus = Shapes::StringShape.new(name: 'InstanceStatus')
InstanceStatusReason = Shapes::StructureShape.new(name: 'InstanceStatusReason')
InstanceStorageConfig = Shapes::StructureShape.new(name: 'InstanceStorageConfig')
InstanceStorageConfigs = Shapes::ListShape.new(name: 'InstanceStorageConfigs')
InstanceStorageResourceType = Shapes::StringShape.new(name: 'InstanceStorageResourceType')
InstanceSummary = Shapes::StructureShape.new(name: 'InstanceSummary')
InstanceSummaryList = Shapes::ListShape.new(name: 'InstanceSummaryList')
IntegrationAssociationId = Shapes::StringShape.new(name: 'IntegrationAssociationId')
IntegrationAssociationSummary = Shapes::StructureShape.new(name: 'IntegrationAssociationSummary')
IntegrationAssociationSummaryList = Shapes::ListShape.new(name: 'IntegrationAssociationSummaryList')
IntegrationType = Shapes::StringShape.new(name: 'IntegrationType')
InternalServiceException = Shapes::StructureShape.new(name: 'InternalServiceException')
InvalidContactFlowException = Shapes::StructureShape.new(name: 'InvalidContactFlowException')
InvalidParameterException = Shapes::StructureShape.new(name: 'InvalidParameterException')
InvalidRequestException = Shapes::StructureShape.new(name: 'InvalidRequestException')
KeyId = Shapes::StringShape.new(name: 'KeyId')
KinesisFirehoseConfig = Shapes::StructureShape.new(name: 'KinesisFirehoseConfig')
KinesisStreamConfig = Shapes::StructureShape.new(name: 'KinesisStreamConfig')
KinesisVideoStreamConfig = Shapes::StructureShape.new(name: 'KinesisVideoStreamConfig')
LexBot = Shapes::StructureShape.new(name: 'LexBot')
LexBotConfig = Shapes::StructureShape.new(name: 'LexBotConfig')
LexBotConfigList = Shapes::ListShape.new(name: 'LexBotConfigList')
LexBotsList = Shapes::ListShape.new(name: 'LexBotsList')
LexRegion = Shapes::StringShape.new(name: 'LexRegion')
LexV2Bot = Shapes::StructureShape.new(name: 'LexV2Bot')
LexVersion = Shapes::StringShape.new(name: 'LexVersion')
LimitExceededException = Shapes::StructureShape.new(name: 'LimitExceededException')
ListAgentStatusRequest = Shapes::StructureShape.new(name: 'ListAgentStatusRequest')
ListAgentStatusResponse = Shapes::StructureShape.new(name: 'ListAgentStatusResponse')
ListApprovedOriginsRequest = Shapes::StructureShape.new(name: 'ListApprovedOriginsRequest')
ListApprovedOriginsResponse = Shapes::StructureShape.new(name: 'ListApprovedOriginsResponse')
ListBotsRequest = Shapes::StructureShape.new(name: 'ListBotsRequest')
ListBotsResponse = Shapes::StructureShape.new(name: 'ListBotsResponse')
ListContactFlowsRequest = Shapes::StructureShape.new(name: 'ListContactFlowsRequest')
ListContactFlowsResponse = Shapes::StructureShape.new(name: 'ListContactFlowsResponse')
ListHoursOfOperationsRequest = Shapes::StructureShape.new(name: 'ListHoursOfOperationsRequest')
ListHoursOfOperationsResponse = Shapes::StructureShape.new(name: 'ListHoursOfOperationsResponse')
ListInstanceAttributesRequest = Shapes::StructureShape.new(name: 'ListInstanceAttributesRequest')
ListInstanceAttributesResponse = Shapes::StructureShape.new(name: 'ListInstanceAttributesResponse')
ListInstanceStorageConfigsRequest = Shapes::StructureShape.new(name: 'ListInstanceStorageConfigsRequest')
ListInstanceStorageConfigsResponse = Shapes::StructureShape.new(name: 'ListInstanceStorageConfigsResponse')
ListInstancesRequest = Shapes::StructureShape.new(name: 'ListInstancesRequest')
ListInstancesResponse = Shapes::StructureShape.new(name: 'ListInstancesResponse')
ListIntegrationAssociationsRequest = Shapes::StructureShape.new(name: 'ListIntegrationAssociationsRequest')
ListIntegrationAssociationsResponse = Shapes::StructureShape.new(name: 'ListIntegrationAssociationsResponse')
ListLambdaFunctionsRequest = Shapes::StructureShape.new(name: 'ListLambdaFunctionsRequest')
ListLambdaFunctionsResponse = Shapes::StructureShape.new(name: 'ListLambdaFunctionsResponse')
ListLexBotsRequest = Shapes::StructureShape.new(name: 'ListLexBotsRequest')
ListLexBotsResponse = Shapes::StructureShape.new(name: 'ListLexBotsResponse')
ListPhoneNumbersRequest = Shapes::StructureShape.new(name: 'ListPhoneNumbersRequest')
ListPhoneNumbersResponse = Shapes::StructureShape.new(name: 'ListPhoneNumbersResponse')
ListPromptsRequest = Shapes::StructureShape.new(name: 'ListPromptsRequest')
ListPromptsResponse = Shapes::StructureShape.new(name: 'ListPromptsResponse')
ListQueueQuickConnectsRequest = Shapes::StructureShape.new(name: 'ListQueueQuickConnectsRequest')
ListQueueQuickConnectsResponse = Shapes::StructureShape.new(name: 'ListQueueQuickConnectsResponse')
ListQueuesRequest = Shapes::StructureShape.new(name: 'ListQueuesRequest')
ListQueuesResponse = Shapes::StructureShape.new(name: 'ListQueuesResponse')
ListQuickConnectsRequest = Shapes::StructureShape.new(name: 'ListQuickConnectsRequest')
ListQuickConnectsResponse = Shapes::StructureShape.new(name: 'ListQuickConnectsResponse')
ListRoutingProfileQueuesRequest = Shapes::StructureShape.new(name: 'ListRoutingProfileQueuesRequest')
ListRoutingProfileQueuesResponse = Shapes::StructureShape.new(name: 'ListRoutingProfileQueuesResponse')
ListRoutingProfilesRequest = Shapes::StructureShape.new(name: 'ListRoutingProfilesRequest')
ListRoutingProfilesResponse = Shapes::StructureShape.new(name: 'ListRoutingProfilesResponse')
ListSecurityKeysRequest = Shapes::StructureShape.new(name: 'ListSecurityKeysRequest')
ListSecurityKeysResponse = Shapes::StructureShape.new(name: 'ListSecurityKeysResponse')
ListSecurityProfilesRequest = Shapes::StructureShape.new(name: 'ListSecurityProfilesRequest')
ListSecurityProfilesResponse = Shapes::StructureShape.new(name: 'ListSecurityProfilesResponse')
ListTagsForResourceRequest = Shapes::StructureShape.new(name: 'ListTagsForResourceRequest')
ListTagsForResourceResponse = Shapes::StructureShape.new(name: 'ListTagsForResourceResponse')
ListUseCasesRequest = Shapes::StructureShape.new(name: 'ListUseCasesRequest')
ListUseCasesResponse = Shapes::StructureShape.new(name: 'ListUseCasesResponse')
ListUserHierarchyGroupsRequest = Shapes::StructureShape.new(name: 'ListUserHierarchyGroupsRequest')
ListUserHierarchyGroupsResponse = Shapes::StructureShape.new(name: 'ListUserHierarchyGroupsResponse')
ListUsersRequest = Shapes::StructureShape.new(name: 'ListUsersRequest')
ListUsersResponse = Shapes::StructureShape.new(name: 'ListUsersResponse')
MaxResult10 = Shapes::IntegerShape.new(name: 'MaxResult10')
MaxResult100 = Shapes::IntegerShape.new(name: 'MaxResult100')
MaxResult1000 = Shapes::IntegerShape.new(name: 'MaxResult1000')
MaxResult2 = Shapes::IntegerShape.new(name: 'MaxResult2')
MaxResult25 = Shapes::IntegerShape.new(name: 'MaxResult25')
MaxResult7 = Shapes::IntegerShape.new(name: 'MaxResult7')
MediaConcurrencies = Shapes::ListShape.new(name: 'MediaConcurrencies')
MediaConcurrency = Shapes::StructureShape.new(name: 'MediaConcurrency')
Message = Shapes::StringShape.new(name: 'Message')
MinutesLimit60 = Shapes::IntegerShape.new(name: 'MinutesLimit60')
Name = Shapes::StringShape.new(name: 'Name')
NextToken = Shapes::StringShape.new(name: 'NextToken')
Origin = Shapes::StringShape.new(name: 'Origin')
OriginsList = Shapes::ListShape.new(name: 'OriginsList')
OutboundCallerConfig = Shapes::StructureShape.new(name: 'OutboundCallerConfig')
OutboundCallerIdName = Shapes::StringShape.new(name: 'OutboundCallerIdName')
OutboundCallsEnabled = Shapes::BooleanShape.new(name: 'OutboundCallsEnabled')
OutboundContactNotPermittedException = Shapes::StructureShape.new(name: 'OutboundContactNotPermittedException')
PEM = Shapes::StringShape.new(name: 'PEM')
ParticipantDetails = Shapes::StructureShape.new(name: 'ParticipantDetails')
ParticipantId = Shapes::StringShape.new(name: 'ParticipantId')
ParticipantToken = Shapes::StringShape.new(name: 'ParticipantToken')
Password = Shapes::StringShape.new(name: 'Password')
PhoneNumber = Shapes::StringShape.new(name: 'PhoneNumber')
PhoneNumberCountryCode = Shapes::StringShape.new(name: 'PhoneNumberCountryCode')
PhoneNumberCountryCodes = Shapes::ListShape.new(name: 'PhoneNumberCountryCodes')
PhoneNumberId = Shapes::StringShape.new(name: 'PhoneNumberId')
PhoneNumberQuickConnectConfig = Shapes::StructureShape.new(name: 'PhoneNumberQuickConnectConfig')
PhoneNumberSummary = Shapes::StructureShape.new(name: 'PhoneNumberSummary')
PhoneNumberSummaryList = Shapes::ListShape.new(name: 'PhoneNumberSummaryList')
PhoneNumberType = Shapes::StringShape.new(name: 'PhoneNumberType')
PhoneNumberTypes = Shapes::ListShape.new(name: 'PhoneNumberTypes')
PhoneType = Shapes::StringShape.new(name: 'PhoneType')
Prefix = Shapes::StringShape.new(name: 'Prefix')
Priority = Shapes::IntegerShape.new(name: 'Priority')
ProblemDetail = Shapes::StructureShape.new(name: 'ProblemDetail')
ProblemMessageString = Shapes::StringShape.new(name: 'ProblemMessageString')
Problems = Shapes::ListShape.new(name: 'Problems')
PromptId = Shapes::StringShape.new(name: 'PromptId')
PromptName = Shapes::StringShape.new(name: 'PromptName')
PromptSummary = Shapes::StructureShape.new(name: 'PromptSummary')
PromptSummaryList = Shapes::ListShape.new(name: 'PromptSummaryList')
Queue = Shapes::StructureShape.new(name: 'Queue')
QueueDescription = Shapes::StringShape.new(name: 'QueueDescription')
QueueId = Shapes::StringShape.new(name: 'QueueId')
QueueMaxContacts = Shapes::IntegerShape.new(name: 'QueueMaxContacts')
QueueName = Shapes::StringShape.new(name: 'QueueName')
QueueQuickConnectConfig = Shapes::StructureShape.new(name: 'QueueQuickConnectConfig')
QueueReference = Shapes::StructureShape.new(name: 'QueueReference')
QueueStatus = Shapes::StringShape.new(name: 'QueueStatus')
QueueSummary = Shapes::StructureShape.new(name: 'QueueSummary')
QueueSummaryList = Shapes::ListShape.new(name: 'QueueSummaryList')
QueueType = Shapes::StringShape.new(name: 'QueueType')
QueueTypes = Shapes::ListShape.new(name: 'QueueTypes')
Queues = Shapes::ListShape.new(name: 'Queues')
QuickConnect = Shapes::StructureShape.new(name: 'QuickConnect')
QuickConnectConfig = Shapes::StructureShape.new(name: 'QuickConnectConfig')
QuickConnectDescription = Shapes::StringShape.new(name: 'QuickConnectDescription')
QuickConnectId = Shapes::StringShape.new(name: 'QuickConnectId')
QuickConnectName = Shapes::StringShape.new(name: 'QuickConnectName')
QuickConnectSummary = Shapes::StructureShape.new(name: 'QuickConnectSummary')
QuickConnectSummaryList = Shapes::ListShape.new(name: 'QuickConnectSummaryList')
QuickConnectType = Shapes::StringShape.new(name: 'QuickConnectType')
QuickConnectTypes = Shapes::ListShape.new(name: 'QuickConnectTypes')
QuickConnectsList = Shapes::ListShape.new(name: 'QuickConnectsList')
Reference = Shapes::StructureShape.new(name: 'Reference')
ReferenceKey = Shapes::StringShape.new(name: 'ReferenceKey')
ReferenceType = Shapes::StringShape.new(name: 'ReferenceType')
ReferenceValue = Shapes::StringShape.new(name: 'ReferenceValue')
ResourceConflictException = Shapes::StructureShape.new(name: 'ResourceConflictException')
ResourceInUseException = Shapes::StructureShape.new(name: 'ResourceInUseException')
ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
ResourceType = Shapes::StringShape.new(name: 'ResourceType')
ResumeContactRecordingRequest = Shapes::StructureShape.new(name: 'ResumeContactRecordingRequest')
ResumeContactRecordingResponse = Shapes::StructureShape.new(name: 'ResumeContactRecordingResponse')
RoutingProfile = Shapes::StructureShape.new(name: 'RoutingProfile')
RoutingProfileDescription = Shapes::StringShape.new(name: 'RoutingProfileDescription')
RoutingProfileId = Shapes::StringShape.new(name: 'RoutingProfileId')
RoutingProfileName = Shapes::StringShape.new(name: 'RoutingProfileName')
RoutingProfileQueueConfig = Shapes::StructureShape.new(name: 'RoutingProfileQueueConfig')
RoutingProfileQueueConfigList = Shapes::ListShape.new(name: 'RoutingProfileQueueConfigList')
RoutingProfileQueueConfigSummary = Shapes::StructureShape.new(name: 'RoutingProfileQueueConfigSummary')
RoutingProfileQueueConfigSummaryList = Shapes::ListShape.new(name: 'RoutingProfileQueueConfigSummaryList')
RoutingProfileQueueReference = Shapes::StructureShape.new(name: 'RoutingProfileQueueReference')
RoutingProfileQueueReferenceList = Shapes::ListShape.new(name: 'RoutingProfileQueueReferenceList')
RoutingProfileSummary = Shapes::StructureShape.new(name: 'RoutingProfileSummary')
RoutingProfileSummaryList = Shapes::ListShape.new(name: 'RoutingProfileSummaryList')
S3Config = Shapes::StructureShape.new(name: 'S3Config')
SecurityKey = Shapes::StructureShape.new(name: 'SecurityKey')
SecurityKeysList = Shapes::ListShape.new(name: 'SecurityKeysList')
SecurityProfileId = Shapes::StringShape.new(name: 'SecurityProfileId')
SecurityProfileIds = Shapes::ListShape.new(name: 'SecurityProfileIds')
SecurityProfileName = Shapes::StringShape.new(name: 'SecurityProfileName')
SecurityProfileSummary = Shapes::StructureShape.new(name: 'SecurityProfileSummary')
SecurityProfileSummaryList = Shapes::ListShape.new(name: 'SecurityProfileSummaryList')
SecurityToken = Shapes::StringShape.new(name: 'SecurityToken')
ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
SourceApplicationName = Shapes::StringShape.new(name: 'SourceApplicationName')
SourceType = Shapes::StringShape.new(name: 'SourceType')
StartChatContactRequest = Shapes::StructureShape.new(name: 'StartChatContactRequest')
StartChatContactResponse = Shapes::StructureShape.new(name: 'StartChatContactResponse')
StartContactRecordingRequest = Shapes::StructureShape.new(name: 'StartContactRecordingRequest')
StartContactRecordingResponse = Shapes::StructureShape.new(name: 'StartContactRecordingResponse')
StartOutboundVoiceContactRequest = Shapes::StructureShape.new(name: 'StartOutboundVoiceContactRequest')
StartOutboundVoiceContactResponse = Shapes::StructureShape.new(name: 'StartOutboundVoiceContactResponse')
StartTaskContactRequest = Shapes::StructureShape.new(name: 'StartTaskContactRequest')
StartTaskContactResponse = Shapes::StructureShape.new(name: 'StartTaskContactResponse')
Statistic = Shapes::StringShape.new(name: 'Statistic')
StopContactRecordingRequest = Shapes::StructureShape.new(name: 'StopContactRecordingRequest')
StopContactRecordingResponse = Shapes::StructureShape.new(name: 'StopContactRecordingResponse')
StopContactRequest = Shapes::StructureShape.new(name: 'StopContactRequest')
StopContactResponse = Shapes::StructureShape.new(name: 'StopContactResponse')
StorageType = Shapes::StringShape.new(name: 'StorageType')
String = Shapes::StringShape.new(name: 'String')
SuspendContactRecordingRequest = Shapes::StructureShape.new(name: 'SuspendContactRecordingRequest')
SuspendContactRecordingResponse = Shapes::StructureShape.new(name: 'SuspendContactRecordingResponse')
TagKey = Shapes::StringShape.new(name: 'TagKey')
TagKeyList = Shapes::ListShape.new(name: 'TagKeyList')
TagMap = Shapes::MapShape.new(name: 'TagMap')
TagResourceRequest = Shapes::StructureShape.new(name: 'TagResourceRequest')
TagValue = Shapes::StringShape.new(name: 'TagValue')
Threshold = Shapes::StructureShape.new(name: 'Threshold')
ThresholdValue = Shapes::FloatShape.new(name: 'ThresholdValue')
ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
TimeZone = Shapes::StringShape.new(name: 'TimeZone')
Timestamp = Shapes::TimestampShape.new(name: 'Timestamp')
URI = Shapes::StringShape.new(name: 'URI')
Unit = Shapes::StringShape.new(name: 'Unit')
UntagResourceRequest = Shapes::StructureShape.new(name: 'UntagResourceRequest')
UpdateAgentStatusDescription = Shapes::StringShape.new(name: 'UpdateAgentStatusDescription')
UpdateAgentStatusRequest = Shapes::StructureShape.new(name: 'UpdateAgentStatusRequest')
UpdateContactAttributesRequest = Shapes::StructureShape.new(name: 'UpdateContactAttributesRequest')
UpdateContactAttributesResponse = Shapes::StructureShape.new(name: 'UpdateContactAttributesResponse')
UpdateContactFlowContentRequest = Shapes::StructureShape.new(name: 'UpdateContactFlowContentRequest')
UpdateContactFlowNameRequest = Shapes::StructureShape.new(name: 'UpdateContactFlowNameRequest')
UpdateHoursOfOperationDescription = Shapes::StringShape.new(name: 'UpdateHoursOfOperationDescription')
UpdateHoursOfOperationRequest = Shapes::StructureShape.new(name: 'UpdateHoursOfOperationRequest')
UpdateInstanceAttributeRequest = Shapes::StructureShape.new(name: 'UpdateInstanceAttributeRequest')
UpdateInstanceStorageConfigRequest = Shapes::StructureShape.new(name: 'UpdateInstanceStorageConfigRequest')
UpdateQueueHoursOfOperationRequest = Shapes::StructureShape.new(name: 'UpdateQueueHoursOfOperationRequest')
UpdateQueueMaxContactsRequest = Shapes::StructureShape.new(name: 'UpdateQueueMaxContactsRequest')
UpdateQueueNameRequest = Shapes::StructureShape.new(name: 'UpdateQueueNameRequest')
UpdateQueueOutboundCallerConfigRequest = Shapes::StructureShape.new(name: 'UpdateQueueOutboundCallerConfigRequest')
UpdateQueueStatusRequest = Shapes::StructureShape.new(name: 'UpdateQueueStatusRequest')
UpdateQuickConnectConfigRequest = Shapes::StructureShape.new(name: 'UpdateQuickConnectConfigRequest')
UpdateQuickConnectDescription = Shapes::StringShape.new(name: 'UpdateQuickConnectDescription')
UpdateQuickConnectNameRequest = Shapes::StructureShape.new(name: 'UpdateQuickConnectNameRequest')
UpdateRoutingProfileConcurrencyRequest = Shapes::StructureShape.new(name: 'UpdateRoutingProfileConcurrencyRequest')
UpdateRoutingProfileDefaultOutboundQueueRequest = Shapes::StructureShape.new(name: 'UpdateRoutingProfileDefaultOutboundQueueRequest')
UpdateRoutingProfileNameRequest = Shapes::StructureShape.new(name: 'UpdateRoutingProfileNameRequest')
UpdateRoutingProfileQueuesRequest = Shapes::StructureShape.new(name: 'UpdateRoutingProfileQueuesRequest')
UpdateUserHierarchyGroupNameRequest = Shapes::StructureShape.new(name: 'UpdateUserHierarchyGroupNameRequest')
UpdateUserHierarchyRequest = Shapes::StructureShape.new(name: 'UpdateUserHierarchyRequest')
UpdateUserHierarchyStructureRequest = Shapes::StructureShape.new(name: 'UpdateUserHierarchyStructureRequest')
UpdateUserIdentityInfoRequest = Shapes::StructureShape.new(name: 'UpdateUserIdentityInfoRequest')
UpdateUserPhoneConfigRequest = Shapes::StructureShape.new(name: 'UpdateUserPhoneConfigRequest')
UpdateUserRoutingProfileRequest = Shapes::StructureShape.new(name: 'UpdateUserRoutingProfileRequest')
UpdateUserSecurityProfilesRequest = Shapes::StructureShape.new(name: 'UpdateUserSecurityProfilesRequest')
UseCase = Shapes::StructureShape.new(name: 'UseCase')
UseCaseId = Shapes::StringShape.new(name: 'UseCaseId')
UseCaseSummaryList = Shapes::ListShape.new(name: 'UseCaseSummaryList')
UseCaseType = Shapes::StringShape.new(name: 'UseCaseType')
User = Shapes::StructureShape.new(name: 'User')
UserId = Shapes::StringShape.new(name: 'UserId')
UserIdentityInfo = Shapes::StructureShape.new(name: 'UserIdentityInfo')
UserNotFoundException = Shapes::StructureShape.new(name: 'UserNotFoundException')
UserPhoneConfig = Shapes::StructureShape.new(name: 'UserPhoneConfig')
UserQuickConnectConfig = Shapes::StructureShape.new(name: 'UserQuickConnectConfig')
UserSummary = Shapes::StructureShape.new(name: 'UserSummary')
UserSummaryList = Shapes::ListShape.new(name: 'UserSummaryList')
Value = Shapes::FloatShape.new(name: 'Value')
VoiceRecordingConfiguration = Shapes::StructureShape.new(name: 'VoiceRecordingConfiguration')
VoiceRecordingTrack = Shapes::StringShape.new(name: 'VoiceRecordingTrack')
timestamp = Shapes::TimestampShape.new(name: 'timestamp')
AgentStatus.add_member(:agent_status_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "AgentStatusARN"))
AgentStatus.add_member(:agent_status_id, Shapes::ShapeRef.new(shape: AgentStatusId, location_name: "AgentStatusId"))
AgentStatus.add_member(:name, Shapes::ShapeRef.new(shape: AgentStatusName, location_name: "Name"))
AgentStatus.add_member(:description, Shapes::ShapeRef.new(shape: AgentStatusDescription, location_name: "Description"))
AgentStatus.add_member(:type, Shapes::ShapeRef.new(shape: AgentStatusType, location_name: "Type"))
AgentStatus.add_member(:display_order, Shapes::ShapeRef.new(shape: AgentStatusOrderNumber, location_name: "DisplayOrder"))
AgentStatus.add_member(:state, Shapes::ShapeRef.new(shape: AgentStatusState, location_name: "State"))
AgentStatus.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
AgentStatus.struct_class = Types::AgentStatus
AgentStatusSummary.add_member(:id, Shapes::ShapeRef.new(shape: AgentStatusId, location_name: "Id"))
AgentStatusSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
AgentStatusSummary.add_member(:name, Shapes::ShapeRef.new(shape: AgentStatusName, location_name: "Name"))
AgentStatusSummary.add_member(:type, Shapes::ShapeRef.new(shape: AgentStatusType, location_name: "Type"))
AgentStatusSummary.struct_class = Types::AgentStatusSummary
AgentStatusSummaryList.member = Shapes::ShapeRef.new(shape: AgentStatusSummary)
AgentStatusTypes.member = Shapes::ShapeRef.new(shape: AgentStatusType)
AssociateApprovedOriginRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateApprovedOriginRequest.add_member(:origin, Shapes::ShapeRef.new(shape: Origin, required: true, location_name: "Origin"))
AssociateApprovedOriginRequest.struct_class = Types::AssociateApprovedOriginRequest
AssociateBotRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateBotRequest.add_member(:lex_bot, Shapes::ShapeRef.new(shape: LexBot, location_name: "LexBot"))
AssociateBotRequest.add_member(:lex_v2_bot, Shapes::ShapeRef.new(shape: LexV2Bot, location_name: "LexV2Bot"))
AssociateBotRequest.struct_class = Types::AssociateBotRequest
AssociateInstanceStorageConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateInstanceStorageConfigRequest.add_member(:resource_type, Shapes::ShapeRef.new(shape: InstanceStorageResourceType, required: true, location_name: "ResourceType"))
AssociateInstanceStorageConfigRequest.add_member(:storage_config, Shapes::ShapeRef.new(shape: InstanceStorageConfig, required: true, location_name: "StorageConfig"))
AssociateInstanceStorageConfigRequest.struct_class = Types::AssociateInstanceStorageConfigRequest
AssociateInstanceStorageConfigResponse.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, location_name: "AssociationId"))
AssociateInstanceStorageConfigResponse.struct_class = Types::AssociateInstanceStorageConfigResponse
AssociateLambdaFunctionRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateLambdaFunctionRequest.add_member(:function_arn, Shapes::ShapeRef.new(shape: FunctionArn, required: true, location_name: "FunctionArn"))
AssociateLambdaFunctionRequest.struct_class = Types::AssociateLambdaFunctionRequest
AssociateLexBotRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateLexBotRequest.add_member(:lex_bot, Shapes::ShapeRef.new(shape: LexBot, required: true, location_name: "LexBot"))
AssociateLexBotRequest.struct_class = Types::AssociateLexBotRequest
AssociateQueueQuickConnectsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateQueueQuickConnectsRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
AssociateQueueQuickConnectsRequest.add_member(:quick_connect_ids, Shapes::ShapeRef.new(shape: QuickConnectsList, required: true, location_name: "QuickConnectIds"))
AssociateQueueQuickConnectsRequest.struct_class = Types::AssociateQueueQuickConnectsRequest
AssociateRoutingProfileQueuesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateRoutingProfileQueuesRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
AssociateRoutingProfileQueuesRequest.add_member(:queue_configs, Shapes::ShapeRef.new(shape: RoutingProfileQueueConfigList, required: true, location_name: "QueueConfigs"))
AssociateRoutingProfileQueuesRequest.struct_class = Types::AssociateRoutingProfileQueuesRequest
AssociateSecurityKeyRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
AssociateSecurityKeyRequest.add_member(:key, Shapes::ShapeRef.new(shape: PEM, required: true, location_name: "Key"))
AssociateSecurityKeyRequest.struct_class = Types::AssociateSecurityKeyRequest
AssociateSecurityKeyResponse.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, location_name: "AssociationId"))
AssociateSecurityKeyResponse.struct_class = Types::AssociateSecurityKeyResponse
Attribute.add_member(:attribute_type, Shapes::ShapeRef.new(shape: InstanceAttributeType, location_name: "AttributeType"))
Attribute.add_member(:value, Shapes::ShapeRef.new(shape: InstanceAttributeValue, location_name: "Value"))
Attribute.struct_class = Types::Attribute
Attributes.key = Shapes::ShapeRef.new(shape: AttributeName)
Attributes.value = Shapes::ShapeRef.new(shape: AttributeValue)
AttributesList.member = Shapes::ShapeRef.new(shape: Attribute)
Channels.member = Shapes::ShapeRef.new(shape: Channel)
ChatMessage.add_member(:content_type, Shapes::ShapeRef.new(shape: ChatContentType, required: true, location_name: "ContentType"))
ChatMessage.add_member(:content, Shapes::ShapeRef.new(shape: ChatContent, required: true, location_name: "Content"))
ChatMessage.struct_class = Types::ChatMessage
ContactFlow.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
ContactFlow.add_member(:id, Shapes::ShapeRef.new(shape: ContactFlowId, location_name: "Id"))
ContactFlow.add_member(:name, Shapes::ShapeRef.new(shape: ContactFlowName, location_name: "Name"))
ContactFlow.add_member(:type, Shapes::ShapeRef.new(shape: ContactFlowType, location_name: "Type"))
ContactFlow.add_member(:description, Shapes::ShapeRef.new(shape: ContactFlowDescription, location_name: "Description"))
ContactFlow.add_member(:content, Shapes::ShapeRef.new(shape: ContactFlowContent, location_name: "Content"))
ContactFlow.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
ContactFlow.struct_class = Types::ContactFlow
ContactFlowNotPublishedException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ContactFlowNotPublishedException.struct_class = Types::ContactFlowNotPublishedException
ContactFlowSummary.add_member(:id, Shapes::ShapeRef.new(shape: ContactFlowId, location_name: "Id"))
ContactFlowSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
ContactFlowSummary.add_member(:name, Shapes::ShapeRef.new(shape: ContactFlowName, location_name: "Name"))
ContactFlowSummary.add_member(:contact_flow_type, Shapes::ShapeRef.new(shape: ContactFlowType, location_name: "ContactFlowType"))
ContactFlowSummary.struct_class = Types::ContactFlowSummary
ContactFlowSummaryList.member = Shapes::ShapeRef.new(shape: ContactFlowSummary)
ContactFlowTypes.member = Shapes::ShapeRef.new(shape: ContactFlowType)
ContactNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ContactNotFoundException.struct_class = Types::ContactNotFoundException
ContactReferences.key = Shapes::ShapeRef.new(shape: ReferenceKey)
ContactReferences.value = Shapes::ShapeRef.new(shape: Reference)
CreateAgentStatusRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateAgentStatusRequest.add_member(:name, Shapes::ShapeRef.new(shape: AgentStatusName, required: true, location_name: "Name"))
CreateAgentStatusRequest.add_member(:description, Shapes::ShapeRef.new(shape: AgentStatusDescription, location_name: "Description"))
CreateAgentStatusRequest.add_member(:state, Shapes::ShapeRef.new(shape: AgentStatusState, required: true, location_name: "State"))
CreateAgentStatusRequest.add_member(:display_order, Shapes::ShapeRef.new(shape: AgentStatusOrderNumber, location_name: "DisplayOrder", metadata: {"box"=>true}))
CreateAgentStatusRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateAgentStatusRequest.struct_class = Types::CreateAgentStatusRequest
CreateAgentStatusResponse.add_member(:agent_status_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "AgentStatusARN"))
CreateAgentStatusResponse.add_member(:agent_status_id, Shapes::ShapeRef.new(shape: AgentStatusId, location_name: "AgentStatusId"))
CreateAgentStatusResponse.struct_class = Types::CreateAgentStatusResponse
CreateContactFlowRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateContactFlowRequest.add_member(:name, Shapes::ShapeRef.new(shape: ContactFlowName, required: true, location_name: "Name"))
CreateContactFlowRequest.add_member(:type, Shapes::ShapeRef.new(shape: ContactFlowType, required: true, location_name: "Type"))
CreateContactFlowRequest.add_member(:description, Shapes::ShapeRef.new(shape: ContactFlowDescription, location_name: "Description"))
CreateContactFlowRequest.add_member(:content, Shapes::ShapeRef.new(shape: ContactFlowContent, required: true, location_name: "Content"))
CreateContactFlowRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateContactFlowRequest.struct_class = Types::CreateContactFlowRequest
CreateContactFlowResponse.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, location_name: "ContactFlowId"))
CreateContactFlowResponse.add_member(:contact_flow_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "ContactFlowArn"))
CreateContactFlowResponse.struct_class = Types::CreateContactFlowResponse
CreateHoursOfOperationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateHoursOfOperationRequest.add_member(:name, Shapes::ShapeRef.new(shape: CommonNameLength127, required: true, location_name: "Name"))
CreateHoursOfOperationRequest.add_member(:description, Shapes::ShapeRef.new(shape: HoursOfOperationDescription, location_name: "Description"))
CreateHoursOfOperationRequest.add_member(:time_zone, Shapes::ShapeRef.new(shape: TimeZone, required: true, location_name: "TimeZone"))
CreateHoursOfOperationRequest.add_member(:config, Shapes::ShapeRef.new(shape: HoursOfOperationConfigList, required: true, location_name: "Config"))
CreateHoursOfOperationRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateHoursOfOperationRequest.struct_class = Types::CreateHoursOfOperationRequest
CreateHoursOfOperationResponse.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, location_name: "HoursOfOperationId"))
CreateHoursOfOperationResponse.add_member(:hours_of_operation_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "HoursOfOperationArn"))
CreateHoursOfOperationResponse.struct_class = Types::CreateHoursOfOperationResponse
CreateInstanceRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken"))
CreateInstanceRequest.add_member(:identity_management_type, Shapes::ShapeRef.new(shape: DirectoryType, required: true, location_name: "IdentityManagementType"))
CreateInstanceRequest.add_member(:instance_alias, Shapes::ShapeRef.new(shape: DirectoryAlias, location_name: "InstanceAlias"))
CreateInstanceRequest.add_member(:directory_id, Shapes::ShapeRef.new(shape: DirectoryId, location_name: "DirectoryId"))
CreateInstanceRequest.add_member(:inbound_calls_enabled, Shapes::ShapeRef.new(shape: InboundCallsEnabled, required: true, location_name: "InboundCallsEnabled"))
CreateInstanceRequest.add_member(:outbound_calls_enabled, Shapes::ShapeRef.new(shape: OutboundCallsEnabled, required: true, location_name: "OutboundCallsEnabled"))
CreateInstanceRequest.struct_class = Types::CreateInstanceRequest
CreateInstanceResponse.add_member(:id, Shapes::ShapeRef.new(shape: InstanceId, location_name: "Id"))
CreateInstanceResponse.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
CreateInstanceResponse.struct_class = Types::CreateInstanceResponse
CreateIntegrationAssociationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateIntegrationAssociationRequest.add_member(:integration_type, Shapes::ShapeRef.new(shape: IntegrationType, required: true, location_name: "IntegrationType"))
CreateIntegrationAssociationRequest.add_member(:integration_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location_name: "IntegrationArn"))
CreateIntegrationAssociationRequest.add_member(:source_application_url, Shapes::ShapeRef.new(shape: URI, required: true, location_name: "SourceApplicationUrl"))
CreateIntegrationAssociationRequest.add_member(:source_application_name, Shapes::ShapeRef.new(shape: SourceApplicationName, required: true, location_name: "SourceApplicationName"))
CreateIntegrationAssociationRequest.add_member(:source_type, Shapes::ShapeRef.new(shape: SourceType, required: true, location_name: "SourceType"))
CreateIntegrationAssociationRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateIntegrationAssociationRequest.struct_class = Types::CreateIntegrationAssociationRequest
CreateIntegrationAssociationResponse.add_member(:integration_association_id, Shapes::ShapeRef.new(shape: IntegrationAssociationId, location_name: "IntegrationAssociationId"))
CreateIntegrationAssociationResponse.add_member(:integration_association_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "IntegrationAssociationArn"))
CreateIntegrationAssociationResponse.struct_class = Types::CreateIntegrationAssociationResponse
CreateQueueRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateQueueRequest.add_member(:name, Shapes::ShapeRef.new(shape: CommonNameLength127, required: true, location_name: "Name"))
CreateQueueRequest.add_member(:description, Shapes::ShapeRef.new(shape: QueueDescription, location_name: "Description"))
CreateQueueRequest.add_member(:outbound_caller_config, Shapes::ShapeRef.new(shape: OutboundCallerConfig, location_name: "OutboundCallerConfig"))
CreateQueueRequest.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, required: true, location_name: "HoursOfOperationId"))
CreateQueueRequest.add_member(:max_contacts, Shapes::ShapeRef.new(shape: QueueMaxContacts, location_name: "MaxContacts", metadata: {"box"=>true}))
CreateQueueRequest.add_member(:quick_connect_ids, Shapes::ShapeRef.new(shape: QuickConnectsList, location_name: "QuickConnectIds"))
CreateQueueRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateQueueRequest.struct_class = Types::CreateQueueRequest
CreateQueueResponse.add_member(:queue_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "QueueArn"))
CreateQueueResponse.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, location_name: "QueueId"))
CreateQueueResponse.struct_class = Types::CreateQueueResponse
CreateQuickConnectRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateQuickConnectRequest.add_member(:name, Shapes::ShapeRef.new(shape: QuickConnectName, required: true, location_name: "Name"))
CreateQuickConnectRequest.add_member(:description, Shapes::ShapeRef.new(shape: QuickConnectDescription, location_name: "Description"))
CreateQuickConnectRequest.add_member(:quick_connect_config, Shapes::ShapeRef.new(shape: QuickConnectConfig, required: true, location_name: "QuickConnectConfig"))
CreateQuickConnectRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateQuickConnectRequest.struct_class = Types::CreateQuickConnectRequest
CreateQuickConnectResponse.add_member(:quick_connect_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "QuickConnectARN"))
CreateQuickConnectResponse.add_member(:quick_connect_id, Shapes::ShapeRef.new(shape: QuickConnectId, location_name: "QuickConnectId"))
CreateQuickConnectResponse.struct_class = Types::CreateQuickConnectResponse
CreateRoutingProfileRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateRoutingProfileRequest.add_member(:name, Shapes::ShapeRef.new(shape: RoutingProfileName, required: true, location_name: "Name"))
CreateRoutingProfileRequest.add_member(:description, Shapes::ShapeRef.new(shape: RoutingProfileDescription, required: true, location_name: "Description"))
CreateRoutingProfileRequest.add_member(:default_outbound_queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location_name: "DefaultOutboundQueueId"))
CreateRoutingProfileRequest.add_member(:queue_configs, Shapes::ShapeRef.new(shape: RoutingProfileQueueConfigList, location_name: "QueueConfigs"))
CreateRoutingProfileRequest.add_member(:media_concurrencies, Shapes::ShapeRef.new(shape: MediaConcurrencies, required: true, location_name: "MediaConcurrencies"))
CreateRoutingProfileRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateRoutingProfileRequest.struct_class = Types::CreateRoutingProfileRequest
CreateRoutingProfileResponse.add_member(:routing_profile_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "RoutingProfileArn"))
CreateRoutingProfileResponse.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, location_name: "RoutingProfileId"))
CreateRoutingProfileResponse.struct_class = Types::CreateRoutingProfileResponse
CreateUseCaseRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateUseCaseRequest.add_member(:integration_association_id, Shapes::ShapeRef.new(shape: IntegrationAssociationId, required: true, location: "uri", location_name: "IntegrationAssociationId"))
CreateUseCaseRequest.add_member(:use_case_type, Shapes::ShapeRef.new(shape: UseCaseType, required: true, location_name: "UseCaseType"))
CreateUseCaseRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateUseCaseRequest.struct_class = Types::CreateUseCaseRequest
CreateUseCaseResponse.add_member(:use_case_id, Shapes::ShapeRef.new(shape: UseCaseId, location_name: "UseCaseId"))
CreateUseCaseResponse.add_member(:use_case_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "UseCaseArn"))
CreateUseCaseResponse.struct_class = Types::CreateUseCaseResponse
CreateUserHierarchyGroupRequest.add_member(:name, Shapes::ShapeRef.new(shape: HierarchyGroupName, required: true, location_name: "Name"))
CreateUserHierarchyGroupRequest.add_member(:parent_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "ParentGroupId"))
CreateUserHierarchyGroupRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateUserHierarchyGroupRequest.struct_class = Types::CreateUserHierarchyGroupRequest
CreateUserHierarchyGroupResponse.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "HierarchyGroupId"))
CreateUserHierarchyGroupResponse.add_member(:hierarchy_group_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "HierarchyGroupArn"))
CreateUserHierarchyGroupResponse.struct_class = Types::CreateUserHierarchyGroupResponse
CreateUserRequest.add_member(:username, Shapes::ShapeRef.new(shape: AgentUsername, required: true, location_name: "Username"))
CreateUserRequest.add_member(:password, Shapes::ShapeRef.new(shape: Password, location_name: "Password"))
CreateUserRequest.add_member(:identity_info, Shapes::ShapeRef.new(shape: UserIdentityInfo, location_name: "IdentityInfo"))
CreateUserRequest.add_member(:phone_config, Shapes::ShapeRef.new(shape: UserPhoneConfig, required: true, location_name: "PhoneConfig"))
CreateUserRequest.add_member(:directory_user_id, Shapes::ShapeRef.new(shape: DirectoryUserId, location_name: "DirectoryUserId"))
CreateUserRequest.add_member(:security_profile_ids, Shapes::ShapeRef.new(shape: SecurityProfileIds, required: true, location_name: "SecurityProfileIds"))
CreateUserRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location_name: "RoutingProfileId"))
CreateUserRequest.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "HierarchyGroupId"))
CreateUserRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
CreateUserRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
CreateUserRequest.struct_class = Types::CreateUserRequest
CreateUserResponse.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, location_name: "UserId"))
CreateUserResponse.add_member(:user_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "UserArn"))
CreateUserResponse.struct_class = Types::CreateUserResponse
Credentials.add_member(:access_token, Shapes::ShapeRef.new(shape: SecurityToken, location_name: "AccessToken"))
Credentials.add_member(:access_token_expiration, Shapes::ShapeRef.new(shape: timestamp, location_name: "AccessTokenExpiration"))
Credentials.add_member(:refresh_token, Shapes::ShapeRef.new(shape: SecurityToken, location_name: "RefreshToken"))
Credentials.add_member(:refresh_token_expiration, Shapes::ShapeRef.new(shape: timestamp, location_name: "RefreshTokenExpiration"))
Credentials.struct_class = Types::Credentials
CurrentMetric.add_member(:name, Shapes::ShapeRef.new(shape: CurrentMetricName, location_name: "Name"))
CurrentMetric.add_member(:unit, Shapes::ShapeRef.new(shape: Unit, location_name: "Unit"))
CurrentMetric.struct_class = Types::CurrentMetric
CurrentMetricData.add_member(:metric, Shapes::ShapeRef.new(shape: CurrentMetric, location_name: "Metric"))
CurrentMetricData.add_member(:value, Shapes::ShapeRef.new(shape: Value, location_name: "Value", metadata: {"box"=>true}))
CurrentMetricData.struct_class = Types::CurrentMetricData
CurrentMetricDataCollections.member = Shapes::ShapeRef.new(shape: CurrentMetricData)
CurrentMetricResult.add_member(:dimensions, Shapes::ShapeRef.new(shape: Dimensions, location_name: "Dimensions"))
CurrentMetricResult.add_member(:collections, Shapes::ShapeRef.new(shape: CurrentMetricDataCollections, location_name: "Collections"))
CurrentMetricResult.struct_class = Types::CurrentMetricResult
CurrentMetricResults.member = Shapes::ShapeRef.new(shape: CurrentMetricResult)
CurrentMetrics.member = Shapes::ShapeRef.new(shape: CurrentMetric)
DeleteHoursOfOperationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteHoursOfOperationRequest.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, required: true, location: "uri", location_name: "HoursOfOperationId"))
DeleteHoursOfOperationRequest.struct_class = Types::DeleteHoursOfOperationRequest
DeleteInstanceRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteInstanceRequest.struct_class = Types::DeleteInstanceRequest
DeleteIntegrationAssociationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteIntegrationAssociationRequest.add_member(:integration_association_id, Shapes::ShapeRef.new(shape: IntegrationAssociationId, required: true, location: "uri", location_name: "IntegrationAssociationId"))
DeleteIntegrationAssociationRequest.struct_class = Types::DeleteIntegrationAssociationRequest
DeleteQuickConnectRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteQuickConnectRequest.add_member(:quick_connect_id, Shapes::ShapeRef.new(shape: QuickConnectId, required: true, location: "uri", location_name: "QuickConnectId"))
DeleteQuickConnectRequest.struct_class = Types::DeleteQuickConnectRequest
DeleteUseCaseRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteUseCaseRequest.add_member(:integration_association_id, Shapes::ShapeRef.new(shape: IntegrationAssociationId, required: true, location: "uri", location_name: "IntegrationAssociationId"))
DeleteUseCaseRequest.add_member(:use_case_id, Shapes::ShapeRef.new(shape: UseCaseId, required: true, location: "uri", location_name: "UseCaseId"))
DeleteUseCaseRequest.struct_class = Types::DeleteUseCaseRequest
DeleteUserHierarchyGroupRequest.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, required: true, location: "uri", location_name: "HierarchyGroupId"))
DeleteUserHierarchyGroupRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteUserHierarchyGroupRequest.struct_class = Types::DeleteUserHierarchyGroupRequest
DeleteUserRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DeleteUserRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
DeleteUserRequest.struct_class = Types::DeleteUserRequest
DescribeAgentStatusRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeAgentStatusRequest.add_member(:agent_status_id, Shapes::ShapeRef.new(shape: AgentStatusId, required: true, location: "uri", location_name: "AgentStatusId"))
DescribeAgentStatusRequest.struct_class = Types::DescribeAgentStatusRequest
DescribeAgentStatusResponse.add_member(:agent_status, Shapes::ShapeRef.new(shape: AgentStatus, location_name: "AgentStatus"))
DescribeAgentStatusResponse.struct_class = Types::DescribeAgentStatusResponse
DescribeContactFlowRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeContactFlowRequest.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location: "uri", location_name: "ContactFlowId"))
DescribeContactFlowRequest.struct_class = Types::DescribeContactFlowRequest
DescribeContactFlowResponse.add_member(:contact_flow, Shapes::ShapeRef.new(shape: ContactFlow, location_name: "ContactFlow"))
DescribeContactFlowResponse.struct_class = Types::DescribeContactFlowResponse
DescribeHoursOfOperationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeHoursOfOperationRequest.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, required: true, location: "uri", location_name: "HoursOfOperationId"))
DescribeHoursOfOperationRequest.struct_class = Types::DescribeHoursOfOperationRequest
DescribeHoursOfOperationResponse.add_member(:hours_of_operation, Shapes::ShapeRef.new(shape: HoursOfOperation, location_name: "HoursOfOperation"))
DescribeHoursOfOperationResponse.struct_class = Types::DescribeHoursOfOperationResponse
DescribeInstanceAttributeRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeInstanceAttributeRequest.add_member(:attribute_type, Shapes::ShapeRef.new(shape: InstanceAttributeType, required: true, location: "uri", location_name: "AttributeType"))
DescribeInstanceAttributeRequest.struct_class = Types::DescribeInstanceAttributeRequest
DescribeInstanceAttributeResponse.add_member(:attribute, Shapes::ShapeRef.new(shape: Attribute, location_name: "Attribute"))
DescribeInstanceAttributeResponse.struct_class = Types::DescribeInstanceAttributeResponse
DescribeInstanceRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeInstanceRequest.struct_class = Types::DescribeInstanceRequest
DescribeInstanceResponse.add_member(:instance, Shapes::ShapeRef.new(shape: Instance, location_name: "Instance"))
DescribeInstanceResponse.struct_class = Types::DescribeInstanceResponse
DescribeInstanceStorageConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeInstanceStorageConfigRequest.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, required: true, location: "uri", location_name: "AssociationId"))
DescribeInstanceStorageConfigRequest.add_member(:resource_type, Shapes::ShapeRef.new(shape: InstanceStorageResourceType, required: true, location: "querystring", location_name: "resourceType"))
DescribeInstanceStorageConfigRequest.struct_class = Types::DescribeInstanceStorageConfigRequest
DescribeInstanceStorageConfigResponse.add_member(:storage_config, Shapes::ShapeRef.new(shape: InstanceStorageConfig, location_name: "StorageConfig"))
DescribeInstanceStorageConfigResponse.struct_class = Types::DescribeInstanceStorageConfigResponse
DescribeQueueRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeQueueRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
DescribeQueueRequest.struct_class = Types::DescribeQueueRequest
DescribeQueueResponse.add_member(:queue, Shapes::ShapeRef.new(shape: Queue, location_name: "Queue"))
DescribeQueueResponse.struct_class = Types::DescribeQueueResponse
DescribeQuickConnectRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeQuickConnectRequest.add_member(:quick_connect_id, Shapes::ShapeRef.new(shape: QuickConnectId, required: true, location: "uri", location_name: "QuickConnectId"))
DescribeQuickConnectRequest.struct_class = Types::DescribeQuickConnectRequest
DescribeQuickConnectResponse.add_member(:quick_connect, Shapes::ShapeRef.new(shape: QuickConnect, location_name: "QuickConnect"))
DescribeQuickConnectResponse.struct_class = Types::DescribeQuickConnectResponse
DescribeRoutingProfileRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeRoutingProfileRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
DescribeRoutingProfileRequest.struct_class = Types::DescribeRoutingProfileRequest
DescribeRoutingProfileResponse.add_member(:routing_profile, Shapes::ShapeRef.new(shape: RoutingProfile, location_name: "RoutingProfile"))
DescribeRoutingProfileResponse.struct_class = Types::DescribeRoutingProfileResponse
DescribeUserHierarchyGroupRequest.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, required: true, location: "uri", location_name: "HierarchyGroupId"))
DescribeUserHierarchyGroupRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeUserHierarchyGroupRequest.struct_class = Types::DescribeUserHierarchyGroupRequest
DescribeUserHierarchyGroupResponse.add_member(:hierarchy_group, Shapes::ShapeRef.new(shape: HierarchyGroup, location_name: "HierarchyGroup"))
DescribeUserHierarchyGroupResponse.struct_class = Types::DescribeUserHierarchyGroupResponse
DescribeUserHierarchyStructureRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeUserHierarchyStructureRequest.struct_class = Types::DescribeUserHierarchyStructureRequest
DescribeUserHierarchyStructureResponse.add_member(:hierarchy_structure, Shapes::ShapeRef.new(shape: HierarchyStructure, location_name: "HierarchyStructure"))
DescribeUserHierarchyStructureResponse.struct_class = Types::DescribeUserHierarchyStructureResponse
DescribeUserRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
DescribeUserRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DescribeUserRequest.struct_class = Types::DescribeUserRequest
DescribeUserResponse.add_member(:user, Shapes::ShapeRef.new(shape: User, location_name: "User"))
DescribeUserResponse.struct_class = Types::DescribeUserResponse
DestinationNotAllowedException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
DestinationNotAllowedException.struct_class = Types::DestinationNotAllowedException
Dimensions.add_member(:queue, Shapes::ShapeRef.new(shape: QueueReference, location_name: "Queue"))
Dimensions.add_member(:channel, Shapes::ShapeRef.new(shape: Channel, location_name: "Channel"))
Dimensions.struct_class = Types::Dimensions
DisassociateApprovedOriginRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateApprovedOriginRequest.add_member(:origin, Shapes::ShapeRef.new(shape: Origin, required: true, location: "querystring", location_name: "origin"))
DisassociateApprovedOriginRequest.struct_class = Types::DisassociateApprovedOriginRequest
DisassociateBotRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateBotRequest.add_member(:lex_bot, Shapes::ShapeRef.new(shape: LexBot, location_name: "LexBot"))
DisassociateBotRequest.add_member(:lex_v2_bot, Shapes::ShapeRef.new(shape: LexV2Bot, location_name: "LexV2Bot"))
DisassociateBotRequest.struct_class = Types::DisassociateBotRequest
DisassociateInstanceStorageConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateInstanceStorageConfigRequest.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, required: true, location: "uri", location_name: "AssociationId"))
DisassociateInstanceStorageConfigRequest.add_member(:resource_type, Shapes::ShapeRef.new(shape: InstanceStorageResourceType, required: true, location: "querystring", location_name: "resourceType"))
DisassociateInstanceStorageConfigRequest.struct_class = Types::DisassociateInstanceStorageConfigRequest
DisassociateLambdaFunctionRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateLambdaFunctionRequest.add_member(:function_arn, Shapes::ShapeRef.new(shape: FunctionArn, required: true, location: "querystring", location_name: "functionArn"))
DisassociateLambdaFunctionRequest.struct_class = Types::DisassociateLambdaFunctionRequest
DisassociateLexBotRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateLexBotRequest.add_member(:bot_name, Shapes::ShapeRef.new(shape: BotName, required: true, location: "querystring", location_name: "botName"))
DisassociateLexBotRequest.add_member(:lex_region, Shapes::ShapeRef.new(shape: LexRegion, required: true, location: "querystring", location_name: "lexRegion"))
DisassociateLexBotRequest.struct_class = Types::DisassociateLexBotRequest
DisassociateQueueQuickConnectsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateQueueQuickConnectsRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
DisassociateQueueQuickConnectsRequest.add_member(:quick_connect_ids, Shapes::ShapeRef.new(shape: QuickConnectsList, required: true, location_name: "QuickConnectIds"))
DisassociateQueueQuickConnectsRequest.struct_class = Types::DisassociateQueueQuickConnectsRequest
DisassociateRoutingProfileQueuesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateRoutingProfileQueuesRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
DisassociateRoutingProfileQueuesRequest.add_member(:queue_references, Shapes::ShapeRef.new(shape: RoutingProfileQueueReferenceList, required: true, location_name: "QueueReferences"))
DisassociateRoutingProfileQueuesRequest.struct_class = Types::DisassociateRoutingProfileQueuesRequest
DisassociateSecurityKeyRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
DisassociateSecurityKeyRequest.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, required: true, location: "uri", location_name: "AssociationId"))
DisassociateSecurityKeyRequest.struct_class = Types::DisassociateSecurityKeyRequest
DuplicateResourceException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
DuplicateResourceException.struct_class = Types::DuplicateResourceException
EncryptionConfig.add_member(:encryption_type, Shapes::ShapeRef.new(shape: EncryptionType, required: true, location_name: "EncryptionType"))
EncryptionConfig.add_member(:key_id, Shapes::ShapeRef.new(shape: KeyId, required: true, location_name: "KeyId"))
EncryptionConfig.struct_class = Types::EncryptionConfig
Filters.add_member(:queues, Shapes::ShapeRef.new(shape: Queues, location_name: "Queues"))
Filters.add_member(:channels, Shapes::ShapeRef.new(shape: Channels, location_name: "Channels"))
Filters.struct_class = Types::Filters
FunctionArnsList.member = Shapes::ShapeRef.new(shape: FunctionArn)
GetContactAttributesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
GetContactAttributesRequest.add_member(:initial_contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location: "uri", location_name: "InitialContactId"))
GetContactAttributesRequest.struct_class = Types::GetContactAttributesRequest
GetContactAttributesResponse.add_member(:attributes, Shapes::ShapeRef.new(shape: Attributes, location_name: "Attributes"))
GetContactAttributesResponse.struct_class = Types::GetContactAttributesResponse
GetCurrentMetricDataRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
GetCurrentMetricDataRequest.add_member(:filters, Shapes::ShapeRef.new(shape: Filters, required: true, location_name: "Filters"))
GetCurrentMetricDataRequest.add_member(:groupings, Shapes::ShapeRef.new(shape: Groupings, location_name: "Groupings"))
GetCurrentMetricDataRequest.add_member(:current_metrics, Shapes::ShapeRef.new(shape: CurrentMetrics, required: true, location_name: "CurrentMetrics"))
GetCurrentMetricDataRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
GetCurrentMetricDataRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult100, location_name: "MaxResults", metadata: {"box"=>true}))
GetCurrentMetricDataRequest.struct_class = Types::GetCurrentMetricDataRequest
GetCurrentMetricDataResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
GetCurrentMetricDataResponse.add_member(:metric_results, Shapes::ShapeRef.new(shape: CurrentMetricResults, location_name: "MetricResults"))
GetCurrentMetricDataResponse.add_member(:data_snapshot_time, Shapes::ShapeRef.new(shape: timestamp, location_name: "DataSnapshotTime"))
GetCurrentMetricDataResponse.struct_class = Types::GetCurrentMetricDataResponse
GetFederationTokenRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
GetFederationTokenRequest.struct_class = Types::GetFederationTokenRequest
GetFederationTokenResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
GetFederationTokenResponse.struct_class = Types::GetFederationTokenResponse
GetMetricDataRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
GetMetricDataRequest.add_member(:start_time, Shapes::ShapeRef.new(shape: timestamp, required: true, location_name: "StartTime"))
GetMetricDataRequest.add_member(:end_time, Shapes::ShapeRef.new(shape: timestamp, required: true, location_name: "EndTime"))
GetMetricDataRequest.add_member(:filters, Shapes::ShapeRef.new(shape: Filters, required: true, location_name: "Filters"))
GetMetricDataRequest.add_member(:groupings, Shapes::ShapeRef.new(shape: Groupings, location_name: "Groupings"))
GetMetricDataRequest.add_member(:historical_metrics, Shapes::ShapeRef.new(shape: HistoricalMetrics, required: true, location_name: "HistoricalMetrics"))
GetMetricDataRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
GetMetricDataRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult100, location_name: "MaxResults", metadata: {"box"=>true}))
GetMetricDataRequest.struct_class = Types::GetMetricDataRequest
GetMetricDataResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
GetMetricDataResponse.add_member(:metric_results, Shapes::ShapeRef.new(shape: HistoricalMetricResults, location_name: "MetricResults"))
GetMetricDataResponse.struct_class = Types::GetMetricDataResponse
Groupings.member = Shapes::ShapeRef.new(shape: Grouping)
HierarchyGroup.add_member(:id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "Id"))
HierarchyGroup.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
HierarchyGroup.add_member(:name, Shapes::ShapeRef.new(shape: HierarchyGroupName, location_name: "Name"))
HierarchyGroup.add_member(:level_id, Shapes::ShapeRef.new(shape: HierarchyLevelId, location_name: "LevelId"))
HierarchyGroup.add_member(:hierarchy_path, Shapes::ShapeRef.new(shape: HierarchyPath, location_name: "HierarchyPath"))
HierarchyGroup.struct_class = Types::HierarchyGroup
HierarchyGroupSummary.add_member(:id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "Id"))
HierarchyGroupSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
HierarchyGroupSummary.add_member(:name, Shapes::ShapeRef.new(shape: HierarchyGroupName, location_name: "Name"))
HierarchyGroupSummary.struct_class = Types::HierarchyGroupSummary
HierarchyGroupSummaryList.member = Shapes::ShapeRef.new(shape: HierarchyGroupSummary)
HierarchyLevel.add_member(:id, Shapes::ShapeRef.new(shape: HierarchyLevelId, location_name: "Id"))
HierarchyLevel.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
HierarchyLevel.add_member(:name, Shapes::ShapeRef.new(shape: HierarchyLevelName, location_name: "Name"))
HierarchyLevel.struct_class = Types::HierarchyLevel
HierarchyLevelUpdate.add_member(:name, Shapes::ShapeRef.new(shape: HierarchyLevelName, required: true, location_name: "Name"))
HierarchyLevelUpdate.struct_class = Types::HierarchyLevelUpdate
HierarchyPath.add_member(:level_one, Shapes::ShapeRef.new(shape: HierarchyGroupSummary, location_name: "LevelOne"))
HierarchyPath.add_member(:level_two, Shapes::ShapeRef.new(shape: HierarchyGroupSummary, location_name: "LevelTwo"))
HierarchyPath.add_member(:level_three, Shapes::ShapeRef.new(shape: HierarchyGroupSummary, location_name: "LevelThree"))
HierarchyPath.add_member(:level_four, Shapes::ShapeRef.new(shape: HierarchyGroupSummary, location_name: "LevelFour"))
HierarchyPath.add_member(:level_five, Shapes::ShapeRef.new(shape: HierarchyGroupSummary, location_name: "LevelFive"))
HierarchyPath.struct_class = Types::HierarchyPath
HierarchyStructure.add_member(:level_one, Shapes::ShapeRef.new(shape: HierarchyLevel, location_name: "LevelOne"))
HierarchyStructure.add_member(:level_two, Shapes::ShapeRef.new(shape: HierarchyLevel, location_name: "LevelTwo"))
HierarchyStructure.add_member(:level_three, Shapes::ShapeRef.new(shape: HierarchyLevel, location_name: "LevelThree"))
HierarchyStructure.add_member(:level_four, Shapes::ShapeRef.new(shape: HierarchyLevel, location_name: "LevelFour"))
HierarchyStructure.add_member(:level_five, Shapes::ShapeRef.new(shape: HierarchyLevel, location_name: "LevelFive"))
HierarchyStructure.struct_class = Types::HierarchyStructure
HierarchyStructureUpdate.add_member(:level_one, Shapes::ShapeRef.new(shape: HierarchyLevelUpdate, location_name: "LevelOne"))
HierarchyStructureUpdate.add_member(:level_two, Shapes::ShapeRef.new(shape: HierarchyLevelUpdate, location_name: "LevelTwo"))
HierarchyStructureUpdate.add_member(:level_three, Shapes::ShapeRef.new(shape: HierarchyLevelUpdate, location_name: "LevelThree"))
HierarchyStructureUpdate.add_member(:level_four, Shapes::ShapeRef.new(shape: HierarchyLevelUpdate, location_name: "LevelFour"))
HierarchyStructureUpdate.add_member(:level_five, Shapes::ShapeRef.new(shape: HierarchyLevelUpdate, location_name: "LevelFive"))
HierarchyStructureUpdate.struct_class = Types::HierarchyStructureUpdate
HistoricalMetric.add_member(:name, Shapes::ShapeRef.new(shape: HistoricalMetricName, location_name: "Name"))
HistoricalMetric.add_member(:threshold, Shapes::ShapeRef.new(shape: Threshold, location_name: "Threshold", metadata: {"box"=>true}))
HistoricalMetric.add_member(:statistic, Shapes::ShapeRef.new(shape: Statistic, location_name: "Statistic"))
HistoricalMetric.add_member(:unit, Shapes::ShapeRef.new(shape: Unit, location_name: "Unit"))
HistoricalMetric.struct_class = Types::HistoricalMetric
HistoricalMetricData.add_member(:metric, Shapes::ShapeRef.new(shape: HistoricalMetric, location_name: "Metric"))
HistoricalMetricData.add_member(:value, Shapes::ShapeRef.new(shape: Value, location_name: "Value", metadata: {"box"=>true}))
HistoricalMetricData.struct_class = Types::HistoricalMetricData
HistoricalMetricDataCollections.member = Shapes::ShapeRef.new(shape: HistoricalMetricData)
HistoricalMetricResult.add_member(:dimensions, Shapes::ShapeRef.new(shape: Dimensions, location_name: "Dimensions"))
HistoricalMetricResult.add_member(:collections, Shapes::ShapeRef.new(shape: HistoricalMetricDataCollections, location_name: "Collections"))
HistoricalMetricResult.struct_class = Types::HistoricalMetricResult
HistoricalMetricResults.member = Shapes::ShapeRef.new(shape: HistoricalMetricResult)
HistoricalMetrics.member = Shapes::ShapeRef.new(shape: HistoricalMetric)
HoursOfOperation.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, location_name: "HoursOfOperationId"))
HoursOfOperation.add_member(:hours_of_operation_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "HoursOfOperationArn"))
HoursOfOperation.add_member(:name, Shapes::ShapeRef.new(shape: CommonNameLength127, location_name: "Name"))
HoursOfOperation.add_member(:description, Shapes::ShapeRef.new(shape: HoursOfOperationDescription, location_name: "Description"))
HoursOfOperation.add_member(:time_zone, Shapes::ShapeRef.new(shape: TimeZone, location_name: "TimeZone"))
HoursOfOperation.add_member(:config, Shapes::ShapeRef.new(shape: HoursOfOperationConfigList, location_name: "Config"))
HoursOfOperation.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
HoursOfOperation.struct_class = Types::HoursOfOperation
HoursOfOperationConfig.add_member(:day, Shapes::ShapeRef.new(shape: HoursOfOperationDays, required: true, location_name: "Day"))
HoursOfOperationConfig.add_member(:start_time, Shapes::ShapeRef.new(shape: HoursOfOperationTimeSlice, required: true, location_name: "StartTime"))
HoursOfOperationConfig.add_member(:end_time, Shapes::ShapeRef.new(shape: HoursOfOperationTimeSlice, required: true, location_name: "EndTime"))
HoursOfOperationConfig.struct_class = Types::HoursOfOperationConfig
HoursOfOperationConfigList.member = Shapes::ShapeRef.new(shape: HoursOfOperationConfig)
HoursOfOperationSummary.add_member(:id, Shapes::ShapeRef.new(shape: HoursOfOperationId, location_name: "Id"))
HoursOfOperationSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
HoursOfOperationSummary.add_member(:name, Shapes::ShapeRef.new(shape: HoursOfOperationName, location_name: "Name"))
HoursOfOperationSummary.struct_class = Types::HoursOfOperationSummary
HoursOfOperationSummaryList.member = Shapes::ShapeRef.new(shape: HoursOfOperationSummary)
HoursOfOperationTimeSlice.add_member(:hours, Shapes::ShapeRef.new(shape: Hours24Format, required: true, location_name: "Hours", metadata: {"box"=>true}))
HoursOfOperationTimeSlice.add_member(:minutes, Shapes::ShapeRef.new(shape: MinutesLimit60, required: true, location_name: "Minutes", metadata: {"box"=>true}))
HoursOfOperationTimeSlice.struct_class = Types::HoursOfOperationTimeSlice
Instance.add_member(:id, Shapes::ShapeRef.new(shape: InstanceId, location_name: "Id"))
Instance.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
Instance.add_member(:identity_management_type, Shapes::ShapeRef.new(shape: DirectoryType, location_name: "IdentityManagementType"))
Instance.add_member(:instance_alias, Shapes::ShapeRef.new(shape: DirectoryAlias, location_name: "InstanceAlias"))
Instance.add_member(:created_time, Shapes::ShapeRef.new(shape: Timestamp, location_name: "CreatedTime"))
Instance.add_member(:service_role, Shapes::ShapeRef.new(shape: ARN, location_name: "ServiceRole"))
Instance.add_member(:instance_status, Shapes::ShapeRef.new(shape: InstanceStatus, location_name: "InstanceStatus"))
Instance.add_member(:status_reason, Shapes::ShapeRef.new(shape: InstanceStatusReason, location_name: "StatusReason"))
Instance.add_member(:inbound_calls_enabled, Shapes::ShapeRef.new(shape: InboundCallsEnabled, location_name: "InboundCallsEnabled"))
Instance.add_member(:outbound_calls_enabled, Shapes::ShapeRef.new(shape: OutboundCallsEnabled, location_name: "OutboundCallsEnabled"))
Instance.struct_class = Types::Instance
InstanceStatusReason.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
InstanceStatusReason.struct_class = Types::InstanceStatusReason
InstanceStorageConfig.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, location_name: "AssociationId"))
InstanceStorageConfig.add_member(:storage_type, Shapes::ShapeRef.new(shape: StorageType, required: true, location_name: "StorageType"))
InstanceStorageConfig.add_member(:s3_config, Shapes::ShapeRef.new(shape: S3Config, location_name: "S3Config"))
InstanceStorageConfig.add_member(:kinesis_video_stream_config, Shapes::ShapeRef.new(shape: KinesisVideoStreamConfig, location_name: "KinesisVideoStreamConfig"))
InstanceStorageConfig.add_member(:kinesis_stream_config, Shapes::ShapeRef.new(shape: KinesisStreamConfig, location_name: "KinesisStreamConfig"))
InstanceStorageConfig.add_member(:kinesis_firehose_config, Shapes::ShapeRef.new(shape: KinesisFirehoseConfig, location_name: "KinesisFirehoseConfig"))
InstanceStorageConfig.struct_class = Types::InstanceStorageConfig
InstanceStorageConfigs.member = Shapes::ShapeRef.new(shape: InstanceStorageConfig)
InstanceSummary.add_member(:id, Shapes::ShapeRef.new(shape: InstanceId, location_name: "Id"))
InstanceSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
InstanceSummary.add_member(:identity_management_type, Shapes::ShapeRef.new(shape: DirectoryType, location_name: "IdentityManagementType"))
InstanceSummary.add_member(:instance_alias, Shapes::ShapeRef.new(shape: DirectoryAlias, location_name: "InstanceAlias"))
InstanceSummary.add_member(:created_time, Shapes::ShapeRef.new(shape: Timestamp, location_name: "CreatedTime"))
InstanceSummary.add_member(:service_role, Shapes::ShapeRef.new(shape: ARN, location_name: "ServiceRole"))
InstanceSummary.add_member(:instance_status, Shapes::ShapeRef.new(shape: InstanceStatus, location_name: "InstanceStatus"))
InstanceSummary.add_member(:inbound_calls_enabled, Shapes::ShapeRef.new(shape: InboundCallsEnabled, location_name: "InboundCallsEnabled"))
InstanceSummary.add_member(:outbound_calls_enabled, Shapes::ShapeRef.new(shape: OutboundCallsEnabled, location_name: "OutboundCallsEnabled"))
InstanceSummary.struct_class = Types::InstanceSummary
InstanceSummaryList.member = Shapes::ShapeRef.new(shape: InstanceSummary)
IntegrationAssociationSummary.add_member(:integration_association_id, Shapes::ShapeRef.new(shape: IntegrationAssociationId, location_name: "IntegrationAssociationId"))
IntegrationAssociationSummary.add_member(:integration_association_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "IntegrationAssociationArn"))
IntegrationAssociationSummary.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, location_name: "InstanceId"))
IntegrationAssociationSummary.add_member(:integration_type, Shapes::ShapeRef.new(shape: IntegrationType, location_name: "IntegrationType"))
IntegrationAssociationSummary.add_member(:integration_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "IntegrationArn"))
IntegrationAssociationSummary.add_member(:source_application_url, Shapes::ShapeRef.new(shape: URI, location_name: "SourceApplicationUrl"))
IntegrationAssociationSummary.add_member(:source_application_name, Shapes::ShapeRef.new(shape: SourceApplicationName, location_name: "SourceApplicationName"))
IntegrationAssociationSummary.add_member(:source_type, Shapes::ShapeRef.new(shape: SourceType, location_name: "SourceType"))
IntegrationAssociationSummary.struct_class = Types::IntegrationAssociationSummary
IntegrationAssociationSummaryList.member = Shapes::ShapeRef.new(shape: IntegrationAssociationSummary)
InternalServiceException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
InternalServiceException.struct_class = Types::InternalServiceException
InvalidContactFlowException.add_member(:problems, Shapes::ShapeRef.new(shape: Problems, location_name: "problems"))
InvalidContactFlowException.struct_class = Types::InvalidContactFlowException
InvalidParameterException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
InvalidParameterException.struct_class = Types::InvalidParameterException
InvalidRequestException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
InvalidRequestException.struct_class = Types::InvalidRequestException
KinesisFirehoseConfig.add_member(:firehose_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location_name: "FirehoseArn"))
KinesisFirehoseConfig.struct_class = Types::KinesisFirehoseConfig
KinesisStreamConfig.add_member(:stream_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location_name: "StreamArn"))
KinesisStreamConfig.struct_class = Types::KinesisStreamConfig
KinesisVideoStreamConfig.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, required: true, location_name: "Prefix"))
KinesisVideoStreamConfig.add_member(:retention_period_hours, Shapes::ShapeRef.new(shape: Hours, required: true, location_name: "RetentionPeriodHours"))
KinesisVideoStreamConfig.add_member(:encryption_config, Shapes::ShapeRef.new(shape: EncryptionConfig, required: true, location_name: "EncryptionConfig"))
KinesisVideoStreamConfig.struct_class = Types::KinesisVideoStreamConfig
LexBot.add_member(:name, Shapes::ShapeRef.new(shape: BotName, location_name: "Name"))
LexBot.add_member(:lex_region, Shapes::ShapeRef.new(shape: LexRegion, location_name: "LexRegion"))
LexBot.struct_class = Types::LexBot
LexBotConfig.add_member(:lex_bot, Shapes::ShapeRef.new(shape: LexBot, location_name: "LexBot"))
LexBotConfig.add_member(:lex_v2_bot, Shapes::ShapeRef.new(shape: LexV2Bot, location_name: "LexV2Bot"))
LexBotConfig.struct_class = Types::LexBotConfig
LexBotConfigList.member = Shapes::ShapeRef.new(shape: LexBotConfig)
LexBotsList.member = Shapes::ShapeRef.new(shape: LexBot)
LexV2Bot.add_member(:alias_arn, Shapes::ShapeRef.new(shape: AliasArn, location_name: "AliasArn"))
LexV2Bot.struct_class = Types::LexV2Bot
LimitExceededException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
LimitExceededException.struct_class = Types::LimitExceededException
ListAgentStatusRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListAgentStatusRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListAgentStatusRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListAgentStatusRequest.add_member(:agent_status_types, Shapes::ShapeRef.new(shape: AgentStatusTypes, location: "querystring", location_name: "AgentStatusTypes"))
ListAgentStatusRequest.struct_class = Types::ListAgentStatusRequest
ListAgentStatusResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListAgentStatusResponse.add_member(:agent_status_summary_list, Shapes::ShapeRef.new(shape: AgentStatusSummaryList, location_name: "AgentStatusSummaryList"))
ListAgentStatusResponse.struct_class = Types::ListAgentStatusResponse
ListApprovedOriginsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListApprovedOriginsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListApprovedOriginsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult25, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListApprovedOriginsRequest.struct_class = Types::ListApprovedOriginsRequest
ListApprovedOriginsResponse.add_member(:origins, Shapes::ShapeRef.new(shape: OriginsList, location_name: "Origins"))
ListApprovedOriginsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListApprovedOriginsResponse.struct_class = Types::ListApprovedOriginsResponse
ListBotsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListBotsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListBotsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult25, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListBotsRequest.add_member(:lex_version, Shapes::ShapeRef.new(shape: LexVersion, required: true, location: "querystring", location_name: "lexVersion"))
ListBotsRequest.struct_class = Types::ListBotsRequest
ListBotsResponse.add_member(:lex_bots, Shapes::ShapeRef.new(shape: LexBotConfigList, location_name: "LexBots"))
ListBotsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListBotsResponse.struct_class = Types::ListBotsResponse
ListContactFlowsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListContactFlowsRequest.add_member(:contact_flow_types, Shapes::ShapeRef.new(shape: ContactFlowTypes, location: "querystring", location_name: "contactFlowTypes"))
ListContactFlowsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListContactFlowsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults"))
ListContactFlowsRequest.struct_class = Types::ListContactFlowsRequest
ListContactFlowsResponse.add_member(:contact_flow_summary_list, Shapes::ShapeRef.new(shape: ContactFlowSummaryList, location_name: "ContactFlowSummaryList"))
ListContactFlowsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListContactFlowsResponse.struct_class = Types::ListContactFlowsResponse
ListHoursOfOperationsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListHoursOfOperationsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListHoursOfOperationsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults"))
ListHoursOfOperationsRequest.struct_class = Types::ListHoursOfOperationsRequest
ListHoursOfOperationsResponse.add_member(:hours_of_operation_summary_list, Shapes::ShapeRef.new(shape: HoursOfOperationSummaryList, location_name: "HoursOfOperationSummaryList"))
ListHoursOfOperationsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListHoursOfOperationsResponse.struct_class = Types::ListHoursOfOperationsResponse
ListInstanceAttributesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListInstanceAttributesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListInstanceAttributesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult7, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListInstanceAttributesRequest.struct_class = Types::ListInstanceAttributesRequest
ListInstanceAttributesResponse.add_member(:attributes, Shapes::ShapeRef.new(shape: AttributesList, location_name: "Attributes"))
ListInstanceAttributesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListInstanceAttributesResponse.struct_class = Types::ListInstanceAttributesResponse
ListInstanceStorageConfigsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListInstanceStorageConfigsRequest.add_member(:resource_type, Shapes::ShapeRef.new(shape: InstanceStorageResourceType, required: true, location: "querystring", location_name: "resourceType"))
ListInstanceStorageConfigsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListInstanceStorageConfigsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult10, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListInstanceStorageConfigsRequest.struct_class = Types::ListInstanceStorageConfigsRequest
ListInstanceStorageConfigsResponse.add_member(:storage_configs, Shapes::ShapeRef.new(shape: InstanceStorageConfigs, location_name: "StorageConfigs"))
ListInstanceStorageConfigsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListInstanceStorageConfigsResponse.struct_class = Types::ListInstanceStorageConfigsResponse
ListInstancesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListInstancesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult10, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListInstancesRequest.struct_class = Types::ListInstancesRequest
ListInstancesResponse.add_member(:instance_summary_list, Shapes::ShapeRef.new(shape: InstanceSummaryList, location_name: "InstanceSummaryList"))
ListInstancesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListInstancesResponse.struct_class = Types::ListInstancesResponse
ListIntegrationAssociationsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListIntegrationAssociationsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListIntegrationAssociationsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult100, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListIntegrationAssociationsRequest.struct_class = Types::ListIntegrationAssociationsRequest
ListIntegrationAssociationsResponse.add_member(:integration_association_summary_list, Shapes::ShapeRef.new(shape: IntegrationAssociationSummaryList, location_name: "IntegrationAssociationSummaryList"))
ListIntegrationAssociationsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListIntegrationAssociationsResponse.struct_class = Types::ListIntegrationAssociationsResponse
ListLambdaFunctionsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListLambdaFunctionsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListLambdaFunctionsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult25, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListLambdaFunctionsRequest.struct_class = Types::ListLambdaFunctionsRequest
ListLambdaFunctionsResponse.add_member(:lambda_functions, Shapes::ShapeRef.new(shape: FunctionArnsList, location_name: "LambdaFunctions"))
ListLambdaFunctionsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListLambdaFunctionsResponse.struct_class = Types::ListLambdaFunctionsResponse
ListLexBotsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListLexBotsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListLexBotsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult25, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListLexBotsRequest.struct_class = Types::ListLexBotsRequest
ListLexBotsResponse.add_member(:lex_bots, Shapes::ShapeRef.new(shape: LexBotsList, location_name: "LexBots"))
ListLexBotsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListLexBotsResponse.struct_class = Types::ListLexBotsResponse
ListPhoneNumbersRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListPhoneNumbersRequest.add_member(:phone_number_types, Shapes::ShapeRef.new(shape: PhoneNumberTypes, location: "querystring", location_name: "phoneNumberTypes"))
ListPhoneNumbersRequest.add_member(:phone_number_country_codes, Shapes::ShapeRef.new(shape: PhoneNumberCountryCodes, location: "querystring", location_name: "phoneNumberCountryCodes"))
ListPhoneNumbersRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListPhoneNumbersRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults"))
ListPhoneNumbersRequest.struct_class = Types::ListPhoneNumbersRequest
ListPhoneNumbersResponse.add_member(:phone_number_summary_list, Shapes::ShapeRef.new(shape: PhoneNumberSummaryList, location_name: "PhoneNumberSummaryList"))
ListPhoneNumbersResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListPhoneNumbersResponse.struct_class = Types::ListPhoneNumbersResponse
ListPromptsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListPromptsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListPromptsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListPromptsRequest.struct_class = Types::ListPromptsRequest
ListPromptsResponse.add_member(:prompt_summary_list, Shapes::ShapeRef.new(shape: PromptSummaryList, location_name: "PromptSummaryList"))
ListPromptsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListPromptsResponse.struct_class = Types::ListPromptsResponse
ListQueueQuickConnectsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListQueueQuickConnectsRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
ListQueueQuickConnectsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListQueueQuickConnectsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult100, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListQueueQuickConnectsRequest.struct_class = Types::ListQueueQuickConnectsRequest
ListQueueQuickConnectsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListQueueQuickConnectsResponse.add_member(:quick_connect_summary_list, Shapes::ShapeRef.new(shape: QuickConnectSummaryList, location_name: "QuickConnectSummaryList"))
ListQueueQuickConnectsResponse.struct_class = Types::ListQueueQuickConnectsResponse
ListQueuesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListQueuesRequest.add_member(:queue_types, Shapes::ShapeRef.new(shape: QueueTypes, location: "querystring", location_name: "queueTypes"))
ListQueuesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListQueuesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults"))
ListQueuesRequest.struct_class = Types::ListQueuesRequest
ListQueuesResponse.add_member(:queue_summary_list, Shapes::ShapeRef.new(shape: QueueSummaryList, location_name: "QueueSummaryList"))
ListQueuesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListQueuesResponse.struct_class = Types::ListQueuesResponse
ListQuickConnectsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListQuickConnectsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListQuickConnectsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListQuickConnectsRequest.add_member(:quick_connect_types, Shapes::ShapeRef.new(shape: QuickConnectTypes, location: "querystring", location_name: "QuickConnectTypes"))
ListQuickConnectsRequest.struct_class = Types::ListQuickConnectsRequest
ListQuickConnectsResponse.add_member(:quick_connect_summary_list, Shapes::ShapeRef.new(shape: QuickConnectSummaryList, location_name: "QuickConnectSummaryList"))
ListQuickConnectsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListQuickConnectsResponse.struct_class = Types::ListQuickConnectsResponse
ListRoutingProfileQueuesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListRoutingProfileQueuesRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
ListRoutingProfileQueuesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListRoutingProfileQueuesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult100, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListRoutingProfileQueuesRequest.struct_class = Types::ListRoutingProfileQueuesRequest
ListRoutingProfileQueuesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListRoutingProfileQueuesResponse.add_member(:routing_profile_queue_config_summary_list, Shapes::ShapeRef.new(shape: RoutingProfileQueueConfigSummaryList, location_name: "RoutingProfileQueueConfigSummaryList"))
ListRoutingProfileQueuesResponse.struct_class = Types::ListRoutingProfileQueuesResponse
ListRoutingProfilesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListRoutingProfilesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListRoutingProfilesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListRoutingProfilesRequest.struct_class = Types::ListRoutingProfilesRequest
ListRoutingProfilesResponse.add_member(:routing_profile_summary_list, Shapes::ShapeRef.new(shape: RoutingProfileSummaryList, location_name: "RoutingProfileSummaryList"))
ListRoutingProfilesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListRoutingProfilesResponse.struct_class = Types::ListRoutingProfilesResponse
ListSecurityKeysRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListSecurityKeysRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListSecurityKeysRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult2, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListSecurityKeysRequest.struct_class = Types::ListSecurityKeysRequest
ListSecurityKeysResponse.add_member(:security_keys, Shapes::ShapeRef.new(shape: SecurityKeysList, location_name: "SecurityKeys"))
ListSecurityKeysResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListSecurityKeysResponse.struct_class = Types::ListSecurityKeysResponse
ListSecurityProfilesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListSecurityProfilesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListSecurityProfilesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListSecurityProfilesRequest.struct_class = Types::ListSecurityProfilesRequest
ListSecurityProfilesResponse.add_member(:security_profile_summary_list, Shapes::ShapeRef.new(shape: SecurityProfileSummaryList, location_name: "SecurityProfileSummaryList"))
ListSecurityProfilesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListSecurityProfilesResponse.struct_class = Types::ListSecurityProfilesResponse
ListTagsForResourceRequest.add_member(:resource_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location: "uri", location_name: "resourceArn"))
ListTagsForResourceRequest.struct_class = Types::ListTagsForResourceRequest
ListTagsForResourceResponse.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "tags"))
ListTagsForResourceResponse.struct_class = Types::ListTagsForResourceResponse
ListUseCasesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListUseCasesRequest.add_member(:integration_association_id, Shapes::ShapeRef.new(shape: IntegrationAssociationId, required: true, location: "uri", location_name: "IntegrationAssociationId"))
ListUseCasesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListUseCasesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult100, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListUseCasesRequest.struct_class = Types::ListUseCasesRequest
ListUseCasesResponse.add_member(:use_case_summary_list, Shapes::ShapeRef.new(shape: UseCaseSummaryList, location_name: "UseCaseSummaryList"))
ListUseCasesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListUseCasesResponse.struct_class = Types::ListUseCasesResponse
ListUserHierarchyGroupsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListUserHierarchyGroupsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListUserHierarchyGroupsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListUserHierarchyGroupsRequest.struct_class = Types::ListUserHierarchyGroupsRequest
ListUserHierarchyGroupsResponse.add_member(:user_hierarchy_group_summary_list, Shapes::ShapeRef.new(shape: HierarchyGroupSummaryList, location_name: "UserHierarchyGroupSummaryList"))
ListUserHierarchyGroupsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListUserHierarchyGroupsResponse.struct_class = Types::ListUserHierarchyGroupsResponse
ListUsersRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
ListUsersRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
ListUsersRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResult1000, location: "querystring", location_name: "maxResults", metadata: {"box"=>true}))
ListUsersRequest.struct_class = Types::ListUsersRequest
ListUsersResponse.add_member(:user_summary_list, Shapes::ShapeRef.new(shape: UserSummaryList, location_name: "UserSummaryList"))
ListUsersResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
ListUsersResponse.struct_class = Types::ListUsersResponse
MediaConcurrencies.member = Shapes::ShapeRef.new(shape: MediaConcurrency)
MediaConcurrency.add_member(:channel, Shapes::ShapeRef.new(shape: Channel, required: true, location_name: "Channel"))
MediaConcurrency.add_member(:concurrency, Shapes::ShapeRef.new(shape: Concurrency, required: true, location_name: "Concurrency"))
MediaConcurrency.struct_class = Types::MediaConcurrency
OriginsList.member = Shapes::ShapeRef.new(shape: Origin)
OutboundCallerConfig.add_member(:outbound_caller_id_name, Shapes::ShapeRef.new(shape: OutboundCallerIdName, location_name: "OutboundCallerIdName"))
OutboundCallerConfig.add_member(:outbound_caller_id_number_id, Shapes::ShapeRef.new(shape: PhoneNumberId, location_name: "OutboundCallerIdNumberId"))
OutboundCallerConfig.add_member(:outbound_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, location_name: "OutboundFlowId"))
OutboundCallerConfig.struct_class = Types::OutboundCallerConfig
OutboundContactNotPermittedException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
OutboundContactNotPermittedException.struct_class = Types::OutboundContactNotPermittedException
ParticipantDetails.add_member(:display_name, Shapes::ShapeRef.new(shape: DisplayName, required: true, location_name: "DisplayName"))
ParticipantDetails.struct_class = Types::ParticipantDetails
PhoneNumberCountryCodes.member = Shapes::ShapeRef.new(shape: PhoneNumberCountryCode)
PhoneNumberQuickConnectConfig.add_member(:phone_number, Shapes::ShapeRef.new(shape: PhoneNumber, required: true, location_name: "PhoneNumber"))
PhoneNumberQuickConnectConfig.struct_class = Types::PhoneNumberQuickConnectConfig
PhoneNumberSummary.add_member(:id, Shapes::ShapeRef.new(shape: PhoneNumberId, location_name: "Id"))
PhoneNumberSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
PhoneNumberSummary.add_member(:phone_number, Shapes::ShapeRef.new(shape: PhoneNumber, location_name: "PhoneNumber"))
PhoneNumberSummary.add_member(:phone_number_type, Shapes::ShapeRef.new(shape: PhoneNumberType, location_name: "PhoneNumberType"))
PhoneNumberSummary.add_member(:phone_number_country_code, Shapes::ShapeRef.new(shape: PhoneNumberCountryCode, location_name: "PhoneNumberCountryCode"))
PhoneNumberSummary.struct_class = Types::PhoneNumberSummary
PhoneNumberSummaryList.member = Shapes::ShapeRef.new(shape: PhoneNumberSummary)
PhoneNumberTypes.member = Shapes::ShapeRef.new(shape: PhoneNumberType)
ProblemDetail.add_member(:message, Shapes::ShapeRef.new(shape: ProblemMessageString, location_name: "message"))
ProblemDetail.struct_class = Types::ProblemDetail
Problems.member = Shapes::ShapeRef.new(shape: ProblemDetail)
PromptSummary.add_member(:id, Shapes::ShapeRef.new(shape: PromptId, location_name: "Id"))
PromptSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
PromptSummary.add_member(:name, Shapes::ShapeRef.new(shape: PromptName, location_name: "Name"))
PromptSummary.struct_class = Types::PromptSummary
PromptSummaryList.member = Shapes::ShapeRef.new(shape: PromptSummary)
Queue.add_member(:name, Shapes::ShapeRef.new(shape: CommonNameLength127, location_name: "Name"))
Queue.add_member(:queue_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "QueueArn"))
Queue.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, location_name: "QueueId"))
Queue.add_member(:description, Shapes::ShapeRef.new(shape: QueueDescription, location_name: "Description"))
Queue.add_member(:outbound_caller_config, Shapes::ShapeRef.new(shape: OutboundCallerConfig, location_name: "OutboundCallerConfig"))
Queue.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, location_name: "HoursOfOperationId"))
Queue.add_member(:max_contacts, Shapes::ShapeRef.new(shape: QueueMaxContacts, location_name: "MaxContacts", metadata: {"box"=>true}))
Queue.add_member(:status, Shapes::ShapeRef.new(shape: QueueStatus, location_name: "Status"))
Queue.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
Queue.struct_class = Types::Queue
QueueQuickConnectConfig.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location_name: "QueueId"))
QueueQuickConnectConfig.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location_name: "ContactFlowId"))
QueueQuickConnectConfig.struct_class = Types::QueueQuickConnectConfig
QueueReference.add_member(:id, Shapes::ShapeRef.new(shape: QueueId, location_name: "Id"))
QueueReference.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
QueueReference.struct_class = Types::QueueReference
QueueSummary.add_member(:id, Shapes::ShapeRef.new(shape: QueueId, location_name: "Id"))
QueueSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
QueueSummary.add_member(:name, Shapes::ShapeRef.new(shape: QueueName, location_name: "Name"))
QueueSummary.add_member(:queue_type, Shapes::ShapeRef.new(shape: QueueType, location_name: "QueueType"))
QueueSummary.struct_class = Types::QueueSummary
QueueSummaryList.member = Shapes::ShapeRef.new(shape: QueueSummary)
QueueTypes.member = Shapes::ShapeRef.new(shape: QueueType)
Queues.member = Shapes::ShapeRef.new(shape: QueueId)
QuickConnect.add_member(:quick_connect_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "QuickConnectARN"))
QuickConnect.add_member(:quick_connect_id, Shapes::ShapeRef.new(shape: QuickConnectId, location_name: "QuickConnectId"))
QuickConnect.add_member(:name, Shapes::ShapeRef.new(shape: QuickConnectName, location_name: "Name"))
QuickConnect.add_member(:description, Shapes::ShapeRef.new(shape: QuickConnectDescription, location_name: "Description"))
QuickConnect.add_member(:quick_connect_config, Shapes::ShapeRef.new(shape: QuickConnectConfig, location_name: "QuickConnectConfig"))
QuickConnect.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
QuickConnect.struct_class = Types::QuickConnect
QuickConnectConfig.add_member(:quick_connect_type, Shapes::ShapeRef.new(shape: QuickConnectType, required: true, location_name: "QuickConnectType"))
QuickConnectConfig.add_member(:user_config, Shapes::ShapeRef.new(shape: UserQuickConnectConfig, location_name: "UserConfig"))
QuickConnectConfig.add_member(:queue_config, Shapes::ShapeRef.new(shape: QueueQuickConnectConfig, location_name: "QueueConfig"))
QuickConnectConfig.add_member(:phone_config, Shapes::ShapeRef.new(shape: PhoneNumberQuickConnectConfig, location_name: "PhoneConfig"))
QuickConnectConfig.struct_class = Types::QuickConnectConfig
QuickConnectSummary.add_member(:id, Shapes::ShapeRef.new(shape: QuickConnectId, location_name: "Id"))
QuickConnectSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
QuickConnectSummary.add_member(:name, Shapes::ShapeRef.new(shape: QuickConnectName, location_name: "Name"))
QuickConnectSummary.add_member(:quick_connect_type, Shapes::ShapeRef.new(shape: QuickConnectType, location_name: "QuickConnectType"))
QuickConnectSummary.struct_class = Types::QuickConnectSummary
QuickConnectSummaryList.member = Shapes::ShapeRef.new(shape: QuickConnectSummary)
QuickConnectTypes.member = Shapes::ShapeRef.new(shape: QuickConnectType)
QuickConnectsList.member = Shapes::ShapeRef.new(shape: QuickConnectId)
Reference.add_member(:value, Shapes::ShapeRef.new(shape: ReferenceValue, required: true, location_name: "Value"))
Reference.add_member(:type, Shapes::ShapeRef.new(shape: ReferenceType, required: true, location_name: "Type"))
Reference.struct_class = Types::Reference
ResourceConflictException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ResourceConflictException.struct_class = Types::ResourceConflictException
ResourceInUseException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ResourceInUseException.add_member(:resource_type, Shapes::ShapeRef.new(shape: ResourceType, location_name: "ResourceType"))
ResourceInUseException.add_member(:resource_id, Shapes::ShapeRef.new(shape: ARN, location_name: "ResourceId"))
ResourceInUseException.struct_class = Types::ResourceInUseException
ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
ResumeContactRecordingRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
ResumeContactRecordingRequest.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "ContactId"))
ResumeContactRecordingRequest.add_member(:initial_contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "InitialContactId"))
ResumeContactRecordingRequest.struct_class = Types::ResumeContactRecordingRequest
ResumeContactRecordingResponse.struct_class = Types::ResumeContactRecordingResponse
RoutingProfile.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, location_name: "InstanceId"))
RoutingProfile.add_member(:name, Shapes::ShapeRef.new(shape: RoutingProfileName, location_name: "Name"))
RoutingProfile.add_member(:routing_profile_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "RoutingProfileArn"))
RoutingProfile.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, location_name: "RoutingProfileId"))
RoutingProfile.add_member(:description, Shapes::ShapeRef.new(shape: RoutingProfileDescription, location_name: "Description"))
RoutingProfile.add_member(:media_concurrencies, Shapes::ShapeRef.new(shape: MediaConcurrencies, location_name: "MediaConcurrencies"))
RoutingProfile.add_member(:default_outbound_queue_id, Shapes::ShapeRef.new(shape: QueueId, location_name: "DefaultOutboundQueueId"))
RoutingProfile.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
RoutingProfile.struct_class = Types::RoutingProfile
RoutingProfileQueueConfig.add_member(:queue_reference, Shapes::ShapeRef.new(shape: RoutingProfileQueueReference, required: true, location_name: "QueueReference"))
RoutingProfileQueueConfig.add_member(:priority, Shapes::ShapeRef.new(shape: Priority, required: true, location_name: "Priority", metadata: {"box"=>true}))
RoutingProfileQueueConfig.add_member(:delay, Shapes::ShapeRef.new(shape: Delay, required: true, location_name: "Delay", metadata: {"box"=>true}))
RoutingProfileQueueConfig.struct_class = Types::RoutingProfileQueueConfig
RoutingProfileQueueConfigList.member = Shapes::ShapeRef.new(shape: RoutingProfileQueueConfig)
RoutingProfileQueueConfigSummary.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location_name: "QueueId"))
RoutingProfileQueueConfigSummary.add_member(:queue_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location_name: "QueueArn"))
RoutingProfileQueueConfigSummary.add_member(:queue_name, Shapes::ShapeRef.new(shape: QueueName, required: true, location_name: "QueueName"))
RoutingProfileQueueConfigSummary.add_member(:priority, Shapes::ShapeRef.new(shape: Priority, required: true, location_name: "Priority"))
RoutingProfileQueueConfigSummary.add_member(:delay, Shapes::ShapeRef.new(shape: Delay, required: true, location_name: "Delay"))
RoutingProfileQueueConfigSummary.add_member(:channel, Shapes::ShapeRef.new(shape: Channel, required: true, location_name: "Channel"))
RoutingProfileQueueConfigSummary.struct_class = Types::RoutingProfileQueueConfigSummary
RoutingProfileQueueConfigSummaryList.member = Shapes::ShapeRef.new(shape: RoutingProfileQueueConfigSummary)
RoutingProfileQueueReference.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location_name: "QueueId"))
RoutingProfileQueueReference.add_member(:channel, Shapes::ShapeRef.new(shape: Channel, required: true, location_name: "Channel"))
RoutingProfileQueueReference.struct_class = Types::RoutingProfileQueueReference
RoutingProfileQueueReferenceList.member = Shapes::ShapeRef.new(shape: RoutingProfileQueueReference)
RoutingProfileSummary.add_member(:id, Shapes::ShapeRef.new(shape: RoutingProfileId, location_name: "Id"))
RoutingProfileSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
RoutingProfileSummary.add_member(:name, Shapes::ShapeRef.new(shape: RoutingProfileName, location_name: "Name"))
RoutingProfileSummary.struct_class = Types::RoutingProfileSummary
RoutingProfileSummaryList.member = Shapes::ShapeRef.new(shape: RoutingProfileSummary)
S3Config.add_member(:bucket_name, Shapes::ShapeRef.new(shape: BucketName, required: true, location_name: "BucketName"))
S3Config.add_member(:bucket_prefix, Shapes::ShapeRef.new(shape: Prefix, required: true, location_name: "BucketPrefix"))
S3Config.add_member(:encryption_config, Shapes::ShapeRef.new(shape: EncryptionConfig, location_name: "EncryptionConfig"))
S3Config.struct_class = Types::S3Config
SecurityKey.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, location_name: "AssociationId"))
SecurityKey.add_member(:key, Shapes::ShapeRef.new(shape: PEM, location_name: "Key"))
SecurityKey.add_member(:creation_time, Shapes::ShapeRef.new(shape: timestamp, location_name: "CreationTime"))
SecurityKey.struct_class = Types::SecurityKey
SecurityKeysList.member = Shapes::ShapeRef.new(shape: SecurityKey)
SecurityProfileIds.member = Shapes::ShapeRef.new(shape: SecurityProfileId)
SecurityProfileSummary.add_member(:id, Shapes::ShapeRef.new(shape: SecurityProfileId, location_name: "Id"))
SecurityProfileSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
SecurityProfileSummary.add_member(:name, Shapes::ShapeRef.new(shape: SecurityProfileName, location_name: "Name"))
SecurityProfileSummary.struct_class = Types::SecurityProfileSummary
SecurityProfileSummaryList.member = Shapes::ShapeRef.new(shape: SecurityProfileSummary)
ServiceQuotaExceededException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ServiceQuotaExceededException.struct_class = Types::ServiceQuotaExceededException
StartChatContactRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
StartChatContactRequest.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location_name: "ContactFlowId"))
StartChatContactRequest.add_member(:attributes, Shapes::ShapeRef.new(shape: Attributes, location_name: "Attributes"))
StartChatContactRequest.add_member(:participant_details, Shapes::ShapeRef.new(shape: ParticipantDetails, required: true, location_name: "ParticipantDetails"))
StartChatContactRequest.add_member(:initial_message, Shapes::ShapeRef.new(shape: ChatMessage, location_name: "InitialMessage"))
StartChatContactRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken", metadata: {"idempotencyToken"=>true}))
StartChatContactRequest.struct_class = Types::StartChatContactRequest
StartChatContactResponse.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, location_name: "ContactId"))
StartChatContactResponse.add_member(:participant_id, Shapes::ShapeRef.new(shape: ParticipantId, location_name: "ParticipantId"))
StartChatContactResponse.add_member(:participant_token, Shapes::ShapeRef.new(shape: ParticipantToken, location_name: "ParticipantToken"))
StartChatContactResponse.struct_class = Types::StartChatContactResponse
StartContactRecordingRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
StartContactRecordingRequest.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "ContactId"))
StartContactRecordingRequest.add_member(:initial_contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "InitialContactId"))
StartContactRecordingRequest.add_member(:voice_recording_configuration, Shapes::ShapeRef.new(shape: VoiceRecordingConfiguration, required: true, location_name: "VoiceRecordingConfiguration"))
StartContactRecordingRequest.struct_class = Types::StartContactRecordingRequest
StartContactRecordingResponse.struct_class = Types::StartContactRecordingResponse
StartOutboundVoiceContactRequest.add_member(:destination_phone_number, Shapes::ShapeRef.new(shape: PhoneNumber, required: true, location_name: "DestinationPhoneNumber"))
StartOutboundVoiceContactRequest.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location_name: "ContactFlowId"))
StartOutboundVoiceContactRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
StartOutboundVoiceContactRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken", metadata: {"idempotencyToken"=>true}))
StartOutboundVoiceContactRequest.add_member(:source_phone_number, Shapes::ShapeRef.new(shape: PhoneNumber, location_name: "SourcePhoneNumber"))
StartOutboundVoiceContactRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, location_name: "QueueId"))
StartOutboundVoiceContactRequest.add_member(:attributes, Shapes::ShapeRef.new(shape: Attributes, location_name: "Attributes"))
StartOutboundVoiceContactRequest.struct_class = Types::StartOutboundVoiceContactRequest
StartOutboundVoiceContactResponse.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, location_name: "ContactId"))
StartOutboundVoiceContactResponse.struct_class = Types::StartOutboundVoiceContactResponse
StartTaskContactRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
StartTaskContactRequest.add_member(:previous_contact_id, Shapes::ShapeRef.new(shape: ContactId, location_name: "PreviousContactId"))
StartTaskContactRequest.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location_name: "ContactFlowId"))
StartTaskContactRequest.add_member(:attributes, Shapes::ShapeRef.new(shape: Attributes, location_name: "Attributes"))
StartTaskContactRequest.add_member(:name, Shapes::ShapeRef.new(shape: Name, required: true, location_name: "Name"))
StartTaskContactRequest.add_member(:references, Shapes::ShapeRef.new(shape: ContactReferences, location_name: "References"))
StartTaskContactRequest.add_member(:description, Shapes::ShapeRef.new(shape: Description, location_name: "Description"))
StartTaskContactRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "ClientToken", metadata: {"idempotencyToken"=>true}))
StartTaskContactRequest.struct_class = Types::StartTaskContactRequest
StartTaskContactResponse.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, location_name: "ContactId"))
StartTaskContactResponse.struct_class = Types::StartTaskContactResponse
StopContactRecordingRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
StopContactRecordingRequest.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "ContactId"))
StopContactRecordingRequest.add_member(:initial_contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "InitialContactId"))
StopContactRecordingRequest.struct_class = Types::StopContactRecordingRequest
StopContactRecordingResponse.struct_class = Types::StopContactRecordingResponse
StopContactRequest.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "ContactId"))
StopContactRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
StopContactRequest.struct_class = Types::StopContactRequest
StopContactResponse.struct_class = Types::StopContactResponse
SuspendContactRecordingRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
SuspendContactRecordingRequest.add_member(:contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "ContactId"))
SuspendContactRecordingRequest.add_member(:initial_contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "InitialContactId"))
SuspendContactRecordingRequest.struct_class = Types::SuspendContactRecordingRequest
SuspendContactRecordingResponse.struct_class = Types::SuspendContactRecordingResponse
TagKeyList.member = Shapes::ShapeRef.new(shape: TagKey)
TagMap.key = Shapes::ShapeRef.new(shape: TagKey)
TagMap.value = Shapes::ShapeRef.new(shape: TagValue)
TagResourceRequest.add_member(:resource_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location: "uri", location_name: "resourceArn"))
TagResourceRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, required: true, location_name: "tags"))
TagResourceRequest.struct_class = Types::TagResourceRequest
Threshold.add_member(:comparison, Shapes::ShapeRef.new(shape: Comparison, location_name: "Comparison"))
Threshold.add_member(:threshold_value, Shapes::ShapeRef.new(shape: ThresholdValue, location_name: "ThresholdValue", metadata: {"box"=>true}))
Threshold.struct_class = Types::Threshold
ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
ThrottlingException.struct_class = Types::ThrottlingException
UntagResourceRequest.add_member(:resource_arn, Shapes::ShapeRef.new(shape: ARN, required: true, location: "uri", location_name: "resourceArn"))
UntagResourceRequest.add_member(:tag_keys, Shapes::ShapeRef.new(shape: TagKeyList, required: true, location: "querystring", location_name: "tagKeys"))
UntagResourceRequest.struct_class = Types::UntagResourceRequest
UpdateAgentStatusRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateAgentStatusRequest.add_member(:agent_status_id, Shapes::ShapeRef.new(shape: AgentStatusId, required: true, location: "uri", location_name: "AgentStatusId"))
UpdateAgentStatusRequest.add_member(:name, Shapes::ShapeRef.new(shape: AgentStatusName, location_name: "Name"))
UpdateAgentStatusRequest.add_member(:description, Shapes::ShapeRef.new(shape: UpdateAgentStatusDescription, location_name: "Description"))
UpdateAgentStatusRequest.add_member(:state, Shapes::ShapeRef.new(shape: AgentStatusState, location_name: "State"))
UpdateAgentStatusRequest.add_member(:display_order, Shapes::ShapeRef.new(shape: AgentStatusOrderNumber, location_name: "DisplayOrder", metadata: {"box"=>true}))
UpdateAgentStatusRequest.add_member(:reset_order_number, Shapes::ShapeRef.new(shape: Boolean, location_name: "ResetOrderNumber"))
UpdateAgentStatusRequest.struct_class = Types::UpdateAgentStatusRequest
UpdateContactAttributesRequest.add_member(:initial_contact_id, Shapes::ShapeRef.new(shape: ContactId, required: true, location_name: "InitialContactId"))
UpdateContactAttributesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location_name: "InstanceId"))
UpdateContactAttributesRequest.add_member(:attributes, Shapes::ShapeRef.new(shape: Attributes, required: true, location_name: "Attributes"))
UpdateContactAttributesRequest.struct_class = Types::UpdateContactAttributesRequest
UpdateContactAttributesResponse.struct_class = Types::UpdateContactAttributesResponse
UpdateContactFlowContentRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateContactFlowContentRequest.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location: "uri", location_name: "ContactFlowId"))
UpdateContactFlowContentRequest.add_member(:content, Shapes::ShapeRef.new(shape: ContactFlowContent, required: true, location_name: "Content"))
UpdateContactFlowContentRequest.struct_class = Types::UpdateContactFlowContentRequest
UpdateContactFlowNameRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateContactFlowNameRequest.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location: "uri", location_name: "ContactFlowId"))
UpdateContactFlowNameRequest.add_member(:name, Shapes::ShapeRef.new(shape: ContactFlowName, location_name: "Name"))
UpdateContactFlowNameRequest.add_member(:description, Shapes::ShapeRef.new(shape: ContactFlowDescription, location_name: "Description"))
UpdateContactFlowNameRequest.struct_class = Types::UpdateContactFlowNameRequest
UpdateHoursOfOperationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateHoursOfOperationRequest.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, required: true, location: "uri", location_name: "HoursOfOperationId"))
UpdateHoursOfOperationRequest.add_member(:name, Shapes::ShapeRef.new(shape: CommonNameLength127, location_name: "Name"))
UpdateHoursOfOperationRequest.add_member(:description, Shapes::ShapeRef.new(shape: UpdateHoursOfOperationDescription, location_name: "Description"))
UpdateHoursOfOperationRequest.add_member(:time_zone, Shapes::ShapeRef.new(shape: TimeZone, location_name: "TimeZone"))
UpdateHoursOfOperationRequest.add_member(:config, Shapes::ShapeRef.new(shape: HoursOfOperationConfigList, location_name: "Config"))
UpdateHoursOfOperationRequest.struct_class = Types::UpdateHoursOfOperationRequest
UpdateInstanceAttributeRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateInstanceAttributeRequest.add_member(:attribute_type, Shapes::ShapeRef.new(shape: InstanceAttributeType, required: true, location: "uri", location_name: "AttributeType"))
UpdateInstanceAttributeRequest.add_member(:value, Shapes::ShapeRef.new(shape: InstanceAttributeValue, required: true, location_name: "Value"))
UpdateInstanceAttributeRequest.struct_class = Types::UpdateInstanceAttributeRequest
UpdateInstanceStorageConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateInstanceStorageConfigRequest.add_member(:association_id, Shapes::ShapeRef.new(shape: AssociationId, required: true, location: "uri", location_name: "AssociationId"))
UpdateInstanceStorageConfigRequest.add_member(:resource_type, Shapes::ShapeRef.new(shape: InstanceStorageResourceType, required: true, location: "querystring", location_name: "resourceType"))
UpdateInstanceStorageConfigRequest.add_member(:storage_config, Shapes::ShapeRef.new(shape: InstanceStorageConfig, required: true, location_name: "StorageConfig"))
UpdateInstanceStorageConfigRequest.struct_class = Types::UpdateInstanceStorageConfigRequest
UpdateQueueHoursOfOperationRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQueueHoursOfOperationRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
UpdateQueueHoursOfOperationRequest.add_member(:hours_of_operation_id, Shapes::ShapeRef.new(shape: HoursOfOperationId, required: true, location_name: "HoursOfOperationId"))
UpdateQueueHoursOfOperationRequest.struct_class = Types::UpdateQueueHoursOfOperationRequest
UpdateQueueMaxContactsRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQueueMaxContactsRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
UpdateQueueMaxContactsRequest.add_member(:max_contacts, Shapes::ShapeRef.new(shape: QueueMaxContacts, location_name: "MaxContacts", metadata: {"box"=>true}))
UpdateQueueMaxContactsRequest.struct_class = Types::UpdateQueueMaxContactsRequest
UpdateQueueNameRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQueueNameRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
UpdateQueueNameRequest.add_member(:name, Shapes::ShapeRef.new(shape: CommonNameLength127, location_name: "Name"))
UpdateQueueNameRequest.add_member(:description, Shapes::ShapeRef.new(shape: QueueDescription, location_name: "Description"))
UpdateQueueNameRequest.struct_class = Types::UpdateQueueNameRequest
UpdateQueueOutboundCallerConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQueueOutboundCallerConfigRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
UpdateQueueOutboundCallerConfigRequest.add_member(:outbound_caller_config, Shapes::ShapeRef.new(shape: OutboundCallerConfig, required: true, location_name: "OutboundCallerConfig"))
UpdateQueueOutboundCallerConfigRequest.struct_class = Types::UpdateQueueOutboundCallerConfigRequest
UpdateQueueStatusRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQueueStatusRequest.add_member(:queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location: "uri", location_name: "QueueId"))
UpdateQueueStatusRequest.add_member(:status, Shapes::ShapeRef.new(shape: QueueStatus, required: true, location_name: "Status"))
UpdateQueueStatusRequest.struct_class = Types::UpdateQueueStatusRequest
UpdateQuickConnectConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQuickConnectConfigRequest.add_member(:quick_connect_id, Shapes::ShapeRef.new(shape: QuickConnectId, required: true, location: "uri", location_name: "QuickConnectId"))
UpdateQuickConnectConfigRequest.add_member(:quick_connect_config, Shapes::ShapeRef.new(shape: QuickConnectConfig, required: true, location_name: "QuickConnectConfig"))
UpdateQuickConnectConfigRequest.struct_class = Types::UpdateQuickConnectConfigRequest
UpdateQuickConnectNameRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateQuickConnectNameRequest.add_member(:quick_connect_id, Shapes::ShapeRef.new(shape: QuickConnectId, required: true, location: "uri", location_name: "QuickConnectId"))
UpdateQuickConnectNameRequest.add_member(:name, Shapes::ShapeRef.new(shape: QuickConnectName, location_name: "Name"))
UpdateQuickConnectNameRequest.add_member(:description, Shapes::ShapeRef.new(shape: UpdateQuickConnectDescription, location_name: "Description"))
UpdateQuickConnectNameRequest.struct_class = Types::UpdateQuickConnectNameRequest
UpdateRoutingProfileConcurrencyRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateRoutingProfileConcurrencyRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
UpdateRoutingProfileConcurrencyRequest.add_member(:media_concurrencies, Shapes::ShapeRef.new(shape: MediaConcurrencies, required: true, location_name: "MediaConcurrencies"))
UpdateRoutingProfileConcurrencyRequest.struct_class = Types::UpdateRoutingProfileConcurrencyRequest
UpdateRoutingProfileDefaultOutboundQueueRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateRoutingProfileDefaultOutboundQueueRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
UpdateRoutingProfileDefaultOutboundQueueRequest.add_member(:default_outbound_queue_id, Shapes::ShapeRef.new(shape: QueueId, required: true, location_name: "DefaultOutboundQueueId"))
UpdateRoutingProfileDefaultOutboundQueueRequest.struct_class = Types::UpdateRoutingProfileDefaultOutboundQueueRequest
UpdateRoutingProfileNameRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateRoutingProfileNameRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
UpdateRoutingProfileNameRequest.add_member(:name, Shapes::ShapeRef.new(shape: RoutingProfileName, location_name: "Name"))
UpdateRoutingProfileNameRequest.add_member(:description, Shapes::ShapeRef.new(shape: RoutingProfileDescription, location_name: "Description"))
UpdateRoutingProfileNameRequest.struct_class = Types::UpdateRoutingProfileNameRequest
UpdateRoutingProfileQueuesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateRoutingProfileQueuesRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location: "uri", location_name: "RoutingProfileId"))
UpdateRoutingProfileQueuesRequest.add_member(:queue_configs, Shapes::ShapeRef.new(shape: RoutingProfileQueueConfigList, required: true, location_name: "QueueConfigs"))
UpdateRoutingProfileQueuesRequest.struct_class = Types::UpdateRoutingProfileQueuesRequest
UpdateUserHierarchyGroupNameRequest.add_member(:name, Shapes::ShapeRef.new(shape: HierarchyGroupName, required: true, location_name: "Name"))
UpdateUserHierarchyGroupNameRequest.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, required: true, location: "uri", location_name: "HierarchyGroupId"))
UpdateUserHierarchyGroupNameRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserHierarchyGroupNameRequest.struct_class = Types::UpdateUserHierarchyGroupNameRequest
UpdateUserHierarchyRequest.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "HierarchyGroupId"))
UpdateUserHierarchyRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
UpdateUserHierarchyRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserHierarchyRequest.struct_class = Types::UpdateUserHierarchyRequest
UpdateUserHierarchyStructureRequest.add_member(:hierarchy_structure, Shapes::ShapeRef.new(shape: HierarchyStructureUpdate, required: true, location_name: "HierarchyStructure"))
UpdateUserHierarchyStructureRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserHierarchyStructureRequest.struct_class = Types::UpdateUserHierarchyStructureRequest
UpdateUserIdentityInfoRequest.add_member(:identity_info, Shapes::ShapeRef.new(shape: UserIdentityInfo, required: true, location_name: "IdentityInfo"))
UpdateUserIdentityInfoRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
UpdateUserIdentityInfoRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserIdentityInfoRequest.struct_class = Types::UpdateUserIdentityInfoRequest
UpdateUserPhoneConfigRequest.add_member(:phone_config, Shapes::ShapeRef.new(shape: UserPhoneConfig, required: true, location_name: "PhoneConfig"))
UpdateUserPhoneConfigRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
UpdateUserPhoneConfigRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserPhoneConfigRequest.struct_class = Types::UpdateUserPhoneConfigRequest
UpdateUserRoutingProfileRequest.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, required: true, location_name: "RoutingProfileId"))
UpdateUserRoutingProfileRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
UpdateUserRoutingProfileRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserRoutingProfileRequest.struct_class = Types::UpdateUserRoutingProfileRequest
UpdateUserSecurityProfilesRequest.add_member(:security_profile_ids, Shapes::ShapeRef.new(shape: SecurityProfileIds, required: true, location_name: "SecurityProfileIds"))
UpdateUserSecurityProfilesRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "UserId"))
UpdateUserSecurityProfilesRequest.add_member(:instance_id, Shapes::ShapeRef.new(shape: InstanceId, required: true, location: "uri", location_name: "InstanceId"))
UpdateUserSecurityProfilesRequest.struct_class = Types::UpdateUserSecurityProfilesRequest
UseCase.add_member(:use_case_id, Shapes::ShapeRef.new(shape: UseCaseId, location_name: "UseCaseId"))
UseCase.add_member(:use_case_arn, Shapes::ShapeRef.new(shape: ARN, location_name: "UseCaseArn"))
UseCase.add_member(:use_case_type, Shapes::ShapeRef.new(shape: UseCaseType, location_name: "UseCaseType"))
UseCase.struct_class = Types::UseCase
UseCaseSummaryList.member = Shapes::ShapeRef.new(shape: UseCase)
User.add_member(:id, Shapes::ShapeRef.new(shape: UserId, location_name: "Id"))
User.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
User.add_member(:username, Shapes::ShapeRef.new(shape: AgentUsername, location_name: "Username"))
User.add_member(:identity_info, Shapes::ShapeRef.new(shape: UserIdentityInfo, location_name: "IdentityInfo"))
User.add_member(:phone_config, Shapes::ShapeRef.new(shape: UserPhoneConfig, location_name: "PhoneConfig"))
User.add_member(:directory_user_id, Shapes::ShapeRef.new(shape: DirectoryUserId, location_name: "DirectoryUserId"))
User.add_member(:security_profile_ids, Shapes::ShapeRef.new(shape: SecurityProfileIds, location_name: "SecurityProfileIds"))
User.add_member(:routing_profile_id, Shapes::ShapeRef.new(shape: RoutingProfileId, location_name: "RoutingProfileId"))
User.add_member(:hierarchy_group_id, Shapes::ShapeRef.new(shape: HierarchyGroupId, location_name: "HierarchyGroupId"))
User.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, location_name: "Tags"))
User.struct_class = Types::User
UserIdentityInfo.add_member(:first_name, Shapes::ShapeRef.new(shape: AgentFirstName, location_name: "FirstName"))
UserIdentityInfo.add_member(:last_name, Shapes::ShapeRef.new(shape: AgentLastName, location_name: "LastName"))
UserIdentityInfo.add_member(:email, Shapes::ShapeRef.new(shape: Email, location_name: "Email"))
UserIdentityInfo.struct_class = Types::UserIdentityInfo
UserNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message"))
UserNotFoundException.struct_class = Types::UserNotFoundException
UserPhoneConfig.add_member(:phone_type, Shapes::ShapeRef.new(shape: PhoneType, required: true, location_name: "PhoneType"))
UserPhoneConfig.add_member(:auto_accept, Shapes::ShapeRef.new(shape: AutoAccept, location_name: "AutoAccept"))
UserPhoneConfig.add_member(:after_contact_work_time_limit, Shapes::ShapeRef.new(shape: AfterContactWorkTimeLimit, location_name: "AfterContactWorkTimeLimit"))
UserPhoneConfig.add_member(:desk_phone_number, Shapes::ShapeRef.new(shape: PhoneNumber, location_name: "DeskPhoneNumber"))
UserPhoneConfig.struct_class = Types::UserPhoneConfig
UserQuickConnectConfig.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location_name: "UserId"))
UserQuickConnectConfig.add_member(:contact_flow_id, Shapes::ShapeRef.new(shape: ContactFlowId, required: true, location_name: "ContactFlowId"))
UserQuickConnectConfig.struct_class = Types::UserQuickConnectConfig
UserSummary.add_member(:id, Shapes::ShapeRef.new(shape: UserId, location_name: "Id"))
UserSummary.add_member(:arn, Shapes::ShapeRef.new(shape: ARN, location_name: "Arn"))
UserSummary.add_member(:username, Shapes::ShapeRef.new(shape: AgentUsername, location_name: "Username"))
UserSummary.struct_class = Types::UserSummary
UserSummaryList.member = Shapes::ShapeRef.new(shape: UserSummary)
VoiceRecordingConfiguration.add_member(:voice_recording_track, Shapes::ShapeRef.new(shape: VoiceRecordingTrack, location_name: "VoiceRecordingTrack"))
VoiceRecordingConfiguration.struct_class = Types::VoiceRecordingConfiguration
# @api private
API = Seahorse::Model::Api.new.tap do |api|
api.version = "2017-08-08"
api.metadata = {
"apiVersion" => "2017-08-08",
"endpointPrefix" => "connect",
"jsonVersion" => "1.1",
"protocol" => "rest-json",
"serviceAbbreviation" => "Amazon Connect",
"serviceFullName" => "Amazon Connect Service",
"serviceId" => "Connect",
"signatureVersion" => "v4",
"signingName" => "connect",
"uid" => "connect-2017-08-08",
}
api.add_operation(:associate_approved_origin, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateApprovedOrigin"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/approved-origin"
o.input = Shapes::ShapeRef.new(shape: AssociateApprovedOriginRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceConflictException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:associate_bot, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateBot"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/bot"
o.input = Shapes::ShapeRef.new(shape: AssociateBotRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceConflictException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:associate_instance_storage_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateInstanceStorageConfig"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/storage-config"
o.input = Shapes::ShapeRef.new(shape: AssociateInstanceStorageConfigRequest)
o.output = Shapes::ShapeRef.new(shape: AssociateInstanceStorageConfigResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceConflictException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:associate_lambda_function, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateLambdaFunction"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/lambda-function"
o.input = Shapes::ShapeRef.new(shape: AssociateLambdaFunctionRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceConflictException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:associate_lex_bot, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateLexBot"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/lex-bot"
o.input = Shapes::ShapeRef.new(shape: AssociateLexBotRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceConflictException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:associate_queue_quick_connects, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateQueueQuickConnects"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/associate-quick-connects"
o.input = Shapes::ShapeRef.new(shape: AssociateQueueQuickConnectsRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:associate_routing_profile_queues, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateRoutingProfileQueues"
o.http_method = "POST"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/associate-queues"
o.input = Shapes::ShapeRef.new(shape: AssociateRoutingProfileQueuesRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:associate_security_key, Seahorse::Model::Operation.new.tap do |o|
o.name = "AssociateSecurityKey"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/security-key"
o.input = Shapes::ShapeRef.new(shape: AssociateSecurityKeyRequest)
o.output = Shapes::ShapeRef.new(shape: AssociateSecurityKeyResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceConflictException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:create_agent_status, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateAgentStatus"
o.http_method = "PUT"
o.http_request_uri = "/agent-status/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateAgentStatusRequest)
o.output = Shapes::ShapeRef.new(shape: CreateAgentStatusResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_contact_flow, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateContactFlow"
o.http_method = "PUT"
o.http_request_uri = "/contact-flows/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateContactFlowRequest)
o.output = Shapes::ShapeRef.new(shape: CreateContactFlowResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidContactFlowException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_hours_of_operation, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateHoursOfOperation"
o.http_method = "PUT"
o.http_request_uri = "/hours-of-operations/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateHoursOfOperationRequest)
o.output = Shapes::ShapeRef.new(shape: CreateHoursOfOperationResponse)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_instance, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateInstance"
o.http_method = "PUT"
o.http_request_uri = "/instance"
o.input = Shapes::ShapeRef.new(shape: CreateInstanceRequest)
o.output = Shapes::ShapeRef.new(shape: CreateInstanceResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_integration_association, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateIntegrationAssociation"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/integration-associations"
o.input = Shapes::ShapeRef.new(shape: CreateIntegrationAssociationRequest)
o.output = Shapes::ShapeRef.new(shape: CreateIntegrationAssociationResponse)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:create_queue, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateQueue"
o.http_method = "PUT"
o.http_request_uri = "/queues/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateQueueRequest)
o.output = Shapes::ShapeRef.new(shape: CreateQueueResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_quick_connect, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateQuickConnect"
o.http_method = "PUT"
o.http_request_uri = "/quick-connects/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateQuickConnectRequest)
o.output = Shapes::ShapeRef.new(shape: CreateQuickConnectResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_routing_profile, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateRoutingProfile"
o.http_method = "PUT"
o.http_request_uri = "/routing-profiles/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateRoutingProfileRequest)
o.output = Shapes::ShapeRef.new(shape: CreateRoutingProfileResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_use_case, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateUseCase"
o.http_method = "PUT"
o.http_request_uri = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases"
o.input = Shapes::ShapeRef.new(shape: CreateUseCaseRequest)
o.output = Shapes::ShapeRef.new(shape: CreateUseCaseResponse)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:create_user, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateUser"
o.http_method = "PUT"
o.http_request_uri = "/users/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateUserRequest)
o.output = Shapes::ShapeRef.new(shape: CreateUserResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:create_user_hierarchy_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateUserHierarchyGroup"
o.http_method = "PUT"
o.http_request_uri = "/user-hierarchy-groups/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: CreateUserHierarchyGroupRequest)
o.output = Shapes::ShapeRef.new(shape: CreateUserHierarchyGroupResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:delete_hours_of_operation, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteHoursOfOperation"
o.http_method = "DELETE"
o.http_request_uri = "/hours-of-operations/{InstanceId}/{HoursOfOperationId}"
o.input = Shapes::ShapeRef.new(shape: DeleteHoursOfOperationRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:delete_instance, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteInstance"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: DeleteInstanceRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
end)
api.add_operation(:delete_integration_association, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteIntegrationAssociation"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}"
o.input = Shapes::ShapeRef.new(shape: DeleteIntegrationAssociationRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:delete_quick_connect, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteQuickConnect"
o.http_method = "DELETE"
o.http_request_uri = "/quick-connects/{InstanceId}/{QuickConnectId}"
o.input = Shapes::ShapeRef.new(shape: DeleteQuickConnectRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:delete_use_case, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteUseCase"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases/{UseCaseId}"
o.input = Shapes::ShapeRef.new(shape: DeleteUseCaseRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:delete_user, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteUser"
o.http_method = "DELETE"
o.http_request_uri = "/users/{InstanceId}/{UserId}"
o.input = Shapes::ShapeRef.new(shape: DeleteUserRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:delete_user_hierarchy_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteUserHierarchyGroup"
o.http_method = "DELETE"
o.http_request_uri = "/user-hierarchy-groups/{InstanceId}/{HierarchyGroupId}"
o.input = Shapes::ShapeRef.new(shape: DeleteUserHierarchyGroupRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_agent_status, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeAgentStatus"
o.http_method = "GET"
o.http_request_uri = "/agent-status/{InstanceId}/{AgentStatusId}"
o.input = Shapes::ShapeRef.new(shape: DescribeAgentStatusRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeAgentStatusResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_contact_flow, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeContactFlow"
o.http_method = "GET"
o.http_request_uri = "/contact-flows/{InstanceId}/{ContactFlowId}"
o.input = Shapes::ShapeRef.new(shape: DescribeContactFlowRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeContactFlowResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ContactFlowNotPublishedException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_hours_of_operation, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeHoursOfOperation"
o.http_method = "GET"
o.http_request_uri = "/hours-of-operations/{InstanceId}/{HoursOfOperationId}"
o.input = Shapes::ShapeRef.new(shape: DescribeHoursOfOperationRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeHoursOfOperationResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_instance, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeInstance"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: DescribeInstanceRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeInstanceResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_instance_attribute, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeInstanceAttribute"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/attribute/{AttributeType}"
o.input = Shapes::ShapeRef.new(shape: DescribeInstanceAttributeRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeInstanceAttributeResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:describe_instance_storage_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeInstanceStorageConfig"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/storage-config/{AssociationId}"
o.input = Shapes::ShapeRef.new(shape: DescribeInstanceStorageConfigRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeInstanceStorageConfigResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:describe_queue, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeQueue"
o.http_method = "GET"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}"
o.input = Shapes::ShapeRef.new(shape: DescribeQueueRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeQueueResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_quick_connect, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeQuickConnect"
o.http_method = "GET"
o.http_request_uri = "/quick-connects/{InstanceId}/{QuickConnectId}"
o.input = Shapes::ShapeRef.new(shape: DescribeQuickConnectRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeQuickConnectResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_routing_profile, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeRoutingProfile"
o.http_method = "GET"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}"
o.input = Shapes::ShapeRef.new(shape: DescribeRoutingProfileRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeRoutingProfileResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_user, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeUser"
o.http_method = "GET"
o.http_request_uri = "/users/{InstanceId}/{UserId}"
o.input = Shapes::ShapeRef.new(shape: DescribeUserRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeUserResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_user_hierarchy_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeUserHierarchyGroup"
o.http_method = "GET"
o.http_request_uri = "/user-hierarchy-groups/{InstanceId}/{HierarchyGroupId}"
o.input = Shapes::ShapeRef.new(shape: DescribeUserHierarchyGroupRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeUserHierarchyGroupResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:describe_user_hierarchy_structure, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeUserHierarchyStructure"
o.http_method = "GET"
o.http_request_uri = "/user-hierarchy-structure/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: DescribeUserHierarchyStructureRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeUserHierarchyStructureResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:disassociate_approved_origin, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateApprovedOrigin"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/approved-origin"
o.input = Shapes::ShapeRef.new(shape: DisassociateApprovedOriginRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:disassociate_bot, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateBot"
o.http_method = "POST"
o.http_request_uri = "/instance/{InstanceId}/bot"
o.input = Shapes::ShapeRef.new(shape: DisassociateBotRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:disassociate_instance_storage_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateInstanceStorageConfig"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/storage-config/{AssociationId}"
o.input = Shapes::ShapeRef.new(shape: DisassociateInstanceStorageConfigRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:disassociate_lambda_function, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateLambdaFunction"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/lambda-function"
o.input = Shapes::ShapeRef.new(shape: DisassociateLambdaFunctionRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:disassociate_lex_bot, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateLexBot"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/lex-bot"
o.input = Shapes::ShapeRef.new(shape: DisassociateLexBotRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:disassociate_queue_quick_connects, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateQueueQuickConnects"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/disassociate-quick-connects"
o.input = Shapes::ShapeRef.new(shape: DisassociateQueueQuickConnectsRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:disassociate_routing_profile_queues, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateRoutingProfileQueues"
o.http_method = "POST"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/disassociate-queues"
o.input = Shapes::ShapeRef.new(shape: DisassociateRoutingProfileQueuesRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:disassociate_security_key, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisassociateSecurityKey"
o.http_method = "DELETE"
o.http_request_uri = "/instance/{InstanceId}/security-key/{AssociationId}"
o.input = Shapes::ShapeRef.new(shape: DisassociateSecurityKeyRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:get_contact_attributes, Seahorse::Model::Operation.new.tap do |o|
o.name = "GetContactAttributes"
o.http_method = "GET"
o.http_request_uri = "/contact/attributes/{InstanceId}/{InitialContactId}"
o.input = Shapes::ShapeRef.new(shape: GetContactAttributesRequest)
o.output = Shapes::ShapeRef.new(shape: GetContactAttributesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:get_current_metric_data, Seahorse::Model::Operation.new.tap do |o|
o.name = "GetCurrentMetricData"
o.http_method = "POST"
o.http_request_uri = "/metrics/current/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: GetCurrentMetricDataRequest)
o.output = Shapes::ShapeRef.new(shape: GetCurrentMetricDataResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:get_federation_token, Seahorse::Model::Operation.new.tap do |o|
o.name = "GetFederationToken"
o.http_method = "GET"
o.http_request_uri = "/user/federate/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: GetFederationTokenRequest)
o.output = Shapes::ShapeRef.new(shape: GetFederationTokenResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: UserNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
end)
api.add_operation(:get_metric_data, Seahorse::Model::Operation.new.tap do |o|
o.name = "GetMetricData"
o.http_method = "POST"
o.http_request_uri = "/metrics/historical/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: GetMetricDataRequest)
o.output = Shapes::ShapeRef.new(shape: GetMetricDataResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_agent_statuses, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListAgentStatuses"
o.http_method = "GET"
o.http_request_uri = "/agent-status/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListAgentStatusRequest)
o.output = Shapes::ShapeRef.new(shape: ListAgentStatusResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_approved_origins, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListApprovedOrigins"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/approved-origins"
o.input = Shapes::ShapeRef.new(shape: ListApprovedOriginsRequest)
o.output = Shapes::ShapeRef.new(shape: ListApprovedOriginsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_bots, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListBots"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/bots"
o.input = Shapes::ShapeRef.new(shape: ListBotsRequest)
o.output = Shapes::ShapeRef.new(shape: ListBotsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_contact_flows, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListContactFlows"
o.http_method = "GET"
o.http_request_uri = "/contact-flows-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListContactFlowsRequest)
o.output = Shapes::ShapeRef.new(shape: ListContactFlowsResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_hours_of_operations, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListHoursOfOperations"
o.http_method = "GET"
o.http_request_uri = "/hours-of-operations-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListHoursOfOperationsRequest)
o.output = Shapes::ShapeRef.new(shape: ListHoursOfOperationsResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_instance_attributes, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListInstanceAttributes"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/attributes"
o.input = Shapes::ShapeRef.new(shape: ListInstanceAttributesRequest)
o.output = Shapes::ShapeRef.new(shape: ListInstanceAttributesResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_instance_storage_configs, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListInstanceStorageConfigs"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/storage-configs"
o.input = Shapes::ShapeRef.new(shape: ListInstanceStorageConfigsRequest)
o.output = Shapes::ShapeRef.new(shape: ListInstanceStorageConfigsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_instances, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListInstances"
o.http_method = "GET"
o.http_request_uri = "/instance"
o.input = Shapes::ShapeRef.new(shape: ListInstancesRequest)
o.output = Shapes::ShapeRef.new(shape: ListInstancesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_integration_associations, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListIntegrationAssociations"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/integration-associations"
o.input = Shapes::ShapeRef.new(shape: ListIntegrationAssociationsRequest)
o.output = Shapes::ShapeRef.new(shape: ListIntegrationAssociationsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_lambda_functions, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListLambdaFunctions"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/lambda-functions"
o.input = Shapes::ShapeRef.new(shape: ListLambdaFunctionsRequest)
o.output = Shapes::ShapeRef.new(shape: ListLambdaFunctionsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_lex_bots, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListLexBots"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/lex-bots"
o.input = Shapes::ShapeRef.new(shape: ListLexBotsRequest)
o.output = Shapes::ShapeRef.new(shape: ListLexBotsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_phone_numbers, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListPhoneNumbers"
o.http_method = "GET"
o.http_request_uri = "/phone-numbers-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListPhoneNumbersRequest)
o.output = Shapes::ShapeRef.new(shape: ListPhoneNumbersResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_prompts, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListPrompts"
o.http_method = "GET"
o.http_request_uri = "/prompts-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListPromptsRequest)
o.output = Shapes::ShapeRef.new(shape: ListPromptsResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_queue_quick_connects, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListQueueQuickConnects"
o.http_method = "GET"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/quick-connects"
o.input = Shapes::ShapeRef.new(shape: ListQueueQuickConnectsRequest)
o.output = Shapes::ShapeRef.new(shape: ListQueueQuickConnectsResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_queues, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListQueues"
o.http_method = "GET"
o.http_request_uri = "/queues-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListQueuesRequest)
o.output = Shapes::ShapeRef.new(shape: ListQueuesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_quick_connects, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListQuickConnects"
o.http_method = "GET"
o.http_request_uri = "/quick-connects/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListQuickConnectsRequest)
o.output = Shapes::ShapeRef.new(shape: ListQuickConnectsResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_routing_profile_queues, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListRoutingProfileQueues"
o.http_method = "GET"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/queues"
o.input = Shapes::ShapeRef.new(shape: ListRoutingProfileQueuesRequest)
o.output = Shapes::ShapeRef.new(shape: ListRoutingProfileQueuesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_routing_profiles, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListRoutingProfiles"
o.http_method = "GET"
o.http_request_uri = "/routing-profiles-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListRoutingProfilesRequest)
o.output = Shapes::ShapeRef.new(shape: ListRoutingProfilesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_security_keys, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListSecurityKeys"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/security-keys"
o.input = Shapes::ShapeRef.new(shape: ListSecurityKeysRequest)
o.output = Shapes::ShapeRef.new(shape: ListSecurityKeysResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_security_profiles, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListSecurityProfiles"
o.http_method = "GET"
o.http_request_uri = "/security-profiles-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListSecurityProfilesRequest)
o.output = Shapes::ShapeRef.new(shape: ListSecurityProfilesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_tags_for_resource, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListTagsForResource"
o.http_method = "GET"
o.http_request_uri = "/tags/{resourceArn}"
o.input = Shapes::ShapeRef.new(shape: ListTagsForResourceRequest)
o.output = Shapes::ShapeRef.new(shape: ListTagsForResourceResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:list_use_cases, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListUseCases"
o.http_method = "GET"
o.http_request_uri = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases"
o.input = Shapes::ShapeRef.new(shape: ListUseCasesRequest)
o.output = Shapes::ShapeRef.new(shape: ListUseCasesResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_user_hierarchy_groups, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListUserHierarchyGroups"
o.http_method = "GET"
o.http_request_uri = "/user-hierarchy-groups-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListUserHierarchyGroupsRequest)
o.output = Shapes::ShapeRef.new(shape: ListUserHierarchyGroupsResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:list_users, Seahorse::Model::Operation.new.tap do |o|
o.name = "ListUsers"
o.http_method = "GET"
o.http_request_uri = "/users-summary/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: ListUsersRequest)
o.output = Shapes::ShapeRef.new(shape: ListUsersResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o[:pager] = Aws::Pager.new(
limit_key: "max_results",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:resume_contact_recording, Seahorse::Model::Operation.new.tap do |o|
o.name = "ResumeContactRecording"
o.http_method = "POST"
o.http_request_uri = "/contact/resume-recording"
o.input = Shapes::ShapeRef.new(shape: ResumeContactRecordingRequest)
o.output = Shapes::ShapeRef.new(shape: ResumeContactRecordingResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:start_chat_contact, Seahorse::Model::Operation.new.tap do |o|
o.name = "StartChatContact"
o.http_method = "PUT"
o.http_request_uri = "/contact/chat"
o.input = Shapes::ShapeRef.new(shape: StartChatContactRequest)
o.output = Shapes::ShapeRef.new(shape: StartChatContactResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
end)
api.add_operation(:start_contact_recording, Seahorse::Model::Operation.new.tap do |o|
o.name = "StartContactRecording"
o.http_method = "POST"
o.http_request_uri = "/contact/start-recording"
o.input = Shapes::ShapeRef.new(shape: StartContactRecordingRequest)
o.output = Shapes::ShapeRef.new(shape: StartContactRecordingResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:start_outbound_voice_contact, Seahorse::Model::Operation.new.tap do |o|
o.name = "StartOutboundVoiceContact"
o.http_method = "PUT"
o.http_request_uri = "/contact/outbound-voice"
o.input = Shapes::ShapeRef.new(shape: StartOutboundVoiceContactRequest)
o.output = Shapes::ShapeRef.new(shape: StartOutboundVoiceContactResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: DestinationNotAllowedException)
o.errors << Shapes::ShapeRef.new(shape: OutboundContactNotPermittedException)
end)
api.add_operation(:start_task_contact, Seahorse::Model::Operation.new.tap do |o|
o.name = "StartTaskContact"
o.http_method = "PUT"
o.http_request_uri = "/contact/task"
o.input = Shapes::ShapeRef.new(shape: StartTaskContactRequest)
o.output = Shapes::ShapeRef.new(shape: StartTaskContactResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:stop_contact, Seahorse::Model::Operation.new.tap do |o|
o.name = "StopContact"
o.http_method = "POST"
o.http_request_uri = "/contact/stop"
o.input = Shapes::ShapeRef.new(shape: StopContactRequest)
o.output = Shapes::ShapeRef.new(shape: StopContactResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ContactNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:stop_contact_recording, Seahorse::Model::Operation.new.tap do |o|
o.name = "StopContactRecording"
o.http_method = "POST"
o.http_request_uri = "/contact/stop-recording"
o.input = Shapes::ShapeRef.new(shape: StopContactRecordingRequest)
o.output = Shapes::ShapeRef.new(shape: StopContactRecordingResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:suspend_contact_recording, Seahorse::Model::Operation.new.tap do |o|
o.name = "SuspendContactRecording"
o.http_method = "POST"
o.http_request_uri = "/contact/suspend-recording"
o.input = Shapes::ShapeRef.new(shape: SuspendContactRecordingRequest)
o.output = Shapes::ShapeRef.new(shape: SuspendContactRecordingResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:tag_resource, Seahorse::Model::Operation.new.tap do |o|
o.name = "TagResource"
o.http_method = "POST"
o.http_request_uri = "/tags/{resourceArn}"
o.input = Shapes::ShapeRef.new(shape: TagResourceRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:untag_resource, Seahorse::Model::Operation.new.tap do |o|
o.name = "UntagResource"
o.http_method = "DELETE"
o.http_request_uri = "/tags/{resourceArn}"
o.input = Shapes::ShapeRef.new(shape: UntagResourceRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:update_agent_status, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateAgentStatus"
o.http_method = "POST"
o.http_request_uri = "/agent-status/{InstanceId}/{AgentStatusId}"
o.input = Shapes::ShapeRef.new(shape: UpdateAgentStatusRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_contact_attributes, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateContactAttributes"
o.http_method = "POST"
o.http_request_uri = "/contact/attributes"
o.input = Shapes::ShapeRef.new(shape: UpdateContactAttributesRequest)
o.output = Shapes::ShapeRef.new(shape: UpdateContactAttributesResponse)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_contact_flow_content, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateContactFlowContent"
o.http_method = "POST"
o.http_request_uri = "/contact-flows/{InstanceId}/{ContactFlowId}/content"
o.input = Shapes::ShapeRef.new(shape: UpdateContactFlowContentRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidContactFlowException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_contact_flow_name, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateContactFlowName"
o.http_method = "POST"
o.http_request_uri = "/contact-flows/{InstanceId}/{ContactFlowId}/name"
o.input = Shapes::ShapeRef.new(shape: UpdateContactFlowNameRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_hours_of_operation, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateHoursOfOperation"
o.http_method = "POST"
o.http_request_uri = "/hours-of-operations/{InstanceId}/{HoursOfOperationId}"
o.input = Shapes::ShapeRef.new(shape: UpdateHoursOfOperationRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_instance_attribute, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateInstanceAttribute"
o.http_method = "POST"
o.http_request_uri = "/instance/{InstanceId}/attribute/{AttributeType}"
o.input = Shapes::ShapeRef.new(shape: UpdateInstanceAttributeRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:update_instance_storage_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateInstanceStorageConfig"
o.http_method = "POST"
o.http_request_uri = "/instance/{InstanceId}/storage-config/{AssociationId}"
o.input = Shapes::ShapeRef.new(shape: UpdateInstanceStorageConfigRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
end)
api.add_operation(:update_queue_hours_of_operation, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQueueHoursOfOperation"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/hours-of-operation"
o.input = Shapes::ShapeRef.new(shape: UpdateQueueHoursOfOperationRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_queue_max_contacts, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQueueMaxContacts"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/max-contacts"
o.input = Shapes::ShapeRef.new(shape: UpdateQueueMaxContactsRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_queue_name, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQueueName"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/name"
o.input = Shapes::ShapeRef.new(shape: UpdateQueueNameRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_queue_outbound_caller_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQueueOutboundCallerConfig"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/outbound-caller-config"
o.input = Shapes::ShapeRef.new(shape: UpdateQueueOutboundCallerConfigRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_queue_status, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQueueStatus"
o.http_method = "POST"
o.http_request_uri = "/queues/{InstanceId}/{QueueId}/status"
o.input = Shapes::ShapeRef.new(shape: UpdateQueueStatusRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_quick_connect_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQuickConnectConfig"
o.http_method = "POST"
o.http_request_uri = "/quick-connects/{InstanceId}/{QuickConnectId}/config"
o.input = Shapes::ShapeRef.new(shape: UpdateQuickConnectConfigRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_quick_connect_name, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateQuickConnectName"
o.http_method = "POST"
o.http_request_uri = "/quick-connects/{InstanceId}/{QuickConnectId}/name"
o.input = Shapes::ShapeRef.new(shape: UpdateQuickConnectNameRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_routing_profile_concurrency, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateRoutingProfileConcurrency"
o.http_method = "POST"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/concurrency"
o.input = Shapes::ShapeRef.new(shape: UpdateRoutingProfileConcurrencyRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_routing_profile_default_outbound_queue, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateRoutingProfileDefaultOutboundQueue"
o.http_method = "POST"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/default-outbound-queue"
o.input = Shapes::ShapeRef.new(shape: UpdateRoutingProfileDefaultOutboundQueueRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_routing_profile_name, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateRoutingProfileName"
o.http_method = "POST"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/name"
o.input = Shapes::ShapeRef.new(shape: UpdateRoutingProfileNameRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_routing_profile_queues, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateRoutingProfileQueues"
o.http_method = "POST"
o.http_request_uri = "/routing-profiles/{InstanceId}/{RoutingProfileId}/queues"
o.input = Shapes::ShapeRef.new(shape: UpdateRoutingProfileQueuesRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_hierarchy, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserHierarchy"
o.http_method = "POST"
o.http_request_uri = "/users/{InstanceId}/{UserId}/hierarchy"
o.input = Shapes::ShapeRef.new(shape: UpdateUserHierarchyRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_hierarchy_group_name, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserHierarchyGroupName"
o.http_method = "POST"
o.http_request_uri = "/user-hierarchy-groups/{InstanceId}/{HierarchyGroupId}/name"
o.input = Shapes::ShapeRef.new(shape: UpdateUserHierarchyGroupNameRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: DuplicateResourceException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_hierarchy_structure, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserHierarchyStructure"
o.http_method = "POST"
o.http_request_uri = "/user-hierarchy-structure/{InstanceId}"
o.input = Shapes::ShapeRef.new(shape: UpdateUserHierarchyStructureRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_identity_info, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserIdentityInfo"
o.http_method = "POST"
o.http_request_uri = "/users/{InstanceId}/{UserId}/identity-info"
o.input = Shapes::ShapeRef.new(shape: UpdateUserIdentityInfoRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_phone_config, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserPhoneConfig"
o.http_method = "POST"
o.http_request_uri = "/users/{InstanceId}/{UserId}/phone-config"
o.input = Shapes::ShapeRef.new(shape: UpdateUserPhoneConfigRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_routing_profile, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserRoutingProfile"
o.http_method = "POST"
o.http_request_uri = "/users/{InstanceId}/{UserId}/routing-profile"
o.input = Shapes::ShapeRef.new(shape: UpdateUserRoutingProfileRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
api.add_operation(:update_user_security_profiles, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateUserSecurityProfiles"
o.http_method = "POST"
o.http_request_uri = "/users/{InstanceId}/{UserId}/security-profiles"
o.input = Shapes::ShapeRef.new(shape: UpdateUserSecurityProfilesRequest)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
o.errors << Shapes::ShapeRef.new(shape: InternalServiceException)
end)
end
end
end
| 74.342345 | 213 | 0.762996 |
1ab32929a4254f9b1f35782eddf09f7face542ce
| 995 |
cask 'razer-synapse' do
version '1.60'
sha256 '5835614db1d24bedeb346eb5a195558ac92cf372abc58da8a434ff6de1325808'
url "http://dl.razerzone.com/drivers/Synapse2/mac/Razer_Synapse_Mac_Driver_v#{version}.dmg"
name 'Razer Synapse'
homepage 'https://www.razerzone.com/synapse/'
depends_on macos: '>= :lion'
pkg 'Razer Synapse.pkg'
uninstall script: '/Applications/Utilities/Uninstall Razer Synapse.app/Contents/MacOS/Uninstall Razer Synapse',
pkgutil: 'com.razerzone.*',
quit: [
'com.razerzone.RzUpdater',
'com.razerzone.rzdeviceengine',
],
launchctl: [
'com.razer.rzupdater',
'com.razerzone.rzdeviceengine',
]
zap delete: [
'~/Library/Preferenecs/com.razer.*',
'~/Library/Preferenecs/com.razerzone.*',
]
caveats do
reboot
end
end
| 30.151515 | 116 | 0.565829 |
ac89634cd692528e142eedd4adad7e0afb17c225
| 1,106 |
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'flutter_background_geolocation'
s.version = '0.2.0'
s.summary = 'The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android. '
s.description = <<-DESC
The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Transistor Softwrae' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'CocoaLumberjack', '~> 3.0'
s.libraries = 'sqlite3', 'z'
s.vendored_frameworks = ['TSLocationManager.framework']
s.static_framework = true
s.ios.deployment_target = '8.0'
end
| 39.5 | 175 | 0.644665 |
ab071c4305c39faeba3ace844b3a0479b5367d80
| 1,181 |
# encoding: utf-8
module SceneToolkit
class CLI < Optitron::CLI
desc "Generate missing or invalid release playlists"
opt "force", "Force the modification of existing files"
def playlists(directory_string)
each_release(directory_string) do |release|
if release.valid_playlist?
heading(release, :green) do
info("Skipping. Playlist seems to be OK.")
end
else
heading(release, :green) do
print_errors(release)
playlist_filename = release.heuristic_filename("m3u")
playlist_path = File.join(release.path, playlist_filename)
if File.exist?(playlist_path) and not params["force"]
error "Playlist #{playlist_filename} already exists. Use --force to replace it."
else
info "Generating new playlist: #{playlist_filename}"
File.open(playlist_path, "w") do |playlist_file|
release.mp3_files.map { |f| File.basename(f) }.each do |mp3_file|
playlist_file.puts mp3_file
end
end
end
end
end
end
end
end
end
| 31.918919 | 94 | 0.594412 |
bffdfe10a7e711f81896645fa86c91cdd1731730
| 210 |
# frozen_string_literal: true
class AddCompletionTimeToMentorMaterials < ActiveRecord::Migration[6.1]
def change
add_column :mentor_materials, :completion_time_in_minutes, :integer, null: true
end
end
| 26.25 | 83 | 0.804762 |
61a8d831b0d0a752cc22217ab9205ffe135ced0c
| 1,920 |
class ManageIQ::Providers::Openstack::CloudManager::Vm
module RemoteConsole
def console_supported?(type)
%w(SPICE VNC).include?(type.upcase)
end
def validate_remote_console_acquire_ticket(protocol, options = {})
raise(MiqException::RemoteConsoleNotSupportedError,
"#{protocol} protocol not enabled for this vm") unless protocol.to_sym == :html5
raise(MiqException::RemoteConsoleNotSupportedError,
"#{protocol} remote console requires the vm to be registered with a management system.") if ext_management_system.nil?
options[:check_if_running] = true unless options.key?(:check_if_running)
raise(MiqException::RemoteConsoleNotSupportedError,
"#{protocol} remote console requires the vm to be running.") if options[:check_if_running] && state != "on"
end
def remote_console_acquire_ticket(_userid, _console_type)
url = ext_management_system.with_provider_connection({:service => "Compute", :tenant_name => cloud_tenant.name}) do |con|
response = con.get_vnc_console(ems_ref, 'novnc')
return nil if response.body.fetch_path('console', 'type') != 'novnc'
response.body.fetch_path('console', 'url')
end
{:remote_url => url, :proto => 'remote'}
end
def remote_console_acquire_ticket_queue(protocol, userid)
task_opts = {
:action => "acquiring Instance #{name} #{protocol.to_s.upcase} remote console ticket for user #{userid}",
:userid => userid
}
queue_opts = {
:class_name => self.class.name,
:instance_id => id,
:method_name => 'remote_console_acquire_ticket',
:priority => MiqQueue::HIGH_PRIORITY,
:role => 'ems_operations',
:zone => my_zone,
:args => [userid, protocol]
}
MiqTask.generic_action_with_callback(task_opts, queue_opts)
end
end
end
| 40 | 130 | 0.665625 |
0170c5972fc6cf0d7d25821cd2edde3d34a9c9b7
| 5,570 |
=begin
Ruby InsightVM API Client
OpenAPI spec version: 3
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.0
=end
require 'date'
module Rapid7VmConsole
#
class ReportConfigDatabaseCredentialsResource
# ${report.config.database.credential.password.description}
attr_accessor :password
# ${report.config.database.credential.username.description}
attr_accessor :username
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'password' => :'password',
:'username' => :'username'
}
end
# Attribute type mapping.
def self.swagger_types
{
:'password' => :'String',
:'username' => :'String'
}
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
return unless attributes.is_a?(Hash)
# convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
if attributes.has_key?(:'password')
self.password = attributes[:'password']
end
if attributes.has_key?(:'username')
self.username = attributes[:'username']
end
end
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
invalid_properties
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
true
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
password == o.password &&
username == o.username
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
self == o
end
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[password, username].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)
self.class.swagger_types.each_pair do |key, type|
if type =~ /\AArray<(.*)>/i
# check to ensure the input is an array given that the the attribute
# is documented as an array but the input is not
if attributes[self.class.attribute_map[key]].is_a?(Array)
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
end
elsif !attributes[self.class.attribute_map[key]].nil?
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
end # or else data not found in attributes(hash), not an issue as the data can be optional
end
self
end
# Deserializes the data based on type
# @param string type Data type
# @param string value Value to be deserialized
# @return [Object] Deserialized data
def _deserialize(type, value)
case type.to_sym
when :DateTime
DateTime.parse(value)
when :Date
Date.parse(value)
when :String
value.to_s
when :Integer
value.to_i
when :Float
value.to_f
when :BOOLEAN
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
false
end
when :Object
# generic object (usually a Hash), return directly
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
k_type = Regexp.last_match[:k_type]
v_type = Regexp.last_match[:v_type]
{}.tap do |hash|
value.each do |k, v|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
end
end
else # model
temp_model = Rapid7VmConsole.const_get(type).new
temp_model.build_from_hash(value)
end
end
# Returns the string representation of the object
# @return [String] String presentation of the object
def to_s
to_hash.to_s
end
# to_body is an alias to to_hash (backward compatibility)
# @return [Hash] Returns the object in the form of hash
def to_body
to_hash
end
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
hash[param] = _to_hash(value)
end
hash
end
# Outputs non-array value in the form of hash
# For object, use to_hash. Otherwise, just return the value
# @param [Object] value Any valid value
# @return [Hash] Returns the value in the form of hash
def _to_hash(value)
if value.is_a?(Array)
value.compact.map { |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end
end
end
| 28.71134 | 107 | 0.61939 |
1c6e0d50ad9268333996b077be982de0379a6b5a
| 1,383 |
require_relative '../../../shared/core_plugin_test_helper.rb'
#-----------------------------------------------------------------------#
# Plugin Definition
#-----------------------------------------------------------------------#
class PluginManagerCliDefinitionTests < Minitest::Test
include CorePluginUnitHelper
@@orig_home = Dir.home
def setup
mock_path = File.expand_path "test/unit/mock"
@config_dir_path = File.join(mock_path, 'config_dirs')
ENV['HOME'] = File.join(@config_dir_path, 'fakehome')
end
def teardown
reset_globals
end
def reset_globals # TODO: REFACTOR this with install/loader tests
ENV['HOME'] = @@orig_home
ENV['INSPEC_CONFIG_DIR'] = nil
Inspec::Plugin::V2::Registry.instance.__reset
end
def test_plugin_registered
loader = Inspec::Plugin::V2::Loader.new
loader.load_all # We want to ensure it is auto-loaded
assert registry.known_plugin?(:'inspec-plugin-manager-cli'), 'inspec-plugin-manager-cli should be registered'
assert registry.loaded_plugin?(:'inspec-plugin-manager-cli'), 'inspec-plugin-manager-cli should be loaded'
status = registry[:'inspec-plugin-manager-cli']
assert_equal 2, status.api_generation, 'inspec-plugin-manager-cli should be v2'
assert_includes status.plugin_types, :cli_command, 'inspec-plugin-manager-cli should have cli_command activators'
end
end
| 34.575 | 117 | 0.661605 |
38069b51418720b607475cf1279514a24a0ae7e2
| 1,204 |
# frozen_string_literal: true
require_relative 'test_helper'
require 'logger'
clock_class = Dynflow::Clock
describe clock_class do
let(:clock) { clock_class.spawn 'clock' }
it 'refuses who without #<< method' do
_(-> { clock.ping Object.new, 0.1, :pong }).must_raise TypeError
clock.ping [], 0.1, :pong
end
it 'pongs' do
q = Queue.new
start = Time.now
clock.ping q, 0.1, o = Object.new
assert_equal o, q.pop
finish = Time.now
assert_in_delta 0.1, finish - start, 0.08
end
it 'pongs on expected times' do
q = Queue.new
start = Time.now
clock.ping q, 0.3, :a
clock.ping q, 0.1, :b
clock.ping q, 0.2, :c
assert_equal :b, q.pop
assert_in_delta 0.1, Time.now - start, 0.08
assert_equal :c, q.pop
assert_in_delta 0.2, Time.now - start, 0.08
assert_equal :a, q.pop
assert_in_delta 0.3, Time.now - start, 0.08
end
it 'works under stress' do
threads = Array.new(4) do
Thread.new do
q = Queue.new
times = 20
times.times { |i| clock.ping q, rand, i }
assert_equal (0...times).to_a, Array.new(times) { q.pop }.sort
end
end
threads.each &:join
end
end
| 21.890909 | 70 | 0.612957 |
399bcb5435550af02c59ffc3cff50d0a1f1fd822
| 1,509 |
require 'rails_helper'
describe JobApplications::CoverLettersController, type: :routing do
describe 'routing' do
it 'routes to #index' do
expected = 'job_applications/cover_letters#index'
expect(get: '/cover_letters').to route_to(expected)
end
it 'routes to #show' do
expected = { controller: 'job_applications/cover_letters', action: 'show',
job_application_id: '1' }
expect(get: '/job_applications/1/cover_letter').to route_to(expected)
end
it 'routes to #create' do
expected = { controller: 'job_applications/cover_letters', action: 'create',
job_application_id: '1' }
expect(post: '/job_applications/1/cover_letter').to route_to(expected)
end
it 'routes to #update via PUT' do
expected = { controller: 'job_applications/cover_letters', action: 'update',
job_application_id: '1' }
expect(put: '/job_applications/1/cover_letter').to route_to(expected)
end
it 'routes to #update via PATCH' do
expected = { controller: 'job_applications/cover_letters', action: 'update',
job_application_id: '1' }
expect(patch: '/job_applications/1/cover_letter').to route_to(expected)
end
it 'routes to #destroy' do
expected = { controller: 'job_applications/cover_letters', action: 'destroy',
job_application_id: '1' }
expect(delete: '/job_applications/1/cover_letter').to route_to(expected)
end
end
end
| 41.916667 | 83 | 0.659377 |
b91cf8b1f85b17fa50098a31828170cddef246ac
| 1,509 |
class VariantGroup < ActiveRecord::Base
include Moderated
include Subscribable
include WithAudits
include SoftDeletable
include Flaggable
include Commentable
has_many :variant_group_variants
has_many :variants, through: :variant_group_variants
has_and_belongs_to_many :sources
def self.index_scope
includes(variants: [:gene, :evidence_items_by_status, :variant_types])
end
def self.view_scope
includes(variants: [:gene, :evidence_items_by_status, :variant_types, :variant_groups])
end
def self.datatable_scope
joins(variants: [:gene, :evidence_items])
end
def additional_changes_info
@@additional_variant_group_changes ||= {
'sources' => {
output_field_name: 'source_ids',
creation_query: ->(x) { Source.get_sources_from_list(x) },
application_query: ->(x) { Source.find(x) },
id_field: 'id'
},
'variants' => {
output_field_name: 'variant_ids',
creation_query: -> (x) { Variant.find(x) },
application_query: -> (x) { Variant.find(x) },
id_field: 'id',
}
}
end
def state_params
gene = self.variants.eager_load(:gene).first.gene
{
variant_group: {
name: self.name,
id: self.id
},
gene: {
id: gene.id,
name: gene.name
}
}
end
def lifecycle_events
{
last_modified: :last_applied_change,
created: :creation_audit,
last_commented_on: :last_review_event,
}
end
end
| 23.578125 | 91 | 0.646123 |
ff3c0cb914e507d4bbddefb924b7379ce1f4486d
| 1,682 |
# frozen_string_literal: true
module Mutations
module AuditEvents
module ExternalAuditEventDestinations
class Update < Base
graphql_name 'ExternalAuditEventDestinationUpdate'
authorize :admin_external_audit_events
argument :id, ::Types::GlobalIDType[::AuditEvents::ExternalAuditEventDestination],
required: true,
description: 'ID of external audit event destination to destroy.'
argument :destinationUrl, GraphQL::Types::String,
required: false,
description: 'Destination URL to change.'
field :external_audit_event_destination, EE::Types::AuditEvents::ExternalAuditEventDestinationType,
null: true,
description: 'Updated destination.'
def resolve(id:, destination_url:)
destination = authorized_find!(id)
audit_update(destination) if destination.update(destination_url: destination_url)
{
external_audit_event_destination: (destination if destination.persisted?),
errors: Array(destination.errors)
}
end
private
def audit_update(destination)
return unless destination.previous_changes.any?
message = "Updated event streaming destination from #{destination.previous_changes['destination_url'].join(' to ')}"
audit(destination, action: :update, extra_context: { message: message })
end
def find_object(destination_gid)
GitlabSchema.object_from_id(destination_gid, expected_type: ::AuditEvents::ExternalAuditEventDestination).sync
end
end
end
end
end
| 32.980392 | 126 | 0.667658 |
791ededec62bfa8ba7273f2b130a8ce2b1a353b3
| 225 |
def upgrade(ta, td, a, d)
a["scheduler"]["disk_allocation_ratio"] = ta["scheduler"]["disk_allocation_ratio"]
return a, d
end
def downgrade(ta, td, a, d)
a["scheduler"].delete("disk_allocation_ratio")
return a, d
end
| 22.5 | 84 | 0.693333 |
28f4af1f302ad96488ff3dbf074022f8425895b6
| 3,475 |
# frozen_string_literal: true
require 'vk/api/objects'
require 'vk/schema/namespace'
module Vk
module API
class Wall < Vk::Schema::Namespace
# @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
class WallpostAttachment < Vk::Schema::Object
# @return [API::Photos::Photo] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :photo, Dry::Types[API::Photos::Photo].optional.default(nil)
# @return [API::Wall::PostedPhoto] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :posted_photo, Dry::Types[API::Wall::PostedPhoto].optional.default(nil)
# @return [API::Audio::AudioFull] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :audio, Dry::Types[API::Audio::AudioFull].optional.default(nil)
# @return [API::Video::Video] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :video, Dry::Types[API::Video::Video].optional.default(nil)
# @return [API::Docs::Doc] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :doc, Dry::Types[API::Docs::Doc].optional.default(nil)
# @return [API::Wall::WallLink] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :link, Dry::Types[API::Wall::WallLink].optional.default(nil)
# @return [API::Wall::Graffiti] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :graffiti, Dry::Types[API::Wall::Graffiti].optional.default(nil)
# @return [API::Wall::AttachedNote] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :note, Dry::Types[API::Wall::AttachedNote].optional.default(nil)
# @return [API::Wall::AppPost] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :app, Dry::Types[API::Wall::AppPost].optional.default(nil)
# @return [API::Polls::Poll] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :poll, Dry::Types[API::Polls::Poll].optional.default(nil)
# @return [API::Pages::WikipageFull] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :page, Dry::Types[API::Pages::WikipageFull].optional.default(nil)
# @return [API::Photos::PhotoAlbum] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :album, Dry::Types[API::Photos::PhotoAlbum].optional.default(nil)
# @return [Array] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :photos_list, API::Types::Coercible::Array.member(API::Types::Coercible::String).optional.default(nil)
# @return [API::Market::MarketAlbum] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :market_market_album, Dry::Types[API::Market::MarketAlbum].optional.default(nil)
# @return [API::Market::MarketItem] @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
attribute :market, Dry::Types[API::Market::MarketItem].optional.default(nil)
# @return [String] Attachment type
attribute :type, API::Types::Coercible::String.enum("photo", "posted_photo", "audio", "video", "doc", "link", "graffiti", "note", "app", "poll", "page", "album", "photos_list", "market_market_album", "market")
end
end
end
end
| 75.543478 | 217 | 0.69036 |
d5267db26a7a0dbb8f3105199b1a564c8ee066f8
| 210 |
class CreateProjects < ActiveRecord::Migration[6.0]
def change
create_table :projects do |t|
t.column(:title, :string)
t.column(:employee_id, :integer)
t.timestamps()
end
end
end
| 19.090909 | 51 | 0.652381 |
b9c461e10fa709187763f9634e2bab95e286e2f3
| 488 |
module Relevance; end
module Relevance::StringAdditions
# preferred over constantize where failure should be unexceptional
def to_const(failval=false)
components = sub(/^::/,'').split('::')
components.inject(Object) do |c,n|
return failval unless c.const_defined?(n)
c.const_get(n)
end
end
# convert anything to a valid Ruby variable name
def variableize
underscore.gsub('/','_')
end
end
String.class_eval {include Relevance::StringAdditions}
| 25.684211 | 68 | 0.704918 |
33d2e463a38b35fa9d8735dc680be2d85ba49f9c
| 692 |
cask "tuxera-ntfs" do
version "2021"
sha256 :no_check # required as upstream package is updated in-place
url "https://tuxera.com/mac/tuxerantfs_#{version}.dmg"
name "Tuxera NTFS"
desc "File system and storage management software"
homepage "https://ntfsformac.tuxera.com/"
livecheck do
url :homepage
regex(/href=.*?tuxerantfs[._-]?v?(\d+(?:\.\d+)*)\.dmg/i)
end
auto_updates true
pkg ".packages/Flat/Install Tuxera NTFS.mpkg"
uninstall quit: [
"com.tuxera.Tuxera-NTFS",
"com.tuxera.filesystems.ntfs.agent",
],
pkgutil: [
"com.tuxera.pkg.Tuxera_NTFS",
"com.tuxera.pkg.Tuxera_NTFS_compat",
]
end
| 24.714286 | 69 | 0.634393 |
4a7ed52b15d410eb853eb9ded78089f6554fe5cb
| 658 |
def talk
puts 'Olá, como você está?'
end
talk
# Meu exemplo
def talk2 (first_name, last_name)
puts "Olá #{first_name} #{last_name}, como você está?"
end
print 'Fala seu nome'
first_name = gets.chomp
print 'Seu sobrenome'
last_name = gets.chomp
talk2(first_name, last_name)
#Exemplo da aula
def talk3(first_name, last_name)
puts "Oie! #{first_name} #{last_name}"
end
first_name = 'Annie'
last_name = 'R Delacroix'
talk3(first_name, last_name)
# Segundo exemplo
# Caso eu não queira que seja obrigatorio passar um parametro
def signal(color = 'vermelho')
puts "O sinal está #{color}"
end
signal
color = 'verde'
signal(color)
| 16.45 | 61 | 0.709726 |
6ac963e1efe8865b3a4f2cc921906651fc8c2944
| 772 |
# frozen_string_literal: true
require "active_support/backtrace_cleaner"
module Rails
class BacktraceCleaner < ActiveSupport::BacktraceCleaner
APP_DIRS_PATTERN = /\A\/?(?:app|config|lib|test|\(\w*\))/
RENDER_TEMPLATE_PATTERN = /:in `.*_\w+_{2,3}\d+_\d+'/
def initialize
super
@root = "#{Rails.root}/"
add_filter do |line|
line.start_with?(@root) ? line.from(@root.size) : line
end
add_filter do |line|
if RENDER_TEMPLATE_PATTERN.match?(line)
line.sub(RENDER_TEMPLATE_PATTERN, "")
else
line
end
end
add_filter do |line|
line.start_with?("./") ? line.from(1) : line
end
add_silencer { |line| !APP_DIRS_PATTERN.match?(line) }
end
end
end
| 25.733333 | 62 | 0.607513 |
7ab0705f8e32697373f1c8205d8aa23011e4b1d0
| 185 |
# Store in memory the last log message received.
class InMemoryBatchAppender < SemanticLogger::Subscriber
attr_accessor :message
def batch(logs)
self.message = logs
end
end
| 18.5 | 56 | 0.762162 |
1d09223d043dc7b90ae31f141a36a9b2f7a56956
| 1,163 |
# Unlight
# Copyright(c)2019 CPA
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
module Unlight
# 台詞を保存するクラス
class Dialogue < Sequel::Model
plugin :validation_class_methods
plugin :hook_class_methods
plugin :caching, CACHE, ignore_exceptions: true
# インサート時の前処理
before_create do
self.created_at = Time.now.utc
end
# インサートとアップデート時の前処理
before_save do
self.updated_at = Time.now.utc
end
# アップデート後の後理処
after_save do
Unlight::Dialogue.refresh_data_version
end
# 全体データバージョンを返す
def self.data_version
ret = cache_store.get('DialogueVersion')
unless ret
ret = refresh_data_version
cache_store.set('DialogueVersion', ret)
end
ret
end
# 全体データバージョンを更新(管理ツールが使う)
def self.refresh_data_version
m = Unlight::Dialogue.order(:updated_at).last
if m
cache_store.set('DialogueVersion', m.version)
m.version
else
0
end
end
# バージョン情報(3ヶ月で循環するのでそれ以上クライアント側で保持してはいけない)
def version
updated_at.to_i % MODEL_CACHE_INT
end
end
end
| 21.145455 | 53 | 0.6681 |
1d2d109af1f2aa146aaaf5ddc1ef2de25bf3429b
| 1,068 |
# This plugin is used to demonstrate plugin dependencies and calling another plugin
# The functionality could be done just by calling roll with +1 and as such is completely useless other than as an example
# But if you really want to use it more power to you
class RollPlusOne < Plugin
def initialize
super
@min_args = 1
@commands = %w(rollplusone)
@help_text = 'Roll some dice and add one- 4d5 - see the dicebag ruby gem online for formatting.'
end
def go(source, _command, args, bot)
# We are directly using the result so we want to disable multithreading (this is also the default for plugin calls)
result = bot.run_command('roll', args, [:plugin, self, source], multithread: false)
# no fancy error handling, this is just a sample. result[0] gives error codes, see docs / bot.rb
return if result[1].nil?
bot.say(self, source, (result[1].total + 1).to_s)
end
def on_text_received(bot, source, text)
# do nothing, we'll use result ourself in go
# this squelchs the default text from the roll command
end
end
| 42.72 | 121 | 0.719101 |
bb6d9100fa77fa6a0d2a86f5027d40ba5017db1a
| 1,516 |
require 'raven/base'
module GitalyServer
module Sentry
def self.enabled?
ENV['SENTRY_DSN'].present?
end
end
end
module GitalyServer
module Sentry
class URLSanitizer < Raven::Processor
include GitalyServer::Utils
def process(data)
sanitize_message(data)
sanitize_fingerprint(data)
sanitize_exceptions(data)
sanitize_logentry(data)
data
end
private
def sanitize_logentry(data)
logentry = data[:logentry]
return unless logentry.is_a?(Hash)
logentry[:message] = sanitize_url(logentry[:message])
end
def sanitize_fingerprint(data)
fingerprint = data[:fingerprint]
return unless fingerprint.is_a?(Array)
fingerprint[-1] = sanitize_url(fingerprint.last)
end
def sanitize_exceptions(data)
exception = data[:exception]
return unless exception.is_a?(Hash)
values = exception[:values]
return unless values.is_a?(Array)
values.each { |exception_data| exception_data[:value] = sanitize_url(exception_data[:value]) }
end
def sanitize_message(data)
data[:message] = sanitize_url(data[:message])
end
end
end
end
Raven.configure do |config|
config.release = ENV['GITALY_VERSION'].presence
config.sanitize_fields = %w[gitaly-servers authorization]
config.processors += [GitalyServer::Sentry::URLSanitizer]
config.current_environment = ENV['SENTRY_ENVIRONMENT'].presence
end
| 23.6875 | 102 | 0.670185 |
0885c1f9aa0ed47926a0e16277c91363735947b7
| 1,872 |
# frozen_string_literal: true
module KodiClient
module Methods
# contains all Kodi Application methods
class Application < KodiMethod
QUIT = 'Application.Quit'
SET_MUTE = 'Application.SetMute'
SET_VOLUME = 'Application.SetVolume'
GET_PROPERTIES = 'Application.GetProperties'
def quit(kodi_id = 1)
request = KodiRequest.new(kodi_id, QUIT)
json = invoke_api(request)
KodiResponse.new(json)
end
def mute(kodi_id = 1, mute_state: Types::Global::Toggle::TOGGLE)
request = KodiRequest.new(kodi_id, SET_MUTE, { 'mute' => mute_state })
json = invoke_api(request)
KodiResponse.new(json)
end
def get_properties(properties = Types::Application::PropertyName.all_properties, kodi_id = 1)
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
json = invoke_api(request)
result = Types::Application::PropertyValue.create(json['result'])
json['result'] = result
KodiResponse.new(json)
end
def set_volume(volume, kodi_id = 1)
set_volume_incr_decr_vol(volume, kodi_id)
end
def increment_volume(kodi_id = 1)
set_volume_incr_decr_vol(Types::Global::IncrementDecrement::INCREMENT, kodi_id)
end
def decrement_volume(kodi_id = 1)
set_volume_incr_decr_vol(Types::Global::IncrementDecrement::INCREMENT, kodi_id)
end
def set_volume_incr_decr_vol(volume, kodi_id = 1)
if volume.is_a?(Integer) && (volume > 100 || volume.negative?)
throw ArgumentError.new('Volume must be between 0 and 100.')
end
request = KodiRequest.new(kodi_id, SET_VOLUME, { 'volume' => volume })
json = invoke_api(request)
KodiResponse.new(json)
end
private :set_volume_incr_decr_vol
end
end
end
| 32.275862 | 99 | 0.660791 |
62373c76713184fd726159c69b4543bfbb3fa885
| 29,965 |
require 'spec_helper'
# fails intermittently in evergreen
describe Mongo::Server::Connection, retry: 3 do
class ConnectionSpecTestException < Exception; end
before(:all) do
ClientRegistry.instance.close_all_clients
end
let!(:address) do
default_address
end
let(:monitoring) do
Mongo::Monitoring.new(monitoring: false)
end
let(:listeners) do
Mongo::Event::Listeners.new
end
let(:app_metadata) do
Mongo::Server::AppMetadata.new(authorized_client.cluster.options)
end
let(:cluster) do
double('cluster').tap do |cl|
allow(cl).to receive(:topology).and_return(topology)
allow(cl).to receive(:app_metadata).and_return(app_metadata)
allow(cl).to receive(:options).and_return({})
allow(cl).to receive(:cluster_time).and_return(nil)
allow(cl).to receive(:update_cluster_time)
allow(cl).to receive(:run_sdam_flow)
end
end
declare_topology_double
let(:server_options) { SpecConfig.instance.test_options.merge(monitoring_io: false) }
let(:server) do
register_server(
Mongo::Server.new(address, cluster, monitoring, listeners, server_options)
)
end
let(:monitored_server) do
register_server(
Mongo::Server.new(address, cluster, monitoring, listeners,
SpecConfig.instance.test_options.merge(monitoring_io: false)
).tap do |server|
allow(server).to receive(:description).and_return(ClusterConfig.instance.primary_description)
expect(server).not_to be_unknown
end
)
end
let(:pool) do
double('pool').tap do |pool|
allow(pool).to receive(:close)
end
end
describe '#connect!' do
shared_examples_for 'keeps server type and topology' do
it 'does not mark server unknown' do
expect(server).not_to receive(:unknown!)
error
end
end
shared_examples_for 'marks server unknown' do
it 'marks server unknown' do
expect(server).to receive(:unknown!)
error
end
end
context 'when no socket exists' do
let(:connection) do
described_class.new(server, server.options)
end
let(:result) do
connection.connect!
end
let(:socket) do
connection.send(:socket)
end
it 'returns true' do
expect(result).to be true
end
it 'creates a socket' do
result
expect(socket).to_not be_nil
end
it 'connects the socket' do
result
expect(socket).to be_alive
end
shared_examples_for 'failing connection' do
it 'raises an exception' do
expect(error).to be_a(Exception)
end
it 'clears socket' do
error
expect(connection.send(:socket)).to be nil
end
it 'attempts to reconnect after failure when asked' do
# for some reason referencing error here instead of
# copy pasting it like this doesn't work
expect(connection).to receive(:authenticate!).and_raise(exception)
expect do
connection.connect!
end.to raise_error(exception)
expect(connection).to receive(:authenticate!).and_raise(ConnectionSpecTestException)
expect do
connection.connect!
end.to raise_error(ConnectionSpecTestException)
end
end
shared_examples_for 'logs a warning' do
let(:expected_message) do
"MONGODB | Failed to handshake with #{address}: #{error.class}: #{error}"
end
it 'logs a warning' do
messages = []
# Straightforward expectations are not working here for some reason
expect(Mongo::Logger.logger).to receive(:warn) do |msg|
messages << msg
end
expect(error).not_to be nil
expect(messages).to include(expected_message)
end
end
context 'when #handshake! dependency raises a non-network exception' do
let(:exception) do
Mongo::Error::OperationFailure.new
end
let(:error) do
expect_any_instance_of(Mongo::Socket).to receive(:write).and_raise(exception)
begin
connection.connect!
rescue Exception => e
e
else
nil
end
end
it_behaves_like 'failing connection'
it_behaves_like 'keeps server type and topology'
end
context 'when #handshake! dependency raises a network exception' do
let(:exception) do
Mongo::Error::SocketError.new
end
let(:error) do
expect_any_instance_of(Mongo::Socket).to receive(:write).and_raise(exception)
begin
connection.connect!
rescue Exception => e
e
else
nil
end
end
it_behaves_like 'failing connection'
it_behaves_like 'marks server unknown'
it_behaves_like 'logs a warning'
end
context 'when #authenticate! raises an exception' do
require_auth
let(:server_options) do
SpecConfig.instance.test_options.merge(monitoring_io: false).
merge(SpecConfig.instance.auth_options)
end
let(:exception) do
Mongo::Error::OperationFailure.new
end
let(:error) do
expect(Mongo::Auth).to receive(:get).and_raise(exception)
expect(connection.send(:socket)).to be nil
begin
connection.connect!
rescue Exception => e
e
else
nil
end
end
it_behaves_like 'failing connection'
it_behaves_like 'logs a warning'
end
context 'when a non-Mongo exception is raised' do
let(:exception) do
SystemExit.new
end
let(:error) do
expect(connection).to receive(:authenticate!).and_raise(exception)
begin
connection.connect!
rescue Exception => e
e
else
nil
end
end
it_behaves_like 'failing connection'
end
end
context 'when a socket exists' do
let(:connection) do
described_class.new(server, server.options)
end
let(:socket) do
connection.send(:socket)
end
it 'keeps the socket alive' do
expect(connection.connect!).to be true
expect(connection.connect!).to be true
expect(socket).to be_alive
end
it 'retains socket object' do
expect(connection.connect!).to be true
socket_id = connection.send(:socket).object_id
expect(connection.connect!).to be true
new_socket_id = connection.send(:socket).object_id
expect(new_socket_id).to eq(socket_id)
end
end
shared_examples_for 'does not disconnect connection pool' do
it 'does not disconnect non-monitoring sockets' do
allow(server).to receive(:pool).and_return(pool)
expect(pool).not_to receive(:disconnect!)
error
end
end
shared_examples_for 'disconnects connection pool' do
it 'disconnects non-monitoring sockets' do
expect(server).to receive(:pool).at_least(:once).and_return(pool)
expect(pool).to receive(:disconnect!).and_return(true)
error
end
end
let(:auth_mechanism) do
if ClusterConfig.instance.server_version >= '3'
Mongo::Auth::SCRAM
else
Mongo::Auth::CR
end
end
context 'when user credentials exist' do
let(:server) { monitored_server }
context 'when the user is not authorized' do
let(:connection) do
described_class.new(
server,
SpecConfig.instance.test_options.merge(
:user => 'notauser',
:password => 'password',
:database => SpecConfig.instance.test_db,
:heartbeat_frequency => 30)
)
end
let(:error) do
begin
connection.send(:connect!)
rescue => ex
ex
else
nil
end
end
context 'not checking pool disconnection' do
before do
allow(cluster).to receive(:pool).with(server).and_return(pool)
allow(pool).to receive(:disconnect!).and_return(true)
end
it 'raises an error' do
expect(error).to be_a(Mongo::Auth::Unauthorized)
end
it_behaves_like 'disconnects connection pool'
it_behaves_like 'keeps server type and topology'
end
# need a separate context here, otherwise disconnect expectation
# is ignored due to allowing disconnects in the other context
context 'checking pool disconnection' do
it_behaves_like 'disconnects connection pool'
end
end
context 'socket timeout during auth' do
let(:connection) do
described_class.new(
server,
SpecConfig.instance.test_options.merge(
:user => SpecConfig.instance.test_user.name,
:password => SpecConfig.instance.test_user.password,
:database => SpecConfig.instance.test_user.database )
)
end
let(:error) do
expect_any_instance_of(auth_mechanism).to receive(:login).and_raise(Mongo::Error::SocketTimeoutError)
begin
connection.send(:connect!)
rescue => ex
ex
else
nil
end
end
it 'propagates the error' do
expect(error).to be_a(Mongo::Error::SocketTimeoutError)
end
it_behaves_like 'does not disconnect connection pool'
it_behaves_like 'keeps server type and topology'
end
context 'non-timeout socket exception during auth' do
let(:connection) do
described_class.new(
server,
SpecConfig.instance.test_options.merge(
:user => SpecConfig.instance.test_user.name,
:password => SpecConfig.instance.test_user.password,
:database => SpecConfig.instance.test_user.database )
)
end
let(:error) do
expect_any_instance_of(auth_mechanism).to receive(:login).and_raise(Mongo::Error::SocketError)
begin
connection.send(:connect!)
rescue => ex
ex
else
nil
end
end
it 'propagates the error' do
expect(error).to be_a(Mongo::Error::SocketError)
end
it_behaves_like 'disconnects connection pool'
it_behaves_like 'marks server unknown'
end
describe 'when the user is authorized' do
let(:connection) do
described_class.new(
server,
SpecConfig.instance.test_options.merge(
:user => SpecConfig.instance.test_user.name,
:password => SpecConfig.instance.test_user.password,
:database => SpecConfig.instance.test_user.database )
)
end
before do
connection.connect!
end
it 'sets the connection as connected' do
expect(connection).to be_connected
end
end
end
end
describe '#disconnect!' do
context 'when a socket is not connected' do
let(:connection) do
described_class.new(server, server.options)
end
it 'does not raise an error' do
expect(connection.disconnect!).to be true
end
end
context 'when a socket is connected' do
let(:connection) do
described_class.new(server, server.options)
end
before do
connection.connect!
connection.disconnect!
end
it 'disconnects the socket' do
expect(connection.send(:socket)).to be_nil
end
end
end
describe '#dispatch' do
let(:server) { monitored_server }
let!(:connection) do
described_class.new(
server,
SpecConfig.instance.test_options.merge(
:user => SpecConfig.instance.test_user.name,
:password => SpecConfig.instance.test_user.password,
:database => SpecConfig.instance.test_user.database )
)
end
let(:documents) do
[{ 'name' => 'testing' }]
end
let(:insert) do
Mongo::Protocol::Insert.new(SpecConfig.instance.test_db, TEST_COLL, documents)
end
let(:query) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, TEST_COLL, { 'name' => 'testing' })
end
context 'when providing a single message' do
let(:reply) do
connection.dispatch([ query ])
end
before do
authorized_collection.delete_many
connection.dispatch([ insert ])
end
it 'it dispatches the message to the socket' do
expect(reply.documents.first['name']).to eq('testing')
end
end
context 'when providing multiple messages' do
let(:selector) do
{ :getlasterror => 1 }
end
let(:command) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, '$cmd', selector, :limit => -1)
end
let(:reply) do
connection.dispatch([ insert, command ])
end
before do
authorized_collection.delete_many
end
it 'raises ArgumentError' do
expect do
reply
end.to raise_error(ArgumentError, 'Can only dispatch one message at a time')
end
end
context 'when the response_to does not match the request_id' do
let(:documents) do
[{ 'name' => 'bob' }, { 'name' => 'alice' }]
end
let(:insert) do
Mongo::Protocol::Insert.new(SpecConfig.instance.test_db, TEST_COLL, documents)
end
let(:query_bob) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, TEST_COLL, { name: 'bob' })
end
let(:query_alice) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, TEST_COLL, { name: 'alice' })
end
before do
authorized_collection.delete_many
end
before do
connection.dispatch([ insert ])
# Fake a query for which we did not read the response. See RUBY-1117
allow(query_bob).to receive(:replyable?) { false }
connection.dispatch([ query_bob ])
end
it 'raises an UnexpectedResponse error' do
expect {
connection.dispatch([ query_alice ])
}.to raise_error(Mongo::Error::UnexpectedResponse,
/Got response for request ID \d+ but expected response for request ID \d+/)
end
context 'linting' do
require_linting
it 'marks the connection no longer usable' do
expect {
connection.dispatch([ query_alice ])
}.to raise_error(Mongo::Error::UnexpectedResponse)
expect do
connection.dispatch([ query_alice ]).documents
end.to raise_error(Mongo::Error::LintError, 'Reconnecting closed connections is no longer supported')
end
end
context 'not linting' do
skip_if_linting
it 'does not affect subsequent requests but warns' do
expect(Mongo::Logger.logger).to receive(:warn).once.and_call_original
expect {
connection.dispatch([ query_alice ])
}.to raise_error(Mongo::Error::UnexpectedResponse)
docs = connection.dispatch([ query_alice ]).documents
expect(docs).to_not be_empty
expect(docs.first['name']).to eq('alice')
end
end
end
context 'when a request is interrupted (Thread.kill)' do
let(:documents) do
[{ 'name' => 'bob' }, { 'name' => 'alice' }]
end
let(:insert) do
Mongo::Protocol::Insert.new(SpecConfig.instance.test_db, TEST_COLL, documents)
end
let(:query_bob) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, TEST_COLL, { name: 'bob' })
end
let(:query_alice) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, TEST_COLL, { name: 'alice' })
end
before do
authorized_collection.delete_many
connection.dispatch([ insert ])
end
it 'closes the socket and does not use it for subsequent requests' do
t = Thread.new {
# Kill the thread just before the reply is read
allow(Mongo::Protocol::Reply).to receive(:deserialize_header) { t.kill && !t.alive? }
connection.dispatch([ query_bob ])
}
t.join
allow(Mongo::Protocol::Message).to receive(:deserialize_header).and_call_original
expect(connection.dispatch([ query_alice ]).documents.first['name']).to eq('alice')
end
end
context 'when the message exceeds the max size' do
context 'when the message is an insert' do
before do
allow(connection).to receive(:max_message_size).and_return(200)
end
let(:documents) do
[{ 'name' => 'testing' } ] * 10
end
let(:reply) do
connection.dispatch([ insert ])
end
it 'checks the size against the max message size' do
expect {
reply
}.to raise_exception(Mongo::Error::MaxMessageSize)
end
end
context 'when the message is a command' do
let(:selector) do
{ :getlasterror => '1' }
end
let(:command) do
Mongo::Protocol::Query.new(SpecConfig.instance.test_db, '$cmd', selector, :limit => -1)
end
let(:reply) do
connection.dispatch([ command ])
end
it 'checks the size against the max bson size' do
expect_any_instance_of(Mongo::Server).to receive(:max_bson_object_size).at_least(:once).and_return(100)
expect do
reply
end.to raise_exception(Mongo::Error::MaxBSONSize)
end
end
end
context 'when a network error occurs' do
let(:server) do
authorized_client.cluster.next_primary.tap do |server|
# to ensure the server stays in unknown state for the duration
# of the test, i.e. to avoid racing with the monitor thread
# which may put the server back into non-unknown state before
# we can verify that the server was marked unknown, kill off
# the monitor thread
server.monitor.instance_variable_get('@thread').kill
end
end
let(:socket) do
connection.connect!
connection.instance_variable_get(:@socket)
end
context 'when a non-timeout socket error occurs' do
before do
expect(socket).to receive(:write).and_raise(Mongo::Error::SocketError)
end
let(:result) do
expect do
connection.dispatch([ insert ])
end.to raise_error(Mongo::Error::SocketError)
end
it 'disconnects and raises the exception' do
result
expect(connection).to_not be_connected
end
it 'disconnects connection pool' do
expect(server.pool).to receive(:disconnect!)
result
end
it 'does not request server scan' do
expect(server.scan_semaphore).not_to receive(:signal)
result
end
it 'marks server unknown' do
expect(server).not_to be_unknown
result
expect(server).to be_unknown
end
end
context 'when a socket timeout occurs' do
before do
expect(socket).to receive(:write).and_raise(Mongo::Error::SocketTimeoutError)
end
let(:result) do
expect do
connection.dispatch([ insert ])
end.to raise_error(Mongo::Error::SocketTimeoutError)
end
it 'disconnects the used connection' do
result
expect(connection).to_not be_connected
end
it 'does not disconnect connection pool' do
expect(server.pool).not_to receive(:disconnect!)
result
end
it 'does not mark server unknown' do
expect(server).not_to be_unknown
result
expect(server).not_to be_unknown
end
end
end
context 'when a socket timeout is set' do
let(:connection) do
described_class.new(server, socket_timeout: 10)
end
it 'sets the timeout' do
expect(connection.timeout).to eq(10)
end
let(:client) do
authorized_client.with(socket_timeout: 1.5)
end
before do
authorized_collection.delete_many
authorized_collection.insert_one(a: 1)
end
it 'raises a timeout when it expires' do
start = Time.now
begin
Timeout::timeout(1.5 + 15) do
client[authorized_collection.name].find("$where" => "sleep(2000) || true").first
end
rescue => ex
end_time = Time.now
expect(ex).to be_a(Timeout::Error)
expect(ex.message).to eq("Took more than 1.5 seconds to receive data.")
end
# Account for wait queue timeout (2s) and rescue
expect(end_time - start).to be_within(2.5).of(1.5)
end
context 'when the socket_timeout is negative' do
let(:connection) do
described_class.new(server, server.options)
end
let(:message) do
insert
end
before do
expect(message).to receive(:replyable?) { false }
connection.send(:deliver, message)
connection.send(:socket).instance_variable_set(:@timeout, -(Time.now.to_i))
end
let(:reply) do
Mongo::Protocol::Message.deserialize(connection.send(:socket),
16*1024*1024, message.request_id)
end
it 'raises a timeout error' do
expect {
reply
}.to raise_exception(Timeout::Error)
end
end
end
context 'when the process is forked' do
let(:insert) do
Mongo::Protocol::Insert.new(SpecConfig.instance.test_db, TEST_COLL, documents)
end
before do
authorized_collection.delete_many
expect(Process).to receive(:pid).at_least(:once).and_return(1)
end
it 'disconnects the connection' do
expect(connection).to receive(:disconnect!).and_call_original
connection.dispatch([ insert ])
end
it 'sets a new pid' do
connection.dispatch([ insert ])
expect(connection.pid).to eq(1)
end
end
end
describe '#initialize' do
context 'when host and port are provided' do
let(:connection) do
described_class.new(server, server.options)
end
it 'sets the address' do
expect(connection.address).to eq(server.address)
end
it 'sets id' do
expect(connection.id).to eq(1)
end
context 'multiple connections' do
it 'use incrementing ids' do
expect(connection.id).to eq(1)
second_connection = described_class.new(server, server.options)
expect(second_connection.id).to eq(2)
end
end
context 'two pools for different servers' do
let(:server2) do
register_server(
Mongo::Server.new(address, cluster, monitoring, listeners, server_options)
)
end
it 'ids do not share namespace' do
server.pool.with_connection do |conn|
expect(conn.id).to eq(1)
end
server2.pool.with_connection do |conn|
expect(conn.id).to eq(1)
end
end
end
it 'sets the socket to nil' do
expect(connection.send(:socket)).to be_nil
end
it 'does not set the timeout to the default' do
expect(connection.timeout).to be_nil
end
end
context 'when timeout options are provided' do
let(:connection) do
described_class.new(server, socket_timeout: 10)
end
it 'sets the timeout' do
expect(connection.timeout).to eq(10)
end
end
context 'when ssl options are provided' do
let(:ssl_options) do
{ :ssl => true, :ssl_key => 'file', :ssl_key_pass_phrase => 'iamaphrase' }
end
let(:connection) do
described_class.new(server, ssl_options)
end
it 'sets the ssl options' do
expect(connection.send(:ssl_options)).to eq(ssl_options)
end
end
context 'when ssl is false' do
context 'when ssl options are provided' do
let(:ssl_options) do
{ :ssl => false, :ssl_key => 'file', :ssl_key_pass_phrase => 'iamaphrase' }
end
let(:connection) do
described_class.new(server, ssl_options)
end
it 'does not set the ssl options' do
expect(connection.send(:ssl_options)).to be_empty
end
end
context 'when ssl options are not provided' do
let(:ssl_options) do
{ :ssl => false }
end
let(:connection) do
described_class.new(server, ssl_options)
end
it 'does not set the ssl options' do
expect(connection.send(:ssl_options)).to be_empty
end
end
end
context 'when authentication options are provided' do
let(:connection) do
described_class.new(
server,
:user => SpecConfig.instance.test_user.name,
:password => SpecConfig.instance.test_user.password,
:database => SpecConfig.instance.test_db,
:auth_mech => :mongodb_cr
)
end
let(:user) do
Mongo::Auth::User.new(
database: SpecConfig.instance.test_db,
user: SpecConfig.instance.test_user.name,
password: SpecConfig.instance.test_user.password
)
end
it 'sets the auth options' do
expect(connection.options[:user]).to eq(user.name)
end
end
end
context 'when different timeout options are set' do
let(:client) do
authorized_client.with(options)
end
let(:server) do
client.cluster.next_primary
end
let(:address) do
server.address
end
let(:connection) do
described_class.new(server, server.options)
end
after do
client.close
end
context 'when a connect_timeout is in the options' do
context 'when a socket_timeout is in the options' do
let(:options) do
SpecConfig.instance.test_options.merge(connect_timeout: 3, socket_timeout: 5)
end
before do
connection.connect!
end
it 'uses the connect_timeout for the address' do
expect(connection.address.send(:connect_timeout)).to eq(3)
end
it 'uses the socket_timeout as the socket_timeout' do
expect(connection.send(:socket).timeout).to eq(5)
end
end
context 'when a socket_timeout is not in the options' do
let(:options) do
SpecConfig.instance.test_options.merge(connect_timeout: 3, socket_timeout: nil)
end
before do
connection.connect!
end
it 'uses the connect_timeout for the address' do
expect(connection.address.send(:connect_timeout)).to eq(3)
end
it 'does not use a socket_timeout' do
expect(connection.send(:socket).timeout).to be(nil)
end
end
end
context 'when a connect_timeout is not in the options' do
context 'when a socket_timeout is in the options' do
let(:options) do
SpecConfig.instance.test_options.merge(connect_timeout: nil, socket_timeout: 5)
end
before do
connection.connect!
end
it 'uses the default connect_timeout for the address' do
expect(connection.address.send(:connect_timeout)).to eq(10)
end
it 'uses the socket_timeout' do
expect(connection.send(:socket).timeout).to eq(5)
end
end
context 'when a socket_timeout is not in the options' do
let(:options) do
SpecConfig.instance.test_options.merge(connect_timeout: nil, socket_timeout: nil)
end
before do
connection.connect!
end
it 'uses the default connect_timeout for the address' do
expect(connection.address.send(:connect_timeout)).to eq(10)
end
it 'does not use a socket_timeout' do
expect(connection.send(:socket).timeout).to be(nil)
end
end
end
end
describe '#app_metadata' do
context 'when all options are identical to server' do
let(:connection) do
described_class.new(server, server.options)
end
it 'is the same object as server app_metadata' do
expect(connection.app_metadata).not_to be nil
expect(connection.app_metadata).to be server.app_metadata
end
end
context 'when auth options are identical to server' do
let(:connection) do
described_class.new(server, server.options.merge(socket_timeout: 2))
end
it 'is the same object as server app_metadata' do
expect(connection.app_metadata).not_to be nil
expect(connection.app_metadata).to be server.app_metadata
end
end
context 'when auth options differ from server' do
let(:connection) do
described_class.new(server, server.options.merge(user: 'foo'))
end
it 'is different object from server app_metadata' do
expect(connection.app_metadata).not_to be nil
expect(connection.app_metadata).not_to be server.app_metadata
end
it 'includes request auth mechanism' do
document = connection.app_metadata.send(:document)
expect(document[:saslSupportedMechs]).to eq('admin.foo')
end
end
end
end
| 26.874439 | 113 | 0.603704 |
21a517280a196d90c83c02fb3f20782fd09dca50
| 735 |
require 'open-uri'
# JAVA
# Alt: http://en.wikipedia.org/wiki/Java_version_history
class Java
attr_reader :name, :description
def initialize
@name = 'Java'
@description = 'The Java programming language.'
extract
end
def latest_stable
@versions.sort.reverse.first
end
def latest_unstable
'Not supported'
end
# not supported
def versions
[]
end
private
def download
open('https://en.wikipedia.org/wiki/Java_version_history', &:read)
end
def extract
text = download
versions = text.scan(/java\sSE\s([0-9]+.[0-9]+.[0-9]+)/i)
flat = versions.inject([]) { |arr, obj| arr << obj[0] }.compact.uniq
@versions = flat.collect! { |e| Versionomy.parse(e) }
end
end
| 17.926829 | 72 | 0.64898 |
b9b71c170c74b8a2c000ae8d6b30f01edb024b4d
| 2,493 |
require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports.
config.consider_all_requests_local = true
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
config.cache_store = :memory_store
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{2.days.to_i}",
}
else
config.action_controller.perform_caching = false
config.cache_store = :null_store
end
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Allow requests for all domains e.g. <app>.dev.gov.uk
config.hosts.clear
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end
| 35.112676 | 85 | 0.768151 |
ed67e3cb5e88ccb1770ed83cef53b268cd4523a2
| 98 |
class Ficha < ActiveRecord::Base
self.abstract_class = true
establish_connection :fichas
end
| 16.333333 | 32 | 0.785714 |
ac01f22653f74f3536a6f57896d4e9bc35cf0afb
| 92 |
require "bundler"
Bundler.setup
require "middleman"
Dir["./lib/*"].each { |f| require f }
| 13.142857 | 37 | 0.663043 |
2877f1e106d3a38a7d3b95dfe3ea27d210b9900e
| 1,220 |
class Customer::MessagesController < Customer::Base
def index
@messages = current_customer.inbound_messages.where(discarded: false).page(params[:page])
end
def show
@message = current_customer.inbound_messages.find(params[:id])
end
def new
@message = CustomerMessage.new
end
# POST
def confirm
@message = CustomerMessage.new(customer_message_params)
if @message.valid?
render action: 'confirm'
else
flash.now.alert = t('.flash_alert')
render action: 'new'
end
end
def create
@message = CustomerMessage.new(customer_message_params)
if params[:commit]
@message.customer = current_customer
if @message.save
flash.notice = t('.flash_notice')
redirect_to :customer_root
else
flash.now.alert = t('.flash_alert')
render action: 'new'
end
else
render action: 'new'
end
end
def destroy
message = StaffMessage.find(params[:id])
message.update_column(:discarded, true)
flash.notice = t('.flash_notice')
redirect_to :back
end
private
def customer_message_params
params.require(:customer_message).permit(
:subject,
:body
)
end
end
| 21.785714 | 93 | 0.658197 |
ed38c76fc5a3e982faf0b9928fe7a0aeab804437
| 4,630 |
require 'linux_admin'
module MiqServer::EnvironmentManagement
extend ActiveSupport::Concern
module ClassMethods
# Spartan mode used for testing only.
# minimal - Runs with 1 worker monitor, 1 generic, and 1 priority worker only
# Can also specify other specific worker types, to start a single
# worker, via underscore separation, e.g. minimal_schedule to start
# 1 schedule worker.
def spartan_mode
@spartan_mode ||= ENV["MIQ_SPARTAN"].to_s.strip
end
def minimal_env?
spartan_mode.start_with?("minimal")
end
def normal_env?
!self.minimal_env?
end
MIQ_SPARTAN_ROLE_SEPARATOR = ":"
def minimal_env_options
@minimal_env_options ||= begin
minimal_env? ? spartan_mode.split(MIQ_SPARTAN_ROLE_SEPARATOR)[1..-1] : []
end
end
def startup_mode
return "Normal" unless minimal_env?
"Minimal".tap { |s| s << " [#{minimal_env_options.join(', ').presence}]" if minimal_env_options.present? }
end
def get_network_information
ipaddr = hostname = mac_address = nil
begin
if MiqEnvironment::Command.is_appliance?
eth0 = LinuxAdmin::NetworkInterface.new("eth0")
ipaddr = eth0.address || eth0.address6
hostname = LinuxAdmin::Hosts.new.hostname
mac_address = eth0.mac_address
else
require 'MiqSockUtil'
ipaddr = MiqSockUtil.getIpAddr
hostname = MiqSockUtil.getFullyQualifiedDomainName
mac_address = UUIDTools::UUID.mac_address.dup
end
rescue
end
[ipaddr, hostname, mac_address]
end
def validate_database
ActiveRecord::Base.connection.reconnect!
# Log the Versions
_log.info("Database Adapter: [#{ActiveRecord::Base.connection.adapter_name}], version: [#{ActiveRecord::Base.connection.database_version}]") if ActiveRecord::Base.connection.respond_to?(:database_version)
_log.info("Database Adapter: [#{ActiveRecord::Base.connection.adapter_name}], detailed version: [#{ActiveRecord::Base.connection.detailed_database_version}]") if ActiveRecord::Base.connection.respond_to?(:detailed_database_version)
end
def start_memcached
# TODO: Need to periodically check the memcached instance to see if it's up, and bounce it and notify the UiWorkers to re-connect
return unless ::Settings.server.session_store.to_s == 'cache'
return unless MiqEnvironment::Command.supports_memcached?
require "#{Rails.root}/lib/miq_memcached" unless Object.const_defined?(:MiqMemcached)
_svr, port = MiqMemcached.server_address.to_s.split(":")
opts = ::Settings.session.memcache_server_opts.to_s
MiqMemcached::Control.restart!(:port => port, :options => opts)
_log.info("Status: #{MiqMemcached::Control.status[1]}")
end
end
#
# Apache
#
def start_apache
return unless MiqEnvironment::Command.is_appliance?
MiqApache::Control.start
end
def stop_apache
return unless MiqEnvironment::Command.is_appliance?
MiqApache::Control.stop
end
def disk_usage_threshold
::Settings.server.events.disk_usage_gt_percent
end
def check_disk_usage(disks)
threshold = disk_usage_threshold
disks.each do |disk|
next unless disk[:used_bytes_percent].to_i > threshold
disk_usage_event = case disk[:mount_point].chomp
when '/' then 'evm_server_system_disk_high_usage'
when '/boot' then 'evm_server_boot_disk_high_usage'
when '/home' then 'evm_server_home_disk_high_usage'
when '/var' then 'evm_server_var_disk_high_usage'
when '/var/log' then 'evm_server_var_log_disk_high_usage'
when '/var/log/audit' then 'evm_server_var_log_audit_disk_high_usage'
when '/var/www/miq_tmp' then 'evm_server_miq_tmp_disk_high_usage'
when '/tmp' then 'evm_server_tmp_disk_high_usage'
when %r{lib/pgsql} then 'evm_server_db_disk_high_usage'
end
next unless disk_usage_event
msg = "Filesystem: #{disk[:filesystem]} (#{disk[:type]}) on #{disk[:mount_point]} is #{disk[:used_bytes_percent]}% full with #{ActionView::Base.new.number_to_human_size(disk[:available_bytes])} free."
MiqEvent.raise_evm_event_queue(self, disk_usage_event, :event_details => msg)
end
end
end
| 38.907563 | 237 | 0.653996 |
bba1ca26b35a3152a580dd89b12dada558d1416f
| 1,491 |
# frozen_string_literal: true
# rubocop: disable Style/Documentation
class Gitlab::BackgroundMigration::UpdateJiraTrackerDataDeploymentTypeBasedOnUrl
# rubocop: disable Gitlab/NamespacedClass
class JiraTrackerData < ActiveRecord::Base
self.table_name = "jira_tracker_data"
self.inheritance_column = :_type_disabled
include ::Integrations::BaseDataFields
attr_encrypted :url, encryption_options
attr_encrypted :api_url, encryption_options
enum deployment_type: { unknown: 0, server: 1, cloud: 2 }, _prefix: :deployment
end
# rubocop: enable Gitlab/NamespacedClass
# https://rubular.com/r/uwgK7k9KH23efa
JIRA_CLOUD_REGEX = %r{^https?://[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?\.atlassian\.net$}ix.freeze
# rubocop: disable CodeReuse/ActiveRecord
def perform(start_id, end_id)
trackers_data = JiraTrackerData
.where(deployment_type: 'unknown')
.where(id: start_id..end_id)
cloud, server = trackers_data.partition { |tracker_data| tracker_data.url.match?(JIRA_CLOUD_REGEX) }
cloud_mappings = cloud.each_with_object({}) do |tracker_data, hash|
hash[tracker_data] = { deployment_type: 2 }
end
server_mapppings = server.each_with_object({}) do |tracker_data, hash|
hash[tracker_data] = { deployment_type: 1 }
end
mappings = cloud_mappings.merge(server_mapppings)
::Gitlab::Database::BulkUpdate.execute(%i[deployment_type], mappings)
end
# rubocop: enable CodeReuse/ActiveRecord
end
| 34.674419 | 107 | 0.735748 |
acf683864ffe23d2f63b7d5c764b39565273f035
| 4,168 |
require 'spec_helper'
require 'active_record_spec_helper'
describe "Validation" do
context "single currency" do
def loan_model
Object.send(:remove_const, "LoanWithCurrency") if defined? LoanWithCurrency
migrate CreateTableDefinition::CreateLoanWithCurrency
load 'loan_with_currency_model_spec_helper.rb'
LoanWithCurrency
end
# subject can be delayed bound ie. after some changes
def add_expectations subject, allow_nil
expect(subject.class.validators.length).to eq 5
expect(subject.class.validators.select {|x| x.is_a? EasyRailsMoney::MoneyValidator }.length).to eq 1
expect(subject.class.validators.map {|x| x.options[:allow_nil] }.uniq).to eq [allow_nil]
EasyRailsMoney::MoneyValidator.any_instance.should_receive(:validate_each).with(subject, :principal, subject.principal)
EasyRailsMoney::MoneyValidator.any_instance.should_receive(:validate_each).with(subject, :repaid, subject.repaid)
EasyRailsMoney::MoneyValidator.any_instance.should_receive(:validate_each).with(subject, :amount_funded, subject.amount_funded)
end
context "do not allow nil" do
let(:subject) do
model = loan_model
model.instance_eval {
validates_money :principal, :repaid, :amount_funded, :allow_nil => false, :allowed_currency => %w[inr usd sgd]
}
loan = model.new
loan.name = "loan having some values"
loan.principal = 100 * 100
loan.repaid = 50 * 100
loan.amount_funded = 10 * 100
loan
end
it "is valid when it is a Money object" do
add_expectations subject, false
expect(subject).to be_valid
end
it "is in-valid if values are nil and allow_nil is false" do
subject.principal = nil
add_expectations subject, false
expect(subject).not_to be_valid
expect(subject.errors.messages).to eq :principal_money=>["is not a number"]
end
it "is in-valid if currency is nil and allow_nil is false" do
old = subject.principal
expect { subject.currency = nil }.to change { subject.principal }.from(old).to(nil)
expect(subject.attributes["currency"]).to be_nil
add_expectations subject, false
expect(subject).not_to be_valid
expect(subject.errors.messages).to eq(:principal_money=>["is not a number"], :repaid_money=>["is not a number"], :amount_funded_money=>["is not a number"], :currency=>["is not included in the list"])
end
end # context "do not allow nil"
context "allow nil", :fixme do
let(:subject) do
model = loan_model
model.instance_eval {
validates_money :principal, :repaid, :amount_funded, :allow_nil => true, :allowed_currency => %w[inr usd sgd]
}
loan = model.new
loan.name = "loan having nil values"
loan.principal = nil
loan.repaid = nil
loan.amount_funded = nil
loan
end
it "is valid if currency is nil and allow_nil is true" do
subject.currency = nil
expect(subject.principal).to be_nil
expect(subject.attributes["currency"]).to be_nil
add_expectations subject, true
expect(subject).to be_valid
end
it "is in-valid if currency is not allowed" do
subject.currency = "foo"
add_expectations subject, true
expect(subject).not_to be_valid
end
end # context "allow nil"
context "no allowed currency" do
let(:subject) do
model = loan_model
model.instance_eval {
validates_money :principal, :repaid, :amount_funded, :allow_nil => false
}
loan = model.new
loan.name = "loan having some values and all currencies allowed"
loan.principal = 100 * 100
loan.repaid = 50 * 100
loan.amount_funded = 10 * 100
loan
end
it "is valid when it is a Money object" do
add_expectations subject, false
expect(subject).to be_valid
end
end
pending "check lower-level validations"
end
end
| 35.931034 | 207 | 0.647793 |
084693fbd22e7a137e4a981aa28750d80528bcf0
| 6,376 |
##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
#
# frozen_string_literal: true
require 'spec_helper.rb'
describe 'Credential' do
it "can read" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.credentials.list()
}.to raise_exception(Twilio::REST::TwilioError)
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'get',
url: 'https://chat.twilio.com/v2/Credentials',
))).to eq(true)
end
it "receives read_full responses" do
@holodeck.mock(Twilio::Response.new(
200,
%q[
{
"credentials": [
{
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Test slow create",
"type": "apn",
"sandbox": "False",
"date_created": "2015-10-07T17:50:01Z",
"date_updated": "2015-10-07T17:50:01Z",
"url": "https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
],
"meta": {
"page": 0,
"page_size": 1,
"first_page_url": "https://chat.twilio.com/v2/Credentials?PageSize=1&Page=0",
"previous_page_url": null,
"url": "https://chat.twilio.com/v2/Credentials?PageSize=1&Page=0",
"next_page_url": null,
"key": "credentials"
}
}
]
))
actual = @client.ip_messaging.v2.credentials.list()
expect(actual).to_not eq(nil)
end
it "receives read_empty responses" do
@holodeck.mock(Twilio::Response.new(
200,
%q[
{
"credentials": [],
"meta": {
"page": 0,
"page_size": 1,
"first_page_url": "https://chat.twilio.com/v2/Credentials?PageSize=1&Page=0",
"previous_page_url": null,
"url": "https://chat.twilio.com/v2/Credentials?PageSize=1&Page=0",
"next_page_url": null,
"key": "credentials"
}
}
]
))
actual = @client.ip_messaging.v2.credentials.list()
expect(actual).to_not eq(nil)
end
it "can create" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.credentials.create(type: 'gcm')
}.to raise_exception(Twilio::REST::TwilioError)
values = {'Type' => 'gcm', }
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://chat.twilio.com/v2/Credentials',
data: values,
))).to eq(true)
end
it "receives create responses" do
@holodeck.mock(Twilio::Response.new(
201,
%q[
{
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Test slow create",
"type": "apn",
"sandbox": "False",
"date_created": "2015-10-07T17:50:01Z",
"date_updated": "2015-10-07T17:50:01Z",
"url": "https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
]
))
actual = @client.ip_messaging.v2.credentials.create(type: 'gcm')
expect(actual).to_not eq(nil)
end
it "can fetch" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
}.to raise_exception(Twilio::REST::TwilioError)
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'get',
url: 'https://chat.twilio.com/v2/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
))).to eq(true)
end
it "receives fetch responses" do
@holodeck.mock(Twilio::Response.new(
200,
%q[
{
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Test slow create",
"type": "apn",
"sandbox": "False",
"date_created": "2015-10-07T17:50:01Z",
"date_updated": "2015-10-07T17:50:01Z",
"url": "https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
]
))
actual = @client.ip_messaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
expect(actual).to_not eq(nil)
end
it "can update" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
}.to raise_exception(Twilio::REST::TwilioError)
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://chat.twilio.com/v2/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
))).to eq(true)
end
it "receives update responses" do
@holodeck.mock(Twilio::Response.new(
200,
%q[
{
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "Test slow create",
"type": "apn",
"sandbox": "False",
"date_created": "2015-10-07T17:50:01Z",
"date_updated": "2015-10-07T17:50:01Z",
"url": "https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
]
))
actual = @client.ip_messaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
expect(actual).to_not eq(nil)
end
it "can delete" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
}.to raise_exception(Twilio::REST::TwilioError)
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'delete',
url: 'https://chat.twilio.com/v2/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
))).to eq(true)
end
it "receives delete responses" do
@holodeck.mock(Twilio::Response.new(
204,
nil,
))
actual = @client.ip_messaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
expect(actual).to eq(true)
end
end
| 28.591928 | 100 | 0.587202 |
79ed5f9d29e33bd82240a52f06ac801314e15bc3
| 196 |
class RemoveOptionalContentFromSteps < ActiveRecord::Migration[5.1]
def change
remove_column :steps, :optional_heading, :string
remove_column :steps, :optional_contents, :text
end
end
| 28 | 67 | 0.77551 |
91858848043a2a8d9e7594010eefd86f8d935ac8
| 1,034 |
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("lib", __dir__)
require "jekyll-remote-theme/version"
Gem::Specification.new do |s|
s.name = "jekyll-remote-theme"
s.version = Jekyll::RemoteTheme::VERSION
s.authors = ["Ben Balter"]
s.email = ["[email protected]"]
s.homepage = "https://github.com/benbalter/jekyll-remote-theme"
s.summary = "Jekyll plugin for building Jekyll sites with any GitHub-hosted theme"
s.files = `git ls-files app lib`.split("\n")
s.require_paths = ["lib"]
s.license = "MIT"
s.add_dependency "jekyll", "~> 3.5"
s.add_dependency "rubyzip", ">= 1.2.1", "< 3.0"
s.add_dependency "typhoeus", ">= 0.7", "< 2.0"
s.add_development_dependency "jekyll-theme-primer", "~> 0.5"
s.add_development_dependency "jekyll_test_plugin_malicious", "~> 0.2"
s.add_development_dependency "pry", "~> 0.11"
s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "rubocop", "~> 0.4", ">= 0.49.0"
end
| 38.296296 | 90 | 0.652805 |
bfc848e2bcd37322a08e4e0e63a2656884323e54
| 831 |
require_relative './../test_helper'
class FloatAttributeTest < MiniTest::Test
def test_attribute_on_model_init
b = Building.new height: 5.42
assert_equal 5.42, b.height
end
def test_attribute_on_existing_model
b = Building.new
b.height = 5.42
assert_equal 5.42, b.height
assert b.height_changed?
end
def test_question_mark_method
b = Building.new height: 5.42
assert_equal true, b.height?
end
def test_type_conversion_on_init
b = Building.new height: '5.42'
assert_equal 5.42, b.height
end
def test_type_conversion_on_existing
b = Building.new
b.height = '5.42'
assert_equal 5.42, b.height
end
def test_persistence
b = Building.new name: 'Test', height: 87.4
assert b.save
assert_equal 87.4, Building.find(b.id).height
end
end
| 21.307692 | 49 | 0.694344 |
116d222f8d624e1a70e3a60bddeb7a50c5fedf19
| 1,253 |
module Noticed
module Model
extend ActiveSupport::Concern
included do
self.inheritance_column = nil
serialize :params, noticed_coder
belongs_to :recipient, polymorphic: true
scope :newest_first, -> { order(created_at: :desc) }
scope :unread, -> { where(read_at: nil) }
scope :read, -> { where.not(read_at: nil) }
end
class_methods do
def mark_as_read!
update_all(read_at: Time.current, updated_at: Time.current)
end
def mark_as_unread!
update_all(read_at: nil, updated_at: Time.current)
end
def noticed_coder
case attribute_types["params"].type
when :json, :jsonb
Noticed::Coder
else
Noticed::TextCoder
end
end
end
# Rehydrate the database notification into the Notification object for rendering
def to_notification
@_notification ||= begin
instance = type.constantize.with(params)
instance.record = self
instance
end
end
def mark_as_read!
update(read_at: Time.current)
end
def mark_as_unread!
update(read_at: nil)
end
def unread?
!read?
end
def read?
read_at?
end
end
end
| 20.209677 | 84 | 0.612929 |
ed4c033aa3a4d272b582f8938e498ed45bf2e63e
| 5,950 |
#
# Author:: Aliasgar Batterywala ([email protected])
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# 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.
#
require "spec_helper"
if ChefUtils.windows?
require "chef/win32/error"
require "chef/win32/security"
require "chef/win32/api/error"
end
describe "Chef::Win32::Security", :windows_only do
describe "self.get_named_security_info" do
context "when HR result is ERROR_SUCCESS" do
it "does not raise the exception" do
expect(Chef::ReservedNames::Win32::Security).to receive(:GetNamedSecurityInfoW).and_return(
Chef::ReservedNames::Win32::API::Error::ERROR_SUCCESS
)
expect { Chef::ReservedNames::Win32::Security.get_named_security_info "/temp_path" }.to_not raise_error
end
end
context "when HR result is not ERROR_SUCCESS and not ERROR_USER_NOT_FOUND" do
it "raises Win32APIError exception" do
expect(Chef::ReservedNames::Win32::Security).to receive(:GetNamedSecurityInfoW).and_return(
Chef::ReservedNames::Win32::API::Error::ERROR_INVALID_ACCESS
)
expect { Chef::ReservedNames::Win32::Security.get_named_security_info "/temp_path" }.to raise_error Chef::Exceptions::Win32APIError
end
end
end
describe "self.set_named_security_info" do
context "when HR result is ERROR_SUCCESS" do
it "does not raise the exception" do
expect(Chef::ReservedNames::Win32::Security).to receive(:SetNamedSecurityInfoW).and_return(
Chef::ReservedNames::Win32::API::Error::ERROR_SUCCESS
)
expect { Chef::ReservedNames::Win32::Security.set_named_security_info "/temp_path", :SE_FILE_OBJECT, {} }.to_not raise_error
end
end
context "when HR result is not ERROR_SUCCESS but it is ERROR_USER_NOT_FOUND" do
it "raises UserIDNotFound exception" do
expect(Chef::ReservedNames::Win32::Security).to receive(:SetNamedSecurityInfoW).and_return(
Chef::ReservedNames::Win32::API::Error::ERROR_USER_NOT_FOUND
)
expect { Chef::ReservedNames::Win32::Security.set_named_security_info "/temp_path", :SE_FILE_OBJECT, {} }.to raise_error Chef::Exceptions::UserIDNotFound
end
end
end
describe "self.has_admin_privileges?" do
context "when the user doesn't have admin privileges" do
it "returns false" do
allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_raise("Access is denied.")
expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to be false
end
end
context "when open_current_process_token fails with some other error than `Access is Denied`" do
it "raises error" do
allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_raise("boom")
expect { Chef::ReservedNames::Win32::Security.has_admin_privileges? }.to raise_error(Chef::Exceptions::Win32APIError)
end
end
context "when the user has admin privileges" do
it "returns true" do
token = double(:process_token)
allow(token).to receive_message_chain(:handle, :handle)
allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_return(token)
allow(Chef::ReservedNames::Win32::Security).to receive(:get_token_information_elevation_type)
allow(Chef::ReservedNames::Win32::Security).to receive(:GetTokenInformation).and_return(true)
allow_any_instance_of(FFI::Buffer).to receive(:read_ulong).and_return(1)
expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to be true
end
end
end
describe "self.get_token_information_elevation_type" do
let(:token_rights) { Chef::ReservedNames::Win32::Security::TOKEN_READ }
let(:token) do
Chef::ReservedNames::Win32::Security.open_process_token(
Chef::ReservedNames::Win32::Process.get_current_process,
token_rights
)
end
it "raises error if GetTokenInformation fails" do
allow(Chef::ReservedNames::Win32::Security).to receive(:GetTokenInformation).and_return(false)
expect { Chef::ReservedNames::Win32::Security.get_token_information_elevation_type(token) }.to raise_error(Chef::Exceptions::Win32APIError)
end
end
describe "self.lookup_account_name" do
let(:security_class) { Chef::ReservedNames::Win32::Security }
context "when FFI::LastError.error result is ERROR_INSUFFICIENT_BUFFER" do
it "does not raise the exception" do
expect(FFI::LastError).to receive(:error).and_return(122)
expect { security_class.lookup_account_name "system" }.to_not raise_error
end
end
context "when operation completed successfully and FFI::LastError.error result is NO_ERROR" do
it "does not raise the exception" do
expect(FFI::LastError).to receive(:error).and_return(0)
expect { security_class.lookup_account_name "system" }.to_not raise_error
end
end
context "when FFI::LastError.error result is not ERROR_INSUFFICIENT_BUFFER and not NO_ERROR" do
it "raises Chef::ReservedNames::Win32::Error.raise! exception" do
expect(FFI::LastError).to receive(:error).and_return(123).at_least(:once)
expect { security_class.lookup_account_name "system" }.to raise_error(Chef::Exceptions::Win32APIError)
end
end
end
end
| 43.430657 | 161 | 0.724874 |
e2256c59921ccc6ba43a92815534d07b264c6ea0
| 8,790 |
# With http://github.com/rails/rails/commit/104898fcb7958bcb69ba0239d6de8aa37f2da9ba
# Rails edge (2.3) reverted all the nice oop changes that were introduced to
# asset_tag_helper in 2.2 ... so no point to code against the 2.2'ish API
# any more. Ok, let's instead overwrite everything. OMG ... suck, why does
# this so remind me of PHP.
require 'action_view/helpers/asset_tag_helper'
module ActionView
module Helpers
module AssetTagHelper
def theme_javascript_path(theme, source)
theme = @controller.site.themes.find_by_theme_id(theme) unless theme.is_a?(Theme)
theme_compute_public_path(theme, source, theme.url + '/javascripts', 'js')
end
alias_method :theme_path_to_javascript, :theme_javascript_path
def theme_javascript_include_tag(theme_id, *sources)
theme = @controller.site.themes.find_by_theme_id(theme_id)
return("could not find theme with the id #{theme_id}") unless theme
options = sources.extract_options!.stringify_keys
cache = options.delete("cache")
recursive = options.delete("recursive")
if ActionController::Base.perform_caching && cache
joined_javascript_name = (cache == true ? "all" : cache) + ".js"
joined_javascript_path = File.join(theme.path + '/javascripts', joined_javascript_name)
paths = theme_compute_javascript_paths(theme, sources, recursive)
theme_write_asset_file_contents(theme, joined_javascript_path, paths) unless File.exists?(joined_javascript_path)
theme_javascript_src_tag(theme, joined_javascript_name, options)
else
theme_expand_javascript_sources(theme, sources, recursive).collect do |source|
theme_javascript_src_tag(theme, source, options)
end.join("\n")
end
end
def theme_stylesheet_path(theme, source)
theme = @controller.site.themes.find_by_theme_id(theme) unless theme.is_a?(Theme)
theme_compute_public_path(theme, source, theme.url + '/stylesheets', 'css')
end
alias_method :theme_path_to_stylesheet, :theme_stylesheet_path
def theme_stylesheet_link_tag(theme_id, *sources)
theme = @controller.site.themes.find_by_theme_id(theme_id)
return("could not find theme with the id #{theme_id}") unless theme
options = sources.extract_options!.stringify_keys
cache = options.delete("cache")
recursive = options.delete("recursive")
if ActionController::Base.perform_caching && cache
joined_stylesheet_name = (cache == true ? "all" : cache) + ".css"
joined_stylesheet_path = File.join(theme.path + '/stylesheets', joined_stylesheet_name)
paths = theme_compute_stylesheet_paths(theme, sources, recursive)
theme_write_asset_file_contents(theme, joined_stylesheet_path, paths) unless File.exists?(joined_stylesheet_path)
theme_stylesheet_tag(theme, joined_stylesheet_name, options)
else
theme_expand_stylesheet_sources(theme, sources, recursive).collect do |source|
theme_stylesheet_tag(theme, source, options)
end.join("\n")
end
end
def theme_image_path(theme, source)
theme = @controller.site.themes.find_by_theme_id(theme) unless theme.is_a?(Theme)
theme_compute_public_path(theme, source, theme.url + '/images')
end
alias_method :theme_path_to_image, :theme_image_path # aliased to avoid conflicts with an image_path named route
def theme_image_tag(theme_id, source, options = {})
theme = @controller.site.themes.find_by_theme_id(theme_id)
return("could not find theme with the id #{theme_id}") unless theme
options.symbolize_keys!
options[:src] = theme_path_to_image(theme, source)
options[:alt] ||= File.basename(options[:src], '.*').split('.').first.to_s.capitalize
if size = options.delete(:size)
options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$}
end
if mouseover = options.delete(:mouseover)
options[:onmouseover] = "this.src='#{theme_image_path(theme, mouseover)}'"
options[:onmouseout] = "this.src='#{theme_image_path(theme, options[:src])}'"
end
tag("img", options)
end
private
def theme_compute_public_path(theme, source, dir, ext = nil, include_host = true)
has_request = @controller.respond_to?(:request)
if ext && (File.extname(source).blank? || File.exist?(File.join(theme.path, dir, "#{source}.#{ext}")))
source += ".#{ext}"
end
unless source =~ %r{^[-a-z]+://}
source = "/#{dir}/#{source}" unless source[0] == ?/
source = theme_rewrite_asset_path(theme, source)
if has_request && include_host
unless source =~ %r{^#{ActionController::Base.relative_url_root}/}
source = "#{ActionController::Base.relative_url_root}#{source}"
end
end
end
if include_host && source !~ %r{^[-a-z]+://}
host = compute_asset_host(source)
if has_request && host.present? && host !~ %r{^[-a-z]+://}
host = "#{@controller.request.protocol}#{host}"
end
"#{host}#{source}"
else
source
end
end
def theme_rails_asset_id(theme, source)
if asset_id = ENV["RAILS_ASSET_ID"]
asset_id
else
if @@cache_asset_timestamps && (asset_id = @@asset_timestamps_cache[source])
asset_id
else
path = File.join(theme.path, source)
asset_id = File.exist?(path) ? File.mtime(path).to_i.to_s : ''
if @@cache_asset_timestamps
@@asset_timestamps_cache_guard.synchronize do
@@asset_timestamps_cache[source] = asset_id
end
end
asset_id
end
end
end
def theme_rewrite_asset_path(theme, source)
asset_id = theme_rails_asset_id(theme, source)
if asset_id.blank?
source
else
source + "?#{asset_id}"
end
end
def theme_javascript_src_tag(theme, source, options)
options = { "type" => Mime::JS, "src" => theme_path_to_javascript(theme, source) }.merge(options)
content_tag("script", "", options)
end
def theme_stylesheet_tag(theme, source, options)
options = { "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen",
"href" => html_escape(theme_path_to_stylesheet(theme, source)) }.merge(options)
tag("link", options, false, false)
end
def theme_compute_javascript_paths(theme, *args)
theme_expand_javascript_sources(theme, *args).collect do |source|
theme_compute_public_path(theme, source, theme.url + '/javascripts', 'js', false)
end
end
def theme_compute_stylesheet_paths(theme, *args)
theme_expand_stylesheet_sources(theme, *args).collect do |source|
theme_compute_public_path(theme, source, theme.url + '/stylesheets', 'css', false)
end
end
def theme_expand_javascript_sources(theme, sources, recursive = false)
if sources.include?(:all)
all_javascript_files = collect_asset_files(theme.path + '/javascripts', ('**' if recursive), '*.js').uniq
else
sources.collect { |source| determine_source(source, {}) }.flatten
end
end
def theme_expand_stylesheet_sources(theme, sources, recursive)
if sources.first == :all
collect_asset_files(theme.path + '/stylesheets', ('**' if recursive), '*.css')
else
sources.collect do |source|
determine_source(source, {})
end.flatten
end
end
def theme_write_asset_file_contents(theme, joined_asset_path, asset_paths)
FileUtils.mkdir_p(File.dirname(joined_asset_path))
File.open(joined_asset_path, "w+") do |cache|
cache.write(theme_join_asset_file_contents(theme, asset_paths))
end
mt = asset_paths.map { |p| File.mtime(theme_asset_file_path(theme, p)) }.max
File.utime(mt, mt, joined_asset_path)
end
def theme_join_asset_file_contents(theme, paths)
paths.collect { |path| File.read(theme_asset_file_path(theme, path)) }.join("\n\n")
end
def theme_asset_file_path(theme, path)
File.join(Theme.root_dir, path.split('?').first)
end
end
end
end
| 40.694444 | 123 | 0.627759 |
7a84a7108d6d1e48b3192783f3cab6e7c2df3a78
| 281 |
module Cyr
module Views
# Since editing and selecting are the same interaction, just different
# flow states, we just have to give the select state a name that matches
# and inherit the edit state.
class SelectSource < Cyr::Views::EditSource; end
end
end
| 25.545455 | 76 | 0.711744 |
e2cd9f7b231606c20896ace1b593447338c001de
| 1,896 |
module Jekyll
# Base class for the tag pages with all the shared behaviour
class BaseTagPage < Page
def initialize(site, base, dir)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process @name
self.read_yaml File.join(base, '_layouts'), layout_page
end
# Implement this function in child classes
# Expected to return a string containing the filename of the layout in _layouts
def layout_page
raise
end
end
# Represents a specific tag page
class TagPage < BaseTagPage
def initialize(site, base, dir, tag)
super(site, base, dir)
self.data['tag'] = tag
end
def layout_page
'tag_page.html'
end
end
# Generate a page for every tag
class TagPageGenerator < Generator
safe true
def generate(site)
if site.layouts.has_key? 'tag_page'
dir = site.config['tag_page_dir'] || 'tag'
site.tags.keys.each do |tag|
write_tag_page(site, File.join(dir, tag), tag)
end
end
end
private
def write_tag_page(site, dir, tag)
page = TagPage.new(site, site.source, dir, tag)
page.render(site.layouts, site.site_payload)
page.write(site.dest)
site.pages << page
end
end
# Represents a page with all the tags
class TagIndexPage < BaseTagPage
def layout_page
'tag_index.html'
end
end
# Generates a page with all tags
class TagIndexGenerator < Generator
safe true
def generate(site)
if site.layouts.has_key? 'tag_index'
dir = site.config['tag_index_dir'] || 'tags'
write_tag_index(site, dir)
end
end
private
def write_tag_index(site, dir)
page = TagIndexPage.new(site, site.source, dir)
page.render(site.layouts, site.site_payload)
page.write(site.dest)
site.pages << page
end
end
end
| 22.843373 | 83 | 0.636076 |
edb3330a5fc872bf57e9656904d3b63111aafa66
| 3,704 |
require 'rake'
require 'rake/clean'
namespace(:tools) do
namespace(:rubygems) do
package = RubyInstaller::RubyGems
interpreter = RubyInstaller::Ruby18
directory package.target
directory package.install_target
CLEAN.include(package.target)
CLEAN.include(package.install_target)
# Put files for the :download task
package.files.each do |f|
file_source = "#{package.url}/#{f}"
file_target = "downloads/#{f}"
download file_target => file_source
# depend on downloads directory
file file_target => "downloads"
# download task need these files as pre-requisites
task :download => file_target
end
task :checkout => "downloads" do
cd RubyInstaller::ROOT do
# If is there already a checkout, update instead of checkout"
if File.exist?(File.join(RubyInstaller::ROOT, package.checkout_target, '.svn'))
sh "svn update #{package.checkout_target}"
else
sh "svn co #{package.checkout} #{package.checkout_target}"
end
end
end
# Prepare the :sandbox, it requires the :download task
task :extract => [:extract_utils, package.target] do
# grab the files from the download task
files = Rake::Task['tools:rubygems:download'].prerequisites
# use the checkout copy instead of the packaged file
unless ENV['CHECKOUT']
files.each { |f|
extract(File.join(RubyInstaller::ROOT, f), package.target)
}
else
cp_r(package.checkout_target, File.join(RubyInstaller::ROOT, 'sandbox'), :verbose => true, :remove_destination => true)
end
end
ENV['CHECKOUT'] ? task(:extract => :checkout) : task(:extract => :download)
task :install => [package.target, package.install_target, interpreter.install_target] do
new_ruby = File.join(RubyInstaller::ROOT, interpreter.install_target, "bin").gsub(File::SEPARATOR, File::ALT_SEPARATOR)
ENV['PATH'] = "#{new_ruby};#{ENV['PATH']}"
ENV.delete("RUBYOPT")
cd package.target do
sh "ruby setup.rb install #{package.configure_options.join(' ')} --destdir=#{File.join(RubyInstaller::ROOT, package.install_target)}"
end
# now fixes all the stub batch files form bin
Dir.glob("{#{interpreter.install_target},#{package.install_target}}/bin/*.bat").each do |bat|
script = File.basename(bat).gsub(File.extname(bat), '')
File.open(bat, 'w') do |f|
f.puts <<-TEXT
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "#{File.join("C:/Ruby/bin", script)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
TEXT
end
end
# and now, fixes the shebang lines for the scripts
bang_line = "#!#{File.expand_path(File.join(interpreter.install_target, 'bin', 'ruby.exe'))}"
Dir.glob("#{package.install_target}/bin/*").each do |script|
# only process true scripts!!! (extensionless)
if File.extname(script) == ""
contents = File.read(script).gsub(/#{Regexp.escape(bang_line)}/) do |match|
"#!/usr/bin/env ruby"
end
File.open(script, 'w') { |f| f.write(contents) }
end
end
# now relocate lib into lib/ruby/site_ruby (to conform default installation).
# Dir.chdir(package.install_target) do
# mv 'lib', '1.8'
# mkdir_p 'lib/ruby/site_ruby'
# mv '1.8', 'lib/ruby/site_ruby'
# end
end
end
end
if ENV['CHECKOUT']
task :download => ['tools:rubygems:checkout']
else
task :download => ['tools:rubygems:download']
end
task :extract => ['tools:rubygems:extract']
task :install => ['tools:rubygems:install']
| 34.943396 | 141 | 0.62959 |
edb58cebc6d887b0871023ec7793548dd6d05eb1
| 411 |
namespace :load do
task :defaults do
load "capistrano/taillog/defaults.rb"
end
end
namespace :logs do
desc "Tail remote logs"
task :tail do
ask(:file, fetch(:default_log))
on roles(:all) do
path = File.join(fetch(:log_path), fetch(:file))
if test("[ -f #{path} ]")
execute :tail, '-f', path
else
fatal "#{path} does not exist!"
end
end
end
end
| 19.571429 | 54 | 0.588808 |
21344c3c276bc500f8f7276a2d01f3eaffca0b53
| 1,964 |
platform "solaris-11-i386" do |plat|
plat.servicedir "/lib/svc/manifest"
plat.defaultdir "/lib/svc/method"
plat.servicetype "smf"
plat.vmpooler_template "solaris-11-x86_64"
plat.add_build_repository 'http://solaris-11-reposync.delivery.puppetlabs.net:81', 'puppetlabs.com'
packages = [
"pl-binutils-i386",
"pl-cmake",
"pl-gcc-i386",
"pl-pkg-config"
]
plat.provision_with("pkg install #{packages.join(' ')}")
plat.provision_with %[echo "# Write the noask file to a temporary directory
# please see man -s 4 admin for details about this file:
# http://www.opensolarisforum.org/man/man4/admin.html
#
# The key thing we don\'t want to prompt for are conflicting files.
# The other nocheck settings are mostly defensive to prevent prompts
# We _do_ want to check for available free space and abort if there is
# not enough
mail=
# Overwrite already installed instances
instance=overwrite
# Do not bother checking for partially installed packages
partial=nocheck
# Do not bother checking the runlevel
runlevel=nocheck
# Do not bother checking package dependencies (We take care of this)
idepend=nocheck
rdepend=nocheck
# DO check for available free space and abort if there isn\'t enough
space=quit
# Do not check for setuid files.
setuid=nocheck
# Do not check if files conflict with other packages
conflict=nocheck
# We have no action scripts. Do not check for them.
action=nocheck
# Install to the default base directory.
basedir=default" > /var/tmp/vanagon-noask;
echo "mirror=https://artifactory.delivery.puppetlabs.net/artifactory/generic__remote_opencsw_mirror/testing" > /var/tmp/vanagon-pkgutil.conf;
pkgadd -n -a /var/tmp/vanagon-noask -d http://get.opencsw.org/now all
/opt/csw/bin/pkgutil --config=/var/tmp/vanagon-pkgutil.conf -y -i libffi_dev || exit 1;
ntpdate pool.ntp.org]
plat.install_build_dependencies_with "pkg install ", " || [[ $? -eq 4 ]]"
plat.output_dir File.join("solaris", "11", "PC1")
end
| 36.37037 | 143 | 0.748473 |
08734cc916f6fd3960baefcf105dd3fca605f98a
| 620 |
require_relative '../../spec_helper'
require_relative 'fixtures/classes'
require_relative 'shared/replace'
describe "String#initialize" do
it "is a private method" do
String.should have_private_instance_method(:initialize)
end
describe "with no arguments" do
it "does not change self" do
s = "some string"
s.send :initialize
s.should == "some string"
end
it "does not raise an exception when frozen" do
a = "hello".freeze
a.send(:initialize).should equal(a)
end
end
describe "with an argument" do
it_behaves_like :string_replace, :initialize
end
end
| 22.962963 | 59 | 0.691935 |
3327c293d50e9d77695f1b5dcf1f00ccaac7d4f3
| 842 |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
User.create!(name: "Example User",
email: "[email protected]",
password: "foobar",
password_confirmation: "foobar",
admin: true)
99.times do |n|
name = Faker::Name.name
email = "example-#{n+1}@railstutorial.org"
password = "password"
User.create!(name: name,
email: email,
password: password,
password_confirmation: password)
end
| 38.272727 | 111 | 0.614014 |
1aea4454287eda17c8a9b4113c0906b4127f36e3
| 57 |
my_num = 100
# Write code above this line!
puts my_num
| 11.4 | 29 | 0.719298 |
f827e99399055c0a9fdabb4ca81c4fecea718248
| 1,568 |
#
# Author:: Marc Paradise <[email protected]>
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# 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.
#
require_relative "../../spec_helper"
require "chef/secret_fetcher/akeyless_vault"
describe Chef::SecretFetcher::AKeylessVault do
let(:node) { {} }
let(:run_context) { double("run_context", node: node) }
context "when validating provided AKeyless Vault configuration" do
it "raises ConfigurationInvalid when :secret_access_key is not provided" do
fetcher = Chef::SecretFetcher::AKeylessVault.new( { access_id: "provided" }, run_context)
expect { fetcher.validate! }.to raise_error(Chef::Exceptions::Secret::ConfigurationInvalid, /:secret_access_key/)
end
it "raises ConfigurationInvalid when :access_key_id is not provided" do
fetcher = Chef::SecretFetcher::AKeylessVault.new( { access_key: "provided" }, run_context)
expect { fetcher.validate! }.to raise_error(Chef::Exceptions::Secret::ConfigurationInvalid, /:access_key_id/)
end
end
end
| 41.263158 | 119 | 0.74426 |
0819dc41f125b5c59fe020da71ab06acf58e65f0
| 1,607 |
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'game_codebreaker/version'
Gem::Specification.new do |spec|
spec.name = "game_codebreaker"
spec.version = GameCodebreaker::VERSION
spec.authors = ["woodcrust"]
spec.email = ["[email protected]"]
spec.summary = %q{This is game codebreaker for your terminal}
spec.description = %q{PLAY NOW!}
spec.homepage = "https://github.com/woodcrust/Codebreaker"
spec.license = "MIT"
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
# spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.files = Dir['lib/**/*']
# # spec.bindir = "exe"
spec.bindir = "bin"
# # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.executables = ["game_codebreaker"]
spec.require_paths = ["lib"]
# spec.files = `git ls-files`.split("\n")
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
# spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
# spec.require_paths = ["./"]
spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.4"
spec.add_development_dependency "rspec-collection_matchers", "~> 1.1"
spec.add_development_dependency 'byebug', '~> 8.0'
end
| 41.205128 | 106 | 0.638457 |
2808d16f09e1596394c94a5f8deab7e253efbbb2
| 6,620 |
require 'minitest/autorun'
require 'json'
# test all the methods we override in embedded_help.rb
# these tests should all pass when run by ruby or openstudio CLI
class EmbeddedHelp_Test < Minitest::Test
def test_dir_glob
original_dir = Dir.pwd
Dir.chdir(File.join(File.dirname(__FILE__), '..'))
# test things that should work in ruby or CLI
no_block_glob = Dir["*.txt", "*.rb"]
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
puts no_block_glob.index('test_embedded_help.rb')
assert_nil(no_block_glob.index('test_embedded_help.rb'))
no_block_glob = Dir.glob(["*.txt", "*.rb"])
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
assert_nil(no_block_glob.index('test_embedded_help.rb'))
no_block_glob = Dir.glob("*.txt")
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_nil(no_block_glob.index('embedded_help.rb'))
assert_nil(no_block_glob.index('test_embedded_help.rb'))
no_block_glob = Dir["**/*.txt", "**/*.rb"]
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
assert_includes(no_block_glob, 'test/test_embedded_help.rb')
no_block_glob = Dir["*{.txt,.rb}"]
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
assert_nil(no_block_glob.index('test_embedded_help.rb'))
assert_nil(no_block_glob.index('test/test_embedded_help.rb'))
no_block_glob = Dir["{,*,*/*}.{txt,rb}"]
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
assert_includes(no_block_glob, 'test/test_embedded_help.rb')
no_block_glob = Dir.glob("{,*,*/*}.{txt,rb}")
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
assert_includes(no_block_glob, 'test/test_embedded_help.rb')
no_block_glob = Dir["./**/*.txt", "./**/*.rb"]
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, './CMakeLists.txt')
assert_includes(no_block_glob, './embedded_help.rb')
assert_includes(no_block_glob, './test/test_embedded_help.rb')
block_glob = []
Dir["*.txt", "*.rb"].each do |p|
block_glob << p
end
assert_includes(block_glob, 'CMakeLists.txt')
assert_includes(block_glob, 'embedded_help.rb')
assert_nil(block_glob.index('test_embedded_help.rb'))
assert(File.fnmatch( "C:/test/help.rb", "C:/test/help.rb", 0))
assert(File.fnmatch( "C:/test/help.rb", "C:/test/help.rb", File::FNM_EXTGLOB))
assert(File.fnmatch( "C:/**/help.rb", "C:/test/help.rb", 0))
assert(File.fnmatch( "C:/**/help.rb", "C:/test/help.rb", File::FNM_EXTGLOB))
assert(!File.fnmatch( "C:/**/help{.rb,.txt}", "C:/test/help.rb", 0))
assert(File.fnmatch( "C:/**/help{.rb,.txt}", "C:/test/help.rb", File::FNM_EXTGLOB))
assert(File.fnmatch( ":/test/help.rb", ":/test/help.rb", 0))
assert(File.fnmatch( ":/test/help.rb", ":/test/help.rb", File::FNM_EXTGLOB))
assert(File.fnmatch( ":/**/help.rb", ":/test/help.rb", 0))
assert(File.fnmatch( ":/**/help.rb", ":/test/help.rb", File::FNM_EXTGLOB))
assert(!File.fnmatch( ":/**/help{.rb,.txt}", ":/test/help.rb", 0))
assert(File.fnmatch( ":/**/help{.rb,.txt}", ":/test/help.rb", File::FNM_EXTGLOB))
# test things that should only work in the CLI
if defined?(OpenStudio::CLI) && OpenStudio::CLI
no_block_glob = Dir[":/*.txt", ":/*.rb"]
assert_instance_of(Array, no_block_glob)
assert(no_block_glob.size > 0)
no_block_glob = Dir.glob(":/*.txt")
assert_instance_of(Array, no_block_glob)
assert(no_block_glob.size == 0)
no_block_glob = Dir[":/**/*.txt", ":/**/*.rb"]
assert_instance_of(Array, no_block_glob)
assert(no_block_glob.size > 0)
no_block_glob = Dir[":/{,*,*/*}.rb"]
assert_instance_of(Array, no_block_glob)
assert(no_block_glob.size > 0)
block_glob = []
Dir[":/*.txt", ":/*.rb"].each do |p|
block_glob << p
end
assert_instance_of(Array, block_glob)
assert(block_glob.size > 0)
end
ensure
Dir.chdir(original_dir)
end
def test_file_read
test_json = { :test_int => 10, :test_string => 'String'}
if File.exist?('test.json')
FileUtils.rm('test.json')
end
assert(!File.exist?('test.json'))
File.open('test.json', 'w') do |f|
f.puts JSON.generate(test_json)
# make sure data is written to the disk one way or the other
begin
f.fsync
rescue
f.flush
end
end
assert(File.exist?('test.json'))
test_json2 = JSON.parse(File.read('test.json'), symbolize_names: true)
assert_equal(test_json2[:test_int], 10)
assert_equal(test_json2[:test_string], 'String')
test_json3 = nil
File.open('test.json', 'r') do |f|
test_json3 = JSON.parse(f.read, symbolize_names: true)
end
assert_equal(test_json3[:test_int], 10)
assert_equal(test_json3[:test_string], 'String')
ensure
if File.exist?('test.json')
FileUtils.rm('test.json')
end
end
def test_fileutils_mv
test_json = { :test_int => 10, :test_string => 'String'}
if File.exist?('mv_test.json')
FileUtils.rm('mv_test.json')
end
assert(!File.exist?('mv_test.json'))
if File.exist?('mv_test2.json')
FileUtils.rm('mv_test2.json')
end
assert(!File.exist?('mv_test2.json'))
File.open('mv_test.json', 'w') do |f|
f.puts JSON.generate(test_json)
# make sure data is written to the disk one way or the other
begin
f.fsync
rescue
f.flush
end
end
assert(File.exist?('mv_test.json'))
assert(!File.exist?('mv_test2.json'))
FileUtils.mv('mv_test.json', 'mv_test2.json', force: true)
assert(!File.exist?('mv_test.json'))
assert(File.exist?('mv_test2.json'))
ensure
if File.exist?('mv_test.json')
FileUtils.rm('mv_test.json')
end
if File.exist?('mv_test2.json')
FileUtils.rm('mv_test2.json')
end
end
end
| 34.300518 | 87 | 0.646979 |
ab1c3f16869bd5aae6ddf0d3e1e5b1ca1dbc1b0e
| 3,560 |
require 'spec_helper'
describe Journey::Resource::WhereMultiple do
let(:klass) do
Class.new(Journey::Resource) do
self.element_name = 'job'
end
end
before { klass.all.each(&:destroy) }
let!(:candidates) { matchables + unmatchables }
let(:collection) { klass.where_multiple(clauses) }
let(:count) { klass.count_multiple(clauses) }
context "when query doesn't contain any key having an array-like value" do
let(:clauses) do
{ query: { number: 'A' } }
end
let(:matchables) do
[ klass.create(number: 'A') ]
end
let(:unmatchables) do
[ klass.create(number: 'X') ]
end
it 'returns correct results' do
expect(matchables).to be_all do |matchable|
collection.include?(matchable)
end
expect(unmatchables).not_to be_any do |unmatchable|
collection.include?(unmatchable)
end
end
it 'counts correctly' do
expect(count).to eq 1
end
pending 'performs 1 query'
end
context "when query contains a key with the value of an array containing a single item" do
let(:clauses) do
{ query: { number: ['A'] }, sort: { number: :desc } }
end
let(:matchables) do
[
klass.create(number: 'A')
]
end
let(:unmatchables) do
[
klass.create(number: 'B')
]
end
it 'returns correct results' do
expect(matchables).to be_all do |matchable|
collection.include?(matchable)
end
expect(unmatchables).not_to be_any do |unmatchable|
collection.include?(unmatchable)
end
end
it 'counts correctly' do
expect(count).to eq 1
end
pending 'performs n queries'
end
context "when query contains one key having an array-like value" do
let(:clauses) do
{ query: { number: ['A', 'B'] } }
end
let(:matchables) do
[
klass.create(number: 'A'),
klass.create(number: 'B')
]
end
let(:unmatchables) do
[
klass.create(number: 'X'),
klass.create(number: 'Y')
]
end
it 'returns correct results' do
expect(matchables).to be_all do |matchable|
collection.include?(matchable)
end
expect(unmatchables).not_to be_any do |unmatchable|
collection.include?(unmatchable)
end
end
it 'counts correctly' do
expect(count).to eq 2
end
pending 'performs n queries'
end
context "when query contains two keys having array-like values" do
let(:clauses) do
{ query: { number: ['A', 'B'], flash_number: ['1', '2'] } }
end
let(:matchables) do
[
klass.create(number: 'A', flash_number: '1'),
klass.create(number: 'A', flash_number: '2'),
klass.create(number: 'B', flash_number: '1'),
klass.create(number: 'B', flash_number: '2'),
]
end
let(:unmatchables) do
[
klass.create(number: 'A', flash_number: '3'),
klass.create(number: 'B', flash_number: '3'),
klass.create(number: 'C', flash_number: '1'),
klass.create(number: 'C', flash_number: '2'),
klass.create(number: 'C', flash_number: '3'),
]
end
it 'returns correct results' do
expect(matchables).to be_all do |matchable|
collection.include?(matchable)
end
expect(unmatchables).not_to be_any do |unmatchable|
collection.include?(unmatchable)
end
end
it 'counts correctly' do
expect(count).to eq 4
end
pending 'performs m * n queries'
end
end
| 23.421053 | 92 | 0.596348 |
084eb7797c84330bd7ec0f0a691ae2acf53b3dc9
| 534 |
# require 'spec_helper'
require 'rails_helper'
describe "User pages" do
subject { page }
describe "profile page" do
it "content user name" do
user = FactoryBot.build(:user)
visit user_path(user)
should hava_content(user.name)
# it { should have_content(user.name) }
# it { should have_title(user.name) }
end
end
=begin
describe "signup page" do
before { visit signup_path }
it { should have_content('Sign up') }
it { should have_title(full_title('Sign up')) }
end
=end
end
| 19.777778 | 51 | 0.655431 |
ab52bd84bd7f7eff30fbeba377bedd3cf0983c54
| 569 |
require 'cancan'
class Forem::ApplicationController < ApplicationController
rescue_from CanCan::AccessDenied do
redirect_to root_path, :alert => t("forem.access_denied")
end
def current_ability
Forem::Ability.new(forem_user)
end
private
def authenticate_forem_user
if !forem_user
session["user_return_to"] = request.fullpath
flash.alert = t("forem.errors.not_signed_in")
redirect_to main_app.sign_in_path
end
end
def forem_admin?
forem_user && forem_user.forem_admin?
end
helper_method :forem_admin?
end
| 19.62069 | 61 | 0.732865 |
abb817d88e8a18e2dc8d7c6ce4c8d3e43919c07b
| 745 |
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Phrase::TagWithStats1
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe 'TagWithStats1' do
before do
# run before each test
@instance = Phrase::TagWithStats1.new
end
after do
# run after each test
end
describe 'test an instance of TagWithStats1' do
it 'should create an instance of TagWithStats1' do
expect(@instance).to be_instance_of(Phrase::TagWithStats1)
end
end
describe 'test attribute "statistics"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
end
| 24.833333 | 102 | 0.727517 |
1cf9cfaff0a8d4cad4cd49204b8741e248127802
| 2,329 |
require "spec_helper"
describe Mongoid::Relations::Embedded::In do
let(:binding_klass) do
Mongoid::Relations::Bindings::Embedded::In
end
let(:builder_klass) do
Mongoid::Relations::Builders::Embedded::In
end
let(:nested_builder_klass) do
Mongoid::Relations::Builders::NestedAttributes::One
end
let(:binding) do
stub
end
let(:base) do
Name.new
end
let(:target) do
Person.new
end
let(:metadata) do
Mongoid::Relations::Metadata.new(
:relation => described_class,
:inverse_class_name => "Name",
:name => :namable,
:polymorphic => true
)
end
describe "#===" do
let(:relation) do
described_class.new(base, target, metadata)
end
context "when the proxied document is same class" do
it "returns true" do
(relation === Person.new).should be_true
end
end
end
describe ".builder" do
it "returns the embedded one builder" do
described_class.builder(metadata, target).should be_a(builder_klass)
end
end
describe ".embedded?" do
it "returns true" do
described_class.should be_embedded
end
end
describe "#initialize" do
let(:relation) do
described_class.new(base, target, metadata)
end
it "parentizes the child" do
relation.base._parent.should == target
end
end
describe ".macro" do
it "returns embeds_one" do
described_class.macro.should == :embedded_in
end
end
describe ".nested_builder" do
let(:attributes) do
{}
end
it "returns the single nested builder" do
described_class.nested_builder(metadata, attributes, {}).should
be_a(nested_builder_klass)
end
end
describe "#respond_to?" do
let(:person) do
Person.new
end
let!(:name) do
person.build_name(:first_name => "Tony")
end
let(:document) do
name.namable
end
Mongoid::Document.public_instance_methods(true).each do |method|
context "when checking #{method}" do
it "returns true" do
document.respond_to?(method).should be_true
end
end
end
end
describe ".valid_options" do
it "returns the valid options" do
described_class.valid_options.should ==
[ :cyclic, :polymorphic ]
end
end
end
| 18.054264 | 74 | 0.638471 |
ed6ed7387866197d6f63a2b6c002048afea9cfc2
| 1,525 |
module Org
class Board::OrgansController < Board::BaseController
before_action :set_organ, only: [:show, :edit, :update, :destroy]
def index
@organs = current_user.organs
if @organs.blank?
@member = current_user.members.build
@organ = @member.build_organ
render :new
else
render 'index'
end
end
def new
@organ = Organ.new
@member = @organ.members.build(owned: true)
end
def create
@organ = Organ.new(organ_params)
@member = @organ.members.build(owned: true)
@member.account = current_account
unless @organ.save
render :new, locals: { model: @organ }, status: :unprocessable_entity
end
end
def show
end
def edit
end
def update
@organ.assign_attributes(organ_params)
unless @organ.save
render :edit, locals: { model: @organ }, status: :unprocessable_entity
end
end
def destroy
@organ.destroy
end
private
def set_member
@member = current_user.members.find params[:member_id]
end
def set_organ
@organ = current_user.organs.find(params[:id])
end
def member_params
p = params.fetch(:member, {}).permit(
:identity
)
p.merge! owned: true
unless p[:identity]
p.merge! identity: current_account.identity
end
p
end
def organ_params
params.fetch(:organ, {}).permit(
:name,
:logo
)
end
end
end
| 19.551282 | 78 | 0.591475 |
62ea3d8f0879183efdeba1471e234e758578802b
| 11,144 |
module ActiveRecord
module Acts #:nodoc:
module List #:nodoc:
def self.included(base)
base.extend(ClassMethods)
end
# This +acts_as+ extension provides the capabilities for sorting and reordering a number of objects in a list.
# The class that has this specified needs to have a +position+ column defined as an integer on
# the mapped database table.
#
# Todo list example:
#
# class TodoList < ActiveRecord::Base
# has_many :todo_items, :order => "position"
# end
#
# class TodoItem < ActiveRecord::Base
# belongs_to :todo_list
# acts_as_list :scope => :todo_list
# end
#
# todo_list.first.move_to_bottom
# todo_list.last.move_higher
module ClassMethods
# Configuration options are:
#
# * +column+ - specifies the column name to use for keeping the position integer (default: +position+)
# * +scope+ - restricts what is to be considered a list. Given a symbol, it'll attach <tt>_id</tt>
# (if it hasn't already been added) and use that as the foreign key restriction. It's also possible
# to give it an entire string that is interpolated if you need a tighter scope than just a foreign key.
# Example: <tt>acts_as_list :scope => 'todo_list_id = #{todo_list_id} AND completed = 0'</tt>
def acts_as_list(options = {})
configuration = { :column => "position", :scope => "1 = 1" }
configuration.update(options) if options.is_a?(Hash)
configuration[:scope] = "#{configuration[:scope]}_id".intern if configuration[:scope].is_a?(Symbol) && configuration[:scope].to_s !~ /_id$/
if configuration[:scope].is_a?(Symbol)
scope_condition_method = %(
def scope_condition
if #{configuration[:scope].to_s}.nil?
"#{configuration[:scope].to_s} IS NULL"
else
"#{configuration[:scope].to_s} = \#{#{configuration[:scope].to_s}}"
end
end
)
else
scope_condition_method = "def scope_condition() \"#{configuration[:scope]}\" end"
end
class_eval <<-EOV
include ActiveRecord::Acts::List::InstanceMethods
def acts_as_list_class
::#{self.name}
end
def position_column
'#{configuration[:column]}'
end
#{scope_condition_method}
before_destroy :remove_from_list
before_create :add_to_list_bottom
EOV
end
end
# All the methods available to a record that has had <tt>acts_as_list</tt> specified. Each method works
# by assuming the object to be the item in the list, so <tt>chapter.move_lower</tt> would move that chapter
# lower in the list of all chapters. Likewise, <tt>chapter.first?</tt> would return +true+ if that chapter is
# the first in the list of all chapters.
module InstanceMethods
# Insert the item at the given position (defaults to the top position of 1).
def insert_at(position = 1)
insert_at_position(position)
end
def move_to(position = 1)
move_to_position(position)
end
# Swap positions with the next lower item, if one exists.
def move_lower
return unless lower_item
acts_as_list_class.transaction do
lower_item.decrement_position
increment_position
end
end
# Swap positions with the next higher item, if one exists.
def move_higher
return unless higher_item
acts_as_list_class.transaction do
higher_item.increment_position
decrement_position
end
end
# Move to the bottom of the list. If the item is already in the list, the items below it have their
# position adjusted accordingly.
def move_to_bottom
return unless in_list?
acts_as_list_class.transaction do
decrement_positions_on_lower_items
assume_bottom_position
end
end
# Move to the top of the list. If the item is already in the list, the items above it have their
# position adjusted accordingly.
def move_to_top
return unless in_list?
acts_as_list_class.transaction do
increment_positions_on_higher_items
assume_top_position
end
end
# Removes the item from the list.
def remove_from_list
if in_list?
decrement_positions_on_lower_items
update_attribute position_column, nil
end
end
# Increase the position of this item without adjusting the rest of the list.
def increment_position
return unless in_list?
update_attribute position_column, self.send(position_column).to_i + 1
end
# Decrease the position of this item without adjusting the rest of the list.
def decrement_position
return unless in_list?
update_attribute position_column, self.send(position_column).to_i - 1
end
# Return +true+ if this object is the first in the list.
def first?
return false unless in_list?
self.send(position_column) == 1
end
# Return +true+ if this object is the last in the list.
def last?
return false unless in_list?
self.send(position_column) == bottom_position_in_list
end
# Return the next higher item in the list.
def higher_item
return nil unless in_list?
acts_as_list_class.find(:first, :conditions =>
"#{scope_condition} AND #{position_column} = #{(send(position_column).to_i - 1).to_s}"
)
end
# Return the next lower item in the list.
def lower_item
return nil unless in_list?
acts_as_list_class.find(:first, :conditions =>
"#{scope_condition} AND #{position_column} = #{(send(position_column).to_i + 1).to_s}"
)
end
# Test if this record is in a list
def in_list?
!send(position_column).nil?
end
private
def add_to_list_top
increment_positions_on_all_items
end
def add_to_list_bottom
self[position_column] = bottom_position_in_list.to_i + 1
end
# Overwrite this method to define the scope of the list changes
def scope_condition() "1" end
# Returns the bottom position number in the list.
# bottom_position_in_list # => 2
def bottom_position_in_list(except = nil)
item = bottom_item(except)
item ? item.send(position_column) : 0
end
# Returns the bottom item
def bottom_item(except = nil)
conditions = scope_condition
conditions = "#{conditions} AND #{self.class.primary_key} != #{except.id}" if except
acts_as_list_class.find(:first, :conditions => conditions, :order => "#{position_column} DESC")
end
# Forces item to assume the bottom position in the list.
def assume_bottom_position
update_attribute(position_column, bottom_position_in_list(self).to_i + 1)
end
# Forces item to assume the top position in the list.
def assume_top_position
update_attribute(position_column, 1)
end
# This has the effect of moving all the higher items up one.
def decrement_positions_on_higher_items(position)
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} - 1)", "#{scope_condition} AND #{position_column} <= #{position}"
)
end
# This has the effect of moving all the lower items up one.
def decrement_positions_on_lower_items
return unless in_list?
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} - 1)", "#{scope_condition} AND #{position_column} > #{send(position_column).to_i}"
)
end
# This has the effect of moving all the higher items down one.
def increment_positions_on_higher_items
return unless in_list?
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} + 1)", "#{scope_condition} AND #{position_column} < #{send(position_column).to_i}"
)
end
# This has the effect of moving all the lower items down one.
def increment_positions_on_lower_items(position)
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} + 1)", "#{scope_condition} AND #{position_column} >= #{position}"
)
end
# Increments position (<tt>position_column</tt>) of all items in the list.
def increment_positions_on_all_items
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} + 1)", "#{scope_condition}"
)
end
# This has the effect of moving all items between two positions (inclusive) up one.
def decrement_positions_between(low, high)
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} - 1)", ["#{scope_condition} AND #{position_column} >= ? AND #{position_column} <= ?", low, high]
)
end
# This has the effect of moving all items between two positions (inclusive) down one.
def increment_positions_between(low, high)
acts_as_list_class.update_all(
"#{position_column} = (#{position_column} + 1)", ["#{scope_condition} AND #{position_column} >= ? AND #{position_column} <= ?", low, high]
)
end
def insert_at_position(position)
remove_from_list
increment_positions_on_lower_items(position)
self.update_attribute(position_column, position)
end
# Moves an existing list element to the "new_position" slot.
def move_to_position(new_position)
old_position = self.send(position_column)
unless new_position == old_position
if new_position < old_position
# Moving higher in the list (up)
new_position = [1, new_position].max
increment_positions_between(new_position, old_position - 1)
else
# Moving lower in the list (down)
new_position = [bottom_position_in_list(self).to_i, new_position].min
decrement_positions_between(old_position + 1, new_position)
end
self.update_attribute(position_column, new_position)
end
end
end
end
end
end
| 38.03413 | 152 | 0.60131 |
1aec7a49e5b01e2755cda7724e37a0cd708d0f03
| 116 |
require "flo_rollout/engine"
require "flo_rollout/init"
require "flo_rollout/feature_detail"
module FloRollout
end
| 16.571429 | 36 | 0.836207 |
6a63ba04c33f0b7015126194d99a9d3a0ece4e5a
| 1,336 |
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Bloggie
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.api_only = false
config.middleware.insert_before 0, "Rack::Cors" do
allow do
origins '*'
resource '*', :headers => :any, :methods => [:get, :post, :options]
end
end
end
end
| 37.111111 | 99 | 0.69985 |
ed1dff6f94d28a5db5b10844e6545a5fb9bf0e63
| 149 |
class FavoriteSerializer < ActiveModel::Serializer
attributes :id, :name, :description, :user_id
def editable
scope == object.user
end
end
| 21.285714 | 50 | 0.738255 |
18f2e237097f661783cc658451256ee2e0f4d507
| 2,380 |
# frozen_string_literal: true
module QA
module Page
module Component
module NewSnippet
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/assets/javascripts/snippets/components/edit.vue' do
element :snippet_title_field, required: true
element :submit_button
end
base.view 'app/assets/javascripts/snippets/components/snippet_description_edit.vue' do
element :snippet_description_field
element :description_placeholder, required: true
end
base.view 'app/assets/javascripts/snippets/components/snippet_blob_edit.vue' do
element :file_name_field
end
base.view 'app/views/shared/form_elements/_description.html.haml' do
element :issuable_form_description
end
base.view 'app/views/shared/snippets/_form.html.haml' do
element :snippet_description_field
element :description_placeholder
element :snippet_title_field
element :file_name_field
element :submit_button
end
base.view 'app/views/shared/_zen.html.haml' do
# This 'element' is here only to ensure the changes in the view source aren't mistakenly changed
element :_, "qa_selector = local_assigns.fetch(:qa_selector, '')" # rubocop:disable QA/ElementWithPattern
end
end
def fill_title(title)
fill_element :snippet_title_field, title
end
def fill_description(description)
click_element :description_placeholder
fill_element :snippet_description_field, description
end
def set_visibility(visibility)
choose visibility
end
def fill_file_name(name)
finished_loading?
fill_element :file_name_field, name
end
def fill_file_content(content)
finished_loading?
text_area.set content
end
def click_create_snippet_button
wait_until(reload: false) { !find_element(:submit_button).disabled? }
click_element(:submit_button, Page::Dashboard::Snippet::Show)
end
private
def text_area
find('#editor textarea', visible: false)
end
end
end
end
end
| 29.382716 | 117 | 0.634034 |
e9d9d3d570d320ced9e6e4f6ca41bdc320c18c6e
| 2,743 |
# typed: strict
# frozen_string_literal: true
require "spec_helper"
class Tapioca::Compilers::Dsl::ActiveRecordFixturesSpec < DslSpec
describe("#initialize") do
after(:each) do
T.unsafe(self).assert_no_generated_errors
end
it("gathers only the ActiveSupport::TestCase base class") do
add_ruby_file("post_test.rb", <<~RUBY)
class PostTest < ActiveSupport::TestCase
end
class User
end
RUBY
assert_equal(["ActiveSupport::TestCase"], gathered_constants)
end
end
describe("#decorate") do
before do
require "active_record"
require "rails"
define_fake_rails_app
end
after(:each) do
T.unsafe(self).assert_no_generated_errors
end
it("does nothing if there are no fixtures") do
expected = <<~RBI
# typed: strong
RBI
assert_equal(expected, rbi_for("ActiveSupport::TestCase"))
end
it("generates methods for fixtures") do
add_content_file("test/fixtures/posts.yml", <<~YAML)
super_post:
title: An incredible Ruby post
author: Johnny Developer
created_at: 2021-09-08 11:00:00
updated_at: 2021-09-08 11:00:00
YAML
expected = <<~RBI
# typed: strong
class ActiveSupport::TestCase
sig { params(fixture_names: Symbol).returns(T.untyped) }
def posts(*fixture_names); end
end
RBI
assert_equal(expected, rbi_for("ActiveSupport::TestCase"))
end
it("generates methods for fixtures from multiple sources") do
add_content_file("test/fixtures/posts.yml", <<~YAML)
super_post:
title: An incredible Ruby post
author: Johnny Developer
created_at: 2021-09-08 11:00:00
updated_at: 2021-09-08 11:00:00
YAML
add_content_file("test/fixtures/users.yml", <<~YAML)
customer:
first_name: John
last_name: Doe
created_at: 2021-09-08 11:00:00
updated_at: 2021-09-08 11:00:00
YAML
expected = <<~RBI
# typed: strong
class ActiveSupport::TestCase
sig { params(fixture_names: Symbol).returns(T.untyped) }
def posts(*fixture_names); end
sig { params(fixture_names: Symbol).returns(T.untyped) }
def users(*fixture_names); end
end
RBI
assert_equal(expected, rbi_for("ActiveSupport::TestCase"))
end
end
private
sig { void }
def define_fake_rails_app
base_folder = Pathname.new(tmp_path("lib"))
config_class = Struct.new(:root)
config = config_class.new(base_folder)
app_class = Struct.new(:config)
Rails.application = app_class.new(config)
end
end
| 24.711712 | 67 | 0.626686 |
5d0d65139af1b30969d167644e70281374b71101
| 446 |
# frozen_string_literal: true
class CreateIncomingChatWebhooks < ActiveRecord::Migration[6.1]
def change
create_table :incoming_chat_webhooks do |t|
t.string :name, null: false
t.string :key, null: false
t.integer :chat_channel_id, null: false
t.string :username
t.string :description
t.string :emoji
t.timestamps
end
add_index :incoming_chat_webhooks, [:key, :chat_channel_id]
end
end
| 24.777778 | 63 | 0.695067 |
1c7106ea1450d71290f04ca7be2715c2e667f5b6
| 2,042 |
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
| 41.673469 | 99 | 0.721841 |
7924e4a57dbe1641132f51dc0f3be3f28e0be0bf
| 1,486 |
module Payday
# Basically just an invoice. Stick a ton of line items in it, add some details, and then render it out!
class Invoice
include Payday::Invoiceable
attr_accessor :invoice_number, :bill_to, :ship_to, :notes, :line_items, :shipping_rate, :shipping_description,
:tax_rate, :tax_description, :due_at, :paid_at, :refunded_at, :currency, :invoice_details, :invoice_date
def initialize(options = {})
self.invoice_number = options[:invoice_number] || nil
self.bill_to = options[:bill_to] || nil
self.ship_to = options[:ship_to] || nil
self.notes = options[:notes] || nil
self.line_items = options[:line_items] || []
self.shipping_rate = options[:shipping_rate] || nil
self.shipping_description = options[:shipping_description] || nil
self.tax_rate = options[:tax_rate] || nil
self.tax_description = options[:tax_description] || nil
self.due_at = options[:due_at] || nil
self.paid_at = options[:paid_at] || nil
self.refunded_at = options[:refunded_at] || nil
self.currency = options[:currency] || nil
self.invoice_details = options[:invoice_details] || []
self.invoice_date = options[:invoice_date] || nil
end
# The tax rate that we're applying, as a BigDecimal
def tax_rate=(value)
@tax_rate = BigDecimal.new(value.to_s)
end
# Shipping rate
def shipping_rate=(value)
@shipping_rate = BigDecimal.new(value.to_s)
end
end
end
| 39.105263 | 114 | 0.676312 |
626c82325ccbbb5a3e222506bc81fb5f9f1c4a40
| 761 |
module PersonalNameHolder
extend ActiveSupport::Concern
KATAKANA_REGEX = /\A[\p{katakana}\u{30fc}]+\z/
HUMAN_NAME_REGEX = /\A[\p{han}\p{hiragana}\p{katakana}u{30fc}A-Za-z]+\z/
included do
include StringNormalizer
before_validation do
self.family_name = normalize_as_name(family_name)
self.given_name = normalize_as_name(given_name)
self.family_name_kana = normalize_as_furigana(family_name_kana)
self.given_name_kana = normalize_as_furigana(given_name_kana)
end
validates :family_name, :given_name, presence: true,
format: { with: HUMAN_NAME_REGEX, allow_blank: true }
validates :family_name_kana, :given_name_kana, presence: true,
format: { with: KATAKANA_REGEX, allow_blank: true }
end
end
| 34.590909 | 74 | 0.735874 |
2115b6ed8987a5c2378ee0d634cfc9223aa66eed
| 2,502 |
# == Schema Information
#
# Table name: procedimientos_medicos_y_de_enfermeria
#
# id :integer not null, primary key
# user_id :integer
# aeropuerto_id :integer
# fecha_novedad :date
# cantidad_acompañamiento_a_pacientes_trasladados_en_ambulancia :integer
# cantidad_actividades_de_capacitacion_propias_y_a_otro_personal :integer
# cantidad_atencion_de_consultas_medicas :integer
# cantidad_atencion_de_llamadas_de_emergencias_de_aeronaves :integer
# cantidad_atencion_de_llamadas_de_emergencias_de_pasajeros_tripu :integer
# cantidad_atencion_de_pacientes_urgentes :integer
# cantidad_atencion_de_pacientes_lesionados_en_el_aeropuerto :integer
# cantidad_autorizacion_de_organos_componente_anatomico :integer
# cantidad_verificacion_de_cadaveres :integer
# cantidad_ambulancias_externas :integer
# cantidad_electrocardiogramas :integer
# cantidad_glucometria :integer
# cantidad_monitoreo_de_pacientes :integer
# cantidad_reunion_de_personal_y_administrativas :integer
# cantidad_reuniones_administrativas_academicas :integer
# cantidad_salida_por_llamadas_de_accidentes_externos :integer
# cantidad_servicios_de_ambulancias_de_sanidad :integer
# cantidad_servicios_de_silla_de_rueda :integer
# cantidad_suminitro_de_medicamentos_iv_im :integer
# cantidad_suminitro_de_medicamentos_vo :integer
# cantidad_suturas_curaciones_y_lavados :integer
# cantidad_terapias_respiratorias_y_nebulizaciones :integer
# cantidad_tomas_y_controles_de_tension_arterial :integer
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper'
RSpec.describe ProcedimientoMedicoYDeEnfermeria, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
| 61.02439 | 106 | 0.588729 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.