source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_clone.rb | Ruby | apache-2.0 | 202 | main | 30,368 | # Author:: Ezra Pagel (<ezra@cpan.org>)
# Contributor:: Jesse Campbell (<hikeit@gmail.com>)
# Contributor:: Bethany Erskine (<bethany@paperlesspost.com>)
# Contributor:: Adrian Stanila (https://github.com/sacx)
# Contributor:: Ryan Hass (rhass@chef.io)
# License:: Apache License, Version 2.0
#
require "chef/knife"
req... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_disk_list.rb | Ruby | apache-2.0 | 202 | main | 1,108 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
# List the disks attached to a VM
# VsphereVmdisklist extends the BaseVspherecommand
class Chef::Knife::VsphereVmDiskList < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm disk list VMNAME"
deps do
Chef::Knife::BaseVsphereCommand.lo... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_move.rb | Ruby | apache-2.0 | 202 | main | 2,903 | #
# Author:: Brian Dupras (<bdupras@rallydev.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Moves the VM to another folder or datastore
# VsphereVmMove extends the BaseVspherecommand
class Chef::Knife::VsphereVmMove < Chef::Knife::BaseVsphereComma... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_state.rb | Ruby | apache-2.0 | 202 | main | 3,135 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Manage power state of a virtual machine
# VsphereVmState extends the BaseVspherecommand
class Chef::Knife::VsphereVmState < Chef::Knife::BaseVsphereCommand
# The... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_pool_list.rb | Ruby | apache-2.0 | 202 | main | 960 | #
# Author:: Jesse Campbell (<hikeit@gmail.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Lists all known pools in the configured datacenter
class Chef::Knife::VspherePoolList < Chef::Knife::BaseVsphereCommand
banner "knife vsphere pool list"
... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_execute.rb | Ruby | apache-2.0 | 202 | main | 1,974 | # Author:: Ian Delahorne (<ian@delahorne.com>)
# License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVMexecute extends the Basevspherecommand
class Chef::Knife::VsphereVmExecute < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm execute VMNAME ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_config.rb | Ruby | apache-2.0 | 202 | main | 1,381 | # Author:: Brian Dupras (<bdupras@rallydev.com>)
# License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVMconfig extends the BaseVspherecommand
class Chef::Knife::VsphereVmConfig < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm config VMNAME P... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_template_list.rb | Ruby | apache-2.0 | 202 | main | 933 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Lists all known VM templates in the configured datacenter
# VsphereTemplatelist extends the BaseVspherecommand
class Chef::Knife::VsphereTemplateList < Chef::Knife... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_cdrom.rb | Ruby | apache-2.0 | 202 | main | 3,151 | # License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVmCdrom extends the BaseVspherecommand
class Chef::Knife::VsphereVmCdrom < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm cdrom VMNAME (options)"
deps do
Chef::Knife::BaseVsphereCom... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_network_add.rb | Ruby | apache-2.0 | 202 | main | 2,562 | #
# Author:: Scott Williams (<scott@backups.net.au>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
class Chef::Knife::VsphereVmNetworkAdd < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm network add VMNAME NETWORKNAME"
deps do
Chef::Kn... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_property_set.rb | Ruby | apache-2.0 | 202 | main | 2,629 | # Author:: Brian Dupras (<bdupras@rallydev.com>)
# License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVMPropertySet extends Basevspherecommand
class Chef::Knife::VsphereVmPropertySet < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm property ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vlan_create.rb | Ruby | apache-2.0 | 202 | main | 1,619 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Lists all known data stores in datacenter with sizes
# VsphereVlanCreate extends BaseVspherecommand
class Chef::Knife::VsphereVlanCreate < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vlan create NAME VID"
deps do
Chef::Knife::Bas... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_network_list.rb | Ruby | apache-2.0 | 202 | main | 1,161 | #
# Author:: Scott Williams (<scott@backups.net.au>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVmNetworklist extends the BaseVspherecommand
class Chef::Knife::VsphereVmNetworkList < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_wait_sysprep.rb | Ruby | apache-2.0 | 202 | main | 1,544 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# Contributor:: Malte Heidenreich (https://github.com/mheidenr)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Wait for vm finishing Sysprep.
# usage:
# knife vsphere vm wait sysprep somemachine --sleep 30 \
# ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_datastorecluster_list.rb | Ruby | apache-2.0 | 202 | main | 2,336 | # Copyright (C) 2012, SCM Ventures AB
# Author: Ian Delahorne <ian@scmventures.se>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_vnc_set.rb | Ruby | apache-2.0 | 202 | main | 1,543 | #
# Author:: Scott Williams (<scott@backups.net.au>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Main class VsphereVMvncset extends the BaseVspherecommand
class Chef::Knife::VsphereVmVncset < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_cluster_list.rb | Ruby | apache-2.0 | 202 | main | 1,504 | #
# Author:: Jesse Campbell (<hikeit@gmail.com>)
# Contributor:: Dennis Pattmann (https://github.com/DennisBP)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Lists all known clusters in the configured datacenter
class Chef::Knife::VsphereClusterList < C... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_property_get.rb | Ruby | apache-2.0 | 202 | main | 1,294 | # Author:: Brian Dupras (<bdupras@rallydev.com>)
# License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVMPropertyget extends the BaseVspherecommand
class Chef::Knife::VsphereVmPropertyGet < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm prope... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vlan_list.rb | Ruby | apache-2.0 | 202 | main | 1,333 | # Author: Jesse Campbell
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANT... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_hosts_list.rb | Ruby | apache-2.0 | 202 | main | 1,032 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
# list hosts belonging to pool
# VsphereHostslist extends the BaseVspherecommand
class Chef::Knife::VsphereHostsList < Chef::Knife::BaseVsphereCommand
banner "knife vsphere hosts list"
deps do
Chef::Knife::BaseVsphereCommand.load_deps
end
... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_datastore_list.rb | Ruby | apache-2.0 | 202 | main | 2,529 | # Copyright (C) 2012, SCM Ventures AB
# Author: Ian Delahorne <ian@scmventures.se>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_pool_query.rb | Ruby | apache-2.0 | 202 | main | 667 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VspherePoolQuery extends the BaseVsphereCommand
class Chef::Knife::VspherePoolQuery < Chef::Knife::BaseVsphereCommand
banner 'knife vsphere pool query POOLNAME QUERY. See "https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.ComputeResource.html" f... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_pool_show.rb | Ruby | apache-2.0 | 202 | main | 1,806 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
class Chef::Knife::VspherePoolShow < Chef::Knife::BaseVsphereCommand
banner 'knife vsphere pool show POOLNAME QUERY. See "https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.ComputeResource.html" for allowed QUERY values.'
deps do
Chef::Knife... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_customization_list.rb | Ruby | apache-2.0 | 202 | main | 760 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Lists all customization specifications in the configured datacenter
# VsphereCustomizationlist extends the BaseVspherecommand
class Chef::Knife::VsphereCustomizatio... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_snapshot.rb | Ruby | apache-2.0 | 202 | main | 4,643 | #
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Manage snapshots of a virtual machine
class Chef::Knife::VsphereVmSnapshot < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm snapshot VMNAME (options)"
deps do
Chef::Knife::BaseVsphereC... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_delete.rb | Ruby | apache-2.0 | 202 | main | 2,465 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Delete a virtual machine from vCenter
# VsphereVmDelete extends the BaseVspherecommand
class Chef::Knife::VsphereVmDelete < Chef::Knife::BaseVsphereCommand
banne... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_show.rb | Ruby | apache-2.0 | 202 | main | 1,533 | # Author:: Brian Dupras (<bdupras@rallydev.com>)
# License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereVmShow extends the BaseVspherecommand
class Chef::Knife::VsphereVmShow < Chef::Knife::BaseVsphereCommand
banner 'knife vsphere vm show VMNAME QUERY. ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_network_set.rb | Ruby | apache-2.0 | 202 | main | 2,006 | #
# Author:: Owen Groves (<omgroves@gmail.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Changes network on a certain VM
# VsphereVmNetworkSet extends the BaseVspherecommand
class Chef::Knife::VsphereVmNetworkSet < Chef::Knife::BaseVsphereCommand
... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_migrate.rb | Ruby | apache-2.0 | 202 | main | 1,863 | #
# Author:: Raducu Deaconu (<rhadoo_io@yahoo.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# migrate vm to specified resource pool , datastore and host
class Chef::Knife::VsphereVmMigrate < Chef::Knife::BaseVsphereCommand
# migrate --resource-po... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_toolsconfig.rb | Ruby | apache-2.0 | 202 | main | 1,586 | # Author:: Malte Heidenreich
# License:: Apache License, Version 2.0
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Vspherevmtoolsconfig extends the BaseVspherecommand
class Chef::Knife::VsphereVmToolsconfig < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm toolsconfig VMNAME PROPER... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_datastore_maxfree.rb | Ruby | apache-2.0 | 202 | main | 2,375 | # Copyright (C) 2012, SCM Ventures AB
# Author: Ian Delahorne <ian@scmventures.se>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_disk_extend.rb | Ruby | apache-2.0 | 202 | main | 1,914 | #
# Author:: Malte Heidenreich (https://github.com/mheidenr)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
class Chef::Knife::VsphereVmDiskExtend < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm disk extend VMNAME SIZE. Extends the disk of v... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_cpu_ratio.rb | Ruby | apache-2.0 | 202 | main | 1,180 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
# VsphereCpuratio extends the BaseVspherecommand
class Chef::Knife::VsphereCpuRatio < Chef::Knife::BaseVsphereCommand
banner "knife vsphere cpu ratio [CLUSTER] [HOST]"
deps do
Chef::Knife::BaseVsphereCommand.load_deps
end
common_options... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_markastemplate.rb | Ruby | apache-2.0 | 202 | main | 1,269 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# Contributor:: Jesse Campbell (<hikeit@gmail.com>)
# Contributor:: Bethany Erskine (<bethany@paperlesspost.com>)
# Contributor:: Adrian Stanila (https://github.com/sacx)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_comm... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_find.rb | Ruby | apache-2.0 | 202 | main | 7,181 | # Author:: Raducu Deaconu (<rhadoo_io@yahoo.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# find vms belonging to pool that match criteria, display specified fields
class Chef::Knife::VsphereVmFind < Chef::Knife::BaseVsphereCommand
banner "knife... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_vmdk_add.rb | Ruby | apache-2.0 | 202 | main | 8,123 | #
# Author:: Brian Flad (<bflad417@gmail.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Add a new disk to a virtual machine
# VsphereVmvmdkadd extends the BaseVspherecommand
class Chef::Knife::VsphereVmVmdkAdd < Chef::Knife::BaseVsphereCommand
b... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_datastorecluster_maxfree.rb | Ruby | apache-2.0 | 202 | main | 2,311 | # Copyright (C) 2012, SCM Ventures AB
# Author: Ian Delahorne <ian@scmventures.se>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_network_delete.rb | Ruby | apache-2.0 | 202 | main | 1,451 | #
# Author:: Scott Williams (<scott@backups.net.au>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
class Chef::Knife::VsphereVmNetworkDelete < Chef::Knife::BaseVsphereCommand
banner "knife vsphere vm network delete VMNAME NICNAME"
deps do
Chef::... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_vm_net.rb | Ruby | apache-2.0 | 202 | main | 2,047 | #
# Author:: Raducu Deaconu (<rhadoo_io@yahoo.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Switch VM networking state up/down (on all network interfaces)
# VsphereVmNet extends the BaseVspherecommand
class Chef::Knife::VsphereVmNet < Chef::Knife... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_datastore_file.rb | Ruby | apache-2.0 | 202 | main | 1,487 | require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Upload or download a file from a datastore
# VsphereDatastoreFile extends the BaseVspherecommand
class Chef::Knife::VsphereDatastoreFile < Chef::Knife::BaseVsphereCommand
banner "knife vsphere datastore file"
deps do
Chef::Knife::BaseVsphe... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/vsphere_folder_list.rb | Ruby | apache-2.0 | 202 | main | 1,021 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require_relative "helpers/base_vsphere_command"
# Lists all vm folders
# VsphereFolderlist extends the BaseVspherecommand
class Chef::Knife::VsphereFolderList < Chef::Knife::BaseVsphereCommand
banner "knife vsphe... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/helpers/search_helper.rb | Ruby | apache-2.0 | 202 | main | 1,899 | # Some helpers for faster searching of the inventory
module SearchHelper
# Retrieves all the VM objects and returns their ObjectContents
# Note that since it's a ObjectContent coming back, the individual
# object's [] will return only the properties you asked for
# and `#obj` will return the actual object (but ... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/helpers/customization_helper.rb | Ruby | apache-2.0 | 202 | main | 1,543 | #
# Author:: Malte Heidenreich (https://github.com/mheidenr)
# License:: Apache License, Version 2.0
#
require "rbvmomi"
# The Customization helper for sysprep
module CustomizationHelper
# Wait for sysprep
#
# @param [Object] vm The VM object to connect to
# @param [Object] vim_connection The vim_connection o... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | lib/chef/knife/helpers/base_vsphere_command.rb | Ruby | apache-2.0 | 202 | main | 13,911 | #
# Author:: Ezra Pagel (<ezra@cpan.org>)
# Contributor:: Jesse Campbell (<hikeit@gmail.com>)
# License:: Apache License, Version 2.0
#
require "chef/knife"
require "chef/knife/bootstrap"
# Power state on
PS_ON ||= "poweredOn".freeze
# Power state off
PS_OFF ||= "poweredOff".freeze
# Power state suspended
PS_SUSPENDE... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_find_spec.rb | Ruby | apache-2.0 | 202 | main | 5,753 | require "spec_helper"
require "chef/knife/vsphere_vm_find"
class Hash
# An artifact of me using hashes to represent the VM -- the method needs to be there to mock
def obj
raise "You shouldn't be calling me"
end
end
describe Chef::Knife::VsphereVmFind do
subject { described_class.new }
let(:ui) { double... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/spec_helper.rb | Ruby | apache-2.0 | 202 | main | 7,115 | require "chef/knife"
# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly req... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_connection_handling_spec.rb | Ruby | apache-2.0 | 202 | main | 2,431 | require "spec_helper"
require "chef/knife/helpers/base_vsphere_command"
describe Chef::Knife::BaseVsphereCommand do
describe "#password" do
before do
expect(subject).to receive(:get_config).with(:vsphere_pass).at_least(:once).and_return(password)
end
context "password is in config file" do
l... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_vmdk_add_spec.rb | Ruby | apache-2.0 | 202 | main | 990 | require "spec_helper"
require "chef/knife/vsphere_vm_vmdk_add"
describe Chef::Knife::VsphereVmVmdkAdd do
let(:datacenter) { double("Datacenter") }
let(:vim) { double("VimConnection", serviceContent: service_content) }
let(:service_content) { double("ServiceContent", virtualDiskManager: "vdm") }
subject { desc... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_migrate_spec.rb | Ruby | apache-2.0 | 202 | main | 1,105 | require "spec_helper"
require "chef/knife/vsphere_vm_migrate"
describe Chef::Knife::VsphereVmMigrate do
include_context "stub_vm_search"
let(:vm) { double("VM") }
let(:host) { double("Host") }
let(:task) { double("Task", wait_for_completion: true) }
subject { described_class.new }
context "input handling... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_config.rb | Ruby | apache-2.0 | 202 | main | 1,558 | require "spec_helper"
require "chef/knife/vsphere_vm_config"
describe Chef::Knife::VsphereVmConfig do
include_context "stub_vm_search"
let(:vm) { double("VM") }
let(:task) { double("Task", wait_for_completion: "") }
context "input sanity" do
it "errors if nothing is given" do
expect { subject.run }... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_cdrom_spec.rb | Ruby | apache-2.0 | 202 | main | 4,179 | require "spec_helper"
require "chef/knife/vsphere_vm_cdrom"
describe Chef::Knife::VsphereVmCdrom do
include_context "stub_vm_search"
let(:vm) { double("VM") }
let(:config) { double("Config", hardware: hardware) }
let(:hardware) { double("Hardware", device: devices) }
let(:devices) { double("Devices") }
l... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vlan_list_spec.rb | Ruby | apache-2.0 | 202 | main | 619 | require "spec_helper"
require "chef/knife/vsphere_vlan_list"
describe Chef::Knife::VsphereVlanList do
let(:datacenter) { double("Datacenter") }
let(:n1) { double("Network", name: "n1") }
let(:n2) { double("Network", name: "n2") }
subject { described_class.new }
it "enumerates the vlans" do
expect(subje... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_clone_spec.rb | Ruby | apache-2.0 | 202 | main | 14,087 | require "spec_helper"
require "chef/knife/vsphere_vm_clone"
require "chef/knife/bootstrap"
class Fakey
def initialize(data)
@data = data
end
def props
@data.keys
end
def method_missing(element)
desired = @data[element]
if desired.is_a? Hash
self.class.new(desired)
else
desir... |
github | chef/knife-vsphere | https://github.com/chef/knife-vsphere | spec/vsphere_vm_snapshot_spec.rb | Ruby | apache-2.0 | 202 | main | 788 | require "spec_helper"
require "chef/knife/vsphere_vm_snapshot"
describe Chef::Knife::VsphereVmSnapshot do
let(:datacenter) { double("Datacenter") }
let(:vim) { double("VimConnection", serviceContent: service_content) }
let(:service_content) { double("ServiceContent") }
subject { described_class.new }
befor... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | Rakefile | Ruby | mit | 202 | main | 240 | # typed: true
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task default: :test |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | Gemfile | Ruby | mit | 202 | main | 399 | # typed: true
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
group(:test) do
gem('mocha')
gem('rubocop', require: false)
gem('rubocop-minitest', require: false)
gem('rubocop-performance', require: false)
gem('vcr')
gem('we... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | example.rb | Ruby | mit | 202 | main | 18,577 | # frozen_string_literal: true
# 1) Copy this code into a file and save it `example.rb`
# 2) Replace the `ACCESS_TOKEN` constant with a valid `access_token`.
# 3) Run the file with the command `ruby example.rb`
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
git_source(:github) { |repo| "... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | whatsapp_sdk.gemspec | Ruby | mit | 202 | main | 2,261 | # typed: true
# frozen_string_literal: true
require_relative 'lib/whatsapp_sdk/version'
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = "whatsapp_sdk"
spec.version = WhatsappSdk::VERSION
spec.authors = ["ignacio-c... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/test_helper.rb | Ruby | mit | 202 | main | 516 | # typed: true
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../lib/whatsapp_sdk', __dir__)
require "minitest/autorun"
require "minitest/assertions"
require 'mocha/minitest'
require "pry"
require "pry-nav"
require "webmock/minitest"
require "errors_helper"
require 'vcr'
VCR.configure do |config|
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/errors_helper.rb | Ruby | mit | 202 | main | 2,205 | # typed: false
# frozen_string_literal: true
module ErrorsHelper
def assert_unsupported_request_error(http_method, response, object_id, fb_trace_id)
assert_error_response(
{
code: 100,
error_subcode: 33,
message: "Unsupported #{http_method} request. Object with ID '#{object_id}' doe... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/version_test.rb | Ruby | mit | 202 | main | 219 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'version'
class VersionTest < Minitest::Test
def test_that_it_has_a_version_number
assert_equal("1.1.0", WhatsappSdk::VERSION)
end
end |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/contact_helper.rb | Ruby | mit | 202 | main | 2,058 | # frozen_string_literal: true
module WhatsappSdk
module ContactHelper
def create_addresses
address1 = Resource::Address.new(
street: "STREET",
city: "CITY",
state: "STATE",
zip: "ZIP",
country: "COUNTRY",
country_code: "COUNTRY_CODE",
type: Resource::... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/client_test.rb | Ruby | mit | 202 | main | 6,560 | # typed: true
# frozen_string_literal: true
require 'test_helper'
require 'api/client'
require 'api/api_configuration'
require 'whatsapp_sdk'
module WhatsappSdk
module Api
class ClientTest < Minitest::Test
def setup(api_version: ApiConfiguration::DEFAULT_API_VERSION)
@access_token = 'test_token'
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/medias_test.rb | Ruby | mit | 202 | main | 10,377 | # typed: false
# frozen_string_literal: true
require "test_helper"
require 'api/medias'
require 'api/client'
module WhatsappSdk
module Api
class MediasTest < Minitest::Test
include(ErrorsHelper)
def setup
client = Client.new(ENV.fetch("WHATSAPP_ACCESS_TOKEN", nil))
@medias_api = Med... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/phone_numbers_test.rb | Ruby | mit | 202 | main | 6,097 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'api/phone_numbers'
require 'api/client'
module WhatsappSdk
module Api
class PhoneNumbersTest < Minitest::Test
include(ErrorsHelper)
def setup
client = Client.new(ENV.fetch('WHATSAPP_ACCESS_TOKEN', nil))
@phon... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/api_configuration_test.rb | Ruby | mit | 202 | main | 481 | # typed: true
# frozen_string_literal: true
require 'test_helper'
require 'api/client'
module WhatsappSdk
module Api
class ClientTest < Minitest::Test
def test_client_url
assert_equal("https://graph.facebook.com/v19.0/",
"#{ApiConfiguration::API_URL}/#{ApiConfiguration::DEFAUL... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/templates_test.rb | Ruby | mit | 202 | main | 19,274 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'api/templates'
require 'api/client'
require 'api/messages'
module WhatsappSdk
module Api
class TemplatesTest < Minitest::Test
include(ErrorsHelper)
def setup
client = Client.new(ENV.fetch('WHATSAPP_ACCESS_TOKEN', nil... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/messages_test.rb | Ruby | mit | 202 | main | 31,450 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'api/messages'
require 'resource/address_type'
require 'resource/address'
require 'resource/contact'
require 'resource/interactive'
require 'resource/interactive_action'
require 'resource/interactive_action_reply_button'
require 'resource/intera... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/business_profile_test.rb | Ruby | mit | 202 | main | 3,407 | # typed: true
# frozen_string_literal: true
require 'api/business_profile'
require 'api/client'
module WhatsappSdk
module Api
class BusinessProfileTest < Minitest::Test
include(ErrorsHelper)
def setup
client = Client.new(ENV.fetch('WHATSAPP_ACCESS_TOKEN', nil))
@business_profile_api... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/api/business_account_test.rb | Ruby | mit | 202 | main | 2,438 | # typed: true
# frozen_string_literal: true
require 'api/business_account'
require 'api/client'
module WhatsappSdk
module Api
class BusinessAccountTest < Minitest::Test
include(ErrorsHelper)
def setup
client = Client.new(ENV.fetch('WHATSAPP_ACCESS_TOKEN', nil))
@business_account_api... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/component_test.rb | Ruby | mit | 202 | main | 6,090 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'resource/parameter_object'
require 'resource/media'
require 'resource/date_time'
require 'resource/currency'
require 'resource/component'
module WhatsappSdk
module Resource
module Resource
class ComponentTest < Minitest::Test
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/date_time_test.rb | Ruby | mit | 202 | main | 422 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'resource/date_time'
module WhatsappSdk
module Resource
module Resource
class DateTimeTest < Minitest::Test
def test_to_json
date_time = DateTime.new(fallback_value: "2020-01-01T00:00:00Z")
assert_equal({... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/currency_test.rb | Ruby | mit | 202 | main | 446 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'resource/currency'
module WhatsappSdk
module Resource
module Resource
class CurrencyTest < Minitest::Test
def test_to_json
currency = Currency.new(code: "USD", amount: 1000, fallback_value: "1000")
asser... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/media_component_test.rb | Ruby | mit | 202 | main | 1,885 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'resource/media'
module WhatsappSdk
module Resource
module Resource
class MediaComponentTest < Minitest::Test
def test_raise_an_error_when_filename_is_passed_and_type_is_not_document
error = assert_raises(MediaComp... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/interactive_action_test.rb | Ruby | mit | 202 | main | 4,218 | # typed: true
# frozen_string_literal: true
require "test_helper"
module WhatsappSdk
module Resource
class InteractionActionTest < Minitest::Test
def test_validation
error = assert_raises(Errors::InvalidInteractiveActionButton) do
interactive_action = InteractiveAction.new(type: Interact... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/interactive_test.rb | Ruby | mit | 202 | main | 20,257 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'resource/interactive'
require 'resource/interactive_action'
require 'resource/interactive_action_reply_button'
require 'resource/interactive_action_section'
require 'resource/interactive_action_section_row'
require 'resource/interactive_body'
r... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/interactive_action_section_row_test.rb | Ruby | mit | 202 | main | 2,340 | # typed: true
# frozen_string_literal: true
require "test_helper"
module WhatsappSdk
module Resource
class InteractionActionSectionRowTest < Minitest::Test
def test_validation
error = assert_raises(Errors::InvalidInteractiveActionSectionRow) do
InteractiveActionSectionRow.new(
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/interactive_action_section_test.rb | Ruby | mit | 202 | main | 1,758 | # typed: true
# frozen_string_literal: true
require "test_helper"
module WhatsappSdk
module Resource
class InteractionActionSectionTest < Minitest::Test
def test_validation
error = assert_raises(Errors::InvalidInteractiveActionSection) do
InteractiveActionSection.new(title: "I am the lon... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/parameter_object_test.rb | Ruby | mit | 202 | main | 5,205 | # typed: false
# frozen_string_literal: true
require "test_helper"
require 'resource/parameter_object'
require 'resource/media'
require 'resource/date_time'
require 'resource/currency'
require 'resource/location'
require 'error'
require 'resource/errors'
module WhatsappSdk
module Resource
module Resource
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/button_parameter_test.rb | Ruby | mit | 202 | main | 950 | # typed: true
# frozen_string_literal: true
require "test_helper"
require 'resource/button_parameter'
module WhatsappSdk
module Resource
module Resource
class ButtonParameterTest < Minitest::Test
def test_creates_a_valid_parameter_object_with_a_valid_type
ButtonParameter.new(type: Button... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | test/whatsapp/resource/location_test.rb | Ruby | mit | 202 | main | 619 | # typed: true
# frozen_string_literal: true
require "test_helper"
require "resource/location"
module WhatsappSdk
module Resource
module Resource
class LocationTest < Minitest::Test
def test_to_json
location = Location.new(latitude: 25.779510, longitude: -80.338631, name: "Miami Store",
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk.rb | Ruby | mit | 202 | main | 331 | # typed: true
# frozen_string_literal: true
require "zeitwerk"
require "faraday"
require "faraday/multipart"
loader = Zeitwerk::Loader.for_gem
loader.setup
module WhatsappSdk
class << self
def configuration
@configuration ||= Configuration.new
end
def configure
yield(configuration)
end... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/configuration.rb | Ruby | mit | 202 | main | 956 | # frozen_string_literal: true
module WhatsappSdk
# This module allows client instantiating the client as a singleton like the following example:
# WhatsappSdk.configure do |config|
# config.access_token = ACCESS_TOKEN
# config.api_version = API_VERSION
# end
#
# The gem have access to the client thro... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/business_profile.rb | Ruby | mit | 202 | main | 2,407 | # frozen_string_literal: true
require_relative "request"
require_relative "../resource/business_profile"
module WhatsappSdk
module Api
class BusinessProfile < Request
DEFAULT_FIELDS = 'about,address,description,email,profile_picture_url,websites,vertical'
class InvalidVertical < StandardError
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/phone_numbers.rb | Ruby | mit | 202 | main | 3,077 | # frozen_string_literal: true
require_relative "request"
module WhatsappSdk
module Api
class PhoneNumbers < Request
DEFAULT_FIELDS = %i[
id is_official_business_account display_phone_number verified_name account_mode quality_rating
certificate code_verification_status eligibility_for_api_b... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/request.rb | Ruby | mit | 202 | main | 783 | # typed: true
# frozen_string_literal: true
require_relative "../../whatsapp_sdk"
module WhatsappSdk
module Api
class Request
def initialize(client = WhatsappSdk.configuration.client)
@client = client
end
def download_file(url:, content_type_header:, file_path: nil)
@client.do... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/medias.rb | Ruby | mit | 202 | main | 4,645 | # frozen_string_literal: true
require "faraday"
require "faraday/multipart"
require_relative "request"
require_relative '../resource/media_types'
module WhatsappSdk
module Api
class Medias < Request
class FileNotFoundError < StandardError
attr_reader :file_path
def initialize(file_path:)... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/messages.rb | Ruby | mit | 202 | main | 15,933 | # frozen_string_literal: true
require_relative "request"
module WhatsappSdk
module Api
class Messages < Request
DEFAULT_HEADERS = { 'Content-Type' => 'application/json' }.freeze
# Send a text message.
#
# @param sender_id [Integer] Sender' phone number.
# @param recipient_number [... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/business_account.rb | Ruby | mit | 202 | main | 2,101 | # frozen_string_literal: true
require_relative "request"
require_relative "../resource/business_account"
module WhatsappSdk
module Api
class BusinessAccount < Request
DEFAULT_FIELDS = %w[id name timezone_id message_template_namespace account_review_status
business_verification_st... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/templates.rb | Ruby | mit | 202 | main | 9,419 | # frozen_string_literal: true
require_relative "request"
require_relative "../resource/languages"
module WhatsappSdk
module Api
class Templates < Request
DEFAULT_HEADERS = { 'Content-Type' => 'application/json' }.freeze
class InvalidCategoryError < StandardError
attr_reader :category
... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/client.rb | Ruby | mit | 202 | main | 3,552 | # frozen_string_literal: true
require "faraday"
require "faraday/multipart"
module WhatsappSdk
module Api
class Client
API_VERSIONS = [
'v24.0', 'v23.0', 'v22.0', 'v21.0', 'v20.0', 'v19.0', 'v18.0', 'v17.0', 'v16.0', 'v15.0', 'v14.0',
'v13.0', 'v12.0', 'v11.0', 'v10.0', 'v9.0', 'v8.0', 'v7... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/responses/success_response.rb | Ruby | mit | 202 | main | 236 | # frozen_string_literal: true
module WhatsappSdk
module Api
module Responses
class SuccessResponse
def self.success_response?(response:)
response["success"] == true
end
end
end
end
end |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/responses/message_data_response.rb | Ruby | mit | 202 | main | 995 | # frozen_string_literal: true
require_relative "../../resource/message"
require_relative "../../resource/contact_response"
module WhatsappSdk
module Api
module Responses
class MessageDataResponse
attr_accessor :contacts, :messages
class << self
def build_from_response(response:)... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/responses/http_response_error.rb | Ruby | mit | 202 | main | 425 | # frozen_string_literal: true
module WhatsappSdk
module Api
module Responses
class HttpResponseError < StandardError
attr_reader :http_status, :body, :error_info
def initialize(http_status:, body:)
super
@http_status = http_status
@body = body
@error... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/responses/pagination_records.rb | Ruby | mit | 202 | main | 332 | # frozen_string_literal: true
module WhatsappSdk
module Api
module Responses
class PaginationRecords
attr_reader :records, :before, :after
def initialize(records:, before:, after:)
@records = records
@before = before
@after = after
end
end
en... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/responses/id_response.rb | Ruby | mit | 202 | main | 220 | # frozen_string_literal: true
module WhatsappSdk
module Api
module Responses
class IdResponse
attr_accessor :id
def initialize(id)
@id = id
end
end
end
end
end |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/api/responses/generic_error_response.rb | Ruby | mit | 202 | main | 776 | # frozen_string_literal: true
module WhatsappSdk
module Api
module Responses
class GenericErrorResponse
attr_reader :code, :subcode, :message, :type, :data, :fbtrace_id
def initialize(response:)
@code = response["code"]
@subcode = response["error_subcode"]
@me... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/resource/message_template_namespace.rb | Ruby | mit | 202 | main | 443 | # frozen_string_literal: true
module WhatsappSdk
module Resource
class MessageTemplateNamespace
attr_accessor :id, :message_template_namespace
def self.from_hash(hash)
message_template_namespace = new
message_template_namespace.id = hash["id"]
message_template_namespace.messa... |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/resource/email.rb | Ruby | mit | 202 | main | 320 | # frozen_string_literal: true
module WhatsappSdk
module Resource
class Email
attr_accessor :email, :type
def initialize(email:, type:)
@email = email
@type = type
end
def to_h
{
email: @email,
type: @type
}
end
end
end
end |
github | ignacio-chiazzo/ruby_whatsapp_sdk | https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk | lib/whatsapp_sdk/resource/location.rb | Ruby | mit | 202 | main | 929 | # typed: false
# frozen_string_literal: true
module WhatsappSdk
module Resource
class Location
# Returns the latitude of the location.
#
# @returns latitude [Float].
attr_accessor :latitude
# Returns the longitude of the location.
#
# @returns longitude [Float].
a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.