channex 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +21 -0
- data/LICENSE +21 -0
- data/README.md +281 -0
- data/Rakefile +12 -0
- data/lib/channex/client.rb +283 -0
- data/lib/channex/configuration.rb +52 -0
- data/lib/channex/errors.rb +62 -0
- data/lib/channex/object.rb +201 -0
- data/lib/channex/objects/booking_revision.rb +124 -0
- data/lib/channex/objects/booking_room.rb +68 -0
- data/lib/channex/objects/company.rb +16 -0
- data/lib/channex/objects/customer.rb +43 -0
- data/lib/channex/objects/guarantee.rb +21 -0
- data/lib/channex/objects/guest.rb +21 -0
- data/lib/channex/objects/message.rb +95 -0
- data/lib/channex/objects/message_thread.rb +76 -0
- data/lib/channex/objects/occupancy.rb +29 -0
- data/lib/channex/objects/review.rb +87 -0
- data/lib/channex/objects/service.rb +44 -0
- data/lib/channex/objects/tax.rb +36 -0
- data/lib/channex/objects.rb +22 -0
- data/lib/channex/resource.rb +130 -0
- data/lib/channex/resources/attachments.rb +36 -0
- data/lib/channex/resources/availability.rb +87 -0
- data/lib/channex/resources/availability_rules.rb +52 -0
- data/lib/channex/resources/booking_revisions.rb +112 -0
- data/lib/channex/resources/bookings.rb +72 -0
- data/lib/channex/resources/channels.rb +96 -0
- data/lib/channex/resources/facilities.rb +29 -0
- data/lib/channex/resources/group_users.rb +76 -0
- data/lib/channex/resources/groups.rb +26 -0
- data/lib/channex/resources/hotel_policies.rb +54 -0
- data/lib/channex/resources/message_threads.rb +89 -0
- data/lib/channex/resources/messages.rb +64 -0
- data/lib/channex/resources/photos.rb +117 -0
- data/lib/channex/resources/properties.rb +42 -0
- data/lib/channex/resources/property_users.rb +32 -0
- data/lib/channex/resources/rate_plans.rb +34 -0
- data/lib/channex/resources/restrictions.rb +98 -0
- data/lib/channex/resources/reviews.rb +41 -0
- data/lib/channex/resources/room_types.rb +34 -0
- data/lib/channex/resources/tax_sets.rb +34 -0
- data/lib/channex/resources/taxes.rb +60 -0
- data/lib/channex/resources/webhooks.rb +87 -0
- data/lib/channex/resources.rb +5 -0
- data/lib/channex/response.rb +102 -0
- data/lib/channex/version.rb +3 -0
- data/lib/channex.rb +52 -0
- data/sig/channex.rbs +4 -0
- metadata +124 -0
data/lib/channex.rb
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require "net/http"
|
|
2
|
+
require "json"
|
|
3
|
+
require "uri"
|
|
4
|
+
require "zeitwerk"
|
|
5
|
+
require "active_support"
|
|
6
|
+
require "active_support/core_ext/hash/slice"
|
|
7
|
+
require "active_support/core_ext/module/delegation"
|
|
8
|
+
require "active_support/core_ext/object/blank"
|
|
9
|
+
require "active_support/core_ext/string/inflections"
|
|
10
|
+
|
|
11
|
+
loader = Zeitwerk::Loader.for_gem
|
|
12
|
+
loader.setup
|
|
13
|
+
|
|
14
|
+
# Channex API Ruby client
|
|
15
|
+
#
|
|
16
|
+
# A clean, idiomatic Ruby library for interacting with the Channex.io
|
|
17
|
+
# channel manager API. Supports properties, room types, rate plans,
|
|
18
|
+
# availability, bookings, and more.
|
|
19
|
+
#
|
|
20
|
+
# @example Basic usage
|
|
21
|
+
# client = Channex::Client.new(api_key: "your-api-key")
|
|
22
|
+
# properties = client.properties.list
|
|
23
|
+
# property = client.properties.retrieve("property-uuid")
|
|
24
|
+
#
|
|
25
|
+
# @example With global configuration
|
|
26
|
+
# Channex.configure do |config|
|
|
27
|
+
# config.api_key = "your-api-key"
|
|
28
|
+
# config.environment = :production
|
|
29
|
+
# end
|
|
30
|
+
#
|
|
31
|
+
# client = Channex::Client.new
|
|
32
|
+
# client.properties.list
|
|
33
|
+
#
|
|
34
|
+
module Channex
|
|
35
|
+
class << self
|
|
36
|
+
attr_writer :configuration
|
|
37
|
+
|
|
38
|
+
def configuration
|
|
39
|
+
@configuration ||= Configuration.new
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def configure
|
|
43
|
+
yield(configuration)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def reset_configuration!
|
|
47
|
+
@configuration = Configuration.new
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
loader.eager_load
|
data/sig/channex.rbs
ADDED
metadata
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: channex
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- asgerb
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: activesupport
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '7.1'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '7.1'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: zeitwerk
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '2.6'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '2.6'
|
|
40
|
+
description: 'A clean, idiomatic Ruby library for the Channex.io channel manager API:
|
|
41
|
+
properties, room types, rate plans, availability, restrictions, bookings, webhooks,
|
|
42
|
+
and more.'
|
|
43
|
+
email:
|
|
44
|
+
- a@asgerbehnckejacobsen.dk
|
|
45
|
+
executables: []
|
|
46
|
+
extensions: []
|
|
47
|
+
extra_rdoc_files: []
|
|
48
|
+
files:
|
|
49
|
+
- CHANGELOG.md
|
|
50
|
+
- LICENSE
|
|
51
|
+
- README.md
|
|
52
|
+
- Rakefile
|
|
53
|
+
- lib/channex.rb
|
|
54
|
+
- lib/channex/client.rb
|
|
55
|
+
- lib/channex/configuration.rb
|
|
56
|
+
- lib/channex/errors.rb
|
|
57
|
+
- lib/channex/object.rb
|
|
58
|
+
- lib/channex/objects.rb
|
|
59
|
+
- lib/channex/objects/booking_revision.rb
|
|
60
|
+
- lib/channex/objects/booking_room.rb
|
|
61
|
+
- lib/channex/objects/company.rb
|
|
62
|
+
- lib/channex/objects/customer.rb
|
|
63
|
+
- lib/channex/objects/guarantee.rb
|
|
64
|
+
- lib/channex/objects/guest.rb
|
|
65
|
+
- lib/channex/objects/message.rb
|
|
66
|
+
- lib/channex/objects/message_thread.rb
|
|
67
|
+
- lib/channex/objects/occupancy.rb
|
|
68
|
+
- lib/channex/objects/review.rb
|
|
69
|
+
- lib/channex/objects/service.rb
|
|
70
|
+
- lib/channex/objects/tax.rb
|
|
71
|
+
- lib/channex/resource.rb
|
|
72
|
+
- lib/channex/resources.rb
|
|
73
|
+
- lib/channex/resources/attachments.rb
|
|
74
|
+
- lib/channex/resources/availability.rb
|
|
75
|
+
- lib/channex/resources/availability_rules.rb
|
|
76
|
+
- lib/channex/resources/booking_revisions.rb
|
|
77
|
+
- lib/channex/resources/bookings.rb
|
|
78
|
+
- lib/channex/resources/channels.rb
|
|
79
|
+
- lib/channex/resources/facilities.rb
|
|
80
|
+
- lib/channex/resources/group_users.rb
|
|
81
|
+
- lib/channex/resources/groups.rb
|
|
82
|
+
- lib/channex/resources/hotel_policies.rb
|
|
83
|
+
- lib/channex/resources/message_threads.rb
|
|
84
|
+
- lib/channex/resources/messages.rb
|
|
85
|
+
- lib/channex/resources/photos.rb
|
|
86
|
+
- lib/channex/resources/properties.rb
|
|
87
|
+
- lib/channex/resources/property_users.rb
|
|
88
|
+
- lib/channex/resources/rate_plans.rb
|
|
89
|
+
- lib/channex/resources/restrictions.rb
|
|
90
|
+
- lib/channex/resources/reviews.rb
|
|
91
|
+
- lib/channex/resources/room_types.rb
|
|
92
|
+
- lib/channex/resources/tax_sets.rb
|
|
93
|
+
- lib/channex/resources/taxes.rb
|
|
94
|
+
- lib/channex/resources/webhooks.rb
|
|
95
|
+
- lib/channex/response.rb
|
|
96
|
+
- lib/channex/version.rb
|
|
97
|
+
- sig/channex.rbs
|
|
98
|
+
homepage: https://github.com/servos-app/channex
|
|
99
|
+
licenses:
|
|
100
|
+
- MIT
|
|
101
|
+
metadata:
|
|
102
|
+
allowed_push_host: https://rubygems.org
|
|
103
|
+
rubygems_mfa_required: 'true'
|
|
104
|
+
homepage_uri: https://github.com/servos-app/channex
|
|
105
|
+
source_code_uri: https://github.com/servos-app/channex
|
|
106
|
+
changelog_uri: https://github.com/servos-app/channex/blob/main/CHANGELOG.md
|
|
107
|
+
rdoc_options: []
|
|
108
|
+
require_paths:
|
|
109
|
+
- lib
|
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
|
+
requirements:
|
|
112
|
+
- - ">="
|
|
113
|
+
- !ruby/object:Gem::Version
|
|
114
|
+
version: 3.2.0
|
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
|
+
requirements:
|
|
117
|
+
- - ">="
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: '0'
|
|
120
|
+
requirements: []
|
|
121
|
+
rubygems_version: 3.6.9
|
|
122
|
+
specification_version: 4
|
|
123
|
+
summary: Ruby client for the Channex.io channel manager API
|
|
124
|
+
test_files: []
|