dnsimple 10.0.0 → 11.0.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 +4 -4
- data/.github/dependabot.yml +5 -7
- data/.github/workflows/ci.yml +3 -3
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/sync-test-fixtures.yml +55 -0
- data/.markdownlint.yaml +15 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_dnsimple.yml +14 -30
- data/CHANGELOG.md +5 -0
- data/Gemfile +7 -7
- data/lib/dnsimple/client/clients.rb +29 -31
- data/lib/dnsimple/client/domains_email_forwards.rb +1 -1
- data/lib/dnsimple/client.rb +5 -5
- data/lib/dnsimple/default.rb +7 -7
- data/lib/dnsimple/response.rb +3 -3
- data/lib/dnsimple/struct/charge.rb +1 -1
- data/lib/dnsimple/struct/email_forward.rb +0 -8
- data/lib/dnsimple/struct.rb +40 -40
- data/lib/dnsimple/version.rb +1 -1
- data/lib/dnsimple.rb +5 -5
- data/spec/dnsimple/client/accounts_spec.rb +2 -2
- data/spec/dnsimple/client/billing_spec.rb +3 -3
- data/spec/dnsimple/client/certificates_spec.rb +11 -11
- data/spec/dnsimple/client/client_service_spec.rb +1 -1
- data/spec/dnsimple/client/contacts_spec.rb +6 -6
- data/spec/dnsimple/client/dns_analytics_spec.rb +9 -9
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +5 -5
- data/spec/dnsimple/client/domains_dnssec_spec.rb +4 -4
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +8 -15
- data/spec/dnsimple/client/domains_pushes_spec.rb +5 -5
- data/spec/dnsimple/client/domains_spec.rb +6 -6
- data/spec/dnsimple/client/identity_spec.rb +2 -2
- data/spec/dnsimple/client/oauth_spec.rb +3 -3
- data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +3 -3
- data/spec/dnsimple/client/registrar_delegation_spec.rb +1 -1
- data/spec/dnsimple/client/registrar_spec.rb +1 -1
- data/spec/dnsimple/client/registrar_transfer_lock_spec.rb +4 -4
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +1 -1
- data/spec/dnsimple/client/services_domains_spec.rb +4 -4
- data/spec/dnsimple/client/services_spec.rb +1 -1
- data/spec/dnsimple/client/templates_domains_spec.rb +2 -2
- data/spec/dnsimple/client/templates_records_spec.rb +4 -4
- data/spec/dnsimple/client/templates_spec.rb +2 -2
- data/spec/dnsimple/client/tlds_spec.rb +5 -5
- data/spec/dnsimple/client/vanity_name_servers_spec.rb +1 -1
- data/spec/dnsimple/client/webhooks_spec.rb +5 -5
- data/spec/dnsimple/client/zones_distributions_spec.rb +3 -3
- data/spec/dnsimple/client/zones_records_spec.rb +7 -7
- data/spec/dnsimple/client/zones_spec.rb +6 -6
- data/spec/dnsimple/client_spec.rb +10 -10
- data/spec/dnsimple/extra_spec.rb +1 -1
- data/spec/dnsimple/options/base_spec.rb +5 -5
- data/spec/dnsimple/options/list_options_spec.rb +21 -21
- data/spec/fixtures.http/accounts/success-user.http +2 -1
- data/spec/fixtures.http/checkRegistrantChange/error-contactnotfound.http +4 -4
- data/spec/fixtures.http/checkRegistrantChange/error-domainnotfound.http +4 -4
- data/spec/fixtures.http/checkRegistrantChange/success.http +5 -5
- data/spec/fixtures.http/createContact/error-validation-errors.http +18 -0
- data/spec/fixtures.http/createEmailForward/created.http +1 -2
- data/spec/fixtures.http/createRegistrantChange/success.http +5 -5
- data/spec/fixtures.http/createWebhook/created.http +16 -16
- data/spec/fixtures.http/deleteRegistrantChange/success.http +4 -4
- data/spec/fixtures.http/deleteRegistrantChange/success_async.http +14 -0
- data/spec/fixtures.http/dnsAnalytics/success.http +1 -1
- data/spec/fixtures.http/getDomainPrices/failure.http +18 -18
- data/spec/fixtures.http/getDomainPrices/success.http +21 -21
- data/spec/fixtures.http/getDomainRestore/success.http +13 -14
- data/spec/fixtures.http/getEmailForward/success.http +1 -2
- data/spec/fixtures.http/getRegistrantChange/success.http +5 -5
- data/spec/fixtures.http/getTld/success.http +1 -1
- data/spec/fixtures.http/getWebhook/success.http +16 -16
- data/spec/fixtures.http/listAccounts/success-user.http +1 -1
- data/spec/fixtures.http/listCharges/fail-400-bad-filter.http +0 -2
- data/spec/fixtures.http/listCharges/fail-403.http +0 -2
- data/spec/fixtures.http/listCharges/success.http +0 -2
- data/spec/fixtures.http/listEmailForwards/success.http +1 -1
- data/spec/fixtures.http/listRegistrantChanges/success.http +5 -5
- data/spec/fixtures.http/listTlds/success.http +1 -1
- data/spec/fixtures.http/listWebhooks/success.http +16 -16
- data/spec/fixtures.http/registerDomain/error-extended-attributes.http +18 -0
- data/spec/fixtures.http/restoreDomain/success.http +12 -13
- data/spec/fixtures.http/updateZoneNsRecords/success.http +16 -0
- data/spec/fixtures.http/whoami/success-account.http +1 -1
- data/spec/fixtures.http/whoami/success.http +1 -1
- data/spec/spec_helper.rb +4 -4
- data/spec/support/webmock.rb +1 -1
- metadata +7 -11
- data/.github/CODEOWNERS +0 -1
- data/.github/workflows/auto-merge.yml +0 -32
- data/lib/dnsimple/client/domains_collaborators.rb +0 -87
- data/spec/dnsimple/client/domains_collaborators_spec.rb +0 -164
- data/spec/fixtures.http/addCollaborator/invite-success.http +0 -20
- data/spec/fixtures.http/addCollaborator/success.http +0 -20
- data/spec/fixtures.http/listCollaborators/success.http +0 -20
- data/spec/fixtures.http/notfound-collaborator.http +0 -15
- data/spec/fixtures.http/removeCollaborator/success.http +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4181725aaf336953ed62dc82cb74fe1d4457880f9fccf3940c817e27ffa559b5
|
4
|
+
data.tar.gz: 11662d9a7780adbb47599e34a6e820c2b980c0be22ec79985557f4bd1801592c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4357613ee6e5c1b8d25a89a8ce6d61fa53c3369bf59ff9e33f5fce0fc800f31e5a0f0d4709726de2fb0f0c4bc7ec092a34c238d9b8fca28bdb722ad6cd2462b
|
7
|
+
data.tar.gz: fa7726f50d6794b34ce537292d50b8050379751942201dad2e61ae246aed2ba5079841140b87ac6bd4494b724aeebc155cc59438f9f9693f69b8dc0c4742357f
|
data/.github/dependabot.yml
CHANGED
@@ -4,18 +4,16 @@ updates:
|
|
4
4
|
- package-ecosystem: bundler
|
5
5
|
directory: /
|
6
6
|
schedule:
|
7
|
-
interval:
|
7
|
+
interval: weekly
|
8
8
|
open-pull-requests-limit: 10
|
9
9
|
labels:
|
10
10
|
- task
|
11
11
|
- dependencies
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
- package-ecosystem: github-actions
|
14
|
+
directory: /
|
14
15
|
schedule:
|
15
|
-
interval:
|
16
|
-
time: '12:00'
|
17
|
-
open-pull-requests-limit: 10
|
16
|
+
interval: weekly
|
18
17
|
labels:
|
19
18
|
- task
|
20
19
|
- dependencies
|
21
|
-
- automerge
|
data/.github/workflows/ci.yml
CHANGED
@@ -16,9 +16,9 @@ jobs:
|
|
16
16
|
runs-on: ubuntu-latest
|
17
17
|
steps:
|
18
18
|
- name: Checkout Code
|
19
|
-
uses: actions/checkout@
|
19
|
+
uses: actions/checkout@v5
|
20
20
|
- name: Run markdownlint-cli
|
21
|
-
uses: nosborn/github-action-markdown-cli@v3.
|
21
|
+
uses: nosborn/github-action-markdown-cli@v3.5.0
|
22
22
|
with:
|
23
23
|
files: .
|
24
24
|
config_file: ".markdownlint.yaml"
|
@@ -36,7 +36,7 @@ jobs:
|
|
36
36
|
- 'ruby-head'
|
37
37
|
- 'truffleruby-head'
|
38
38
|
steps:
|
39
|
-
- uses: actions/checkout@
|
39
|
+
- uses: actions/checkout@v5
|
40
40
|
- name: Set up Ruby
|
41
41
|
uses: ruby/setup-ruby@v1
|
42
42
|
with:
|
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
|
12
12
|
steps:
|
13
13
|
- name: Wait for tests to succeed
|
14
|
-
uses: lewagon/wait-on-check-action@v1.
|
14
|
+
uses: lewagon/wait-on-check-action@v1.4.0
|
15
15
|
with:
|
16
16
|
ref: 'refs/heads/main'
|
17
17
|
running-workflow-name: 'Release to RubyGems'
|
@@ -19,7 +19,7 @@ jobs:
|
|
19
19
|
wait-interval: 10
|
20
20
|
allowed-conclusions: success
|
21
21
|
|
22
|
-
- uses: actions/checkout@
|
22
|
+
- uses: actions/checkout@v5
|
23
23
|
|
24
24
|
- name: Release Gem
|
25
25
|
uses: simplyqio/publish-rubygems-action@2.0.0
|
@@ -0,0 +1,55 @@
|
|
1
|
+
name: Sync test fixtures
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
sync_fixtures:
|
8
|
+
name: Sync test fixtures
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- name: Checkout repository
|
12
|
+
uses: actions/checkout@v5
|
13
|
+
- name: Sync fixtures
|
14
|
+
run: |
|
15
|
+
TMP_DIR=$(mktemp -d)
|
16
|
+
curl -fsSL "https://codeload.github.com/dnsimple/dnsimple-developer/tar.gz/refs/heads/main" \
|
17
|
+
| tar -xz -C "$TMP_DIR"
|
18
|
+
rsync -a --delete "$TMP_DIR/dnsimple-developer-main/fixtures/v2/api/" spec/fixtures.http/
|
19
|
+
- name: Create a PR to sync fixtures if there are changes
|
20
|
+
run: |
|
21
|
+
cat <<'MD' > pr_body.md
|
22
|
+
This PR replaces the fixtures in this repository with those from https://github.com/dnsimple/dnsimple-developer/
|
23
|
+
|
24
|
+
## Checklist
|
25
|
+
- [ ] Close and re-open this PR to trigger the CI workflow (it does not run automatically)
|
26
|
+
- [ ] Ensure the CI workflow passes before merging
|
27
|
+
MD
|
28
|
+
|
29
|
+
# Configure Git identity for the workflow
|
30
|
+
git config --global user.name "github-actions"
|
31
|
+
git config --global user.email "github-actions@github.com"
|
32
|
+
|
33
|
+
# Create and switch to a new branch
|
34
|
+
BRANCH="chore/sync-fixtures-${GITHUB_RUN_ID}"
|
35
|
+
NOW="$(date +'%Y-%m-%d %H:%M:%S')"
|
36
|
+
git checkout -b "$BRANCH"
|
37
|
+
|
38
|
+
# Stage changes
|
39
|
+
git add spec/fixtures.http
|
40
|
+
|
41
|
+
# Commit if there are staged changes
|
42
|
+
if ! git diff --cached --quiet; then
|
43
|
+
git commit -m "chore: sync test fixtures as of $NOW"
|
44
|
+
git push -u origin "$BRANCH"
|
45
|
+
|
46
|
+
gh pr create \
|
47
|
+
--title "chore: Sync fixtures as of $NOW" \
|
48
|
+
--body-file pr_body.md \
|
49
|
+
--base main \
|
50
|
+
--head "$BRANCH"
|
51
|
+
else
|
52
|
+
echo "No fixture detected; nothing to do"
|
53
|
+
fi
|
54
|
+
env:
|
55
|
+
GITHUB_TOKEN: ${{ github.token }}
|
data/.markdownlint.yaml
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_dnsimple.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# This file serves as a template for RuboCop configuration. The primary template is maintained in the engineering repository.
|
2
|
+
# Please ensure that any changes made here are also reflected in the engineering file to maintain consistency.
|
2
3
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# DNSimple Ruby engineering template: https://github.com/dnsimple/dnsimple-engineering/blob/main/templates/ruby/rubocop_dnsimple.yml
|
5
|
+
#
|
6
|
+
# For default configurations, refer to: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
7
|
+
#
|
8
|
+
# Additional References:
|
9
|
+
# * Ruby Style Guide: https://github.com/bbatsov/ruby-style-guide
|
10
|
+
# * RuboCop Documentation: https://rubocop.readthedocs.io/
|
6
11
|
|
7
12
|
AllCops:
|
8
13
|
Exclude:
|
@@ -10,20 +15,6 @@ AllCops:
|
|
10
15
|
- '*.gemspec'
|
11
16
|
NewCops: enable
|
12
17
|
|
13
|
-
# In most cases, Gems are sorted alphabetically.
|
14
|
-
# However, in some few cases the order is relevant due to dependencies.
|
15
|
-
Bundler/OrderedGems:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
# This cop requires odd code indentations (as of rubocop 0.57.0)
|
19
|
-
# https://github.com/rubocop-hq/rubocop/issues/5956
|
20
|
-
Layout/AccessModifierIndentation:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
# It causes weird aligments, especially for specs.
|
24
|
-
Layout/BlockEndNewline:
|
25
|
-
Enabled: false
|
26
|
-
|
27
18
|
# Generally, the keyword style uses a lot of space. This is particularly true when
|
28
19
|
# you use case/if statements, in combination with a long-name variable.
|
29
20
|
#
|
@@ -110,7 +101,7 @@ Naming/MemoizedInstanceVariableName:
|
|
110
101
|
Naming/PredicateName:
|
111
102
|
Enabled: false
|
112
103
|
|
113
|
-
# The team agreed decided to use exception
|
104
|
+
# The team agreed decided to use exception.
|
114
105
|
Naming/RescuedExceptionsVariableName:
|
115
106
|
PreferredName: 'exception'
|
116
107
|
|
@@ -160,8 +151,10 @@ Style/FormatString:
|
|
160
151
|
Style/FormatStringToken:
|
161
152
|
Enabled: false
|
162
153
|
|
163
|
-
#
|
154
|
+
# always - forces use of the 3.1 syntax (e.g. foo:)
|
155
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashSyntax
|
164
156
|
Style/HashSyntax:
|
157
|
+
EnforcedShorthandSyntax: always
|
165
158
|
Exclude:
|
166
159
|
# Rakefiles generally have definitions like
|
167
160
|
# :default => :test
|
@@ -191,7 +184,7 @@ Style/MultilineBlockChain:
|
|
191
184
|
Style/NegatedIf:
|
192
185
|
Enabled: false
|
193
186
|
|
194
|
-
# Magic numbers are not welcomed
|
187
|
+
# Magic numbers are not welcomed.
|
195
188
|
Style/NumericLiterals:
|
196
189
|
Exclude:
|
197
190
|
# however tests can use numeric literals for method calls,
|
@@ -219,13 +212,9 @@ Style/SpecialGlobalVars:
|
|
219
212
|
Enabled: false
|
220
213
|
EnforcedStyle: use_perl_names
|
221
214
|
|
222
|
-
# We generally use double quotes, sometimes single quotes.
|
223
|
-
# Should we enforce it at code level?
|
224
215
|
Style/StringLiterals:
|
225
|
-
Enabled: false
|
226
216
|
EnforcedStyle: double_quotes
|
227
217
|
|
228
|
-
# Pick one option for consistency.
|
229
218
|
Style/StringLiteralsInInterpolation:
|
230
219
|
EnforcedStyle: double_quotes
|
231
220
|
|
@@ -266,11 +255,6 @@ Style/WordArray:
|
|
266
255
|
Layout/CaseIndentation:
|
267
256
|
EnforcedStyle: end
|
268
257
|
|
269
|
-
# I was a big fan of leading, but trailing seems to be more commonly adopted.
|
270
|
-
# At least at the time being.
|
271
|
-
Layout/DotPosition:
|
272
|
-
EnforcedStyle: leading
|
273
|
-
|
274
258
|
# Double empty lines are useful to separate conceptually different methods
|
275
259
|
# in the same class or module.
|
276
260
|
Layout/EmptyLines:
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
|
|
4
4
|
|
5
5
|
## main
|
6
6
|
|
7
|
+
## 11.0.0
|
8
|
+
|
9
|
+
- CHANGED: Removed `from` and `to` fields in `EmailForward`
|
10
|
+
- CHANGED: Removed `DomainCollaborators`
|
11
|
+
|
7
12
|
## 10.0.0
|
8
13
|
|
9
14
|
- CHANGED: Minimum Ruby version is now 3.2
|
data/Gemfile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem
|
8
|
-
gem 'rubocop', '1.75.4', require: false
|
9
|
-
gem 'rubocop-performance', '1.25.0', require: false
|
10
|
-
gem 'rubocop-rake', '0.7.1', require: false
|
11
|
-
gem 'rubocop-rspec', '3.6.0', require: false
|
12
|
-
gem "base64", "~> 0.2.0"
|
7
|
+
gem "base64", "~> 0.3.0"
|
13
8
|
gem "bigdecimal", "~> 3.1"
|
9
|
+
gem "coveralls", "~> 0.8", require: false
|
14
10
|
gem "csv", "~> 3.2"
|
11
|
+
gem "rubocop", "~> 1.75", require: false
|
12
|
+
gem "rubocop-performance", "~> 1.25", require: false
|
13
|
+
gem "rubocop-rake", "~> 0.7", require: false
|
14
|
+
gem "rubocop-rspec", "~> 3.6", require: false
|
@@ -120,7 +120,7 @@ module Dnsimple
|
|
120
120
|
end
|
121
121
|
|
122
122
|
|
123
|
-
require_relative
|
123
|
+
require_relative "accounts"
|
124
124
|
|
125
125
|
class AccountsService < ClientService
|
126
126
|
|
@@ -128,7 +128,7 @@ module Dnsimple
|
|
128
128
|
|
129
129
|
end
|
130
130
|
|
131
|
-
require_relative
|
131
|
+
require_relative "billing"
|
132
132
|
|
133
133
|
class BillingService < ClientService
|
134
134
|
|
@@ -136,7 +136,7 @@ module Dnsimple
|
|
136
136
|
|
137
137
|
end
|
138
138
|
|
139
|
-
require_relative
|
139
|
+
require_relative "certificates"
|
140
140
|
|
141
141
|
class CertificatesService < ClientService
|
142
142
|
|
@@ -145,7 +145,7 @@ module Dnsimple
|
|
145
145
|
end
|
146
146
|
|
147
147
|
|
148
|
-
require_relative
|
148
|
+
require_relative "contacts"
|
149
149
|
|
150
150
|
class ContactsService < ClientService
|
151
151
|
|
@@ -154,12 +154,11 @@ module Dnsimple
|
|
154
154
|
end
|
155
155
|
|
156
156
|
|
157
|
-
require_relative
|
158
|
-
require_relative
|
159
|
-
require_relative
|
160
|
-
require_relative
|
161
|
-
require_relative
|
162
|
-
require_relative 'domains_collaborators'
|
157
|
+
require_relative "domains"
|
158
|
+
require_relative "domains_delegation_signer_records"
|
159
|
+
require_relative "domains_dnssec"
|
160
|
+
require_relative "domains_email_forwards"
|
161
|
+
require_relative "domains_pushes"
|
163
162
|
|
164
163
|
class DomainsService < ClientService
|
165
164
|
|
@@ -168,11 +167,10 @@ module Dnsimple
|
|
168
167
|
include Client::DomainsDnssec
|
169
168
|
include Client::DomainsEmailForwards
|
170
169
|
include Client::DomainsPushes
|
171
|
-
include Client::DomainsCollaborators
|
172
170
|
|
173
171
|
end
|
174
172
|
|
175
|
-
require_relative
|
173
|
+
require_relative "dns_analytics"
|
176
174
|
|
177
175
|
class DnsAnalyticsService < ClientService
|
178
176
|
|
@@ -181,7 +179,7 @@ module Dnsimple
|
|
181
179
|
end
|
182
180
|
|
183
181
|
|
184
|
-
require_relative
|
182
|
+
require_relative "identity"
|
185
183
|
|
186
184
|
class IdentityService < ClientService
|
187
185
|
|
@@ -190,7 +188,7 @@ module Dnsimple
|
|
190
188
|
end
|
191
189
|
|
192
190
|
|
193
|
-
require_relative
|
191
|
+
require_relative "oauth"
|
194
192
|
|
195
193
|
class OauthService < ClientService
|
196
194
|
|
@@ -198,12 +196,12 @@ module Dnsimple
|
|
198
196
|
|
199
197
|
end
|
200
198
|
|
201
|
-
require_relative
|
202
|
-
require_relative
|
203
|
-
require_relative
|
204
|
-
require_relative
|
205
|
-
require_relative
|
206
|
-
require_relative
|
199
|
+
require_relative "registrar"
|
200
|
+
require_relative "registrar_auto_renewal"
|
201
|
+
require_relative "registrar_whois_privacy"
|
202
|
+
require_relative "registrar_registrant_changes"
|
203
|
+
require_relative "registrar_transfer_lock"
|
204
|
+
require_relative "registrar_delegation"
|
207
205
|
|
208
206
|
class RegistrarService < ClientService
|
209
207
|
|
@@ -217,8 +215,8 @@ module Dnsimple
|
|
217
215
|
end
|
218
216
|
|
219
217
|
|
220
|
-
require_relative
|
221
|
-
require_relative
|
218
|
+
require_relative "services"
|
219
|
+
require_relative "services_domains"
|
222
220
|
|
223
221
|
class ServicesService < ClientService
|
224
222
|
|
@@ -228,9 +226,9 @@ module Dnsimple
|
|
228
226
|
end
|
229
227
|
|
230
228
|
|
231
|
-
require_relative
|
232
|
-
require_relative
|
233
|
-
require_relative
|
229
|
+
require_relative "templates"
|
230
|
+
require_relative "templates_domains"
|
231
|
+
require_relative "templates_records"
|
234
232
|
|
235
233
|
class TemplatesService < ClientService
|
236
234
|
|
@@ -241,7 +239,7 @@ module Dnsimple
|
|
241
239
|
end
|
242
240
|
|
243
241
|
|
244
|
-
require_relative
|
242
|
+
require_relative "tlds"
|
245
243
|
|
246
244
|
class TldsService < ClientService
|
247
245
|
|
@@ -250,7 +248,7 @@ module Dnsimple
|
|
250
248
|
end
|
251
249
|
|
252
250
|
|
253
|
-
require_relative
|
251
|
+
require_relative "vanity_name_servers"
|
254
252
|
|
255
253
|
class VanityNameServersService < ClientService
|
256
254
|
|
@@ -259,9 +257,9 @@ module Dnsimple
|
|
259
257
|
end
|
260
258
|
|
261
259
|
|
262
|
-
require_relative
|
263
|
-
require_relative
|
264
|
-
require_relative
|
260
|
+
require_relative "zones"
|
261
|
+
require_relative "zones_records"
|
262
|
+
require_relative "zones_distributions"
|
265
263
|
|
266
264
|
class ZonesService < ClientService
|
267
265
|
|
@@ -272,7 +270,7 @@ module Dnsimple
|
|
272
270
|
end
|
273
271
|
|
274
272
|
|
275
|
-
require_relative
|
273
|
+
require_relative "webhooks"
|
276
274
|
|
277
275
|
class WebhooksService < ClientService
|
278
276
|
|
@@ -69,7 +69,7 @@ module Dnsimple
|
|
69
69
|
#
|
70
70
|
# @raise [Dnsimple::RequestError]
|
71
71
|
def create_email_forward(account_id, domain_id, attributes, options = {})
|
72
|
-
Extra.validate_mandatory_attributes(attributes, [:
|
72
|
+
Extra.validate_mandatory_attributes(attributes, [:alias_name, :destination_email])
|
73
73
|
response = client.post(Client.versioned("/%s/domains/%s/email_forwards" % [account_id, domain_id]), attributes, options)
|
74
74
|
|
75
75
|
Dnsimple::Response.new(response, Struct::EmailForward.new(response["data"]))
|
data/lib/dnsimple/client.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
3
|
+
require "httparty"
|
4
|
+
require "dnsimple/extra"
|
5
|
+
require "dnsimple/struct"
|
6
|
+
require "dnsimple/response"
|
7
|
+
require "dnsimple/client/clients"
|
8
8
|
|
9
9
|
module Dnsimple
|
10
10
|
# Client for the DNSimple API
|
data/lib/dnsimple/default.rb
CHANGED
@@ -35,43 +35,43 @@ module Dnsimple
|
|
35
35
|
# Default API endpoint from ENV or {BASE_URL}
|
36
36
|
# @return [String]
|
37
37
|
def base_url
|
38
|
-
ENV.fetch(
|
38
|
+
ENV.fetch("DNSIMPLE_BASE_URL", BASE_URL)
|
39
39
|
end
|
40
40
|
|
41
41
|
# Default DNSimple username for Basic Auth from ENV
|
42
42
|
# @return [String]
|
43
43
|
def username
|
44
|
-
ENV.fetch(
|
44
|
+
ENV.fetch("DNSIMPLE_USERNAME", nil)
|
45
45
|
end
|
46
46
|
|
47
47
|
# Default DNSimple password for Basic Auth from ENV
|
48
48
|
# @return [String]
|
49
49
|
def password
|
50
|
-
ENV.fetch(
|
50
|
+
ENV.fetch("DNSIMPLE_PASSWORD", nil)
|
51
51
|
end
|
52
52
|
|
53
53
|
# Default DNSimple access token for OAuth authentication from ENV
|
54
54
|
# @return [String]
|
55
55
|
def access_token
|
56
|
-
ENV.fetch(
|
56
|
+
ENV.fetch("DNSIMPLE_ACCESS_TOKEN", nil)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Default DNSimple Domain API Token for Token Auth from ENV
|
60
60
|
# @return [String]
|
61
61
|
def domain_api_token
|
62
|
-
ENV.fetch(
|
62
|
+
ENV.fetch("DNSIMPLE_API_DOMAIN_TOKEN", nil)
|
63
63
|
end
|
64
64
|
|
65
65
|
# Default User-Agent header string from ENV
|
66
66
|
# @return [String]
|
67
67
|
def user_agent
|
68
|
-
ENV.fetch(
|
68
|
+
ENV.fetch("DNSIMPLE_USER_AGENT", nil)
|
69
69
|
end
|
70
70
|
|
71
71
|
# Default Proxy address:port from ENV
|
72
72
|
# @return [String]
|
73
73
|
def proxy
|
74
|
-
ENV.fetch(
|
74
|
+
ENV.fetch("DNSIMPLE_PROXY", nil)
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
data/lib/dnsimple/response.rb
CHANGED
@@ -32,9 +32,9 @@ module Dnsimple
|
|
32
32
|
@http_response = http_response
|
33
33
|
@data = data
|
34
34
|
|
35
|
-
@rate_limit = http_response.headers[
|
36
|
-
@rate_limit_remaining = http_response.headers[
|
37
|
-
@rate_limit_reset = Time.at(http_response.headers[
|
35
|
+
@rate_limit = http_response.headers["X-RateLimit-Limit"].to_i
|
36
|
+
@rate_limit_remaining = http_response.headers["X-RateLimit-Remaining"].to_i
|
37
|
+
@rate_limit_reset = Time.at(http_response.headers["X-RateLimit-Reset"].to_i)
|
38
38
|
end
|
39
39
|
|
40
40
|
end
|
@@ -10,14 +10,6 @@ module Dnsimple
|
|
10
10
|
# @return [Integer] The associated domain ID.
|
11
11
|
attr_accessor :domain_id
|
12
12
|
|
13
|
-
# @return [String] The "local part" of the originating email address. Anything to the left of the @ symbol.
|
14
|
-
# @deprecated use {#alias_email} instead
|
15
|
-
attr_accessor :from
|
16
|
-
|
17
|
-
# @return [String] The full email address to forward to.
|
18
|
-
# @deprecated use {#destination_email} instead
|
19
|
-
attr_accessor :to
|
20
|
-
|
21
13
|
# @return [String] The receiving email recipient.
|
22
14
|
attr_accessor :alias_email
|
23
15
|
|
data/lib/dnsimple/struct.rb
CHANGED
@@ -15,43 +15,43 @@ module Dnsimple
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
require_relative
|
19
|
-
require_relative
|
20
|
-
require_relative
|
21
|
-
require_relative
|
22
|
-
require_relative
|
23
|
-
require_relative
|
24
|
-
require_relative
|
25
|
-
require_relative
|
26
|
-
require_relative
|
27
|
-
require_relative
|
28
|
-
require_relative
|
29
|
-
require_relative
|
30
|
-
require_relative
|
31
|
-
require_relative
|
32
|
-
require_relative
|
33
|
-
require_relative
|
34
|
-
require_relative
|
35
|
-
require_relative
|
36
|
-
require_relative
|
37
|
-
require_relative
|
38
|
-
require_relative
|
39
|
-
require_relative
|
40
|
-
require_relative
|
41
|
-
require_relative
|
42
|
-
require_relative
|
43
|
-
require_relative
|
44
|
-
require_relative
|
45
|
-
require_relative
|
46
|
-
require_relative
|
47
|
-
require_relative
|
48
|
-
require_relative
|
49
|
-
require_relative
|
50
|
-
require_relative
|
51
|
-
require_relative
|
52
|
-
require_relative
|
53
|
-
require_relative
|
54
|
-
require_relative
|
55
|
-
require_relative
|
56
|
-
require_relative
|
57
|
-
require_relative
|
18
|
+
require_relative "struct/account"
|
19
|
+
require_relative "struct/collaborator"
|
20
|
+
require_relative "struct/contact"
|
21
|
+
require_relative "struct/certificate"
|
22
|
+
require_relative "struct/certificate_bundle"
|
23
|
+
require_relative "struct/certificate_purchase"
|
24
|
+
require_relative "struct/certificate_renewal"
|
25
|
+
require_relative "struct/charge"
|
26
|
+
require_relative "struct/delegation_signer_record"
|
27
|
+
require_relative "struct/dnssec"
|
28
|
+
require_relative "struct/domain"
|
29
|
+
require_relative "struct/domain_check"
|
30
|
+
require_relative "struct/domain_premium_price"
|
31
|
+
require_relative "struct/domain_price"
|
32
|
+
require_relative "struct/domain_push"
|
33
|
+
require_relative "struct/domain_registration"
|
34
|
+
require_relative "struct/domain_restore"
|
35
|
+
require_relative "struct/domain_transfer"
|
36
|
+
require_relative "struct/domain_renewal"
|
37
|
+
require_relative "struct/dns_analytics"
|
38
|
+
require_relative "struct/email_forward"
|
39
|
+
require_relative "struct/extended_attribute"
|
40
|
+
require_relative "struct/oauth_token"
|
41
|
+
require_relative "struct/registrant_change_check"
|
42
|
+
require_relative "struct/registrant_change"
|
43
|
+
require_relative "struct/transfer_lock"
|
44
|
+
require_relative "struct/zone_record"
|
45
|
+
require_relative "struct/service"
|
46
|
+
require_relative "struct/template"
|
47
|
+
require_relative "struct/template_record"
|
48
|
+
require_relative "struct/tld"
|
49
|
+
require_relative "struct/user"
|
50
|
+
require_relative "struct/vanity_name_server"
|
51
|
+
require_relative "struct/whois_privacy"
|
52
|
+
require_relative "struct/whois_privacy_renewal"
|
53
|
+
require_relative "struct/zone"
|
54
|
+
require_relative "struct/zone_file"
|
55
|
+
require_relative "struct/zone_distribution"
|
56
|
+
require_relative "struct/webhook"
|
57
|
+
require_relative "struct/whoami"
|