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
|
---|---|---|---|---|---|
030d65a000b5b994eb2ac164f3a08ac9aed513e7 | 144 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_bier-to-bier_session'
| 36 | 82 | 0.798611 |
1d99e8080501e7df31a56f755c8b6fdedbc9771a | 774 | class RenameOldCategorizationColumns < ActiveRecord::Migration[4.2]
def up
# This is done in order to not accidentally read the old values anymore,
# but to keep them still safe in the DB as backup for a while if bugs found in the news system
rename_column :listings, :category, :category_old
rename_column :listings, :subcategory, :subcategory_old
rename_column :listings, :share_type, :share_type_old
rename_column :listings, :listing_type, :listing_type_old
end
def down
rename_column :listings, :category_old, :category
rename_column :listings, :subcategory_old, :subcategory
rename_column :listings, :share_type_old, :share_type
rename_column :listings, :listing_type_old, :listing_type
end
end
| 43 | 100 | 0.739018 |
e94bd2e7165b7da4b9d9ca8203fb0f1d10168e39 | 510 | class LeaveWordsController < ApplicationController
before_action :must_be_admin!, except: [:create]
layout false
def create
lw = LeaveWord.new params.require(:leave_word).permit :content
if lw.save
flash[:notice] = t 'messages.success'
else
flash[:alert] = lw.errors.full_messages
end
redirect_to about_us_path
end
def index
@leave_words = LeaveWord.order(id: :desc)
end
def destroy
LeaveWord.destroy params[:id]
render json: {ok: true}
end
end | 19.615385 | 66 | 0.690196 |
5df342105603912d37711701b3827b0e4c2ace9e | 6,112 | # frozen_string_literal: true
require "test_helper"
# Since the goal is to check only against the records that would be returned by the association,
# we need to follow the expected behavior for limits, offset and order.
describe "wa" do
let(:s0) { LimOffOrdS0.create! }
it "Count with belongs_to handles (ignore) offsets and limit" do
s0
assert_wa_from(LimOffOrdS0, 0, :b1)
assert_wa_from(LimOffOrdS0, 0, :bl1)
without_manual_wa_test do # ActiveRecord doesn't ignore offset for belongs_to...
s0.create_b1!
s0.save!
assert_wa_from(LimOffOrdS0, 1, :b1)
assert_wa_from(LimOffOrdS0, 1, :bl1)
s0.create_b1!
s0.save!
assert_wa_from(LimOffOrdS0, 1, :b1)
assert_wa_from(LimOffOrdS0, 1, :bl1)
end
end
it "Count with has_many follows limits and offsets" do
skip if Test::SelectedDBHelper == Test::MySQL
s0
assert_wa_from(LimOffOrdS0, 0, :m1)
assert_wa_from(LimOffOrdS0, 0, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 0, :m1)
assert_wa_from(LimOffOrdS0, 0, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 1, :m1)
assert_wa_from(LimOffOrdS0, 0, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 2, :m1)
assert_wa_from(LimOffOrdS0, 1, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 3, :m1)
assert_wa_from(LimOffOrdS0, 2, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 3, :m1)
assert_wa_from(LimOffOrdS0, 2, :ml1)
end
it "Count with has_many and options[:ignore_limit] ignores offsets and limits" do
with_wa_default_options(ignore_limit: true) do
without_manual_wa_test do
s0
assert_wa_from(LimOffOrdS0, 0, :m1)
assert_wa_from(LimOffOrdS0, 0, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 1, :m1)
assert_wa_from(LimOffOrdS0, 1, :ml1)
s0.m1.create!
assert_wa_from(LimOffOrdS0, 2, :m1)
assert_wa_from(LimOffOrdS0, 2, :ml1)
end
end
end
it "Count with has_one follows offsets and limit is set to 1" do
skip if Test::SelectedDBHelper == Test::MySQL
s0
assert_wa_from(LimOffOrdS0, 0, :o1)
assert_wa_from(LimOffOrdS0, 0, :ol1)
s0.create_has_one!(:o1)
assert_wa_from(LimOffOrdS0, 0, :o1)
assert_wa_from(LimOffOrdS0, 0, :ol1)
s0.create_has_one!(:o1)
assert_wa_from(LimOffOrdS0, 1, :o1)
assert_wa_from(LimOffOrdS0, 0, :ol1)
s0.create_has_one!(:o1)
assert_wa_from(LimOffOrdS0, 1, :o1)
assert_wa_from(LimOffOrdS0, 1, :ol1)
s0.create_has_one!(:o1)
assert_wa_from(LimOffOrdS0, 1, :o1)
assert_wa_from(LimOffOrdS0, 1, :ol1)
end
it "Count with has_one and options[:ignore_limit] ignores offsets and limits and acts like has_many" do
with_wa_default_options(ignore_limit: true) do
without_manual_wa_test do
s0
assert_wa_from(LimOffOrdS0, 0, :o1)
assert_wa_from(LimOffOrdS0, 0, :ol1)
s0.create_has_one!(:o1)
assert_wa_from(LimOffOrdS0, 1, :o1)
assert_wa_from(LimOffOrdS0, 1, :ol1)
s0.create_has_one!(:o1)
assert_wa_from(LimOffOrdS0, 2, :o1)
assert_wa_from(LimOffOrdS0, 2, :ol1)
end
end
end
it "Count with has_and_belongs_to_many follows limits and offsets" do
skip if Test::SelectedDBHelper == Test::MySQL
s0
assert_wa_from(LimOffOrdS0, 0, :z1)
assert_wa_from(LimOffOrdS0, 0, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 0, :z1)
assert_wa_from(LimOffOrdS0, 0, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 1, :z1)
assert_wa_from(LimOffOrdS0, 0, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 2, :z1)
assert_wa_from(LimOffOrdS0, 1, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 3, :z1)
assert_wa_from(LimOffOrdS0, 2, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 3, :z1)
assert_wa_from(LimOffOrdS0, 2, :zl1)
end
it "Count with has_and_belongs_to_many and options[:ignore_limit] ignores offsets and limits" do
with_wa_default_options(ignore_limit: true) do
without_manual_wa_test do
s0
assert_wa_from(LimOffOrdS0, 0, :z1)
assert_wa_from(LimOffOrdS0, 0, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 1, :z1)
assert_wa_from(LimOffOrdS0, 1, :zl1)
s0.z1.create!
assert_wa_from(LimOffOrdS0, 2, :z1)
assert_wa_from(LimOffOrdS0, 2, :zl1)
end
end
end
# Classes for the following tests only
class LimThroughS0 < ActiveRecord::Base
self.table_name = "s0s"
has_many :m1, class_name: "LimThroughS1", foreign_key: "s0_id"
has_many :limited_m2m1, -> { limit(2).reorder("s2s.id desc") }, class_name: "LimThroughS2", through: :m1, source: :m2
end
class LimThroughS1 < ActiveRecord::Base
self.table_name = "s1s"
has_many :m2, class_name: "LimThroughS2", foreign_key: "s1_id"
end
class LimThroughS2 < ActiveRecord::Base
self.table_name = "s2s"
end
it "_* ignores limit from has_many :through's scope" do
s0 = LimThroughS0.create!
s1 = s0.m1.create!
s1.m2.create!
s1.m2.create!
s1.m2.create!
without_manual_wa_test do # Different handling of limit on :through associations
assert_wa_from(LimThroughS0, 3, :limited_m2m1)
end
end
# Classes for the following tests only
class OffThroughS0 < ActiveRecord::Base
self.table_name = "s0s"
has_many :m1, class_name: "OffThroughS1", foreign_key: "s0_id"
has_many :offset_m2m1, -> { offset(2).reorder("s2s.id desc") }, class_name: "OffThroughS2", through: :m1, source: :m2
end
class OffThroughS1 < ActiveRecord::Base
self.table_name = "s1s"
has_many :m2, class_name: "OffThroughS2", foreign_key: "s1_id"
end
class OffThroughS2 < ActiveRecord::Base
self.table_name = "s2s"
end
it "_* ignores offset from has_many :through's scope" do
s0 = OffThroughS0.create!
s1 = s0.m1.create!
s1.m2.create!
without_manual_wa_test do # Different handling of offset on :through associations
assert_wa_from(OffThroughS0, 1, :offset_m2m1)
end
end
end
| 28.560748 | 121 | 0.680137 |
ed1ec0ce29c9cdc0803bfa63435026ac01ffcc2d | 1,434 | # frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'listen/version'
Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
gem.name = 'listen'
gem.version = Listen::VERSION
gem.license = 'MIT'
gem.author = 'Thibaud Guillaume-Gentil'
gem.email = '[email protected]'
gem.homepage = 'https://github.com/guard/listen'
gem.summary = 'Listen to file modifications'
gem.description = 'The Listen gem listens to file modifications and '\
'notifies you about the changes. Works everywhere!'
gem.metadata = {
'allowed_push_host' => 'https://rubygems.org',
'bug_tracker_uri' => "#{gem.homepage}/issues",
'changelog_uri' => "#{gem.homepage}/releases",
'documentation_uri' => "https://www.rubydoc.info/gems/listen/#{gem.version}",
'homepage_uri' => gem.homepage,
'source_code_uri' => "#{gem.homepage}/tree/v#{gem.version}"
}
gem.files = `git ls-files -z`.split("\x0").select do |f|
%r{^(?:bin|lib)/} =~ f
end + %w[CHANGELOG.md CONTRIBUTING.md LICENSE.txt README.md]
gem.test_files = []
gem.executable = 'listen'
gem.require_path = 'lib'
gem.required_ruby_version = '>= 2.2.7' # rubocop:disable Gemspec/RequiredRubyVersion
gem.add_dependency 'rb-fsevent', '~> 0.10', '>= 0.10.3'
gem.add_dependency 'rb-inotify', '~> 0.9', '>= 0.9.10'
end
| 35.85 | 86 | 0.660391 |
ed8a78f64293fa85efd86f8ac13f6905d0a6ca7d | 1,851 | module Oriented
module Core
#
# Class to encapsulate the transaction for OrientDB
#
# Currently, if anything fails, it will rollback the connection
# and then CLOSE it. This means any existing objects in your
# context will be hosed and you'll have to go get them from the db
# with a new connection.
#
# An Identity map would help this, methinks.
class Transaction
def self.run connection = Oriented.connection, options={}, &block
puts options.inspect if options[:commit_on_sucess]
ensure_connection(connection)
ret = yield
connection.commit if options.fetch(:commit_on_success, false) == true
ret
rescue => ex
Oriented.close_connection
puts "rescue att 1 e = #{ex}"
# Rails.logger.info("first attempt = #{ex}")
begin
connection = Oriented.connection
connection.connect
ret = yield
rescue Exception=>e
connection.rollback
# Rails.logger.info("second attempt = #{e}")
raise
end
ensure
end
private
def self.ensure_connection(conn)
unless conn.transaction_active?
conn.connect
end
end
end
module TransactionWrapper
def wrap_in_transaction(*methods)
methods.each do |method|
tx_method = "#{method}_no_tx"
send(:alias_method, tx_method, method)
send(:define_method, method) do |*args|
Oriented::Core::Transaction.run { send(tx_method, *args) }
end
send(:define_method, "#{method}!") do |*args|
Oriented::Core::Transaction.run(Oriented.connection, {commit_on_success: true}) { send(tx_method, *args) }
end
end
end
end
end
end
| 29.380952 | 118 | 0.592653 |
5d78549dfcb7cc6f861de45095f18b0573b79525 | 5,790 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
require 'date'
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
module OCI
# ChangeWaasPolicyCompartmentDetails model.
class Waas::Models::ChangeWaasPolicyCompartmentDetails
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment into which the resource should be moved.
# For information about moving resources between compartments, see [Moving Resources to a Different Compartment](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
#
# @return [String]
attr_accessor :compartment_id
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
# rubocop:disable Style/SymbolLiteral
'compartment_id': :'compartmentId'
# rubocop:enable Style/SymbolLiteral
}
end
# Attribute type mapping.
def self.swagger_types
{
# rubocop:disable Style/SymbolLiteral
'compartment_id': :'String'
# rubocop:enable Style/SymbolLiteral
}
end
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
def initialize(attributes = {})
return unless attributes.is_a?(Hash)
# convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
# Checks equality by comparing each attribute.
# @param [Object] other the other object to be compared
def ==(other)
return true if equal?(other)
self.class == other.class &&
compartment_id == other.compartment_id
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
# @see the `==` method
# @param [Object] other the other object to be compared
def eql?(other)
self == other
end
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[compartment_id].hash
end
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)
self.class.swagger_types.each_pair do |key, type|
if type =~ /^Array<(.*)>/i
# check to ensure the input is an array given that the the attribute
# is documented as an array but the input is not
if attributes[self.class.attribute_map[key]].is_a?(Array)
public_method("#{key}=").call(
attributes[self.class.attribute_map[key]]
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
)
end
elsif !attributes[self.class.attribute_map[key]].nil?
public_method("#{key}=").call(
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
)
end
# or else data not found in attributes(hash), not an issue as the data can be optional
end
self
end
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
# Returns the string representation of the object
# @return [String] String presentation of the object
def to_s
to_hash.to_s
end
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = public_method(attr).call
next if value.nil? && !instance_variable_defined?("@#{attr}")
hash[param] = _to_hash(value)
end
hash
end
private
# Outputs non-array value in the form of hash
# For object, use to_hash. Otherwise, just return the value
# @param [Object] value Any valid value
# @return [Hash] Returns the value in the form of hash
def _to_hash(value)
if value.is_a?(Array)
value.compact.map { |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end
end
end
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
| 36.878981 | 245 | 0.683938 |
01b7bc5addd37496ac6cb496aa8da4ac25ce5d41 | 3,936 | # frozen_string_literal: true
describe ActiveRecord::Migration, "#drop_materialized_view" do
before_all do
run_migration <<~RUBY
create_table "users", force: :cascade do |t|
t.string "name"
t.boolean "admin"
end
create_table "weird"
RUBY
end
before { run_migration(snippet) }
let(:snippet) do
<<~RUBY
create_materialized_view "admin_users" do |v|
v.sql_definition <<~Q.chomp
SELECT users.id, users.name
FROM users
WHERE users.admin
Q
v.column "name", storage: :external
v.comment "Admin users only"
end
RUBY
end
let(:query) { "SELECT * FROM admin_users;" }
context "with a full definition" do
let(:migration) do
<<~RUBY
drop_materialized_view "admin_users" do |v|
v.sql_definition <<~Q.chomp
SELECT users.id, users.name
FROM users
WHERE users.admin
Q
v.column "name", storage: :external
v.comment "Admin users only"
end
RUBY
end
its(:execution) { is_expected.to disable_sql_request(query) }
its(:execution) { is_expected.to remove(snippet).from_schema }
its(:inversion) { is_expected.to enable_sql_request(query) }
its(:inversion) { is_expected.not_to change_schema }
end
context "with a version-based definition" do
let(:migration) do
<<~RUBY
drop_materialized_view "admin_users", revert_to_version: 1 do |v|
v.column "name", storage: :external
v.comment "Admin users only"
end
RUBY
end
its(:execution) { is_expected.to disable_sql_request(query) }
its(:execution) { is_expected.to remove(snippet).from_schema }
its(:inversion) { is_expected.to enable_sql_request(query) }
its(:inversion) { is_expected.not_to change_schema }
end
context "with a name only" do
let(:migration) do
<<~RUBY
drop_materialized_view "admin_users"
RUBY
end
its(:execution) { is_expected.to disable_sql_request(query) }
its(:execution) { is_expected.to remove(snippet).from_schema }
it { is_expected.to be_irreversible.because(/sql_definition can't be blank/i) }
end
context "when a view was absent" do
context "without the `if_exists` option" do
let(:migration) do
<<~RUBY
drop_materialized_view "unknown"
RUBY
end
its(:execution) { is_expected.to raise_error(StandardError) }
end
context "with the `replace_existing: true` option" do
let(:migration) do
<<~RUBY
drop_materialized_view "unknown", if_exists: true
RUBY
end
its(:execution) { is_expected.not_to change_schema }
it { is_expected.to be_irreversible.because_of(/if_exists: true/i) }
end
end
context "when a view was used" do
before do
run_migration <<~RUBY
create_function "do_nothing() admin_users",
body: "SELECT * FROM admin_users;"
RUBY
end
context "without the `:force` option" do
let(:migration) do
<<~RUBY
drop_materialized_view "admin_users"
RUBY
end
its(:execution) { is_expected.to raise_error(StandardError) }
end
context "with the `force: :cascade` option" do
let(:migration) do
<<~RUBY
drop_materialized_view "admin_users", force: :cascade
RUBY
end
its(:execution) { is_expected.to disable_sql_request(query) }
its(:execution) { is_expected.to remove(snippet).from_schema }
it { is_expected.to be_irreversible.because_of(/force: :cascade/i) }
end
end
context "without a name" do
let(:migration) do
<<~RUBY
drop_materialized_view sql_definition: "SELECT * FROM users"
RUBY
end
it { is_expected.to fail_validation.because(/name can't be blank/i) }
end
end
| 26.958904 | 83 | 0.629573 |
38b525802c64994026d806665f0dba6807ca33fe | 451 | # frozen_string_literal: true
module DbBlaster
# PORO for source-table-configuration fields
class SourceTableConfiguration
attr_reader :source_table_name, :batch_size, :ignored_column_names
def initialize(params)
params.each_key do |key|
instance_variable_set("@#{key}", params[key])
end
end
def update_params
{ batch_size: batch_size,
ignored_columns: ignored_column_names }
end
end
end
| 22.55 | 70 | 0.711752 |
115d3d00923955e3ff7692ab136a043177aa2bc5 | 1,747 | require File.join(File.dirname(__FILE__), "helpers")
require "sensu/extension"
describe "Sensu::Extension::Bridge" do
include Helpers
it "inherits Base" do
expect(Sensu::Extension::Bridge.superclass).to eq(Sensu::Extension::Base)
extension = Sensu::Extension::Bridge.new
expect(extension).to respond_to(:name, :name_alias, :description, :definition, :safe_run, :stop, :has_key?, :[])
end
end
describe "Sensu::Extension::Check" do
include Helpers
it "inherits Base" do
expect(Sensu::Extension::Check.superclass).to eq(Sensu::Extension::Base)
extension = Sensu::Extension::Check.new
expect(extension).to respond_to(:name, :name_alias, :description, :definition, :safe_run, :stop, :has_key?, :[])
end
end
describe "Sensu::Extension::Filter" do
include Helpers
it "inherits Base" do
expect(Sensu::Extension::Filter.superclass).to eq(Sensu::Extension::Base)
extension = Sensu::Extension::Filter.new
expect(extension).to respond_to(:name, :name_alias, :description, :definition, :safe_run, :stop, :has_key?, :[])
end
end
describe "Sensu::Extension::Mutator" do
include Helpers
it "inherits Base" do
expect(Sensu::Extension::Mutator.superclass).to eq(Sensu::Extension::Base)
extension = Sensu::Extension::Mutator.new
expect(extension).to respond_to(:name, :name_alias, :description, :definition, :safe_run, :stop, :has_key?, :[])
end
end
describe "Sensu::Extension::Handler" do
include Helpers
it "inherits Base" do
expect(Sensu::Extension::Handler.superclass).to eq(Sensu::Extension::Base)
extension = Sensu::Extension::Handler.new
expect(extension).to respond_to(:name, :name_alias, :description, :definition, :safe_run, :stop, :has_key?, :[])
end
end
| 32.962264 | 116 | 0.715512 |
628b026ba7d6c8b93a9ea3e617b42a4d64b9e342 | 59,958 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::VMwareCloudSimple::Mgmt::V2019_04_01
#
# Description of the new service
#
class VirtualMachines
include MsRestAzure
#
# Creates and initializes a new instance of the VirtualMachines class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [VMwareCloudSimpleClient] reference to the VMwareCloudSimpleClient
attr_reader :client
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<VirtualMachine>] operation results.
#
def list_by_subscription(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
first_page = list_by_subscription_as_lazy(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
first_page.get_all_items
end
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_subscription_with_http_info(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
list_by_subscription_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
end
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_subscription_async(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/virtualMachines'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id},
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachineListResponse.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param resource_group_name [String] The name of the resource group
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<VirtualMachine>] operation results.
#
def list_by_resource_group(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
first_page.get_all_items
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param resource_group_name [String] The name of the resource group
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param resource_group_name [String] The name of the resource group
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachineListResponse.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements virtual machine GET method
#
# Get virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachine] operation results.
#
def get(resource_group_name, virtual_machine_name, custom_headers:nil)
response = get_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Implements virtual machine GET method
#
# Get virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_with_http_info(resource_group_name, virtual_machine_name, custom_headers:nil)
get_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
end
#
# Implements virtual machine GET method
#
# Get virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_async(resource_group_name, virtual_machine_name, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualMachineName' => virtual_machine_name},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements virtual machine PUT method
#
# Create Or Update Virtual Machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [VirtualMachine] Create or Update Virtual
# Machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachine] operation results.
#
def create_or_update(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
response = create_or_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [VirtualMachine] Create or Update Virtual
# Machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Concurrent::Promise] promise which provides async access to http
# response.
#
def create_or_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end
#
# Implements virtual machine DELETE method
#
# Delete virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
def delete(resource_group_name, virtual_machine_name, custom_headers:nil)
response = delete_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
nil
end
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Concurrent::Promise] promise which provides async access to http
# response.
#
def delete_async(resource_group_name, virtual_machine_name, custom_headers:nil)
# Send request
promise = begin_delete_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end
#
# Implements virtual machine PATCH method
#
# Patch virtual machine properties
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [PatchPayload] Patch virtual machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachine] operation results.
#
def update(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
response = update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [PatchPayload] Patch virtual machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Concurrent::Promise] promise which provides async access to http
# response.
#
def update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
# Send request
promise = begin_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end
#
# Implements a start method for a virtual machine
#
# Power on virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
def start(resource_group_name, virtual_machine_name, custom_headers:nil)
response = start_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
nil
end
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Concurrent::Promise] promise which provides async access to http
# response.
#
def start_async(resource_group_name, virtual_machine_name, custom_headers:nil)
# Send request
promise = begin_start_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end
#
# Implements shutdown, poweroff, and suspend method for a virtual machine
#
# Power off virtual machine, options: shutdown, poweroff, and suspend
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param m [VirtualMachineStopMode] body stop mode parameter (reboot, shutdown,
# etc...)
# @param mode [StopMode] query stop mode parameter (reboot, shutdown, etc...).
# Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
def stop(resource_group_name, virtual_machine_name, m:nil, mode:nil, custom_headers:nil)
response = stop_async(resource_group_name, virtual_machine_name, m:m, mode:mode, custom_headers:custom_headers).value!
nil
end
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param m [VirtualMachineStopMode] body stop mode parameter (reboot, shutdown,
# etc...)
# @param mode [StopMode] query stop mode parameter (reboot, shutdown, etc...).
# Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Concurrent::Promise] promise which provides async access to http
# response.
#
def stop_async(resource_group_name, virtual_machine_name, m:nil, mode:nil, custom_headers:nil)
# Send request
promise = begin_stop_async(resource_group_name, virtual_machine_name, m:m, mode:mode, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end
#
# Implements virtual machine PUT method
#
# Create Or Update Virtual Machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [VirtualMachine] Create or Update Virtual
# Machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachine] operation results.
#
def begin_create_or_update(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Implements virtual machine PUT method
#
# Create Or Update Virtual Machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [VirtualMachine] Create or Update Virtual
# Machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def begin_create_or_update_with_http_info(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
begin_create_or_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers).value!
end
#
# Implements virtual machine PUT method
#
# Create Or Update Virtual Machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [VirtualMachine] Create or Update Virtual
# Machine request
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def begin_create_or_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, '@client.referer is nil' if @client.referer.nil?
fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil?
fail ArgumentError, "'virtual_machine_name' should satisfy the constraint - 'Pattern': '^[-a-zA-Z0-9]+$'" if !virtual_machine_name.nil? && virtual_machine_name.match(Regexp.new('^^[-a-zA-Z0-9]+$$')).nil?
fail ArgumentError, 'virtual_machine_request is nil' if virtual_machine_request.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['Referer'] = @client.referer unless @client.referer.nil?
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
request_content = @client.serialize(request_mapper, virtual_machine_request)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualMachineName' => virtual_machine_name},
query_params: {'api-version' => @client.api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:put, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 201
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
# Deserialize Response
if status_code == 201
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements virtual machine DELETE method
#
# Delete virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def begin_delete(resource_group_name, virtual_machine_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
nil
end
#
# Implements virtual machine DELETE method
#
# Delete virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def begin_delete_with_http_info(resource_group_name, virtual_machine_name, custom_headers:nil)
begin_delete_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
end
#
# Implements virtual machine DELETE method
#
# Delete virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def begin_delete_async(resource_group_name, virtual_machine_name, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, '@client.referer is nil' if @client.referer.nil?
fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['Referer'] = @client.referer unless @client.referer.nil?
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualMachineName' => virtual_machine_name},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:delete, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 202 || status_code == 204
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
result
end
promise.execute
end
#
# Implements virtual machine PATCH method
#
# Patch virtual machine properties
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [PatchPayload] Patch virtual machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachine] operation results.
#
def begin_update(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
response = begin_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Implements virtual machine PATCH method
#
# Patch virtual machine properties
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [PatchPayload] Patch virtual machine request
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def begin_update_with_http_info(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
begin_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:custom_headers).value!
end
#
# Implements virtual machine PATCH method
#
# Patch virtual machine properties
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param virtual_machine_request [PatchPayload] Patch virtual machine request
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def begin_update_async(resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil?
fail ArgumentError, 'virtual_machine_request is nil' if virtual_machine_request.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::PatchPayload.mapper()
request_content = @client.serialize(request_mapper, virtual_machine_request)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualMachineName' => virtual_machine_name},
query_params: {'api-version' => @client.api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:patch, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachine.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements a start method for a virtual machine
#
# Power on virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def begin_start(resource_group_name, virtual_machine_name, custom_headers:nil)
response = begin_start_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
nil
end
#
# Implements a start method for a virtual machine
#
# Power on virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def begin_start_with_http_info(resource_group_name, virtual_machine_name, custom_headers:nil)
begin_start_async(resource_group_name, virtual_machine_name, custom_headers:custom_headers).value!
end
#
# Implements a start method for a virtual machine
#
# Power on virtual machine
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def begin_start_async(resource_group_name, virtual_machine_name, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, '@client.referer is nil' if @client.referer.nil?
fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['Referer'] = @client.referer unless @client.referer.nil?
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/start'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualMachineName' => virtual_machine_name},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 202
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
result
end
promise.execute
end
#
# Implements shutdown, poweroff, and suspend method for a virtual machine
#
# Power off virtual machine, options: shutdown, poweroff, and suspend
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param m [VirtualMachineStopMode] body stop mode parameter (reboot, shutdown,
# etc...)
# @param mode [StopMode] query stop mode parameter (reboot, shutdown, etc...).
# Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def begin_stop(resource_group_name, virtual_machine_name, m:nil, mode:nil, custom_headers:nil)
response = begin_stop_async(resource_group_name, virtual_machine_name, m:m, mode:mode, custom_headers:custom_headers).value!
nil
end
#
# Implements shutdown, poweroff, and suspend method for a virtual machine
#
# Power off virtual machine, options: shutdown, poweroff, and suspend
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param m [VirtualMachineStopMode] body stop mode parameter (reboot, shutdown,
# etc...)
# @param mode [StopMode] query stop mode parameter (reboot, shutdown, etc...).
# Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def begin_stop_with_http_info(resource_group_name, virtual_machine_name, m:nil, mode:nil, custom_headers:nil)
begin_stop_async(resource_group_name, virtual_machine_name, m:m, mode:mode, custom_headers:custom_headers).value!
end
#
# Implements shutdown, poweroff, and suspend method for a virtual machine
#
# Power off virtual machine, options: shutdown, poweroff, and suspend
#
# @param resource_group_name [String] The name of the resource group
# @param virtual_machine_name [String] virtual machine name
# @param m [VirtualMachineStopMode] body stop mode parameter (reboot, shutdown,
# etc...)
# @param mode [StopMode] query stop mode parameter (reboot, shutdown, etc...).
# Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def begin_stop_async(resource_group_name, virtual_machine_name, m:nil, mode:nil, custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, '@client.referer is nil' if @client.referer.nil?
fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['Referer'] = @client.referer unless @client.referer.nil?
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachineStopMode.mapper()
request_content = @client.serialize(request_mapper, m)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/stop'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualMachineName' => virtual_machine_name},
query_params: {'mode' => mode,'api-version' => @client.api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 202
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
result
end
promise.execute
end
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachineListResponse] operation results.
#
def list_by_subscription_next(next_page_link, custom_headers:nil)
response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
end
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_subscription_next_async(next_page_link, custom_headers:nil)
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'nextLink' => next_page_link},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachineListResponse.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachineListResponse] operation results.
#
def list_by_resource_group_next(next_page_link, custom_headers:nil)
response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'nextLink' => next_page_link},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::VirtualMachineListResponse.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Implements list virtual machine within subscription method
#
# Returns list virtual machine within subscription
#
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachineListResponse] which provide lazy access to pages of
# the response.
#
def list_by_subscription_as_lazy(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
response = list_by_subscription_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end
#
# Implements list virtual machine within RG method
#
# Returns list of virtual machine within resource group
#
# @param resource_group_name [String] The name of the resource group
# @param filter [String] The filter to apply on the list operation
# @param top [Integer] The maximum number of record sets to return
# @param skip_token [String] to be used by nextLink implementation
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [VirtualMachineListResponse] which provide lazy access to pages of
# the response.
#
def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end
end
end
| 45.18312 | 209 | 0.710281 |
e208b6850a98fe2c8258849e4ed08bc581592605 | 1,604 | #
# Be sure to run `pod lib lint JHKPushMsgSDK.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 = 'JHKPushMsgSDK'
s.version = '0.1.4'
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
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/mzdongEddie/JHKPushMsgSDK'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'mzdongEddie' => '[email protected]' }
s.source = { :git => 'https://github.com/mzdongEddie/JHKPushMsgSDK.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '8.0'
s.source_files = 'JHKPushMsgSDK/Classes/*'
# s.resource_bundles = {
# 'JHKPushMsgSDK' => ['JHKPushMsgSDK/Assets/*.png']
# }
s.public_header_files = 'JHKPushMsgSDK/Classes/*.h'
# s.frameworks = 'UIKit', 'MapKit'
s.dependency 'AlicloudPush', '~> 1.9.8'
end
| 37.302326 | 109 | 0.648379 |
b993b420f389bd6f9206b5daeaefe2df1c39be41 | 2,955 | # frozen_string_literal: true
require "byebug/frame"
require "byebug/helpers/path"
require "byebug/helpers/file"
require "byebug/processors/command_processor"
module Byebug
#
# Mantains context information for the debugger and it's the main
# communication point between the library and the C-extension through the
# at_breakpoint, at_catchpoint, at_tracing, at_line and at_return callbacks
#
class Context
include Helpers::FileHelper
class << self
include Helpers::PathHelper
attr_writer :ignored_files
#
# List of files byebug will ignore while debugging
#
def ignored_files
@ignored_files ||=
Byebug.mode == :standalone ? lib_files + [bin_file] : lib_files
end
attr_writer :interface
def interface
@interface ||= LocalInterface.new
end
attr_writer :processor
def processor
@processor ||= CommandProcessor
end
end
#
# Reader for the current frame
#
def frame
@frame ||= Frame.new(self, 0)
end
#
# Writer for the current frame
#
def frame=(pos)
@frame = Frame.new(self, pos)
end
extend Forwardable
def_delegators :frame, :file, :line
#
# Current file & line information
#
def location
"#{normalize(file)}:#{line}"
end
#
# Current file, line and source code information
#
def full_location
return location if virtual_file?(file)
"#{location} #{get_line(file, line)}"
end
#
# Context's stack size
#
def stack_size
return 0 unless backtrace
backtrace.drop_while { |l| ignored_file?(l.first.path) }
.take_while { |l| !ignored_file?(l.first.path) }
.size
end
def interrupt
step_into 1
end
#
# Line handler
#
def at_line
self.frame = 0
return if ignored_file?(file)
processor.at_line
end
#
# Tracing handler
#
def at_tracing
return if ignored_file?(file)
processor.at_tracing
end
#
# Breakpoint handler
#
def at_breakpoint(breakpoint)
processor.at_breakpoint(breakpoint)
end
#
# Catchpoint handler
#
def at_catchpoint(exception)
processor.at_catchpoint(exception)
end
#
# Return handler
#
def at_return(return_value)
return if ignored_file?(file)
processor.at_return(return_value)
end
#
# End of class definition handler
#
def at_end
return if ignored_file?(file)
processor.at_end
end
private
def processor
@processor ||= self.class.processor.new(self, self.class.interface)
end
#
# Tells whether a file is ignored by the debugger.
#
# @param path [String] filename to be checked.
#
def ignored_file?(path)
self.class.ignored_files.include?(path)
end
end
end
| 18.702532 | 77 | 0.61692 |
6a19bdf4ad0baf8946d54be21c965f9b2d783ebd | 11,198 | require 'test_helper'
class Arvados::V1::LinksControllerTest < ActionController::TestCase
['link', 'link_json'].each do |formatted_link|
test "no symbol keys in serialized hash #{formatted_link}" do
link = {
properties: {username: 'testusername'},
link_class: 'test',
name: 'encoding',
tail_uuid: users(:admin).uuid,
head_uuid: virtual_machines(:testvm).uuid
}
authorize_with :admin
if formatted_link == 'link_json'
post :create, link: link.to_json
else
post :create, link: link
end
assert_response :success
assert_not_nil assigns(:object)
assert_equal 'testusername', assigns(:object).properties['username']
assert_equal false, assigns(:object).properties.has_key?(:username)
end
end
%w(created_at modified_at).each do |attr|
{nil: nil, bogus: 2.days.ago}.each do |bogustype, bogusvalue|
test "cannot set #{bogustype} #{attr} in create" do
authorize_with :active
post :create, {
link: {
properties: {},
link_class: 'test',
name: 'test',
}.merge(attr => bogusvalue)
}
assert_response :success
resp = JSON.parse @response.body
assert_in_delta Time.now, Time.parse(resp[attr]), 3.0
end
test "cannot set #{bogustype} #{attr} in update" do
really_created_at = links(:test_timestamps).created_at
authorize_with :active
put :update, {
id: links(:test_timestamps).uuid,
link: {
:properties => {test: 'test'},
attr => bogusvalue
}
}
assert_response :success
resp = JSON.parse @response.body
case attr
when 'created_at'
assert_in_delta really_created_at, Time.parse(resp[attr]), 0.001
else
assert_in_delta Time.now, Time.parse(resp[attr]), 3.0
end
end
end
end
test "head must exist" do
link = {
link_class: 'test',
name: 'stuff',
tail_uuid: users(:active).uuid,
head_uuid: 'zzzzz-tpzed-xyzxyzxerrrorxx'
}
authorize_with :admin
post :create, link: link
assert_response 422
end
test "tail must exist" do
link = {
link_class: 'test',
name: 'stuff',
head_uuid: users(:active).uuid,
tail_uuid: 'zzzzz-tpzed-xyzxyzxerrrorxx'
}
authorize_with :admin
post :create, link: link
assert_response 422
end
test "head and tail exist, head_kind and tail_kind are returned" do
link = {
link_class: 'test',
name: 'stuff',
head_uuid: users(:active).uuid,
tail_uuid: users(:spectator).uuid,
}
authorize_with :admin
post :create, link: link
assert_response :success
l = JSON.parse(@response.body)
assert 'arvados#user', l['head_kind']
assert 'arvados#user', l['tail_kind']
end
test "can supply head_kind and tail_kind without error" do
link = {
link_class: 'test',
name: 'stuff',
head_uuid: users(:active).uuid,
tail_uuid: users(:spectator).uuid,
head_kind: "arvados#user",
tail_kind: "arvados#user",
}
authorize_with :admin
post :create, link: link
assert_response :success
l = JSON.parse(@response.body)
assert 'arvados#user', l['head_kind']
assert 'arvados#user', l['tail_kind']
end
test "tail must be visible by user" do
link = {
link_class: 'test',
name: 'stuff',
head_uuid: users(:active).uuid,
tail_uuid: authorized_keys(:admin).uuid,
}
authorize_with :active
post :create, link: link
assert_response 422
end
test "filter links with 'is_a' operator" do
authorize_with :admin
get :index, {
filters: [ ['tail_uuid', 'is_a', 'arvados#user'] ]
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f| f.tail_uuid.match User.uuid_regex }).count
end
test "filter links with 'is_a' operator with more than one" do
authorize_with :admin
get :index, {
filters: [ ['tail_uuid', 'is_a', ['arvados#user', 'arvados#group'] ] ],
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f|
f.tail_uuid.match User.uuid_regex or
f.tail_uuid.match Group.uuid_regex
}).count
end
test "filter links with 'is_a' operator with bogus type" do
authorize_with :admin
get :index, {
filters: [ ['tail_uuid', 'is_a', ['arvados#bogus'] ] ],
}
assert_response :success
found = assigns(:objects)
assert_equal 0, found.count
end
test "filter links with 'is_a' operator with collection" do
authorize_with :admin
get :index, {
filters: [ ['head_uuid', 'is_a', ['arvados#collection'] ] ],
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f| f.head_uuid.match Collection.uuid_regex}).count
end
test "test can still use where tail_kind" do
authorize_with :admin
get :index, {
where: { tail_kind: 'arvados#user' }
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f| f.tail_uuid.match User.uuid_regex }).count
end
test "test can still use where head_kind" do
authorize_with :admin
get :index, {
where: { head_kind: 'arvados#user' }
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f| f.head_uuid.match User.uuid_regex }).count
end
test "test can still use filter tail_kind" do
authorize_with :admin
get :index, {
filters: [ ['tail_kind', '=', 'arvados#user'] ]
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f| f.tail_uuid.match User.uuid_regex }).count
end
test "test can still use filter head_kind" do
authorize_with :admin
get :index, {
filters: [ ['head_kind', '=', 'arvados#user'] ]
}
assert_response :success
found = assigns(:objects)
assert_not_equal 0, found.count
assert_equal found.count, (found.select { |f| f.head_uuid.match User.uuid_regex }).count
end
test "head_kind matches head_uuid" do
link = {
link_class: 'test',
name: 'stuff',
head_uuid: groups(:public).uuid,
head_kind: "arvados#user",
tail_uuid: users(:spectator).uuid,
tail_kind: "arvados#user",
}
authorize_with :admin
post :create, link: link
assert_response 422
end
test "tail_kind matches tail_uuid" do
link = {
link_class: 'test',
name: 'stuff',
head_uuid: users(:active).uuid,
head_kind: "arvados#user",
tail_uuid: groups(:public).uuid,
tail_kind: "arvados#user",
}
authorize_with :admin
post :create, link: link
assert_response 422
end
test "test with virtual_machine" do
link = {
tail_kind: "arvados#user",
tail_uuid: users(:active).uuid,
head_kind: "arvados#virtual_machine",
head_uuid: virtual_machines(:testvm).uuid,
link_class: "permission",
name: "can_login",
properties: {username: "repo_and_user_name"}
}
authorize_with :admin
post :create, link: link
assert_response 422
end
test "test with virtualMachine" do
link = {
tail_kind: "arvados#user",
tail_uuid: users(:active).uuid,
head_kind: "arvados#virtualMachine",
head_uuid: virtual_machines(:testvm).uuid,
link_class: "permission",
name: "can_login",
properties: {username: "repo_and_user_name"}
}
authorize_with :admin
post :create, link: link
assert_response :success
end
test "project owner can show a project permission" do
uuid = links(:project_viewer_can_read_project).uuid
authorize_with :active
get :show, id: uuid
assert_response :success
assert_equal(uuid, assigns(:object).andand.uuid)
end
test "admin can show a project permission" do
uuid = links(:project_viewer_can_read_project).uuid
authorize_with :admin
get :show, id: uuid
assert_response :success
assert_equal(uuid, assigns(:object).andand.uuid)
end
test "project viewer can't show others' project permissions" do
authorize_with :project_viewer
get :show, id: links(:admin_can_write_aproject).uuid
assert_response 404
end
test "requesting a nonexistent link returns 404" do
authorize_with :active
get :show, id: 'zzzzz-zzzzz-zzzzzzzzzzzzzzz'
assert_response 404
end
# not implemented
skip "retrieve all permissions using generic links index api" do
# Links.readable_by() does not return the full set of permission
# links that are visible to a user (i.e., all permission links
# whose head_uuid references an object for which the user has
# ownership or can_manage permission). Therefore, neither does
# /arvados/v1/links.
#
# It is possible to retrieve the full set of permissions for a
# single object via /arvados/v1/permissions.
authorize_with :active
get :index, filters: [['link_class', '=', 'permission'],
['head_uuid', '=', groups(:aproject).uuid]]
assert_response :success
assert_not_nil assigns(:objects)
assert_includes(assigns(:objects).map(&:uuid),
links(:project_viewer_can_read_project).uuid)
end
test "admin can index project permissions" do
authorize_with :admin
get :index, filters: [['link_class', '=', 'permission'],
['head_uuid', '=', groups(:aproject).uuid]]
assert_response :success
assert_not_nil assigns(:objects)
assert_includes(assigns(:objects).map(&:uuid),
links(:project_viewer_can_read_project).uuid)
end
test "project viewer can't index others' project permissions" do
authorize_with :project_viewer
get :index, filters: [['link_class', '=', 'permission'],
['head_uuid', '=', groups(:aproject).uuid],
['tail_uuid', '!=', users(:project_viewer).uuid]]
assert_response :success
assert_not_nil assigns(:objects)
assert_empty assigns(:objects)
end
# Granting permissions.
test "grant can_read on project to other users in group" do
authorize_with :user_foo_in_sharing_group
refute users(:user_bar_in_sharing_group).can?(read: collections(:collection_owned_by_foo).uuid)
post :create, {
link: {
tail_uuid: users(:user_bar_in_sharing_group).uuid,
link_class: 'permission',
name: 'can_read',
head_uuid: collections(:collection_owned_by_foo).uuid,
}
}
assert_response :success
assert users(:user_bar_in_sharing_group).can?(read: collections(:collection_owned_by_foo).uuid)
end
end
| 30.679452 | 99 | 0.641186 |
915556084a21ce0adfa4311659eaafb39d14cab7 | 461 | # frozen_string_literal: true
module StatsLite
DEFAULT_COMMANDS = {
host: {
hostname: "hostname",
ip: {
public: "curl -s ifconfig.me"
}
},
cpu: {
model: "lscpu | grep 'Model name' | cut -f 2 -d \":\" | awk '{$1=$1}1'",
cores: "nproc",
usage: <<-CMD
(grep 'cpu ' /proc/stat;sleep 0.1;grep 'cpu ' /proc/stat)|awk -v RS="" '{print ""($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)"%"}'
CMD
}
}
end
| 23.05 | 128 | 0.492408 |
d516d504eefdbabaaab0431060ba13df8ff50b13 | 3,383 | Rails.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
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = 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.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
# Generate digests for assets URLs.
config.assets.digest = true
# `config.assets.precompile` has moved to config/initializers/assets.rb
# 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
# Set to :debug to see everything in the log.
config.log_level = :info
# 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 in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# replace this with your tracker code
GA.tracker = "UA-54066809-1"
end
| 39.337209 | 104 | 0.758794 |
618854d8cdcb3db389d9f13a4424400d86912739 | 3,590 | class User < ApplicationRecord
has_many :microposts, dependent: :destroy
has_many :active_relationships, class_name: "Relationship",
foreign_key: "follower_id",
dependent: :destroy
has_many :passive_relationships, class_name: "Relationship",
foreign_key: "followed_id",
dependent: :destroy
has_many :following, through: :active_relationships, source: :followed
has_many :followers, through: :passive_relationships, source: :follower
attr_accessor :remember_token, :activation_token, :reset_token
before_save :downcase_email
before_create :create_activation_digest
before_save { self.email = email.downcase }
validates :name, presence: true, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
validates :email, presence: true, length: { maximum: 50 },
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
validates :password, presence: true, length: { minimum: 6 }, allow_nil: true
has_secure_password
# Returns the hash digest of the given string.
def User.digest(string)
cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
BCrypt::Engine.cost
BCrypt::Password.create(string, cost: cost)
end
# Returns a random token.
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?(attribute, token)
digest = send("#{attribute}_digest")
return false if digest.nil?
BCrypt::Password.new(digest).is_password?(token)
end
# Forgets a user.
def forget
update_attribute(:remember_digest, nil)
end
# Activates an account.
def activate
update_attribute(:activated, true)
update_attribute(:activated_at, Time.zone.now)
end
# Sends activation email.
def send_activation_email
UserMailer.account_activation(self).deliver_now
end
# Sets the password reset attributes.
def create_reset_digest
self.reset_token = User.new_token
update_attribute(:reset_digest, User.digest(reset_token))
update_attribute(:reset_sent_at, Time.zone.now)
end
# Sends password reset email.
def send_password_reset_email
UserMailer.password_reset(self).deliver_now
end
# Returns true if a password reset has expired.
def password_reset_expired?
reset_sent_at < 2.hours.ago
end
# Returns a user's status feed.
def feed
following_ids = "SELECT followed_id FROM relationships
WHERE follower_id = :user_id"
Micropost.where("user_id IN (#{following_ids})
OR user_id = :user_id", user_id: id)
end
# Follows a user.
def follow(other_user)
following << other_user
end
# Unfollows a user.
def unfollow(other_user)
following.delete(other_user)
end
# Returns true if the current user is following the other user.
def following?(other_user)
following.include?(other_user)
end
private
# Converts email to all lower-case.
def downcase_email
self.email = email.downcase
end
# Creates and assigns the activation token and digest.
def create_activation_digest
self.activation_token = User.new_token
self.activation_digest = User.digest(activation_token)
end
end
| 30.168067 | 78 | 0.682173 |
28312fff299d8ab37a74176e0625fa9b09ef61f8 | 6,702 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require "google/cloud/os_login/v1/os_login_service_client"
module Google
module Cloud
module OsLogin
# rubocop:disable LineLength
##
# # Ruby Client for Cloud OS Login API
#
# [Cloud OS Login API][Product Documentation]:
# You can use OS Login to manage access to your VM instances using IAM roles.
# - [Product Documentation][]
#
# ## Quick Start
# In order to use this library, you first need to go through the following
# steps:
#
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
# 3. [Enable the Cloud OS Login API.](https://console.cloud.google.com/apis/library/oslogin.googleapis.com)
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-os_login/latest/file.AUTHENTICATION.html)
#
# ### Installation
# ```
# $ gem install google-cloud-os_login
# ```
#
# ### Next Steps
# - Read the [Cloud OS Login API Product documentation][Product Documentation]
# to learn more about the product and see How-to Guides.
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
# to see the full list of Cloud APIs that we cover.
#
# [Product Documentation]: https://cloud.google.com/compute/docs/oslogin/rest/
#
# ## Enabling Logging
#
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
#
# Configuring a Ruby stdlib logger:
#
# ```ruby
# require "logger"
#
# module MyLogger
# LOGGER = Logger.new $stderr, level: Logger::WARN
# def logger
# LOGGER
# end
# end
#
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
# module GRPC
# extend MyLogger
# end
# ```
#
module V1
# rubocop:enable LineLength
##
# Cloud OS Login API
#
# The Cloud OS Login API allows you to manage users and their associated SSH
# public keys for logging into virtual machines on Google Cloud Platform.
#
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
# be many types.
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
# authenticating requests made by this client.
# A `String` will be treated as the path to the keyfile to be used for the construction of
# credentials for this client.
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
# credentials for this client.
# A `GRPC::Core::Channel` will be used to make calls through.
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
# should already be composed with a `GRPC::Core::CallCredentials` object.
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
# metadata for requests, generally, to give OAuth credentials.
# @param scopes [Array<String>]
# The OAuth scopes for this service. This parameter is ignored if
# an updater_proc is supplied.
# @param client_config [Hash]
# A Hash for call options for each method. See
# Google::Gax#construct_settings for the structure of
# this data. Falls back to the default config if not specified
# or the specified config is missing data points.
# @param timeout [Numeric]
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
def self.new \
credentials: nil,
scopes: nil,
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
kwargs = {
credentials: credentials,
scopes: scopes,
client_config: client_config,
timeout: timeout,
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::OsLogin::V1::OsLoginServiceClient.new(**kwargs)
end
end
end
end
end
| 44.979866 | 186 | 0.641152 |
bb7983c348b4263ce4959734944712735e30802b | 3,352 | # frozen_string_literal: true
class BappsController < ApplicationController
include Reports
respond_to :html
respond_to :pdf, :odf, :xml, :json, only: :index
helper_method :sort_column, :sort_direction
before_action :set_app, only: %i[show destroy update edit new]
before_action :authenticate_user!, only: %i[edit new]
autocomplete :bproce, :name, extra_data: [:id]
def index
if params[:bproce_id].present? # это приложения выбранного процесса
@bp = Bproce.find(params[:bproce_id]) # информация о процессе
@bproce_bapps = @bp.bproce_bapps.paginate(per_page: 10, page: params[:page])
elsif params[:all].present?
@bapps = Bapp.order(:name)
else
bapps = Bapp.all
bapps = bapps.searchtype(params[:apptype]) if params[:apptype].present?
bapps = bapps.tagged_with(params[:tag]) if params[:tag].present?
bapps = bapps.search(params[:search]) if params[:search].present?
@bapps = bapps.order(sort_order(sort_column, sort_direction)).paginate(per_page: 10, page: params[:page])
end
respond_to do |format|
format.html
format.odt { list }
end
end
def new
respond_with(@bapp)
end
def create
@bapp = Bapp.create(bapp_params)
flash[:notice] = 'Successfully created bapp.' if @bapp.save
respond_with(@bapp)
end
def show
respond_with(@bapp = Bapp.find(params[:id]))
end
def edit
@bproce_bapp = BproceBapp.new(bapp_id: @bapp.id)
end
def update
@bproce_bapp = BproceBapp.new(bapp_id: @bapp.id)
if @bapp.update(bapp_params)
@bapp.tag_list = params[:bapp][:tag_list]
@bapp.save
@bapp.reload
redirect_to @bapp, notice: 'Приложение сохранено.'
else
render action: 'edit'
end
end
def destroy
flash[:notice] = 'Successfully destroyed bapp.' if @bapp.destroy
respond_with(@bapp)
end
def autocomplete
@bapps = Bapp.order(:name).where('description ilike ? or name like ?', "%#{params[:term]}%", "%#{params[:term]}%")
render json: @bapps.map(&:name)
end
private
def bapp_params
params.require(:bapp).permit(:name, :description, :apptype, :purpose, :version_app,
:directory_app, :distribution_app, :executable_file,
:licence, :source_app, :note, :tag_list)
end
def set_app
if params[:search].present? # это поиск
@bapps = Bapp.search(params[:search])
.order(sort_order(sort_column, sort_direction))
.paginate(per_page: 10, page: params[:page])
render :index # покажем список найденного
else
@bapp = params[:id].present? ? Bapp.find(params[:id]) : Bapp.new
end
end
def list
report = ODFReport::Report.new('reports/bapps.odt') do |r|
nn = 0
r.add_table('TABLE_01', @bapps, header: true) do |t|
t.add_column(:nn) do |_ca|
nn += 1
"#{nn}."
end
t.add_column(:name, :name)
t.add_column(:id)
t.add_column(:description, :description)
t.add_column(:purpose, :purpose)
t.add_column(:apptype, :apptype)
end
report_footer r
end
send_data report.generate, type: 'application/msword',
filename: 'bapps.odt',
disposition: 'inline'
end
end
| 29.663717 | 118 | 0.624105 |
01beb49c5e8c7b1ddaa855e5cceb1a489c385111 | 3,018 | class Orders::ItemAdder
# timed services default to 1 minute (arbitrary)
DEFAULT_TIMED_SERVICES_DURATION = 1
def initialize(order)
@order = order
end
def add(product, quantity = 1, attributes = {})
check_for_mixed_facility! product
quantity = quantity.to_i
# Only TimedServices care about duration
duration = attributes.delete(:duration)
return [] if quantity <= 0
ods = if product.is_a? Bundle
add_bundles(product, quantity, attributes)
elsif product.is_a? Service
add_services(product, quantity, attributes)
elsif product.is_a? TimedService
add_timed_services(product, quantity, duration, attributes)
elsif product.respond_to?(:reservations) && quantity > 1
# products which have reservations (instruments) should each get their own order_detail
add_instruments(product, quantity, attributes)
else
[create_order_detail({ product_id: product.id, quantity: quantity }.merge(attributes))]
end
ods || []
end
private
def check_for_mixed_facility!(product)
if product.facility != @order.facility
if @order.order_details.length > 0
raise NUCore::MixedFacilityCart
else
@order.update_attributes(facility: product.facility)
end
end
end
def add_instruments(product, quantity, attributes)
Array.new(quantity) do
create_order_detail({ product_id: product.id, quantity: 1 }.merge(attributes))
end
end
def add_timed_services(product, quantity, duration, attributes)
Array.new(quantity) do
create_order_detail({ product_id: product.id, quantity: duration || DEFAULT_TIMED_SERVICES_DURATION }.merge(attributes))
end
end
def add_services(product, quantity, attributes)
separate = (product.active_template? || product.active_survey?)
# can't add single order_detail for service when it requires a template or a survey.
# number of order details to add
repeat = separate ? quantity : 1
# quantity to add them with
individual_quantity = separate ? 1 : quantity
Array.new(repeat) do
create_order_detail({ product_id: product.id, quantity: individual_quantity }.merge(attributes))
end
end
def add_bundles(product, quantity, attributes = {})
quantity.times.inject([]) { |ods, _i| ods.concat create_bundle_order_detail(product, attributes) }
end
def create_bundle_order_detail(product, attributes = {})
group_id = @order.max_group_id + 1
product.bundle_products.collect do |bp|
create_order_detail(
{
product_id: bp.product.id,
quantity: bp.quantity,
bundle_product_id: product.id,
group_id: group_id,
}.merge(attributes),
)
end
end
def create_order_detail(options)
options.reverse_merge!(
quantity: 1,
account: @order.account,
created_by: @order.created_by,
)
@order.order_details.create!(options)
end
end
| 30.795918 | 126 | 0.682571 |
1c96f0a776bfa0d89b0ae0c0acf5cf8a495496c7 | 685 | #
# Copyright 2019 ThoughtWorks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
com.thoughtworks.go.util.Pair.class_eval do
def to_ary
[self.first(), self.last()]
end
end | 32.619048 | 74 | 0.748905 |
183a94e7e083cd0a630390fd0e1a5bbba9080dd6 | 871 | class MicropostsController < ApplicationController
before_action :logged_in_user, only: [:create, :destroy]
before_action :correct_user, only: :destroy
def create
@micropost = current_user.microposts.build(micropost_params)
if @micropost.save
flash[:success] = "Micropost created!"
redirect_to root_url
else
@feed_items = []
render 'static_pages/home'
end
end
def destroy
@micropost.destroy
flash[:success] = "Micropost deleted"
# redirect_to request.referrer || root_url
redirect_back(fallback_location: root_url) # added in Rails 5!
end
private
def micropost_params
params.require(:micropost).permit(:content, :picture)
end
def correct_user
@micropost = current_user.microposts.find_by(id: params[:id])
redirect_to root_url if @micropost.nil?
end
end
| 26.393939 | 67 | 0.695752 |
acc368027d9ff196b62a1384b5b29da92656d9ae | 388 | require 'test_helper'
class NavigationTest < ActionDispatch::IntegrationTest
include IntegrationTestSupport
test 'can render default landing page' do
visit '/'
assert page.has_text? "Welcome to Ember on Rails!"
end
test 'can using simple "ember magic"' do
visit '/'
fill_in 'sampleInput', with: 'EMBER ROCKS!'
assert page.has_text? "EMBER ROCKS!"
end
end
| 22.823529 | 54 | 0.71134 |
f708e041b9a58466f3d0c01c36fd90975588d0ef | 41 | module Sendcloud
VERSION = "0.0.4"
end
| 10.25 | 19 | 0.682927 |
e945d6f04e14f3b15c3034212f75c27229e49dd8 | 1,137 | module TweetValidator
require "active_model"
require "uri"
class TweetLengthValidator < ActiveModel::EachValidator
TWEET_MAX_LENGTH = 140
def validate_each(record, attribute, value)
record.errors.add(attribute, :invalid_tweet) unless TweetLengthValidator.valid_tweet?(value)
end
def self.valid_tweet?(tweet)
return false unless tweet
return false if tweet.empty?
return false unless shorten_url_length(sanitize(tweet)) <= TWEET_MAX_LENGTH
true
end
def self.sanitize(tweet)
tweet.gsub(/%<.+?>/, "").gsub(/%{.+?}/, "")
end
def self.shorten_url_length(tweet)
shorten_tweet = tweet.gsub(URI.regexp("http"), dummy_http_url).gsub(URI.regexp("https"), dummy_https_url)
shorten_tweet.length
end
private_class_method
def self.dummy_http_url
dummy_url("http://", TweetValidator.config.short_url_length)
end
def self.dummy_https_url
dummy_url("https://", TweetValidator.config.short_url_length_https)
end
def self.dummy_url(prefix, max_length)
prefix + "x" * (max_length - prefix.length)
end
end
end
| 25.840909 | 111 | 0.693052 |
389b2b562bcf5c1a1ee8b870403561a12d598ecb | 1,793 | module MmsIntegration
class Medium < MediaManagementResource
self.element_name = 'media_object'
PER_PAGE = 20 # Number of elements displayed on grid
# Just expected to be called by the descendants of Medium
# Expected options: page, per_page
def self.search_by_kmapid(uid, options = {})
options.empty? ? self.search_by("kmapid:#{uid}") : self.paginate(options.merge(query: "kmapid:#{uid}"))
end
# Using nested active resource. This is problematic when caching
def category_ids
self.associated_categories.collect{ |c| c.id }
end
# Using nested active resource. This is problematic when caching
def feature_ids
self.locations
end
# Using nested active resource. This is problematic when caching
def prioritized_title
first = self.titles.first
return first.nil? ? self.id : first.title
end
def web_url
return nil if self.type != 'OnlineResource'
web_address = self.web_address
return '' if web_address.nil?
url = web_address.url
url.nil? ? '' : url
end
def bibliographic_reference
a = self.respond_to?(:photographer) ? [self.photographer.fullname] : []
a << "<i>#{self.prioritized_title}</i>"
s = a.join(', ')
if self.respond_to? :publisher
publisher = self.publisher
a = publisher.respond_to?(:country) ? [publisher.country] : []
a << publisher.title
s2 = a.join(': ')
else
s2 = nil
end
a = s2.blank? ? [] : [s2]
taken_on = self.respond_to?(:taken_on) ? self.taken_on : nil
a << taken_on if !taken_on.blank?
s2 = a.join(', ')
s << " (#{s2})" if !s2.blank?
return s.html_safe
end
alias :title :prioritized_title
end
end
| 29.883333 | 109 | 0.625209 |
e2217031f69b71eee5b8bd487a198a4330b2c3b7 | 1,734 | module Membership
module Admin
class MembershipFeesController < ::Admin::BaseController
include EitherMatcher
append_view_path 'app/components'
def unpaid
@profile_unpaid_this_year = Db::Profile.where(accepted: true)
.where.not('position @> array[?]', 'honorable_kw').where.not('position @> array[?]', 'canceled').where.not('position @> array[?]', 'senior').select do |profile|
!::Membership::Activement.new(user: profile.user).active?
end
end
def check_emails
@profile_unpaid_this_year = Db::Profile
.where(kw_id: Membership::FeesRepository.new.get_unpaid_kw_ids_this_year)
.where.not('position @> array[?]', 'honorable_kw').where.not('position @> array[?]', 'senior').where.not('position @> array[?]', 'canceled')
@emails = extract_emails_to_array(unpaid_params.fetch(:emails, ''))
@emails_without_profile = @emails.select { |e| !Db::Profile.exists?(email: e) }
@unpaid_profiles = Membership::FeesRepository.new.find_unpaid_profiles_this_year_by_emails(@emails).select do |profile|
!::Membership::Activement.new(user: profile.user).active?
end
@unpaid_emails = @unpaid_profiles.map(&:email).join(' ')
render :unpaid
end
private
def authorize_admin
redirect_to root_url, alert: 'Nie jestes administratorem!' unless user_signed_in? && (current_user.roles.include?('office') || current_user.admin?)
end
def unpaid_params
params.require(:unpaid).permit(:emails)
end
def extract_emails_to_array(txt)
reg = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i
txt.scan(reg).uniq
end
end
end
end
| 39.409091 | 170 | 0.644175 |
1d3d25a0a1eeb0c2bcce954b458cb59ca9606fd9 | 507 | describe :net_ftp_last_response_code, :shared => true do
before(:each) do
@socket = mock("Socket")
@ftp = Net::FTP.new
@ftp.instance_variable_set(:@sock, @socket)
end
it "returns the response code for the last response" do
responses = [ "200 Command okay.", "212 Directory status." ]
@socket.should_receive(:readline).and_return(*responses)
@ftp.send(:getresp)
@ftp.send(@method).should == "200"
@ftp.send(:getresp)
@ftp.send(@method).should == "212"
end
end
| 25.35 | 64 | 0.656805 |
b95a9df7512a7ad9c7cf0d83eac4d74906c3b572 | 141 | # frozen_string_literal: true
class FailingJob < BasicJob
def self.perform(*args)
super(*args)
raise "This job failed"
end
end
| 14.1 | 29 | 0.702128 |
b9556bad5fdf7f005baa8ca4c5733fcae8869c6f | 913 | Pod::Spec.new do |s|
s.name = 'SGSScanner'
s.version = '0.1.2'
s.summary = '二维码、条形码工具'
s.homepage = 'https://github.com/CharlsPrince/SGSScanner'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'CharlsPrince' => '[email protected]' }
s.source = { :git => 'https://github.com/CharlsPrince/SGSScanner.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.requires_arc = true
s.public_header_files = 'SGSScanner/**/SGSScanner*.h'
s.source_files = 'SGSScanner/**/SGSScanner*.{h,m}'
s.resource_bundles = {
'SGSScanner' => ['SGSScanner/Assets/*.png']
}
s.subspec 'Core' do |ss|
ss.source_files = 'SGSScanner/Classes/Core/*.{h,m}'
ss.public_header_files = 'SGSScanner/Classes/Core/*.h'
ss.frameworks = 'UIKit', 'AVFoundation'
end
s.frameworks = 'UIKit', 'AVFoundation'
end
| 31.482759 | 107 | 0.595838 |
6ac164d8e121e9caeb55ed54c032738c10114092 | 423 | # http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
default[:mongodb][:ulimit][:fsize] = "unlimited" #file_size
default[:mongodb][:ulimit][:cpu] = "unlimited" #cpu_time
default[:mongodb][:ulimit][:as] = "unlimited" #virtual memory
default[:mongodb][:ulimit][:nofile] = 64000 #number_files
default[:mongodb][:ulimit][:rss] = "unlimited" #memory_size
default[:mongodb][:ulimit][:nproc] = 32000 #processes
| 52.875 | 71 | 0.732861 |
878bd543176c96b59e34dc1a29cef4484896d7f6 | 483 | module ApexParser
ApexClassCreator.new do |c|
c.add_class(:Id, %i[public])
c.add_instance_method(:addError, [:public], :String, [[:String, :string_to_integer]]) do |local_scope|
end
c.add_instance_method(:getSObjectType, [:public], :String, [[:String, :string_to_integer]]) do |local_scope|
end
c.add_instance_method(:valueOf, [:public], :String, [[:String, :to_id]]) do |local_scope|
AST::Id.new(value: local_scope[:to_id].value)
end
end
end
| 32.2 | 112 | 0.677019 |
61a996ec31c6575f498dc8aaf9f33f6f5e21e8db | 477 | # frozen_string_literal: true
require 'minitest/autorun'
require_relative '../rgb'
# rgb.rbのテスト
class RgbTest < Minitest::Test
def test_to_hex
assert_equal '#000000', to_hex(0, 0, 0)
assert_equal '#ffffff', to_hex(255, 255, 255)
assert_equal '#043c78', to_hex(4, 60, 120)
end
def test_to_ints
assert_equal [0, 0, 0], to_ints('#000000')
assert_equal [255, 255, 255], to_ints('#ffffff')
assert_equal [255, 255, 255], to_ints('#FFFFFF')
end
end
| 23.85 | 52 | 0.677149 |
2125222250e318e97f5794978bb960ff65fbfd8d | 120 | class AddPostIdToPictures < ActiveRecord::Migration
def change
add_column :pictures, :post_id, :integer
end
end
| 20 | 51 | 0.766667 |
28e25beb58139d4cb94cb344d356062a89f2f551 | 1,753 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::EventGrid::Mgmt::V2020_04_01_preview
module Models
#
# NumberLessThan Advanced Filter.
#
class NumberLessThanAdvancedFilter < AdvancedFilter
include MsRestAzure
def initialize
@operatorType = "NumberLessThan"
end
attr_accessor :operatorType
# @return [Float] The filter value.
attr_accessor :value
#
# Mapper for NumberLessThanAdvancedFilter class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'NumberLessThan',
type: {
name: 'Composite',
class_name: 'NumberLessThanAdvancedFilter',
model_properties: {
key: {
client_side_validation: true,
required: false,
serialized_name: 'key',
type: {
name: 'String'
}
},
operatorType: {
client_side_validation: true,
required: true,
serialized_name: 'operatorType',
type: {
name: 'String'
}
},
value: {
client_side_validation: true,
required: false,
serialized_name: 'value',
type: {
name: 'Double'
}
}
}
}
}
end
end
end
end
| 25.042857 | 70 | 0.50599 |
622214197308e6201923085b48e97355e5185ab5 | 903 | module Tilia
module VObject
module Splitter
# VObject splitter.
#
# The splitter is responsible for reading a large vCard or iCalendar object,
# and splitting it into multiple objects.
#
# This is for example for Card and CalDAV, which require every event and vcard
# to exist in their own objects, instead of one large one.
module SplitterInterface
# Constructor.
#
# The splitter should receive an readable file stream as it's input.
#
# @param [resource] input
def initialize(_input)
end
# Every time self.next is called, a new object will be parsed, until we
# hit the end of the stream.
#
# When the end is reached, null will be returned.
#
# @return [Sabre\VObject\Component, nil]
def next
end
end
end
end
end
| 28.21875 | 84 | 0.603544 |
1a074bbdc703b476761340a3b33ba985d8b32244 | 2,606 | class CodeServer < Formula
desc "Access VS Code through the browser"
homepage "https://github.com/cdr/code-server"
url "https://registry.npmjs.org/code-server/-/code-server-3.8.1.tgz"
sha256 "0838c6a844695126a780915eab4e4b7864016bee6fc17f58ab19998573000c9b"
license "MIT"
livecheck do
url :stable
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5c7f2f97dccfea452f85bd97068e2018575afe4633173887b2c6751649ded431"
sha256 cellar: :any_skip_relocation, big_sur: "52be90308e8b09b5fd9d74d1778dc2d4cf43d35e048ad0e171bbfa0ff41f19fc"
sha256 cellar: :any_skip_relocation, catalina: "de0c1e1abca52e96877b8e62d8b52e177a67e873882f7e72bce6f2eab7736440"
sha256 cellar: :any_skip_relocation, mojave: "2d99d114e087e90336e5257caf14fce64b0d5db3caff357c7f86b2f81fb2292a"
end
depends_on "[email protected]" => :build
depends_on "yarn" => :build
depends_on "node"
on_linux do
depends_on "pkg-config" => :build
depends_on "libsecret"
depends_on "libx11"
depends_on "libxkbfile"
end
def install
system "yarn", "--production", "--frozen-lockfile"
libexec.install Dir["*"]
env = { PATH: "#{HOMEBREW_PREFIX}/opt/node/bin:$PATH" }
(bin/"code-server").write_env_script "#{libexec}/out/node/entry.js", env
end
def caveats
<<~EOS
The launchd service runs on http://127.0.0.1:8080. Logs are located at #{var}/log/code-server.log.
EOS
end
plist_options manual: "code-server"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{HOMEBREW_PREFIX}/bin/code-server</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{ENV["HOME"]}</string>
<key>StandardOutPath</key>
<string>#{var}/log/code-server.log</string>
<key>StandardErrorPath</key>
<string>#{var}/log/code-server.log</string>
</dict>
</plist>
EOS
end
test do
# See https://github.com/cdr/code-server/blob/master/ci/build/test-standalone-release.sh
system bin/"code-server", "--extensions-dir=.", "--install-extension", "ms-python.python"
assert_match "ms-python.python",
shell_output("#{bin/"code-server"} --extensions-dir=. --list-extensions")
end
end
| 32.987342 | 122 | 0.66769 |
f849315ffb8b3931638fb3077ef92289e2210a5e | 1,116 | Pod::Spec.new do |s|
s.name = 'FirebaseAnalyticsSwift'
s.version = '8.13.0-beta'
s.summary = 'Swift Extensions for Firebase Analytics'
s.description = <<-DESC
Firebase Analytics is a free, out-of-the-box analytics solution that inspires actionable insights based on app usage and user engagement.
DESC
s.homepage = 'https://firebase.google.com/features/analytics/'
s.license = { :type => 'Apache', :file => 'LICENSE' }
s.authors = 'Google, Inc.'
s.source = {
:git => 'https://github.com/Firebase/firebase-ios-sdk.git',
:tag => 'CocoaPods-' + s.version.to_s
}
s.static_framework = true
s.swift_version = '5.3'
s.ios.deployment_target = '13.0'
s.osx.deployment_target = '10.15'
s.tvos.deployment_target = '13.0'
s.cocoapods_version = '>= 1.10.0'
s.prefix_header_file = false
s.source_files = [
'FirebaseAnalyticsSwift/Sources/*.swift',
]
s.dependency 'FirebaseAnalytics', '~> 8.9'
end
| 32.823529 | 137 | 0.570789 |
212a1c756951a8faa1d3d109059020cf6807f9be | 161 |
lambda { |stdout,stderr,status|
output = stdout + stderr
return :red if /AssertionError:/.match(output)
return :green if status === 0
return :amber
}
| 20.125 | 50 | 0.677019 |
bf40b0c246a49b1df9f61579f9e15e2bf703d95e | 2,283 | # frozen_string_literal: true
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
module Google
module Ads
module GoogleAds
module V8
module Enums
# Container for enum describing reasons why a customer is not eligible to use
# PaymentMode.CONVERSIONS.
class CustomerPayPerConversionEligibilityFailureReasonEnum
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
# Enum describing possible reasons a customer is not eligible to use
# PaymentMode.CONVERSIONS.
module CustomerPayPerConversionEligibilityFailureReason
# Not specified.
UNSPECIFIED = 0
# Used for return value only. Represents value unknown in this version.
UNKNOWN = 1
# Customer does not have enough conversions.
NOT_ENOUGH_CONVERSIONS = 2
# Customer's conversion lag is too high.
CONVERSION_LAG_TOO_HIGH = 3
# Customer uses shared budgets.
HAS_CAMPAIGN_WITH_SHARED_BUDGET = 4
# Customer has conversions with ConversionActionType.UPLOAD_CLICKS.
HAS_UPLOAD_CLICKS_CONVERSION = 5
# Customer's average daily spend is too high.
AVERAGE_DAILY_SPEND_TOO_HIGH = 6
# Customer's eligibility has not yet been calculated by the Google Ads
# backend. Check back soon.
ANALYSIS_NOT_COMPLETE = 7
# Customer is not eligible due to other reasons.
OTHER = 8
end
end
end
end
end
end
end
| 33.573529 | 87 | 0.650898 |
03d2424405ae7a1595c9900f3249d1f7d044e427 | 1,490 | require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/fixtures/classes'
describe "Module#private_instance_methods" do
it "returns a list of private methods in module and its ancestors" do
methods = ModuleSpecs::CountsMixin.private_instance_methods
methods.should_include('private_3')
methods = ModuleSpecs::CountsParent.private_instance_methods
methods.should_include('private_3')
methods.should_include('private_2')
methods = ModuleSpecs::CountsChild.private_instance_methods
methods.should_include('private_3')
methods.should_include('private_2')
methods.should_include('private_1')
end
it "when passed false as a parameter, should return only methods defined in that module" do
ModuleSpecs::CountsMixin.private_instance_methods(false).should == ['private_3']
ModuleSpecs::CountsParent.private_instance_methods(false).should == ['private_2']
ModuleSpecs::CountsChild.private_instance_methods(false).should == ['private_1']
end
it "default list should be the same as passing true as an argument" do
ModuleSpecs::CountsMixin.private_instance_methods(true).should ==
ModuleSpecs::CountsMixin.private_instance_methods
ModuleSpecs::CountsParent.private_instance_methods(true).should ==
ModuleSpecs::CountsParent.private_instance_methods
ModuleSpecs::CountsChild.private_instance_methods(true).should ==
ModuleSpecs::CountsChild.private_instance_methods
end
end
| 43.823529 | 93 | 0.778523 |
f7c0ff9a1a4ae72575841b410777818d5a33c48b | 67 | # frozen_string_literal: true
module MASH
VERSION = '0.1.0'
end
| 11.166667 | 29 | 0.716418 |
87a8a60512c96e90e7ba43c5771d3bfa8f99b805 | 7,646 | =begin
#Selling Partner API for FBA Small And Light
#The Selling Partner API for FBA Small and Light lets you help sellers manage their listings in the Small and Light program. The program reduces the cost of fulfilling orders for small and lightweight FBA inventory. You can enroll or remove items from the program and check item eligibility and enrollment status. You can also preview the estimated program fees charged to a seller for items sold while enrolled in the program.
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.24
=end
require 'date'
module AmzSpApi::FbaSmallAndLightApiModel
# Error response returned when the request is unsuccessful.
class Error
# An error code that identifies the type of error that occurred.
attr_accessor :code
# A message that describes the error condition in a human-readable form.
attr_accessor :message
# Additional information that can help the caller understand or fix the issue.
attr_accessor :details
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'code' => :'code',
:'message' => :'message',
:'details' => :'details'
}
end
# Attribute type mapping.
def self.openapi_types
{
:'code' => :'Object',
:'message' => :'Object',
:'details' => :'Object'
}
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
])
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `AmzSpApi::FbaSmallAndLightApiModel::Error` initialize method"
end
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `AmzSpApi::FbaSmallAndLightApiModel::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
if attributes.key?(:'code')
self.code = attributes[:'code']
end
if attributes.key?(:'message')
self.message = attributes[:'message']
end
if attributes.key?(:'details')
self.details = attributes[:'details']
end
end
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
if @code.nil?
invalid_properties.push('invalid value for "code", code cannot be nil.')
end
if @message.nil?
invalid_properties.push('invalid value for "message", message cannot be nil.')
end
invalid_properties
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @code.nil?
return false if @message.nil?
true
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
code == o.code &&
message == o.message &&
details == o.details
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
self == o
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[code, message, details].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def self.build_from_hash(attributes)
new.build_from_hash(attributes)
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)
self.class.openapi_types.each_pair do |key, type|
if type =~ /\AArray<(.*)>/i
# check to ensure the input is an array given that the attribute
# is documented as an array but the input is not
if attributes[self.class.attribute_map[key]].is_a?(Array)
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
end
elsif !attributes[self.class.attribute_map[key]].nil?
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
self.send("#{key}=", nil)
end
end
self
end
# Deserializes the data based on type
# @param string type Data type
# @param string value Value to be deserialized
# @return [Object] Deserialized data
def _deserialize(type, value)
case type.to_sym
when :DateTime
DateTime.parse(value)
when :Date
Date.parse(value)
when :String
value.to_s
when :Integer
value.to_i
when :Float
value.to_f
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
false
end
when :Object
# generic object (usually a Hash), return directly
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
k_type = Regexp.last_match[:k_type]
v_type = Regexp.last_match[:v_type]
{}.tap do |hash|
value.each do |k, v|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
end
end
else # model
AmzSpApi::FbaSmallAndLightApiModel.const_get(type).build_from_hash(value)
end
end
# Returns the string representation of the object
# @return [String] String presentation of the object
def to_s
to_hash.to_s
end
# to_body is an alias to to_hash (backward compatibility)
# @return [Hash] Returns the object in the form of hash
def to_body
to_hash
end
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end
hash[param] = _to_hash(value)
end
hash
end
# Outputs non-array value in the form of hash
# For object, use to_hash. Otherwise, just return the value
# @param [Object] value Any valid value
# @return [Hash] Returns the value in the form of hash
def _to_hash(value)
if value.is_a?(Array)
value.compact.map { |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end end
end
| 31.991632 | 427 | 0.633011 |
ed38c91702d6be60490cb0a48f921977671d0e8a | 516 | # This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def change
create_table :active_storage_variant_records do |t|
t.belongs_to :blob, null: false, index: false
t.string :variation_digest, null: false
t.index %i[blob_id variation_digest],
name: 'index_active_storage_variant_records_uniqueness', unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end
| 36.857143 | 83 | 0.748062 |
ff7e28917aa06331baa0b9fd7adaf15d2ac49a82 | 5,744 | module Oec
class ReportDiffTask < Task
include Validator
attr_accessor :diff_report
def run_internal
@diff_report = Oec::DiffReport.new @opts
Oec::CourseCode.by_dept_code(@course_code_filter).keys.each { |dept_code| analyze dept_code }
update_remote_drive
log_validation_errors
end
private
def update_remote_drive
confirmations_folder = @remote_drive.find_nested([@term_code, Oec::Folder.confirmations])
raise UnexpectedDataError, "No department confirmations folder found for term #{@term_code}" unless confirmations_folder
title = "#{@term_code} diff report"
if (remote_file = @remote_drive.find_first_matching_item(title, confirmations_folder))
# TODO: Be transactional, implement @remote_drive.update_worksheet(). For now, the benefit is not worth the risk of refactor.
log :info, "Permanently delete the old diff report #{remote_file.id}"
@remote_drive.trash_item(remote_file, permanently_delete: true)
end
upload_worksheet(@diff_report, title, confirmations_folder)
end
def analyze(dept_code)
dept_name = Berkeley::Departments.get(dept_code, concise: true)
validate(dept_code, @term_code) do |errors|
unless (sis_data = csv_row_hash([@term_code, Oec::Folder.sis_imports, "#{datestamp} #{timestamp}", dept_name], dept_code, Oec::SisImportSheet))
log :warn, "Skipping #{dept_name} diff: no '#{Oec::Folder.sis_imports}' '#{datestamp} #{timestamp}' spreadsheet found"
return
end
unless (dept_data = csv_row_hash([@term_code, Oec::Folder.confirmations, dept_name], dept_code, Oec::CourseConfirmation))
log :warn, "Skipping #{dept_name} diff: no department confirmation spreadsheet found"
return
end
keys_of_rows_with_diff = []
intersection = (sis_keys = sis_data.keys) & (dept_keys = dept_data.keys)
(sis_keys | dept_keys).select do |key|
if intersection.include? key
column_with_diff = columns_to_compare.detect do |column|
# Anticipate nil column values
sis_value = sis_data[key][column].to_s
dept_value = dept_data[key][column].to_s
sis_value.casecmp(dept_value) != 0
end
keys_of_rows_with_diff << key if column_with_diff
else
keys_of_rows_with_diff << key
end
end
log :info, "#{keys_of_rows_with_diff.length} row(s) with diff found in #{@term_code}/departments/#{dept_name}"
report_diff(dept_code, sis_data, dept_data, keys_of_rows_with_diff)
end
end
def default_date_time
date_time_of_most_recent Oec::Folder.sis_imports
end
def report_diff(dept_code, sis_data, dept_data, keys)
keys.each do |key|
sis_row = sis_data[key]
dept_row = dept_data[key]
ldap_uid = sis_row ? sis_row['LDAP_UID'] : dept_row['LDAP_UID']
id = "#{key[:term_yr]}-#{key[:term_cd]}-#{key[:ccn]}"
id << "-#{key[:ldap_uid]}" unless key[:ldap_uid].to_s.empty?
diff_row = {
'+/-' => diff_type_symbol(sis_row, dept_row),
'DEPT_CODE' => dept_code,
'KEY' => id,
'LDAP_UID' => ldap_uid
}
columns_to_compare.each do |column|
diff_row["sis:#{column}"] = sis_row ? sis_row[column] : nil
diff_row[column] = dept_row ? dept_row[column] : nil
end
@diff_report[key] = diff_row
end
end
def diff_type_symbol(sis_row, dept_row)
return ' ' if sis_row && dept_row
dept_row ? '+' : '-'
end
def columns_to_compare
%w(COURSE_NAME FIRST_NAME LAST_NAME EMAIL_ADDRESS DEPT_FORM EVALUATION_TYPE MODULAR_COURSE START_DATE END_DATE)
end
def csv_row_hash(folder_titles, dept_code, klass)
return unless (file = @remote_drive.find_nested(folder_titles, @opts))
hash = {}
csv = @remote_drive.export_csv file
klass.from_csv(csv, dept_code: dept_code).each do |row|
begin
row = Oec::Worksheet.capitalize_keys row
id = extract_id row
validate(dept_code, id[:ccn]) do |errors|
report(errors, id, :annotation, false, %w(A B GSI CHEM MCB))
report(errors, id, :ldap_uid, false, (1..99999999))
report(errors, row, 'EVALUATION_TYPE', false, %w(F G))
report(errors, row, 'MODULAR_COURSE', false, %w(Y N y n))
report(errors, row, 'START_DATE', true)
report(errors, row, 'END_DATE', true)
end
hash[id] = row
rescue => e
log :error, "\nThis row with bad data in #{folder_titles} will be ignored: \n#{row}."
log :error, "We will NOT abort; the error is NOT fatal: #{e.message}"
end
end
hash
rescue => e
# We do not tolerate fatal errors when loading CSV file.
log :error, "\nBoom! Crash! Fatal error in csv_row_hash(#{folder_titles}, #{dept_code}, #{klass})\n"
raise e
end
def report(errors, hash, key, required, range=nil)
value = (range && range.first.is_a?(Numeric) && /\A\d+\z/.match(hash[key])) ? hash[key].to_i : hash[key]
return if value.blank? && !required
unless range.nil? || range.include?(value)
errors.add(value.nil? ? "#{key} is blank" : "Invalid #{key}: #{value}")
end
end
def extract_id(row)
id = row['COURSE_ID'].split '-'
ccn_plus_tag = id[2].split '_'
hash = { term_yr: id[0], term_cd: id[1], ccn: ccn_plus_tag[0] }
hash[:annotation] = ccn_plus_tag[1] if ccn_plus_tag.length == 2
hash[:ldap_uid] = row['LDAP_UID'] unless row['LDAP_UID'].blank?
hash
end
end
end
| 40.167832 | 151 | 0.632138 |
0369357f05fd8037155b06804cc5c725dd321a9e | 579 | module LanguageServer
module Protocol
module Interface
class UnregistrationParams
def initialize(unregisterations:)
@attributes = {}
@attributes[:unregisterations] = unregisterations
@attributes.freeze
end
# @return [Unregistration[]]
def unregisterations
attributes.fetch(:unregisterations)
end
attr_reader :attributes
def to_hash
attributes
end
def to_json(*args)
to_hash.to_json(*args)
end
end
end
end
end
| 18.677419 | 59 | 0.583765 |
036f87aee312e71f387b6b6f4b4c0c72adae892d | 6,511 | require 'spec_helper'
describe 'Pkg::Platforms' do
describe '#by_package_format' do
it 'should return an array of platforms that use a given format' do
deb_platforms = ['debian', 'ubuntu']
rpm_platforms = ['aix', 'el', 'fedora', 'redhatfips', 'sles']
expect(Pkg::Platforms.by_package_format('deb')).to match_array(deb_platforms)
expect(Pkg::Platforms.by_package_format('rpm')).to match_array(rpm_platforms)
end
end
describe '#formats' do
it 'should return all package formats' do
fmts = ['rpm', 'deb', 'dmg', 'svr4', 'ips', 'msi']
expect(Pkg::Platforms.formats).to match_array(fmts)
end
end
describe '#supported_platforms' do
it 'should return all supported platforms' do
platforms = ['aix', 'debian', 'el', 'fedora', 'osx', 'redhatfips', 'sles', 'solaris', 'ubuntu', 'windows', 'windowsfips']
expect(Pkg::Platforms.supported_platforms).to match_array(platforms)
end
end
describe '#versions_for_platform' do
it 'should return all supported versions for a given platform' do
expect(Pkg::Platforms.versions_for_platform('el')).to match_array(['5', '6', '7', '8'])
end
it 'should raise an error if given a nonexistent platform' do
expect{Pkg::Platforms.versions_for_platform('notaplatform') }.to raise_error
end
end
describe '#codenames' do
it 'should return all codenames for a given platform' do
codenames = ['focal', 'bionic', 'bullseye', 'buster', 'cosmic', 'jessie', 'stretch', 'trusty', 'xenial']
expect(Pkg::Platforms.codenames).to match_array(codenames)
end
end
describe '#codename_to_platform_version' do
it 'should return the platform and version corresponding to a given codename' do
expect(Pkg::Platforms.codename_to_platform_version('xenial')).to eq(['ubuntu', '16.04'])
end
it 'should fail if given nil as a codename' do
expect{Pkg::Platforms.codename_to_platform_version(nil)}.to raise_error
end
end
describe '#codename_for_platform_version' do
it 'should return the codename corresponding to a given platform and version' do
expect(Pkg::Platforms.codename_for_platform_version('ubuntu', '16.04')).to eq('xenial')
end
end
describe '#arches_for_codename' do
it 'should return an array of arches corresponding to a given codename' do
expect(Pkg::Platforms.arches_for_codename('xenial')).to match_array(['amd64', 'i386', 'ppc64el'])
end
it 'should be able to include source archietectures' do
expect(Pkg::Platforms.arches_for_codename('xenial', true)).to match_array(["amd64", "i386", "ppc64el", "source"])
end
end
describe '#codename_to_tags' do
it 'should return an array of platform tags corresponding to a given codename' do
expect(Pkg::Platforms.codename_to_tags('xenial')).to match_array(['ubuntu-16.04-i386', 'ubuntu-16.04-amd64', "ubuntu-16.04-ppc64el"])
end
end
describe '#arches_for_platform_version' do
it 'should return an array of arches for a given platform and version' do
expect(Pkg::Platforms.arches_for_platform_version('sles', '12')).to match_array(['x86_64', 'ppc64le'])
end
it 'should be able to include source architectures' do
expect(Pkg::Platforms.arches_for_platform_version('sles', '12', true)).to match_array(["SRPMS", "ppc64le", "x86_64"])
end
end
describe '#platform_tags' do
it 'should return an array of platform tags' do
tags = Pkg::Platforms.platform_tags
expect(tags).to be_instance_of(Array)
expect(tags.count).to be > 0
end
it 'should include a basic platform' do
tags = Pkg::Platforms.platform_tags
expect(tags).to include('el-7-x86_64')
end
end
describe '#platform_lookup' do
['osx-10.15-x86_64', 'osx-11-x86_64'].each do |platform|
it 'should return a hash of platform info' do
expect(Pkg::Platforms.platform_lookup(platform)).to be_instance_of(Hash)
end
it 'should include at least arch and package format keys' do
expect(Pkg::Platforms.platform_lookup(platform).keys).to include(:architectures)
expect(Pkg::Platforms.platform_lookup(platform).keys).to include(:package_format)
end
end
end
describe '#get_attribute' do
it 'returns info about a given platform' do
expect(Pkg::Platforms.get_attribute('el-6-x86_64', :signature_format)).to eq('v4')
end
it 'fails with a reasonable error when specified attribute is not defined' do
expect { Pkg::Platforms.get_attribute('osx-10.15-x86_64', :signature_format) }.to raise_error(/doesn't have information/)
end
end
describe '#package_format_for_tag' do
it 'should return the package format for a given platform tag' do
expect(Pkg::Platforms.package_format_for_tag('windows-2012-x86')).to eq('msi')
end
end
describe '#parse_platform_tag' do
test_cases = {
'debian-9-amd64' => ['debian', '9', 'amd64'],
'windows-2012-x86' => ['windows', '2012', 'x86'],
'windowsfips-2012-x64' => ['windowsfips', '2012', 'x64'],
'el-7-x86_64' => ['el', '7', 'x86_64'],
'el-6' => ['el', '6', ''],
'xenial-amd64' => ['ubuntu', '16.04', 'amd64'],
'xenial' => ['ubuntu', '16.04', ''],
'windows-2012' => ['windows', '2012', ''],
'redhatfips-7-x86_64' => ['redhatfips', '7', 'x86_64'],
'el-7-SRPMS' => ['el', '7', 'SRPMS'],
'ubuntu-16.04-source' => ['ubuntu', '16.04', 'source'],
}
fail_cases = [
'debian-4-amd64',
'el-x86_64',
'nothing',
'windows-x86',
'el-7-notarch',
'debian-7-x86_64',
'el-7-source',
'debian-7-SRPMS',
]
test_cases.each do |platform_tag, results|
it "returns an array for #{platform_tag}" do
expect(Pkg::Platforms.parse_platform_tag(platform_tag)).to match_array(results)
end
end
fail_cases.each do |platform_tag|
it "fails out for #{platform_tag}" do
expect { Pkg::Platforms.parse_platform_tag(platform_tag)}.to raise_error
end
end
end
describe '#generic_platform_tag' do
it 'fails for unsupported platforms' do
expect { Pkg::Platforms.generic_platform_tag('butts') }.to raise_error
end
it 'returns a supported platform tag containing the supplied platform' do
Pkg::Platforms.supported_platforms.each do |platform|
expect(Pkg::Platforms.platform_tags).to include(Pkg::Platforms.generic_platform_tag(platform))
end
end
end
end
| 36.374302 | 139 | 0.6681 |
3991321dabefece5de3e75adac5b37ffaff70a7b | 543 | module Fog
module Compute
class Google
class Mock
def delete_snapshot(snapshot_name)
Fog::Mock.not_implemented
end
end
class Real
def delete_snapshot(snapshot_name)
api_method = @compute.snapshots.delete
parameters = {
'project' => @project,
'snapshot' => snapshot_name,
}
result = self.build_result(api_method, parameters)
response = self.build_response(result)
end
end
end
end
end
| 17.516129 | 60 | 0.565378 |
bfac041de82c1c91b758490ba5d1dd063ae9b845 | 1,871 | class UsersController < ApplicationController
before_action :logged_in_user, only: [:index, :edit, :update, :destroy,
:following, :followers]
before_action :correct_user, only: [:edit, :update]
before_action :admin_user, only: :destroy
def index
@users = User.paginate(page: params[:page])
end
def show
@user = User.find(params[:id])
@microposts = @user.microposts.paginate(page: params[:page])
end
def new
@user = User.new
end
def create
@user = User.new(user_params)
if @user.save
@user.send_activation_email
flash[:info] = "Please check your email to activate your account."
redirect_to root_url
else
render 'new'
end
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update(user_params)
flash[:success] = "Profile updated"
redirect_to @user
else
render 'edit'
end
end
def destroy
User.find(params[:id]).destroy
flash[:success] = "User deleted"
redirect_to users_url
end
def following
@title = "Following"
@user = User.find(params[:id])
@users = @user.following.paginate(page: params[:page])
render 'show_follow'
end
def followers
@title = "Followers"
@user = User.find(params[:id])
@users = @user.followers.paginate(page: params[:page])
render 'show_follow'
end
private
def user_params
params.require(:user).permit(:name, :email, :password,
:password_confirmation)
end
# beforeフィルター
# 正しいユーザーかどうか確認
def correct_user
@user = User.find(params[:id])
redirect_to(root_url) unless current_user?(@user)
end
# 管理者かどうか確認
def admin_user
redirect_to(root_url) unless current_user.admin?
end
end
| 22.011765 | 73 | 0.6248 |
91de15e50036113ba1e1226c7090d38363b1f572 | 1,231 | module Net
class Response
# @!visibility private
attr_accessor :options, :mock
# @!visibility private
def initialize(options = {})
@options = options
@headers = options[:headers]
@mock = false
end
# Returns the HTTP status code of the response
# @return [Fixnum]
# @example
# response.status_code
# #=> 200
def status
options[:status_code]
end
# Returns the HTTP status message of the response according to RFC 2616
# @return [String]
# @example
# response.status_message
# #=> "OK"
def status_message
options[:status_message]
end
# Returns the mime type of the response
# @return [String]
# @example
# repsonse.status_message
# #=> "OK"
def mime_type
options[:mime_type]
end
# Returns body of the response
# @return [String]
# @example
# response.body
# #=> "Hello World"
def body
options.fetch(:body, "")
end
# Returns a hash containing key/value pairs of headers
# @return [Hash]
# @example
# response.headers
# #=> { 'Content-Type' => 'application/josn' }
def headers
@headers
end
end
end
| 20.864407 | 75 | 0.585703 |
1cbed6e2b571c79ba37fb2b6b75b3683cb8af12f | 38,578 | # Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
require 'spec_helper'
require 'tempfile'
module AWS
class S3
describe S3Object do
it_behaves_like 'an S3 model object', Bucket.new('foobucket'), 'foo'
let(:config) { stub_config }
let(:client) { config.s3_client }
let(:bucket) { Bucket.new('foobucket', :config => config, :s3_client => client) }
let(:object) { S3Object.new(bucket, 'foo') }
it_behaves_like('it has an ACL',
:set_method => :put_object_acl,
:get_method => :get_object_acl,
:options => {
:bucket_name => "foobucket",
:key => "foo"
}) do
let(:model_obj) { object }
end
it 'should have a key' do
object.key.should == "foo"
end
it 'should have a bucket' do
object.bucket.should == bucket
end
context '#inspect' do
it 'should include the object bucket and key' do
object.inspect.should ==
"<AWS::S3::S3Object:foobucket/foo>"
end
end
context '#==' do
context 'same class' do
it 'should return true if the bucket and key match' do
object.should == described_class.new(bucket, "foo")
end
it 'should return false if the bucket does not match' do
object.should_not == described_class.new(Bucket.new("barbucket"),
"foo")
end
it 'should return false if the ID does not match' do
object.should_not == described_class.new(bucket, "bar")
end
end
context 'different class' do
it 'should return false' do
imposter_class = Class.new(DelegateClass(described_class)) do
define_method(:bucket) { bucket }
define_method(:key) { "foo" }
end
object.should_not == imposter_class.new(object)
end
end
end
context '#exists?' do
it 'should call head_object' do
client.should_receive(:head_object).
with(:bucket_name => "foobucket",
:key => "foo").and_return(client.stub_for(:head_object))
object.exists?
end
it 'should return true if the request is successful' do
object.exists?.should be_true
end
it 'should return false if a NoSuchKey error is raised' do
client.stub(:head_object).
and_raise(Errors::NoSuchKey.new(double("req"),
double("resp",
:status => 404,
:body => '')))
object.exists?.should be_false
end
it 'should not intercept other kinds of errors' do
client.stub(:head_object).and_raise("FOO")
lambda { object.exists? }.should raise_error("FOO")
end
end
context '#write' do
context ':reduced_redundancy' do
it 'converts this options to :storage_class when true' do
client.should_receive(:put_object).
with(hash_including(:storage_class => 'REDUCED_REDUNDANCY')).
and_return(client.stub_for(:put_object))
object.write "data", :reduced_redundancy => true
end
it 'omits :storage_class when false' do
client.should_receive(:put_object).
with(hash_not_including(:storage_class)).
and_return(client.stub_for(:put_object))
object.write "data", :reduced_redundancy => false
end
it 'omits :storage_class not specified' do
client.should_receive(:put_object).
with(hash_not_including(:storage_class)).
and_return(client.stub_for(:put_object))
object.write "data", :reduced_redundancy => false
end
end
context 'with no arguments' do
it 'should raise an argument error' do
lambda {
object.write
}.should raise_error(ArgumentError)
end
end
context 'with a string' do
it 'should call put_object with the bucket, key and data' do
client.should_receive(:put_object).with do |options|
options[:bucket_name].should eq('foobucket')
options[:key].should eq('foo')
options[:data].should be_a(StringIO)
options[:data].read.should eq('HELLO')
options
end.and_return(client.stub_for(:put_object))
object.write("HELLO")
end
end
context 'with a file path' do
it 'should call put_object with the bucket, key and data' do
f = Tempfile.new("test")
f.write "abc"
f.rewind
# 1.9 supports encoding, 1.8 does not
if Object.const_defined?(:Encoding)
File.should_receive(:open).
with(f.path, 'rb', :encoding => "BINARY").
and_return(f)
else
File.should_receive(:open).with(f.path, 'rb').and_return(f)
end
client.should_receive(:put_object).
with(:bucket_name => "foobucket",
:key => "foo",
:content_length => 3,
:data => f).
and_return(client.stub_for(:put_object))
object.write(:file => f.path)
end
it 'should raise an error if there is a data argument' do
lambda do
object.write("HELLO", :file => "HELLO")
end.should raise_error(ArgumentError, /data passed multiple ways/)
end
end
context 'with a data option' do
it 'should call put_object with the bucket, key and data' do
io = double('io', :size => 5)
StringIO.should_receive(:new).
with('HELLO').
and_return(io)
client.should_receive(:put_object).
with(:bucket_name => "foobucket",
:key => "foo",
:data => io,
:content_length => 5).
and_return(client.stub_for(:put_object))
object.write(:data => "HELLO")
end
end
context 'low-level options' do
context 'with data' do
it 'should pass the content_md5 option' do
client.should_receive(:put_object).
with(:bucket_name => "foobucket",
:key => "foo",
:data => instance_of(StringIO),
:content_length => 5,
:content_md5 => "62HurZDjuJnGvL4nrFgWYA==").
and_return(client.stub_for(:put_object))
object.write("HELLO", :content_md5 => "62HurZDjuJnGvL4nrFgWYA==")
end
end
context 'with no data' do
it 'should pass the content_md5 option' do
client.should_receive(:put_object).
with(:bucket_name => "foobucket",
:key => "foo",
:data => instance_of(StringIO),
:content_length => 0,
:content_md5 => "62HurZDjuJnGvL4nrFgWYA==").
and_return(client.stub_for(:put_object))
object.write('', :content_md5 => "62HurZDjuJnGvL4nrFgWYA==")
end
end
context 'with acl options' do
it 'should convert symbolized canned acls to strings' do
client.should_receive(:put_object).with(hash_including({
:acl => :public_read,
})).and_return(client.stub_for(:put_object))
object.write('data', :acl => :public_read)
end
it 'passes :grant_* options along to the client' do
client.should_receive(:put_object).with(hash_including({
:grant_read => 'read',
:grant_write => 'write',
:grant_read_acp => 'read-acp',
:grant_write_acp => 'read-acp',
:grant_full_control => 'full-control',
})).and_return(client.stub_for(:put_object))
object.write('data',
:grant_read => 'read',
:grant_write => 'write',
:grant_read_acp => 'read-acp',
:grant_write_acp => 'read-acp',
:grant_full_control => 'full-control')
end
end
context ':server_side_encryption' do
it 'should not pass the option by default' do
client.should_receive(:put_object).
with(hash_not_including(:server_side_encryption)).
and_return(client.stub_for(:put_object))
object.write("HELLO")
end
it 'should pass the value from configuration if present' do
client.should_receive(:put_object).
with(hash_including(:server_side_encryption => :aes256)).
and_return(client.stub_for(:put_object))
object.config.stub(:s3_server_side_encryption => :aes256)
object.write("HELLO")
end
it 'should not pass the option if it is overridden to nil' do
client.should_receive(:put_object).
with(hash_not_including(:server_side_encryption)).
and_return(client.stub_for(:put_object))
object.config.stub(:s3_server_side_encryption => :aes256)
object.write("HELLO", :server_side_encryption => nil)
end
it 'should allow overriding the config with a different value' do
client.should_receive(:put_object).
with(hash_including(:server_side_encryption => :foobar)).
and_return(client.stub_for(:put_object))
object.config.stub(:s3_server_side_encryption => :aes256)
object.write("HELLO", :server_side_encryption => :foobar)
end
end
end
context 'large data' do
let(:upload) { double("upload",
:add_part => nil) }
before(:each) do
object.stub(:multipart_upload).and_yield(upload)
end
it 'should perform a multipart upload' do
object.should_receive(:multipart_upload).and_yield(upload)
object.write("HELLO", :multipart_threshold => 3)
end
it 'should not perform a multipart upload with :single_request' do
object.should_not_receive(:multipart_upload)
client.should_receive(:put_object).
and_return(client.stub_for(:put_object))
object.write("HELLO",
:single_request => true,
:multipart_threshold => 3)
end
it 'should pass additional options to the multipart_upload call' do
object.should_receive(:multipart_upload).
with(:metadata => { "color" => "red" },
:data => instance_of(StringIO)).
and_yield(upload)
object.write("HELLO",
:metadata => { "color" => "red" },
:multipart_threshold => 3)
end
it 'should default to the multipart threshold from the config' do
config.stub(:s3_multipart_threshold).and_return(3)
object.should_receive(:multipart_upload).and_yield(upload)
object.write("HELLO")
end
context 'string' do
it 'should split the upload into parts' do
upload.should_receive(:add_part).ordered.with("aa")
upload.should_receive(:add_part).ordered.with("bb")
object.write("aabb",
:multipart_threshold => 2,
:multipart_min_part_size => 2)
end
it 'should default to the configured multipart_min_part_size' do
config.stub(:s3_multipart_min_part_size).and_return(2)
upload.should_receive(:add_part).ordered.with("aa")
upload.should_receive(:add_part).ordered.with("bb")
object.write("aabb",
:multipart_threshold => 2)
end
end
context 'stream' do
it 'should split the upload into parts' do
upload.should_receive(:add_part).ordered.with("aa")
upload.should_receive(:add_part).ordered.with("bb")
object.write(StringIO.new("aabb"),
:multipart_threshold => 2,
:multipart_min_part_size => 2)
end
end
context 'file' do
it 'should split the upload into parts' do
upload.should_receive(:add_part).ordered.with("aa")
upload.should_receive(:add_part).ordered.with("bb")
f = Tempfile.new("foo")
f.write("aabb")
f.close
object.write(:file => f.path,
:multipart_threshold => 2,
:multipart_min_part_size => 2)
end
end
end
context 'return value' do
let(:return_value) { object.write("HELLO") }
let(:resp) { client.new_stub_for(:put_object) }
before(:each) do
resp
client.stub(:put_object).and_return(resp)
end
it 'should be the object if no version ID is returned' do
return_value.should be(object)
end
it 'should be an object version with the returned version ID' do
resp.data[:version_id] = "abc123"
return_value.should be_an(ObjectVersion)
return_value.config.should be(config)
return_value.object.should be(object)
return_value.version_id.should == "abc123"
end
end
end
context '#multipart_upload' do
before(:each) do
client.stub(:initiate_multipart_upload).
and_return(double("response",
:upload_id => "abc123"))
client.stub(:abort_multipart_upload)
end
it 'should initiate a multipart upload' do
client.should_receive(:initiate_multipart_upload).
with(:bucket_name => "foobucket",
:key => "foo").
and_return(double("response",
:upload_id => "abc123"))
object.multipart_upload { |upload| }
end
it 'should pass additional options to the initiate call' do
client.should_receive(:initiate_multipart_upload).
with(hash_including(:content_type => "application/json")).
and_return(double("response",
:upload_id => "abc123"))
object.multipart_upload(:content_type =>
"application/json") { |upload| }
end
context ':server_side_encryption' do
it 'should not pass the option by default' do
client.should_receive(:initiate_multipart_upload).
with(hash_not_including(:server_side_encryption)).
and_return(double("response",
:upload_id => "abc123"))
object.multipart_upload { |upload| }
end
it 'should pass the value from configuration if present' do
client.should_receive(:initiate_multipart_upload).
with(hash_including(:server_side_encryption => :aes256)).
and_return(double("response",
:upload_id => "abc123"))
object.config.stub(:s3_server_side_encryption => :aes256)
object.multipart_upload { |upload| }
end
it 'should not pass the option if it is overridden to nil' do
client.should_receive(:initiate_multipart_upload).
with(hash_not_including(:server_side_encryption)).
and_return(double("response",
:upload_id => "abc123"))
object.config.stub(:s3_server_side_encryption => :aes256)
object.multipart_upload(:server_side_encryption => nil) { |upload| }
end
it 'should allow overriding the config with a different value' do
client.should_receive(:initiate_multipart_upload).
with(hash_including(:server_side_encryption => :foobar)).
and_return(double("response",
:upload_id => "abc123"))
object.config.stub(:s3_server_side_encryption => :aes256)
object.multipart_upload(:server_side_encryption =>
:foobar) { |upload| }
end
end
it 'should pass the config' do
object.multipart_upload.config.should be(config)
end
it 'should abort the upload if no parts are added' do
client.should_receive(:abort_multipart_upload).
with(:bucket_name => "foobucket",
:key => "foo",
:upload_id => "abc123")
object.multipart_upload {|upload|}
end
it 'should abort the upload if an error is raised', :foo => true do
client.should_receive(:abort_multipart_upload).
with(:bucket_name => "foobucket",
:key => "foo",
:upload_id => "abc123")
e = StandardError.new('error')
# after aborting the upload, the error should be re-raised
begin
object.multipart_upload do |upload|
upload.add_part('part')
raise e
end
rescue => error
error.should eq(e)
end
end
it 'does not abort the upload if an exception is raised' do
begin
client.should_not_receive(:abort_multipart_upload)
object.multipart_upload {|upload| raise Exception.new }
rescue Exception
nil
end
end
it 'should not abort the upload if initialization failed' do
client.should_not_receive(:abort_multipart_upload)
client.stub(:initiate_multipart_upload).
and_raise("FOO")
lambda do
object.multipart_upload { |upload| }
end.should raise_error("FOO")
end
it 'should complete the upload using the completed parts' do
client.should_receive(:complete_multipart_upload).
with(:bucket_name => "foobucket",
:key => "foo",
:upload_id => "abc123",
:parts => [{ :part_number => 1,
:etag => "abc123" },
{ :part_number => 2,
:etag => "def456" }]).
and_return(client.stub_for(:complete_multipart_upload))
object.multipart_upload do |upload|
upload.stub(:completed_parts).
and_return([{ :part_number => 1,
:etag => "abc123" },
{ :part_number => 2,
:etag => "def456" }])
end
end
it 'should yield a MultipartUpload object' do
obj = double("obj")
obj.should_receive(:call).with(an_instance_of(MultipartUpload))
object.multipart_upload { |upload| obj.call(upload) }
end
it 'should pass the upload ID to the upload object' do
object.multipart_upload do |upload|
upload.upload_id.should == "abc123"
end
end
it 'should pass the S3Object to the upload object' do
object.multipart_upload do |upload|
upload.object.should == object
end
end
context 'return value with a block' do
let(:return_value) do
object.multipart_upload do |u|
u.stub(:completed_parts).and_return(completed_parts)
end
end
let(:completed_parts) { [{ :part_number => 1,
:etag => "abc123" },
{ :part_number => 2,
:etag => "def456" }] }
let(:resp) { client.new_stub_for(:complete_multipart_upload) }
before(:each) do
resp
client.stub(:complete_multipart_upload).and_return(resp)
end
it 'should be the object if no version ID is returned' do
return_value.should be(object)
end
it 'should be an object version with the returned version ID' do
resp.data[:version_id] = 'abc123'
return_value.should be_an(ObjectVersion)
return_value.config.should be(config)
return_value.object.should be(object)
return_value.version_id.should == "abc123"
end
context 'when no parts were uploaded' do
let(:completed_parts) { [] }
it 'should be nil' do
return_value.should be_nil
end
end
end
context 'without a block' do
it 'should return the upload object' do
object.multipart_upload.should be_a(MultipartUpload)
end
it 'should not complete or abort the upload' do
client.should_not_receive(:complete_multipart_upload)
client.should_not_receive(:abort_multipart_upload)
end
end
end
context '#multipart_uploads' do
it 'should return an upload collection' do
uploads = object.multipart_uploads
uploads.should be_an(ObjectUploadCollection)
uploads.object.should be(object)
uploads.config.should be(config)
end
end
context '#delete' do
it 'should call delete_object' do
client.should_receive(:delete_object).with(:bucket_name => "foobucket",
:key => "foo")
object.delete
end
it 'should pass along additional options' do
client.should_receive(:delete_object).
with(:bucket_name => "foobucket", :key => "foo", :version_id => 'vid')
object.delete(:version_id => 'vid')
end
end
context '#read' do
let(:response) { client.stub_for(:get_object) }
before(:each) do
response.data[:data] = 'HELLO'
client.stub(:get_object).and_return(response)
end
it 'should call get_object with the bucket name and key' do
client.should_receive(:get_object).with(:bucket_name => "foobucket",
:key => "foo")
object.read
end
it 'returns the object data from #get_object' do
object.read.should == "HELLO"
end
it 'returns the #get_object response data if given a block' do
resp = object.read do |chunk|
# reading the data in chunks
end
resp.should be(response.data)
end
end
context '#metadata' do
it 'should return a metadata object' do
object.metadata.should be_a(ObjectMetadata)
end
it 'should pass the object and config to the constructor' do
ObjectMetadata.should_receive(:new).
with(object, hash_including(:config => config))
object.metadata
end
end
context '#head' do
it 'returns the response from a head_object request' do
head = double('head-object-response')
client.stub(:head_object).and_return(head)
object.head.should == head
end
it 'accepts a version_id' do
response = double('versioned-head-object-response')
client.should_receive(:head_object).
with(hash_including(:version_id => '1234')).
and_return(response)
object.head(:version_id => '1234')
end
end
context '#etag' do
it 'returns #etag from the head response' do
head = { :etag => 'myetag' }
client.stub(:head_object).and_return(head)
object.etag.should eq('myetag')
end
end
context '#last_modified' do
it 'returns #last_modified from the head response' do
now = Time.now
head = { :last_modified => now }
client.stub(:head_object).and_return(head)
object.last_modified.should eq(now)
end
end
context '#content_length' do
it 'returns #content_length from the head response' do
head = { :content_length => 123 }
client.stub(:head_object).and_return(head)
object.content_length.should eq(123)
end
end
context '#content_type' do
it 'returns #content_type from the head response' do
head = { :content_type => 'text/plain' }
client.stub(:head_object).and_return(head)
object.content_type.should eq('text/plain')
end
end
context '#server_side_encryption' do
it 'returns #server_side_encryption from the head response' do
head = { :server_side_encryption => :aes256 }
client.stub(:head_object).and_return(head)
object.server_side_encryption.should eq(:aes256)
end
end
context '#server_side_encryption?' do
it 'should return true if server_side_encryption is not nil' do
object.stub(:server_side_encryption => 'foo')
object.server_side_encryption?.should be_true
end
it 'should return false if server_side_encryption is nil' do
object.stub(:server_side_encryption => nil)
object.server_side_encryption?.should be_false
end
end
context '#restore_in_progress?' do
it 'returns true if the object is being restored' do
head = { :restore_in_progress => true }
client.stub(:head_object).and_return(head)
object.restore_in_progress?.should be(true)
end
it 'returns false if the object is not an archive copy' do
head = { :restore_in_progress => false }
client.stub(:head_object).and_return(head)
object.restore_in_progress?.should be(false)
end
end
context '#restore_expiration_date' do
it 'returns the expiration date if it is an archive copy' do
time = Time.now
head = { :restore_expiration_date => time }
client.stub(:head_object).and_return(head)
object.restore_expiration_date.should eq(time)
end
end
context '#restored_object?' do
it 'returns false if the object is not an archive copy' do
head = { :restore_expiration_date => nil }
client.stub(:head_object).and_return(head)
object.restored_object?.should be(false)
end
end
context '#versions' do
it 'returns a versioned object collection' do
object.versions.should be_an(ObjectVersionCollection)
end
end
context '#url_for' do
let(:http_request) { Request.new }
let(:credential_provider) {
Core::CredentialProviders::StaticProvider.new({
:access_key_id => "ACCESS_KEY",
:secret_access_key => "SECRET",
})
}
before(:each) do
http_request.stub(:canonicalized_resource).and_return("/foo/bar")
config.stub(:credential_provider).and_return(credential_provider)
Request.stub(:new).and_return(http_request)
end
it 'should return an HTTPS URI object' do
object.url_for(:get).should be_a(URI::HTTPS)
end
it 'should return an HTTP URI object if :secure is false' do
object.url_for(:get, :secure => false).should be_a(URI::HTTP)
end
it 'should construct an S3 http request object' do
Request.should_receive(:new).and_return(http_request)
object.url_for(:get)
end
it 'should set the bucket' do
http_request.should_receive(:bucket=).with("foobucket")
object.url_for(:get)
end
it 'should set the key' do
http_request.should_receive(:key=).with("foo")
object.url_for(:get)
end
it 'should set the endpoint according to the configuration' do
object.config.stub(:s3_endpoint).and_return("foo.com")
http_request.should_receive(:host=).with("foo.com")
object.url_for(:get)
end
it 'should include the version id when provided' do
http_request.stub(:add_param)
http_request.should_receive(:add_param).
with('versionId', 'version-id-string')
object.url_for(:read, :version_id => 'version-id-string')
end
context 'federated sessions' do
let(:credential_provider) {
Core::CredentialProviders::StaticProvider.new({
:access_key_id => "ACCESS_KEY",
:secret_access_key => "SECRET",
:session_token => "SESSION_TOKEN",
})
}
it 'adds the security token to the request' do
http_request.stub(:add_param)
http_request.should_receive(:add_param).
with('x-amz-security-token', 'SESSION_TOKEN')
object.url_for(:get)
end
end
shared_examples_for "presigned url request parameter" do |name, param|
it "should add #{name.inspect} as #{param}" do
http_request.stub(:add_param)
http_request.should_receive(:add_param).with(param, "value")
object.url_for(:get, Hash[[[name, "value"]]])
end
it "should make #{param} part of the string to sign" do
http_request.should_receive(:canonicalized_resource) do
http_request.params.map { |p| p.to_s }.
should include("#{param}=value")
end
object.url_for(:get, Hash[[[name, "value"]]])
end
end
it_should_behave_like("presigned url request parameter",
:response_content_type, "response-content-type")
it_should_behave_like("presigned url request parameter",
:response_content_language, "response-content-language")
it_should_behave_like("presigned url request parameter",
:response_expires, "response-expires")
it_should_behave_like("presigned url request parameter",
:response_cache_control, "response-cache-control")
it_should_behave_like("presigned url request parameter",
:response_content_disposition, "response-content-disposition")
it_should_behave_like("presigned url request parameter",
:response_content_encoding, "response-content-encoding")
it 'should add a parameter for the access key' do
object.url_for(:get).query.split("&").
should include("AWSAccessKeyId=ACCESS_KEY")
end
it 'should add a parameter for the expiration timestamp' do
Time.stub(:now).and_return(Time.parse("2011-05-23 17:39:04 -0700"))
object.url_for(:get).query.split("&").
should include("Expires=1306201144")
end
it 'should accept an object that responds to #to_int' do
Time.stub(:now).and_return(10)
seconds = double('seconds', :to_int => 10)
object.url_for(:get, :expires => seconds).
query.split("&").should include("Expires=20")
end
it 'should accept a Time object for :expires' do
object.url_for(:get, :expires =>
Time.parse("2011-05-23 18:39:04 -0700")).
query.split("&").should include("Expires=1306201144")
end
it 'should accept a DateTime object for :expires' do
object.url_for(:get, :expires =>
DateTime.parse("2011-05-23 18:39:04 -0700")).
query.split("&").should include("Expires=1306201144")
end
it 'should accept an integer offset for :expires' do
Time.stub(:now).and_return(Time.parse("2011-05-23 18:39:00 -0700"))
object.url_for(:get, :expires => 4).
query.split("&").should include("Expires=1306201144")
end
it 'should accept a string date/time for :expires' do
object.url_for(:get, :expires => "2011-05-23 18:39:04 -0700").
query.split("&").should include("Expires=1306201144")
end
it 'should use the request host in the URL' do
http_request.stub(:host).and_return("foo.com")
object.url_for(:get).host.should == "foo.com"
end
it 'should use the request path in the URL' do
http_request.stub(:path).and_return("/foobar")
object.url_for(:get).path.should == "/foobar"
end
it 'should use the request querystring in the URL' do
http_request.stub(:querystring).and_return("something=itsvalue")
object.url_for(:get).query.should == "something=itsvalue"
end
it 'should default to the general use_ssl parameter for urls' do
config.stub(:use_ssl?).and_return true
object.url_for(:get).scheme.should == "https"
config.stub(:use_ssl?).and_return false
object.url_for(:get).scheme.should == "http"
end
it 'should prefer :secure over the general use_ssl parameter for urls' do
config.stub(:use_ssl?).and_return true
object.url_for(:get, :secure => false).scheme.should == "http"
config.stub(:use_ssl?).and_return false
object.url_for(:get, :secure => true).scheme.should == "https"
end
it 'should default to the :s3_port value for urls' do
config.stub(:s3_port).and_return nil
object.url_for(:get).port.should == 443
config.stub(:s3_port).and_return 8080
object.url_for(:get).port.should == 8080
end
it 'should prefer :port over the general :s3_port parameter for urls' do
config.stub(:s3_port).and_return 8080
object.url_for(:get, :port => 80).port.should == 80
end
it 'should default to the general :s3_force_path_style value for urls' do
config.stub(:s3_force_path_style).and_return false
url = object.url_for(:get)
url.host.should == "foobucket.s3.amazonaws.com"
url.path.should_not =~ /^\/foobucket\//
config.stub(:s3_force_path_style).and_return true
url = object.url_for(:get)
url.host.should == "s3.amazonaws.com"
url.path.should =~ /^\/foobucket\//
end
it 'should prefer :force_path_style over the general :s3_force_path_style parameter for urls' do
config.stub(:s3_force_path_style).and_return true
url = object.url_for(:get, :force_path_style => false)
url.host.should == "foobucket.s3.amazonaws.com"
url.path.should_not =~ /^\/foobucket\//
end
end
context '#public_url' do
let(:url) { object.public_url }
it 'should be an HTTPS URI' do
url.should be_a(URI::HTTPS)
end
it 'should be an HTTP URI if secure is false' do
object.public_url(:secure => false).should be_a(URI::HTTP)
end
context 'dns compatible bucket' do
it 'should use the subdomain-style host' do
url.to_s.
should == "https://foobucket.s3.amazonaws.com/foo"
end
end
context 'dns incompatible bucket' do
let(:bucket) { Bucket.new("foo..bar", :config => config) }
it 'should use the path-style url' do
url.to_s.
should == "https://s3.amazonaws.com/foo..bar/foo"
end
end
end
context '#presigned_post' do
it 'should return a PresignedPost for the object' do
post = object.presigned_post
post.should be_a(PresignedPost)
post.bucket.should be(object.bucket)
post.key.should == object.key
post.config.should be(config)
end
it 'should pass additional options' do
PresignedPost.should_receive(:new).
with(object.bucket,
:key => object.key,
:foo => "bar")
object.presigned_post(:foo => "bar")
end
end
context '#reduced_redundancy=' do
def expect_copy_with_storage_class(sc)
client.should_receive(:copy_object).
with(:bucket_name => "foobucket",
:key => "foo",
:copy_source => "foobucket/foo",
:metadata_directive => "COPY",
:storage_class => sc)
end
context 'set to true' do
it 'should set :storage_class to "REDUCED_REDUNDANCY"' do
expect_copy_with_storage_class("REDUCED_REDUNDANCY")
object.reduced_redundancy = true
end
end
context 'set to false' do
it 'should set :storage_class to "STANDARD"' do
expect_copy_with_storage_class("STANDARD")
object.reduced_redundancy = false
end
end
it 'should return the assigned value' do
object.send(:reduced_redundancy=, "foo").should == "foo"
end
end
end
end
end
| 33.870061 | 104 | 0.558168 |
212f909b4a46858ae03e43234621a870a8676f77 | 175 | class User < ActiveRecord::Base
has_secure_password
has_many :bookmarks
has_many :categories, through: :bookmarks
validates_presence_of :email, :password_digest
end
| 19.444444 | 48 | 0.794286 |
e88aa1da35d83f360c3826d96df8e44b84be27c5 | 1,673 | #
# Be sure to run `pod lib lint ZZVCAnimateTransition.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 = 'ZZVCAnimateTransition'
s.version = '0.1.0'
s.summary = 'A short description of ZZVCAnimateTransition.'
# 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
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/ZeusZZ/ZZVCAnimateTransition'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'ZeusZZ' => '[email protected]' }
s.source = { :git => 'https://github.com/ZeusZZ/ZZVCAnimateTransition.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '8.0'
s.source_files = 'ZZVCAnimateTransition/Classes/**/*'
# s.resource_bundles = {
# 'ZZVCAnimateTransition' => ['ZZVCAnimateTransition/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
| 38.906977 | 112 | 0.654513 |
ac82f45589b3daec0ea92f76900d4079aa5aa44e | 2,377 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 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.
#++
require_relative '../legacy_spec_helper'
describe 'Application' do
include Redmine::I18n
def document_root_element
html_document.root
end
fixtures :all
around do |example|
with_settings login_required: '0' do
example.run
end
end
it 'set localization' do
allow(Setting).to receive(:available_languages).and_return [:de, :en]
allow(Setting).to receive(:default_language).and_return 'en'
# a french user
get '/projects', {}, 'HTTP_ACCEPT_LANGUAGE' => 'de,de-de;q=0.8,en-us;q=0.5,en;q=0.3'
assert_response :success
assert_select 'h2', content: 'Projekte'
assert_equal :de, current_language
# not a supported language: default language should be used
get '/projects', {}, 'HTTP_ACCEPT_LANGUAGE' => 'zz'
assert_response :success
assert_select 'h2', content: 'Projects'
end
it 'token based access should not start session' do
# work_packages of a private project
get '/work_packages/4.atom'
assert_response 302
rss_key = User.find(2).rss_key
get "/work_packages/4.atom?key=#{rss_key}"
assert_response 200
assert_nil session[:user_id]
end
end
| 32.561644 | 91 | 0.72907 |
4a6f37597ab680921d2afdc272eee8a4c5673567 | 1,662 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'cucumber-messages'
s.version = '10.0.3'
s.authors = ["Aslak Hellesøy"]
s.description = "Protocol Buffer messages for Cucumber's inter-process communication"
s.summary = "cucumber-messages-#{s.version}"
s.email = '[email protected]'
s.homepage = "https://github.com/cucumber/messages-ruby#readme"
s.platform = Gem::Platform::RUBY
s.license = "MIT"
s.required_ruby_version = ">= 2.3"
s.metadata = {
'bug_tracker_uri' => 'https://github.com/cucumber/cucumber/issues',
'changelog_uri' => 'https://github.com/cucumber/cucumber/blob/master/messages/CHANGELOG.md',
'documentation_uri' => 'https://www.rubydoc.info/github/cucumber/messages-ruby',
'mailing_list_uri' => 'https://groups.google.com/forum/#!forum/cukes',
'source_code_uri' => 'https://github.com/cucumber/cucumber/blob/master/messages/ruby',
}
# TODO: Switch back to 'protobuf' when these PRs are merged and released:
# https://github.com/ruby-protobuf/protobuf/pull/411
# https://github.com/ruby-protobuf/protobuf/pull/415
s.add_dependency 'protobuf-cucumber', '~> 3.10', '>= 3.10.8'
s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
s.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
s.rubygems_version = ">= 1.6.1"
s.files = Dir[
'README.md',
'LICENSE',
'lib/**/*'
]
s.test_files = Dir['spec/**/*']
s.rdoc_options = ["--charset=UTF-8"]
s.require_path = "lib"
end
| 41.55 | 116 | 0.599278 |
b9f38d59a187035ed03579516fcc25826a58cb33 | 599 | require 'erb'
require 'yaml'
class DatabaseConfig
class NoConfigFound < StandardError ; end
def self.for(environment)
config = YAML.load(database_config)[environment.to_s]
if config.nil?
raise NoConfigFound, "No config found for environment '#{environment}'"
end
{ host: config["host"],
database: config["database"],
username: config["username"],
password: config["password"],
reconnect: true
}
end
def self.database_config
erb_content = File.read(ROOT_PATH.join("database.yml"))
ERB.new(erb_content).result(binding)
end
end
| 21.392857 | 77 | 0.677796 |
9160d049653720588d54529e6e984445a2015133 | 1,076 | # -*- encoding: utf-8 -*-
# stub: netrc 0.11.0 ruby lib
Gem::Specification.new do |s|
s.name = "netrc".freeze
s.version = "0.11.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Keith Rarick".freeze, "geemus (Wesley Beary)".freeze]
s.date = "2015-10-29"
s.description = "This library can read and update netrc files, preserving formatting including comments and whitespace.".freeze
s.email = "[email protected]".freeze
s.homepage = "https://github.com/geemus/netrc".freeze
s.licenses = ["MIT".freeze]
s.rubygems_version = "3.1.4".freeze
s.summary = "Library to read and write netrc files.".freeze
s.installed_by_version = "3.1.4" if s.respond_to? :installed_by_version
if s.respond_to? :specification_version then
s.specification_version = 4
end
if s.respond_to? :add_runtime_dependency then
s.add_development_dependency(%q<minitest>.freeze, [">= 0"])
else
s.add_dependency(%q<minitest>.freeze, [">= 0"])
end
end
| 34.709677 | 129 | 0.704461 |
3910ada1c7049af0cc904f2b0ed1c864e0d0dbfd | 11,115 | # -*- coding: utf-8 -*-
require 'shellwords'
require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist'
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
require ENV['TM_SUPPORT_PATH'] + '/lib/ui'
require ENV["TM_BUNDLE_SUPPORT"] + "/lib/defaults.rb"
require ENV["TM_BUNDLE_SUPPORT"] + "/lib/ledger/html5.rb"
module Ledger
class Report
attr :ledger
attr :warnings
attr_accessor :type
attr_accessor :accounts
attr_accessor :ignored_accounts
attr_accessor :payee
attr_accessor :since
attr_accessor :until
attr_accessor :display_since
attr_accessor :display_until
attr_accessor :effective_dates
attr_accessor :currency
attr_accessor :collapse
attr_accessor :virtual
attr_accessor :pivot
attr_accessor :format
attr_accessor :status # Any, Cleared, Uncleared, Pending
attr_accessor :other
attr_accessor :chart
attr_accessor :strict_check
# type = balance, cleared, register, equity, …
def initialize type, options = {}
opts = { :accounts => [], :ignored_accounts => [], :other => [] }.merge!(options)
@type = type
@ledger = 'ledger' # Path to the ledger's executable
@accounts = Array.new(opts[:accounts]) || []
@ignored_accounts = Array.new(opts[:ignored_accounts]) || []
@payee = opts[:payee] || ''
@since = opts[:since] || ''
@until = opts[:until] || ''
@display_since = opts[:display_since] || ''
@display_until = opts[:display_until] || ''
@effective_dates = opts.has_key?(:effective_dates) ? opts[:effective_dates] : false
@currency = opts[:currency]
@collapse = opts.has_key?(:collapse) ? opts[:collapse] : false
@virtual = opts.has_key?(:virtual) ? opts[:virtual] : false
@pivot = opts[:pivot] || ''
@format = opts[:format] || ''
@status = opts[:status] || 'Any'
@other = Array.new(opts[:other]) || []
@strict_check = opts.has_key?(:strict_check) ? opts[:strict_check] : false
@warnings = []
@chart = opts.has_key?(:chart) ? opts[:chart] : false
end
def add_option opt
@other << opt.strip
end
# Returns the list of the commodities used in this report.
def commodities
%x|#{self.ledger} commodities #{['--file', ENV['TM_FILEPATH']].shelljoin}|.split(/\n/).map { |c| c.sub(/ \{.*$/,'')} # Remove price, if any
end
# Returns the list of the accounts used in this report.
#
# Note: '--monthly <non-existent account>' and similar (--daily, --weekly, etc…)
# may cause ledger to segfault.
def all_accounts
a = self.arguments
a.delete_if { |e| e =~ /--(daily|weekly|biweekly|monthly|quarterly|yearly)/ }
%x|#{self.ledger} accounts #{a.shelljoin}|.split(/\n/)
end
# Returns the list of payees used in this report.
#
# See the note in #accounts.
def all_payees
a = self.arguments
a.delete_if { |e| e =~ /--(daily|weekly|biweekly|monthly|quarterly|yearly)/ }
%x|#{self.ledger} payees #{a.shelljoin}|.split(/\n/)
end
# Returns true if the user presses the OK button,
# returns false if the user cancels or closes the window.
def dialog nib_name = 'ReportDialog'
if self.currency =~ /none/i
comm = ['(Disabled)']
self.currency = '(Disabled)'
else
comm = self.commodities
comm << 'All' if 'All' == self.currency
end
self.currency = comm.first if self.currency.nil? or self.currency.empty?
statuses = ['Any','Cleared','Uncleared','Pending']
params = {
'account' => self.accounts.join(','),
'ignored' => self.ignored_accounts.join(','),
'payee' => self.payee,
'since' => self.since,
'until' => self.until,
'displaySince' => self.display_since,
'displayUntil' => self.display_until,
'effective' => self.effective_dates,
'currencyList' => comm,
'currency' => self.currency,
'collapse' => self.collapse,
'virtual' => self.virtual,
'pivot' => self.pivot,
'chart' => self.chart,
'statuses' => statuses,
'status' => self.status,
'strictCheck' => self.strict_check,
'other' => ''
}
nib = ENV['TM_BUNDLE_SUPPORT']+"/nib/#{nib_name}"
return_value = %x{#{TM_DIALOG} -cmp #{e_sh params.to_plist} '#{nib}'}
return_hash = OSX::PropertyList::load(return_value)
result = return_hash['result']
return false if result.nil?
self.accounts = result['returnArgument'] ? result['returnArgument'].split(',') : []
self.accounts.each { |a| a.strip! }
self.ignored_accounts = return_hash['ignored'] ? return_hash['ignored'].split(',') : []
self.payee = return_hash['payee'] || ''
self.since = return_hash['since'] || ''
self.until = return_hash['until'] || ''
self.display_since = return_hash['displaySince'] || ''
self.display_until = return_hash['displayUntil'] || ''
self.effective_dates = return_hash['effective']
self.currency = return_hash['currency'] || ''
self.currency = '' if self.currency =~ /all|none|no value|disabled/i
self.collapse = return_hash['collapse']
self.virtual = return_hash['virtual']
self.pivot = return_hash['pivot'] || ''
self.chart = return_hash['chart']
self.status = return_hash['status']
self.strict_check = return_hash['strictCheck']
self.other += return_hash['other'].shellsplit if return_hash['other']
return true
end
# Returns the command for this report.
def command options = {}
opts = { :escape => true }.merge!(options)
if opts[:escape]
return "#{self.ledger} #{self.type} #{self.arguments.shelljoin}"
else
return "#{self.ledger} #{self.type} #{self.arguments.map { |a| "'" + a + "'" }.join(' ')}"
end
end
# Runs the report and returns the result as a string.
# If :html is set to true, returns the result as an html snippet.
def run options = {}
opts = { :wrapper => 'pre' }.merge!(options)
@warnings = []
output = %x|#{self.ledger} #{self.type} #{self.arguments.shelljoin}|
# Clean up
output.gsub!(/<(Total|Unspecified payee|Revalued|Adjustment|None)>/) { |m| '<' + $1 + '>' }
output = output.gsub(/class="[^"]*?amount.*?".*?<\//m) do |match|
match.gsub(/(-\d+([,\.]\d+)*)/) do |amount|
'<span class="neg">' + $1 + '</span>'
end
end
if opts[:html]
attrs = {}
attrs[:id] = opts[:id] if opts[:id]
attrs[:class] = opts[:class] if opts[:class]
container = Ledger::Html5::Snippet.new('div', nil, attrs)
section = Ledger::Html5::Snippet.new('section', nil)
section << '<h2>' + opts[:title] + '</h2>' if opts[:title]
content = Ledger::Html5::Snippet.new(opts[:wrapper], nil)
if opts[:header] and 'table' == opts[:wrapper]
header = "<thead>\n<tr>\n"
opts[:header].each do |h|
header << "<th scope=\"col\" class=\"header-#{h.downcase.gsub(/\s/,'-')}\">#{h}</th>\n"
end
header << "</tr>\n</thead>\n"
content << header
end
content << output
section << content
container << section
footer = Ledger::Html5::Snippet.new('footer', nil)
unless @warnings.empty?
warnings = Ledger::Html5::Snippet.new('ul', nil, :class => 'warnings')
@warnings.each { |w| warnings << Ledger::Html5::Snippet.new('li', w) }
footer << warnings
end
cmd = self.command(:escape => true)
cmd.gsub!(/</, '<')
cmd.gsub!(/>/, '>')
footer << Ledger::Html5::Snippet.new('pre', cmd, :class => 'ledger-command')
container << footer
return container
else
return output
end
end
# Prints the report.
def pretty_print title = '', options = {}
opts = { :html => true, :css => THEME }.merge!(options)
output = self.run(opts)
if opts[:html]
html = Ledger::Html5::Page.new(title, :css => opts[:css])
html << output
print html.to_s
else
print output
end
end
# Returns the arguments for the ledger executable as an array.
def arguments
args = ["--file=#{ENV['TM_FILEPATH']}"]
if self.strict_check
args << '--strict' << '--explicit' << '--check-payees' # Check accounts, payees, commodities and tags
end
unless self.accounts.empty?
args << '('
args += self.accounts
args << ')'
end
unless self.ignored_accounts.empty?
args << 'and' unless self.accounts.empty?
args << 'not' << '('
args += self.ignored_accounts
args << ')'
end
args << 'payee' << '/'+self.payee.gsub(/,/,'|')+'/' unless self.payee.empty?
pe = period_expr(self.since, self.until)
args << '--limit' << pe unless pe.empty?
if self.type =~ /bal/ or self.type =~ /cleared/ or self.type =~ /budget/
# See http://article.gmane.org/gmane.comp.finance.ledger.general/3864/match=bug+value+expressions
unless self.display_since.empty? and self.display_until.empty?
@warnings << 'Display period is ignored for this report.'
end
else
pe = period_expr(self.display_since, self.display_until)
args << '--display' << pe unless pe.empty?
end
args << '-X' << currency unless self.currency.nil? or self.currency.empty?
args << '--collapse' if self.collapse
args << '--real' unless self.virtual
args << '--effective' if self.effective_dates
args << '--pivot' << self.pivot unless self.pivot.empty?
args << '-F' << self.format unless self.format.empty?
args += self.other unless self.other.empty?
case self.status
when 'Cleared'
args << '--cleared'
when 'Uncleared'
args << '--uncleared'
when 'Pending'
args << '--pending'
end
return args
end
def args_hash
{
:accounts => self.accounts,
:ignored_accounts => self.ignored_accounts,
:payee => self.payee,
:since => self.since,
:until => self.until,
:display_since => self.display_since,
:display_until => self.display_until,
:effective_dates => self.effective_dates,
:currency => self.currency,
:collapse => self.collapse,
:virtual => self.virtual,
:pivot => self.pivot,
:format => self.format,
:other => self.other,
:chart => self.chart,
:status => self.status,
:strict_check => self.strict_check
}
end
# Returns a string representing a period expression in Ledger's syntax.
def period_expr from, to
return '' if from.empty? and to.empty?
expr = ''
expr << "d>=[#{from}]" unless from.empty?
unless to.empty?
expr << ' and ' unless from.empty?
expr << "d<=[#{to}]"
end
return expr
end
end # class Report
end # module Ledger
| 37.298658 | 145 | 0.581017 |
1acbd8e76e03d13818618e752156485be3a8a443 | 135,139 | # 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 DocumentaiV1beta2
class GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DeleteLabelerPoolOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DeleteProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DeleteProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DisableProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3DisableProcessorResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3EnableProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3EnableProcessorResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3ExportProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3ExportProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3ImportDocumentsMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3ImportDocumentsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3SetDefaultProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3SetDefaultProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3UpdateDatasetOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3UpdateHumanReviewConfigMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1BatchProcessMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1BatchProcessResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1CommonOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1DeleteProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1DeleteProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1DeployProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1DeployProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1DisableProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1DisableProcessorResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1EnableProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1EnableProcessorResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1HumanReviewStatus
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1ReviewDocumentResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1SetDefaultProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1UndeployProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1BoundingPoly
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1Document
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentEntity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentEntityRelation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageAnchor
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageBlock
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageDimension
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageFormField
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageImage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageLayout
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageLine
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageMatrix
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageParagraph
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageTable
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageToken
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentPageVisualElement
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentProvenance
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentProvenanceParent
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentRevision
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentShardInfo
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentStyle
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentStyleFontSize
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentTextAnchor
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1DocumentTextChange
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1GcsDestination
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1GcsSource
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1InputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1NormalizedVertex
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1OperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1OutputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1ProcessDocumentResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta1Vertex
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2AutoMlParams
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2BoundingPoly
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2Document
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentEntity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentEntityRelation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentLabel
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageAnchor
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageBlock
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageDimension
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageFormField
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageImage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageLayout
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageLine
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageMatrix
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageParagraph
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageTable
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageToken
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentPageVisualElement
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentProvenance
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentProvenanceParent
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentRevision
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentShardInfo
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentStyle
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentStyleFontSize
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentTextAnchor
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2DocumentTextChange
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2EntityExtractionParams
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2FormExtractionParams
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2GcsDestination
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2GcsSource
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2InputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2KeyValuePairHint
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2NormalizedVertex
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2OcrParams
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2OperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2OutputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2ProcessDocumentRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2ProcessDocumentResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2TableBoundHint
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2TableExtractionParams
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta2Vertex
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3BatchProcessMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3BatchProcessResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3CommonOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3DeployProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3DisableProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3DisableProcessorResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3EnableProcessorMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3EnableProcessorResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3HumanReviewStatus
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3ReviewDocumentResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3UndeployProcessorVersionMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiV1beta3UndeployProcessorVersionResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleLongrunningOperation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleProtobufEmpty
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleRpcStatus
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleTypeColor
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleTypeDate
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleTypeDateTime
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleTypeMoney
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleTypePostalAddress
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleTypeTimeZone
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3DeleteLabelerPoolOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3DeleteProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3DeleteProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3DisableProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3DisableProcessorResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3EnableProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3EnableProcessorResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :evaluation, as: 'evaluation'
end
end
class GoogleCloudDocumentaiUiv1beta3ExportProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3ExportProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_uri, as: 'gcsUri'
end
end
class GoogleCloudDocumentaiUiv1beta3ImportDocumentsMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3ImportDocumentsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3SetDefaultProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3SetDefaultProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
property :test_dataset_validation, as: 'testDatasetValidation', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation::Representation
property :training_dataset_validation, as: 'trainingDatasetValidation', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :dataset_error_count, as: 'datasetErrorCount'
collection :dataset_errors, as: 'datasetErrors', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
property :document_error_count, as: 'documentErrorCount'
collection :document_errors, as: 'documentErrors', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :processor_version, as: 'processorVersion'
end
end
class GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiUiv1beta3UpdateDatasetOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3UpdateHumanReviewConfigMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1BatchProcessMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
collection :individual_process_statuses, as: 'individualProcessStatuses', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus::Representation
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :human_review_status, as: 'humanReviewStatus', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1HumanReviewStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1HumanReviewStatus::Representation
property :input_gcs_source, as: 'inputGcsSource'
property :output_gcs_destination, as: 'outputGcsDestination'
property :status, as: 'status', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
end
end
class GoogleCloudDocumentaiV1BatchProcessResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1CommonOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1DeleteProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1DeleteProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1DeployProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1DeployProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1DisableProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1DisableProcessorResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1EnableProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1EnableProcessorResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1HumanReviewStatus
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :human_review_operation, as: 'humanReviewOperation'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
end
end
class GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1ReviewDocumentResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_destination, as: 'gcsDestination'
end
end
class GoogleCloudDocumentaiV1SetDefaultProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1SetDefaultProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1UndeployProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :responses, as: 'responses', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1ProcessDocumentResponse, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1ProcessDocumentResponse::Representation
end
end
class GoogleCloudDocumentaiV1beta1BoundingPoly
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :normalized_vertices, as: 'normalizedVertices', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1NormalizedVertex, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1NormalizedVertex::Representation
collection :vertices, as: 'vertices', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1Vertex, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1Vertex::Representation
end
end
class GoogleCloudDocumentaiV1beta1Document
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, :base64 => true, as: 'content'
collection :entities, as: 'entities', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntity, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntity::Representation
collection :entity_relations, as: 'entityRelations', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntityRelation, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntityRelation::Representation
property :error, as: 'error', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
property :mime_type, as: 'mimeType'
collection :pages, as: 'pages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPage::Representation
collection :revisions, as: 'revisions', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentRevision, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentRevision::Representation
property :shard_info, as: 'shardInfo', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentShardInfo, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentShardInfo::Representation
property :text, as: 'text'
collection :text_changes, as: 'textChanges', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextChange, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextChange::Representation
collection :text_styles, as: 'textStyles', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentStyle, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentStyle::Representation
property :uri, as: 'uri'
end
end
class GoogleCloudDocumentaiV1beta1DocumentEntity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :confidence, as: 'confidence'
property :id, as: 'id'
property :mention_id, as: 'mentionId'
property :mention_text, as: 'mentionText'
property :normalized_value, as: 'normalizedValue', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue::Representation
property :page_anchor, as: 'pageAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageAnchor::Representation
collection :properties, as: 'properties', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntity, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntity::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
property :redacted, as: 'redacted'
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor::Representation
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :address_value, as: 'addressValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypePostalAddress, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypePostalAddress::Representation
property :boolean_value, as: 'booleanValue'
property :date_value, as: 'dateValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypeDate, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeDate::Representation
property :datetime_value, as: 'datetimeValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypeDateTime, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeDateTime::Representation
property :float_value, as: 'floatValue'
property :integer_value, as: 'integerValue'
property :money_value, as: 'moneyValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypeMoney, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeMoney::Representation
property :text, as: 'text'
end
end
class GoogleCloudDocumentaiV1beta1DocumentEntityRelation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :object_id_prop, as: 'objectId'
property :relation, as: 'relation'
property :subject_id, as: 'subjectId'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :blocks, as: 'blocks', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageBlock, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageBlock::Representation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :dimension, as: 'dimension', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDimension, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDimension::Representation
collection :form_fields, as: 'formFields', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageFormField, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageFormField::Representation
property :image, as: 'image', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageImage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageImage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
collection :lines, as: 'lines', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLine, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLine::Representation
property :page_number, as: 'pageNumber'
collection :paragraphs, as: 'paragraphs', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageParagraph, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageParagraph::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
collection :tables, as: 'tables', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTable, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTable::Representation
collection :tokens, as: 'tokens', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageToken, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageToken::Representation
collection :transforms, as: 'transforms', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageMatrix, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageMatrix::Representation
collection :visual_elements, as: 'visualElements', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageVisualElement, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageVisualElement::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageAnchor
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :page_refs, as: 'pageRefs', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageAnchorPageRef
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bounding_poly, as: 'boundingPoly', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1BoundingPoly, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1BoundingPoly::Representation
property :confidence, as: 'confidence'
property :layout_id, as: 'layoutId'
property :layout_type, as: 'layoutType'
property :page, :numeric_string => true, as: 'page'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageBlock
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :confidence, as: 'confidence'
property :language_code, as: 'languageCode'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageDimension
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :height, as: 'height'
property :unit, as: 'unit'
property :width, as: 'width'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageFormField
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :corrected_key_text, as: 'correctedKeyText'
property :corrected_value_text, as: 'correctedValueText'
property :field_name, as: 'fieldName', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :field_value, as: 'fieldValue', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
collection :name_detected_languages, as: 'nameDetectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
collection :value_detected_languages, as: 'valueDetectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :value_type, as: 'valueType'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageImage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, :base64 => true, as: 'content'
property :height, as: 'height'
property :mime_type, as: 'mimeType'
property :width, as: 'width'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageLayout
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bounding_poly, as: 'boundingPoly', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1BoundingPoly, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1BoundingPoly::Representation
property :confidence, as: 'confidence'
property :orientation, as: 'orientation'
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageLine
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageMatrix
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cols, as: 'cols'
property :data, :base64 => true, as: 'data'
property :rows, as: 'rows'
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageParagraph
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageTable
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :body_rows, as: 'bodyRows', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow::Representation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
collection :header_rows, as: 'headerRows', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :col_span, as: 'colSpan'
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :row_span, as: 'rowSpan'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :cells, as: 'cells', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageToken
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :detected_break, as: 'detectedBreak', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak::Representation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta1DocumentPageVisualElement
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout::Representation
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta1DocumentProvenance
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
collection :parents, as: 'parents', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenanceParent, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenanceParent::Representation
property :revision, as: 'revision'
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta1DocumentProvenanceParent
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
property :index, as: 'index'
property :revision, as: 'revision'
end
end
class GoogleCloudDocumentaiV1beta1DocumentRevision
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :agent, as: 'agent'
property :create_time, as: 'createTime'
property :human_review, as: 'humanReview', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview::Representation
property :id, as: 'id'
collection :parent, as: 'parent'
property :processor, as: 'processor'
end
end
class GoogleCloudDocumentaiV1beta1DocumentRevisionHumanReview
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :state, as: 'state'
property :state_message, as: 'stateMessage'
end
end
class GoogleCloudDocumentaiV1beta1DocumentShardInfo
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :shard_count, :numeric_string => true, as: 'shardCount'
property :shard_index, :numeric_string => true, as: 'shardIndex'
property :text_offset, :numeric_string => true, as: 'textOffset'
end
end
class GoogleCloudDocumentaiV1beta1DocumentStyle
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :background_color, as: 'backgroundColor', class: Google::Apis::DocumentaiV1beta2::GoogleTypeColor, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeColor::Representation
property :color, as: 'color', class: Google::Apis::DocumentaiV1beta2::GoogleTypeColor, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeColor::Representation
property :font_size, as: 'fontSize', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentStyleFontSize, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentStyleFontSize::Representation
property :font_weight, as: 'fontWeight'
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor::Representation
property :text_decoration, as: 'textDecoration'
property :text_style, as: 'textStyle'
end
end
class GoogleCloudDocumentaiV1beta1DocumentStyleFontSize
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :size, as: 'size'
property :unit, as: 'unit'
end
end
class GoogleCloudDocumentaiV1beta1DocumentTextAnchor
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, as: 'content'
collection :text_segments, as: 'textSegments', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment::Representation
end
end
class GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :end_index, :numeric_string => true, as: 'endIndex'
property :start_index, :numeric_string => true, as: 'startIndex'
end
end
class GoogleCloudDocumentaiV1beta1DocumentTextChange
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :changed_text, as: 'changedText'
collection :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentProvenance::Representation
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor::Representation
end
end
class GoogleCloudDocumentaiV1beta1GcsDestination
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :uri, as: 'uri'
end
end
class GoogleCloudDocumentaiV1beta1GcsSource
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :uri, as: 'uri'
end
end
class GoogleCloudDocumentaiV1beta1InputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_source, as: 'gcsSource', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1GcsSource, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1GcsSource::Representation
property :mime_type, as: 'mimeType'
end
end
class GoogleCloudDocumentaiV1beta1NormalizedVertex
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :x, as: 'x'
property :y, as: 'y'
end
end
class GoogleCloudDocumentaiV1beta1OperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1beta1OutputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_destination, as: 'gcsDestination', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1GcsDestination, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1GcsDestination::Representation
property :pages_per_shard, as: 'pagesPerShard'
end
end
class GoogleCloudDocumentaiV1beta1ProcessDocumentResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :input_config, as: 'inputConfig', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1InputConfig, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1InputConfig::Representation
property :output_config, as: 'outputConfig', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1OutputConfig, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1OutputConfig::Representation
end
end
class GoogleCloudDocumentaiV1beta1Vertex
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :x, as: 'x'
property :y, as: 'y'
end
end
class GoogleCloudDocumentaiV1beta2AutoMlParams
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :model, as: 'model'
end
end
class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :requests, as: 'requests', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentRequest, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentRequest::Representation
end
end
class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :responses, as: 'responses', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentResponse, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentResponse::Representation
end
end
class GoogleCloudDocumentaiV1beta2BoundingPoly
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :normalized_vertices, as: 'normalizedVertices', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2NormalizedVertex, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2NormalizedVertex::Representation
collection :vertices, as: 'vertices', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Vertex, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Vertex::Representation
end
end
class GoogleCloudDocumentaiV1beta2Document
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, :base64 => true, as: 'content'
collection :entities, as: 'entities', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntity, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntity::Representation
collection :entity_relations, as: 'entityRelations', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntityRelation, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntityRelation::Representation
property :error, as: 'error', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
collection :labels, as: 'labels', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentLabel, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentLabel::Representation
property :mime_type, as: 'mimeType'
collection :pages, as: 'pages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPage::Representation
collection :revisions, as: 'revisions', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentRevision, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentRevision::Representation
property :shard_info, as: 'shardInfo', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentShardInfo, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentShardInfo::Representation
property :text, as: 'text'
collection :text_changes, as: 'textChanges', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextChange, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextChange::Representation
collection :text_styles, as: 'textStyles', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentStyle, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentStyle::Representation
property :uri, as: 'uri'
end
end
class GoogleCloudDocumentaiV1beta2DocumentEntity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :confidence, as: 'confidence'
property :id, as: 'id'
property :mention_id, as: 'mentionId'
property :mention_text, as: 'mentionText'
property :normalized_value, as: 'normalizedValue', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue::Representation
property :page_anchor, as: 'pageAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageAnchor::Representation
collection :properties, as: 'properties', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntity, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntity::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
property :redacted, as: 'redacted'
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor::Representation
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :address_value, as: 'addressValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypePostalAddress, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypePostalAddress::Representation
property :boolean_value, as: 'booleanValue'
property :date_value, as: 'dateValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypeDate, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeDate::Representation
property :datetime_value, as: 'datetimeValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypeDateTime, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeDateTime::Representation
property :float_value, as: 'floatValue'
property :integer_value, as: 'integerValue'
property :money_value, as: 'moneyValue', class: Google::Apis::DocumentaiV1beta2::GoogleTypeMoney, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeMoney::Representation
property :text, as: 'text'
end
end
class GoogleCloudDocumentaiV1beta2DocumentEntityRelation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :object_id_prop, as: 'objectId'
property :relation, as: 'relation'
property :subject_id, as: 'subjectId'
end
end
class GoogleCloudDocumentaiV1beta2DocumentLabel
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :automl_model, as: 'automlModel'
property :confidence, as: 'confidence'
property :name, as: 'name'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :blocks, as: 'blocks', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageBlock, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageBlock::Representation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :dimension, as: 'dimension', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDimension, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDimension::Representation
collection :form_fields, as: 'formFields', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageFormField, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageFormField::Representation
property :image, as: 'image', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageImage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageImage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
collection :lines, as: 'lines', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLine, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLine::Representation
property :page_number, as: 'pageNumber'
collection :paragraphs, as: 'paragraphs', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageParagraph, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageParagraph::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
collection :tables, as: 'tables', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTable, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTable::Representation
collection :tokens, as: 'tokens', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageToken, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageToken::Representation
collection :transforms, as: 'transforms', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageMatrix, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageMatrix::Representation
collection :visual_elements, as: 'visualElements', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageVisualElement, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageVisualElement::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageAnchor
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :page_refs, as: 'pageRefs', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageAnchorPageRef
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bounding_poly, as: 'boundingPoly', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly::Representation
property :confidence, as: 'confidence'
property :layout_id, as: 'layoutId'
property :layout_type, as: 'layoutType'
property :page, :numeric_string => true, as: 'page'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageBlock
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :confidence, as: 'confidence'
property :language_code, as: 'languageCode'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageDimension
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :height, as: 'height'
property :unit, as: 'unit'
property :width, as: 'width'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageFormField
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :corrected_key_text, as: 'correctedKeyText'
property :corrected_value_text, as: 'correctedValueText'
property :field_name, as: 'fieldName', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :field_value, as: 'fieldValue', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
collection :name_detected_languages, as: 'nameDetectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
collection :value_detected_languages, as: 'valueDetectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :value_type, as: 'valueType'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageImage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, :base64 => true, as: 'content'
property :height, as: 'height'
property :mime_type, as: 'mimeType'
property :width, as: 'width'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageLayout
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bounding_poly, as: 'boundingPoly', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly::Representation
property :confidence, as: 'confidence'
property :orientation, as: 'orientation'
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageLine
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageMatrix
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cols, as: 'cols'
property :data, :base64 => true, as: 'data'
property :rows, as: 'rows'
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageParagraph
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageTable
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :body_rows, as: 'bodyRows', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow::Representation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
collection :header_rows, as: 'headerRows', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :col_span, as: 'colSpan'
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :row_span, as: 'rowSpan'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :cells, as: 'cells', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageToken
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :detected_break, as: 'detectedBreak', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak::Representation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta2DocumentPageVisualElement
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :detected_languages, as: 'detectedLanguages', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage::Representation
property :layout, as: 'layout', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout::Representation
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta2DocumentProvenance
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
collection :parents, as: 'parents', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenanceParent, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenanceParent::Representation
property :revision, as: 'revision'
property :type, as: 'type'
end
end
class GoogleCloudDocumentaiV1beta2DocumentProvenanceParent
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
property :index, as: 'index'
property :revision, as: 'revision'
end
end
class GoogleCloudDocumentaiV1beta2DocumentRevision
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :agent, as: 'agent'
property :create_time, as: 'createTime'
property :human_review, as: 'humanReview', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview::Representation
property :id, as: 'id'
collection :parent, as: 'parent'
property :processor, as: 'processor'
end
end
class GoogleCloudDocumentaiV1beta2DocumentRevisionHumanReview
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :state, as: 'state'
property :state_message, as: 'stateMessage'
end
end
class GoogleCloudDocumentaiV1beta2DocumentShardInfo
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :shard_count, :numeric_string => true, as: 'shardCount'
property :shard_index, :numeric_string => true, as: 'shardIndex'
property :text_offset, :numeric_string => true, as: 'textOffset'
end
end
class GoogleCloudDocumentaiV1beta2DocumentStyle
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :background_color, as: 'backgroundColor', class: Google::Apis::DocumentaiV1beta2::GoogleTypeColor, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeColor::Representation
property :color, as: 'color', class: Google::Apis::DocumentaiV1beta2::GoogleTypeColor, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeColor::Representation
property :font_size, as: 'fontSize', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentStyleFontSize, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentStyleFontSize::Representation
property :font_weight, as: 'fontWeight'
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor::Representation
property :text_decoration, as: 'textDecoration'
property :text_style, as: 'textStyle'
end
end
class GoogleCloudDocumentaiV1beta2DocumentStyleFontSize
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :size, as: 'size'
property :unit, as: 'unit'
end
end
class GoogleCloudDocumentaiV1beta2DocumentTextAnchor
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, as: 'content'
collection :text_segments, as: 'textSegments', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment::Representation
end
end
class GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :end_index, :numeric_string => true, as: 'endIndex'
property :start_index, :numeric_string => true, as: 'startIndex'
end
end
class GoogleCloudDocumentaiV1beta2DocumentTextChange
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :changed_text, as: 'changedText'
collection :provenance, as: 'provenance', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentProvenance::Representation
property :text_anchor, as: 'textAnchor', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor::Representation
end
end
class GoogleCloudDocumentaiV1beta2EntityExtractionParams
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :enabled, as: 'enabled'
property :model_version, as: 'modelVersion'
end
end
class GoogleCloudDocumentaiV1beta2FormExtractionParams
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :enabled, as: 'enabled'
collection :key_value_pair_hints, as: 'keyValuePairHints', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2KeyValuePairHint, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2KeyValuePairHint::Representation
property :model_version, as: 'modelVersion'
end
end
class GoogleCloudDocumentaiV1beta2GcsDestination
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :uri, as: 'uri'
end
end
class GoogleCloudDocumentaiV1beta2GcsSource
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :uri, as: 'uri'
end
end
class GoogleCloudDocumentaiV1beta2InputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :contents, :base64 => true, as: 'contents'
property :gcs_source, as: 'gcsSource', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2GcsSource, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2GcsSource::Representation
property :mime_type, as: 'mimeType'
end
end
class GoogleCloudDocumentaiV1beta2KeyValuePairHint
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :key, as: 'key'
collection :value_types, as: 'valueTypes'
end
end
class GoogleCloudDocumentaiV1beta2NormalizedVertex
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :x, as: 'x'
property :y, as: 'y'
end
end
class GoogleCloudDocumentaiV1beta2OcrParams
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :language_hints, as: 'languageHints'
end
end
class GoogleCloudDocumentaiV1beta2OperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1beta2OutputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_destination, as: 'gcsDestination', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2GcsDestination, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2GcsDestination::Representation
property :pages_per_shard, as: 'pagesPerShard'
end
end
class GoogleCloudDocumentaiV1beta2ProcessDocumentRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :automl_params, as: 'automlParams', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2AutoMlParams, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2AutoMlParams::Representation
property :document_type, as: 'documentType'
property :entity_extraction_params, as: 'entityExtractionParams', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2EntityExtractionParams, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2EntityExtractionParams::Representation
property :form_extraction_params, as: 'formExtractionParams', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2FormExtractionParams, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2FormExtractionParams::Representation
property :input_config, as: 'inputConfig', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2InputConfig, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2InputConfig::Representation
property :ocr_params, as: 'ocrParams', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OcrParams, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OcrParams::Representation
property :output_config, as: 'outputConfig', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OutputConfig, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OutputConfig::Representation
property :parent, as: 'parent'
property :table_extraction_params, as: 'tableExtractionParams', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2TableExtractionParams, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2TableExtractionParams::Representation
end
end
class GoogleCloudDocumentaiV1beta2ProcessDocumentResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :input_config, as: 'inputConfig', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2InputConfig, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2InputConfig::Representation
property :output_config, as: 'outputConfig', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OutputConfig, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OutputConfig::Representation
end
end
class GoogleCloudDocumentaiV1beta2TableBoundHint
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bounding_box, as: 'boundingBox', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly::Representation
property :page_number, as: 'pageNumber'
end
end
class GoogleCloudDocumentaiV1beta2TableExtractionParams
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :enabled, as: 'enabled'
collection :header_hints, as: 'headerHints'
property :model_version, as: 'modelVersion'
collection :table_bound_hints, as: 'tableBoundHints', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2TableBoundHint, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2TableBoundHint::Representation
end
end
class GoogleCloudDocumentaiV1beta2Vertex
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :x, as: 'x'
property :y, as: 'y'
end
end
class GoogleCloudDocumentaiV1beta3BatchProcessMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
collection :individual_process_statuses, as: 'individualProcessStatuses', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus::Representation
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1beta3BatchProcessMetadataIndividualProcessStatus
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :human_review_operation, as: 'humanReviewOperation'
property :human_review_status, as: 'humanReviewStatus', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3HumanReviewStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3HumanReviewStatus::Representation
property :input_gcs_source, as: 'inputGcsSource'
property :output_gcs_destination, as: 'outputGcsDestination'
property :status, as: 'status', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
end
end
class GoogleCloudDocumentaiV1beta3BatchProcessResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1beta3CommonOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1beta3DeleteProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3DeleteProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3DeployProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3DeployProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1beta3DisableProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3DisableProcessorResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1beta3EnableProcessorMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3EnableProcessorResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1beta3HumanReviewStatus
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :human_review_operation, as: 'humanReviewOperation'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
end
end
class GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
property :create_time, as: 'createTime'
property :state, as: 'state'
property :state_message, as: 'stateMessage'
property :update_time, as: 'updateTime'
end
end
class GoogleCloudDocumentaiV1beta3ReviewDocumentResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_destination, as: 'gcsDestination'
end
end
class GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleCloudDocumentaiV1beta3UndeployProcessorVersionMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :common_metadata, as: 'commonMetadata', class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata, decorator: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta3CommonOperationMetadata::Representation
end
end
class GoogleCloudDocumentaiV1beta3UndeployProcessorVersionResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleLongrunningOperation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :done, as: 'done'
property :error, as: 'error', class: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus, decorator: Google::Apis::DocumentaiV1beta2::GoogleRpcStatus::Representation
hash :metadata, as: 'metadata'
property :name, as: 'name'
hash :response, as: 'response'
end
end
class GoogleProtobufEmpty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GoogleRpcStatus
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :code, as: 'code'
collection :details, as: 'details'
property :message, as: 'message'
end
end
class GoogleTypeColor
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :alpha, as: 'alpha'
property :blue, as: 'blue'
property :green, as: 'green'
property :red, as: 'red'
end
end
class GoogleTypeDate
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :day, as: 'day'
property :month, as: 'month'
property :year, as: 'year'
end
end
class GoogleTypeDateTime
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :day, as: 'day'
property :hours, as: 'hours'
property :minutes, as: 'minutes'
property :month, as: 'month'
property :nanos, as: 'nanos'
property :seconds, as: 'seconds'
property :time_zone, as: 'timeZone', class: Google::Apis::DocumentaiV1beta2::GoogleTypeTimeZone, decorator: Google::Apis::DocumentaiV1beta2::GoogleTypeTimeZone::Representation
property :utc_offset, as: 'utcOffset'
property :year, as: 'year'
end
end
class GoogleTypeMoney
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :currency_code, as: 'currencyCode'
property :nanos, as: 'nanos'
property :units, :numeric_string => true, as: 'units'
end
end
class GoogleTypePostalAddress
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :address_lines, as: 'addressLines'
property :administrative_area, as: 'administrativeArea'
property :language_code, as: 'languageCode'
property :locality, as: 'locality'
property :organization, as: 'organization'
property :postal_code, as: 'postalCode'
collection :recipients, as: 'recipients'
property :region_code, as: 'regionCode'
property :revision, as: 'revision'
property :sorting_code, as: 'sortingCode'
property :sublocality, as: 'sublocality'
end
end
class GoogleTypeTimeZone
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :id, as: 'id'
property :version, as: 'version'
end
end
end
end
end
| 48.698739 | 336 | 0.722782 |
11713c13eb117b32f57b36a0d0655e0d1306a6a7 | 1,717 | Pod::Spec.new do |spec|
spec.name = "ESPProvision"
spec.version = "2.0.11"
spec.summary = "ESP-IDF provisioning in Swift"
spec.description = "It provides mechanism to provide network credentials and/or custom data to an ESP32, ESP32-S2 or ESP8266 devices"
spec.homepage = "https://github.com/espressif/esp-idf-provisioning-ios"
spec.license = { :type => 'Apache License, Version 2.0',
:text => <<-LICENSE
Copyright © 2020 Espressif.
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.
LICENSE
}
spec.author = "Espressif Systems"
spec.platform = :ios, "11.0"
spec.source = { :git => "https://github.com/espressif/esp-idf-provisioning-ios.git", :tag => "lib-#{spec.version}" }
spec.source_files = "ESPProvision", "ESPProvision/**/*.{h,m,swift}"
spec.subspec 'Core' do |cs|
cs.dependency "SwiftProtobuf", "~> 1.5.0"
cs.dependency "Curve25519", "~> 1.1.0"
end
spec.swift_versions = ['5.1', '5.2']
end
| 44.025641 | 136 | 0.5894 |
e873c456a4d48ddf797362fe23c164af1e2a26db | 1,619 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::MediaServices::Mgmt::V2018_07_01
module Models
#
# Base class for content key ID location. A derived class must be used to
# represent the location.
#
class ContentKeyPolicyPlayReadyContentKeyLocation
include MsRestAzure
@@discriminatorMap = Hash.new
@@discriminatorMap["#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"] = "ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"
@@discriminatorMap["#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier"] = "ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier"
def initialize
@odatatype = "ContentKeyPolicyPlayReadyContentKeyLocation"
end
attr_accessor :odatatype
#
# Mapper for ContentKeyPolicyPlayReadyContentKeyLocation class as Ruby
# Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ContentKeyPolicyPlayReadyContentKeyLocation',
type: {
name: 'Composite',
polymorphic_discriminator: '@odata.type',
uber_parent: 'ContentKeyPolicyPlayReadyContentKeyLocation',
class_name: 'ContentKeyPolicyPlayReadyContentKeyLocation',
model_properties: {
}
}
}
end
end
end
end
| 32.38 | 174 | 0.700432 |
26789a93651db4ade22b0b1f8c3887e0b25b9c7b | 4,255 | require 'spec_helper'
require 'dentaku/token'
require 'dentaku/tokenizer'
require 'dentaku/parser'
describe Dentaku::Parser do
it 'parses an integer literal' do
node = parse('5')
expect(node.value).to eq(5)
end
it 'performs simple addition' do
node = parse('5 + 4')
expect(node.value).to eq(9)
end
it 'compares two numbers' do
node = parse('5 < 4')
expect(node.value).to eq(false)
end
it 'calculates unary percentage' do
node = parse('5%')
expect(node.value).to eq(0.05)
end
it 'calculates bitwise OR' do
node = parse('2|3')
expect(node.value).to eq(3)
end
it 'performs multiple operations in one stream' do
node = parse('5 * 4 + 3')
expect(node.value).to eq(23)
end
it 'respects order of operations' do
node = parse('5 + 4*3')
expect(node.value).to eq(17)
end
it 'respects grouping by parenthesis' do
node = parse('(5 + 4) * 3')
expect(node.value).to eq(27)
end
it 'evaluates functions' do
node = parse('IF(5 < 4, 3, 2)')
expect(node.value).to eq(2)
end
it 'represents formulas with variables' do
node = parse('5 * x')
expect { node.value }.to raise_error(Dentaku::UnboundVariableError)
expect(node.value("x" => 3)).to eq(15)
end
it 'evaluates access into data structures' do
node = parse('a[1]')
expect { node.value }.to raise_error(Dentaku::UnboundVariableError)
expect(node.value("a" => [1, 2, 3])).to eq(2)
end
it 'evaluates boolean expressions' do
node = parse('true AND false')
expect(node.value).to eq(false)
end
it 'evaluates a case statement' do
node = parse('CASE x WHEN 1 THEN 2 WHEN 3 THEN 4 END')
expect(node.value("x" => 3)).to eq(4)
end
it 'evaluates a nested case statement with case-sensitivity' do
node = parse('CASE x WHEN 1 THEN CASE Y WHEN "A" THEN 2 WHEN "B" THEN 3 END END', { case_sensitive: true }, { case_sensitive: true })
expect(node.value("x" => 1, "y" => "A", "Y" => "B")).to eq(3)
end
it 'evaluates arrays' do
node = parse('{1, 2, 3}')
expect(node.value).to eq([1, 2, 3])
end
context 'invalid expression' do
it 'raises a parse error for bad math' do
expect {
parse("5 * -")
}.to raise_error(Dentaku::ParseError)
end
it 'raises a parse error for bad logic' do
expect {
parse("TRUE AND")
}.to raise_error(Dentaku::ParseError)
end
it 'raises a parse error for too many operands' do
expect {
parse("IF(1, 0, IF(1, 2, 3, 4))")
}.to raise_error(Dentaku::ParseError)
expect {
parse("CASE a WHEN 1 THEN true ELSE THEN IF(1, 2, 3, 4) END")
}.to raise_error(Dentaku::ParseError)
end
it 'raises a parse error for bad grouping structure' do
expect {
parse(",")
}.to raise_error(Dentaku::ParseError)
expect {
parse("5, x")
described_class.new([five, comma, x]).parse
}.to raise_error(Dentaku::ParseError)
expect {
parse("5 + 5, x")
}.to raise_error(Dentaku::ParseError)
expect {
parse("{1, 2, }")
}.to raise_error(Dentaku::ParseError)
expect {
parse("CONCAT('1', '2', )")
}.to raise_error(Dentaku::ParseError)
end
it 'raises parse errors for malformed case statements' do
expect {
parse("CASE a when 'one' then 1")
}.to raise_error(Dentaku::ParseError)
expect {
parse("case a whend 'one' then 1 end")
}.to raise_error(Dentaku::ParseError)
expect {
parse("CASE a WHEN 'one' THEND 1 END")
}.to raise_error(Dentaku::ParseError)
expect {
parse("CASE a when 'one' then end")
}.to raise_error(Dentaku::ParseError)
end
it 'raises a parse error when trying to access an undefined function' do
expect {
parse("undefined()")
}.to raise_error(Dentaku::ParseError)
end
end
it "evaluates explicit 'NULL' as nil" do
node = parse("NULL")
expect(node.value).to eq(nil)
end
private
def parse(expr, parser_options = {}, tokenizer_options = {})
tokens = Dentaku::Tokenizer.new.tokenize(expr, tokenizer_options)
described_class.new(tokens, parser_options).parse
end
end
| 25.479042 | 137 | 0.612691 |
f79f5ce473adf86e7057959a086bff578ab6a81b | 2,452 | require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper")
describe Sequel::Model, "BooleanReaders plugin" do
before do
@db = Sequel.mock
def @db.supports_schema_parsing?() true end
def @db.schema(*args)
[[:id, {}], [:z, {:type=>:integer, :db_type=>'tinyint(1)'}], [:b, {:type=>:boolean, :db_type=>'boolean'}]]
end
@c = Class.new(Sequel::Model(@db[:items]))
@p = proc do
@columns = [:id, :b, :z]
def columns; @columns; end
end
@c.instance_eval(&@p)
end
it "should create attribute? readers for all boolean attributes" do
@c.plugin(:boolean_readers)
o = @c.new
o.b?.must_be_nil
o.b = '1'
o.b?.must_equal true
o.b = '0'
o.b?.must_equal false
o.b = ''
o.b?.must_be_nil
end
it "should not create attribute? readers for non-boolean attributes" do
@c.plugin(:boolean_readers)
proc{@c.new.z?}.must_raise(NoMethodError)
proc{@c.new.id?}.must_raise(NoMethodError)
end
it "should accept a block to determine if an attribute is boolean" do
@c.plugin(:boolean_readers){|c| db_schema[c][:db_type] == 'tinyint(1)'}
proc{@c.new.b?}.must_raise(NoMethodError)
o = @c.new
o.z.must_be_nil
o.z?.must_be_nil
o.z = '1'
o.z.must_equal 1
o.z?.must_equal true
o.z = '0'
o.z.must_equal 0
o.z?.must_equal false
o.z = ''
o.z.must_be_nil
o.z?.must_be_nil
end
it "should create boolean readers when set_dataset is defined" do
c = Class.new(Sequel::Model(@db))
c.instance_eval(&@p)
c.plugin(:boolean_readers)
c.set_dataset(@db[:a])
o = c.new
o.b?.must_be_nil
o.b = '1'
o.b?.must_equal true
o.b = '0'
o.b?.must_equal false
o.b = ''
o.b?.must_be_nil
proc{o.i?}.must_raise(NoMethodError)
c = Class.new(Sequel::Model(@db))
c.instance_eval(&@p)
c.plugin(:boolean_readers){|x| db_schema[x][:db_type] == 'tinyint(1)'}
c.set_dataset(@db[:a])
o = c.new
o.z.must_be_nil
o.z?.must_be_nil
o.z = '1'
o.z.must_equal 1
o.z?.must_equal true
o.z = '0'
o.z.must_equal 0
o.z?.must_equal false
o.z = ''
o.z.must_be_nil
o.z?.must_be_nil
proc{o.b?}.must_raise(NoMethodError)
end
it "should handle cases where getting the columns raises an error" do
@c.meta_def(:columns){raise Sequel::Error}
@c.plugin(:boolean_readers)
proc{@c.new.b?}.must_raise(NoMethodError)
end
end
| 26.085106 | 112 | 0.615824 |
03c3a78e698e031f64d13e1268bf421ed560cd82 | 4,178 | require 'spec_helper'
describe 'gws_presence_users', type: :request, dbscope: :example do
let!(:site) { gws_site }
let!(:user) { gws_user }
let!(:custom_group) { create :gws_custom_group, member_ids: [user.id] }
let(:auth_token_path) { sns_auth_token_path(format: :json) }
let(:users_path) { gws_presence_apis_users_path(site: site.id, format: :json) }
let(:group_users_path) do
gws_presence_apis_group_users_path(site: site.id, group: gws_user.gws_default_group.id, format: :json)
end
let(:custom_group_users_path) do
gws_presence_apis_custom_group_users_path(site: site.id, group: custom_group.id, format: :json)
end
let(:update_path) { gws_presence_apis_user_path(site: site.id, id: gws_user.id, format: :json) }
let(:states_path) { states_gws_presence_apis_users_path(site: site.id, format: :json) }
let(:presence_states) { Gws::UserPresence.new.state_options.map(&:reverse).to_h }
let(:presence_styles) { Gws::UserPresence.new.state_styles }
context "login with gws-admin" do
before do
# get and save auth token
get auth_token_path
@auth_token = JSON.parse(response.body)["auth_token"]
# login
params = {
'authenticity_token' => @auth_token,
'item[email]' => gws_user.email,
'item[password]' => "pass"
}
post sns_login_path(format: :json), params: params
end
it "GET /.g:site/presence/users.json" do
get users_path
expect(response.status).to eq 200
json = JSON.parse(response.body)
gws_admin = json["items"][1]
expect(gws_admin["id"]).to eq gws_user.id
expect(gws_admin["name"]).to eq gws_user.name
end
it "GET /.g:site/presence/g-:group/users.json" do
get group_users_path
expect(response.status).to eq 200
json = JSON.parse(response.body)
gws_admin = json["items"][1]
expect(gws_admin["id"]).to eq gws_user.id
expect(gws_admin["name"]).to eq gws_user.name
end
it "GET /.g:site/presence/c-:group/users.json" do
get custom_group_users_path
expect(response.status).to eq 200
json = JSON.parse(response.body)
gws_admin = json["items"][0]
expect(gws_admin["id"]).to eq gws_user.id
expect(gws_admin["name"]).to eq gws_user.name
end
it "PUT /.g:site/presence/users.json" do
params = {
presence_state: "available",
presence_memo: "modified-memo",
presence_plan: "modified-plan"
}
put update_path, params: params
expect(response.status).to eq 200
gws_admin = JSON.parse(response.body)
expect(gws_admin["id"]).to eq gws_user.id
expect(gws_admin["name"]).to eq gws_user.name
expect(gws_admin["presence_state"]).to eq "available"
expect(gws_admin["presence_state_label"]).to eq presence_states["available"]
expect(gws_admin["presence_state_style"]).to eq presence_styles["available"]
expect(gws_admin["presence_memo"]).to eq "modified-memo"
expect(gws_admin["presence_plan"]).to eq "modified-plan"
expect(gws_admin["editable"]).to eq true
get group_users_path
expect(response.status).to eq 200
json = JSON.parse(response.body)
gws_admin = json["items"][1]
expect(gws_admin["id"]).to eq gws_user.id
expect(gws_admin["name"]).to eq gws_user.name
expect(gws_admin["presence_state"]).to eq "available"
expect(gws_admin["presence_state_label"]).to eq presence_states["available"]
expect(gws_admin["presence_state_style"]).to eq presence_styles["available"]
expect(gws_admin["presence_memo"]).to eq "modified-memo"
expect(gws_admin["presence_plan"]).to eq "modified-plan"
expect(gws_admin["editable"]).to eq true
end
it "GET /.g:site/presence/users/states.json" do
get states_path
expect(response.status).to eq 200
json = JSON.parse(response.body)
available = json["items"][0]
expect(available["name"]).to eq "available"
expect(available["label"]).to eq presence_states["available"]
expect(available["style"]).to eq presence_styles["available"]
expect(available["order"]).to eq 0
end
end
end
| 37.63964 | 106 | 0.674246 |
28854508763233fc0a3750ad1ba29f4bc494bad3 | 143 | # encoding: utf-8
# frozen_string_literal: true
# author: Dominik Richter
# author: Christoph Hartmann
module Inspec
VERSION = '3.0.52'
end
| 15.888889 | 29 | 0.741259 |
f8c8aa4f58b999d645e61aa00013963c6f1d27fd | 293 | module RailsMarketplace
module SellerHelper
# Logs in the given seller.
def seller_log_in(seller)
session[:seller_id] = seller.id
end
def seller_logged_in?
!session[:seller_id].nil?
end
def seller_log_out
session.delete(:seller_id)
end
end
end | 18.3125 | 37 | 0.675768 |
03b524218131133e3d2ac391baa812ea5bb10d17 | 232 | # = Database
#
# Load the database configuration for the current environment.
Halcyon.db = Halcyon::Runner.load_config(Halcyon::Runner.config_path('database'))
Halcyon.db = Halcyon.db[(Halcyon.environment || :development).to_sym]
| 33.142857 | 81 | 0.767241 |
f7a4bf1a9f90d575cc6671354d8d9d59ca42f65d | 1,716 | # frozen_string_literal: true
module Admin
class PropagateIntegrationService
include PropagateService
def propagate
if integration.instance_level?
update_inherited_integrations
create_integration_for_groups_without_integration
create_integration_for_projects_without_integration
else
update_inherited_descendant_integrations
create_integration_for_groups_without_integration_belonging_to_group
create_integration_for_projects_without_integration_belonging_to_group
end
end
private
def update_inherited_integrations
propagate_integrations(
Integration.by_type(integration.type).inherit_from_id(integration.id),
PropagateIntegrationInheritWorker
)
end
def update_inherited_descendant_integrations
propagate_integrations(
Integration.inherited_descendants_from_self_or_ancestors_from(integration),
PropagateIntegrationInheritDescendantWorker
)
end
def create_integration_for_groups_without_integration
propagate_integrations(
Group.without_integration(integration),
PropagateIntegrationGroupWorker
)
end
def create_integration_for_groups_without_integration_belonging_to_group
propagate_integrations(
integration.group.descendants.without_integration(integration),
PropagateIntegrationGroupWorker
)
end
def create_integration_for_projects_without_integration_belonging_to_group
propagate_integrations(
Project.without_integration(integration).in_namespace(integration.group.self_and_descendants),
PropagateIntegrationProjectWorker
)
end
end
end
| 30.105263 | 102 | 0.778555 |
2682cd8a9340a69599bbd31e7861109297ae9e73 | 116 | class AddPageToLevels < ActiveRecord::Migration[4.2]
def change
add_column :levels, :page, :integer
end
end
| 19.333333 | 52 | 0.732759 |
2151ecf0135c722176ff528d00f40a0995bd4703 | 4,107 | class GraphTool < Formula
include Language::Python::Virtualenv
desc "Efficient network analysis for Python 3"
homepage "https://graph-tool.skewed.de/"
url "https://downloads.skewed.de/graph-tool/graph-tool-2.33.tar.bz2"
sha256 "f07025160a8cb376551508c6d8aa5fd05a146c67c4706ea4635d2766aa5c9fcb"
license "GPL-3.0"
bottle do
sha256 "c87595bb20ff5868ca1b32ee16baf7cad07c08124b4bb209bf9fb275821cb661" => :catalina
sha256 "04e48635f2b6d233525a3df163acbe1fc9b6ee5859892c2a2d46afa631ae8fd3" => :mojave
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "boost-python3"
depends_on "cairomm"
depends_on "cgal"
depends_on "google-sparsehash"
depends_on "gtk+3"
depends_on "librsvg"
depends_on :macos => :mojave # for C++17
depends_on "numpy"
depends_on "py3cairo"
depends_on "pygobject3"
depends_on "[email protected]"
depends_on "scipy"
resource "Cycler" do
url "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz"
sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"
end
resource "kiwisolver" do
url "https://files.pythonhosted.org/packages/16/e7/df58eb8868d183223692d2a62529a594f6414964a3ae93548467b146a24d/kiwisolver-1.1.0.tar.gz"
sha256 "53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75"
end
resource "matplotlib" do
url "https://files.pythonhosted.org/packages/12/d1/7b12cd79c791348cb0c78ce6e7d16bd72992f13c9f1e8e43d2725a6d8adf/matplotlib-3.1.1.tar.gz"
sha256 "1febd22afe1489b13c6749ea059d392c03261b2950d1d45c17e3aed812080c93"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/00/32/8076fa13e832bb4dcff379f18f228e5a53412be0631808b9ca2610c0f566/pyparsing-2.4.5.tar.gz"
sha256 "4ca62001be367f01bd3e92ecbb79070272a9d4964dce6a48a82ff0b8bc7e683a"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz"
sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
end
resource "pytz" do
url "https://files.pythonhosted.org/packages/82/c3/534ddba230bd4fbbd3b7a3d35f3341d014cca213f369a9940925e7e5f691/pytz-2019.3.tar.gz"
sha256 "b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be"
end
resource "six" do
url "https://files.pythonhosted.org/packages/94/3e/edcf6fef41d89187df7e38e868b2dd2182677922b600e880baad7749c865/six-1.13.0.tar.gz"
sha256 "30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"
end
def install
system "autoreconf", "-fiv"
xy = Language::Python.major_minor_version Formula["[email protected]"].opt_bin/"python3"
venv = virtualenv_create(libexec, Formula["[email protected]"].opt_bin/"python3")
resources.each do |r|
venv.pip_install_and_link r
end
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
PYTHON=python3
PYTHON_LIBS=-undefined\ dynamic_lookup
--with-python-module-path=#{lib}/python#{xy}/site-packages
--with-boost-python=boost_python#{xy.to_s.delete(".")}-mt
--with-boost-libdir=#{HOMEBREW_PREFIX}/opt/boost/lib
--with-boost-coroutine=boost_coroutine-mt
]
args << "--with-expat=#{MacOS.sdk_path}/usr" if MacOS.sdk_path_if_needed
system "./configure", *args
system "make", "install"
site_packages = "lib/python#{xy}/site-packages"
pth_contents = "import site; site.addsitedir('#{libexec/site_packages}')\n"
(prefix/site_packages/"homebrew-graph-tool.pth").write pth_contents
end
test do
(testpath/"test.py").write <<~EOS
import graph_tool as gt
g = gt.Graph()
v1 = g.add_vertex()
v2 = g.add_vertex()
e = g.add_edge(v1, v2)
assert g.num_edges() == 1
assert g.num_vertices() == 2
EOS
system Formula["[email protected]"].opt_bin/"python3", "test.py"
end
end
| 37 | 145 | 0.750426 |
edf1abe9675e33f8aa0a6b4eb2b5b0a2bb8ccdc5 | 918 | require 'sinatra/flash/hash'
module Sinatra
module Flash
# Provides a helper for accessing the flash storage.
module Storage
# The main Sinatra helper for accessing the flash. You can have multiple flash collections (e.g.,
# for different apps in your Rack stack) by passing a symbol to it.
#
# @param [optional, String, Symbol] key Specifies which key in the session contains the hash
# you want to reference. Defaults to ':flash'. If there is no session or the key is not found,
# an empty hash is used. Note that this is only used in the case of multiple flash _collections_,
# which is rarer than multiple flash messages.
#
# @return [FlashHash] Assign to this like any other hash.
def flash(key=:flash)
@flash ||= {}
@flash[key.to_sym] ||= FlashHash.new((session ? session[key.to_sym] : {}))
end
end
end
end
| 35.307692 | 104 | 0.662309 |
ab57249e0795b83adcaeb83370851b898746a06a | 19,473 | # frozen_string_literal: true
# rubocop:disable Lint/RedundantCopDisableDirective, Layout/LineLength, Layout/HeredocIndentation
module Engine
module Config
module Game
module G18LosAngeles
JSON = <<-'DATA'
{
"filename": "18_los_angeles",
"modulename": "18LosAngeles",
"certLimit": {
"2": {
"5": 19,
"4": 16
},
"3": {
"5" : 14,
"4" : 11
},
"4": {
"6" : 12,
"5" : 10,
"4" : 8
},
"5": {
"7" : 11,
"6" : 10,
"5" : 8,
"4" : 6
}
},
"locationNames": {
"A2": "Reseda",
"A4": "Van Nuys",
"A6": "Burbank",
"A8": "Pasadena",
"A10": "Lancaster",
"A12": "Victorville",
"A14": "San Bernardino",
"B1": "Oxnard",
"B3": "Beverly Hills",
"B5": "Hollywood",
"B7": "South Pasadena",
"B9": "Alhambra",
"B11": "Azusa",
"B13": "San Dimas",
"B15": "Pomona",
"C2": "Santa Monica",
"C4": "Culver City",
"C6": "Los Angeles",
"C8": "Montebello",
"C10": "Puente",
"C12": "Walnut",
"C14": "Riverside",
"D3": "El Segundo",
"D5": "Gardena",
"D7": "Compton",
"D9": "Norwalk",
"D11": "La Habra",
"D13": "Yorba Linda",
"D15": "Palm Springs",
"E4": "Redondo Beach",
"E6": "Torrance",
"E8": "Long Beach",
"E10": "Cypress",
"E12": "Anaheim",
"E14": "Alta Vista",
"E16": "Corona",
"F5": "San Pedro",
"F7": "Port of Long Beach",
"F9": "Westminster",
"F11": "Garden Grove",
"F13": "Santa Ana",
"F15": "Irvine"
},
"tiles": {
"5": 3,
"6": 4,
"7": 4,
"8": 4,
"9": 4,
"14": 4,
"15": 5,
"16": 2,
"17": 1,
"18": 1,
"19": 2,
"20": 2,
"21": 1,
"22": 1,
"23": 4,
"24": 4,
"25": 2,
"26": 1,
"27": 1,
"28": 1,
"29": 1,
"30": 1,
"31": 1,
"39": 1,
"40": 1,
"41": 2,
"42": 2,
"43": 2,
"44": 1,
"45": 2,
"46": 2,
"47": 2,
"51": 2,
"57": 4,
"70": 1,
"290": 1,
"291": 1,
"292": 1,
"293": 1,
"294": 2,
"295": 2,
"296": 1,
"297": 2,
"298LA": 1,
"299LA": 1,
"300LA": 1,
"611": 4,
"619": 3
},
"companies": [
{
"name": "Gardena Tramway",
"value": 140,
"treasury": 60,
"revenue": 0,
"desc": "Starts with $60 in treasury, a 2 train, and a token in Gardena (D5). In ORs, this is the first minor to operate. May only lay or upgrade 1 tile per OR. Splits revenue evenly with owner. May be sold to a corporation for up to $140.",
"sym": "GT"
},
{
"name": "Orange County Railroad",
"value": 100,
"treasury": 40,
"revenue": 0,
"desc": "Starts with $40 in treasury, a 2 train, and a token in Cypress (E10). In ORs, this is the second minor to operate. May only lay or upgrade 1 tile per OR. Splits revenue evenly with owner. May be sold to a corporation for up to $100.",
"sym": "OCR"
},
{
"name": "Pacific Maritime",
"value": 60,
"revenue": 10,
"desc": "Reserves a token slot in Long Beach (E8), in the city next to Norwalk (D9). The owning corporation may place an extra token there at no cost, with no connection needed. Once this company is purchased by a corporation, the slot that was reserved may be used by other corporations.",
"sym": "PMC",
"abilities": [
{
"type": "token",
"when": "owning_corp_or_turn",
"owner_type":"corporation",
"hexes": [
"E8"
],
"city": 2,
"price": 0,
"teleport_price": 0,
"count": 1,
"extra": true
},
{
"type": "reservation",
"remove": "sold",
"hex": "E8",
"city": 2
}
]
},
{
"name": "United States Mail Contract",
"value": 80,
"revenue": 0,
"desc": "Adds $10 per location visited by any one train of the owning corporation. Never closes once purchased by a corporation.",
"sym": "MAIL",
"abilities": [
{
"type": "close",
"when": "never",
"owner_type": "corporation"
}
]
},
{
"name": "Chino Hills Excavation",
"value": 60,
"revenue": 20,
"desc": "Reduces, for the owning corporation, the cost of laying all hill tiles and tunnel/pass hexsides by $20.",
"sym": "CHE",
"abilities": [
{
"type":"tile_discount",
"discount": 20,
"terrain": "mountain",
"owner_type": "corporation"
}
]
},
{
"name": "Los Angeles Citrus",
"value": 60,
"revenue": 15,
"desc": "The owning corporation may assign Los Angeles Citrus to either Riverside (C14) or Port of Long Beach (F7), to add $30 to all routes it runs to this location.",
"sym": "LAC",
"abilities": [
{
"type": "assign_hexes",
"when": "owning_corp_or_turn",
"hexes": [
"C14",
"F7"
],
"count": 1,
"owner_type": "corporation"
},
{
"type": "assign_corporation",
"when": "sold",
"count": 1,
"owner_type": "corporation"
}
]
},
{
"name": "Los Angeles Steamship",
"value": 40,
"revenue": 10,
"desc": "The owning corporation may assign the Los Angeles Steamship to one of Oxnard (B1), Santa Monica (C2), Port of Long Beach (F7), or Westminster (F9), to add $20 per port symbol to all routes it runs to this location.",
"sym": "LAS",
"abilities": [
{
"type": "assign_hexes",
"when": "owning_corp_or_turn",
"hexes": [
"B1",
"C2",
"F7",
"F9"
],
"count_per_or": 1,
"owner_type": "corporation"
},
{
"type": "assign_corporation",
"when": "sold",
"count": 1,
"owner_type": "corporation"
}
]
},
{
"name": "South Bay Line",
"value": 40,
"revenue": 15,
"desc": "The owning corporation may make an extra $0 cost tile upgrade of either Redondo Beach (E4) or Torrance (E6), but not both.",
"sym": "SBL",
"abilities": [
{
"type":"tile_lay",
"when": "owning_corp_or_turn",
"owner_type":"corporation",
"free":true,
"hexes":[
"E4",
"E6"
],
"tiles": [
"14",
"15",
"619"
],
"special": false,
"count": 1
}
]
},
{
"name": "Puente Trolley",
"value": 40,
"revenue": 15,
"desc": "The owning corporation may lay an extra $0 cost yellow tile in Puente (C10), even if they are not connected to Puente.",
"sym": "PT",
"abilities": [
{
"type": "blocks_hexes",
"owner_type": "player",
"hexes": [
"C10"
]
},
{
"type":"tile_lay",
"when": "owning_corp_or_turn",
"owner_type":"corporation",
"free":true,
"hexes":[
"C10"
],
"tiles": [
"7",
"8",
"9"
],
"blocks":false,
"count": 1
}
]
},
{
"name": "Beverly Hills Carriage",
"value": 40,
"revenue": 15,
"desc": "The owning corporation may lay an extra $0 cost yellow tile in Beverly Hills (B3), even if they are not connected to Beverly Hills. Any terrain costs are ignored.",
"sym": "BHC",
"abilities": [
{
"type": "blocks_hexes",
"owner_type": "player",
"hexes": [
"B3"
]
},
{
"type":"tile_lay",
"when": "owning_corp_or_turn",
"owner_type":"corporation",
"free":true,
"hexes":[
"B3"
],
"tiles": [
"7",
"8",
"9"
],
"blocks": false,
"count": 1
}
]
},
{
"name": "Dewey, Cheatham, and Howe",
"value": 40,
"revenue": 10,
"desc": "The owning corporation may place a token (from their charter, paying the normal cost) in a city they are connected to that does not have any open token slots. If a later tile placement adds a new slot, this token fills that slot. This ability may not be used in Long Beach (E8).",
"sym": "DC&H",
"min_players": 3,
"abilities": [
{
"type": "token",
"when": "owning_corp_or_turn",
"owner_type":"corporation",
"count": 1,
"from_owner": true,
"cheater": 0,
"special_only": true,
"discount": 0,
"hexes": [
"A2", "A4", "A6", "A8", "B5", "B7", "B9", "B11", "B13", "C2", "C4",
"C6", "C8", "C12", "D5", "D7", "D9", "D11", "D13", "E4", "E6",
"E10", "E12", "F7", "F9", "F11", "F13"
]
}
]
},
{
"name": "Los Angeles Title",
"value": 40,
"revenue": 10,
"desc": "The owning corporation may place an Open City token in any unreserved slot except for Long Beach (E8). The owning corporation need not be connected to the city where the token is placed.",
"sym": "LAT",
"min_players": 3,
"abilities": [
{
"type": "token",
"when": "owning_corp_or_turn",
"owner_type":"corporation",
"price": 0,
"teleport_price": 0,
"count": 1,
"special_only": true,
"neutral": true,
"hexes": [
"A4", "A6", "A8", "B5", "B7", "B9", "B11", "B13", "C4", "C6", "C8",
"C12", "D5", "D7", "D9", "D11", "D13", "E4", "E6", "E10", "E12",
"F7", "F9", "F11", "F13"
]
}
]
}
],
"minors": [
{
"sym": "GT",
"name": "Gardena Tramway",
"logo": "18_los_angeles/GT",
"tokens": [0],
"coordinates": "D5",
"color": "brown",
"text_color": "white"
},
{
"sym": "OCR",
"name": "Orange County Railroad",
"logo": "18_los_angeles/OCR",
"tokens": [0],
"coordinates": "E10",
"color": "purple",
"text_color": "white"
}
],
"corporations": [
{
"float_percent": 20,
"sym": "ELA",
"name": "East Los Angeles & San Pedro Railroad",
"logo": "18_los_angeles/ELA",
"tokens": [
0,
80,
80,
80,
80,
80
],
"abilities": [
{
"type": "token",
"description": "Reserved $40/$60 Culver City (C4) token",
"hexes": [
"C4"
],
"price": 40,
"teleport_price": 60
},
{
"type": "reservation",
"hex": "C4",
"remove": "IV"
}
],
"coordinates": "C12",
"color": "red",
"always_market_price": true
},
{
"float_percent": 20,
"sym": "LA",
"name": "Los Angeles Railway",
"logo": "18_los_angeles/LA",
"tokens": [
0,
80,
80,
80,
80
],
"abilities": [
{
"type": "token",
"description": "Reserved $40 Alhambra (B9) token",
"hexes": [
"B9"
],
"count": 1,
"price": 40
},
{
"type": "reservation",
"hex": "B9",
"remove": "IV"
}
],
"coordinates": "A8",
"color": "green",
"always_market_price": true
},
{
"float_percent": 20,
"sym": "LAIR",
"name": "Los Angeles and Independence Railroad",
"logo": "18_los_angeles/LAIR",
"tokens": [
0,
80,
80,
80,
80
],
"coordinates": "A2",
"color": "lightBlue",
"text_color": "black",
"always_market_price": true
},
{
"float_percent": 20,
"sym": "PER",
"name": "Pacific Electric Railroad",
"logo": "18_los_angeles/PER",
"tokens": [
0,
80,
80,
80
],
"coordinates": "F13",
"color": "orange",
"text_color": "black",
"always_market_price": true
},
{
"float_percent": 20,
"sym": "SF",
"name": "Santa Fe Railroad",
"logo": "18_los_angeles/SF",
"tokens": [
0,
80,
80,
80,
80
],
"abilities": [
{
"type": "token",
"description": "Reserved $40 Montebello (C8) token",
"hexes": [
"C8"
],
"count": 1,
"price": 40
},
{
"type": "reservation",
"hex": "C8",
"remove": "IV"
}
],
"coordinates": "D13",
"color": "pink",
"text_color": "black",
"always_market_price": true
},
{
"float_percent": 20,
"sym": "SP",
"name": "Southern Pacific Railroad",
"logo": "18_los_angeles/SP",
"tokens": [
0,
80,
80,
80,
80
],
"abilities": [
{
"type": "token",
"description": "Reserved $40/$100 Los Angeles (C6) token",
"hexes": [
"C6"
],
"price": 40,
"count": 1,
"teleport_price": 100
},
{
"type": "reservation",
"hex": "C6",
"remove": "IV"
}
],
"coordinates": "C2",
"color": "blue",
"always_market_price": true
},
{
"float_percent": 20,
"sym": "UP",
"name": "Union Pacific Railroad",
"logo": "18_los_angeles/UP",
"tokens": [
0,
80,
80,
80,
80
],
"coordinates": "B11",
"color": "black",
"always_market_price": true
}
],
"hexes": {
"white": {
"": [
"C10"
],
"upgrade=cost:40,terrain:water": [
"D3"
],
"city=revenue:0;border=edge:0,type:mountain,cost:20": [
"A4"
],
"border=edge:3,type:mountain,cost:20;border=edge:4,type:mountain,cost:20": [
"B3"
],
"city=revenue:0;border=edge:3,type:mountain,cost:20;border=edge:1,type:water,cost:40": [
"B9"
],
"city=revenue:0;border=edge:2,type:mountain,cost:20;border=edge:3,type:mountain,cost:20;label=Z": [
"B13"
],
"city=revenue:0;border=edge:4,type:water,cost:40;border=edge:5,type:water,cost:40": [
"B7"
],
"city=revenue:0;border=edge:2,type:water,cost:40": [
"C8"
],
"city=revenue:0;border=edge:3,type:water,cost:40": [
"D5"
],
"city=revenue:0;upgrade=cost:40,terrain:mountain": [
"C12"
],
"city=revenue:0;border=edge:4,type:water,cost:40;stub=edge:0": [
"D9"
],
"city=revenue:0;border=edge:1,type:water,cost:40": [
"D11"
],
"city=revenue:0;icon=image:18_los_angeles/sbl,sticky:1": [
"E4"
],
"city=revenue:0;icon=image:18_los_angeles/sbl,sticky:1;stub=edge:4": [
"E6"
],
"city=revenue:0;border=edge:0,type:water,cost:40;stub=edge:1": [
"E10"
],
"city=revenue:0;label=Z": [
"E12"
],
"upgrade=cost:40,terrain:mountain;border=edge:5,type:mountain,cost:20": [
"E14"
],
"city=revenue:0": [
"A6",
"C4",
"F11"
],
"city=revenue:0;stub=edge:5": [
"D7"
]
},
"gray": {
"city=revenue:20;path=a:1,b:_0;path=a:2,b:_0;path=a:4,b:_0;path=a:5,b:_0;border=edge:1,type:mountain,cost:20": [
"B5"
],
"city=revenue:10;icon=image:port;icon=image:port;path=a:2,b:_0;path=a:4,b:_0;path=a:5,b:_0;": [
"C2"
],
"city=revenue:20,slots:2;path=a:1,b:_0;path=a:2,b:_0;path=a:4,b:_0;path=a:5,b:_0;": [
"D13"
],
"city=revenue:10;border=edge:3,type:water,cost:40;icon=image:port;icon=image:port;path=a:3,b:_0;path=a:4,b:_0": [
"F9"
],
"path=a:2,b:3": [
"F5"
],
"offboard=revenue:0,visit_cost:100;path=a:0,b:_0": [
"a9"
],
"offboard=revenue:0,visit_cost:100;path=a:2,b:_0": [
"G14"
]
},
"red": {
"city=revenue:yellow_30|brown_50,groups:NW;label=N/W;icon=image:1846/20;path=a:4,b:_0,terminal:1;path=a:5,b:_0,terminal:1": [
"A2"
],
"offboard=revenue:yellow_20|brown_40,groups:N|NW|NE;label=N;border=edge:0,type:mountain,cost:20;border=edge:1,type:mountain,cost:20;border=edge:5,type:mountain,cost:20;icon=image:1846/30;path=a:0,b:_0;path=a:1,b:_0;path=a:5,b:_0": [
"A10"
],
"offboard=revenue:yellow_20|brown_40,groups:N|NW|NE;label=N;border=edge:0,type:mountain,cost:20;border=edge:5,type:mountain,cost:20;icon=image:1846/20;path=a:0,b:_0;path=a:5,b:_0": [
"A12"
],
"offboard=revenue:yellow_20|brown_40,groups:NE;label=N/E;border=edge:0,type:mountain,cost:20;icon=image:1846/20;path=a:0,b:_0": [
"A14"
],
"offboard=revenue:yellow_40|brown_10,groups:W|NW|SW;label=W;icon=image:port;icon=image:1846/30;path=a:4,b:_0;path=a:5,b:_0": [
"B1"
],
"offboard=revenue:yellow_20|brown_50,groups:E|NE|SE;label=E;icon=image:1846/30;path=a:1,b:_0": [
"B15"
],
"offboard=revenue:yellow_30|brown_70,groups:E|NE|SE;label=E;icon=image:1846/30;icon=image:18_los_angeles/meat;path=a:1,b:_0;path=a:2,b:_0": [
"C14"
],
"offboard=revenue:yellow_20|brown_40,groups:E|NE|SE;label=E;icon=image:1846/30;path=a:0,b:_0;path=a:1,b:_0": [
"D15"
],
"offboard=revenue:yellow_20|brown_40,groups:SE;label=S/E;icon=image:1846/20;path=a:1,b:_0": [
"E16"
],
"offboard=revenue:yellow_20|brown_50,groups:SE;label=S/E;border=edge:2,type:mountain,cost:20;path=a:1,b:_0;path=a:2,b:_0;icon=image:1846/20": [
"F15"
],
"offboard=revenue:yellow_20|brown_40,groups:S|SE|SW;label=S;path=a:3,b:_0;icon=image:1846/50;icon=image:18_los_angeles/meat;icon=image:port": [
"F7"
]
},
"yellow": {
"city=revenue:20;path=a:1,b:_0;path=a:5,b:_0;border=edge:4,type:mountain,cost:20": [
"A8"
],
"city=revenue:20;border=edge:2,type:mountain,cost:20;border=edge:3,type:mountain,cost:20;path=a:1,b:_0;path=a:4,b:_0": [
"B11"
],
"city=revenue:40,slots:2;path=a:0,b:_0;path=a:4,b:_0;label=Z;border=edge:0,type:water,cost:40": [
"C6"
],
"city=revenue:10,groups:LongBeach;city=revenue:10,groups:LongBeach;city=revenue:10,groups:LongBeach;city=revenue:10,groups:LongBeach;path=a:1,b:_0;path=a:2,b:_1;path=a:3,b:_2;path=a:4,b:_3;stub=edge:0;label=LB": [
"E8"
],
"city=revenue:20,slots:2;path=a:1,b:_0;path=a:3,b:_0": [
"F13"
]
}
}
}
DATA
end
end
end
end
# rubocop:enable Lint/RedundantCopDisableDirective, Layout/LineLength, Layout/HeredocIndentation
| 26.208614 | 296 | 0.4687 |
1d94c7d3c53c98676e3206b4891bc1c37461aedb | 157 | class CreateFeatureds < ActiveRecord::Migration
def change
create_table :featureds do |t|
t.string :wtp_id
t.timestamps
end
end
end
| 15.7 | 47 | 0.681529 |
6a64499dfc75c4e3bfc74430a878e5fcfa8a63a5 | 39,141 | # 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 WebsecurityscannerV1beta
# Scan authentication configuration.
class Authentication
include Google::Apis::Core::Hashable
# Describes authentication configuration that uses a custom account.
# Corresponds to the JSON property `customAccount`
# @return [Google::Apis::WebsecurityscannerV1beta::CustomAccount]
attr_accessor :custom_account
# Describes authentication configuration that uses a Google account.
# Corresponds to the JSON property `googleAccount`
# @return [Google::Apis::WebsecurityscannerV1beta::GoogleAccount]
attr_accessor :google_account
# Describes authentication configuration for Identity-Aware-Proxy (IAP).
# Corresponds to the JSON property `iapCredential`
# @return [Google::Apis::WebsecurityscannerV1beta::IapCredential]
attr_accessor :iap_credential
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@custom_account = args[:custom_account] if args.key?(:custom_account)
@google_account = args[:google_account] if args.key?(:google_account)
@iap_credential = args[:iap_credential] if args.key?(:iap_credential)
end
end
# A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web
# Security Scanner Service crawls the web applications, following all links
# within the scope of sites, to find the URLs to test against.
class CrawledUrl
include Google::Apis::Core::Hashable
# The body of the request that was used to visit the URL.
# Corresponds to the JSON property `body`
# @return [String]
attr_accessor :body
# The http method of the request that was used to visit the URL, in uppercase.
# Corresponds to the JSON property `httpMethod`
# @return [String]
attr_accessor :http_method
# The URL that was crawled.
# Corresponds to the JSON property `url`
# @return [String]
attr_accessor :url
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@body = args[:body] if args.key?(:body)
@http_method = args[:http_method] if args.key?(:http_method)
@url = args[:url] if args.key?(:url)
end
end
# Describes authentication configuration that uses a custom account.
class CustomAccount
include Google::Apis::Core::Hashable
# Required. The login form URL of the website.
# Corresponds to the JSON property `loginUrl`
# @return [String]
attr_accessor :login_url
# Required. Input only. The password of the custom account. The credential is
# stored encrypted and not returned in any response nor included in audit logs.
# Corresponds to the JSON property `password`
# @return [String]
attr_accessor :password
# Required. The user name of the custom account.
# Corresponds to the JSON property `username`
# @return [String]
attr_accessor :username
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@login_url = args[:login_url] if args.key?(:login_url)
@password = args[:password] if args.key?(:password)
@username = args[:username] if args.key?(:username)
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
# A Finding resource represents a vulnerability instance identified during a
# ScanRun.
class Finding
include Google::Apis::Core::Hashable
# The body of the request that triggered the vulnerability.
# Corresponds to the JSON property `body`
# @return [String]
attr_accessor :body
# The description of the vulnerability.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# The URL where the browser lands when the vulnerability is detected.
# Corresponds to the JSON property `finalUrl`
# @return [String]
attr_accessor :final_url
# The type of the Finding. Detailed and up-to-date information on findings can
# be found here: https://cloud.google.com/security-command-center/docs/how-to-
# remediate-web-security-scanner
# Corresponds to the JSON property `findingType`
# @return [String]
attr_accessor :finding_type
# ! Information about a vulnerability with an HTML.
# Corresponds to the JSON property `form`
# @return [Google::Apis::WebsecurityscannerV1beta::Form]
attr_accessor :form
# If the vulnerability was originated from nested IFrame, the immediate parent
# IFrame is reported.
# Corresponds to the JSON property `frameUrl`
# @return [String]
attr_accessor :frame_url
# The URL produced by the server-side fuzzer and used in the request that
# triggered the vulnerability.
# Corresponds to the JSON property `fuzzedUrl`
# @return [String]
attr_accessor :fuzzed_url
# The http method of the request that triggered the vulnerability, in uppercase.
# Corresponds to the JSON property `httpMethod`
# @return [String]
attr_accessor :http_method
# The resource name of the Finding. The name follows the format of 'projects/`
# projectId`/scanConfigs/`scanConfigId`/scanruns/`scanRunId`/findings/`findingId`
# '. The finding IDs are generated by the system.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Information reported for an outdated library.
# Corresponds to the JSON property `outdatedLibrary`
# @return [Google::Apis::WebsecurityscannerV1beta::OutdatedLibrary]
attr_accessor :outdated_library
# The URL containing human-readable payload that user can leverage to reproduce
# the vulnerability.
# Corresponds to the JSON property `reproductionUrl`
# @return [String]
attr_accessor :reproduction_url
# The severity level of the reported vulnerability.
# Corresponds to the JSON property `severity`
# @return [String]
attr_accessor :severity
# The tracking ID uniquely identifies a vulnerability instance across multiple
# ScanRuns.
# Corresponds to the JSON property `trackingId`
# @return [String]
attr_accessor :tracking_id
# Information regarding any resource causing the vulnerability such as
# JavaScript sources, image, audio files, etc.
# Corresponds to the JSON property `violatingResource`
# @return [Google::Apis::WebsecurityscannerV1beta::ViolatingResource]
attr_accessor :violating_resource
# Information about vulnerable or missing HTTP Headers.
# Corresponds to the JSON property `vulnerableHeaders`
# @return [Google::Apis::WebsecurityscannerV1beta::VulnerableHeaders]
attr_accessor :vulnerable_headers
# Information about vulnerable request parameters.
# Corresponds to the JSON property `vulnerableParameters`
# @return [Google::Apis::WebsecurityscannerV1beta::VulnerableParameters]
attr_accessor :vulnerable_parameters
# Information reported for an XSS.
# Corresponds to the JSON property `xss`
# @return [Google::Apis::WebsecurityscannerV1beta::Xss]
attr_accessor :xss
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@body = args[:body] if args.key?(:body)
@description = args[:description] if args.key?(:description)
@final_url = args[:final_url] if args.key?(:final_url)
@finding_type = args[:finding_type] if args.key?(:finding_type)
@form = args[:form] if args.key?(:form)
@frame_url = args[:frame_url] if args.key?(:frame_url)
@fuzzed_url = args[:fuzzed_url] if args.key?(:fuzzed_url)
@http_method = args[:http_method] if args.key?(:http_method)
@name = args[:name] if args.key?(:name)
@outdated_library = args[:outdated_library] if args.key?(:outdated_library)
@reproduction_url = args[:reproduction_url] if args.key?(:reproduction_url)
@severity = args[:severity] if args.key?(:severity)
@tracking_id = args[:tracking_id] if args.key?(:tracking_id)
@violating_resource = args[:violating_resource] if args.key?(:violating_resource)
@vulnerable_headers = args[:vulnerable_headers] if args.key?(:vulnerable_headers)
@vulnerable_parameters = args[:vulnerable_parameters] if args.key?(:vulnerable_parameters)
@xss = args[:xss] if args.key?(:xss)
end
end
# A FindingTypeStats resource represents stats regarding a specific FindingType
# of Findings under a given ScanRun.
class FindingTypeStats
include Google::Apis::Core::Hashable
# The count of findings belonging to this finding type.
# Corresponds to the JSON property `findingCount`
# @return [Fixnum]
attr_accessor :finding_count
# The finding type associated with the stats.
# Corresponds to the JSON property `findingType`
# @return [String]
attr_accessor :finding_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@finding_count = args[:finding_count] if args.key?(:finding_count)
@finding_type = args[:finding_type] if args.key?(:finding_type)
end
end
# ! Information about a vulnerability with an HTML.
class Form
include Google::Apis::Core::Hashable
# ! The URI where to send the form when it's submitted.
# Corresponds to the JSON property `actionUri`
# @return [String]
attr_accessor :action_uri
# ! The names of form fields related to the vulnerability.
# Corresponds to the JSON property `fields`
# @return [Array<String>]
attr_accessor :fields
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@action_uri = args[:action_uri] if args.key?(:action_uri)
@fields = args[:fields] if args.key?(:fields)
end
end
# Describes authentication configuration that uses a Google account.
class GoogleAccount
include Google::Apis::Core::Hashable
# Required. Input only. The password of the Google account. The credential is
# stored encrypted and not returned in any response nor included in audit logs.
# Corresponds to the JSON property `password`
# @return [String]
attr_accessor :password
# Required. The user name of the Google account.
# Corresponds to the JSON property `username`
# @return [String]
attr_accessor :username
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@password = args[:password] if args.key?(:password)
@username = args[:username] if args.key?(:username)
end
end
# Describes a HTTP Header.
class Header
include Google::Apis::Core::Hashable
# Header name.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Header value.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
@value = args[:value] if args.key?(:value)
end
end
# Describes authentication configuration for Identity-Aware-Proxy (IAP).
class IapCredential
include Google::Apis::Core::Hashable
# Describes authentication configuration when Web-Security-Scanner service
# account is added in Identity-Aware-Proxy (IAP) access policies.
# Corresponds to the JSON property `iapTestServiceAccountInfo`
# @return [Google::Apis::WebsecurityscannerV1beta::IapTestServiceAccountInfo]
attr_accessor :iap_test_service_account_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@iap_test_service_account_info = args[:iap_test_service_account_info] if args.key?(:iap_test_service_account_info)
end
end
# Describes authentication configuration when Web-Security-Scanner service
# account is added in Identity-Aware-Proxy (IAP) access policies.
class IapTestServiceAccountInfo
include Google::Apis::Core::Hashable
# Required. Describes OAuth2 Client ID of resources protected by Identity-Aware-
# Proxy(IAP).
# Corresponds to the JSON property `targetAudienceClientId`
# @return [String]
attr_accessor :target_audience_client_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@target_audience_client_id = args[:target_audience_client_id] if args.key?(:target_audience_client_id)
end
end
# Response for the `ListCrawledUrls` method.
class ListCrawledUrlsResponse
include Google::Apis::Core::Hashable
# The list of CrawledUrls returned.
# Corresponds to the JSON property `crawledUrls`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::CrawledUrl>]
attr_accessor :crawled_urls
# Token to retrieve the next page of results, or empty if there are no more
# results in the list.
# 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)
@crawled_urls = args[:crawled_urls] if args.key?(:crawled_urls)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# Response for the `ListFindingTypeStats` method.
class ListFindingTypeStatsResponse
include Google::Apis::Core::Hashable
# The list of FindingTypeStats returned.
# Corresponds to the JSON property `findingTypeStats`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::FindingTypeStats>]
attr_accessor :finding_type_stats
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@finding_type_stats = args[:finding_type_stats] if args.key?(:finding_type_stats)
end
end
# Response for the `ListFindings` method.
class ListFindingsResponse
include Google::Apis::Core::Hashable
# The list of Findings returned.
# Corresponds to the JSON property `findings`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::Finding>]
attr_accessor :findings
# Token to retrieve the next page of results, or empty if there are no more
# results in the list.
# 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)
@findings = args[:findings] if args.key?(:findings)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# Response for the `ListScanConfigs` method.
class ListScanConfigsResponse
include Google::Apis::Core::Hashable
# Token to retrieve the next page of results, or empty if there are no more
# results in the list.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The list of ScanConfigs returned.
# Corresponds to the JSON property `scanConfigs`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::ScanConfig>]
attr_accessor :scan_configs
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)
@scan_configs = args[:scan_configs] if args.key?(:scan_configs)
end
end
# Response for the `ListScanRuns` method.
class ListScanRunsResponse
include Google::Apis::Core::Hashable
# Token to retrieve the next page of results, or empty if there are no more
# results in the list.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The list of ScanRuns returned.
# Corresponds to the JSON property `scanRuns`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::ScanRun>]
attr_accessor :scan_runs
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)
@scan_runs = args[:scan_runs] if args.key?(:scan_runs)
end
end
# Information reported for an outdated library.
class OutdatedLibrary
include Google::Apis::Core::Hashable
# URLs to learn more information about the vulnerabilities in the library.
# Corresponds to the JSON property `learnMoreUrls`
# @return [Array<String>]
attr_accessor :learn_more_urls
# The name of the outdated library.
# Corresponds to the JSON property `libraryName`
# @return [String]
attr_accessor :library_name
# The version number.
# 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)
@learn_more_urls = args[:learn_more_urls] if args.key?(:learn_more_urls)
@library_name = args[:library_name] if args.key?(:library_name)
@version = args[:version] if args.key?(:version)
end
end
# A ScanConfig resource contains the configurations to launch a scan.
class ScanConfig
include Google::Apis::Core::Hashable
# Scan authentication configuration.
# Corresponds to the JSON property `authentication`
# @return [Google::Apis::WebsecurityscannerV1beta::Authentication]
attr_accessor :authentication
# The excluded URL patterns as described in https://cloud.google.com/security-
# command-center/docs/how-to-use-web-security-scanner#excluding_urls
# Corresponds to the JSON property `blacklistPatterns`
# @return [Array<String>]
attr_accessor :blacklist_patterns
# Required. The user provided display name of the ScanConfig.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Controls export of scan configurations and results to Security Command Center.
# Corresponds to the JSON property `exportToSecurityCommandCenter`
# @return [String]
attr_accessor :export_to_security_command_center
# Whether to keep scanning even if most requests return HTTP error codes.
# Corresponds to the JSON property `ignoreHttpStatusErrors`
# @return [Boolean]
attr_accessor :ignore_http_status_errors
alias_method :ignore_http_status_errors?, :ignore_http_status_errors
# A ScanRun is a output-only resource representing an actual run of the scan.
# Next id: 12
# Corresponds to the JSON property `latestRun`
# @return [Google::Apis::WebsecurityscannerV1beta::ScanRun]
attr_accessor :latest_run
# Whether the scan config is managed by Web Security Scanner, output only.
# Corresponds to the JSON property `managedScan`
# @return [Boolean]
attr_accessor :managed_scan
alias_method :managed_scan?, :managed_scan
# The maximum QPS during scanning. A valid value ranges from 5 to 20 inclusively.
# If the field is unspecified or its value is set 0, server will default to 15.
# Other values outside of [5, 20] range will be rejected with INVALID_ARGUMENT
# error.
# Corresponds to the JSON property `maxQps`
# @return [Fixnum]
attr_accessor :max_qps
# The resource name of the ScanConfig. The name follows the format of 'projects/`
# projectId`/scanConfigs/`scanConfigId`'. The ScanConfig IDs are generated by
# the system.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The risk level selected for the scan
# Corresponds to the JSON property `riskLevel`
# @return [String]
attr_accessor :risk_level
# Scan schedule configuration.
# Corresponds to the JSON property `schedule`
# @return [Google::Apis::WebsecurityscannerV1beta::Schedule]
attr_accessor :schedule
# Required. The starting URLs from which the scanner finds site pages.
# Corresponds to the JSON property `startingUrls`
# @return [Array<String>]
attr_accessor :starting_urls
# Whether the scan configuration has enabled static IP address scan feature. If
# enabled, the scanner will access applications from static IP addresses.
# Corresponds to the JSON property `staticIpScan`
# @return [Boolean]
attr_accessor :static_ip_scan
alias_method :static_ip_scan?, :static_ip_scan
# Set of Google Cloud platforms targeted by the scan. If empty, APP_ENGINE will
# be used as a default.
# Corresponds to the JSON property `targetPlatforms`
# @return [Array<String>]
attr_accessor :target_platforms
# The user agent used during scanning.
# Corresponds to the JSON property `userAgent`
# @return [String]
attr_accessor :user_agent
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@authentication = args[:authentication] if args.key?(:authentication)
@blacklist_patterns = args[:blacklist_patterns] if args.key?(:blacklist_patterns)
@display_name = args[:display_name] if args.key?(:display_name)
@export_to_security_command_center = args[:export_to_security_command_center] if args.key?(:export_to_security_command_center)
@ignore_http_status_errors = args[:ignore_http_status_errors] if args.key?(:ignore_http_status_errors)
@latest_run = args[:latest_run] if args.key?(:latest_run)
@managed_scan = args[:managed_scan] if args.key?(:managed_scan)
@max_qps = args[:max_qps] if args.key?(:max_qps)
@name = args[:name] if args.key?(:name)
@risk_level = args[:risk_level] if args.key?(:risk_level)
@schedule = args[:schedule] if args.key?(:schedule)
@starting_urls = args[:starting_urls] if args.key?(:starting_urls)
@static_ip_scan = args[:static_ip_scan] if args.key?(:static_ip_scan)
@target_platforms = args[:target_platforms] if args.key?(:target_platforms)
@user_agent = args[:user_agent] if args.key?(:user_agent)
end
end
# Defines a custom error message used by CreateScanConfig and UpdateScanConfig
# APIs when scan configuration validation fails. It is also reported as part of
# a ScanRunErrorTrace message if scan validation fails due to a scan
# configuration error.
class ScanConfigError
include Google::Apis::Core::Hashable
# Indicates the reason code for a configuration failure.
# Corresponds to the JSON property `code`
# @return [String]
attr_accessor :code
# Indicates the full name of the ScanConfig field that triggers this error, for
# example "scan_config.max_qps". This field is provided for troubleshooting
# purposes only and its actual value can change in the future.
# Corresponds to the JSON property `fieldName`
# @return [String]
attr_accessor :field_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@field_name = args[:field_name] if args.key?(:field_name)
end
end
# A ScanRun is a output-only resource representing an actual run of the scan.
# Next id: 12
class ScanRun
include Google::Apis::Core::Hashable
# The time at which the ScanRun reached termination state - that the ScanRun is
# either finished or stopped by user.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# Output only. Defines an error trace message for a ScanRun.
# Corresponds to the JSON property `errorTrace`
# @return [Google::Apis::WebsecurityscannerV1beta::ScanRunErrorTrace]
attr_accessor :error_trace
# The execution state of the ScanRun.
# Corresponds to the JSON property `executionState`
# @return [String]
attr_accessor :execution_state
# Whether the scan run has found any vulnerabilities.
# Corresponds to the JSON property `hasVulnerabilities`
# @return [Boolean]
attr_accessor :has_vulnerabilities
alias_method :has_vulnerabilities?, :has_vulnerabilities
# The resource name of the ScanRun. The name follows the format of 'projects/`
# projectId`/scanConfigs/`scanConfigId`/scanRuns/`scanRunId`'. The ScanRun IDs
# are generated by the system.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The percentage of total completion ranging from 0 to 100. If the scan is in
# queue, the value is 0. If the scan is running, the value ranges from 0 to 100.
# If the scan is finished, the value is 100.
# Corresponds to the JSON property `progressPercent`
# @return [Fixnum]
attr_accessor :progress_percent
# The result state of the ScanRun. This field is only available after the
# execution state reaches "FINISHED".
# Corresponds to the JSON property `resultState`
# @return [String]
attr_accessor :result_state
# The time at which the ScanRun started.
# Corresponds to the JSON property `startTime`
# @return [String]
attr_accessor :start_time
# The number of URLs crawled during this ScanRun. If the scan is in progress,
# the value represents the number of URLs crawled up to now.
# Corresponds to the JSON property `urlsCrawledCount`
# @return [Fixnum]
attr_accessor :urls_crawled_count
# The number of URLs tested during this ScanRun. If the scan is in progress, the
# value represents the number of URLs tested up to now. The number of URLs
# tested is usually larger than the number URLS crawled because typically a
# crawled URL is tested with multiple test payloads.
# Corresponds to the JSON property `urlsTestedCount`
# @return [Fixnum]
attr_accessor :urls_tested_count
# A list of warnings, if such are encountered during this scan run.
# Corresponds to the JSON property `warningTraces`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::ScanRunWarningTrace>]
attr_accessor :warning_traces
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@end_time = args[:end_time] if args.key?(:end_time)
@error_trace = args[:error_trace] if args.key?(:error_trace)
@execution_state = args[:execution_state] if args.key?(:execution_state)
@has_vulnerabilities = args[:has_vulnerabilities] if args.key?(:has_vulnerabilities)
@name = args[:name] if args.key?(:name)
@progress_percent = args[:progress_percent] if args.key?(:progress_percent)
@result_state = args[:result_state] if args.key?(:result_state)
@start_time = args[:start_time] if args.key?(:start_time)
@urls_crawled_count = args[:urls_crawled_count] if args.key?(:urls_crawled_count)
@urls_tested_count = args[:urls_tested_count] if args.key?(:urls_tested_count)
@warning_traces = args[:warning_traces] if args.key?(:warning_traces)
end
end
# Output only. Defines an error trace message for a ScanRun.
class ScanRunErrorTrace
include Google::Apis::Core::Hashable
# Indicates the error reason code.
# Corresponds to the JSON property `code`
# @return [String]
attr_accessor :code
# If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
# common HTTP error code, if such is available. For example, if this code is 404,
# the scan has encountered too many NOT_FOUND responses.
# Corresponds to the JSON property `mostCommonHttpErrorCode`
# @return [Fixnum]
attr_accessor :most_common_http_error_code
# Defines a custom error message used by CreateScanConfig and UpdateScanConfig
# APIs when scan configuration validation fails. It is also reported as part of
# a ScanRunErrorTrace message if scan validation fails due to a scan
# configuration error.
# Corresponds to the JSON property `scanConfigError`
# @return [Google::Apis::WebsecurityscannerV1beta::ScanConfigError]
attr_accessor :scan_config_error
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@most_common_http_error_code = args[:most_common_http_error_code] if args.key?(:most_common_http_error_code)
@scan_config_error = args[:scan_config_error] if args.key?(:scan_config_error)
end
end
# Output only. Defines a warning trace message for ScanRun. Warning traces
# provide customers with useful information that helps make the scanning process
# more effective.
class ScanRunWarningTrace
include Google::Apis::Core::Hashable
# Indicates the warning code.
# Corresponds to the JSON property `code`
# @return [String]
attr_accessor :code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
end
end
# Scan schedule configuration.
class Schedule
include Google::Apis::Core::Hashable
# Required. The duration of time between executions in days.
# Corresponds to the JSON property `intervalDurationDays`
# @return [Fixnum]
attr_accessor :interval_duration_days
# A timestamp indicates when the next run will be scheduled. The value is
# refreshed by the server after each run. If unspecified, it will default to
# current server time, which means the scan will be scheduled to start
# immediately.
# Corresponds to the JSON property `scheduleTime`
# @return [String]
attr_accessor :schedule_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@interval_duration_days = args[:interval_duration_days] if args.key?(:interval_duration_days)
@schedule_time = args[:schedule_time] if args.key?(:schedule_time)
end
end
# Request for the `StartScanRun` method.
class StartScanRunRequest
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Request for the `StopScanRun` method.
class StopScanRunRequest
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Information regarding any resource causing the vulnerability such as
# JavaScript sources, image, audio files, etc.
class ViolatingResource
include Google::Apis::Core::Hashable
# The MIME type of this resource.
# Corresponds to the JSON property `contentType`
# @return [String]
attr_accessor :content_type
# URL of this violating resource.
# Corresponds to the JSON property `resourceUrl`
# @return [String]
attr_accessor :resource_url
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@content_type = args[:content_type] if args.key?(:content_type)
@resource_url = args[:resource_url] if args.key?(:resource_url)
end
end
# Information about vulnerable or missing HTTP Headers.
class VulnerableHeaders
include Google::Apis::Core::Hashable
# List of vulnerable headers.
# Corresponds to the JSON property `headers`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::Header>]
attr_accessor :headers
# List of missing headers.
# Corresponds to the JSON property `missingHeaders`
# @return [Array<Google::Apis::WebsecurityscannerV1beta::Header>]
attr_accessor :missing_headers
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@headers = args[:headers] if args.key?(:headers)
@missing_headers = args[:missing_headers] if args.key?(:missing_headers)
end
end
# Information about vulnerable request parameters.
class VulnerableParameters
include Google::Apis::Core::Hashable
# The vulnerable parameter names.
# Corresponds to the JSON property `parameterNames`
# @return [Array<String>]
attr_accessor :parameter_names
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@parameter_names = args[:parameter_names] if args.key?(:parameter_names)
end
end
# Information reported for an XSS.
class Xss
include Google::Apis::Core::Hashable
# An error message generated by a javascript breakage.
# Corresponds to the JSON property `errorMessage`
# @return [String]
attr_accessor :error_message
# Stack traces leading to the point where the XSS occurred.
# Corresponds to the JSON property `stackTraces`
# @return [Array<String>]
attr_accessor :stack_traces
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@error_message = args[:error_message] if args.key?(:error_message)
@stack_traces = args[:stack_traces] if args.key?(:stack_traces)
end
end
end
end
end
| 38.98506 | 136 | 0.629519 |
2630d74c2c36520406ea22ac7175c254fa5be8ea | 2,618 | require "spec_helper"
RSpec.describe Search::BaseRegistry do
before do
@index = double("elasticsearch index")
@base_registry = described_class.new(@index, sample_field_definitions, "example-format")
end
def example_document
{
"content_id" => "example-content-id",
"slug" => "example-document",
"link" => "/government/example-document",
"title" => "Example document",
}
end
it "uses time as default clock" do
# This is to make sure the cache expiry is expressed in seconds; DateTime,
# for example, treats number addition as a number of days.
expect(Search::TimedCache).to receive(:new).with(an_instance_of(Integer), Time)
described_class.new(@index, sample_field_definitions, "example-format")
end
it "can fetch document series by slug" do
allow(@index).to receive(:documents_by_format)
.with("example-format", anything)
.and_return([example_document])
fetched_document = @base_registry["example-document"]
expect(example_document).to eq(fetched_document)
end
it "only required fields are requested from index" do
expect(@index).to receive(:documents_by_format)
.with("example-format", sample_field_definitions(%w[slug link title content_id]))
@base_registry["example-document"]
end
it "returns nil if document collection not found" do
allow(@index).to receive(:documents_by_format)
.with("example-format", anything)
.and_return([example_document])
expect(@base_registry["non-existent-document"]).to be_nil
end
it "document enumerator is traversed only once" do
document_enumerator = double("enumerator")
expect(document_enumerator).to receive(:to_a).once.and_return([example_document])
allow(@index).to receive(:documents_by_format)
.with("example-format", anything)
.once
.and_return(document_enumerator)
expect(@base_registry["example-document"]).to be_truthy
expect(@base_registry["example-document"]).to be_truthy
end
it "uses cache" do
# Make sure we're using TimedCache#get; TimedCache is tested elsewhere, so
# we don't need to worry about cache expiry tests here.
expect_any_instance_of(Search::TimedCache).to receive(:get).with(no_args).and_return([example_document])
expect(@base_registry["example-document"]).to be_truthy
end
it "find by content_id" do
allow(@index).to receive(:documents_by_format)
.with("example-format", anything)
.and_return([example_document])
expect(
@base_registry.by_content_id("example-content-id"),
).to eq(example_document)
end
end
| 34.447368 | 108 | 0.713522 |
b95a51600b69ef5bffa5328f5b11dbc5ba90efb5 | 131 | require 'test_helper'
class MaterialMediaTypeTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 16.375 | 53 | 0.725191 |
e8ccb703ed98f42bc7ec85833f8d76aa71a1295e | 1,734 | require 'test_helper'
class EPaymentPlansHelperTest < Test::Unit::TestCase
include ActiveMerchant::Billing::Integrations
def setup
@helper = EPaymentPlans::Helper.new('order-500','[email protected]', :amount => 500, :currency => 'USD')
end
def test_basic_helper_fields
assert_field 'order[account]', '[email protected]'
assert_field 'order[amount]', '500'
assert_field 'order[num]', 'order-500'
end
def test_customer_fields
@helper.customer :first_name => 'Cody', :last_name => 'Fauser', :email => '[email protected]'
assert_field 'order[first_name]', 'Cody'
assert_field 'order[last_name]', 'Fauser'
assert_field 'order[email]', '[email protected]'
end
def test_address_mapping
@helper.billing_address :address1 => '1 My Street',
:address2 => '',
:company => 'Shopify',
:city => 'Leeds',
:state => 'Yorkshire',
:zip => 'LS2 7EE',
:country => 'CA'
assert_field 'order[address1]', '1 My Street'
assert_field 'order[city]', 'Leeds'
assert_field 'order[company]', 'Shopify'
assert_field 'order[state]', 'Yorkshire'
assert_field 'order[zip]', 'LS2 7EE'
end
def test_unknown_address_mapping
@helper.billing_address :farm => 'CA'
assert_equal 3, @helper.fields.size
end
def test_unknown_mapping
assert_nothing_raised do
@helper.company_address :address => '500 Dwemthy Fox Road'
end
end
def test_setting_invalid_address_field
fields = @helper.fields.dup
@helper.billing_address :street => 'My Street'
assert_equal fields, @helper.fields
end
end
| 30.421053 | 107 | 0.624567 |
abfeb66d229515515cf2c6e2d1d88b199627bc04 | 661 | # frozen_string_literal: true
require "yaml"
require "ht_sip_validator/validator_config"
module HathiTrust # rubocop:disable Style/ClassAndModuleChildren
# Represents a configuration for a set of Validators
class Configuration
attr_reader :config
def initialize(config_file_handle)
@config = YAML.load(config_file_handle.read) || {}
end
def package_checks
config_section_checks("package_checks")
end
def file_checks
config_section_checks("file_checks")
end
private
def config_section_checks(type)
(config[type] || [])
.map {|config| ValidatorConfig.new(config) }
end
end
end
| 20.65625 | 64 | 0.712557 |
62407ca021f0307e9052e5586f72aa0da6ebc2eb | 2,019 | # frozen_string_literal: true
require 'spec_helper'
feature Sponsor do
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
shared_examples 'sponsors' do
scenario 'adds and updates sponsors', feature: true, js: true do
path = "#{Rails.root}/app/assets/images/rails.png"
conference.sponsorship_levels << create(:sponsorship_level, conference: conference)
sign_in organizer
visit admin_conference_sponsors_path(
conference_id: conference.short_title)
# Add sponsors
click_link 'Add Sponsor'
fill_in 'sponsor_name', with: 'SUSE'
fill_in 'sponsor_description', with: 'The original provider of the enterprise Linux distribution'
attach_file 'Picture', path
fill_in 'sponsor_website_url', with: 'http://www.suse.com'
select(conference.sponsorship_levels.first.title, from: 'sponsor_sponsorship_level_id')
click_button 'Create Sponsor'
expect(flash).to eq('Sponsor successfully created.')
within('table#sponsors') do
expect(page.has_content?('SUSE')).to be true
expect(page.has_content?('The original provider')).to be true
expect(page.has_content?('http://www.suse.com')).to be true
expect(page.has_content?(conference.sponsorship_levels.first.title)).to be true
expect(page).to have_selector("img[src*='rails.png']")
expect(page.assert_selector('tr', count: 2)).to be true
end
# Remove sponsor
visit admin_conference_sponsors_path(
conference_id: conference.short_title
)
within('table#sponsors') do
page.accept_confirm do
click_link 'Delete'
end
end
expect(flash).to eq('Sponsor successfully deleted.')
expect(page).to_not have_selector('table#sponsors')
end
end
describe 'organizer' do
it_behaves_like 'sponsors'
end
end
| 34.810345 | 103 | 0.684993 |
bf507d1aead0e2440f38f45d2ed3be49fc11eda9 | 540 | class Zone
INVALID = -1
CREATED = 0
PLAY = 1
DECK = 2
HAND = 3
GRAVEYARD = 4
REMOVEDFROMGAME = 5
SETASIDE = 6
SECRET = 7
class << self
def parse(value)
values.fetch(value, value)
end
def values
{
'INVALID' => INVALID,
'CREATED' => CREATED,
'PLAY' => PLAY,
'DECK' => DECK,
'HAND' => HAND,
'GRAVEYARD' => GRAVEYARD,
'REMOVEDFROMGAME' => REMOVEDFROMGAME,
'SETASIDE' => SETASIDE,
'SECRET' => SECRET,
}
end
end
end
| 16.875 | 45 | 0.507407 |
621628b5097589fcdc82c94ff7c72e47696ec3e7 | 3,787 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2016_06_01
module Models
#
# Path rule of URL path map of application gateway
#
class ApplicationGatewayPathRule < SubResource
include MsRestAzure
# @return [Array<String>] Path rules of URL path map
attr_accessor :paths
# @return [SubResource] Backend address pool resource of URL path map
attr_accessor :backend_address_pool
# @return [SubResource] Backend http settings resource of URL path map
attr_accessor :backend_http_settings
# @return [String] Path rule of URL path map resource
# Updating/Deleting/Failed
attr_accessor :provisioning_state
# @return [String] Name of the resource that is unique within a resource
# group. This name can be used to access the resource
attr_accessor :name
# @return [String] A unique read-only string that changes whenever the
# resource is updated
attr_accessor :etag
#
# Mapper for ApplicationGatewayPathRule class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ApplicationGatewayPathRule',
type: {
name: 'Composite',
class_name: 'ApplicationGatewayPathRule',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
paths: {
client_side_validation: true,
required: false,
serialized_name: 'properties.paths',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
backend_address_pool: {
client_side_validation: true,
required: false,
serialized_name: 'properties.backendAddressPool',
type: {
name: 'Composite',
class_name: 'SubResource'
}
},
backend_http_settings: {
client_side_validation: true,
required: false,
serialized_name: 'properties.backendHttpSettings',
type: {
name: 'Composite',
class_name: 'SubResource'
}
},
provisioning_state: {
client_side_validation: true,
required: false,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
etag: {
client_side_validation: true,
required: false,
serialized_name: 'etag',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
| 30.788618 | 78 | 0.493795 |
bf7ffec628135548f9b8bc28af76379a7d4d433e | 1,641 | module Blazer
class Engine < ::Rails::Engine
isolate_namespace Blazer
initializer "blazer" do |app|
# use a proc instead of a string
app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff)\z/ }
app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
Blazer.time_zone ||= Blazer.settings["time_zone"] || Time.zone
Blazer.audit = Blazer.settings.key?("audit") ? Blazer.settings["audit"] : true
Blazer.user_name = Blazer.settings["user_name"] if Blazer.settings["user_name"]
Blazer.from_email = Blazer.settings["from_email"] if Blazer.settings["from_email"]
Blazer.before_action = Blazer.settings["before_action_method"] if Blazer.settings["before_action_method"]
Blazer.check_schedules = Blazer.settings["check_schedules"] if Blazer.settings.key?("check_schedules")
Blazer.cache ||= Rails.cache
Blazer.anomaly_checks = Blazer.settings["anomaly_checks"] || false
Blazer.forecasting = Blazer.settings["forecasting"] || false
Blazer.async = Blazer.settings["async"] || false
if Blazer.async
require "blazer/run_statement_job"
end
Blazer.images = Blazer.settings["images"] || false
Blazer.override_csp = Blazer.settings["override_csp"] || false
Blazer.slack_webhook_url = Blazer.settings["slack_webhook_url"] || ENV["BLAZER_SLACK_WEBHOOK_URL"]
Blazer.mapbox_access_token = Blazer.settings["mapbox_access_token"] || ENV["MAPBOX_ACCESS_TOKEN"]
end
end
end
| 49.727273 | 111 | 0.69287 |
79f98547705f3f7a970a423fa73ca9bae4f93218 | 110 | class AddIndexToGroupsName < ActiveRecord::Migration[6.0]
def change
add_index :groups, :name
end
end
| 18.333333 | 57 | 0.745455 |
086962be6b0eaf8a816e0632310d16ad4d500338 | 7,342 | require 'spec_helper'
module Aws
module Partitions
describe 'Partitions' do
describe '.partition' do
%w(aws aws-cn aws-us-gov).each do |p|
it "can return a partition by name: #{p.inspect}" do
partition = Aws.partition(p)
expect(partition).to be_kind_of(Partition)
expect(partition.name).to eq(p)
end
end
it 'raises ArgumentError on unknown partition names' do
expect {
Aws.partition('fake-name')
}.to raise_error(ArgumentError, /invalid partition name/)
end
end
describe '.partitions' do
it 'returns a list of Partition objects' do
partitions = Aws.partitions
expect(partitions.map(&:name).sort).to eq(%w(aws aws-cn aws-us-gov).sort)
partitions.each do |p|
expect(p).to be_kind_of(Partition)
end
end
end
describe Partition do
describe '#name' do
it 'returns the partition name' do
expect(Aws.partition('aws').name).to eq('aws')
end
end
describe '#region' do
it 'gets a region by name' do
region = Aws.partition('aws').region('us-east-1')
expect(region).to be_kind_of(Partitions::Region)
expect(region.name).to eq('us-east-1')
end
it 'returns a list of supported services with the region' do
region = Aws.partition('aws').region('us-east-1')
expect(region.services).to include('EC2')
expect(region.services).not_to include('Route53')
end
it 'raises ArgumentError for unknown regions' do
expect {
Aws.partition('aws').region('us-EAST-1') # wrong format
}.to raise_error(ArgumentError, /invalid region name/)
end
it 'provides a list of valid region names in the argument error' do
expect {
Aws.partition('aws').region('fake-region')
}.to raise_error(ArgumentError, /us-east-1, /)
end
end
describe '#regions' do
it 'returns an array of Region objects' do
expect(Aws.partition('aws').regions).to be_kind_of(Array)
end
it 'includes regions from the current partition' do
{
'aws' => 'us-east-1',
'aws-cn' => 'cn-north-1',
'aws-us-gov' => 'us-gov-west-1',
}.each_pair do |p, r|
expect(Aws.partition(p).regions.map(&:name)).to include(r)
end
end
it 'does not include the partition global endpoint name' do
regions = Aws.partition('aws').regions
expect(regions.map(&:name)).not_to include('aws-global')
end
end
describe '#service' do
Aws::SERVICE_MODULE_NAMES.each do |svc_name|
next if svc_name == 'CloudSearchDomain'
it "can return a service by name: #{svc_name}" do
service = Aws.partition('aws').service(svc_name)
expect(service).to be_kind_of(Partitions::Service)
expect(service.name).to eq(svc_name)
end
end
it 'raises ArgumentError for unknown regions' do
expect {
Aws.partition('aws').region('us-EAST-1') # wrong format
}.to raise_error(ArgumentError, /invalid region name/)
end
it 'provides a list of valid region names in the argument error' do
expect {
Aws.partition('aws').region('fake-region')
}.to raise_error(ArgumentError, /us-east-1, /)
end
end
describe '#services' do
it 'returns a list of supported services' do
services = Aws.partition('aws').services.map(&:name)
Aws::SERVICE_MODULE_NAMES.each do |svc_name|
expect(services).to include(svc_name)
end
end
end
end
describe Region do
it '#name returns the region name' do
region = Aws.partition('aws').region('us-east-1')
expect(region.name).to eq('us-east-1')
end
it '#description returns the region name' do
region = Aws.partition('aws').region('us-east-1')
expect(region.description).to eq('US East (N. Virginia)')
end
it '#partition_name returns the partition name' do
region = Aws.partition('aws').region('us-east-1')
expect(region.partition_name).to eq('aws')
end
it '#services returns the list of services available in region' do
region = Aws.partition('aws').region('us-east-1')
expect(region.services).to include('EC2')
expect(region.services).not_to include('Route53')
end
end
describe Service do
it '#name returns the service name' do
expect(Aws.partition('aws').service('IAM').name).to eq('IAM')
end
it '#partition_name returns the parition name' do
expect(Aws.partition('aws').service('IAM').partition_name).to eq('aws')
end
it '#regions returns partition regions for the service' do
expect(Aws.partition('aws').service('IAM').partition_name).to eq('aws')
end
it '#partition_region returns the partition global endpoint region' do
svc = Aws.partition('aws').service('IAM')
expect(svc.partition_region).to eq('aws-global')
svc = Aws.partition('aws-cn').service('IAM')
expect(svc.partition_region).to eq('aws-cn-global')
svc = Aws.partition('aws').service('EC2')
expect(svc.partition_region).to be(nil)
end
it '#regionalized? returns true if the service is regionalized' do
svc = Aws.partition('aws').service('IAM')
expect(svc.regionalized?).to be(false)
svc = Aws.partition('aws').service('EC2')
expect(svc.regionalized?).to be(true)
end
it '#regions returns the list of regions the service is available in' do
svc = Aws.partition('aws').service('IAM')
expect(svc.regions.sort).to eq([])
expect(svc.partition_region).to eq('aws-global')
svc = Aws.partition('aws').service('EC2')
expect(svc.regions).not_to include('aws-global')
expect(svc.regions).to include('us-east-1')
expect(svc.regions).to include('us-west-1')
expect(svc.regions).to include('us-west-2')
end
end
describe 'symmetry' do
Aws.partitions.each do |partition|
partition.services.each do |service|
service.regions.each do |region|
it "#{partition.name} : service #{service.name} : region #{region}" do
expect(partition.region(region).services).to include(service.name)
end
end
end
partition.regions.each do |region|
region.services.each do |service|
it "#{partition.name} : region #{region.name} : service #{service}" do
expect(partition.service(service).regions).to include(region.name)
end
end
end
end
end
end
end
end
| 32.061135 | 84 | 0.565377 |
030b3e74101c8809e13517421f486617e8479b0f | 1,057 | require_relative '../test_helper'
module SmartAnswer
class PostcodeQuestionTest < ActiveSupport::TestCase
def setup
@initial_state = State.new(:example)
@question = Question::Postcode.new(nil, :example) do
save_input_as :my_postcode
next_node { outcome :done }
end
end
test "valid postcode" do
new_state = @question.transition(@initial_state, "W1A 2AB")
assert_equal "W1A 2AB", new_state.my_postcode
end
test "abnormal postcode" do
new_state = @question.transition(@initial_state, "w1A2ab")
assert_equal "W1A 2AB", new_state.my_postcode
end
test "incomplete postcode" do
e = assert_raises InvalidResponse do
@question.transition(@initial_state, "W1A")
end
assert_equal "error_postcode_incomplete", e.message
end
test "invalid postcode" do
e = assert_raises InvalidResponse do
@question.transition(@initial_state, "invalid-postcode")
end
assert_equal "error_postcode_invalid", e.message
end
end
end
| 27.815789 | 65 | 0.683065 |
d50b27b27549f69b06c2c18a0b3dcab1ee2d2f2b | 315,524 | # WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
require 'aws-sdk-core/plugins/logging.rb'
require 'aws-sdk-core/plugins/param_converter.rb'
require 'aws-sdk-core/plugins/param_validator.rb'
require 'aws-sdk-core/plugins/user_agent.rb'
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
require 'aws-sdk-core/plugins/retry_errors.rb'
require 'aws-sdk-core/plugins/global_configuration.rb'
require 'aws-sdk-core/plugins/regional_endpoint.rb'
require 'aws-sdk-core/plugins/response_paging.rb'
require 'aws-sdk-core/plugins/stub_responses.rb'
require 'aws-sdk-core/plugins/idempotency_token.rb'
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
require 'aws-sdk-core/plugins/signature_v4.rb'
require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
Aws::Plugins::GlobalConfiguration.add_identifier(:ssm)
module Aws::SSM
class Client < Seahorse::Client::Base
include Aws::ClientStubs
@identifier = :ssm
set_api(ClientApi::API)
add_plugin(Seahorse::Client::Plugins::ContentLength)
add_plugin(Aws::Plugins::CredentialsConfiguration)
add_plugin(Aws::Plugins::Logging)
add_plugin(Aws::Plugins::ParamConverter)
add_plugin(Aws::Plugins::ParamValidator)
add_plugin(Aws::Plugins::UserAgent)
add_plugin(Aws::Plugins::HelpfulSocketErrors)
add_plugin(Aws::Plugins::RetryErrors)
add_plugin(Aws::Plugins::GlobalConfiguration)
add_plugin(Aws::Plugins::RegionalEndpoint)
add_plugin(Aws::Plugins::ResponsePaging)
add_plugin(Aws::Plugins::StubResponses)
add_plugin(Aws::Plugins::IdempotencyToken)
add_plugin(Aws::Plugins::JsonvalueConverter)
add_plugin(Aws::Plugins::SignatureV4)
add_plugin(Aws::Plugins::Protocols::JsonRpc)
# @option options [required, Aws::CredentialProvider] :credentials
# Your AWS credentials. This can be an instance of any one of the
# following classes:
#
# * `Aws::Credentials` - Used for configuring static, non-refreshing
# credentials.
#
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
# from an EC2 IMDS on an EC2 instance.
#
# * `Aws::SharedCredentials` - Used for loading credentials from a
# shared file, such as `~/.aws/config`.
#
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
#
# When `:credentials` are not configured directly, the following
# locations will be searched for credentials:
#
# * `Aws.config[:credentials]`
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
# * `~/.aws/credentials`
# * `~/.aws/config`
# * EC2 IMDS instance profile - When used by default, the timeouts are
# very aggressive. Construct and pass an instance of
# `Aws::InstanceProfileCredentails` to enable retries and extended
# timeouts.
#
# @option options [required, String] :region
# The AWS region to connect to. The configured `:region` is
# used to determine the service `:endpoint`. When not passed,
# a default `:region` is search for in the following locations:
#
# * `Aws.config[:region]`
# * `ENV['AWS_REGION']`
# * `ENV['AMAZON_REGION']`
# * `ENV['AWS_DEFAULT_REGION']`
# * `~/.aws/credentials`
# * `~/.aws/config`
#
# @option options [String] :access_key_id
#
# @option options [Boolean] :convert_params (true)
# When `true`, an attempt is made to coerce request parameters into
# the required types.
#
# @option options [String] :endpoint
# The client endpoint is normally constructed from the `:region`
# option. You should only configure an `:endpoint` when connecting
# to test endpoints. This should be avalid HTTP(S) URI.
#
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
# The log formatter.
#
# @option options [Symbol] :log_level (:info)
# The log level to send messages to the `:logger` at.
#
# @option options [Logger] :logger
# The Logger instance to send log messages to. If this option
# is not set, logging will be disabled.
#
# @option options [String] :profile ("default")
# Used when loading credentials from the shared credentials file
# at HOME/.aws/credentials. When not specified, 'default' is used.
#
# @option options [Float] :retry_base_delay (0.3)
# The base delay in seconds used by the default backoff function.
#
# @option options [Symbol] :retry_jitter (:none)
# A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
#
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
#
# @option options [Integer] :retry_limit (3)
# The maximum number of times to retry failed requests. Only
# ~ 500 level server errors and certain ~ 400 level client errors
# are retried. Generally, these are throttling errors, data
# checksum errors, networking errors, timeout errors and auth
# errors from expired credentials.
#
# @option options [Integer] :retry_max_delay (0)
# The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
#
# @option options [String] :secret_access_key
#
# @option options [String] :session_token
#
# @option options [Boolean] :simple_json (false)
# Disables request parameter conversion, validation, and formatting.
# Also disable response data type conversions. This option is useful
# when you want to ensure the highest level of performance by
# avoiding overhead of walking request parameters and response data
# structures.
#
# When `:simple_json` is enabled, the request parameters hash must
# be formatted exactly as the DynamoDB API expects.
#
# @option options [Boolean] :stub_responses (false)
# Causes the client to return stubbed responses. By default
# fake responses are generated and returned. You can specify
# the response data to return or errors to raise by calling
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
#
# ** Please note ** When response stubbing is enabled, no HTTP
# requests are made, and retries are disabled.
#
# @option options [Boolean] :validate_params (true)
# When `true`, request parameters are validated before
# sending the request.
#
def initialize(*args)
super
end
# @!group API Operations
# Adds or overwrites one or more tags for the specified resource. Tags
# are metadata that you can assign to your documents, managed instances,
# Maintenance Windows, Parameter Store parameters, and patch baselines.
# Tags enable you to categorize your resources in different ways, for
# example, by purpose, owner, or environment. Each tag consists of a key
# and an optional value, both of which you define. For example, you
# could define a set of tags for your account's managed instances that
# helps you track each instance's owner and stack level. For example:
# Key=Owner and Value=DbAdmin, SysAdmin, or Dev. Or Key=Stack and
# Value=Production, Pre-Production, or Test.
#
# Each resource can have a maximum of 50 tags.
#
# We recommend that you devise a set of tag keys that meets your needs
# for each resource type. Using a consistent set of tag keys makes it
# easier for you to manage your resources. You can search and filter the
# resources based on the tags you add. Tags don't have any semantic
# meaning to Amazon EC2 and are interpreted strictly as a string of
# characters.
#
# For more information about tags, see [Tagging Your Amazon EC2
# Resources][1] in the *Amazon EC2 User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html
#
# @option params [required, String] :resource_type
# Specifies the type of resource you are tagging.
#
# <note markdown="1"> The ManagedInstance type for this API action is for on-premises
# managed instances. You must specify the the name of the managed
# instance in the following format: mi-ID\_number. For example,
# mi-1a2b3c4d5e6f.
#
# </note>
#
# @option params [required, String] :resource_id
# The resource ID you want to tag.
#
# Use the ID of the resource. Here are some examples:
#
# ManagedInstance: mi-012345abcde
#
# MaintenanceWindow: mw-012345abcde
#
# PatchBaseline: pb-012345abcde
#
# For the Document and Parameter values, use the name of the resource.
#
# <note markdown="1"> The ManagedInstance type for this API action is only for on-premises
# managed instances. You must specify the the name of the managed
# instance in the following format: mi-ID\_number. For example,
# mi-1a2b3c4d5e6f.
#
# </note>
#
# @option params [required, Array<Types::Tag>] :tags
# One or more tags. The value parameter is required, but if you don't
# want the tag to have a value, specify the parameter with no value, and
# we set the value to an empty string.
#
# Do not enter personally identifiable information in this field.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.add_tags_to_resource({
# resource_type: "Document", # required, accepts Document, ManagedInstance, MaintenanceWindow, Parameter, PatchBaseline
# resource_id: "ResourceId", # required
# tags: [ # required
# {
# key: "TagKey", # required
# value: "TagValue", # required
# },
# ],
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/AddTagsToResource AWS API Documentation
#
# @overload add_tags_to_resource(params = {})
# @param [Hash] params ({})
def add_tags_to_resource(params = {}, options = {})
req = build_request(:add_tags_to_resource, params)
req.send_request(options)
end
# Attempts to cancel the command specified by the Command ID. There is
# no guarantee that the command will be terminated and the underlying
# process stopped.
#
# @option params [required, String] :command_id
# The ID of the command you want to cancel.
#
# @option params [Array<String>] :instance_ids
# (Optional) A list of instance IDs on which you want to cancel the
# command. If not provided, the command is canceled on every instance on
# which it was requested.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.cancel_command({
# command_id: "CommandId", # required
# instance_ids: ["InstanceId"],
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommand AWS API Documentation
#
# @overload cancel_command(params = {})
# @param [Hash] params ({})
def cancel_command(params = {}, options = {})
req = build_request(:cancel_command, params)
req.send_request(options)
end
# Registers your on-premises server or virtual machine with Amazon EC2
# so that you can manage these resources using Run Command. An
# on-premises server or virtual machine that has been registered with
# EC2 is called a managed instance. For more information about
# activations, see [Setting Up Systems Manager in Hybrid
# Environments][1].
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html
#
# @option params [String] :description
# A user-defined description of the resource that you want to register
# with Amazon EC2.
#
# Do not enter personally identifiable information in this field.
#
# @option params [String] :default_instance_name
# The name of the registered, managed instance as it will appear in the
# Amazon EC2 console or when you use the AWS command line tools to list
# EC2 resources.
#
# Do not enter personally identifiable information in this field.
#
# @option params [required, String] :iam_role
# The Amazon Identity and Access Management (IAM) role that you want to
# assign to the managed instance.
#
# @option params [Integer] :registration_limit
# Specify the maximum number of managed instances you want to register.
# The default value is 1 instance.
#
# @option params [Time,DateTime,Date,Integer,String] :expiration_date
# The date by which this activation request should expire. The default
# value is 24 hours.
#
# @return [Types::CreateActivationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreateActivationResult#activation_id #activation_id} => String
# * {Types::CreateActivationResult#activation_code #activation_code} => String
#
# @example Request syntax with placeholder values
#
# resp = client.create_activation({
# description: "ActivationDescription",
# default_instance_name: "DefaultInstanceName",
# iam_role: "IamRole", # required
# registration_limit: 1,
# expiration_date: Time.now,
# })
#
# @example Response structure
#
# resp.activation_id #=> String
# resp.activation_code #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateActivation AWS API Documentation
#
# @overload create_activation(params = {})
# @param [Hash] params ({})
def create_activation(params = {}, options = {})
req = build_request(:create_activation, params)
req.send_request(options)
end
# Associates the specified Systems Manager document with the specified
# instances or targets.
#
# When you associate a document with one or more instances using
# instance IDs or tags, the SSM Agent running on the instance processes
# the document and configures the instance as specified.
#
# If you associate a document with an instance that already has an
# associated document, the system throws the AssociationAlreadyExists
# exception.
#
# @option params [required, String] :name
# The name of the Systems Manager document.
#
# @option params [String] :document_version
# The document version you want to associate with the target(s). Can be
# a specific version or the default version.
#
# @option params [String] :instance_id
# The instance ID.
#
# @option params [Hash<String,Array>] :parameters
# The parameters for the documents runtime configuration.
#
# @option params [Array<Types::Target>] :targets
# The targets (either instances or tags) for the association.
#
# @option params [String] :schedule_expression
# A cron expression when the association will be applied to the
# target(s).
#
# @option params [Types::InstanceAssociationOutputLocation] :output_location
# An Amazon S3 bucket where you want to store the output details of the
# request.
#
# @option params [String] :association_name
# Specify a descriptive name for the association.
#
# @return [Types::CreateAssociationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreateAssociationResult#association_description #association_description} => Types::AssociationDescription
#
# @example Request syntax with placeholder values
#
# resp = client.create_association({
# name: "DocumentName", # required
# document_version: "DocumentVersion",
# instance_id: "InstanceId",
# parameters: {
# "ParameterName" => ["ParameterValue"],
# },
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# schedule_expression: "ScheduleExpression",
# output_location: {
# s3_location: {
# output_s3_region: "S3Region",
# output_s3_bucket_name: "S3BucketName",
# output_s3_key_prefix: "S3KeyPrefix",
# },
# },
# association_name: "AssociationName",
# })
#
# @example Response structure
#
# resp.association_description.name #=> String
# resp.association_description.instance_id #=> String
# resp.association_description.association_version #=> String
# resp.association_description.date #=> Time
# resp.association_description.last_update_association_date #=> Time
# resp.association_description.status.date #=> Time
# resp.association_description.status.name #=> String, one of "Pending", "Success", "Failed"
# resp.association_description.status.message #=> String
# resp.association_description.status.additional_info #=> String
# resp.association_description.overview.status #=> String
# resp.association_description.overview.detailed_status #=> String
# resp.association_description.overview.association_status_aggregated_count #=> Hash
# resp.association_description.overview.association_status_aggregated_count["StatusName"] #=> Integer
# resp.association_description.document_version #=> String
# resp.association_description.parameters #=> Hash
# resp.association_description.parameters["ParameterName"] #=> Array
# resp.association_description.parameters["ParameterName"][0] #=> String
# resp.association_description.association_id #=> String
# resp.association_description.targets #=> Array
# resp.association_description.targets[0].key #=> String
# resp.association_description.targets[0].values #=> Array
# resp.association_description.targets[0].values[0] #=> String
# resp.association_description.schedule_expression #=> String
# resp.association_description.output_location.s3_location.output_s3_region #=> String
# resp.association_description.output_location.s3_location.output_s3_bucket_name #=> String
# resp.association_description.output_location.s3_location.output_s3_key_prefix #=> String
# resp.association_description.last_execution_date #=> Time
# resp.association_description.last_successful_execution_date #=> Time
# resp.association_description.association_name #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociation AWS API Documentation
#
# @overload create_association(params = {})
# @param [Hash] params ({})
def create_association(params = {}, options = {})
req = build_request(:create_association, params)
req.send_request(options)
end
# Associates the specified Systems Manager document with the specified
# instances or targets.
#
# When you associate a document with one or more instances using
# instance IDs or tags, the SSM Agent running on the instance processes
# the document and configures the instance as specified.
#
# If you associate a document with an instance that already has an
# associated document, the system throws the AssociationAlreadyExists
# exception.
#
# @option params [required, Array<Types::CreateAssociationBatchRequestEntry>] :entries
# One or more associations.
#
# @return [Types::CreateAssociationBatchResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreateAssociationBatchResult#successful #successful} => Array<Types::AssociationDescription>
# * {Types::CreateAssociationBatchResult#failed #failed} => Array<Types::FailedCreateAssociation>
#
# @example Request syntax with placeholder values
#
# resp = client.create_association_batch({
# entries: [ # required
# {
# name: "DocumentName", # required
# instance_id: "InstanceId",
# parameters: {
# "ParameterName" => ["ParameterValue"],
# },
# document_version: "DocumentVersion",
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# schedule_expression: "ScheduleExpression",
# output_location: {
# s3_location: {
# output_s3_region: "S3Region",
# output_s3_bucket_name: "S3BucketName",
# output_s3_key_prefix: "S3KeyPrefix",
# },
# },
# association_name: "AssociationName",
# },
# ],
# })
#
# @example Response structure
#
# resp.successful #=> Array
# resp.successful[0].name #=> String
# resp.successful[0].instance_id #=> String
# resp.successful[0].association_version #=> String
# resp.successful[0].date #=> Time
# resp.successful[0].last_update_association_date #=> Time
# resp.successful[0].status.date #=> Time
# resp.successful[0].status.name #=> String, one of "Pending", "Success", "Failed"
# resp.successful[0].status.message #=> String
# resp.successful[0].status.additional_info #=> String
# resp.successful[0].overview.status #=> String
# resp.successful[0].overview.detailed_status #=> String
# resp.successful[0].overview.association_status_aggregated_count #=> Hash
# resp.successful[0].overview.association_status_aggregated_count["StatusName"] #=> Integer
# resp.successful[0].document_version #=> String
# resp.successful[0].parameters #=> Hash
# resp.successful[0].parameters["ParameterName"] #=> Array
# resp.successful[0].parameters["ParameterName"][0] #=> String
# resp.successful[0].association_id #=> String
# resp.successful[0].targets #=> Array
# resp.successful[0].targets[0].key #=> String
# resp.successful[0].targets[0].values #=> Array
# resp.successful[0].targets[0].values[0] #=> String
# resp.successful[0].schedule_expression #=> String
# resp.successful[0].output_location.s3_location.output_s3_region #=> String
# resp.successful[0].output_location.s3_location.output_s3_bucket_name #=> String
# resp.successful[0].output_location.s3_location.output_s3_key_prefix #=> String
# resp.successful[0].last_execution_date #=> Time
# resp.successful[0].last_successful_execution_date #=> Time
# resp.successful[0].association_name #=> String
# resp.failed #=> Array
# resp.failed[0].entry.name #=> String
# resp.failed[0].entry.instance_id #=> String
# resp.failed[0].entry.parameters #=> Hash
# resp.failed[0].entry.parameters["ParameterName"] #=> Array
# resp.failed[0].entry.parameters["ParameterName"][0] #=> String
# resp.failed[0].entry.document_version #=> String
# resp.failed[0].entry.targets #=> Array
# resp.failed[0].entry.targets[0].key #=> String
# resp.failed[0].entry.targets[0].values #=> Array
# resp.failed[0].entry.targets[0].values[0] #=> String
# resp.failed[0].entry.schedule_expression #=> String
# resp.failed[0].entry.output_location.s3_location.output_s3_region #=> String
# resp.failed[0].entry.output_location.s3_location.output_s3_bucket_name #=> String
# resp.failed[0].entry.output_location.s3_location.output_s3_key_prefix #=> String
# resp.failed[0].entry.association_name #=> String
# resp.failed[0].message #=> String
# resp.failed[0].fault #=> String, one of "Client", "Server", "Unknown"
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatch AWS API Documentation
#
# @overload create_association_batch(params = {})
# @param [Hash] params ({})
def create_association_batch(params = {}, options = {})
req = build_request(:create_association_batch, params)
req.send_request(options)
end
# Creates a Systems Manager document.
#
# After you create a document, you can use CreateAssociation to
# associate it with one or more running instances.
#
# @option params [required, String] :content
# A valid JSON or YAML string.
#
# @option params [required, String] :name
# A name for the Systems Manager document.
#
# Do not use the following to begin the names of documents you create.
# They are reserved by AWS for use as document prefixes:
#
# * `aws`
#
# * `amazon`
#
# * `amzn`
#
# @option params [String] :document_type
# The type of document to create. Valid document types include: Policy,
# Automation, and Command.
#
# @option params [String] :document_format
# Specify the document format for the request. The document format can
# be either JSON or YAML. JSON is the default format.
#
# @option params [String] :target_type
# Specify a target type to define the kinds of resources the document
# can run on. For example, to run a document on EC2 instances, specify
# the following value: /AWS::EC2::Instance. If you specify a value of
# '/' the document can run on all types of resources. If you don't
# specify a value, the document can't run on any resources. For a list
# of valid resource types, see [AWS Resource Types Reference][1] in the
# *AWS CloudFormation User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
#
# @return [Types::CreateDocumentResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreateDocumentResult#document_description #document_description} => Types::DocumentDescription
#
# @example Request syntax with placeholder values
#
# resp = client.create_document({
# content: "DocumentContent", # required
# name: "DocumentName", # required
# document_type: "Command", # accepts Command, Policy, Automation
# document_format: "YAML", # accepts YAML, JSON
# target_type: "TargetType",
# })
#
# @example Response structure
#
# resp.document_description.sha_1 #=> String
# resp.document_description.hash #=> String
# resp.document_description.hash_type #=> String, one of "Sha256", "Sha1"
# resp.document_description.name #=> String
# resp.document_description.owner #=> String
# resp.document_description.created_date #=> Time
# resp.document_description.status #=> String, one of "Creating", "Active", "Updating", "Deleting"
# resp.document_description.document_version #=> String
# resp.document_description.description #=> String
# resp.document_description.parameters #=> Array
# resp.document_description.parameters[0].name #=> String
# resp.document_description.parameters[0].type #=> String, one of "String", "StringList"
# resp.document_description.parameters[0].description #=> String
# resp.document_description.parameters[0].default_value #=> String
# resp.document_description.platform_types #=> Array
# resp.document_description.platform_types[0] #=> String, one of "Windows", "Linux"
# resp.document_description.document_type #=> String, one of "Command", "Policy", "Automation"
# resp.document_description.schema_version #=> String
# resp.document_description.latest_version #=> String
# resp.document_description.default_version #=> String
# resp.document_description.document_format #=> String, one of "YAML", "JSON"
# resp.document_description.target_type #=> String
# resp.document_description.tags #=> Array
# resp.document_description.tags[0].key #=> String
# resp.document_description.tags[0].value #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocument AWS API Documentation
#
# @overload create_document(params = {})
# @param [Hash] params ({})
def create_document(params = {}, options = {})
req = build_request(:create_document, params)
req.send_request(options)
end
# Creates a new Maintenance Window.
#
# @option params [required, String] :name
# The name of the Maintenance Window.
#
# @option params [String] :description
# An optional description for the Maintenance Window. We recommend
# specifying a description to help you organize your Maintenance
# Windows.
#
# @option params [required, String] :schedule
# The schedule of the Maintenance Window in the form of a cron or rate
# expression.
#
# @option params [required, Integer] :duration
# The duration of the Maintenance Window in hours.
#
# @option params [required, Integer] :cutoff
# The number of hours before the end of the Maintenance Window that
# Systems Manager stops scheduling new tasks for execution.
#
# @option params [required, Boolean] :allow_unassociated_targets
# Enables a Maintenance Window task to execute on managed instances,
# even if you have not registered those instances as targets. If
# enabled, then you must specify the unregistered instances (by instance
# ID) when you register a task with the Maintenance Window
#
# If you don't enable this option, then you must specify
# previously-registered targets when you register a task with the
# Maintenance Window.
#
# @option params [String] :client_token
# User-provided idempotency token.
#
# **A suitable default value is auto-generated.** You should normally
# not need to pass this option.**
#
# @return [Types::CreateMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreateMaintenanceWindowResult#window_id #window_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.create_maintenance_window({
# name: "MaintenanceWindowName", # required
# description: "MaintenanceWindowDescription",
# schedule: "MaintenanceWindowSchedule", # required
# duration: 1, # required
# cutoff: 1, # required
# allow_unassociated_targets: false, # required
# client_token: "ClientToken",
# })
#
# @example Response structure
#
# resp.window_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindow AWS API Documentation
#
# @overload create_maintenance_window(params = {})
# @param [Hash] params ({})
def create_maintenance_window(params = {}, options = {})
req = build_request(:create_maintenance_window, params)
req.send_request(options)
end
# Creates a patch baseline.
#
# <note markdown="1"> For information about valid key and value pairs in `PatchFilters` for
# each supported operating system type, see [PatchFilter][1].
#
# </note>
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html
#
# @option params [String] :operating_system
# Defines the operating system the patch baseline applies to. The
# Default value is WINDOWS.
#
# @option params [required, String] :name
# The name of the patch baseline.
#
# @option params [Types::PatchFilterGroup] :global_filters
# A set of global filters used to exclude patches from the baseline.
#
# @option params [Types::PatchRuleGroup] :approval_rules
# A set of rules used to include patches in the baseline.
#
# @option params [Array<String>] :approved_patches
# A list of explicitly approved patches for the baseline.
#
# For information about accepted formats for lists of approved patches
# and rejected patches, see [Package Name Formats for Approved and
# Rejected Patch Lists][1] in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html
#
# @option params [String] :approved_patches_compliance_level
# Defines the compliance level for approved patches. This means that if
# an approved patch is reported as missing, this is the severity of the
# compliance violation. The default value is UNSPECIFIED.
#
# @option params [Boolean] :approved_patches_enable_non_security
# Indicates whether the list of approved patches includes non-security
# updates that should be applied to the instances. The default value is
# 'false'. Applies to Linux instances only.
#
# @option params [Array<String>] :rejected_patches
# A list of explicitly rejected patches for the baseline.
#
# For information about accepted formats for lists of approved patches
# and rejected patches, see [Package Name Formats for Approved and
# Rejected Patch Lists][1] in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html
#
# @option params [String] :description
# A description of the patch baseline.
#
# @option params [Array<Types::PatchSource>] :sources
# Information about the patches to use to update the instances,
# including target operating systems and source repositories. Applies to
# Linux instances only.
#
# @option params [String] :client_token
# User-provided idempotency token.
#
# **A suitable default value is auto-generated.** You should normally
# not need to pass this option.**
#
# @return [Types::CreatePatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::CreatePatchBaselineResult#baseline_id #baseline_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.create_patch_baseline({
# operating_system: "WINDOWS", # accepts WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, UBUNTU, REDHAT_ENTERPRISE_LINUX, SUSE, CENTOS
# name: "BaselineName", # required
# global_filters: {
# patch_filters: [ # required
# {
# key: "PRODUCT", # required, accepts PRODUCT, CLASSIFICATION, MSRC_SEVERITY, PATCH_ID, SECTION, PRIORITY, SEVERITY
# values: ["PatchFilterValue"], # required
# },
# ],
# },
# approval_rules: {
# patch_rules: [ # required
# {
# patch_filter_group: { # required
# patch_filters: [ # required
# {
# key: "PRODUCT", # required, accepts PRODUCT, CLASSIFICATION, MSRC_SEVERITY, PATCH_ID, SECTION, PRIORITY, SEVERITY
# values: ["PatchFilterValue"], # required
# },
# ],
# },
# compliance_level: "CRITICAL", # accepts CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED
# approve_after_days: 1, # required
# enable_non_security: false,
# },
# ],
# },
# approved_patches: ["PatchId"],
# approved_patches_compliance_level: "CRITICAL", # accepts CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED
# approved_patches_enable_non_security: false,
# rejected_patches: ["PatchId"],
# description: "BaselineDescription",
# sources: [
# {
# name: "PatchSourceName", # required
# products: ["PatchSourceProduct"], # required
# configuration: "PatchSourceConfiguration", # required
# },
# ],
# client_token: "ClientToken",
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaseline AWS API Documentation
#
# @overload create_patch_baseline(params = {})
# @param [Hash] params ({})
def create_patch_baseline(params = {}, options = {})
req = build_request(:create_patch_baseline, params)
req.send_request(options)
end
# Creates a resource data sync configuration to a single bucket in
# Amazon S3. This is an asynchronous operation that returns immediately.
# After a successful initial sync is completed, the system continuously
# syncs data to the Amazon S3 bucket. To check the status of the sync,
# use the ListResourceDataSync.
#
# By default, data is not encrypted in Amazon S3. We strongly recommend
# that you enable encryption in Amazon S3 to ensure secure data storage.
# We also recommend that you secure access to the Amazon S3 bucket by
# creating a restrictive bucket policy. To view an example of a
# restrictive Amazon S3 bucket policy for Resource Data Sync, see
# [Create a Resource Data Sync for Inventory][1] in the *AWS Systems
# Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync-create.html
#
# @option params [required, String] :sync_name
# A name for the configuration.
#
# @option params [required, Types::ResourceDataSyncS3Destination] :s3_destination
# Amazon S3 configuration details for the sync.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.create_resource_data_sync({
# sync_name: "ResourceDataSyncName", # required
# s3_destination: { # required
# bucket_name: "ResourceDataSyncS3BucketName", # required
# prefix: "ResourceDataSyncS3Prefix",
# sync_format: "JsonSerDe", # required, accepts JsonSerDe
# region: "ResourceDataSyncS3Region", # required
# awskms_key_arn: "ResourceDataSyncAWSKMSKeyARN",
# },
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateResourceDataSync AWS API Documentation
#
# @overload create_resource_data_sync(params = {})
# @param [Hash] params ({})
def create_resource_data_sync(params = {}, options = {})
req = build_request(:create_resource_data_sync, params)
req.send_request(options)
end
# Deletes an activation. You are not required to delete an activation.
# If you delete an activation, you can no longer use it to register
# additional managed instances. Deleting an activation does not
# de-register managed instances. You must manually de-register managed
# instances.
#
# @option params [required, String] :activation_id
# The ID of the activation that you want to delete.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_activation({
# activation_id: "ActivationId", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteActivation AWS API Documentation
#
# @overload delete_activation(params = {})
# @param [Hash] params ({})
def delete_activation(params = {}, options = {})
req = build_request(:delete_activation, params)
req.send_request(options)
end
# Disassociates the specified Systems Manager document from the
# specified instance.
#
# When you disassociate a document from an instance, it does not change
# the configuration of the instance. To change the configuration state
# of an instance after you disassociate a document, you must create a
# new document with the desired configuration and associate it with the
# instance.
#
# @option params [String] :name
# The name of the Systems Manager document.
#
# @option params [String] :instance_id
# The ID of the instance.
#
# @option params [String] :association_id
# The association ID that you want to delete.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_association({
# name: "DocumentName",
# instance_id: "InstanceId",
# association_id: "AssociationId",
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteAssociation AWS API Documentation
#
# @overload delete_association(params = {})
# @param [Hash] params ({})
def delete_association(params = {}, options = {})
req = build_request(:delete_association, params)
req.send_request(options)
end
# Deletes the Systems Manager document and all instance associations to
# the document.
#
# Before you delete the document, we recommend that you use
# DeleteAssociation to disassociate all instances that are associated
# with the document.
#
# @option params [required, String] :name
# The name of the document.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_document({
# name: "DocumentName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocument AWS API Documentation
#
# @overload delete_document(params = {})
# @param [Hash] params ({})
def delete_document(params = {}, options = {})
req = build_request(:delete_document, params)
req.send_request(options)
end
# Delete a custom inventory type, or the data associated with a custom
# Inventory type. Deleting a custom inventory type is also referred to
# as deleting a custom inventory schema.
#
# @option params [required, String] :type_name
# The name of the custom inventory type for which you want to delete
# either all previously collected data, or the inventory type itself.
#
# @option params [String] :schema_delete_option
# Use the `SchemaDeleteOption` to delete a custom inventory type
# (schema). If you don't choose this option, the system only deletes
# existing inventory data associated with the custom inventory type.
# Choose one of the following options:
#
# DisableSchema: If you choose this option, the system ignores all
# inventory data for the specified version, and any earlier versions. To
# enable this schema again, you must call the `PutInventory` action for
# a version greater than the disbled version.
#
# DeleteSchema: This option deletes the specified custom type from the
# Inventory service. You can recreate the schema later, if you want.
#
# @option params [Boolean] :dry_run
# Use this option to view a summary of the deletion request without
# deleting any data or the data type. This option is useful when you
# only want to understand what will be deleted. Once you validate that
# the data to be deleted is what you intend to delete, you can run the
# same command without specifying the `DryRun` option.
#
# @option params [String] :client_token
# User-provided idempotency token.
#
# **A suitable default value is auto-generated.** You should normally
# not need to pass this option.**
#
# @return [Types::DeleteInventoryResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeleteInventoryResult#deletion_id #deletion_id} => String
# * {Types::DeleteInventoryResult#type_name #type_name} => String
# * {Types::DeleteInventoryResult#deletion_summary #deletion_summary} => Types::InventoryDeletionSummary
#
# @example Request syntax with placeholder values
#
# resp = client.delete_inventory({
# type_name: "InventoryItemTypeName", # required
# schema_delete_option: "DisableSchema", # accepts DisableSchema, DeleteSchema
# dry_run: false,
# client_token: "ClientToken",
# })
#
# @example Response structure
#
# resp.deletion_id #=> String
# resp.type_name #=> String
# resp.deletion_summary.total_count #=> Integer
# resp.deletion_summary.remaining_count #=> Integer
# resp.deletion_summary.summary_items #=> Array
# resp.deletion_summary.summary_items[0].version #=> String
# resp.deletion_summary.summary_items[0].count #=> Integer
# resp.deletion_summary.summary_items[0].remaining_count #=> Integer
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteInventory AWS API Documentation
#
# @overload delete_inventory(params = {})
# @param [Hash] params ({})
def delete_inventory(params = {}, options = {})
req = build_request(:delete_inventory, params)
req.send_request(options)
end
# Deletes a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window to delete.
#
# @return [Types::DeleteMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeleteMaintenanceWindowResult#window_id #window_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.delete_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# })
#
# @example Response structure
#
# resp.window_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteMaintenanceWindow AWS API Documentation
#
# @overload delete_maintenance_window(params = {})
# @param [Hash] params ({})
def delete_maintenance_window(params = {}, options = {})
req = build_request(:delete_maintenance_window, params)
req.send_request(options)
end
# Delete a parameter from the system.
#
# @option params [required, String] :name
# The name of the parameter to delete.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_parameter({
# name: "PSParameterName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameter AWS API Documentation
#
# @overload delete_parameter(params = {})
# @param [Hash] params ({})
def delete_parameter(params = {}, options = {})
req = build_request(:delete_parameter, params)
req.send_request(options)
end
# Delete a list of parameters. This API is used to delete parameters by
# using the Amazon EC2 console.
#
# @option params [required, Array<String>] :names
# The names of the parameters to delete.
#
# @return [Types::DeleteParametersResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeleteParametersResult#deleted_parameters #deleted_parameters} => Array<String>
# * {Types::DeleteParametersResult#invalid_parameters #invalid_parameters} => Array<String>
#
# @example Request syntax with placeholder values
#
# resp = client.delete_parameters({
# names: ["PSParameterName"], # required
# })
#
# @example Response structure
#
# resp.deleted_parameters #=> Array
# resp.deleted_parameters[0] #=> String
# resp.invalid_parameters #=> Array
# resp.invalid_parameters[0] #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameters AWS API Documentation
#
# @overload delete_parameters(params = {})
# @param [Hash] params ({})
def delete_parameters(params = {}, options = {})
req = build_request(:delete_parameters, params)
req.send_request(options)
end
# Deletes a patch baseline.
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline to delete.
#
# @return [Types::DeletePatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeletePatchBaselineResult#baseline_id #baseline_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.delete_patch_baseline({
# baseline_id: "BaselineId", # required
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaseline AWS API Documentation
#
# @overload delete_patch_baseline(params = {})
# @param [Hash] params ({})
def delete_patch_baseline(params = {}, options = {})
req = build_request(:delete_patch_baseline, params)
req.send_request(options)
end
# Deletes a Resource Data Sync configuration. After the configuration is
# deleted, changes to inventory data on managed instances are no longer
# synced with the target Amazon S3 bucket. Deleting a sync configuration
# does not delete data in the target Amazon S3 bucket.
#
# @option params [required, String] :sync_name
# The name of the configuration to delete.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_resource_data_sync({
# sync_name: "ResourceDataSyncName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteResourceDataSync AWS API Documentation
#
# @overload delete_resource_data_sync(params = {})
# @param [Hash] params ({})
def delete_resource_data_sync(params = {}, options = {})
req = build_request(:delete_resource_data_sync, params)
req.send_request(options)
end
# Removes the server or virtual machine from the list of registered
# servers. You can reregister the instance again at any time. If you
# don't plan to use Run Command on the server, we suggest uninstalling
# SSM Agent first.
#
# @option params [required, String] :instance_id
# The ID assigned to the managed instance when you registered it using
# the activation process.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.deregister_managed_instance({
# instance_id: "ManagedInstanceId", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstance AWS API Documentation
#
# @overload deregister_managed_instance(params = {})
# @param [Hash] params ({})
def deregister_managed_instance(params = {}, options = {})
req = build_request(:deregister_managed_instance, params)
req.send_request(options)
end
# Removes a patch group from a patch baseline.
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline to deregister the patch group from.
#
# @option params [required, String] :patch_group
# The name of the patch group that should be deregistered from the patch
# baseline.
#
# @return [Types::DeregisterPatchBaselineForPatchGroupResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeregisterPatchBaselineForPatchGroupResult#baseline_id #baseline_id} => String
# * {Types::DeregisterPatchBaselineForPatchGroupResult#patch_group #patch_group} => String
#
# @example Request syntax with placeholder values
#
# resp = client.deregister_patch_baseline_for_patch_group({
# baseline_id: "BaselineId", # required
# patch_group: "PatchGroup", # required
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
# resp.patch_group #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroup AWS API Documentation
#
# @overload deregister_patch_baseline_for_patch_group(params = {})
# @param [Hash] params ({})
def deregister_patch_baseline_for_patch_group(params = {}, options = {})
req = build_request(:deregister_patch_baseline_for_patch_group, params)
req.send_request(options)
end
# Removes a target from a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window the target should be removed from.
#
# @option params [required, String] :window_target_id
# The ID of the target definition to remove.
#
# @option params [Boolean] :safe
# The system checks if the target is being referenced by a task. If the
# target is being referenced, the system returns an error and does not
# deregister the target from the Maintenance Window.
#
# @return [Types::DeregisterTargetFromMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeregisterTargetFromMaintenanceWindowResult#window_id #window_id} => String
# * {Types::DeregisterTargetFromMaintenanceWindowResult#window_target_id #window_target_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.deregister_target_from_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# window_target_id: "MaintenanceWindowTargetId", # required
# safe: false,
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.window_target_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTargetFromMaintenanceWindow AWS API Documentation
#
# @overload deregister_target_from_maintenance_window(params = {})
# @param [Hash] params ({})
def deregister_target_from_maintenance_window(params = {}, options = {})
req = build_request(:deregister_target_from_maintenance_window, params)
req.send_request(options)
end
# Removes a task from a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window the task should be removed from.
#
# @option params [required, String] :window_task_id
# The ID of the task to remove from the Maintenance Window.
#
# @return [Types::DeregisterTaskFromMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeregisterTaskFromMaintenanceWindowResult#window_id #window_id} => String
# * {Types::DeregisterTaskFromMaintenanceWindowResult#window_task_id #window_task_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.deregister_task_from_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# window_task_id: "MaintenanceWindowTaskId", # required
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.window_task_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindow AWS API Documentation
#
# @overload deregister_task_from_maintenance_window(params = {})
# @param [Hash] params ({})
def deregister_task_from_maintenance_window(params = {}, options = {})
req = build_request(:deregister_task_from_maintenance_window, params)
req.send_request(options)
end
# Details about the activation, including: the date and time the
# activation was created, the expiration date, the IAM role assigned to
# the instances in the activation, and the number of instances activated
# by this registration.
#
# @option params [Array<Types::DescribeActivationsFilter>] :filters
# A filter to view information about your activations.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @return [Types::DescribeActivationsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeActivationsResult#activation_list #activation_list} => Array<Types::Activation>
# * {Types::DescribeActivationsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_activations({
# filters: [
# {
# filter_key: "ActivationIds", # accepts ActivationIds, DefaultInstanceName, IamRole
# filter_values: ["String"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.activation_list #=> Array
# resp.activation_list[0].activation_id #=> String
# resp.activation_list[0].description #=> String
# resp.activation_list[0].default_instance_name #=> String
# resp.activation_list[0].iam_role #=> String
# resp.activation_list[0].registration_limit #=> Integer
# resp.activation_list[0].registrations_count #=> Integer
# resp.activation_list[0].expiration_date #=> Time
# resp.activation_list[0].expired #=> Boolean
# resp.activation_list[0].created_date #=> Time
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivations AWS API Documentation
#
# @overload describe_activations(params = {})
# @param [Hash] params ({})
def describe_activations(params = {}, options = {})
req = build_request(:describe_activations, params)
req.send_request(options)
end
# Describes the association for the specified target or instance. If you
# created the association by using the `Targets` parameter, then you
# must retrieve the association by using the association ID. If you
# created the association by specifying an instance ID and a Systems
# Manager document, then you retrieve the association by specifying the
# document name and the instance ID.
#
# @option params [String] :name
# The name of the Systems Manager document.
#
# @option params [String] :instance_id
# The instance ID.
#
# @option params [String] :association_id
# The association ID for which you want information.
#
# @option params [String] :association_version
# Specify the association version to retrieve. To view the latest
# version, either specify `$LATEST` for this parameter, or omit this
# parameter. To view a list of all associations for an instance, use
# ListInstanceAssociations. To get a list of versions for a specific
# association, use ListAssociationVersions.
#
# @return [Types::DescribeAssociationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAssociationResult#association_description #association_description} => Types::AssociationDescription
#
# @example Request syntax with placeholder values
#
# resp = client.describe_association({
# name: "DocumentName",
# instance_id: "InstanceId",
# association_id: "AssociationId",
# association_version: "AssociationVersion",
# })
#
# @example Response structure
#
# resp.association_description.name #=> String
# resp.association_description.instance_id #=> String
# resp.association_description.association_version #=> String
# resp.association_description.date #=> Time
# resp.association_description.last_update_association_date #=> Time
# resp.association_description.status.date #=> Time
# resp.association_description.status.name #=> String, one of "Pending", "Success", "Failed"
# resp.association_description.status.message #=> String
# resp.association_description.status.additional_info #=> String
# resp.association_description.overview.status #=> String
# resp.association_description.overview.detailed_status #=> String
# resp.association_description.overview.association_status_aggregated_count #=> Hash
# resp.association_description.overview.association_status_aggregated_count["StatusName"] #=> Integer
# resp.association_description.document_version #=> String
# resp.association_description.parameters #=> Hash
# resp.association_description.parameters["ParameterName"] #=> Array
# resp.association_description.parameters["ParameterName"][0] #=> String
# resp.association_description.association_id #=> String
# resp.association_description.targets #=> Array
# resp.association_description.targets[0].key #=> String
# resp.association_description.targets[0].values #=> Array
# resp.association_description.targets[0].values[0] #=> String
# resp.association_description.schedule_expression #=> String
# resp.association_description.output_location.s3_location.output_s3_region #=> String
# resp.association_description.output_location.s3_location.output_s3_bucket_name #=> String
# resp.association_description.output_location.s3_location.output_s3_key_prefix #=> String
# resp.association_description.last_execution_date #=> Time
# resp.association_description.last_successful_execution_date #=> Time
# resp.association_description.association_name #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociation AWS API Documentation
#
# @overload describe_association(params = {})
# @param [Hash] params ({})
def describe_association(params = {}, options = {})
req = build_request(:describe_association, params)
req.send_request(options)
end
# Use this API action to view information about a specific execution of
# a specific association.
#
# @option params [required, String] :association_id
# The association ID that includes the execution for which you want to
# view details.
#
# @option params [required, String] :execution_id
# The execution ID for which you want to view details.
#
# @option params [Array<Types::AssociationExecutionTargetsFilter>] :filters
# Filters for the request. You can specify the following filters and
# values.
#
# Status (EQUAL)
#
# ResourceId (EQUAL)
#
# ResourceType (EQUAL)
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @return [Types::DescribeAssociationExecutionTargetsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAssociationExecutionTargetsResult#association_execution_targets #association_execution_targets} => Array<Types::AssociationExecutionTarget>
# * {Types::DescribeAssociationExecutionTargetsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_association_execution_targets({
# association_id: "AssociationId", # required
# execution_id: "AssociationExecutionId", # required
# filters: [
# {
# key: "Status", # required, accepts Status, ResourceId, ResourceType
# value: "AssociationExecutionTargetsFilterValue", # required
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.association_execution_targets #=> Array
# resp.association_execution_targets[0].association_id #=> String
# resp.association_execution_targets[0].association_version #=> String
# resp.association_execution_targets[0].execution_id #=> String
# resp.association_execution_targets[0].resource_id #=> String
# resp.association_execution_targets[0].resource_type #=> String
# resp.association_execution_targets[0].status #=> String
# resp.association_execution_targets[0].detailed_status #=> String
# resp.association_execution_targets[0].last_execution_date #=> Time
# resp.association_execution_targets[0].output_source.output_source_id #=> String
# resp.association_execution_targets[0].output_source.output_source_type #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociationExecutionTargets AWS API Documentation
#
# @overload describe_association_execution_targets(params = {})
# @param [Hash] params ({})
def describe_association_execution_targets(params = {}, options = {})
req = build_request(:describe_association_execution_targets, params)
req.send_request(options)
end
# Use this API action to view all executions for a specific association
# ID.
#
# @option params [required, String] :association_id
# The association ID for which you want to view execution history
# details.
#
# @option params [Array<Types::AssociationExecutionFilter>] :filters
# Filters for the request. You can specify the following filters and
# values.
#
# ExecutionId (EQUAL)
#
# Status (EQUAL)
#
# CreatedTime (EQUAL, GREATER\_THAN, LESS\_THAN)
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @return [Types::DescribeAssociationExecutionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAssociationExecutionsResult#association_executions #association_executions} => Array<Types::AssociationExecution>
# * {Types::DescribeAssociationExecutionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_association_executions({
# association_id: "AssociationId", # required
# filters: [
# {
# key: "ExecutionId", # required, accepts ExecutionId, Status, CreatedTime
# value: "AssociationExecutionFilterValue", # required
# type: "EQUAL", # required, accepts EQUAL, LESS_THAN, GREATER_THAN
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.association_executions #=> Array
# resp.association_executions[0].association_id #=> String
# resp.association_executions[0].association_version #=> String
# resp.association_executions[0].execution_id #=> String
# resp.association_executions[0].status #=> String
# resp.association_executions[0].detailed_status #=> String
# resp.association_executions[0].created_time #=> Time
# resp.association_executions[0].last_execution_date #=> Time
# resp.association_executions[0].resource_count_by_status #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociationExecutions AWS API Documentation
#
# @overload describe_association_executions(params = {})
# @param [Hash] params ({})
def describe_association_executions(params = {}, options = {})
req = build_request(:describe_association_executions, params)
req.send_request(options)
end
# Provides details about all active and terminated Automation
# executions.
#
# @option params [Array<Types::AutomationExecutionFilter>] :filters
# Filters used to limit the scope of executions that are requested.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeAutomationExecutionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAutomationExecutionsResult#automation_execution_metadata_list #automation_execution_metadata_list} => Array<Types::AutomationExecutionMetadata>
# * {Types::DescribeAutomationExecutionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_automation_executions({
# filters: [
# {
# key: "DocumentNamePrefix", # required, accepts DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId, CurrentAction, StartTimeBefore, StartTimeAfter
# values: ["AutomationExecutionFilterValue"], # required
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.automation_execution_metadata_list #=> Array
# resp.automation_execution_metadata_list[0].automation_execution_id #=> String
# resp.automation_execution_metadata_list[0].document_name #=> String
# resp.automation_execution_metadata_list[0].document_version #=> String
# resp.automation_execution_metadata_list[0].automation_execution_status #=> String, one of "Pending", "InProgress", "Waiting", "Success", "TimedOut", "Cancelling", "Cancelled", "Failed"
# resp.automation_execution_metadata_list[0].execution_start_time #=> Time
# resp.automation_execution_metadata_list[0].execution_end_time #=> Time
# resp.automation_execution_metadata_list[0].executed_by #=> String
# resp.automation_execution_metadata_list[0].log_file #=> String
# resp.automation_execution_metadata_list[0].outputs #=> Hash
# resp.automation_execution_metadata_list[0].outputs["AutomationParameterKey"] #=> Array
# resp.automation_execution_metadata_list[0].outputs["AutomationParameterKey"][0] #=> String
# resp.automation_execution_metadata_list[0].mode #=> String, one of "Auto", "Interactive"
# resp.automation_execution_metadata_list[0].parent_automation_execution_id #=> String
# resp.automation_execution_metadata_list[0].current_step_name #=> String
# resp.automation_execution_metadata_list[0].current_action #=> String
# resp.automation_execution_metadata_list[0].failure_message #=> String
# resp.automation_execution_metadata_list[0].target_parameter_name #=> String
# resp.automation_execution_metadata_list[0].targets #=> Array
# resp.automation_execution_metadata_list[0].targets[0].key #=> String
# resp.automation_execution_metadata_list[0].targets[0].values #=> Array
# resp.automation_execution_metadata_list[0].targets[0].values[0] #=> String
# resp.automation_execution_metadata_list[0].resolved_targets.parameter_values #=> Array
# resp.automation_execution_metadata_list[0].resolved_targets.parameter_values[0] #=> String
# resp.automation_execution_metadata_list[0].resolved_targets.truncated #=> Boolean
# resp.automation_execution_metadata_list[0].max_concurrency #=> String
# resp.automation_execution_metadata_list[0].max_errors #=> String
# resp.automation_execution_metadata_list[0].target #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutions AWS API Documentation
#
# @overload describe_automation_executions(params = {})
# @param [Hash] params ({})
def describe_automation_executions(params = {}, options = {})
req = build_request(:describe_automation_executions, params)
req.send_request(options)
end
# Information about all active and terminated step executions in an
# Automation workflow.
#
# @option params [required, String] :automation_execution_id
# The Automation execution ID for which you want step execution
# descriptions.
#
# @option params [Array<Types::StepExecutionFilter>] :filters
# One or more filters to limit the number of step executions returned by
# the request.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [Boolean] :reverse_order
# A boolean that indicates whether to list step executions in reverse
# order by start time. The default value is false.
#
# @return [Types::DescribeAutomationStepExecutionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAutomationStepExecutionsResult#step_executions #step_executions} => Array<Types::StepExecution>
# * {Types::DescribeAutomationStepExecutionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_automation_step_executions({
# automation_execution_id: "AutomationExecutionId", # required
# filters: [
# {
# key: "StartTimeBefore", # required, accepts StartTimeBefore, StartTimeAfter, StepExecutionStatus, StepExecutionId, StepName, Action
# values: ["StepExecutionFilterValue"], # required
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# reverse_order: false,
# })
#
# @example Response structure
#
# resp.step_executions #=> Array
# resp.step_executions[0].step_name #=> String
# resp.step_executions[0].action #=> String
# resp.step_executions[0].timeout_seconds #=> Integer
# resp.step_executions[0].on_failure #=> String
# resp.step_executions[0].max_attempts #=> Integer
# resp.step_executions[0].execution_start_time #=> Time
# resp.step_executions[0].execution_end_time #=> Time
# resp.step_executions[0].step_status #=> String, one of "Pending", "InProgress", "Waiting", "Success", "TimedOut", "Cancelling", "Cancelled", "Failed"
# resp.step_executions[0].response_code #=> String
# resp.step_executions[0].inputs #=> Hash
# resp.step_executions[0].inputs["String"] #=> String
# resp.step_executions[0].outputs #=> Hash
# resp.step_executions[0].outputs["AutomationParameterKey"] #=> Array
# resp.step_executions[0].outputs["AutomationParameterKey"][0] #=> String
# resp.step_executions[0].response #=> String
# resp.step_executions[0].failure_message #=> String
# resp.step_executions[0].failure_details.failure_stage #=> String
# resp.step_executions[0].failure_details.failure_type #=> String
# resp.step_executions[0].failure_details.details #=> Hash
# resp.step_executions[0].failure_details.details["AutomationParameterKey"] #=> Array
# resp.step_executions[0].failure_details.details["AutomationParameterKey"][0] #=> String
# resp.step_executions[0].step_execution_id #=> String
# resp.step_executions[0].overridden_parameters #=> Hash
# resp.step_executions[0].overridden_parameters["AutomationParameterKey"] #=> Array
# resp.step_executions[0].overridden_parameters["AutomationParameterKey"][0] #=> String
# resp.step_executions[0].is_end #=> Boolean
# resp.step_executions[0].next_step #=> String
# resp.step_executions[0].is_critical #=> Boolean
# resp.step_executions[0].valid_next_steps #=> Array
# resp.step_executions[0].valid_next_steps[0] #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationStepExecutions AWS API Documentation
#
# @overload describe_automation_step_executions(params = {})
# @param [Hash] params ({})
def describe_automation_step_executions(params = {}, options = {})
req = build_request(:describe_automation_step_executions, params)
req.send_request(options)
end
# Lists all patches that could possibly be included in a patch baseline.
#
# @option params [Array<Types::PatchOrchestratorFilter>] :filters
# Filters used to scope down the returned patches.
#
# @option params [Integer] :max_results
# The maximum number of patches to return (per page).
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeAvailablePatchesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAvailablePatchesResult#patches #patches} => Array<Types::Patch>
# * {Types::DescribeAvailablePatchesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_available_patches({
# filters: [
# {
# key: "PatchOrchestratorFilterKey",
# values: ["PatchOrchestratorFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.patches #=> Array
# resp.patches[0].id #=> String
# resp.patches[0].release_date #=> Time
# resp.patches[0].title #=> String
# resp.patches[0].description #=> String
# resp.patches[0].content_url #=> String
# resp.patches[0].vendor #=> String
# resp.patches[0].product_family #=> String
# resp.patches[0].product #=> String
# resp.patches[0].classification #=> String
# resp.patches[0].msrc_severity #=> String
# resp.patches[0].kb_number #=> String
# resp.patches[0].msrc_number #=> String
# resp.patches[0].language #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAvailablePatches AWS API Documentation
#
# @overload describe_available_patches(params = {})
# @param [Hash] params ({})
def describe_available_patches(params = {}, options = {})
req = build_request(:describe_available_patches, params)
req.send_request(options)
end
# Describes the specified Systems Manager document.
#
# @option params [required, String] :name
# The name of the Systems Manager document.
#
# @option params [String] :document_version
# The document version for which you want information. Can be a specific
# version or the default version.
#
# @return [Types::DescribeDocumentResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeDocumentResult#document #document} => Types::DocumentDescription
#
# @example Request syntax with placeholder values
#
# resp = client.describe_document({
# name: "DocumentARN", # required
# document_version: "DocumentVersion",
# })
#
# @example Response structure
#
# resp.document.sha_1 #=> String
# resp.document.hash #=> String
# resp.document.hash_type #=> String, one of "Sha256", "Sha1"
# resp.document.name #=> String
# resp.document.owner #=> String
# resp.document.created_date #=> Time
# resp.document.status #=> String, one of "Creating", "Active", "Updating", "Deleting"
# resp.document.document_version #=> String
# resp.document.description #=> String
# resp.document.parameters #=> Array
# resp.document.parameters[0].name #=> String
# resp.document.parameters[0].type #=> String, one of "String", "StringList"
# resp.document.parameters[0].description #=> String
# resp.document.parameters[0].default_value #=> String
# resp.document.platform_types #=> Array
# resp.document.platform_types[0] #=> String, one of "Windows", "Linux"
# resp.document.document_type #=> String, one of "Command", "Policy", "Automation"
# resp.document.schema_version #=> String
# resp.document.latest_version #=> String
# resp.document.default_version #=> String
# resp.document.document_format #=> String, one of "YAML", "JSON"
# resp.document.target_type #=> String
# resp.document.tags #=> Array
# resp.document.tags[0].key #=> String
# resp.document.tags[0].value #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocument AWS API Documentation
#
# @overload describe_document(params = {})
# @param [Hash] params ({})
def describe_document(params = {}, options = {})
req = build_request(:describe_document, params)
req.send_request(options)
end
# Describes the permissions for a Systems Manager document. If you
# created the document, you are the owner. If a document is shared, it
# can either be shared privately (by specifying a user's AWS account
# ID) or publicly (*All*).
#
# @option params [required, String] :name
# The name of the document for which you are the owner.
#
# @option params [required, String] :permission_type
# The permission type for the document. The permission type can be
# *Share*.
#
# @return [Types::DescribeDocumentPermissionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeDocumentPermissionResponse#account_ids #account_ids} => Array<String>
#
# @example Request syntax with placeholder values
#
# resp = client.describe_document_permission({
# name: "DocumentName", # required
# permission_type: "Share", # required, accepts Share
# })
#
# @example Response structure
#
# resp.account_ids #=> Array
# resp.account_ids[0] #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocumentPermission AWS API Documentation
#
# @overload describe_document_permission(params = {})
# @param [Hash] params ({})
def describe_document_permission(params = {}, options = {})
req = build_request(:describe_document_permission, params)
req.send_request(options)
end
# All associations for the instance(s).
#
# @option params [required, String] :instance_id
# The instance ID for which you want to view all associations.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeEffectiveInstanceAssociationsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeEffectiveInstanceAssociationsResult#associations #associations} => Array<Types::InstanceAssociation>
# * {Types::DescribeEffectiveInstanceAssociationsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_effective_instance_associations({
# instance_id: "InstanceId", # required
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.associations #=> Array
# resp.associations[0].association_id #=> String
# resp.associations[0].instance_id #=> String
# resp.associations[0].content #=> String
# resp.associations[0].association_version #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociations AWS API Documentation
#
# @overload describe_effective_instance_associations(params = {})
# @param [Hash] params ({})
def describe_effective_instance_associations(params = {}, options = {})
req = build_request(:describe_effective_instance_associations, params)
req.send_request(options)
end
# Retrieves the current effective patches (the patch and the approval
# state) for the specified patch baseline. Note that this API applies
# only to Windows patch baselines.
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline to retrieve the effective patches for.
#
# @option params [Integer] :max_results
# The maximum number of patches to return (per page).
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeEffectivePatchesForPatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeEffectivePatchesForPatchBaselineResult#effective_patches #effective_patches} => Array<Types::EffectivePatch>
# * {Types::DescribeEffectivePatchesForPatchBaselineResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_effective_patches_for_patch_baseline({
# baseline_id: "BaselineId", # required
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.effective_patches #=> Array
# resp.effective_patches[0].patch.id #=> String
# resp.effective_patches[0].patch.release_date #=> Time
# resp.effective_patches[0].patch.title #=> String
# resp.effective_patches[0].patch.description #=> String
# resp.effective_patches[0].patch.content_url #=> String
# resp.effective_patches[0].patch.vendor #=> String
# resp.effective_patches[0].patch.product_family #=> String
# resp.effective_patches[0].patch.product #=> String
# resp.effective_patches[0].patch.classification #=> String
# resp.effective_patches[0].patch.msrc_severity #=> String
# resp.effective_patches[0].patch.kb_number #=> String
# resp.effective_patches[0].patch.msrc_number #=> String
# resp.effective_patches[0].patch.language #=> String
# resp.effective_patches[0].patch_status.deployment_status #=> String, one of "APPROVED", "PENDING_APPROVAL", "EXPLICIT_APPROVED", "EXPLICIT_REJECTED"
# resp.effective_patches[0].patch_status.compliance_level #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.effective_patches[0].patch_status.approval_date #=> Time
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaseline AWS API Documentation
#
# @overload describe_effective_patches_for_patch_baseline(params = {})
# @param [Hash] params ({})
def describe_effective_patches_for_patch_baseline(params = {}, options = {})
req = build_request(:describe_effective_patches_for_patch_baseline, params)
req.send_request(options)
end
# The status of the associations for the instance(s).
#
# @option params [required, String] :instance_id
# The instance IDs for which you want association status information.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeInstanceAssociationsStatusResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeInstanceAssociationsStatusResult#instance_association_status_infos #instance_association_status_infos} => Array<Types::InstanceAssociationStatusInfo>
# * {Types::DescribeInstanceAssociationsStatusResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_instance_associations_status({
# instance_id: "InstanceId", # required
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.instance_association_status_infos #=> Array
# resp.instance_association_status_infos[0].association_id #=> String
# resp.instance_association_status_infos[0].name #=> String
# resp.instance_association_status_infos[0].document_version #=> String
# resp.instance_association_status_infos[0].association_version #=> String
# resp.instance_association_status_infos[0].instance_id #=> String
# resp.instance_association_status_infos[0].execution_date #=> Time
# resp.instance_association_status_infos[0].status #=> String
# resp.instance_association_status_infos[0].detailed_status #=> String
# resp.instance_association_status_infos[0].execution_summary #=> String
# resp.instance_association_status_infos[0].error_code #=> String
# resp.instance_association_status_infos[0].output_url.s3_output_url.output_url #=> String
# resp.instance_association_status_infos[0].association_name #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatus AWS API Documentation
#
# @overload describe_instance_associations_status(params = {})
# @param [Hash] params ({})
def describe_instance_associations_status(params = {}, options = {})
req = build_request(:describe_instance_associations_status, params)
req.send_request(options)
end
# Describes one or more of your instances. You can use this to get
# information about instances like the operating system platform, the
# SSM Agent version (Linux), status etc. If you specify one or more
# instance IDs, it returns information for those instances. If you do
# not specify instance IDs, it returns information for all your
# instances. If you specify an instance ID that is not valid or an
# instance that you do not own, you receive an error.
#
# <note markdown="1"> The IamRole field for this API action is the Amazon Identity and
# Access Management (IAM) role assigned to on-premises instances. This
# call does not return the IAM role for Amazon EC2 instances.
#
# </note>
#
# @option params [Array<Types::InstanceInformationFilter>] :instance_information_filter_list
# One or more filters. Use a filter to return a more specific list of
# instances.
#
# @option params [Array<Types::InstanceInformationStringFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# instances.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeInstanceInformationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeInstanceInformationResult#instance_information_list #instance_information_list} => Array<Types::InstanceInformation>
# * {Types::DescribeInstanceInformationResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_instance_information({
# instance_information_filter_list: [
# {
# key: "InstanceIds", # required, accepts InstanceIds, AgentVersion, PingStatus, PlatformTypes, ActivationIds, IamRole, ResourceType, AssociationStatus
# value_set: ["InstanceInformationFilterValue"], # required
# },
# ],
# filters: [
# {
# key: "InstanceInformationStringFilterKey", # required
# values: ["InstanceInformationFilterValue"], # required
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.instance_information_list #=> Array
# resp.instance_information_list[0].instance_id #=> String
# resp.instance_information_list[0].ping_status #=> String, one of "Online", "ConnectionLost", "Inactive"
# resp.instance_information_list[0].last_ping_date_time #=> Time
# resp.instance_information_list[0].agent_version #=> String
# resp.instance_information_list[0].is_latest_version #=> Boolean
# resp.instance_information_list[0].platform_type #=> String, one of "Windows", "Linux"
# resp.instance_information_list[0].platform_name #=> String
# resp.instance_information_list[0].platform_version #=> String
# resp.instance_information_list[0].activation_id #=> String
# resp.instance_information_list[0].iam_role #=> String
# resp.instance_information_list[0].registration_date #=> Time
# resp.instance_information_list[0].resource_type #=> String, one of "ManagedInstance", "Document", "EC2Instance"
# resp.instance_information_list[0].name #=> String
# resp.instance_information_list[0].ip_address #=> String
# resp.instance_information_list[0].computer_name #=> String
# resp.instance_information_list[0].association_status #=> String
# resp.instance_information_list[0].last_association_execution_date #=> Time
# resp.instance_information_list[0].last_successful_association_execution_date #=> Time
# resp.instance_information_list[0].association_overview.detailed_status #=> String
# resp.instance_information_list[0].association_overview.instance_association_status_aggregated_count #=> Hash
# resp.instance_information_list[0].association_overview.instance_association_status_aggregated_count["StatusName"] #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformation AWS API Documentation
#
# @overload describe_instance_information(params = {})
# @param [Hash] params ({})
def describe_instance_information(params = {}, options = {})
req = build_request(:describe_instance_information, params)
req.send_request(options)
end
# Retrieves the high-level patch state of one or more instances.
#
# @option params [required, Array<String>] :instance_ids
# The ID of the instance whose patch state information should be
# retrieved.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of instances to return (per page).
#
# @return [Types::DescribeInstancePatchStatesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeInstancePatchStatesResult#instance_patch_states #instance_patch_states} => Array<Types::InstancePatchState>
# * {Types::DescribeInstancePatchStatesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_instance_patch_states({
# instance_ids: ["InstanceId"], # required
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.instance_patch_states #=> Array
# resp.instance_patch_states[0].instance_id #=> String
# resp.instance_patch_states[0].patch_group #=> String
# resp.instance_patch_states[0].baseline_id #=> String
# resp.instance_patch_states[0].snapshot_id #=> String
# resp.instance_patch_states[0].owner_information #=> String
# resp.instance_patch_states[0].installed_count #=> Integer
# resp.instance_patch_states[0].installed_other_count #=> Integer
# resp.instance_patch_states[0].missing_count #=> Integer
# resp.instance_patch_states[0].failed_count #=> Integer
# resp.instance_patch_states[0].not_applicable_count #=> Integer
# resp.instance_patch_states[0].operation_start_time #=> Time
# resp.instance_patch_states[0].operation_end_time #=> Time
# resp.instance_patch_states[0].operation #=> String, one of "Scan", "Install"
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStates AWS API Documentation
#
# @overload describe_instance_patch_states(params = {})
# @param [Hash] params ({})
def describe_instance_patch_states(params = {}, options = {})
req = build_request(:describe_instance_patch_states, params)
req.send_request(options)
end
# Retrieves the high-level patch state for the instances in the
# specified patch group.
#
# @option params [required, String] :patch_group
# The name of the patch group for which the patch state information
# should be retrieved.
#
# @option params [Array<Types::InstancePatchStateFilter>] :filters
# Each entry in the array is a structure containing:
#
# Key (string between 1 and 200 characters)
#
# Values (array containing a single string)
#
# Type (string "Equal", "NotEqual", "LessThan", "GreaterThan")
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of patches to return (per page).
#
# @return [Types::DescribeInstancePatchStatesForPatchGroupResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeInstancePatchStatesForPatchGroupResult#instance_patch_states #instance_patch_states} => Array<Types::InstancePatchState>
# * {Types::DescribeInstancePatchStatesForPatchGroupResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_instance_patch_states_for_patch_group({
# patch_group: "PatchGroup", # required
# filters: [
# {
# key: "InstancePatchStateFilterKey", # required
# values: ["InstancePatchStateFilterValue"], # required
# type: "Equal", # required, accepts Equal, NotEqual, LessThan, GreaterThan
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.instance_patch_states #=> Array
# resp.instance_patch_states[0].instance_id #=> String
# resp.instance_patch_states[0].patch_group #=> String
# resp.instance_patch_states[0].baseline_id #=> String
# resp.instance_patch_states[0].snapshot_id #=> String
# resp.instance_patch_states[0].owner_information #=> String
# resp.instance_patch_states[0].installed_count #=> Integer
# resp.instance_patch_states[0].installed_other_count #=> Integer
# resp.instance_patch_states[0].missing_count #=> Integer
# resp.instance_patch_states[0].failed_count #=> Integer
# resp.instance_patch_states[0].not_applicable_count #=> Integer
# resp.instance_patch_states[0].operation_start_time #=> Time
# resp.instance_patch_states[0].operation_end_time #=> Time
# resp.instance_patch_states[0].operation #=> String, one of "Scan", "Install"
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroup AWS API Documentation
#
# @overload describe_instance_patch_states_for_patch_group(params = {})
# @param [Hash] params ({})
def describe_instance_patch_states_for_patch_group(params = {}, options = {})
req = build_request(:describe_instance_patch_states_for_patch_group, params)
req.send_request(options)
end
# Retrieves information about the patches on the specified instance and
# their state relative to the patch baseline being used for the
# instance.
#
# @option params [required, String] :instance_id
# The ID of the instance whose patch state information should be
# retrieved.
#
# @option params [Array<Types::PatchOrchestratorFilter>] :filters
# Each entry in the array is a structure containing:
#
# Key (string, between 1 and 128 characters)
#
# Values (array of strings, each string between 1 and 256 characters)
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of patches to return (per page).
#
# @return [Types::DescribeInstancePatchesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeInstancePatchesResult#patches #patches} => Array<Types::PatchComplianceData>
# * {Types::DescribeInstancePatchesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_instance_patches({
# instance_id: "InstanceId", # required
# filters: [
# {
# key: "PatchOrchestratorFilterKey",
# values: ["PatchOrchestratorFilterValue"],
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.patches #=> Array
# resp.patches[0].title #=> String
# resp.patches[0].kb_id #=> String
# resp.patches[0].classification #=> String
# resp.patches[0].severity #=> String
# resp.patches[0].state #=> String, one of "INSTALLED", "INSTALLED_OTHER", "MISSING", "NOT_APPLICABLE", "FAILED"
# resp.patches[0].installed_time #=> Time
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatches AWS API Documentation
#
# @overload describe_instance_patches(params = {})
# @param [Hash] params ({})
def describe_instance_patches(params = {}, options = {})
req = build_request(:describe_instance_patches, params)
req.send_request(options)
end
# Describes a specific delete inventory operation.
#
# @option params [String] :deletion_id
# Specify the delete inventory ID for which you want information. This
# ID was returned by the `DeleteInventory` action.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @return [Types::DescribeInventoryDeletionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeInventoryDeletionsResult#inventory_deletions #inventory_deletions} => Array<Types::InventoryDeletionStatusItem>
# * {Types::DescribeInventoryDeletionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_inventory_deletions({
# deletion_id: "InventoryDeletionId",
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.inventory_deletions #=> Array
# resp.inventory_deletions[0].deletion_id #=> String
# resp.inventory_deletions[0].type_name #=> String
# resp.inventory_deletions[0].deletion_start_time #=> Time
# resp.inventory_deletions[0].last_status #=> String, one of "InProgress", "Complete"
# resp.inventory_deletions[0].last_status_message #=> String
# resp.inventory_deletions[0].deletion_summary.total_count #=> Integer
# resp.inventory_deletions[0].deletion_summary.remaining_count #=> Integer
# resp.inventory_deletions[0].deletion_summary.summary_items #=> Array
# resp.inventory_deletions[0].deletion_summary.summary_items[0].version #=> String
# resp.inventory_deletions[0].deletion_summary.summary_items[0].count #=> Integer
# resp.inventory_deletions[0].deletion_summary.summary_items[0].remaining_count #=> Integer
# resp.inventory_deletions[0].last_status_update_time #=> Time
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInventoryDeletions AWS API Documentation
#
# @overload describe_inventory_deletions(params = {})
# @param [Hash] params ({})
def describe_inventory_deletions(params = {}, options = {})
req = build_request(:describe_inventory_deletions, params)
req.send_request(options)
end
# Retrieves the individual task executions (one per target) for a
# particular task executed as part of a Maintenance Window execution.
#
# @option params [required, String] :window_execution_id
# The ID of the Maintenance Window execution the task is part of.
#
# @option params [required, String] :task_id
# The ID of the specific task in the Maintenance Window task that should
# be retrieved.
#
# @option params [Array<Types::MaintenanceWindowFilter>] :filters
# Optional filters used to scope down the returned task invocations. The
# supported filter key is STATUS with the corresponding values PENDING,
# IN\_PROGRESS, SUCCESS, FAILED, TIMED\_OUT, CANCELLING, and CANCELLED.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeMaintenanceWindowExecutionTaskInvocationsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeMaintenanceWindowExecutionTaskInvocationsResult#window_execution_task_invocation_identities #window_execution_task_invocation_identities} => Array<Types::MaintenanceWindowExecutionTaskInvocationIdentity>
# * {Types::DescribeMaintenanceWindowExecutionTaskInvocationsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_maintenance_window_execution_task_invocations({
# window_execution_id: "MaintenanceWindowExecutionId", # required
# task_id: "MaintenanceWindowExecutionTaskId", # required
# filters: [
# {
# key: "MaintenanceWindowFilterKey",
# values: ["MaintenanceWindowFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.window_execution_task_invocation_identities #=> Array
# resp.window_execution_task_invocation_identities[0].window_execution_id #=> String
# resp.window_execution_task_invocation_identities[0].task_execution_id #=> String
# resp.window_execution_task_invocation_identities[0].invocation_id #=> String
# resp.window_execution_task_invocation_identities[0].execution_id #=> String
# resp.window_execution_task_invocation_identities[0].task_type #=> String, one of "RUN_COMMAND", "AUTOMATION", "STEP_FUNCTIONS", "LAMBDA"
# resp.window_execution_task_invocation_identities[0].parameters #=> String
# resp.window_execution_task_invocation_identities[0].status #=> String, one of "PENDING", "IN_PROGRESS", "SUCCESS", "FAILED", "TIMED_OUT", "CANCELLING", "CANCELLED", "SKIPPED_OVERLAPPING"
# resp.window_execution_task_invocation_identities[0].status_details #=> String
# resp.window_execution_task_invocation_identities[0].start_time #=> Time
# resp.window_execution_task_invocation_identities[0].end_time #=> Time
# resp.window_execution_task_invocation_identities[0].owner_information #=> String
# resp.window_execution_task_invocation_identities[0].window_target_id #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocations AWS API Documentation
#
# @overload describe_maintenance_window_execution_task_invocations(params = {})
# @param [Hash] params ({})
def describe_maintenance_window_execution_task_invocations(params = {}, options = {})
req = build_request(:describe_maintenance_window_execution_task_invocations, params)
req.send_request(options)
end
# For a given Maintenance Window execution, lists the tasks that were
# executed.
#
# @option params [required, String] :window_execution_id
# The ID of the Maintenance Window execution whose task executions
# should be retrieved.
#
# @option params [Array<Types::MaintenanceWindowFilter>] :filters
# Optional filters used to scope down the returned tasks. The supported
# filter key is STATUS with the corresponding values PENDING,
# IN\_PROGRESS, SUCCESS, FAILED, TIMED\_OUT, CANCELLING, and CANCELLED.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeMaintenanceWindowExecutionTasksResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeMaintenanceWindowExecutionTasksResult#window_execution_task_identities #window_execution_task_identities} => Array<Types::MaintenanceWindowExecutionTaskIdentity>
# * {Types::DescribeMaintenanceWindowExecutionTasksResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_maintenance_window_execution_tasks({
# window_execution_id: "MaintenanceWindowExecutionId", # required
# filters: [
# {
# key: "MaintenanceWindowFilterKey",
# values: ["MaintenanceWindowFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.window_execution_task_identities #=> Array
# resp.window_execution_task_identities[0].window_execution_id #=> String
# resp.window_execution_task_identities[0].task_execution_id #=> String
# resp.window_execution_task_identities[0].status #=> String, one of "PENDING", "IN_PROGRESS", "SUCCESS", "FAILED", "TIMED_OUT", "CANCELLING", "CANCELLED", "SKIPPED_OVERLAPPING"
# resp.window_execution_task_identities[0].status_details #=> String
# resp.window_execution_task_identities[0].start_time #=> Time
# resp.window_execution_task_identities[0].end_time #=> Time
# resp.window_execution_task_identities[0].task_arn #=> String
# resp.window_execution_task_identities[0].task_type #=> String, one of "RUN_COMMAND", "AUTOMATION", "STEP_FUNCTIONS", "LAMBDA"
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasks AWS API Documentation
#
# @overload describe_maintenance_window_execution_tasks(params = {})
# @param [Hash] params ({})
def describe_maintenance_window_execution_tasks(params = {}, options = {})
req = build_request(:describe_maintenance_window_execution_tasks, params)
req.send_request(options)
end
# Lists the executions of a Maintenance Window. This includes
# information about when the Maintenance Window was scheduled to be
# active, and information about tasks registered and run with the
# Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window whose executions should be retrieved.
#
# @option params [Array<Types::MaintenanceWindowFilter>] :filters
# Each entry in the array is a structure containing:
#
# Key (string, between 1 and 128 characters)
#
# Values (array of strings, each string is between 1 and 256 characters)
#
# The supported Keys are ExecutedBefore and ExecutedAfter with the value
# being a date/time string such as 2016-11-04T05:00:00Z.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeMaintenanceWindowExecutionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeMaintenanceWindowExecutionsResult#window_executions #window_executions} => Array<Types::MaintenanceWindowExecution>
# * {Types::DescribeMaintenanceWindowExecutionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_maintenance_window_executions({
# window_id: "MaintenanceWindowId", # required
# filters: [
# {
# key: "MaintenanceWindowFilterKey",
# values: ["MaintenanceWindowFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.window_executions #=> Array
# resp.window_executions[0].window_id #=> String
# resp.window_executions[0].window_execution_id #=> String
# resp.window_executions[0].status #=> String, one of "PENDING", "IN_PROGRESS", "SUCCESS", "FAILED", "TIMED_OUT", "CANCELLING", "CANCELLED", "SKIPPED_OVERLAPPING"
# resp.window_executions[0].status_details #=> String
# resp.window_executions[0].start_time #=> Time
# resp.window_executions[0].end_time #=> Time
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutions AWS API Documentation
#
# @overload describe_maintenance_window_executions(params = {})
# @param [Hash] params ({})
def describe_maintenance_window_executions(params = {}, options = {})
req = build_request(:describe_maintenance_window_executions, params)
req.send_request(options)
end
# Lists the targets registered with the Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window whose targets should be retrieved.
#
# @option params [Array<Types::MaintenanceWindowFilter>] :filters
# Optional filters that can be used to narrow down the scope of the
# returned window targets. The supported filter keys are Type,
# WindowTargetId and OwnerInformation.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeMaintenanceWindowTargetsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeMaintenanceWindowTargetsResult#targets #targets} => Array<Types::MaintenanceWindowTarget>
# * {Types::DescribeMaintenanceWindowTargetsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_maintenance_window_targets({
# window_id: "MaintenanceWindowId", # required
# filters: [
# {
# key: "MaintenanceWindowFilterKey",
# values: ["MaintenanceWindowFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.targets #=> Array
# resp.targets[0].window_id #=> String
# resp.targets[0].window_target_id #=> String
# resp.targets[0].resource_type #=> String, one of "INSTANCE"
# resp.targets[0].targets #=> Array
# resp.targets[0].targets[0].key #=> String
# resp.targets[0].targets[0].values #=> Array
# resp.targets[0].targets[0].values[0] #=> String
# resp.targets[0].owner_information #=> String
# resp.targets[0].name #=> String
# resp.targets[0].description #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargets AWS API Documentation
#
# @overload describe_maintenance_window_targets(params = {})
# @param [Hash] params ({})
def describe_maintenance_window_targets(params = {}, options = {})
req = build_request(:describe_maintenance_window_targets, params)
req.send_request(options)
end
# Lists the tasks in a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window whose tasks should be retrieved.
#
# @option params [Array<Types::MaintenanceWindowFilter>] :filters
# Optional filters used to narrow down the scope of the returned tasks.
# The supported filter keys are WindowTaskId, TaskArn, Priority, and
# TaskType.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeMaintenanceWindowTasksResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeMaintenanceWindowTasksResult#tasks #tasks} => Array<Types::MaintenanceWindowTask>
# * {Types::DescribeMaintenanceWindowTasksResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_maintenance_window_tasks({
# window_id: "MaintenanceWindowId", # required
# filters: [
# {
# key: "MaintenanceWindowFilterKey",
# values: ["MaintenanceWindowFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.tasks #=> Array
# resp.tasks[0].window_id #=> String
# resp.tasks[0].window_task_id #=> String
# resp.tasks[0].task_arn #=> String
# resp.tasks[0].type #=> String, one of "RUN_COMMAND", "AUTOMATION", "STEP_FUNCTIONS", "LAMBDA"
# resp.tasks[0].targets #=> Array
# resp.tasks[0].targets[0].key #=> String
# resp.tasks[0].targets[0].values #=> Array
# resp.tasks[0].targets[0].values[0] #=> String
# resp.tasks[0].task_parameters #=> Hash
# resp.tasks[0].task_parameters["MaintenanceWindowTaskParameterName"].values #=> Array
# resp.tasks[0].task_parameters["MaintenanceWindowTaskParameterName"].values[0] #=> String
# resp.tasks[0].priority #=> Integer
# resp.tasks[0].logging_info.s3_bucket_name #=> String
# resp.tasks[0].logging_info.s3_key_prefix #=> String
# resp.tasks[0].logging_info.s3_region #=> String
# resp.tasks[0].service_role_arn #=> String
# resp.tasks[0].max_concurrency #=> String
# resp.tasks[0].max_errors #=> String
# resp.tasks[0].name #=> String
# resp.tasks[0].description #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasks AWS API Documentation
#
# @overload describe_maintenance_window_tasks(params = {})
# @param [Hash] params ({})
def describe_maintenance_window_tasks(params = {}, options = {})
req = build_request(:describe_maintenance_window_tasks, params)
req.send_request(options)
end
# Retrieves the Maintenance Windows in an AWS account.
#
# @option params [Array<Types::MaintenanceWindowFilter>] :filters
# Optional filters used to narrow down the scope of the returned
# Maintenance Windows. Supported filter keys are Name and Enabled.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeMaintenanceWindowsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeMaintenanceWindowsResult#window_identities #window_identities} => Array<Types::MaintenanceWindowIdentity>
# * {Types::DescribeMaintenanceWindowsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_maintenance_windows({
# filters: [
# {
# key: "MaintenanceWindowFilterKey",
# values: ["MaintenanceWindowFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.window_identities #=> Array
# resp.window_identities[0].window_id #=> String
# resp.window_identities[0].name #=> String
# resp.window_identities[0].description #=> String
# resp.window_identities[0].enabled #=> Boolean
# resp.window_identities[0].duration #=> Integer
# resp.window_identities[0].cutoff #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindows AWS API Documentation
#
# @overload describe_maintenance_windows(params = {})
# @param [Hash] params ({})
def describe_maintenance_windows(params = {}, options = {})
req = build_request(:describe_maintenance_windows, params)
req.send_request(options)
end
# Get information about a parameter.
#
# Request results are returned on a best-effort basis. If you specify
# `MaxResults` in the request, the response includes information up to
# the limit specified. The number of items returned, however, can be
# between zero and the value of `MaxResults`. If the service reaches an
# internal limit while processing the results, it stops the operation
# and returns the matching values up to that point and a `NextToken`.
# You can specify the `NextToken` in a subsequent call to get the next
# set of results.
#
# @option params [Array<Types::ParametersFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [Array<Types::ParameterStringFilter>] :parameter_filters
# Filters to limit the request results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribeParametersResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeParametersResult#parameters #parameters} => Array<Types::ParameterMetadata>
# * {Types::DescribeParametersResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_parameters({
# filters: [
# {
# key: "Name", # required, accepts Name, Type, KeyId
# values: ["ParametersFilterValue"], # required
# },
# ],
# parameter_filters: [
# {
# key: "ParameterStringFilterKey", # required
# option: "ParameterStringQueryOption",
# values: ["ParameterStringFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.parameters #=> Array
# resp.parameters[0].name #=> String
# resp.parameters[0].type #=> String, one of "String", "StringList", "SecureString"
# resp.parameters[0].key_id #=> String
# resp.parameters[0].last_modified_date #=> Time
# resp.parameters[0].last_modified_user #=> String
# resp.parameters[0].description #=> String
# resp.parameters[0].allowed_pattern #=> String
# resp.parameters[0].version #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParameters AWS API Documentation
#
# @overload describe_parameters(params = {})
# @param [Hash] params ({})
def describe_parameters(params = {}, options = {})
req = build_request(:describe_parameters, params)
req.send_request(options)
end
# Lists the patch baselines in your AWS account.
#
# @option params [Array<Types::PatchOrchestratorFilter>] :filters
# Each element in the array is a structure containing:
#
# Key: (string, "NAME\_PREFIX" or "OWNER")
#
# Value: (array of strings, exactly 1 entry, between 1 and 255
# characters)
#
# @option params [Integer] :max_results
# The maximum number of patch baselines to return (per page).
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribePatchBaselinesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribePatchBaselinesResult#baseline_identities #baseline_identities} => Array<Types::PatchBaselineIdentity>
# * {Types::DescribePatchBaselinesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_patch_baselines({
# filters: [
# {
# key: "PatchOrchestratorFilterKey",
# values: ["PatchOrchestratorFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.baseline_identities #=> Array
# resp.baseline_identities[0].baseline_id #=> String
# resp.baseline_identities[0].baseline_name #=> String
# resp.baseline_identities[0].operating_system #=> String, one of "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", "CENTOS"
# resp.baseline_identities[0].baseline_description #=> String
# resp.baseline_identities[0].default_baseline #=> Boolean
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchBaselines AWS API Documentation
#
# @overload describe_patch_baselines(params = {})
# @param [Hash] params ({})
def describe_patch_baselines(params = {}, options = {})
req = build_request(:describe_patch_baselines, params)
req.send_request(options)
end
# Returns high-level aggregated patch compliance state for a patch
# group.
#
# @option params [required, String] :patch_group
# The name of the patch group whose patch snapshot should be retrieved.
#
# @return [Types::DescribePatchGroupStateResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribePatchGroupStateResult#instances #instances} => Integer
# * {Types::DescribePatchGroupStateResult#instances_with_installed_patches #instances_with_installed_patches} => Integer
# * {Types::DescribePatchGroupStateResult#instances_with_installed_other_patches #instances_with_installed_other_patches} => Integer
# * {Types::DescribePatchGroupStateResult#instances_with_missing_patches #instances_with_missing_patches} => Integer
# * {Types::DescribePatchGroupStateResult#instances_with_failed_patches #instances_with_failed_patches} => Integer
# * {Types::DescribePatchGroupStateResult#instances_with_not_applicable_patches #instances_with_not_applicable_patches} => Integer
#
# @example Request syntax with placeholder values
#
# resp = client.describe_patch_group_state({
# patch_group: "PatchGroup", # required
# })
#
# @example Response structure
#
# resp.instances #=> Integer
# resp.instances_with_installed_patches #=> Integer
# resp.instances_with_installed_other_patches #=> Integer
# resp.instances_with_missing_patches #=> Integer
# resp.instances_with_failed_patches #=> Integer
# resp.instances_with_not_applicable_patches #=> Integer
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupState AWS API Documentation
#
# @overload describe_patch_group_state(params = {})
# @param [Hash] params ({})
def describe_patch_group_state(params = {}, options = {})
req = build_request(:describe_patch_group_state, params)
req.send_request(options)
end
# Lists all patch groups that have been registered with patch baselines.
#
# @option params [Integer] :max_results
# The maximum number of patch groups to return (per page).
#
# @option params [Array<Types::PatchOrchestratorFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::DescribePatchGroupsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribePatchGroupsResult#mappings #mappings} => Array<Types::PatchGroupPatchBaselineMapping>
# * {Types::DescribePatchGroupsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.describe_patch_groups({
# max_results: 1,
# filters: [
# {
# key: "PatchOrchestratorFilterKey",
# values: ["PatchOrchestratorFilterValue"],
# },
# ],
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.mappings #=> Array
# resp.mappings[0].patch_group #=> String
# resp.mappings[0].baseline_identity.baseline_id #=> String
# resp.mappings[0].baseline_identity.baseline_name #=> String
# resp.mappings[0].baseline_identity.operating_system #=> String, one of "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", "CENTOS"
# resp.mappings[0].baseline_identity.baseline_description #=> String
# resp.mappings[0].baseline_identity.default_baseline #=> Boolean
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroups AWS API Documentation
#
# @overload describe_patch_groups(params = {})
# @param [Hash] params ({})
def describe_patch_groups(params = {}, options = {})
req = build_request(:describe_patch_groups, params)
req.send_request(options)
end
# Get detailed information about a particular Automation execution.
#
# @option params [required, String] :automation_execution_id
# The unique identifier for an existing automation execution to examine.
# The execution ID is returned by StartAutomationExecution when the
# execution of an Automation document is initiated.
#
# @return [Types::GetAutomationExecutionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetAutomationExecutionResult#automation_execution #automation_execution} => Types::AutomationExecution
#
# @example Request syntax with placeholder values
#
# resp = client.get_automation_execution({
# automation_execution_id: "AutomationExecutionId", # required
# })
#
# @example Response structure
#
# resp.automation_execution.automation_execution_id #=> String
# resp.automation_execution.document_name #=> String
# resp.automation_execution.document_version #=> String
# resp.automation_execution.execution_start_time #=> Time
# resp.automation_execution.execution_end_time #=> Time
# resp.automation_execution.automation_execution_status #=> String, one of "Pending", "InProgress", "Waiting", "Success", "TimedOut", "Cancelling", "Cancelled", "Failed"
# resp.automation_execution.step_executions #=> Array
# resp.automation_execution.step_executions[0].step_name #=> String
# resp.automation_execution.step_executions[0].action #=> String
# resp.automation_execution.step_executions[0].timeout_seconds #=> Integer
# resp.automation_execution.step_executions[0].on_failure #=> String
# resp.automation_execution.step_executions[0].max_attempts #=> Integer
# resp.automation_execution.step_executions[0].execution_start_time #=> Time
# resp.automation_execution.step_executions[0].execution_end_time #=> Time
# resp.automation_execution.step_executions[0].step_status #=> String, one of "Pending", "InProgress", "Waiting", "Success", "TimedOut", "Cancelling", "Cancelled", "Failed"
# resp.automation_execution.step_executions[0].response_code #=> String
# resp.automation_execution.step_executions[0].inputs #=> Hash
# resp.automation_execution.step_executions[0].inputs["String"] #=> String
# resp.automation_execution.step_executions[0].outputs #=> Hash
# resp.automation_execution.step_executions[0].outputs["AutomationParameterKey"] #=> Array
# resp.automation_execution.step_executions[0].outputs["AutomationParameterKey"][0] #=> String
# resp.automation_execution.step_executions[0].response #=> String
# resp.automation_execution.step_executions[0].failure_message #=> String
# resp.automation_execution.step_executions[0].failure_details.failure_stage #=> String
# resp.automation_execution.step_executions[0].failure_details.failure_type #=> String
# resp.automation_execution.step_executions[0].failure_details.details #=> Hash
# resp.automation_execution.step_executions[0].failure_details.details["AutomationParameterKey"] #=> Array
# resp.automation_execution.step_executions[0].failure_details.details["AutomationParameterKey"][0] #=> String
# resp.automation_execution.step_executions[0].step_execution_id #=> String
# resp.automation_execution.step_executions[0].overridden_parameters #=> Hash
# resp.automation_execution.step_executions[0].overridden_parameters["AutomationParameterKey"] #=> Array
# resp.automation_execution.step_executions[0].overridden_parameters["AutomationParameterKey"][0] #=> String
# resp.automation_execution.step_executions[0].is_end #=> Boolean
# resp.automation_execution.step_executions[0].next_step #=> String
# resp.automation_execution.step_executions[0].is_critical #=> Boolean
# resp.automation_execution.step_executions[0].valid_next_steps #=> Array
# resp.automation_execution.step_executions[0].valid_next_steps[0] #=> String
# resp.automation_execution.step_executions_truncated #=> Boolean
# resp.automation_execution.parameters #=> Hash
# resp.automation_execution.parameters["AutomationParameterKey"] #=> Array
# resp.automation_execution.parameters["AutomationParameterKey"][0] #=> String
# resp.automation_execution.outputs #=> Hash
# resp.automation_execution.outputs["AutomationParameterKey"] #=> Array
# resp.automation_execution.outputs["AutomationParameterKey"][0] #=> String
# resp.automation_execution.failure_message #=> String
# resp.automation_execution.mode #=> String, one of "Auto", "Interactive"
# resp.automation_execution.parent_automation_execution_id #=> String
# resp.automation_execution.executed_by #=> String
# resp.automation_execution.current_step_name #=> String
# resp.automation_execution.current_action #=> String
# resp.automation_execution.target_parameter_name #=> String
# resp.automation_execution.targets #=> Array
# resp.automation_execution.targets[0].key #=> String
# resp.automation_execution.targets[0].values #=> Array
# resp.automation_execution.targets[0].values[0] #=> String
# resp.automation_execution.resolved_targets.parameter_values #=> Array
# resp.automation_execution.resolved_targets.parameter_values[0] #=> String
# resp.automation_execution.resolved_targets.truncated #=> Boolean
# resp.automation_execution.max_concurrency #=> String
# resp.automation_execution.max_errors #=> String
# resp.automation_execution.target #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecution AWS API Documentation
#
# @overload get_automation_execution(params = {})
# @param [Hash] params ({})
def get_automation_execution(params = {}, options = {})
req = build_request(:get_automation_execution, params)
req.send_request(options)
end
# Returns detailed information about command execution for an invocation
# or plugin.
#
# @option params [required, String] :command_id
# (Required) The parent command ID of the invocation plugin.
#
# @option params [required, String] :instance_id
# (Required) The ID of the managed instance targeted by the command. A
# managed instance can be an Amazon EC2 instance or an instance in your
# hybrid environment that is configured for Systems Manager.
#
# @option params [String] :plugin_name
# (Optional) The name of the plugin for which you want detailed results.
# If the document contains only one plugin, the name can be omitted and
# the details will be returned.
#
# @return [Types::GetCommandInvocationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetCommandInvocationResult#command_id #command_id} => String
# * {Types::GetCommandInvocationResult#instance_id #instance_id} => String
# * {Types::GetCommandInvocationResult#comment #comment} => String
# * {Types::GetCommandInvocationResult#document_name #document_name} => String
# * {Types::GetCommandInvocationResult#document_version #document_version} => String
# * {Types::GetCommandInvocationResult#plugin_name #plugin_name} => String
# * {Types::GetCommandInvocationResult#response_code #response_code} => Integer
# * {Types::GetCommandInvocationResult#execution_start_date_time #execution_start_date_time} => String
# * {Types::GetCommandInvocationResult#execution_elapsed_time #execution_elapsed_time} => String
# * {Types::GetCommandInvocationResult#execution_end_date_time #execution_end_date_time} => String
# * {Types::GetCommandInvocationResult#status #status} => String
# * {Types::GetCommandInvocationResult#status_details #status_details} => String
# * {Types::GetCommandInvocationResult#standard_output_content #standard_output_content} => String
# * {Types::GetCommandInvocationResult#standard_output_url #standard_output_url} => String
# * {Types::GetCommandInvocationResult#standard_error_content #standard_error_content} => String
# * {Types::GetCommandInvocationResult#standard_error_url #standard_error_url} => String
# * {Types::GetCommandInvocationResult#cloud_watch_output_config #cloud_watch_output_config} => Types::CloudWatchOutputConfig
#
# @example Request syntax with placeholder values
#
# resp = client.get_command_invocation({
# command_id: "CommandId", # required
# instance_id: "InstanceId", # required
# plugin_name: "CommandPluginName",
# })
#
# @example Response structure
#
# resp.command_id #=> String
# resp.instance_id #=> String
# resp.comment #=> String
# resp.document_name #=> String
# resp.document_version #=> String
# resp.plugin_name #=> String
# resp.response_code #=> Integer
# resp.execution_start_date_time #=> String
# resp.execution_elapsed_time #=> String
# resp.execution_end_date_time #=> String
# resp.status #=> String, one of "Pending", "InProgress", "Delayed", "Success", "Cancelled", "TimedOut", "Failed", "Cancelling"
# resp.status_details #=> String
# resp.standard_output_content #=> String
# resp.standard_output_url #=> String
# resp.standard_error_content #=> String
# resp.standard_error_url #=> String
# resp.cloud_watch_output_config.cloud_watch_log_group_name #=> String
# resp.cloud_watch_output_config.cloud_watch_output_enabled #=> Boolean
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCommandInvocation AWS API Documentation
#
# @overload get_command_invocation(params = {})
# @param [Hash] params ({})
def get_command_invocation(params = {}, options = {})
req = build_request(:get_command_invocation, params)
req.send_request(options)
end
# Retrieves the default patch baseline. Note that Systems Manager
# supports creating multiple default patch baselines. For example, you
# can create a default patch baseline for each operating system.
#
# If you do not specify an operating system value, the default patch
# baseline for Windows is returned.
#
# @option params [String] :operating_system
# Returns the default patch baseline for the specified operating system.
#
# @return [Types::GetDefaultPatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetDefaultPatchBaselineResult#baseline_id #baseline_id} => String
# * {Types::GetDefaultPatchBaselineResult#operating_system #operating_system} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_default_patch_baseline({
# operating_system: "WINDOWS", # accepts WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, UBUNTU, REDHAT_ENTERPRISE_LINUX, SUSE, CENTOS
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
# resp.operating_system #=> String, one of "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", "CENTOS"
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDefaultPatchBaseline AWS API Documentation
#
# @overload get_default_patch_baseline(params = {})
# @param [Hash] params ({})
def get_default_patch_baseline(params = {}, options = {})
req = build_request(:get_default_patch_baseline, params)
req.send_request(options)
end
# Retrieves the current snapshot for the patch baseline the instance
# uses. This API is primarily used by the AWS-RunPatchBaseline Systems
# Manager document.
#
# @option params [required, String] :instance_id
# The ID of the instance for which the appropriate patch snapshot should
# be retrieved.
#
# @option params [required, String] :snapshot_id
# The user-defined snapshot ID.
#
# @return [Types::GetDeployablePatchSnapshotForInstanceResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetDeployablePatchSnapshotForInstanceResult#instance_id #instance_id} => String
# * {Types::GetDeployablePatchSnapshotForInstanceResult#snapshot_id #snapshot_id} => String
# * {Types::GetDeployablePatchSnapshotForInstanceResult#snapshot_download_url #snapshot_download_url} => String
# * {Types::GetDeployablePatchSnapshotForInstanceResult#product #product} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_deployable_patch_snapshot_for_instance({
# instance_id: "InstanceId", # required
# snapshot_id: "SnapshotId", # required
# })
#
# @example Response structure
#
# resp.instance_id #=> String
# resp.snapshot_id #=> String
# resp.snapshot_download_url #=> String
# resp.product #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDeployablePatchSnapshotForInstance AWS API Documentation
#
# @overload get_deployable_patch_snapshot_for_instance(params = {})
# @param [Hash] params ({})
def get_deployable_patch_snapshot_for_instance(params = {}, options = {})
req = build_request(:get_deployable_patch_snapshot_for_instance, params)
req.send_request(options)
end
# Gets the contents of the specified Systems Manager document.
#
# @option params [required, String] :name
# The name of the Systems Manager document.
#
# @option params [String] :document_version
# The document version for which you want information.
#
# @option params [String] :document_format
# Returns the document in the specified format. The document format can
# be either JSON or YAML. JSON is the default format.
#
# @return [Types::GetDocumentResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetDocumentResult#name #name} => String
# * {Types::GetDocumentResult#document_version #document_version} => String
# * {Types::GetDocumentResult#content #content} => String
# * {Types::GetDocumentResult#document_type #document_type} => String
# * {Types::GetDocumentResult#document_format #document_format} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_document({
# name: "DocumentARN", # required
# document_version: "DocumentVersion",
# document_format: "YAML", # accepts YAML, JSON
# })
#
# @example Response structure
#
# resp.name #=> String
# resp.document_version #=> String
# resp.content #=> String
# resp.document_type #=> String, one of "Command", "Policy", "Automation"
# resp.document_format #=> String, one of "YAML", "JSON"
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocument AWS API Documentation
#
# @overload get_document(params = {})
# @param [Hash] params ({})
def get_document(params = {}, options = {})
req = build_request(:get_document, params)
req.send_request(options)
end
# Query inventory information.
#
# @option params [Array<Types::InventoryFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [Array<Types::InventoryAggregator>] :aggregators
# Returns counts of inventory types based on one or more expressions.
# For example, if you aggregate by using an expression that uses the
# `AWS:InstanceInformation.PlatformType` type, you can see a count of
# how many Windows and Linux instances exist in your inventoried fleet.
#
# @option params [Array<Types::ResultAttribute>] :result_attributes
# The list of inventory item types to return.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @return [Types::GetInventoryResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetInventoryResult#entities #entities} => Array<Types::InventoryResultEntity>
# * {Types::GetInventoryResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_inventory({
# filters: [
# {
# key: "InventoryFilterKey", # required
# values: ["InventoryFilterValue"], # required
# type: "Equal", # accepts Equal, NotEqual, BeginWith, LessThan, GreaterThan
# },
# ],
# aggregators: [
# {
# expression: "InventoryAggregatorExpression",
# aggregators: {
# # recursive InventoryAggregatorList
# },
# },
# ],
# result_attributes: [
# {
# type_name: "InventoryItemTypeName", # required
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.entities #=> Array
# resp.entities[0].id #=> String
# resp.entities[0].data #=> Hash
# resp.entities[0].data["InventoryResultItemKey"].type_name #=> String
# resp.entities[0].data["InventoryResultItemKey"].schema_version #=> String
# resp.entities[0].data["InventoryResultItemKey"].capture_time #=> String
# resp.entities[0].data["InventoryResultItemKey"].content_hash #=> String
# resp.entities[0].data["InventoryResultItemKey"].content #=> Array
# resp.entities[0].data["InventoryResultItemKey"].content[0] #=> Hash
# resp.entities[0].data["InventoryResultItemKey"].content[0]["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventory AWS API Documentation
#
# @overload get_inventory(params = {})
# @param [Hash] params ({})
def get_inventory(params = {}, options = {})
req = build_request(:get_inventory, params)
req.send_request(options)
end
# Return a list of inventory type names for the account, or return a
# list of attribute names for a specific Inventory item type.
#
# @option params [String] :type_name
# The type of inventory item to return.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [Boolean] :aggregator
# Returns inventory schemas that support aggregation. For example, this
# call returns the `AWS:InstanceInformation` type, because it supports
# aggregation based on the `PlatformName`, `PlatformType`, and
# `PlatformVersion` attributes.
#
# @option params [Boolean] :sub_type
# Returns the sub-type schema for a specified inventory type.
#
# @return [Types::GetInventorySchemaResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetInventorySchemaResult#schemas #schemas} => Array<Types::InventoryItemSchema>
# * {Types::GetInventorySchemaResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_inventory_schema({
# type_name: "InventoryItemTypeNameFilter",
# next_token: "NextToken",
# max_results: 1,
# aggregator: false,
# sub_type: false,
# })
#
# @example Response structure
#
# resp.schemas #=> Array
# resp.schemas[0].type_name #=> String
# resp.schemas[0].version #=> String
# resp.schemas[0].attributes #=> Array
# resp.schemas[0].attributes[0].name #=> String
# resp.schemas[0].attributes[0].data_type #=> String, one of "string", "number"
# resp.schemas[0].display_name #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchema AWS API Documentation
#
# @overload get_inventory_schema(params = {})
# @param [Hash] params ({})
def get_inventory_schema(params = {}, options = {})
req = build_request(:get_inventory_schema, params)
req.send_request(options)
end
# Retrieves a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the desired Maintenance Window.
#
# @return [Types::GetMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetMaintenanceWindowResult#window_id #window_id} => String
# * {Types::GetMaintenanceWindowResult#name #name} => String
# * {Types::GetMaintenanceWindowResult#description #description} => String
# * {Types::GetMaintenanceWindowResult#schedule #schedule} => String
# * {Types::GetMaintenanceWindowResult#duration #duration} => Integer
# * {Types::GetMaintenanceWindowResult#cutoff #cutoff} => Integer
# * {Types::GetMaintenanceWindowResult#allow_unassociated_targets #allow_unassociated_targets} => Boolean
# * {Types::GetMaintenanceWindowResult#enabled #enabled} => Boolean
# * {Types::GetMaintenanceWindowResult#created_date #created_date} => Time
# * {Types::GetMaintenanceWindowResult#modified_date #modified_date} => Time
#
# @example Request syntax with placeholder values
#
# resp = client.get_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.name #=> String
# resp.description #=> String
# resp.schedule #=> String
# resp.duration #=> Integer
# resp.cutoff #=> Integer
# resp.allow_unassociated_targets #=> Boolean
# resp.enabled #=> Boolean
# resp.created_date #=> Time
# resp.modified_date #=> Time
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindow AWS API Documentation
#
# @overload get_maintenance_window(params = {})
# @param [Hash] params ({})
def get_maintenance_window(params = {}, options = {})
req = build_request(:get_maintenance_window, params)
req.send_request(options)
end
# Retrieves details about a specific task executed as part of a
# Maintenance Window execution.
#
# @option params [required, String] :window_execution_id
# The ID of the Maintenance Window execution that includes the task.
#
# @return [Types::GetMaintenanceWindowExecutionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetMaintenanceWindowExecutionResult#window_execution_id #window_execution_id} => String
# * {Types::GetMaintenanceWindowExecutionResult#task_ids #task_ids} => Array<String>
# * {Types::GetMaintenanceWindowExecutionResult#status #status} => String
# * {Types::GetMaintenanceWindowExecutionResult#status_details #status_details} => String
# * {Types::GetMaintenanceWindowExecutionResult#start_time #start_time} => Time
# * {Types::GetMaintenanceWindowExecutionResult#end_time #end_time} => Time
#
# @example Request syntax with placeholder values
#
# resp = client.get_maintenance_window_execution({
# window_execution_id: "MaintenanceWindowExecutionId", # required
# })
#
# @example Response structure
#
# resp.window_execution_id #=> String
# resp.task_ids #=> Array
# resp.task_ids[0] #=> String
# resp.status #=> String, one of "PENDING", "IN_PROGRESS", "SUCCESS", "FAILED", "TIMED_OUT", "CANCELLING", "CANCELLED", "SKIPPED_OVERLAPPING"
# resp.status_details #=> String
# resp.start_time #=> Time
# resp.end_time #=> Time
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecution AWS API Documentation
#
# @overload get_maintenance_window_execution(params = {})
# @param [Hash] params ({})
def get_maintenance_window_execution(params = {}, options = {})
req = build_request(:get_maintenance_window_execution, params)
req.send_request(options)
end
# Retrieves the details about a specific task executed as part of a
# Maintenance Window execution.
#
# @option params [required, String] :window_execution_id
# The ID of the Maintenance Window execution that includes the task.
#
# @option params [required, String] :task_id
# The ID of the specific task execution in the Maintenance Window task
# that should be retrieved.
#
# @return [Types::GetMaintenanceWindowExecutionTaskResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetMaintenanceWindowExecutionTaskResult#window_execution_id #window_execution_id} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#task_execution_id #task_execution_id} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#task_arn #task_arn} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#service_role #service_role} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#type #type} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#task_parameters #task_parameters} => Array<Hash<String,Types::MaintenanceWindowTaskParameterValueExpression>>
# * {Types::GetMaintenanceWindowExecutionTaskResult#priority #priority} => Integer
# * {Types::GetMaintenanceWindowExecutionTaskResult#max_concurrency #max_concurrency} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#max_errors #max_errors} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#status #status} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#status_details #status_details} => String
# * {Types::GetMaintenanceWindowExecutionTaskResult#start_time #start_time} => Time
# * {Types::GetMaintenanceWindowExecutionTaskResult#end_time #end_time} => Time
#
# @example Request syntax with placeholder values
#
# resp = client.get_maintenance_window_execution_task({
# window_execution_id: "MaintenanceWindowExecutionId", # required
# task_id: "MaintenanceWindowExecutionTaskId", # required
# })
#
# @example Response structure
#
# resp.window_execution_id #=> String
# resp.task_execution_id #=> String
# resp.task_arn #=> String
# resp.service_role #=> String
# resp.type #=> String, one of "RUN_COMMAND", "AUTOMATION", "STEP_FUNCTIONS", "LAMBDA"
# resp.task_parameters #=> Array
# resp.task_parameters[0] #=> Hash
# resp.task_parameters[0]["MaintenanceWindowTaskParameterName"].values #=> Array
# resp.task_parameters[0]["MaintenanceWindowTaskParameterName"].values[0] #=> String
# resp.priority #=> Integer
# resp.max_concurrency #=> String
# resp.max_errors #=> String
# resp.status #=> String, one of "PENDING", "IN_PROGRESS", "SUCCESS", "FAILED", "TIMED_OUT", "CANCELLING", "CANCELLED", "SKIPPED_OVERLAPPING"
# resp.status_details #=> String
# resp.start_time #=> Time
# resp.end_time #=> Time
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTask AWS API Documentation
#
# @overload get_maintenance_window_execution_task(params = {})
# @param [Hash] params ({})
def get_maintenance_window_execution_task(params = {}, options = {})
req = build_request(:get_maintenance_window_execution_task, params)
req.send_request(options)
end
# Retrieves a task invocation. A task invocation is a specific task
# executing on a specific target. Maintenance Windows report status for
# all invocations.
#
# @option params [required, String] :window_execution_id
# The ID of the Maintenance Window execution for which the task is a
# part.
#
# @option params [required, String] :task_id
# The ID of the specific task in the Maintenance Window task that should
# be retrieved.
#
# @option params [required, String] :invocation_id
# The invocation ID to retrieve.
#
# @return [Types::GetMaintenanceWindowExecutionTaskInvocationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#window_execution_id #window_execution_id} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#task_execution_id #task_execution_id} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#invocation_id #invocation_id} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#execution_id #execution_id} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#task_type #task_type} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#parameters #parameters} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#status #status} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#status_details #status_details} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#start_time #start_time} => Time
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#end_time #end_time} => Time
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#owner_information #owner_information} => String
# * {Types::GetMaintenanceWindowExecutionTaskInvocationResult#window_target_id #window_target_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_maintenance_window_execution_task_invocation({
# window_execution_id: "MaintenanceWindowExecutionId", # required
# task_id: "MaintenanceWindowExecutionTaskId", # required
# invocation_id: "MaintenanceWindowExecutionTaskInvocationId", # required
# })
#
# @example Response structure
#
# resp.window_execution_id #=> String
# resp.task_execution_id #=> String
# resp.invocation_id #=> String
# resp.execution_id #=> String
# resp.task_type #=> String, one of "RUN_COMMAND", "AUTOMATION", "STEP_FUNCTIONS", "LAMBDA"
# resp.parameters #=> String
# resp.status #=> String, one of "PENDING", "IN_PROGRESS", "SUCCESS", "FAILED", "TIMED_OUT", "CANCELLING", "CANCELLED", "SKIPPED_OVERLAPPING"
# resp.status_details #=> String
# resp.start_time #=> Time
# resp.end_time #=> Time
# resp.owner_information #=> String
# resp.window_target_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTaskInvocation AWS API Documentation
#
# @overload get_maintenance_window_execution_task_invocation(params = {})
# @param [Hash] params ({})
def get_maintenance_window_execution_task_invocation(params = {}, options = {})
req = build_request(:get_maintenance_window_execution_task_invocation, params)
req.send_request(options)
end
# Lists the tasks in a Maintenance Window.
#
# @option params [required, String] :window_id
# The Maintenance Window ID that includes the task to retrieve.
#
# @option params [required, String] :window_task_id
# The Maintenance Window task ID to retrieve.
#
# @return [Types::GetMaintenanceWindowTaskResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetMaintenanceWindowTaskResult#window_id #window_id} => String
# * {Types::GetMaintenanceWindowTaskResult#window_task_id #window_task_id} => String
# * {Types::GetMaintenanceWindowTaskResult#targets #targets} => Array<Types::Target>
# * {Types::GetMaintenanceWindowTaskResult#task_arn #task_arn} => String
# * {Types::GetMaintenanceWindowTaskResult#service_role_arn #service_role_arn} => String
# * {Types::GetMaintenanceWindowTaskResult#task_type #task_type} => String
# * {Types::GetMaintenanceWindowTaskResult#task_parameters #task_parameters} => Hash<String,Types::MaintenanceWindowTaskParameterValueExpression>
# * {Types::GetMaintenanceWindowTaskResult#task_invocation_parameters #task_invocation_parameters} => Types::MaintenanceWindowTaskInvocationParameters
# * {Types::GetMaintenanceWindowTaskResult#priority #priority} => Integer
# * {Types::GetMaintenanceWindowTaskResult#max_concurrency #max_concurrency} => String
# * {Types::GetMaintenanceWindowTaskResult#max_errors #max_errors} => String
# * {Types::GetMaintenanceWindowTaskResult#logging_info #logging_info} => Types::LoggingInfo
# * {Types::GetMaintenanceWindowTaskResult#name #name} => String
# * {Types::GetMaintenanceWindowTaskResult#description #description} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_maintenance_window_task({
# window_id: "MaintenanceWindowId", # required
# window_task_id: "MaintenanceWindowTaskId", # required
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.window_task_id #=> String
# resp.targets #=> Array
# resp.targets[0].key #=> String
# resp.targets[0].values #=> Array
# resp.targets[0].values[0] #=> String
# resp.task_arn #=> String
# resp.service_role_arn #=> String
# resp.task_type #=> String, one of "RUN_COMMAND", "AUTOMATION", "STEP_FUNCTIONS", "LAMBDA"
# resp.task_parameters #=> Hash
# resp.task_parameters["MaintenanceWindowTaskParameterName"].values #=> Array
# resp.task_parameters["MaintenanceWindowTaskParameterName"].values[0] #=> String
# resp.task_invocation_parameters.run_command.comment #=> String
# resp.task_invocation_parameters.run_command.document_hash #=> String
# resp.task_invocation_parameters.run_command.document_hash_type #=> String, one of "Sha256", "Sha1"
# resp.task_invocation_parameters.run_command.notification_config.notification_arn #=> String
# resp.task_invocation_parameters.run_command.notification_config.notification_events #=> Array
# resp.task_invocation_parameters.run_command.notification_config.notification_events[0] #=> String, one of "All", "InProgress", "Success", "TimedOut", "Cancelled", "Failed"
# resp.task_invocation_parameters.run_command.notification_config.notification_type #=> String, one of "Command", "Invocation"
# resp.task_invocation_parameters.run_command.output_s3_bucket_name #=> String
# resp.task_invocation_parameters.run_command.output_s3_key_prefix #=> String
# resp.task_invocation_parameters.run_command.parameters #=> Hash
# resp.task_invocation_parameters.run_command.parameters["ParameterName"] #=> Array
# resp.task_invocation_parameters.run_command.parameters["ParameterName"][0] #=> String
# resp.task_invocation_parameters.run_command.service_role_arn #=> String
# resp.task_invocation_parameters.run_command.timeout_seconds #=> Integer
# resp.task_invocation_parameters.automation.document_version #=> String
# resp.task_invocation_parameters.automation.parameters #=> Hash
# resp.task_invocation_parameters.automation.parameters["AutomationParameterKey"] #=> Array
# resp.task_invocation_parameters.automation.parameters["AutomationParameterKey"][0] #=> String
# resp.task_invocation_parameters.step_functions.input #=> String
# resp.task_invocation_parameters.step_functions.name #=> String
# resp.task_invocation_parameters.lambda.client_context #=> String
# resp.task_invocation_parameters.lambda.qualifier #=> String
# resp.task_invocation_parameters.lambda.payload #=> String
# resp.priority #=> Integer
# resp.max_concurrency #=> String
# resp.max_errors #=> String
# resp.logging_info.s3_bucket_name #=> String
# resp.logging_info.s3_key_prefix #=> String
# resp.logging_info.s3_region #=> String
# resp.name #=> String
# resp.description #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowTask AWS API Documentation
#
# @overload get_maintenance_window_task(params = {})
# @param [Hash] params ({})
def get_maintenance_window_task(params = {}, options = {})
req = build_request(:get_maintenance_window_task, params)
req.send_request(options)
end
# Get information about a parameter by using the parameter name. Don't
# confuse this API action with the GetParameters API action.
#
# @option params [required, String] :name
# The name of the parameter you want to query.
#
# @option params [Boolean] :with_decryption
# Return decrypted values for secure string parameters. This flag is
# ignored for String and StringList parameter types.
#
# @return [Types::GetParameterResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetParameterResult#parameter #parameter} => Types::Parameter
#
# @example Request syntax with placeholder values
#
# resp = client.get_parameter({
# name: "PSParameterName", # required
# with_decryption: false,
# })
#
# @example Response structure
#
# resp.parameter.name #=> String
# resp.parameter.type #=> String, one of "String", "StringList", "SecureString"
# resp.parameter.value #=> String
# resp.parameter.version #=> Integer
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameter AWS API Documentation
#
# @overload get_parameter(params = {})
# @param [Hash] params ({})
def get_parameter(params = {}, options = {})
req = build_request(:get_parameter, params)
req.send_request(options)
end
# Query a list of all parameters used by the AWS account.
#
# @option params [required, String] :name
# The name of a parameter you want to query.
#
# @option params [Boolean] :with_decryption
# Return decrypted values for secure string parameters. This flag is
# ignored for String and StringList parameter types.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::GetParameterHistoryResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetParameterHistoryResult#parameters #parameters} => Array<Types::ParameterHistory>
# * {Types::GetParameterHistoryResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_parameter_history({
# name: "PSParameterName", # required
# with_decryption: false,
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.parameters #=> Array
# resp.parameters[0].name #=> String
# resp.parameters[0].type #=> String, one of "String", "StringList", "SecureString"
# resp.parameters[0].key_id #=> String
# resp.parameters[0].last_modified_date #=> Time
# resp.parameters[0].last_modified_user #=> String
# resp.parameters[0].description #=> String
# resp.parameters[0].value #=> String
# resp.parameters[0].allowed_pattern #=> String
# resp.parameters[0].version #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistory AWS API Documentation
#
# @overload get_parameter_history(params = {})
# @param [Hash] params ({})
def get_parameter_history(params = {}, options = {})
req = build_request(:get_parameter_history, params)
req.send_request(options)
end
# Get details of a parameter. Don't confuse this API action with the
# GetParameter API action.
#
# @option params [required, Array<String>] :names
# Names of the parameters for which you want to query information.
#
# @option params [Boolean] :with_decryption
# Return decrypted secure string value. Return decrypted values for
# secure string parameters. This flag is ignored for String and
# StringList parameter types.
#
# @return [Types::GetParametersResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetParametersResult#parameters #parameters} => Array<Types::Parameter>
# * {Types::GetParametersResult#invalid_parameters #invalid_parameters} => Array<String>
#
# @example Request syntax with placeholder values
#
# resp = client.get_parameters({
# names: ["PSParameterName"], # required
# with_decryption: false,
# })
#
# @example Response structure
#
# resp.parameters #=> Array
# resp.parameters[0].name #=> String
# resp.parameters[0].type #=> String, one of "String", "StringList", "SecureString"
# resp.parameters[0].value #=> String
# resp.parameters[0].version #=> Integer
# resp.invalid_parameters #=> Array
# resp.invalid_parameters[0] #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameters AWS API Documentation
#
# @overload get_parameters(params = {})
# @param [Hash] params ({})
def get_parameters(params = {}, options = {})
req = build_request(:get_parameters, params)
req.send_request(options)
end
# Retrieve parameters in a specific hierarchy. For more information, see
# [Working with Systems Manager Parameters][1] in the *AWS Systems
# Manager User Guide*.
#
# Request results are returned on a best-effort basis. If you specify
# `MaxResults` in the request, the response includes information up to
# the limit specified. The number of items returned, however, can be
# between zero and the value of `MaxResults`. If the service reaches an
# internal limit while processing the results, it stops the operation
# and returns the matching values up to that point and a `NextToken`.
# You can specify the `NextToken` in a subsequent call to get the next
# set of results.
#
# <note markdown="1"> This API action doesn't support filtering by tags.
#
# </note>
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-working.html
#
# @option params [required, String] :path
# The hierarchy for the parameter. Hierarchies start with a forward
# slash (/) and end with the parameter name. A parameter name hierarchy
# can have a maximum of 15 levels. Here is an example of a hierarchy:
# `/Finance/Prod/IAD/WinServ2016/license33`
#
# @option params [Boolean] :recursive
# Retrieve all parameters within a hierarchy.
#
# If a user has access to a path, then the user can access all levels of
# that path. For example, if a user has permission to access path /a,
# then the user can also access /a/b. Even if a user has explicitly been
# denied access in IAM for parameter /a, they can still call the
# GetParametersByPath API action recursively and view /a/b.
#
# @option params [Array<Types::ParameterStringFilter>] :parameter_filters
# Filters to limit the request results.
#
# <note markdown="1"> You can't filter using the parameter name.
#
# </note>
#
# @option params [Boolean] :with_decryption
# Retrieve all parameters in a hierarchy with their value decrypted.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @return [Types::GetParametersByPathResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetParametersByPathResult#parameters #parameters} => Array<Types::Parameter>
# * {Types::GetParametersByPathResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_parameters_by_path({
# path: "PSParameterName", # required
# recursive: false,
# parameter_filters: [
# {
# key: "ParameterStringFilterKey", # required
# option: "ParameterStringQueryOption",
# values: ["ParameterStringFilterValue"],
# },
# ],
# with_decryption: false,
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.parameters #=> Array
# resp.parameters[0].name #=> String
# resp.parameters[0].type #=> String, one of "String", "StringList", "SecureString"
# resp.parameters[0].value #=> String
# resp.parameters[0].version #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParametersByPath AWS API Documentation
#
# @overload get_parameters_by_path(params = {})
# @param [Hash] params ({})
def get_parameters_by_path(params = {}, options = {})
req = build_request(:get_parameters_by_path, params)
req.send_request(options)
end
# Retrieves information about a patch baseline.
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline to retrieve.
#
# @return [Types::GetPatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetPatchBaselineResult#baseline_id #baseline_id} => String
# * {Types::GetPatchBaselineResult#name #name} => String
# * {Types::GetPatchBaselineResult#operating_system #operating_system} => String
# * {Types::GetPatchBaselineResult#global_filters #global_filters} => Types::PatchFilterGroup
# * {Types::GetPatchBaselineResult#approval_rules #approval_rules} => Types::PatchRuleGroup
# * {Types::GetPatchBaselineResult#approved_patches #approved_patches} => Array<String>
# * {Types::GetPatchBaselineResult#approved_patches_compliance_level #approved_patches_compliance_level} => String
# * {Types::GetPatchBaselineResult#approved_patches_enable_non_security #approved_patches_enable_non_security} => Boolean
# * {Types::GetPatchBaselineResult#rejected_patches #rejected_patches} => Array<String>
# * {Types::GetPatchBaselineResult#patch_groups #patch_groups} => Array<String>
# * {Types::GetPatchBaselineResult#created_date #created_date} => Time
# * {Types::GetPatchBaselineResult#modified_date #modified_date} => Time
# * {Types::GetPatchBaselineResult#description #description} => String
# * {Types::GetPatchBaselineResult#sources #sources} => Array<Types::PatchSource>
#
# @example Request syntax with placeholder values
#
# resp = client.get_patch_baseline({
# baseline_id: "BaselineId", # required
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
# resp.name #=> String
# resp.operating_system #=> String, one of "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", "CENTOS"
# resp.global_filters.patch_filters #=> Array
# resp.global_filters.patch_filters[0].key #=> String, one of "PRODUCT", "CLASSIFICATION", "MSRC_SEVERITY", "PATCH_ID", "SECTION", "PRIORITY", "SEVERITY"
# resp.global_filters.patch_filters[0].values #=> Array
# resp.global_filters.patch_filters[0].values[0] #=> String
# resp.approval_rules.patch_rules #=> Array
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters #=> Array
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters[0].key #=> String, one of "PRODUCT", "CLASSIFICATION", "MSRC_SEVERITY", "PATCH_ID", "SECTION", "PRIORITY", "SEVERITY"
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters[0].values #=> Array
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters[0].values[0] #=> String
# resp.approval_rules.patch_rules[0].compliance_level #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.approval_rules.patch_rules[0].approve_after_days #=> Integer
# resp.approval_rules.patch_rules[0].enable_non_security #=> Boolean
# resp.approved_patches #=> Array
# resp.approved_patches[0] #=> String
# resp.approved_patches_compliance_level #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.approved_patches_enable_non_security #=> Boolean
# resp.rejected_patches #=> Array
# resp.rejected_patches[0] #=> String
# resp.patch_groups #=> Array
# resp.patch_groups[0] #=> String
# resp.created_date #=> Time
# resp.modified_date #=> Time
# resp.description #=> String
# resp.sources #=> Array
# resp.sources[0].name #=> String
# resp.sources[0].products #=> Array
# resp.sources[0].products[0] #=> String
# resp.sources[0].configuration #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaseline AWS API Documentation
#
# @overload get_patch_baseline(params = {})
# @param [Hash] params ({})
def get_patch_baseline(params = {}, options = {})
req = build_request(:get_patch_baseline, params)
req.send_request(options)
end
# Retrieves the patch baseline that should be used for the specified
# patch group.
#
# @option params [required, String] :patch_group
# The name of the patch group whose patch baseline should be retrieved.
#
# @option params [String] :operating_system
# Returns he operating system rule specified for patch groups using the
# patch baseline.
#
# @return [Types::GetPatchBaselineForPatchGroupResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::GetPatchBaselineForPatchGroupResult#baseline_id #baseline_id} => String
# * {Types::GetPatchBaselineForPatchGroupResult#patch_group #patch_group} => String
# * {Types::GetPatchBaselineForPatchGroupResult#operating_system #operating_system} => String
#
# @example Request syntax with placeholder values
#
# resp = client.get_patch_baseline_for_patch_group({
# patch_group: "PatchGroup", # required
# operating_system: "WINDOWS", # accepts WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, UBUNTU, REDHAT_ENTERPRISE_LINUX, SUSE, CENTOS
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
# resp.patch_group #=> String
# resp.operating_system #=> String, one of "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", "CENTOS"
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineForPatchGroup AWS API Documentation
#
# @overload get_patch_baseline_for_patch_group(params = {})
# @param [Hash] params ({})
def get_patch_baseline_for_patch_group(params = {}, options = {})
req = build_request(:get_patch_baseline_for_patch_group, params)
req.send_request(options)
end
# Retrieves all versions of an association for a specific association
# ID.
#
# @option params [required, String] :association_id
# The association ID for which you want to view all versions.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @return [Types::ListAssociationVersionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListAssociationVersionsResult#association_versions #association_versions} => Array<Types::AssociationVersionInfo>
# * {Types::ListAssociationVersionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_association_versions({
# association_id: "AssociationId", # required
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.association_versions #=> Array
# resp.association_versions[0].association_id #=> String
# resp.association_versions[0].association_version #=> String
# resp.association_versions[0].created_date #=> Time
# resp.association_versions[0].name #=> String
# resp.association_versions[0].document_version #=> String
# resp.association_versions[0].parameters #=> Hash
# resp.association_versions[0].parameters["ParameterName"] #=> Array
# resp.association_versions[0].parameters["ParameterName"][0] #=> String
# resp.association_versions[0].targets #=> Array
# resp.association_versions[0].targets[0].key #=> String
# resp.association_versions[0].targets[0].values #=> Array
# resp.association_versions[0].targets[0].values[0] #=> String
# resp.association_versions[0].schedule_expression #=> String
# resp.association_versions[0].output_location.s3_location.output_s3_region #=> String
# resp.association_versions[0].output_location.s3_location.output_s3_bucket_name #=> String
# resp.association_versions[0].output_location.s3_location.output_s3_key_prefix #=> String
# resp.association_versions[0].association_name #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociationVersions AWS API Documentation
#
# @overload list_association_versions(params = {})
# @param [Hash] params ({})
def list_association_versions(params = {}, options = {})
req = build_request(:list_association_versions, params)
req.send_request(options)
end
# Lists the associations for the specified Systems Manager document or
# instance.
#
# @option params [Array<Types::AssociationFilter>] :association_filter_list
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::ListAssociationsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListAssociationsResult#associations #associations} => Array<Types::Association>
# * {Types::ListAssociationsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_associations({
# association_filter_list: [
# {
# key: "InstanceId", # required, accepts InstanceId, Name, AssociationId, AssociationStatusName, LastExecutedBefore, LastExecutedAfter, AssociationName
# value: "AssociationFilterValue", # required
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.associations #=> Array
# resp.associations[0].name #=> String
# resp.associations[0].instance_id #=> String
# resp.associations[0].association_id #=> String
# resp.associations[0].association_version #=> String
# resp.associations[0].document_version #=> String
# resp.associations[0].targets #=> Array
# resp.associations[0].targets[0].key #=> String
# resp.associations[0].targets[0].values #=> Array
# resp.associations[0].targets[0].values[0] #=> String
# resp.associations[0].last_execution_date #=> Time
# resp.associations[0].overview.status #=> String
# resp.associations[0].overview.detailed_status #=> String
# resp.associations[0].overview.association_status_aggregated_count #=> Hash
# resp.associations[0].overview.association_status_aggregated_count["StatusName"] #=> Integer
# resp.associations[0].schedule_expression #=> String
# resp.associations[0].association_name #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociations AWS API Documentation
#
# @overload list_associations(params = {})
# @param [Hash] params ({})
def list_associations(params = {}, options = {})
req = build_request(:list_associations, params)
req.send_request(options)
end
# An invocation is copy of a command sent to a specific instance. A
# command can apply to one or more instances. A command invocation
# applies to one instance. For example, if a user executes SendCommand
# against three instances, then a command invocation is created for each
# requested instance ID. ListCommandInvocations provide status about
# command execution.
#
# @option params [String] :command_id
# (Optional) The invocations for a specific command ID.
#
# @option params [String] :instance_id
# (Optional) The command execution details for a specific instance ID.
#
# @option params [Integer] :max_results
# (Optional) The maximum number of items to return for this call. The
# call also returns a token that you can specify in a subsequent call to
# get the next set of results.
#
# @option params [String] :next_token
# (Optional) The token for the next set of items to return. (You
# received this token from a previous call.)
#
# @option params [Array<Types::CommandFilter>] :filters
# (Optional) One or more filters. Use a filter to return a more specific
# list of results.
#
# @option params [Boolean] :details
# (Optional) If set this returns the response of the command executions
# and any command output. By default this is set to False.
#
# @return [Types::ListCommandInvocationsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListCommandInvocationsResult#command_invocations #command_invocations} => Array<Types::CommandInvocation>
# * {Types::ListCommandInvocationsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_command_invocations({
# command_id: "CommandId",
# instance_id: "InstanceId",
# max_results: 1,
# next_token: "NextToken",
# filters: [
# {
# key: "InvokedAfter", # required, accepts InvokedAfter, InvokedBefore, Status
# value: "CommandFilterValue", # required
# },
# ],
# details: false,
# })
#
# @example Response structure
#
# resp.command_invocations #=> Array
# resp.command_invocations[0].command_id #=> String
# resp.command_invocations[0].instance_id #=> String
# resp.command_invocations[0].instance_name #=> String
# resp.command_invocations[0].comment #=> String
# resp.command_invocations[0].document_name #=> String
# resp.command_invocations[0].document_version #=> String
# resp.command_invocations[0].requested_date_time #=> Time
# resp.command_invocations[0].status #=> String, one of "Pending", "InProgress", "Delayed", "Success", "Cancelled", "TimedOut", "Failed", "Cancelling"
# resp.command_invocations[0].status_details #=> String
# resp.command_invocations[0].trace_output #=> String
# resp.command_invocations[0].standard_output_url #=> String
# resp.command_invocations[0].standard_error_url #=> String
# resp.command_invocations[0].command_plugins #=> Array
# resp.command_invocations[0].command_plugins[0].name #=> String
# resp.command_invocations[0].command_plugins[0].status #=> String, one of "Pending", "InProgress", "Success", "TimedOut", "Cancelled", "Failed"
# resp.command_invocations[0].command_plugins[0].status_details #=> String
# resp.command_invocations[0].command_plugins[0].response_code #=> Integer
# resp.command_invocations[0].command_plugins[0].response_start_date_time #=> Time
# resp.command_invocations[0].command_plugins[0].response_finish_date_time #=> Time
# resp.command_invocations[0].command_plugins[0].output #=> String
# resp.command_invocations[0].command_plugins[0].standard_output_url #=> String
# resp.command_invocations[0].command_plugins[0].standard_error_url #=> String
# resp.command_invocations[0].command_plugins[0].output_s3_region #=> String
# resp.command_invocations[0].command_plugins[0].output_s3_bucket_name #=> String
# resp.command_invocations[0].command_plugins[0].output_s3_key_prefix #=> String
# resp.command_invocations[0].service_role #=> String
# resp.command_invocations[0].notification_config.notification_arn #=> String
# resp.command_invocations[0].notification_config.notification_events #=> Array
# resp.command_invocations[0].notification_config.notification_events[0] #=> String, one of "All", "InProgress", "Success", "TimedOut", "Cancelled", "Failed"
# resp.command_invocations[0].notification_config.notification_type #=> String, one of "Command", "Invocation"
# resp.command_invocations[0].cloud_watch_output_config.cloud_watch_log_group_name #=> String
# resp.command_invocations[0].cloud_watch_output_config.cloud_watch_output_enabled #=> Boolean
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocations AWS API Documentation
#
# @overload list_command_invocations(params = {})
# @param [Hash] params ({})
def list_command_invocations(params = {}, options = {})
req = build_request(:list_command_invocations, params)
req.send_request(options)
end
# Lists the commands requested by users of the AWS account.
#
# @option params [String] :command_id
# (Optional) If provided, lists only the specified command.
#
# @option params [String] :instance_id
# (Optional) Lists commands issued against this instance ID.
#
# @option params [Integer] :max_results
# (Optional) The maximum number of items to return for this call. The
# call also returns a token that you can specify in a subsequent call to
# get the next set of results.
#
# @option params [String] :next_token
# (Optional) The token for the next set of items to return. (You
# received this token from a previous call.)
#
# @option params [Array<Types::CommandFilter>] :filters
# (Optional) One or more filters. Use a filter to return a more specific
# list of results.
#
# @return [Types::ListCommandsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListCommandsResult#commands #commands} => Array<Types::Command>
# * {Types::ListCommandsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_commands({
# command_id: "CommandId",
# instance_id: "InstanceId",
# max_results: 1,
# next_token: "NextToken",
# filters: [
# {
# key: "InvokedAfter", # required, accepts InvokedAfter, InvokedBefore, Status
# value: "CommandFilterValue", # required
# },
# ],
# })
#
# @example Response structure
#
# resp.commands #=> Array
# resp.commands[0].command_id #=> String
# resp.commands[0].document_name #=> String
# resp.commands[0].document_version #=> String
# resp.commands[0].comment #=> String
# resp.commands[0].expires_after #=> Time
# resp.commands[0].parameters #=> Hash
# resp.commands[0].parameters["ParameterName"] #=> Array
# resp.commands[0].parameters["ParameterName"][0] #=> String
# resp.commands[0].instance_ids #=> Array
# resp.commands[0].instance_ids[0] #=> String
# resp.commands[0].targets #=> Array
# resp.commands[0].targets[0].key #=> String
# resp.commands[0].targets[0].values #=> Array
# resp.commands[0].targets[0].values[0] #=> String
# resp.commands[0].requested_date_time #=> Time
# resp.commands[0].status #=> String, one of "Pending", "InProgress", "Success", "Cancelled", "Failed", "TimedOut", "Cancelling"
# resp.commands[0].status_details #=> String
# resp.commands[0].output_s3_region #=> String
# resp.commands[0].output_s3_bucket_name #=> String
# resp.commands[0].output_s3_key_prefix #=> String
# resp.commands[0].max_concurrency #=> String
# resp.commands[0].max_errors #=> String
# resp.commands[0].target_count #=> Integer
# resp.commands[0].completed_count #=> Integer
# resp.commands[0].error_count #=> Integer
# resp.commands[0].delivery_timed_out_count #=> Integer
# resp.commands[0].service_role #=> String
# resp.commands[0].notification_config.notification_arn #=> String
# resp.commands[0].notification_config.notification_events #=> Array
# resp.commands[0].notification_config.notification_events[0] #=> String, one of "All", "InProgress", "Success", "TimedOut", "Cancelled", "Failed"
# resp.commands[0].notification_config.notification_type #=> String, one of "Command", "Invocation"
# resp.commands[0].cloud_watch_output_config.cloud_watch_log_group_name #=> String
# resp.commands[0].cloud_watch_output_config.cloud_watch_output_enabled #=> Boolean
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommands AWS API Documentation
#
# @overload list_commands(params = {})
# @param [Hash] params ({})
def list_commands(params = {}, options = {})
req = build_request(:list_commands, params)
req.send_request(options)
end
# For a specified resource ID, this API action returns a list of
# compliance statuses for different resource types. Currently, you can
# only specify one resource ID per call. List results depend on the
# criteria specified in the filter.
#
# @option params [Array<Types::ComplianceStringFilter>] :filters
# One or more compliance filters. Use a filter to return a more specific
# list of results.
#
# @option params [Array<String>] :resource_ids
# The ID for the resources from which to get compliance information.
# Currently, you can only specify one resource ID.
#
# @option params [Array<String>] :resource_types
# The type of resource from which to get compliance information.
# Currently, the only supported resource type is `ManagedInstance`.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @return [Types::ListComplianceItemsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListComplianceItemsResult#compliance_items #compliance_items} => Array<Types::ComplianceItem>
# * {Types::ListComplianceItemsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_compliance_items({
# filters: [
# {
# key: "ComplianceStringFilterKey",
# values: ["ComplianceFilterValue"],
# type: "EQUAL", # accepts EQUAL, NOT_EQUAL, BEGIN_WITH, LESS_THAN, GREATER_THAN
# },
# ],
# resource_ids: ["ComplianceResourceId"],
# resource_types: ["ComplianceResourceType"],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.compliance_items #=> Array
# resp.compliance_items[0].compliance_type #=> String
# resp.compliance_items[0].resource_type #=> String
# resp.compliance_items[0].resource_id #=> String
# resp.compliance_items[0].id #=> String
# resp.compliance_items[0].title #=> String
# resp.compliance_items[0].status #=> String, one of "COMPLIANT", "NON_COMPLIANT"
# resp.compliance_items[0].severity #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.compliance_items[0].execution_summary.execution_time #=> Time
# resp.compliance_items[0].execution_summary.execution_id #=> String
# resp.compliance_items[0].execution_summary.execution_type #=> String
# resp.compliance_items[0].details #=> Hash
# resp.compliance_items[0].details["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListComplianceItems AWS API Documentation
#
# @overload list_compliance_items(params = {})
# @param [Hash] params ({})
def list_compliance_items(params = {}, options = {})
req = build_request(:list_compliance_items, params)
req.send_request(options)
end
# Returns a summary count of compliant and non-compliant resources for a
# compliance type. For example, this call can return State Manager
# associations, patches, or custom compliance types according to the
# filter criteria that you specify.
#
# @option params [Array<Types::ComplianceStringFilter>] :filters
# One or more compliance or inventory filters. Use a filter to return a
# more specific list of results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. Currently, you
# can specify null or 50. The call also returns a token that you can
# specify in a subsequent call to get the next set of results.
#
# @return [Types::ListComplianceSummariesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListComplianceSummariesResult#compliance_summary_items #compliance_summary_items} => Array<Types::ComplianceSummaryItem>
# * {Types::ListComplianceSummariesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_compliance_summaries({
# filters: [
# {
# key: "ComplianceStringFilterKey",
# values: ["ComplianceFilterValue"],
# type: "EQUAL", # accepts EQUAL, NOT_EQUAL, BEGIN_WITH, LESS_THAN, GREATER_THAN
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.compliance_summary_items #=> Array
# resp.compliance_summary_items[0].compliance_type #=> String
# resp.compliance_summary_items[0].compliant_summary.compliant_count #=> Integer
# resp.compliance_summary_items[0].compliant_summary.severity_summary.critical_count #=> Integer
# resp.compliance_summary_items[0].compliant_summary.severity_summary.high_count #=> Integer
# resp.compliance_summary_items[0].compliant_summary.severity_summary.medium_count #=> Integer
# resp.compliance_summary_items[0].compliant_summary.severity_summary.low_count #=> Integer
# resp.compliance_summary_items[0].compliant_summary.severity_summary.informational_count #=> Integer
# resp.compliance_summary_items[0].compliant_summary.severity_summary.unspecified_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.non_compliant_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.severity_summary.critical_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.severity_summary.high_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.severity_summary.medium_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.severity_summary.low_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.severity_summary.informational_count #=> Integer
# resp.compliance_summary_items[0].non_compliant_summary.severity_summary.unspecified_count #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListComplianceSummaries AWS API Documentation
#
# @overload list_compliance_summaries(params = {})
# @param [Hash] params ({})
def list_compliance_summaries(params = {}, options = {})
req = build_request(:list_compliance_summaries, params)
req.send_request(options)
end
# List all versions for a document.
#
# @option params [required, String] :name
# The name of the document about which you want version information.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::ListDocumentVersionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListDocumentVersionsResult#document_versions #document_versions} => Array<Types::DocumentVersionInfo>
# * {Types::ListDocumentVersionsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_document_versions({
# name: "DocumentName", # required
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.document_versions #=> Array
# resp.document_versions[0].name #=> String
# resp.document_versions[0].document_version #=> String
# resp.document_versions[0].created_date #=> Time
# resp.document_versions[0].is_default_version #=> Boolean
# resp.document_versions[0].document_format #=> String, one of "YAML", "JSON"
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersions AWS API Documentation
#
# @overload list_document_versions(params = {})
# @param [Hash] params ({})
def list_document_versions(params = {}, options = {})
req = build_request(:list_document_versions, params)
req.send_request(options)
end
# Describes one or more of your Systems Manager documents.
#
# @option params [Array<Types::DocumentFilter>] :document_filter_list
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [Array<Types::DocumentKeyValuesFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @return [Types::ListDocumentsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListDocumentsResult#document_identifiers #document_identifiers} => Array<Types::DocumentIdentifier>
# * {Types::ListDocumentsResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_documents({
# document_filter_list: [
# {
# key: "Name", # required, accepts Name, Owner, PlatformTypes, DocumentType
# value: "DocumentFilterValue", # required
# },
# ],
# filters: [
# {
# key: "DocumentKeyValuesFilterKey",
# values: ["DocumentKeyValuesFilterValue"],
# },
# ],
# max_results: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.document_identifiers #=> Array
# resp.document_identifiers[0].name #=> String
# resp.document_identifiers[0].owner #=> String
# resp.document_identifiers[0].platform_types #=> Array
# resp.document_identifiers[0].platform_types[0] #=> String, one of "Windows", "Linux"
# resp.document_identifiers[0].document_version #=> String
# resp.document_identifiers[0].document_type #=> String, one of "Command", "Policy", "Automation"
# resp.document_identifiers[0].schema_version #=> String
# resp.document_identifiers[0].document_format #=> String, one of "YAML", "JSON"
# resp.document_identifiers[0].target_type #=> String
# resp.document_identifiers[0].tags #=> Array
# resp.document_identifiers[0].tags[0].key #=> String
# resp.document_identifiers[0].tags[0].value #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocuments AWS API Documentation
#
# @overload list_documents(params = {})
# @param [Hash] params ({})
def list_documents(params = {}, options = {})
req = build_request(:list_documents, params)
req.send_request(options)
end
# A list of inventory items returned by the request.
#
# @option params [required, String] :instance_id
# The instance ID for which you want inventory information.
#
# @option params [required, String] :type_name
# The type of inventory item for which you want information.
#
# @option params [Array<Types::InventoryFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [String] :next_token
# The token for the next set of items to return. (You received this
# token from a previous call.)
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @return [Types::ListInventoryEntriesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListInventoryEntriesResult#type_name #type_name} => String
# * {Types::ListInventoryEntriesResult#instance_id #instance_id} => String
# * {Types::ListInventoryEntriesResult#schema_version #schema_version} => String
# * {Types::ListInventoryEntriesResult#capture_time #capture_time} => String
# * {Types::ListInventoryEntriesResult#entries #entries} => Array<Hash<String,String>>
# * {Types::ListInventoryEntriesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_inventory_entries({
# instance_id: "InstanceId", # required
# type_name: "InventoryItemTypeName", # required
# filters: [
# {
# key: "InventoryFilterKey", # required
# values: ["InventoryFilterValue"], # required
# type: "Equal", # accepts Equal, NotEqual, BeginWith, LessThan, GreaterThan
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.type_name #=> String
# resp.instance_id #=> String
# resp.schema_version #=> String
# resp.capture_time #=> String
# resp.entries #=> Array
# resp.entries[0] #=> Hash
# resp.entries[0]["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntries AWS API Documentation
#
# @overload list_inventory_entries(params = {})
# @param [Hash] params ({})
def list_inventory_entries(params = {}, options = {})
req = build_request(:list_inventory_entries, params)
req.send_request(options)
end
# Returns a resource-level summary count. The summary includes
# information about compliant and non-compliant statuses and detailed
# compliance-item severity counts, according to the filter criteria you
# specify.
#
# @option params [Array<Types::ComplianceStringFilter>] :filters
# One or more filters. Use a filter to return a more specific list of
# results.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @return [Types::ListResourceComplianceSummariesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListResourceComplianceSummariesResult#resource_compliance_summary_items #resource_compliance_summary_items} => Array<Types::ResourceComplianceSummaryItem>
# * {Types::ListResourceComplianceSummariesResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_resource_compliance_summaries({
# filters: [
# {
# key: "ComplianceStringFilterKey",
# values: ["ComplianceFilterValue"],
# type: "EQUAL", # accepts EQUAL, NOT_EQUAL, BEGIN_WITH, LESS_THAN, GREATER_THAN
# },
# ],
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.resource_compliance_summary_items #=> Array
# resp.resource_compliance_summary_items[0].compliance_type #=> String
# resp.resource_compliance_summary_items[0].resource_type #=> String
# resp.resource_compliance_summary_items[0].resource_id #=> String
# resp.resource_compliance_summary_items[0].status #=> String, one of "COMPLIANT", "NON_COMPLIANT"
# resp.resource_compliance_summary_items[0].overall_severity #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.resource_compliance_summary_items[0].execution_summary.execution_time #=> Time
# resp.resource_compliance_summary_items[0].execution_summary.execution_id #=> String
# resp.resource_compliance_summary_items[0].execution_summary.execution_type #=> String
# resp.resource_compliance_summary_items[0].compliant_summary.compliant_count #=> Integer
# resp.resource_compliance_summary_items[0].compliant_summary.severity_summary.critical_count #=> Integer
# resp.resource_compliance_summary_items[0].compliant_summary.severity_summary.high_count #=> Integer
# resp.resource_compliance_summary_items[0].compliant_summary.severity_summary.medium_count #=> Integer
# resp.resource_compliance_summary_items[0].compliant_summary.severity_summary.low_count #=> Integer
# resp.resource_compliance_summary_items[0].compliant_summary.severity_summary.informational_count #=> Integer
# resp.resource_compliance_summary_items[0].compliant_summary.severity_summary.unspecified_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.non_compliant_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.severity_summary.critical_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.severity_summary.high_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.severity_summary.medium_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.severity_summary.low_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.severity_summary.informational_count #=> Integer
# resp.resource_compliance_summary_items[0].non_compliant_summary.severity_summary.unspecified_count #=> Integer
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListResourceComplianceSummaries AWS API Documentation
#
# @overload list_resource_compliance_summaries(params = {})
# @param [Hash] params ({})
def list_resource_compliance_summaries(params = {}, options = {})
req = build_request(:list_resource_compliance_summaries, params)
req.send_request(options)
end
# Lists your resource data sync configurations. Includes information
# about the last time a sync attempted to start, the last sync status,
# and the last time a sync successfully completed.
#
# The number of sync configurations might be too large to return using a
# single call to `ListResourceDataSync`. You can limit the number of
# sync configurations returned by using the `MaxResults` parameter. To
# determine whether there are more sync configurations to list, check
# the value of `NextToken` in the output. If there are more sync
# configurations to list, you can request them by specifying the
# `NextToken` returned in the call to the parameter of a subsequent
# call.
#
# @option params [String] :next_token
# A token to start the list. Use this token to get the next set of
# results.
#
# @option params [Integer] :max_results
# The maximum number of items to return for this call. The call also
# returns a token that you can specify in a subsequent call to get the
# next set of results.
#
# @return [Types::ListResourceDataSyncResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListResourceDataSyncResult#resource_data_sync_items #resource_data_sync_items} => Array<Types::ResourceDataSyncItem>
# * {Types::ListResourceDataSyncResult#next_token #next_token} => String
#
# @example Request syntax with placeholder values
#
# resp = client.list_resource_data_sync({
# next_token: "NextToken",
# max_results: 1,
# })
#
# @example Response structure
#
# resp.resource_data_sync_items #=> Array
# resp.resource_data_sync_items[0].sync_name #=> String
# resp.resource_data_sync_items[0].s3_destination.bucket_name #=> String
# resp.resource_data_sync_items[0].s3_destination.prefix #=> String
# resp.resource_data_sync_items[0].s3_destination.sync_format #=> String, one of "JsonSerDe"
# resp.resource_data_sync_items[0].s3_destination.region #=> String
# resp.resource_data_sync_items[0].s3_destination.awskms_key_arn #=> String
# resp.resource_data_sync_items[0].last_sync_time #=> Time
# resp.resource_data_sync_items[0].last_successful_sync_time #=> Time
# resp.resource_data_sync_items[0].last_status #=> String, one of "Successful", "Failed", "InProgress"
# resp.resource_data_sync_items[0].sync_created_time #=> Time
# resp.resource_data_sync_items[0].last_sync_status_message #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListResourceDataSync AWS API Documentation
#
# @overload list_resource_data_sync(params = {})
# @param [Hash] params ({})
def list_resource_data_sync(params = {}, options = {})
req = build_request(:list_resource_data_sync, params)
req.send_request(options)
end
# Returns a list of the tags assigned to the specified resource.
#
# @option params [required, String] :resource_type
# Returns a list of tags for a specific resource type.
#
# @option params [required, String] :resource_id
# The resource ID for which you want to see a list of tags.
#
# @return [Types::ListTagsForResourceResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::ListTagsForResourceResult#tag_list #tag_list} => Array<Types::Tag>
#
# @example Request syntax with placeholder values
#
# resp = client.list_tags_for_resource({
# resource_type: "Document", # required, accepts Document, ManagedInstance, MaintenanceWindow, Parameter, PatchBaseline
# resource_id: "ResourceId", # required
# })
#
# @example Response structure
#
# resp.tag_list #=> Array
# resp.tag_list[0].key #=> String
# resp.tag_list[0].value #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListTagsForResource AWS API Documentation
#
# @overload list_tags_for_resource(params = {})
# @param [Hash] params ({})
def list_tags_for_resource(params = {}, options = {})
req = build_request(:list_tags_for_resource, params)
req.send_request(options)
end
# Shares a Systems Manager document publicly or privately. If you share
# a document privately, you must specify the AWS user account IDs for
# those people who can use the document. If you share a document
# publicly, you must specify *All* as the account ID.
#
# @option params [required, String] :name
# The name of the document that you want to share.
#
# @option params [required, String] :permission_type
# The permission type for the document. The permission type can be
# *Share*.
#
# @option params [Array<String>] :account_ids_to_add
# The AWS user accounts that should have access to the document. The
# account IDs can either be a group of account IDs or *All*.
#
# @option params [Array<String>] :account_ids_to_remove
# The AWS user accounts that should no longer have access to the
# document. The AWS user account can either be a group of account IDs or
# *All*. This action has a higher priority than *AccountIdsToAdd*. If
# you specify an account ID to add and the same ID to remove, the system
# removes access to the document.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.modify_document_permission({
# name: "DocumentName", # required
# permission_type: "Share", # required, accepts Share
# account_ids_to_add: ["AccountId"],
# account_ids_to_remove: ["AccountId"],
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermission AWS API Documentation
#
# @overload modify_document_permission(params = {})
# @param [Hash] params ({})
def modify_document_permission(params = {}, options = {})
req = build_request(:modify_document_permission, params)
req.send_request(options)
end
# Registers a compliance type and other compliance details on a
# designated resource. This action lets you register custom compliance
# details with a resource. This call overwrites existing compliance
# information on the resource, so you must provide a full list of
# compliance items each time that you send the request.
#
# ComplianceType can be one of the following:
#
# * ExecutionId: The execution ID when the patch, association, or custom
# compliance item was applied.
#
# * ExecutionType: Specify patch, association, or Custom:`string`.
#
# * ExecutionTime. The time the patch, association, or custom compliance
# item was applied to the instance.
#
# * Id: The patch, association, or custom compliance ID.
#
# * Title: A title.
#
# * Status: The status of the compliance item. For example, `approved`
# for patches, or `Failed` for associations.
#
# * Severity: A patch severity. For example, `critical`.
#
# * DocumentName: A SSM document name. For example,
# AWS-RunPatchBaseline.
#
# * DocumentVersion: An SSM document version number. For example, 4.
#
# * Classification: A patch classification. For example, `security
# updates`.
#
# * PatchBaselineId: A patch baseline ID.
#
# * PatchSeverity: A patch severity. For example, `Critical`.
#
# * PatchState: A patch state. For example,
# `InstancesWithFailedPatches`.
#
# * PatchGroup: The name of a patch group.
#
# * InstalledTime: The time the association, patch, or custom compliance
# item was applied to the resource. Specify the time by using the
# following format: yyyy-MM-dd'T'HH:mm:ss'Z'
#
# @option params [required, String] :resource_id
# Specify an ID for this resource. For a managed instance, this is the
# instance ID.
#
# @option params [required, String] :resource_type
# Specify the type of resource. `ManagedInstance` is currently the only
# supported resource type.
#
# @option params [required, String] :compliance_type
# Specify the compliance type. For example, specify Association (for a
# State Manager association), Patch, or Custom:`string`.
#
# @option params [required, Types::ComplianceExecutionSummary] :execution_summary
# A summary of the call execution that includes an execution ID, the
# type of execution (for example, `Command`), and the date/time of the
# execution using a datetime object that is saved in the following
# format: yyyy-MM-dd'T'HH:mm:ss'Z'.
#
# @option params [required, Array<Types::ComplianceItemEntry>] :items
# Information about the compliance as defined by the resource type. For
# example, for a patch compliance type, `Items` includes information
# about the PatchSeverity, Classification, etc.
#
# @option params [String] :item_content_hash
# MD5 or SHA-256 content hash. The content hash is used to determine if
# existing information should be overwritten or ignored. If the content
# hashes match, the request to put compliance information is ignored.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.put_compliance_items({
# resource_id: "ComplianceResourceId", # required
# resource_type: "ComplianceResourceType", # required
# compliance_type: "ComplianceTypeName", # required
# execution_summary: { # required
# execution_time: Time.now, # required
# execution_id: "ComplianceExecutionId",
# execution_type: "ComplianceExecutionType",
# },
# items: [ # required
# {
# id: "ComplianceItemId",
# title: "ComplianceItemTitle",
# severity: "CRITICAL", # required, accepts CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED
# status: "COMPLIANT", # required, accepts COMPLIANT, NON_COMPLIANT
# details: {
# "AttributeName" => "AttributeValue",
# },
# },
# ],
# item_content_hash: "ComplianceItemContentHash",
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutComplianceItems AWS API Documentation
#
# @overload put_compliance_items(params = {})
# @param [Hash] params ({})
def put_compliance_items(params = {}, options = {})
req = build_request(:put_compliance_items, params)
req.send_request(options)
end
# Bulk update custom inventory items on one more instance. The request
# adds an inventory item, if it doesn't already exist, or updates an
# inventory item, if it does exist.
#
# @option params [required, String] :instance_id
# One or more instance IDs where you want to add or update inventory
# items.
#
# @option params [required, Array<Types::InventoryItem>] :items
# The inventory items that you want to add or update on instances.
#
# @return [Types::PutInventoryResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::PutInventoryResult#message #message} => String
#
# @example Request syntax with placeholder values
#
# resp = client.put_inventory({
# instance_id: "InstanceId", # required
# items: [ # required
# {
# type_name: "InventoryItemTypeName", # required
# schema_version: "InventoryItemSchemaVersion", # required
# capture_time: "InventoryItemCaptureTime", # required
# content_hash: "InventoryItemContentHash",
# content: [
# {
# "AttributeName" => "AttributeValue",
# },
# ],
# context: {
# "AttributeName" => "AttributeValue",
# },
# },
# ],
# })
#
# @example Response structure
#
# resp.message #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventory AWS API Documentation
#
# @overload put_inventory(params = {})
# @param [Hash] params ({})
def put_inventory(params = {}, options = {})
req = build_request(:put_inventory, params)
req.send_request(options)
end
# Add a parameter to the system.
#
# @option params [required, String] :name
# The fully qualified name of the parameter that you want to add to the
# system. The fully qualified name includes the complete hierarchy of
# the parameter path and name. For example:
# `/Dev/DBServer/MySQL/db-string13`
#
# Naming Constraints:
#
# * Parameter names are case sensitive.
#
# * A parameter name must be unique within an AWS Region
#
# * A parameter name can't be prefixed with "aws" or "ssm"
# (case-insensitive).
#
# * Parameter names can include only the following symbols and letters:
# `a-zA-Z0-9_.-/`
#
# * A parameter name can't include spaces.
#
# * Parameter hierarchies are limited to a maximum depth of fifteen
# levels.
#
# For additional information about valid values for parameter names, see
# [Requirements and Constraints for Parameter Names][1] in the *AWS
# Systems Manager User Guide*.
#
# <note markdown="1"> The maximum length constraint listed below includes capacity for
# additional system attributes that are not part of the name. The
# maximum length for the fully qualified parameter name is 1011
# characters.
#
# </note>
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html
#
# @option params [String] :description
# Information about the parameter that you want to add to the system.
# Optional but recommended.
#
# Do not enter personally identifiable information in this field.
#
# @option params [required, String] :value
# The parameter value that you want to add to the system.
#
# @option params [required, String] :type
# The type of parameter that you want to add to the system.
#
# Items in a `StringList` must be separated by a comma (,). You can't
# use other punctuation or special character to escape items in the
# list. If you have a parameter value that requires a comma, then use
# the `String` data type.
#
# <note markdown="1"> `SecureString` is not currently supported for AWS CloudFormation
# templates or in the China Regions.
#
# </note>
#
# @option params [String] :key_id
# The KMS Key ID that you want to use to encrypt a parameter. Either the
# default AWS Key Management Service (AWS KMS) key automatically
# assigned to your AWS account or a custom key. Required for parameters
# that use the `SecureString` data type.
#
# If you don't specify a key ID, the system uses the default key
# associated with your AWS account.
#
# * To use your default AWS KMS key, choose the `SecureString` data
# type, and do *not* specify the `Key ID` when you create the
# parameter. The system automatically populates `Key ID` with your
# default KMS key.
#
# * To use a custom KMS key, choose the `SecureString` data type with
# the `Key ID` parameter.
#
# @option params [Boolean] :overwrite
# Overwrite an existing parameter. If not specified, will default to
# "false".
#
# @option params [String] :allowed_pattern
# A regular expression used to validate the parameter value. For
# example, for String types with values restricted to numbers, you can
# specify the following: AllowedPattern=^\\d+$
#
# @return [Types::PutParameterResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::PutParameterResult#version #version} => Integer
#
# @example Request syntax with placeholder values
#
# resp = client.put_parameter({
# name: "PSParameterName", # required
# description: "ParameterDescription",
# value: "PSParameterValue", # required
# type: "String", # required, accepts String, StringList, SecureString
# key_id: "ParameterKeyId",
# overwrite: false,
# allowed_pattern: "AllowedPattern",
# })
#
# @example Response structure
#
# resp.version #=> Integer
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutParameter AWS API Documentation
#
# @overload put_parameter(params = {})
# @param [Hash] params ({})
def put_parameter(params = {}, options = {})
req = build_request(:put_parameter, params)
req.send_request(options)
end
# Defines the default patch baseline.
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline that should be the default patch
# baseline.
#
# @return [Types::RegisterDefaultPatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::RegisterDefaultPatchBaselineResult#baseline_id #baseline_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.register_default_patch_baseline({
# baseline_id: "BaselineId", # required
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaseline AWS API Documentation
#
# @overload register_default_patch_baseline(params = {})
# @param [Hash] params ({})
def register_default_patch_baseline(params = {}, options = {})
req = build_request(:register_default_patch_baseline, params)
req.send_request(options)
end
# Registers a patch baseline for a patch group.
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline to register the patch group with.
#
# @option params [required, String] :patch_group
# The name of the patch group that should be registered with the patch
# baseline.
#
# @return [Types::RegisterPatchBaselineForPatchGroupResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::RegisterPatchBaselineForPatchGroupResult#baseline_id #baseline_id} => String
# * {Types::RegisterPatchBaselineForPatchGroupResult#patch_group #patch_group} => String
#
# @example Request syntax with placeholder values
#
# resp = client.register_patch_baseline_for_patch_group({
# baseline_id: "BaselineId", # required
# patch_group: "PatchGroup", # required
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
# resp.patch_group #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroup AWS API Documentation
#
# @overload register_patch_baseline_for_patch_group(params = {})
# @param [Hash] params ({})
def register_patch_baseline_for_patch_group(params = {}, options = {})
req = build_request(:register_patch_baseline_for_patch_group, params)
req.send_request(options)
end
# Registers a target with a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window the target should be registered with.
#
# @option params [required, String] :resource_type
# The type of target being registered with the Maintenance Window.
#
# @option params [required, Array<Types::Target>] :targets
# The targets (either instances or tags).
#
# Specify instances using the following format:
#
# `Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>`
#
# Specify tags using either of the following formats:
#
# `Key=tag:<tag-key>,Values=<tag-value-1>,<tag-value-2>`
#
# `Key=tag-key,Values=<tag-key-1>,<tag-key-2>`
#
# @option params [String] :owner_information
# User-provided value that will be included in any CloudWatch events
# raised while running tasks for these targets in this Maintenance
# Window.
#
# @option params [String] :name
# An optional name for the target.
#
# @option params [String] :description
# An optional description for the target.
#
# @option params [String] :client_token
# User-provided idempotency token.
#
# **A suitable default value is auto-generated.** You should normally
# not need to pass this option.**
#
# @return [Types::RegisterTargetWithMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::RegisterTargetWithMaintenanceWindowResult#window_target_id #window_target_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.register_target_with_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# resource_type: "INSTANCE", # required, accepts INSTANCE
# targets: [ # required
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# owner_information: "OwnerInformation",
# name: "MaintenanceWindowName",
# description: "MaintenanceWindowDescription",
# client_token: "ClientToken",
# })
#
# @example Response structure
#
# resp.window_target_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindow AWS API Documentation
#
# @overload register_target_with_maintenance_window(params = {})
# @param [Hash] params ({})
def register_target_with_maintenance_window(params = {}, options = {})
req = build_request(:register_target_with_maintenance_window, params)
req.send_request(options)
end
# Adds a new task to a Maintenance Window.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window the task should be added to.
#
# @option params [required, Array<Types::Target>] :targets
# The targets (either instances or Maintenance Window targets).
#
# Specify instances using the following format:
#
# `Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>`
#
# Specify Maintenance Window targets using the following format:
#
# `Key=<WindowTargetIds>,Values=<window-target-id-1>,<window-target-id-2>`
#
# @option params [required, String] :task_arn
# The ARN of the task to execute
#
# @option params [required, String] :service_role_arn
# The role that should be assumed when executing the task.
#
# @option params [required, String] :task_type
# The type of task being registered.
#
# @option params [Hash<String,Types::MaintenanceWindowTaskParameterValueExpression>] :task_parameters
# The parameters that should be passed to the task when it is executed.
#
# <note markdown="1"> `TaskParameters` has been deprecated. To specify parameters to pass to
# a task when it runs, instead use the `Parameters` option in the
# `TaskInvocationParameters` structure. For information about how
# Systems Manager handles these options for the supported Maintenance
# Window task types, see MaintenanceWindowTaskInvocationParameters.
#
# </note>
#
# @option params [Types::MaintenanceWindowTaskInvocationParameters] :task_invocation_parameters
# The parameters that the task should use during execution. Populate
# only the fields that match the task type. All other fields should be
# empty.
#
# @option params [Integer] :priority
# The priority of the task in the Maintenance Window, the lower the
# number the higher the priority. Tasks in a Maintenance Window are
# scheduled in priority order with tasks that have the same priority
# scheduled in parallel.
#
# @option params [required, String] :max_concurrency
# The maximum number of targets this task can be run for in parallel.
#
# @option params [required, String] :max_errors
# The maximum number of errors allowed before this task stops being
# scheduled.
#
# @option params [Types::LoggingInfo] :logging_info
# A structure containing information about an Amazon S3 bucket to write
# instance-level logs to.
#
# <note markdown="1"> `LoggingInfo` has been deprecated. To specify an S3 bucket to contain
# logs, instead use the `OutputS3BucketName` and `OutputS3KeyPrefix`
# options in the `TaskInvocationParameters` structure. For information
# about how Systems Manager handles these options for the supported
# Maintenance Window task types, see
# MaintenanceWindowTaskInvocationParameters.
#
# </note>
#
# @option params [String] :name
# An optional name for the task.
#
# @option params [String] :description
# An optional description for the task.
#
# @option params [String] :client_token
# User-provided idempotency token.
#
# **A suitable default value is auto-generated.** You should normally
# not need to pass this option.**
#
# @return [Types::RegisterTaskWithMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::RegisterTaskWithMaintenanceWindowResult#window_task_id #window_task_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.register_task_with_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# targets: [ # required
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# task_arn: "MaintenanceWindowTaskArn", # required
# service_role_arn: "ServiceRole", # required
# task_type: "RUN_COMMAND", # required, accepts RUN_COMMAND, AUTOMATION, STEP_FUNCTIONS, LAMBDA
# task_parameters: {
# "MaintenanceWindowTaskParameterName" => {
# values: ["MaintenanceWindowTaskParameterValue"],
# },
# },
# task_invocation_parameters: {
# run_command: {
# comment: "Comment",
# document_hash: "DocumentHash",
# document_hash_type: "Sha256", # accepts Sha256, Sha1
# notification_config: {
# notification_arn: "NotificationArn",
# notification_events: ["All"], # accepts All, InProgress, Success, TimedOut, Cancelled, Failed
# notification_type: "Command", # accepts Command, Invocation
# },
# output_s3_bucket_name: "S3BucketName",
# output_s3_key_prefix: "S3KeyPrefix",
# parameters: {
# "ParameterName" => ["ParameterValue"],
# },
# service_role_arn: "ServiceRole",
# timeout_seconds: 1,
# },
# automation: {
# document_version: "DocumentVersion",
# parameters: {
# "AutomationParameterKey" => ["AutomationParameterValue"],
# },
# },
# step_functions: {
# input: "MaintenanceWindowStepFunctionsInput",
# name: "MaintenanceWindowStepFunctionsName",
# },
# lambda: {
# client_context: "MaintenanceWindowLambdaClientContext",
# qualifier: "MaintenanceWindowLambdaQualifier",
# payload: "data",
# },
# },
# priority: 1,
# max_concurrency: "MaxConcurrency", # required
# max_errors: "MaxErrors", # required
# logging_info: {
# s3_bucket_name: "S3BucketName", # required
# s3_key_prefix: "S3KeyPrefix",
# s3_region: "S3Region", # required
# },
# name: "MaintenanceWindowName",
# description: "MaintenanceWindowDescription",
# client_token: "ClientToken",
# })
#
# @example Response structure
#
# resp.window_task_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindow AWS API Documentation
#
# @overload register_task_with_maintenance_window(params = {})
# @param [Hash] params ({})
def register_task_with_maintenance_window(params = {}, options = {})
req = build_request(:register_task_with_maintenance_window, params)
req.send_request(options)
end
# Removes all tags from the specified resource.
#
# @option params [required, String] :resource_type
# The type of resource of which you want to remove a tag.
#
# <note markdown="1"> The ManagedInstance type for this API action is only for on-premises
# managed instances. You must specify the the name of the managed
# instance in the following format: mi-ID\_number. For example,
# mi-1a2b3c4d5e6f.
#
# </note>
#
# @option params [required, String] :resource_id
# The resource ID for which you want to remove tags. Use the ID of the
# resource. Here are some examples:
#
# ManagedInstance: mi-012345abcde
#
# MaintenanceWindow: mw-012345abcde
#
# PatchBaseline: pb-012345abcde
#
# For the Document and Parameter values, use the name of the resource.
#
# <note markdown="1"> The ManagedInstance type for this API action is only for on-premises
# managed instances. You must specify the the name of the managed
# instance in the following format: mi-ID\_number. For example,
# mi-1a2b3c4d5e6f.
#
# </note>
#
# @option params [required, Array<String>] :tag_keys
# Tag keys that you want to remove from the specified resource.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.remove_tags_from_resource({
# resource_type: "Document", # required, accepts Document, ManagedInstance, MaintenanceWindow, Parameter, PatchBaseline
# resource_id: "ResourceId", # required
# tag_keys: ["TagKey"], # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RemoveTagsFromResource AWS API Documentation
#
# @overload remove_tags_from_resource(params = {})
# @param [Hash] params ({})
def remove_tags_from_resource(params = {}, options = {})
req = build_request(:remove_tags_from_resource, params)
req.send_request(options)
end
# Sends a signal to an Automation execution to change the current
# behavior or status of the execution.
#
# @option params [required, String] :automation_execution_id
# The unique identifier for an existing Automation execution that you
# want to send the signal to.
#
# @option params [required, String] :signal_type
# The type of signal. Valid signal types include the following: Approve
# and Reject
#
# @option params [Hash<String,Array>] :payload
# The data sent with the signal. The data schema depends on the type of
# signal used in the request.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.send_automation_signal({
# automation_execution_id: "AutomationExecutionId", # required
# signal_type: "Approve", # required, accepts Approve, Reject, StartStep, StopStep, Resume
# payload: {
# "AutomationParameterKey" => ["AutomationParameterValue"],
# },
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendAutomationSignal AWS API Documentation
#
# @overload send_automation_signal(params = {})
# @param [Hash] params ({})
def send_automation_signal(params = {}, options = {})
req = build_request(:send_automation_signal, params)
req.send_request(options)
end
# Executes commands on one or more managed instances.
#
# @option params [Array<String>] :instance_ids
# The instance IDs where the command should execute. You can specify a
# maximum of 50 IDs. If you prefer not to list individual instance IDs,
# you can instead send commands to a fleet of instances using the
# Targets parameter, which accepts EC2 tags. For more information about
# how to use Targets, see [Sending Commands to a Fleet][1] in the *AWS
# Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html
#
# @option params [Array<Types::Target>] :targets
# (Optional) An array of search criteria that targets instances using a
# Key,Value combination that you specify. Targets is required if you
# don't provide one or more instance IDs in the call. For more
# information about how to use Targets, see [Sending Commands to a
# Fleet][1] in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html
#
# @option params [required, String] :document_name
# Required. The name of the Systems Manager document to execute. This
# can be a public document or a custom document.
#
# @option params [String] :document_version
# The SSM document version to use in the request. You can specify
# $DEFAULT, $LATEST, or a specific version number. If you execute
# commands by using the AWS CLI, then you must escape the first two
# options by using a backslash. If you specify a version number, then
# you don't need to use the backslash. For example:
#
# --document-version "\\$DEFAULT"
#
# --document-version "\\$LATEST"
#
# --document-version "3"
#
# @option params [String] :document_hash
# The Sha256 or Sha1 hash created by the system when the document was
# created.
#
# <note markdown="1"> Sha1 hashes have been deprecated.
#
# </note>
#
# @option params [String] :document_hash_type
# Sha256 or Sha1.
#
# <note markdown="1"> Sha1 hashes have been deprecated.
#
# </note>
#
# @option params [Integer] :timeout_seconds
# If this time is reached and the command has not already started
# executing, it will not run.
#
# @option params [String] :comment
# User-specified information about the command, such as a brief
# description of what the command should do.
#
# @option params [Hash<String,Array>] :parameters
# The required and optional parameters specified in the document being
# executed.
#
# @option params [String] :output_s3_region
# (Deprecated) You can no longer specify this parameter. The system
# ignores it. Instead, Systems Manager automatically determines the
# Amazon S3 bucket region.
#
# @option params [String] :output_s3_bucket_name
# The name of the S3 bucket where command execution responses should be
# stored.
#
# @option params [String] :output_s3_key_prefix
# The directory structure within the S3 bucket where the responses
# should be stored.
#
# @option params [String] :max_concurrency
# (Optional) The maximum number of instances that are allowed to execute
# the command at the same time. You can specify a number such as 10 or a
# percentage such as 10%. The default value is 50. For more information
# about how to use MaxConcurrency, see [Using Concurrency Controls][1]
# in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-velocity
#
# @option params [String] :max_errors
# The maximum number of errors allowed without the command failing. When
# the command fails one more time beyond the value of MaxErrors, the
# systems stops sending the command to additional targets. You can
# specify a number like 10 or a percentage like 10%. The default value
# is 0. For more information about how to use MaxErrors, see [Using
# Error Controls][1] in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-maxerrors
#
# @option params [String] :service_role_arn
# The IAM role that Systems Manager uses to send notifications.
#
# @option params [Types::NotificationConfig] :notification_config
# Configurations for sending notifications.
#
# @option params [Types::CloudWatchOutputConfig] :cloud_watch_output_config
# Enables Systems Manager to send Run Command output to Amazon
# CloudWatch Logs.
#
# @return [Types::SendCommandResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::SendCommandResult#command #command} => Types::Command
#
# @example Request syntax with placeholder values
#
# resp = client.send_command({
# instance_ids: ["InstanceId"],
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# document_name: "DocumentARN", # required
# document_version: "DocumentVersion",
# document_hash: "DocumentHash",
# document_hash_type: "Sha256", # accepts Sha256, Sha1
# timeout_seconds: 1,
# comment: "Comment",
# parameters: {
# "ParameterName" => ["ParameterValue"],
# },
# output_s3_region: "S3Region",
# output_s3_bucket_name: "S3BucketName",
# output_s3_key_prefix: "S3KeyPrefix",
# max_concurrency: "MaxConcurrency",
# max_errors: "MaxErrors",
# service_role_arn: "ServiceRole",
# notification_config: {
# notification_arn: "NotificationArn",
# notification_events: ["All"], # accepts All, InProgress, Success, TimedOut, Cancelled, Failed
# notification_type: "Command", # accepts Command, Invocation
# },
# cloud_watch_output_config: {
# cloud_watch_log_group_name: "CloudWatchLogGroupName",
# cloud_watch_output_enabled: false,
# },
# })
#
# @example Response structure
#
# resp.command.command_id #=> String
# resp.command.document_name #=> String
# resp.command.document_version #=> String
# resp.command.comment #=> String
# resp.command.expires_after #=> Time
# resp.command.parameters #=> Hash
# resp.command.parameters["ParameterName"] #=> Array
# resp.command.parameters["ParameterName"][0] #=> String
# resp.command.instance_ids #=> Array
# resp.command.instance_ids[0] #=> String
# resp.command.targets #=> Array
# resp.command.targets[0].key #=> String
# resp.command.targets[0].values #=> Array
# resp.command.targets[0].values[0] #=> String
# resp.command.requested_date_time #=> Time
# resp.command.status #=> String, one of "Pending", "InProgress", "Success", "Cancelled", "Failed", "TimedOut", "Cancelling"
# resp.command.status_details #=> String
# resp.command.output_s3_region #=> String
# resp.command.output_s3_bucket_name #=> String
# resp.command.output_s3_key_prefix #=> String
# resp.command.max_concurrency #=> String
# resp.command.max_errors #=> String
# resp.command.target_count #=> Integer
# resp.command.completed_count #=> Integer
# resp.command.error_count #=> Integer
# resp.command.delivery_timed_out_count #=> Integer
# resp.command.service_role #=> String
# resp.command.notification_config.notification_arn #=> String
# resp.command.notification_config.notification_events #=> Array
# resp.command.notification_config.notification_events[0] #=> String, one of "All", "InProgress", "Success", "TimedOut", "Cancelled", "Failed"
# resp.command.notification_config.notification_type #=> String, one of "Command", "Invocation"
# resp.command.cloud_watch_output_config.cloud_watch_log_group_name #=> String
# resp.command.cloud_watch_output_config.cloud_watch_output_enabled #=> Boolean
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendCommand AWS API Documentation
#
# @overload send_command(params = {})
# @param [Hash] params ({})
def send_command(params = {}, options = {})
req = build_request(:send_command, params)
req.send_request(options)
end
# Use this API action to execute an association immediately and only one
# time. This action can be helpful when troubleshooting associations.
#
# @option params [required, Array<String>] :association_ids
# The association IDs that you want to execute immediately and only one
# time.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.start_associations_once({
# association_ids: ["AssociationId"], # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAssociationsOnce AWS API Documentation
#
# @overload start_associations_once(params = {})
# @param [Hash] params ({})
def start_associations_once(params = {}, options = {})
req = build_request(:start_associations_once, params)
req.send_request(options)
end
# Initiates execution of an Automation document.
#
# @option params [required, String] :document_name
# The name of the Automation document to use for this execution.
#
# @option params [String] :document_version
# The version of the Automation document to use for this execution.
#
# @option params [Hash<String,Array>] :parameters
# A key-value map of execution parameters, which match the declared
# parameters in the Automation document.
#
# @option params [String] :client_token
# User-provided idempotency token. The token must be unique, is case
# insensitive, enforces the UUID format, and can't be reused.
#
# @option params [String] :mode
# The execution mode of the automation. Valid modes include the
# following: Auto and Interactive. The default mode is Auto.
#
# @option params [String] :target_parameter_name
# The name of the parameter used as the target resource for the
# rate-controlled execution. Required if you specify Targets.
#
# @option params [Array<Types::Target>] :targets
# A key-value mapping to target resources. Required if you specify
# TargetParameterName.
#
# @option params [String] :max_concurrency
# The maximum number of targets allowed to run this task in parallel.
# You can specify a number, such as 10, or a percentage, such as 10%.
# The default value is 10.
#
# @option params [String] :max_errors
# The number of errors that are allowed before the system stops running
# the automation on additional targets. You can specify either an
# absolute number of errors, for example 10, or a percentage of the
# target set, for example 10%. If you specify 3, for example, the system
# stops running the automation when the fourth error is received. If you
# specify 0, then the system stops running the automation on additional
# targets after the first error result is returned. If you run an
# automation on 50 resources and set max-errors to 10%, then the system
# stops running the automation on additional targets when the sixth
# error is received.
#
# Executions that are already running an automation when max-errors is
# reached are allowed to complete, but some of these executions may fail
# as well. If you need to ensure that there won't be more than
# max-errors failed executions, set max-concurrency to 1 so the
# executions proceed one at a time.
#
# @return [Types::StartAutomationExecutionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::StartAutomationExecutionResult#automation_execution_id #automation_execution_id} => String
#
# @example Request syntax with placeholder values
#
# resp = client.start_automation_execution({
# document_name: "DocumentARN", # required
# document_version: "DocumentVersion",
# parameters: {
# "AutomationParameterKey" => ["AutomationParameterValue"],
# },
# client_token: "IdempotencyToken",
# mode: "Auto", # accepts Auto, Interactive
# target_parameter_name: "AutomationParameterKey",
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# max_concurrency: "MaxConcurrency",
# max_errors: "MaxErrors",
# })
#
# @example Response structure
#
# resp.automation_execution_id #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecution AWS API Documentation
#
# @overload start_automation_execution(params = {})
# @param [Hash] params ({})
def start_automation_execution(params = {}, options = {})
req = build_request(:start_automation_execution, params)
req.send_request(options)
end
# Stop an Automation that is currently executing.
#
# @option params [required, String] :automation_execution_id
# The execution ID of the Automation to stop.
#
# @option params [String] :type
# The stop request type. Valid types include the following: Cancel and
# Complete. The default type is Cancel.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.stop_automation_execution({
# automation_execution_id: "AutomationExecutionId", # required
# type: "Complete", # accepts Complete, Cancel
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecution AWS API Documentation
#
# @overload stop_automation_execution(params = {})
# @param [Hash] params ({})
def stop_automation_execution(params = {}, options = {})
req = build_request(:stop_automation_execution, params)
req.send_request(options)
end
# Updates an association. You can update the association name and
# version, the document version, schedule, parameters, and Amazon S3
# output.
#
# @option params [required, String] :association_id
# The ID of the association you want to update.
#
# @option params [Hash<String,Array>] :parameters
# The parameters you want to update for the association. If you create a
# parameter using Parameter Store, you can reference the parameter using
# \\\{\\\{ssm:parameter-name\\}\\}
#
# @option params [String] :document_version
# The document version you want update for the association.
#
# @option params [String] :schedule_expression
# The cron expression used to schedule the association that you want to
# update.
#
# @option params [Types::InstanceAssociationOutputLocation] :output_location
# An Amazon S3 bucket where you want to store the results of this
# request.
#
# @option params [String] :name
# The name of the association document.
#
# @option params [Array<Types::Target>] :targets
# The targets of the association.
#
# @option params [String] :association_name
# The name of the association that you want to update.
#
# @option params [String] :association_version
# This parameter is provided for concurrency control purposes. You must
# specify the latest association version in the service. If you want to
# ensure that this request succeeds, either specify `$LATEST`, or omit
# this parameter.
#
# @return [Types::UpdateAssociationResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateAssociationResult#association_description #association_description} => Types::AssociationDescription
#
# @example Request syntax with placeholder values
#
# resp = client.update_association({
# association_id: "AssociationId", # required
# parameters: {
# "ParameterName" => ["ParameterValue"],
# },
# document_version: "DocumentVersion",
# schedule_expression: "ScheduleExpression",
# output_location: {
# s3_location: {
# output_s3_region: "S3Region",
# output_s3_bucket_name: "S3BucketName",
# output_s3_key_prefix: "S3KeyPrefix",
# },
# },
# name: "DocumentName",
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# association_name: "AssociationName",
# association_version: "AssociationVersion",
# })
#
# @example Response structure
#
# resp.association_description.name #=> String
# resp.association_description.instance_id #=> String
# resp.association_description.association_version #=> String
# resp.association_description.date #=> Time
# resp.association_description.last_update_association_date #=> Time
# resp.association_description.status.date #=> Time
# resp.association_description.status.name #=> String, one of "Pending", "Success", "Failed"
# resp.association_description.status.message #=> String
# resp.association_description.status.additional_info #=> String
# resp.association_description.overview.status #=> String
# resp.association_description.overview.detailed_status #=> String
# resp.association_description.overview.association_status_aggregated_count #=> Hash
# resp.association_description.overview.association_status_aggregated_count["StatusName"] #=> Integer
# resp.association_description.document_version #=> String
# resp.association_description.parameters #=> Hash
# resp.association_description.parameters["ParameterName"] #=> Array
# resp.association_description.parameters["ParameterName"][0] #=> String
# resp.association_description.association_id #=> String
# resp.association_description.targets #=> Array
# resp.association_description.targets[0].key #=> String
# resp.association_description.targets[0].values #=> Array
# resp.association_description.targets[0].values[0] #=> String
# resp.association_description.schedule_expression #=> String
# resp.association_description.output_location.s3_location.output_s3_region #=> String
# resp.association_description.output_location.s3_location.output_s3_bucket_name #=> String
# resp.association_description.output_location.s3_location.output_s3_key_prefix #=> String
# resp.association_description.last_execution_date #=> Time
# resp.association_description.last_successful_execution_date #=> Time
# resp.association_description.association_name #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociation AWS API Documentation
#
# @overload update_association(params = {})
# @param [Hash] params ({})
def update_association(params = {}, options = {})
req = build_request(:update_association, params)
req.send_request(options)
end
# Updates the status of the Systems Manager document associated with the
# specified instance.
#
# @option params [required, String] :name
# The name of the Systems Manager document.
#
# @option params [required, String] :instance_id
# The ID of the instance.
#
# @option params [required, Types::AssociationStatus] :association_status
# The association status.
#
# @return [Types::UpdateAssociationStatusResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateAssociationStatusResult#association_description #association_description} => Types::AssociationDescription
#
# @example Request syntax with placeholder values
#
# resp = client.update_association_status({
# name: "DocumentName", # required
# instance_id: "InstanceId", # required
# association_status: { # required
# date: Time.now, # required
# name: "Pending", # required, accepts Pending, Success, Failed
# message: "StatusMessage", # required
# additional_info: "StatusAdditionalInfo",
# },
# })
#
# @example Response structure
#
# resp.association_description.name #=> String
# resp.association_description.instance_id #=> String
# resp.association_description.association_version #=> String
# resp.association_description.date #=> Time
# resp.association_description.last_update_association_date #=> Time
# resp.association_description.status.date #=> Time
# resp.association_description.status.name #=> String, one of "Pending", "Success", "Failed"
# resp.association_description.status.message #=> String
# resp.association_description.status.additional_info #=> String
# resp.association_description.overview.status #=> String
# resp.association_description.overview.detailed_status #=> String
# resp.association_description.overview.association_status_aggregated_count #=> Hash
# resp.association_description.overview.association_status_aggregated_count["StatusName"] #=> Integer
# resp.association_description.document_version #=> String
# resp.association_description.parameters #=> Hash
# resp.association_description.parameters["ParameterName"] #=> Array
# resp.association_description.parameters["ParameterName"][0] #=> String
# resp.association_description.association_id #=> String
# resp.association_description.targets #=> Array
# resp.association_description.targets[0].key #=> String
# resp.association_description.targets[0].values #=> Array
# resp.association_description.targets[0].values[0] #=> String
# resp.association_description.schedule_expression #=> String
# resp.association_description.output_location.s3_location.output_s3_region #=> String
# resp.association_description.output_location.s3_location.output_s3_bucket_name #=> String
# resp.association_description.output_location.s3_location.output_s3_key_prefix #=> String
# resp.association_description.last_execution_date #=> Time
# resp.association_description.last_successful_execution_date #=> Time
# resp.association_description.association_name #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateAssociationStatus AWS API Documentation
#
# @overload update_association_status(params = {})
# @param [Hash] params ({})
def update_association_status(params = {}, options = {})
req = build_request(:update_association_status, params)
req.send_request(options)
end
# The document you want to update.
#
# @option params [required, String] :content
# The content in a document that you want to update.
#
# @option params [required, String] :name
# The name of the document that you want to update.
#
# @option params [String] :document_version
# The version of the document that you want to update.
#
# @option params [String] :document_format
# Specify the document format for the new document version. Systems
# Manager supports JSON and YAML documents. JSON is the default format.
#
# @option params [String] :target_type
# Specify a new target type for the document.
#
# @return [Types::UpdateDocumentResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateDocumentResult#document_description #document_description} => Types::DocumentDescription
#
# @example Request syntax with placeholder values
#
# resp = client.update_document({
# content: "DocumentContent", # required
# name: "DocumentName", # required
# document_version: "DocumentVersion",
# document_format: "YAML", # accepts YAML, JSON
# target_type: "TargetType",
# })
#
# @example Response structure
#
# resp.document_description.sha_1 #=> String
# resp.document_description.hash #=> String
# resp.document_description.hash_type #=> String, one of "Sha256", "Sha1"
# resp.document_description.name #=> String
# resp.document_description.owner #=> String
# resp.document_description.created_date #=> Time
# resp.document_description.status #=> String, one of "Creating", "Active", "Updating", "Deleting"
# resp.document_description.document_version #=> String
# resp.document_description.description #=> String
# resp.document_description.parameters #=> Array
# resp.document_description.parameters[0].name #=> String
# resp.document_description.parameters[0].type #=> String, one of "String", "StringList"
# resp.document_description.parameters[0].description #=> String
# resp.document_description.parameters[0].default_value #=> String
# resp.document_description.platform_types #=> Array
# resp.document_description.platform_types[0] #=> String, one of "Windows", "Linux"
# resp.document_description.document_type #=> String, one of "Command", "Policy", "Automation"
# resp.document_description.schema_version #=> String
# resp.document_description.latest_version #=> String
# resp.document_description.default_version #=> String
# resp.document_description.document_format #=> String, one of "YAML", "JSON"
# resp.document_description.target_type #=> String
# resp.document_description.tags #=> Array
# resp.document_description.tags[0].key #=> String
# resp.document_description.tags[0].value #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocument AWS API Documentation
#
# @overload update_document(params = {})
# @param [Hash] params ({})
def update_document(params = {}, options = {})
req = build_request(:update_document, params)
req.send_request(options)
end
# Set the default version of a document.
#
# @option params [required, String] :name
# The name of a custom document that you want to set as the default
# version.
#
# @option params [required, String] :document_version
# The version of a custom document that you want to set as the default
# version.
#
# @return [Types::UpdateDocumentDefaultVersionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateDocumentDefaultVersionResult#description #description} => Types::DocumentDefaultVersionDescription
#
# @example Request syntax with placeholder values
#
# resp = client.update_document_default_version({
# name: "DocumentName", # required
# document_version: "DocumentVersionNumber", # required
# })
#
# @example Response structure
#
# resp.description.name #=> String
# resp.description.default_version #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersion AWS API Documentation
#
# @overload update_document_default_version(params = {})
# @param [Hash] params ({})
def update_document_default_version(params = {}, options = {})
req = build_request(:update_document_default_version, params)
req.send_request(options)
end
# Updates an existing Maintenance Window. Only specified parameters are
# modified.
#
# @option params [required, String] :window_id
# The ID of the Maintenance Window to update.
#
# @option params [String] :name
# The name of the Maintenance Window.
#
# @option params [String] :description
# An optional description for the update request.
#
# @option params [String] :schedule
# The schedule of the Maintenance Window in the form of a cron or rate
# expression.
#
# @option params [Integer] :duration
# The duration of the Maintenance Window in hours.
#
# @option params [Integer] :cutoff
# The number of hours before the end of the Maintenance Window that
# Systems Manager stops scheduling new tasks for execution.
#
# @option params [Boolean] :allow_unassociated_targets
# Whether targets must be registered with the Maintenance Window before
# tasks can be defined for those targets.
#
# @option params [Boolean] :enabled
# Whether the Maintenance Window is enabled.
#
# @option params [Boolean] :replace
# If True, then all fields that are required by the
# CreateMaintenanceWindow action are also required for this API request.
# Optional fields that are not specified are set to null.
#
# @return [Types::UpdateMaintenanceWindowResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateMaintenanceWindowResult#window_id #window_id} => String
# * {Types::UpdateMaintenanceWindowResult#name #name} => String
# * {Types::UpdateMaintenanceWindowResult#description #description} => String
# * {Types::UpdateMaintenanceWindowResult#schedule #schedule} => String
# * {Types::UpdateMaintenanceWindowResult#duration #duration} => Integer
# * {Types::UpdateMaintenanceWindowResult#cutoff #cutoff} => Integer
# * {Types::UpdateMaintenanceWindowResult#allow_unassociated_targets #allow_unassociated_targets} => Boolean
# * {Types::UpdateMaintenanceWindowResult#enabled #enabled} => Boolean
#
# @example Request syntax with placeholder values
#
# resp = client.update_maintenance_window({
# window_id: "MaintenanceWindowId", # required
# name: "MaintenanceWindowName",
# description: "MaintenanceWindowDescription",
# schedule: "MaintenanceWindowSchedule",
# duration: 1,
# cutoff: 1,
# allow_unassociated_targets: false,
# enabled: false,
# replace: false,
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.name #=> String
# resp.description #=> String
# resp.schedule #=> String
# resp.duration #=> Integer
# resp.cutoff #=> Integer
# resp.allow_unassociated_targets #=> Boolean
# resp.enabled #=> Boolean
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindow AWS API Documentation
#
# @overload update_maintenance_window(params = {})
# @param [Hash] params ({})
def update_maintenance_window(params = {}, options = {})
req = build_request(:update_maintenance_window, params)
req.send_request(options)
end
# Modifies the target of an existing Maintenance Window. You can't
# change the target type, but you can change the following:
#
# The target from being an ID target to a Tag target, or a Tag target to
# an ID target.
#
# IDs for an ID target.
#
# Tags for a Tag target.
#
# Owner.
#
# Name.
#
# Description.
#
# If a parameter is null, then the corresponding field is not modified.
#
# @option params [required, String] :window_id
# The Maintenance Window ID with which to modify the target.
#
# @option params [required, String] :window_target_id
# The target ID to modify.
#
# @option params [Array<Types::Target>] :targets
# The targets to add or replace.
#
# @option params [String] :owner_information
# User-provided value that will be included in any CloudWatch events
# raised while running tasks for these targets in this Maintenance
# Window.
#
# @option params [String] :name
# A name for the update.
#
# @option params [String] :description
# An optional description for the update.
#
# @option params [Boolean] :replace
# If True, then all fields that are required by the
# RegisterTargetWithMaintenanceWindow action are also required for this
# API request. Optional fields that are not specified are set to null.
#
# @return [Types::UpdateMaintenanceWindowTargetResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateMaintenanceWindowTargetResult#window_id #window_id} => String
# * {Types::UpdateMaintenanceWindowTargetResult#window_target_id #window_target_id} => String
# * {Types::UpdateMaintenanceWindowTargetResult#targets #targets} => Array<Types::Target>
# * {Types::UpdateMaintenanceWindowTargetResult#owner_information #owner_information} => String
# * {Types::UpdateMaintenanceWindowTargetResult#name #name} => String
# * {Types::UpdateMaintenanceWindowTargetResult#description #description} => String
#
# @example Request syntax with placeholder values
#
# resp = client.update_maintenance_window_target({
# window_id: "MaintenanceWindowId", # required
# window_target_id: "MaintenanceWindowTargetId", # required
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# owner_information: "OwnerInformation",
# name: "MaintenanceWindowName",
# description: "MaintenanceWindowDescription",
# replace: false,
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.window_target_id #=> String
# resp.targets #=> Array
# resp.targets[0].key #=> String
# resp.targets[0].values #=> Array
# resp.targets[0].values[0] #=> String
# resp.owner_information #=> String
# resp.name #=> String
# resp.description #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowTarget AWS API Documentation
#
# @overload update_maintenance_window_target(params = {})
# @param [Hash] params ({})
def update_maintenance_window_target(params = {}, options = {})
req = build_request(:update_maintenance_window_target, params)
req.send_request(options)
end
# Modifies a task assigned to a Maintenance Window. You can't change
# the task type, but you can change the following values:
#
# * TaskARN. For example, you can change a RUN\_COMMAND task from
# AWS-RunPowerShellScript to AWS-RunShellScript.
#
# * ServiceRoleArn
#
# * TaskInvocationParameters
#
# * Priority
#
# * MaxConcurrency
#
# * MaxErrors
#
# If a parameter is null, then the corresponding field is not modified.
# Also, if you set Replace to true, then all fields required by the
# RegisterTaskWithMaintenanceWindow action are required for this
# request. Optional fields that aren't specified are set to null.
#
# @option params [required, String] :window_id
# The Maintenance Window ID that contains the task to modify.
#
# @option params [required, String] :window_task_id
# The task ID to modify.
#
# @option params [Array<Types::Target>] :targets
# The targets (either instances or tags) to modify. Instances are
# specified using Key=instanceids,Values=instanceID\_1,instanceID\_2.
# Tags are specified using Key=tag\_name,Values=tag\_value.
#
# @option params [String] :task_arn
# The task ARN to modify.
#
# @option params [String] :service_role_arn
# The IAM service role ARN to modify. The system assumes this role
# during task execution.
#
# @option params [Hash<String,Types::MaintenanceWindowTaskParameterValueExpression>] :task_parameters
# The parameters to modify.
#
# <note markdown="1"> `TaskParameters` has been deprecated. To specify parameters to pass to
# a task when it runs, instead use the `Parameters` option in the
# `TaskInvocationParameters` structure. For information about how
# Systems Manager handles these options for the supported Maintenance
# Window task types, see MaintenanceWindowTaskInvocationParameters.
#
# </note>
#
# The map has the following format:
#
# Key: string, between 1 and 255 characters
#
# Value: an array of strings, each string is between 1 and 255
# characters
#
# @option params [Types::MaintenanceWindowTaskInvocationParameters] :task_invocation_parameters
# The parameters that the task should use during execution. Populate
# only the fields that match the task type. All other fields should be
# empty.
#
# @option params [Integer] :priority
# The new task priority to specify. The lower the number, the higher the
# priority. Tasks that have the same priority are scheduled in parallel.
#
# @option params [String] :max_concurrency
# The new `MaxConcurrency` value you want to specify. `MaxConcurrency`
# is the number of targets that are allowed to run this task in
# parallel.
#
# @option params [String] :max_errors
# The new `MaxErrors` value to specify. `MaxErrors` is the maximum
# number of errors that are allowed before the task stops being
# scheduled.
#
# @option params [Types::LoggingInfo] :logging_info
# The new logging location in Amazon S3 to specify.
#
# <note markdown="1"> `LoggingInfo` has been deprecated. To specify an S3 bucket to contain
# logs, instead use the `OutputS3BucketName` and `OutputS3KeyPrefix`
# options in the `TaskInvocationParameters` structure. For information
# about how Systems Manager handles these options for the supported
# Maintenance Window task types, see
# MaintenanceWindowTaskInvocationParameters.
#
# </note>
#
# @option params [String] :name
# The new task name to specify.
#
# @option params [String] :description
# The new task description to specify.
#
# @option params [Boolean] :replace
# If True, then all fields that are required by the
# RegisterTaskWithMaintenanceWndow action are also required for this API
# request. Optional fields that are not specified are set to null.
#
# @return [Types::UpdateMaintenanceWindowTaskResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdateMaintenanceWindowTaskResult#window_id #window_id} => String
# * {Types::UpdateMaintenanceWindowTaskResult#window_task_id #window_task_id} => String
# * {Types::UpdateMaintenanceWindowTaskResult#targets #targets} => Array<Types::Target>
# * {Types::UpdateMaintenanceWindowTaskResult#task_arn #task_arn} => String
# * {Types::UpdateMaintenanceWindowTaskResult#service_role_arn #service_role_arn} => String
# * {Types::UpdateMaintenanceWindowTaskResult#task_parameters #task_parameters} => Hash<String,Types::MaintenanceWindowTaskParameterValueExpression>
# * {Types::UpdateMaintenanceWindowTaskResult#task_invocation_parameters #task_invocation_parameters} => Types::MaintenanceWindowTaskInvocationParameters
# * {Types::UpdateMaintenanceWindowTaskResult#priority #priority} => Integer
# * {Types::UpdateMaintenanceWindowTaskResult#max_concurrency #max_concurrency} => String
# * {Types::UpdateMaintenanceWindowTaskResult#max_errors #max_errors} => String
# * {Types::UpdateMaintenanceWindowTaskResult#logging_info #logging_info} => Types::LoggingInfo
# * {Types::UpdateMaintenanceWindowTaskResult#name #name} => String
# * {Types::UpdateMaintenanceWindowTaskResult#description #description} => String
#
# @example Request syntax with placeholder values
#
# resp = client.update_maintenance_window_task({
# window_id: "MaintenanceWindowId", # required
# window_task_id: "MaintenanceWindowTaskId", # required
# targets: [
# {
# key: "TargetKey",
# values: ["TargetValue"],
# },
# ],
# task_arn: "MaintenanceWindowTaskArn",
# service_role_arn: "ServiceRole",
# task_parameters: {
# "MaintenanceWindowTaskParameterName" => {
# values: ["MaintenanceWindowTaskParameterValue"],
# },
# },
# task_invocation_parameters: {
# run_command: {
# comment: "Comment",
# document_hash: "DocumentHash",
# document_hash_type: "Sha256", # accepts Sha256, Sha1
# notification_config: {
# notification_arn: "NotificationArn",
# notification_events: ["All"], # accepts All, InProgress, Success, TimedOut, Cancelled, Failed
# notification_type: "Command", # accepts Command, Invocation
# },
# output_s3_bucket_name: "S3BucketName",
# output_s3_key_prefix: "S3KeyPrefix",
# parameters: {
# "ParameterName" => ["ParameterValue"],
# },
# service_role_arn: "ServiceRole",
# timeout_seconds: 1,
# },
# automation: {
# document_version: "DocumentVersion",
# parameters: {
# "AutomationParameterKey" => ["AutomationParameterValue"],
# },
# },
# step_functions: {
# input: "MaintenanceWindowStepFunctionsInput",
# name: "MaintenanceWindowStepFunctionsName",
# },
# lambda: {
# client_context: "MaintenanceWindowLambdaClientContext",
# qualifier: "MaintenanceWindowLambdaQualifier",
# payload: "data",
# },
# },
# priority: 1,
# max_concurrency: "MaxConcurrency",
# max_errors: "MaxErrors",
# logging_info: {
# s3_bucket_name: "S3BucketName", # required
# s3_key_prefix: "S3KeyPrefix",
# s3_region: "S3Region", # required
# },
# name: "MaintenanceWindowName",
# description: "MaintenanceWindowDescription",
# replace: false,
# })
#
# @example Response structure
#
# resp.window_id #=> String
# resp.window_task_id #=> String
# resp.targets #=> Array
# resp.targets[0].key #=> String
# resp.targets[0].values #=> Array
# resp.targets[0].values[0] #=> String
# resp.task_arn #=> String
# resp.service_role_arn #=> String
# resp.task_parameters #=> Hash
# resp.task_parameters["MaintenanceWindowTaskParameterName"].values #=> Array
# resp.task_parameters["MaintenanceWindowTaskParameterName"].values[0] #=> String
# resp.task_invocation_parameters.run_command.comment #=> String
# resp.task_invocation_parameters.run_command.document_hash #=> String
# resp.task_invocation_parameters.run_command.document_hash_type #=> String, one of "Sha256", "Sha1"
# resp.task_invocation_parameters.run_command.notification_config.notification_arn #=> String
# resp.task_invocation_parameters.run_command.notification_config.notification_events #=> Array
# resp.task_invocation_parameters.run_command.notification_config.notification_events[0] #=> String, one of "All", "InProgress", "Success", "TimedOut", "Cancelled", "Failed"
# resp.task_invocation_parameters.run_command.notification_config.notification_type #=> String, one of "Command", "Invocation"
# resp.task_invocation_parameters.run_command.output_s3_bucket_name #=> String
# resp.task_invocation_parameters.run_command.output_s3_key_prefix #=> String
# resp.task_invocation_parameters.run_command.parameters #=> Hash
# resp.task_invocation_parameters.run_command.parameters["ParameterName"] #=> Array
# resp.task_invocation_parameters.run_command.parameters["ParameterName"][0] #=> String
# resp.task_invocation_parameters.run_command.service_role_arn #=> String
# resp.task_invocation_parameters.run_command.timeout_seconds #=> Integer
# resp.task_invocation_parameters.automation.document_version #=> String
# resp.task_invocation_parameters.automation.parameters #=> Hash
# resp.task_invocation_parameters.automation.parameters["AutomationParameterKey"] #=> Array
# resp.task_invocation_parameters.automation.parameters["AutomationParameterKey"][0] #=> String
# resp.task_invocation_parameters.step_functions.input #=> String
# resp.task_invocation_parameters.step_functions.name #=> String
# resp.task_invocation_parameters.lambda.client_context #=> String
# resp.task_invocation_parameters.lambda.qualifier #=> String
# resp.task_invocation_parameters.lambda.payload #=> String
# resp.priority #=> Integer
# resp.max_concurrency #=> String
# resp.max_errors #=> String
# resp.logging_info.s3_bucket_name #=> String
# resp.logging_info.s3_key_prefix #=> String
# resp.logging_info.s3_region #=> String
# resp.name #=> String
# resp.description #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowTask AWS API Documentation
#
# @overload update_maintenance_window_task(params = {})
# @param [Hash] params ({})
def update_maintenance_window_task(params = {}, options = {})
req = build_request(:update_maintenance_window_task, params)
req.send_request(options)
end
# Assigns or changes an Amazon Identity and Access Management (IAM) role
# to the managed instance.
#
# @option params [required, String] :instance_id
# The ID of the managed instance where you want to update the role.
#
# @option params [required, String] :iam_role
# The IAM role you want to assign or change.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.update_managed_instance_role({
# instance_id: "ManagedInstanceId", # required
# iam_role: "IamRole", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRole AWS API Documentation
#
# @overload update_managed_instance_role(params = {})
# @param [Hash] params ({})
def update_managed_instance_role(params = {}, options = {})
req = build_request(:update_managed_instance_role, params)
req.send_request(options)
end
# Modifies an existing patch baseline. Fields not specified in the
# request are left unchanged.
#
# <note markdown="1"> For information about valid key and value pairs in `PatchFilters` for
# each supported operating system type, see [PatchFilter][1].
#
# </note>
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html
#
# @option params [required, String] :baseline_id
# The ID of the patch baseline to update.
#
# @option params [String] :name
# The name of the patch baseline.
#
# @option params [Types::PatchFilterGroup] :global_filters
# A set of global filters used to exclude patches from the baseline.
#
# @option params [Types::PatchRuleGroup] :approval_rules
# A set of rules used to include patches in the baseline.
#
# @option params [Array<String>] :approved_patches
# A list of explicitly approved patches for the baseline.
#
# For information about accepted formats for lists of approved patches
# and rejected patches, see [Package Name Formats for Approved and
# Rejected Patch Lists][1] in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html
#
# @option params [String] :approved_patches_compliance_level
# Assigns a new compliance severity level to an existing patch baseline.
#
# @option params [Boolean] :approved_patches_enable_non_security
# Indicates whether the list of approved patches includes non-security
# updates that should be applied to the instances. The default value is
# 'false'. Applies to Linux instances only.
#
# @option params [Array<String>] :rejected_patches
# A list of explicitly rejected patches for the baseline.
#
# For information about accepted formats for lists of approved patches
# and rejected patches, see [Package Name Formats for Approved and
# Rejected Patch Lists][1] in the *AWS Systems Manager User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html
#
# @option params [String] :description
# A description of the patch baseline.
#
# @option params [Array<Types::PatchSource>] :sources
# Information about the patches to use to update the instances,
# including target operating systems and source repositories. Applies to
# Linux instances only.
#
# @option params [Boolean] :replace
# If True, then all fields that are required by the CreatePatchBaseline
# action are also required for this API request. Optional fields that
# are not specified are set to null.
#
# @return [Types::UpdatePatchBaselineResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::UpdatePatchBaselineResult#baseline_id #baseline_id} => String
# * {Types::UpdatePatchBaselineResult#name #name} => String
# * {Types::UpdatePatchBaselineResult#operating_system #operating_system} => String
# * {Types::UpdatePatchBaselineResult#global_filters #global_filters} => Types::PatchFilterGroup
# * {Types::UpdatePatchBaselineResult#approval_rules #approval_rules} => Types::PatchRuleGroup
# * {Types::UpdatePatchBaselineResult#approved_patches #approved_patches} => Array<String>
# * {Types::UpdatePatchBaselineResult#approved_patches_compliance_level #approved_patches_compliance_level} => String
# * {Types::UpdatePatchBaselineResult#approved_patches_enable_non_security #approved_patches_enable_non_security} => Boolean
# * {Types::UpdatePatchBaselineResult#rejected_patches #rejected_patches} => Array<String>
# * {Types::UpdatePatchBaselineResult#created_date #created_date} => Time
# * {Types::UpdatePatchBaselineResult#modified_date #modified_date} => Time
# * {Types::UpdatePatchBaselineResult#description #description} => String
# * {Types::UpdatePatchBaselineResult#sources #sources} => Array<Types::PatchSource>
#
# @example Request syntax with placeholder values
#
# resp = client.update_patch_baseline({
# baseline_id: "BaselineId", # required
# name: "BaselineName",
# global_filters: {
# patch_filters: [ # required
# {
# key: "PRODUCT", # required, accepts PRODUCT, CLASSIFICATION, MSRC_SEVERITY, PATCH_ID, SECTION, PRIORITY, SEVERITY
# values: ["PatchFilterValue"], # required
# },
# ],
# },
# approval_rules: {
# patch_rules: [ # required
# {
# patch_filter_group: { # required
# patch_filters: [ # required
# {
# key: "PRODUCT", # required, accepts PRODUCT, CLASSIFICATION, MSRC_SEVERITY, PATCH_ID, SECTION, PRIORITY, SEVERITY
# values: ["PatchFilterValue"], # required
# },
# ],
# },
# compliance_level: "CRITICAL", # accepts CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED
# approve_after_days: 1, # required
# enable_non_security: false,
# },
# ],
# },
# approved_patches: ["PatchId"],
# approved_patches_compliance_level: "CRITICAL", # accepts CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED
# approved_patches_enable_non_security: false,
# rejected_patches: ["PatchId"],
# description: "BaselineDescription",
# sources: [
# {
# name: "PatchSourceName", # required
# products: ["PatchSourceProduct"], # required
# configuration: "PatchSourceConfiguration", # required
# },
# ],
# replace: false,
# })
#
# @example Response structure
#
# resp.baseline_id #=> String
# resp.name #=> String
# resp.operating_system #=> String, one of "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", "CENTOS"
# resp.global_filters.patch_filters #=> Array
# resp.global_filters.patch_filters[0].key #=> String, one of "PRODUCT", "CLASSIFICATION", "MSRC_SEVERITY", "PATCH_ID", "SECTION", "PRIORITY", "SEVERITY"
# resp.global_filters.patch_filters[0].values #=> Array
# resp.global_filters.patch_filters[0].values[0] #=> String
# resp.approval_rules.patch_rules #=> Array
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters #=> Array
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters[0].key #=> String, one of "PRODUCT", "CLASSIFICATION", "MSRC_SEVERITY", "PATCH_ID", "SECTION", "PRIORITY", "SEVERITY"
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters[0].values #=> Array
# resp.approval_rules.patch_rules[0].patch_filter_group.patch_filters[0].values[0] #=> String
# resp.approval_rules.patch_rules[0].compliance_level #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.approval_rules.patch_rules[0].approve_after_days #=> Integer
# resp.approval_rules.patch_rules[0].enable_non_security #=> Boolean
# resp.approved_patches #=> Array
# resp.approved_patches[0] #=> String
# resp.approved_patches_compliance_level #=> String, one of "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFORMATIONAL", "UNSPECIFIED"
# resp.approved_patches_enable_non_security #=> Boolean
# resp.rejected_patches #=> Array
# resp.rejected_patches[0] #=> String
# resp.created_date #=> Time
# resp.modified_date #=> Time
# resp.description #=> String
# resp.sources #=> Array
# resp.sources[0].name #=> String
# resp.sources[0].products #=> Array
# resp.sources[0].products[0] #=> String
# resp.sources[0].configuration #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaseline AWS API Documentation
#
# @overload update_patch_baseline(params = {})
# @param [Hash] params ({})
def update_patch_baseline(params = {}, options = {})
req = build_request(:update_patch_baseline, params)
req.send_request(options)
end
# @!endgroup
# @param params ({})
# @api private
def build_request(operation_name, params = {})
handlers = @handlers.for(operation_name)
context = Seahorse::Client::RequestContext.new(
operation_name: operation_name,
operation: config.api.operation(operation_name),
client: self,
params: params,
config: config)
context[:gem_name] = 'aws-sdk-ssm'
context[:gem_version] = '1.18.0'
Seahorse::Client::Request.new(handlers, context)
end
# @api private
# @deprecated
def waiter_names
[]
end
class << self
# @api private
attr_reader :identifier
# @api private
def errors_module
Errors
end
end
end
end
| 46.190016 | 235 | 0.674868 |
1d8fb07886275ace1396a19940e9eb017c17ce78 | 485 | require 'test_helper'
class InfoControllerTest < ActionController::TestCase
include Devise::TestHelpers
test 'should redirect to select project' do
sign_in(User.first)
sign_out(User.first)
get :index
assert_response :redirect
end
test 'should show info content' do
sign_in(User.first)
sign_out(User.first)
get :index, nil, {current_project_id: Project.first.id}
assert_template 'info/index'
assert_select 'h3', Project.first.name
end
end
| 25.526316 | 59 | 0.731959 |
33bae45eca8abafb3f30ea66d55f488a5e5b701b | 1,189 | require "language/node"
class Typescript < Formula
desc "Language for application scale JavaScript development"
homepage "https://www.typescriptlang.org/"
url "https://registry.npmjs.org/typescript/-/typescript-3.1.6.tgz"
sha256 "2cc76f3321bcdce70bdc7d8691e8d40b88a622902f8eeafbda3984ba7a9ed125"
head "https://github.com/Microsoft/TypeScript.git"
bottle do
cellar :any_skip_relocation
sha256 "888f88897105a66131feb42227c4f4fff333e0e719828f1c55250a7267ade29c" => :mojave
sha256 "4c203d8ae33eb1ad9687278bb5311e7d2cb275fbce173cbc315c4966bbc26906" => :high_sierra
sha256 "2993d32f6629020e8395bd78fafffe9f8ae8f01a44e9afcb20877d15c027df1f" => :sierra
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
(testpath/"test.ts").write <<~EOS
class Test {
greet() {
return "Hello, world!";
}
};
var test = new Test();
document.body.innerHTML = test.greet();
EOS
system bin/"tsc", "test.ts"
assert_predicate testpath/"test.js", :exist?, "test.js was not generated"
end
end
| 30.487179 | 93 | 0.71741 |
f811821b3524db68a9bcdb09fa8ef90f74422f30 | 801 | module Fluent
class AccesslogFilter < Filter
Plugin.register_filter('accesslog', self)
config_param :remove_fields, :string, :default => ''
def configure(conf)
super
@remove_fields_list = @remove_fields.split(',')
end
def filter(tag, time, record)
# elim no_data
begin
record.reject!{ |k,v| v == '-' }
rescue => e
log.warn "failed to eliminate hyphen", :error_class => e.class, :error => e.message
log.warn_backtrace
end
# remove keys
begin
@remove_fields_list.each do |field|
record.delete(field)
end
rescue => e
log.warn "failed to delete field", :error_class => e.class, :error => e.message
log.warn_backtrace
end
record
end
end
end
| 22.885714 | 91 | 0.589263 |
e25fb8214e3dc401f7e93c0feb86fca03493d487 | 126 | require 'test_helper'
class CurrencyRateTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.75 | 48 | 0.714286 |
6a5f5a1bdbe56982e2431aad834257d387d39b85 | 4,115 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'IBM Tivoli Storage Manager Express RCA Service Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in the IBM Tivoli Storage Manager Express Remote
Client Agent service. By sending a "dicuGetIdentify" request packet containing a long
NodeName parameter, an attacker can execute arbitrary code.
NOTE: this exploit first connects to the CAD service to start the RCA service and obtain
the port number on which it runs. This service does not restart.
},
'Author' => [ 'jduck' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2008-4828' ],
[ 'OSVDB', '54232' ],
[ 'BID', '34803' ]
],
'DefaultOptions' =>
{
'EXITFUNC' => 'seh',
},
'Privileged' => true,
'Payload' =>
{
# wchar_t buf[1024];
'Space' => ((1024*2)+4),
'BadChars' => "\x00",
'StackAdjustment' => -3500,
},
'Platform' => 'win',
'Targets' =>
[
# this target should be pretty universal..
# dbghelp.dll is shipped with TSM Express, and hasn't been kept up-to-date..
[ 'IBM Tivoli Storage Manager Express 5.3.6.2', { 'Ret' => 0x028495d3 } ], # p/p/r dbghelp.dll v6.0.17.0
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Nov 04 2009'))
register_options( [ Opt::RPORT(1582) ], self.class )
end
def make_tsm_packet(op,data)
pkt = ""
if op > 0xff
pkt << [0,8,0xa5,op,0xc+data.length].pack('nCCNN')
else
pkt << [data.length,op,0xa5].pack('nCC')
end
pkt << data
end
def explode_tsm_packet(buf)
return nil if buf.length < 4
len,op,magic = buf[0,4].unpack('nCC')
return nil if magic != 0xa5
if op == 0x08
return nil if buf.length < 12
op,len = buf[4,8].unpack('NN')
data = buf[12,len]
else
data = buf[4,len]
end
return op,data
end
def extract_port(buf)
op,data = explode_tsm_packet(buf)
if op != 0x10300
print_error("Invalid response verb from CAD service: 0x%x" % op)
return nil
end
if data.length < 6
print_error("Insufficient data from CAD service.")
return nil
end
port_str_len = data[4,2].unpack('n')[0]
if data.length < (24+port_str_len)
print_error("Insufficient data from CAD service.")
return nil
end
data[24,port_str_len].unpack('n*').pack('C*').to_i
end
def exploit
print_status("Trying target %s..." % target.name)
# first get the port number
query = [1].pack('n')
query << "\x00" * 10
data = make_tsm_packet(0x10200, query)
connect
print_status("Attempting to start the RCA service via the CAD service...")
sock.put(data)
buf = sock.get_once(-1, 10)
disconnect
rca_port = extract_port(buf)
if not rca_port or rca_port == 0
print_error("The RCA agent service was not started :(")
else
print_status("RCA Agent is now running on port %u" % rca_port)
end
# trigger the vulnerability
copy_len = payload_space + 4
sploit = rand_text(33)
# start offset, length
sploit[10,4] = [0,copy_len].pack('n*')
# data to copy
buf = payload.encoded
# we need this special encoding to make it work..
buf << [target.ret].pack('V').unpack('v*').pack('n*')
# adjustment :)
sploit << buf
data = make_tsm_packet(0x10400, sploit)
connect(true, { 'RPORT' => rca_port })
print_status("Sending specially crafted dicuGetIdentifyRequest packet...")
sock.write(data)
print_status("Starting handler...")
handler
disconnect
end
end
| 27.433333 | 114 | 0.589793 |
39cedd8bc70fd83ba583b5c73e49fb68e791fad9 | 162 | class Createtweets < ActiveRecord::Migration
def change
create_table :tweets do |t|
t.string :content
t.integer :user_id
end
end
end
| 13.5 | 44 | 0.654321 |
26ae071f90b2e83409221de3af2d5d6a59a16bf4 | 1,612 | require_relative '../../world_gadgets/configuration_engine'
require_relative '../../world_gadgets/oz_logger'
require_relative '../../world_gadgets/ledger'
require_relative '../../world_gadgets/validation_engine'
require_relative '../../world_gadgets/router/router'
require_relative '../../world_gadgets/browser_engine'
require_relative '../../world_gadgets/data_engine'
module Oz
# Allows overriding of the classes used by CoreWorld to create its submodules.
# Usage looks like
# CoreWorld::PaveStones.logger = MyShinyNewLogger
# Aliased to CoreWorld::Settings
#
module CoreWorld
module PaveStones
@settings = {
configuration_engine: ConfigurationEngine,
logger: OzLogger,
ledger: Ledger,
validation_engine: ValidationEngine,
router: Router,
browser_engine: BrowserEngine,
data_engine: DataEngine
}
class << self
extend Enumerable
def configs
@settings
end
def keys
@settings.keys.reject{ |key, _| key == :logger } #logger is defined as readonly in CoreWorld once initialized, preserving this.
end
def [](arg)
@settings[arg]
end
def []=(arg, value)
@settings[arg] = value
end
def each
@settings.each
end
def respond_to_missing?
true
end
def method_missing(method, *args)
super unless @settings.keys.include? method
@settings[method]
end
end
end
end
CoreWorld::Settings = CoreWorld::PaveStones
end | 24.8 | 137 | 0.633995 |
1d314bd7e519894f2c9d8a2a99147bf2cb471aa5 | 552 | # frozen_string_literal: true
module Ops
module Author
# With this action the author becomes an active user of the system.
# He will be able to visit dashboard and view the progress of his idea.
class Activate < BaseOperation
step :change_state!
step :send_notification!
private
def change_state!(_ctx, author:, **)
author.activate!
true
end
def send_notification!(_ctx, author:, **)
::Author::RoleActivatedMailer.notify(author.id).deliver_later
end
end
end
end
| 23 | 75 | 0.65942 |
38d67b6b8c2f0c81e41f938cade1ac56f00f28cb | 32,513 | module Searchkick
class Query
extend Forwardable
@@metric_aggs = [:avg, :cardinality, :max, :min, :sum]
attr_reader :klass, :term, :options
attr_accessor :body
def_delegators :execute, :map, :each, :any?, :empty?, :size, :length, :slice, :[], :to_ary,
:records, :results, :suggestions, :each_with_hit, :with_details, :aggregations, :aggs,
:took, :error, :model_name, :entry_name, :total_count, :total_entries,
:current_page, :per_page, :limit_value, :padding, :total_pages, :num_pages,
:offset_value, :offset, :previous_page, :prev_page, :next_page, :first_page?, :last_page?,
:out_of_range?, :hits, :response, :to_a, :first
def initialize(klass, term = "*", **options)
unknown_keywords = options.keys - [:aggs, :body, :body_options, :boost,
:boost_by, :boost_by_distance, :boost_by_recency, :boost_where, :conversions, :conversions_term, :debug, :emoji, :exclude, :execute, :explain,
:fields, :highlight, :includes, :index_name, :indices_boost, :limit, :load,
:match, :misspellings, :model_includes, :offset, :operator, :order, :padding, :page, :per_page, :profile,
:request_params, :routing, :scope_results, :select, :similar, :smart_aggs, :suggest, :track, :type, :where]
raise ArgumentError, "unknown keywords: #{unknown_keywords.join(", ")}" if unknown_keywords.any?
term = term.to_s
if options[:emoji]
term = EmojiParser.parse_unicode(term) { |e| " #{e.name} " }.strip
end
@klass = klass
@term = term
@options = options
@match_suffix = options[:match] || searchkick_options[:match] || "analyzed"
# prevent Ruby warnings
@type = nil
@routing = nil
@misspellings = false
@misspellings_below = nil
@highlighted_fields = nil
prepare
end
def searchkick_index
klass ? klass.searchkick_index : nil
end
def searchkick_options
klass ? klass.searchkick_options : {}
end
def searchkick_klass
klass ? klass.searchkick_klass : nil
end
def params
index =
if options[:index_name]
Array(options[:index_name]).map { |v| v.respond_to?(:searchkick_index) ? v.searchkick_index.name : v }.join(",")
elsif searchkick_index
searchkick_index.name
else
"_all"
end
params = {
index: index,
body: body
}
params[:type] = @type if @type
params[:routing] = @routing if @routing
params.merge!(options[:request_params]) if options[:request_params]
params
end
def execute
@execute ||= begin
begin
response = execute_search
if retry_misspellings?(response)
prepare
response = execute_search
end
rescue => e # TODO rescue type
handle_error(e)
end
handle_response(response)
end
end
def to_curl
query = params
type = query[:type]
index = query[:index].is_a?(Array) ? query[:index].join(",") : query[:index]
# no easy way to tell which host the client will use
host = Searchkick.client.transport.hosts.first
credentials = host[:user] || host[:password] ? "#{host[:user]}:#{host[:password]}@" : nil
"curl #{host[:protocol]}://#{credentials}#{host[:host]}:#{host[:port]}/#{CGI.escape(index)}#{type ? "/#{type.map { |t| CGI.escape(t) }.join(',')}" : ''}/_search?pretty -H 'Content-Type: application/json' -d '#{query[:body].to_json}'"
end
def handle_response(response)
opts = {
page: @page,
per_page: @per_page,
padding: @padding,
load: @load,
includes: options[:includes],
model_includes: options[:model_includes],
json: [email protected]?,
match_suffix: @match_suffix,
highlighted_fields: @highlighted_fields || [],
misspellings: @misspellings,
term: term,
scope_results: options[:scope_results],
index_name: options[:index_name]
}
if options[:debug]
require "pp"
puts "Searchkick Version: #{Searchkick::VERSION}"
puts "Elasticsearch Version: #{Searchkick.server_version}"
puts
puts "Model Searchkick Options"
pp searchkick_options
puts
puts "Search Options"
pp options
puts
if searchkick_index
puts "Model Search Data"
begin
pp klass.limit(3).map { |r| RecordData.new(searchkick_index, r).index_data }
rescue => e
puts "#{e.class.name}: #{e.message}"
end
puts
puts "Elasticsearch Mapping"
puts JSON.pretty_generate(searchkick_index.mapping)
puts
puts "Elasticsearch Settings"
puts JSON.pretty_generate(searchkick_index.settings)
puts
end
puts "Elasticsearch Query"
puts to_curl
puts
puts "Elasticsearch Results"
puts JSON.pretty_generate(response)
end
# set execute for multi search
@execute = Searchkick::Results.new(searchkick_klass, response, opts)
end
def retry_misspellings?(response)
@misspellings_below && response["hits"]["total"] < @misspellings_below
end
private
def handle_error(e)
status_code = e.message[1..3].to_i
if status_code == 404
raise MissingIndexError, "Index missing - run #{reindex_command}"
elsif status_code == 500 && (
e.message.include?("IllegalArgumentException[minimumSimilarity >= 1]") ||
e.message.include?("No query registered for [multi_match]") ||
e.message.include?("[match] query does not support [cutoff_frequency]") ||
e.message.include?("No query registered for [function_score]")
)
raise UnsupportedVersionError, "This version of Searchkick requires Elasticsearch 5 or greater"
elsif status_code == 400
if (
e.message.include?("bool query does not support [filter]") ||
e.message.include?("[bool] filter does not support [filter]")
)
raise UnsupportedVersionError, "This version of Searchkick requires Elasticsearch 5 or greater"
elsif e.message =~ /analyzer \[searchkick_.+\] not found/
raise InvalidQueryError, "Bad mapping - run #{reindex_command}"
else
raise InvalidQueryError, e.message
end
else
raise e
end
end
def reindex_command
searchkick_klass ? "#{searchkick_klass.name}.reindex" : "reindex"
end
def execute_search
Searchkick.client.search(params)
end
def prepare
boost_fields, fields = set_fields
operator = options[:operator] || "and"
# pagination
page = [options[:page].to_i, 1].max
per_page = (options[:limit] || options[:per_page] || 10_000).to_i
padding = [options[:padding].to_i, 0].max
offset = options[:offset] || (page - 1) * per_page + padding
# model and eager loading
load = options[:load].nil? ? true : options[:load]
all = term == "*"
@json = options[:body]
if @json
ignored_options = options.keys & [:aggs, :boost,
:boost_by, :boost_by_distance, :boost_by_recency, :boost_where, :conversions, :conversions_term, :exclude, :explain,
:fields, :highlight, :indices_boost, :match, :misspellings, :operator, :order,
:profile, :select, :smart_aggs, :suggest, :where]
raise ArgumentError, "Options incompatible with body option: #{ignored_options.join(", ")}" if ignored_options.any?
payload = @json
else
must_not = []
should = []
if options[:similar]
query = {
more_like_this: {
like: term,
min_doc_freq: 1,
min_term_freq: 1,
analyzer: "searchkick_search2"
}
}
if fields.all? { |f| f.start_with?("*.") }
raise ArgumentError, "Must specify fields to search"
end
if fields != ["_all"]
query[:more_like_this][:fields] = fields
end
elsif all
query = {
match_all: {}
}
else
queries = []
misspellings =
if options.key?(:misspellings)
options[:misspellings]
else
true
end
if misspellings.is_a?(Hash) && misspellings[:below] && !@misspellings_below
@misspellings_below = misspellings[:below].to_i
misspellings = false
end
if misspellings != false
edit_distance = (misspellings.is_a?(Hash) && (misspellings[:edit_distance] || misspellings[:distance])) || 1
transpositions =
if misspellings.is_a?(Hash) && misspellings.key?(:transpositions)
{fuzzy_transpositions: misspellings[:transpositions]}
else
{fuzzy_transpositions: true}
end
prefix_length = (misspellings.is_a?(Hash) && misspellings[:prefix_length]) || 0
default_max_expansions = @misspellings_below ? 20 : 3
max_expansions = (misspellings.is_a?(Hash) && misspellings[:max_expansions]) || default_max_expansions
@misspellings = true
else
@misspellings = false
end
fields.each do |field|
queries_to_add = []
qs = []
factor = boost_fields[field] || 1
shared_options = {
query: term,
boost: 10 * factor
}
match_type =
if field.end_with?(".phrase")
field =
if field == "_all.phrase"
"_all"
else
field.sub(/\.phrase\z/, ".analyzed")
end
:match_phrase
else
:match
end
shared_options[:operator] = operator if match_type == :match
exclude_analyzer = nil
exclude_field = field
if field == "_all" || field.end_with?(".analyzed")
shared_options[:cutoff_frequency] = 0.001 unless operator.to_s == "and" || misspellings == false
qs << shared_options.merge(analyzer: "searchkick_search")
# searchkick_search and searchkick_search2 are the same for ukrainian
unless %w(japanese korean polish ukrainian vietnamese).include?(searchkick_options[:language])
qs << shared_options.merge(analyzer: "searchkick_search2")
end
exclude_analyzer = "searchkick_search2"
elsif field.end_with?(".exact")
f = field.split(".")[0..-2].join(".")
queries_to_add << {match: {f => shared_options.merge(analyzer: "keyword")}}
exclude_field = f
exclude_analyzer = "keyword"
else
analyzer = field =~ /\.word_(start|middle|end)\z/ ? "searchkick_word_search" : "searchkick_autocomplete_search"
qs << shared_options.merge(analyzer: analyzer)
exclude_analyzer = analyzer
end
if misspellings != false && match_type == :match
qs.concat(qs.map { |q| q.except(:cutoff_frequency).merge(fuzziness: edit_distance, prefix_length: prefix_length, max_expansions: max_expansions, boost: factor).merge(transpositions) })
end
if field.start_with?("*.")
q2 = qs.map { |q| {multi_match: q.merge(fields: [field], type: match_type == :match_phrase ? "phrase" : "best_fields")} }
if below61?
q2.each do |q|
q[:multi_match].delete(:fuzzy_transpositions)
end
end
else
q2 = qs.map { |q| {match_type => {field => q}} }
end
# boost exact matches more
if field =~ /\.word_(start|middle|end)\z/ && searchkick_options[:word] != false
queries_to_add << {
bool: {
must: {
bool: {
should: q2
}
},
should: {match_type => {field.sub(/\.word_(start|middle|end)\z/, ".analyzed") => qs.first}}
}
}
else
queries_to_add.concat(q2)
end
queries.concat(queries_to_add)
if options[:exclude]
must_not.concat(set_exclude(exclude_field, exclude_analyzer))
end
end
payload = {
dis_max: {
queries: queries
}
}
should.concat(set_conversions)
query = payload
end
payload = {}
# type when inheritance
where = (options[:where] || {}).dup
if searchkick_options[:inheritance] && (options[:type] || (klass != searchkick_klass && searchkick_index))
where[:type] = [options[:type] || klass].flatten.map { |v| searchkick_index.klass_document_type(v, true) }
end
# start everything as efficient filters
# move to post_filters as aggs demand
filters = where_filters(where)
post_filters = []
# aggregations
set_aggregations(payload, filters, post_filters) if options[:aggs]
# post filters
set_post_filters(payload, post_filters) if post_filters.any?
custom_filters = []
multiply_filters = []
set_boost_by(multiply_filters, custom_filters)
set_boost_where(custom_filters)
set_boost_by_distance(custom_filters) if options[:boost_by_distance]
set_boost_by_recency(custom_filters) if options[:boost_by_recency]
payload[:query] = build_query(query, filters, should, must_not, custom_filters, multiply_filters)
payload[:explain] = options[:explain] if options[:explain]
payload[:profile] = options[:profile] if options[:profile]
# order
set_order(payload) if options[:order]
# indices_boost
set_boost_by_indices(payload)
# suggestions
set_suggestions(payload, options[:suggest]) if options[:suggest]
# highlight
set_highlights(payload, fields) if options[:highlight]
# timeout shortly after client times out
payload[:timeout] ||= "#{Searchkick.search_timeout + 1}s"
# An empty array will cause only the _id and _type for each hit to be returned
# https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html
if options[:select]
if options[:select] == []
# intuitively [] makes sense to return no fields, but ES by default returns all fields
payload[:_source] = false
else
payload[:_source] = options[:select]
end
elsif load
payload[:_source] = false
end
end
# pagination
pagination_options = options[:page] || options[:limit] || options[:per_page] || options[:offset] || options[:padding]
if !options[:body] || pagination_options
payload[:size] = per_page
payload[:from] = offset
end
# type
if !searchkick_options[:inheritance] && (options[:type] || (klass != searchkick_klass && searchkick_index))
@type = [options[:type] || klass].flatten.map { |v| searchkick_index.klass_document_type(v) }
end
# routing
@routing = options[:routing] if options[:routing]
# merge more body options
payload = payload.deep_merge(options[:body_options]) if options[:body_options]
@body = payload
@page = page
@per_page = per_page
@padding = padding
@load = load
end
def set_fields
boost_fields = {}
fields = options[:fields] || searchkick_options[:default_fields] || searchkick_options[:searchable]
all = searchkick_options.key?(:_all) ? searchkick_options[:_all] : false
default_match = options[:match] || searchkick_options[:match] || :word
fields =
if fields
fields.map do |value|
k, v = value.is_a?(Hash) ? value.to_a.first : [value, default_match]
k2, boost = k.to_s.split("^", 2)
field = "#{k2}.#{v == :word ? 'analyzed' : v}"
boost_fields[field] = boost.to_f if boost
field
end
elsif all && default_match == :word
["_all"]
elsif all && default_match == :phrase
["_all.phrase"]
elsif term == "*"
[]
elsif default_match == :exact
raise ArgumentError, "Must specify fields to search"
else
[default_match == :word ? "*.analyzed" : "*.#{default_match}"]
end
[boost_fields, fields]
end
def build_query(query, filters, should, must_not, custom_filters, multiply_filters)
if filters.any? || must_not.any? || should.any?
bool = {must: query}
bool[:filter] = filters if filters.any? # where
bool[:must_not] = must_not if must_not.any? # exclude
bool[:should] = should if should.any? # conversions
query = {bool: bool}
end
if custom_filters.any?
query = {
function_score: {
functions: custom_filters,
query: query,
score_mode: "sum"
}
}
end
if multiply_filters.any?
query = {
function_score: {
functions: multiply_filters,
query: query,
score_mode: "multiply"
}
}
end
query
end
def set_conversions
conversions_fields = Array(options[:conversions] || searchkick_options[:conversions]).map(&:to_s)
if conversions_fields.present? && options[:conversions] != false
conversions_fields.map do |conversions_field|
{
nested: {
path: conversions_field,
score_mode: "sum",
query: {
function_score: {
boost_mode: "replace",
query: {
match: {
"#{conversions_field}.query" => options[:conversions_term] || term
}
},
field_value_factor: {
field: "#{conversions_field}.count"
}
}
}
}
}
end
else
[]
end
end
def set_exclude(field, analyzer)
Array(options[:exclude]).map do |phrase|
{
multi_match: {
fields: [field],
query: phrase,
analyzer: analyzer,
type: "phrase"
}
}
end
end
def set_boost_by_distance(custom_filters)
boost_by_distance = options[:boost_by_distance] || {}
# legacy format
if boost_by_distance[:field]
boost_by_distance = {boost_by_distance[:field] => boost_by_distance.except(:field)}
end
boost_by_distance.each do |field, attributes|
attributes = {function: :gauss, scale: "5mi"}.merge(attributes)
unless attributes[:origin]
raise ArgumentError, "boost_by_distance requires :origin"
end
function_params = attributes.except(:factor, :function)
function_params[:origin] = location_value(function_params[:origin])
custom_filters << {
weight: attributes[:factor] || 1,
attributes[:function] => {
field => function_params
}
}
end
end
def set_boost_by_recency(custom_filters)
options[:boost_by_recency].each do |field, attributes|
attributes = {function: :gauss, origin: Time.now}.merge(attributes)
custom_filters << {
weight: attributes[:factor] || 1,
attributes[:function] => {
field => attributes.except(:factor, :function)
}
}
end
end
def set_boost_by(multiply_filters, custom_filters)
boost_by = options[:boost_by] || {}
if boost_by.is_a?(Array)
boost_by = Hash[boost_by.map { |f| [f, {factor: 1}] }]
elsif boost_by.is_a?(Hash)
multiply_by, boost_by = boost_by.partition { |_, v| v.delete(:boost_mode) == "multiply" }.map { |i| Hash[i] }
end
boost_by[options[:boost]] = {factor: 1} if options[:boost]
custom_filters.concat boost_filters(boost_by, modifier: "ln2p")
multiply_filters.concat boost_filters(multiply_by || {})
end
def set_boost_where(custom_filters)
boost_where = options[:boost_where] || {}
boost_where.each do |field, value|
if value.is_a?(Array) && value.first.is_a?(Hash)
value.each do |value_factor|
custom_filters << custom_filter(field, value_factor[:value], value_factor[:factor])
end
elsif value.is_a?(Hash)
custom_filters << custom_filter(field, value[:value], value[:factor])
else
factor = 1000
custom_filters << custom_filter(field, value, factor)
end
end
end
def set_boost_by_indices(payload)
return unless options[:indices_boost]
indices_boost = options[:indices_boost].each_with_object({}) do |(key, boost), memo|
index = key.respond_to?(:searchkick_index) ? key.searchkick_index.name : key
# try to use index explicitly instead of alias: https://github.com/elasticsearch/elasticsearch/issues/4756
index_by_alias = Searchkick.client.indices.get_alias(index: index).keys.first
memo[index_by_alias || index] = boost
end
payload[:indices_boost] = indices_boost
end
def set_suggestions(payload, suggest)
suggest_fields = nil
if suggest.is_a?(Array)
suggest_fields = suggest
else
suggest_fields = (searchkick_options[:suggest] || []).map(&:to_s)
# intersection
if options[:fields]
suggest_fields &= options[:fields].map { |v| (v.is_a?(Hash) ? v.keys.first : v).to_s.split("^", 2).first }
end
end
if suggest_fields.any?
payload[:suggest] = {text: term}
suggest_fields.each do |field|
payload[:suggest][field] = {
phrase: {
field: "#{field}.suggest"
}
}
end
else
raise ArgumentError, "Must pass fields to suggest option"
end
end
def set_highlights(payload, fields)
payload[:highlight] = {
fields: Hash[fields.map { |f| [f, {}] }],
fragment_size: below60? ? 30000 : 0
}
if options[:highlight].is_a?(Hash)
if (tag = options[:highlight][:tag])
payload[:highlight][:pre_tags] = [tag]
payload[:highlight][:post_tags] = [tag.to_s.gsub(/\A<(\w+).+/, "</\\1>")]
end
if (fragment_size = options[:highlight][:fragment_size])
payload[:highlight][:fragment_size] = fragment_size
end
if (encoder = options[:highlight][:encoder])
payload[:highlight][:encoder] = encoder
end
highlight_fields = options[:highlight][:fields]
if highlight_fields
payload[:highlight][:fields] = {}
highlight_fields.each do |name, opts|
payload[:highlight][:fields]["#{name}.#{@match_suffix}"] = opts || {}
end
end
end
@highlighted_fields = payload[:highlight][:fields].keys
end
def set_aggregations(payload, filters, post_filters)
aggs = options[:aggs]
payload[:aggs] = {}
aggs = Hash[aggs.map { |f| [f, {}] }] if aggs.is_a?(Array) # convert to more advanced syntax
aggs.each do |field, agg_options|
size = agg_options[:limit] ? agg_options[:limit] : 1_000
shared_agg_options = agg_options.slice(:order, :min_doc_count)
if agg_options[:ranges]
payload[:aggs][field] = {
range: {
field: agg_options[:field] || field,
ranges: agg_options[:ranges]
}.merge(shared_agg_options)
}
elsif agg_options[:date_ranges]
payload[:aggs][field] = {
date_range: {
field: agg_options[:field] || field,
ranges: agg_options[:date_ranges]
}.merge(shared_agg_options)
}
elsif (histogram = agg_options[:date_histogram])
interval = histogram[:interval]
payload[:aggs][field] = {
date_histogram: {
field: histogram[:field],
interval: interval
}
}
elsif (metric = @@metric_aggs.find { |k| agg_options.has_key?(k) })
payload[:aggs][field] = {
metric => {
field: agg_options[metric][:field] || field
}
}
else
payload[:aggs][field] = {
terms: {
field: agg_options[:field] || field,
size: size
}.merge(shared_agg_options)
}
end
where = {}
where = (options[:where] || {}).reject { |k| k == field } unless options[:smart_aggs] == false
agg_filters = where_filters(where.merge(agg_options[:where] || {}))
# only do one level comparison for simplicity
filters.select! do |filter|
if agg_filters.include?(filter)
true
else
post_filters << filter
false
end
end
if agg_filters.any?
payload[:aggs][field] = {
filter: {
bool: {
must: agg_filters
}
},
aggs: {
field => payload[:aggs][field]
}
}
end
end
end
def set_post_filters(payload, post_filters)
payload[:post_filter] = {
bool: {
filter: post_filters
}
}
end
# TODO id transformation for arrays
def set_order(payload)
order = options[:order].is_a?(Enumerable) ? options[:order] : {options[:order] => :asc}
id_field = :_uid
payload[:sort] = order.is_a?(Array) ? order : Hash[order.map { |k, v| [k.to_s == "id" ? id_field : k, v] }]
end
def where_filters(where)
filters = []
(where || {}).each do |field, value|
field = :_id if field.to_s == "id"
if field == :or
value.each do |or_clause|
filters << {bool: {should: or_clause.map { |or_statement| {bool: {filter: where_filters(or_statement)}} }}}
end
elsif field == :_or
filters << {bool: {should: value.map { |or_statement| {bool: {filter: where_filters(or_statement)}} }}}
elsif field == :_not
filters << {bool: {must_not: where_filters(value)}}
elsif field == :_and
filters << {bool: {must: value.map { |or_statement| {bool: {filter: where_filters(or_statement)}} }}}
else
# expand ranges
if value.is_a?(Range)
value = {gte: value.first, (value.exclude_end? ? :lt : :lte) => value.last}
end
value = {in: value} if value.is_a?(Array)
if value.is_a?(Hash)
value.each do |op, op_value|
case op
when :within, :bottom_right, :bottom_left
# do nothing
when :near
filters << {
geo_distance: {
field => location_value(op_value),
distance: value[:within] || "50mi"
}
}
when :geo_polygon
filters << {
geo_polygon: {
field => op_value
}
}
when :geo_shape
shape = op_value.except(:relation)
shape[:coordinates] = coordinate_array(shape[:coordinates]) if shape[:coordinates]
filters << {
geo_shape: {
field => {
relation: op_value[:relation] || "intersects",
shape: shape
}
}
}
when :top_left
filters << {
geo_bounding_box: {
field => {
top_left: location_value(op_value),
bottom_right: location_value(value[:bottom_right])
}
}
}
when :top_right
filters << {
geo_bounding_box: {
field => {
top_right: location_value(op_value),
bottom_left: location_value(value[:bottom_left])
}
}
}
when :regexp # support for regexp queries without using a regexp ruby object
filters << {regexp: {field => {value: op_value}}}
when :not, :_not # not equal
filters << {bool: {must_not: term_filters(field, op_value)}}
when :all
op_value.each do |val|
filters << term_filters(field, val)
end
when :in
filters << term_filters(field, op_value)
else
range_query =
case op
when :gt
{from: op_value, include_lower: false}
when :gte
{from: op_value, include_lower: true}
when :lt
{to: op_value, include_upper: false}
when :lte
{to: op_value, include_upper: true}
else
raise "Unknown where operator: #{op.inspect}"
end
# issue 132
if (existing = filters.find { |f| f[:range] && f[:range][field] })
existing[:range][field].merge!(range_query)
else
filters << {range: {field => range_query}}
end
end
end
else
filters << term_filters(field, value)
end
end
end
filters
end
def term_filters(field, value)
if value.is_a?(Array) # in query
if value.any?(&:nil?)
{bool: {should: [term_filters(field, nil), term_filters(field, value.compact)]}}
else
{terms: {field => value}}
end
elsif value.nil?
{bool: {must_not: {exists: {field: field}}}}
elsif value.is_a?(Regexp)
{regexp: {field => {value: value.source, flags: "NONE"}}}
else
{term: {field => value}}
end
end
def custom_filter(field, value, factor)
{
filter: where_filters(field => value),
weight: factor
}
end
def boost_filter(field, factor: 1, modifier: nil, missing: nil)
script_score = {
field_value_factor: {
field: field,
factor: factor.to_f,
modifier: modifier
}
}
if missing
script_score[:field_value_factor][:missing] = missing.to_f
else
script_score[:filter] = {
exists: {
field: field
}
}
end
script_score
end
def boost_filters(boost_by, modifier: nil)
boost_by.map do |field, value|
boost_filter(field, modifier: modifier, **value)
end
end
# Recursively descend through nesting of arrays until we reach either a lat/lon object or an array of numbers,
# eventually returning the same structure with all values transformed to [lon, lat].
#
def coordinate_array(value)
if value.is_a?(Hash)
[value[:lon], value[:lat]]
elsif value.is_a?(Array) and !value[0].is_a?(Numeric)
value.map { |a| coordinate_array(a) }
else
value
end
end
def location_value(value)
if value.is_a?(Array)
value.map(&:to_f).reverse
else
value
end
end
def below60?
Searchkick.server_below?("6.0.0")
end
def below61?
Searchkick.server_below?("6.1.0")
end
end
end
| 32.709256 | 239 | 0.548488 |
4a04fef639e68c8d0c075c042e44057138a1b9c7 | 395 | require 'base_kde_formula'
class Kgeography < BaseKdeFormula
homepage 'http://www.kde.org/'
url 'http://download.kde.org/stable/4.10.2/src/kgeography-4.10.2.tar.xz'
sha1 '14cd9d3d788a9f0068af3e10f26f0375b5c7251a'
devel do
url 'http://download.kde.org/stable/4.10.2/src/kgeography-4.10.2.tar.xz'
sha1 '14cd9d3d788a9f0068af3e10f26f0375b5c7251a'
end
depends_on 'kdelibs'
end
| 26.333333 | 76 | 0.751899 |
01276b2aa0a68937598e673f9117e390c472f514 | 7,537 | module Authlogic
module ActsAsAuthentic
# Handles everything related to the login field.
module Login
def self.included(klass)
klass.class_eval do
extend Config
add_acts_as_authentic_module(Methods)
end
end
# Confguration for the login field.
module Config
# The name of the login field in the database.
#
# * <tt>Default:</tt> :login or :username, if they exist
# * <tt>Accepts:</tt> Symbol
def login_field(value = nil)
config(:login_field, value, first_column_to_exist(nil, :login, :username))
end
alias_method :login_field=, :login_field
# Whether or not the validate the login field
#
# * <tt>Default:</tt> true
# * <tt>Accepts:</tt> Boolean
def validate_login_field(value = nil)
config(:validate_login_field, value, true)
end
alias_method :validate_login_field=, :validate_login_field
# A hash of options for the validates_length_of call for the login field. Allows you to change this however you want.
#
# <b>Keep in mind this is ruby. I wanted to keep this as flexible as possible, so you can completely replace the hash or
# merge options into it. Checkout the convenience function merge_validates_length_of_login_field_options to merge
# options.</b>
#
# * <tt>Default:</tt> {:within => 3..100}
# * <tt>Accepts:</tt> Hash of options accepted by validates_length_of
def validates_length_of_login_field_options(value = nil)
config(:validates_length_of_login_field_options, value, {:within => 3..100})
end
alias_method :validates_length_of_login_field_options=, :validates_length_of_login_field_options
# A convenience function to merge options into the validates_length_of_login_field_options. So intead of:
#
# self.validates_length_of_login_field_options = validates_length_of_login_field_options.merge(:my_option => my_value)
#
# You can do this:
#
# merge_validates_length_of_login_field_options :my_option => my_value
def merge_validates_length_of_login_field_options(options = {})
self.validates_length_of_login_field_options = validates_length_of_login_field_options.merge(options)
end
# A hash of options for the validates_format_of call for the login field. Allows you to change this however you want.
#
# <b>Keep in mind this is ruby. I wanted to keep this as flexible as possible, so you can completely replace the hash or
# merge options into it. Checkout the convenience function merge_validates_format_of_login_field_options to merge
# options.</b>
#
# * <tt>Default:</tt> {:with => Authlogic::Regex.login, :message => I18n.t('error_messages.login_invalid', :default => "should use only letters, numbers, spaces, and .-_@ please.")}
# * <tt>Accepts:</tt> Hash of options accepted by validates_format_of
def validates_format_of_login_field_options(value = nil)
config(:validates_format_of_login_field_options, value, {:with => Authlogic::Regex.login, :message => I18n.t('error_messages.login_invalid', :default => "should use only letters, numbers, spaces, and .-_@ please.")})
end
alias_method :validates_format_of_login_field_options=, :validates_format_of_login_field_options
# See merge_validates_length_of_login_field_options. The same thing, except for validates_format_of_login_field_options
def merge_validates_format_of_login_field_options(options = {})
self.validates_format_of_login_field_options = validates_format_of_login_field_options.merge(options)
end
# A hash of options for the validates_uniqueness_of call for the login field. Allows you to change this however you want.
#
# <b>Keep in mind this is ruby. I wanted to keep this as flexible as possible, so you can completely replace the hash or
# merge options into it. Checkout the convenience function merge_validates_format_of_login_field_options to merge
# options.</b>
#
# * <tt>Default:</tt> {:case_sensitive => false, :scope => validations_scope, :if => "#{login_field}_changed?".to_sym}
# * <tt>Accepts:</tt> Hash of options accepted by validates_uniqueness_of
def validates_uniqueness_of_login_field_options(value = nil)
config(:validates_uniqueness_of_login_field_options, value, {:case_sensitive => false, :scope => validations_scope, :if => "#{login_field}_changed?".to_sym})
end
alias_method :validates_uniqueness_of_login_field_options=, :validates_uniqueness_of_login_field_options
# See merge_validates_length_of_login_field_options. The same thing, except for validates_uniqueness_of_login_field_options
def merge_validates_uniqueness_of_login_field_options(options = {})
self.validates_uniqueness_of_login_field_options = validates_uniqueness_of_login_field_options.merge(options)
end
# This method allows you to find a record with the given login. If you notice, with ActiveRecord you have the
# validates_uniqueness_of validation function. They give you a :case_sensitive option. I handle this in the same
# manner that they handle that. If you are using the login field and set false for the :case_sensitive option in
# validates_uniqueness_of_login_field_options this method will modify the query to look something like:
#
# first(:conditions => ["LOWER(#{quoted_table_name}.#{login_field}) = ?", login.downcase])
#
# If you don't specify this it calls the good old find_by_* method:
#
# find_by_login(login)
#
# The above also applies for using email as your login, except that you need to set the :case_sensitive in
# validates_uniqueness_of_email_field_options to false.
#
# The only reason I need to do the above is for Postgres and SQLite since they perform case sensitive searches with the
# find_by_* methods.
def find_by_smart_case_login_field(login)
if login_field
find_with_case(login_field, login, validates_uniqueness_of_login_field_options[:case_sensitive] != false)
else
find_with_case(email_field, login, validates_uniqueness_of_email_field_options[:case_sensitive] != false)
end
end
private
def find_with_case(field, value, sensitivity = true)
if sensitivity
send("find_by_#{field}", value)
else
first(:conditions => ["LOWER(#{quoted_table_name}.#{field}) = ?", value.downcase])
end
end
end
# All methods relating to the login field
module Methods
# Adds in various validations, modules, etc.
def self.included(klass)
klass.class_eval do
if validate_login_field && login_field
validates_length_of login_field, validates_length_of_login_field_options
validates_format_of login_field, validates_format_of_login_field_options
validates_uniqueness_of login_field, validates_uniqueness_of_login_field_options
end
end
end
end
end
end
end | 53.453901 | 226 | 0.682234 |
1c3188e16221f3f34c062947034dd893173f6af0 | 494 | class Widget < Mongomatic::Base
def self.populate_sample_data(data_file)
raw_data = JSON.parse(File.read(data_file))
raw_data["widgets"].each do |id, data|
widget = Widget.new(:_id => id, :name => data["name"])
sprockets = {}
data["sprockets"].each do |sprocket_id, sprocket_data|
sprockets[sprocket_id] = sprocket_data
end
widget["sprockets"] = sprockets
widget.insert
end
collection.create_index("name", :unique => true)
end
end | 32.933333 | 60 | 0.653846 |
4a2e2b3c0a5db9e09df8c041c515561197afe544 | 1,174 | require 'nokogiri'
require 'open-uri'
require 'time'
class Api::V10::FlightsController < ApplicationController
require_dependency 'flights_parser'
def departures
@title = 'Departures'
if Rails.cache.exist? 'departures'
@flights = Rails.cache.fetch('departures')
else
@flights = FlightsParser::get_departures
Rails.cache.write('departures', @flights, expires_in: 30.seconds)
end
respond_to do |format|
format.json { render json: @flights }
format.xml { render xml: @flights }
format.html { render :departures, layout: ((params[:layout].nil? || params[:layout] == 'true') ? true : false) }
end
end
def arrivals
@title = 'Arrivals'
if Rails.cache.exist? 'arrivals'
@flights = Rails.cache.fetch('arrivals')
else
@flights = FlightsParser::get_arrivals
Rails.cache.write('arrivals', @flights, expires_in: 30.seconds)
end
respond_to do |format|
format.json { render json: @flights }
format.xml { render xml: @flights }
format.html { render :arrivals, layout: ((params[:layout].nil? || params[:layout] == 'true') ? true : false) }
end
end
end
| 26.681818 | 118 | 0.650767 |
6a0f99ecfcbcf069fe32f3bfe95d01f347e0f40b | 283 | # frozen_string_literal: true
require_relative "band2mopidy/version"
module Band2Mopidy
class Error < StandardError; end
end
require_relative "band2mopidy/gnoosic"
require_relative "band2mopidy/discogs"
require_relative "band2mopidy/bandcamp"
require_relative "band2mopidy/mpd"
| 21.769231 | 39 | 0.840989 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.