devdraft 1.0.0 → 1.0.1
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/README.md +86 -1088
- data/devdraft_ai_sdk.gemspec +2 -2
- data/example.rb +94 -0
- data/git_push.sh +1 -1
- data/lib/devdraft/api_error.rb +1 -1
- data/lib/devdraft/configuration.rb +1 -1
- data/lib/devdraft/version.rb +2 -2
- metadata +3 -2
data/devdraft_ai_sdk.gemspec
CHANGED
@@ -16,7 +16,7 @@ require "devdraft/version"
|
|
16
16
|
|
17
17
|
Gem::Specification.new do |s|
|
18
18
|
s.name = "devdraft"
|
19
|
-
s.version =
|
19
|
+
s.version = Devdraft::VERSION
|
20
20
|
s.platform = Gem::Platform::RUBY
|
21
21
|
s.authors = ["Swagger-Codegen"]
|
22
22
|
s.email = [""]
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
|
32
32
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
33
33
|
|
34
|
-
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
34
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? && !f.end_with?('.gem') }
|
35
35
|
s.test_files = `find spec/*`.split("\n")
|
36
36
|
s.executables = []
|
37
37
|
s.require_paths = ["lib"]
|
data/example.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Example usage of the Devdraft Ruby SDK
|
3
|
+
#
|
4
|
+
# Installation:
|
5
|
+
# gem install devdraft
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
# ruby example.rb
|
9
|
+
|
10
|
+
require 'devdraft'
|
11
|
+
|
12
|
+
# Configure the SDK
|
13
|
+
Devdraft.configure do |config|
|
14
|
+
# Set your API key (required for authenticated endpoints)
|
15
|
+
config.api_key['api_key'] = 'YOUR_API_KEY'
|
16
|
+
|
17
|
+
# Optional: Set a custom base URL if needed
|
18
|
+
# config.base_url = 'https://api.devdraft.com'
|
19
|
+
|
20
|
+
# Optional: Enable debug logging
|
21
|
+
config.debugging = true
|
22
|
+
end
|
23
|
+
|
24
|
+
# Example 1: Health Check
|
25
|
+
def check_health
|
26
|
+
puts "\n=== Health Check Example ==="
|
27
|
+
api_instance = Devdraft::APIHealthApi.new
|
28
|
+
|
29
|
+
begin
|
30
|
+
# Public health check (no auth required)
|
31
|
+
result = api_instance.health_controller_public_health_check_v0
|
32
|
+
puts "Public Health Check Response:"
|
33
|
+
puts result.inspect
|
34
|
+
|
35
|
+
# Authenticated health check
|
36
|
+
result = api_instance.health_controller_check_v0
|
37
|
+
puts "\nAuthenticated Health Check Response:"
|
38
|
+
puts result.inspect
|
39
|
+
rescue => e
|
40
|
+
puts "Error during health check: #{e}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Example 2: List Customers
|
45
|
+
def list_customers
|
46
|
+
puts "\n=== List Customers Example ==="
|
47
|
+
api_instance = Devdraft::CustomersApi.new
|
48
|
+
|
49
|
+
begin
|
50
|
+
# List customers with pagination
|
51
|
+
result = api_instance.customers_controller_list_v0(
|
52
|
+
page: 1,
|
53
|
+
limit: 10
|
54
|
+
)
|
55
|
+
puts "Customers Response:"
|
56
|
+
puts result.inspect
|
57
|
+
rescue => e
|
58
|
+
puts "Error listing customers: #{e}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Example 3: Create Payment Link
|
63
|
+
def create_payment_link
|
64
|
+
puts "\n=== Create Payment Link Example ==="
|
65
|
+
api_instance = Devdraft::PaymentLinksApi.new
|
66
|
+
|
67
|
+
begin
|
68
|
+
# Create a payment link
|
69
|
+
payment_link = Devdraft::CreatePaymentLinkDto.new(
|
70
|
+
amount: 100.00,
|
71
|
+
currency: 'USD',
|
72
|
+
description: 'Test Payment Link',
|
73
|
+
expires_at: (Time.now + 86400).iso8601 # 24 hours from now
|
74
|
+
)
|
75
|
+
|
76
|
+
result = api_instance.payment_links_controller_create_v0(payment_link)
|
77
|
+
puts "Payment Link Created:"
|
78
|
+
puts result.inspect
|
79
|
+
rescue => e
|
80
|
+
puts "Error creating payment link: #{e}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Run examples
|
85
|
+
puts "Devdraft Ruby SDK Examples"
|
86
|
+
puts "=========================="
|
87
|
+
puts "Make sure to set your API key in the configuration block above."
|
88
|
+
puts "Running examples..."
|
89
|
+
|
90
|
+
check_health
|
91
|
+
list_customers
|
92
|
+
create_payment_link
|
93
|
+
|
94
|
+
puts "\nExamples completed!"
|
data/git_push.sh
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
# Set repository details
|
10
10
|
GIT_USER_ID="devraftengineer"
|
11
11
|
GIT_REPO_ID="devdraft-sdk-ruby"
|
12
|
-
RELEASE_NOTE="Initial release:
|
12
|
+
RELEASE_NOTE="Initial release: Devdraft Ruby SDK"
|
13
13
|
GIT_REPO_BASE_URL="github.com"
|
14
14
|
|
15
15
|
# Initialize the local directory as a Git repository
|
data/lib/devdraft/api_error.rb
CHANGED
data/lib/devdraft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devdraft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swagger-Codegen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- docs/WalletsApi.md
|
147
147
|
- docs/WebhookResponseDto.md
|
148
148
|
- docs/WebhooksApi.md
|
149
|
+
- example.rb
|
149
150
|
- git_push.sh
|
150
151
|
- lib/devdraft.rb
|
151
152
|
- lib/devdraft/api/api_health_api.rb
|