fopost 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.
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fopost
4
+ module Resources
5
+ # `client.workspaces` — the workspaces the key can reach.
6
+ class Workspaces < Base
7
+ def list
8
+ parse_list(Workspace, unwrap(http.get('/workspaces')))
9
+ end
10
+
11
+ def get(workspace_id)
12
+ Workspace.new(unwrap(http.get("/workspaces/#{workspace_id}")))
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fopost
4
+ # Sentinel for "the caller did not pass this", so an explicit nil can still
5
+ # clear a field on a partial update.
6
+ UNSET = Object.new
7
+ def UNSET.inspect = 'Fopost::UNSET'
8
+ def UNSET.to_s = 'Fopost::UNSET'
9
+ UNSET.freeze
10
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fopost
4
+ VERSION = '0.1.0'
5
+ end
data/lib/fopost.rb ADDED
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fopost/version'
4
+ require 'fopost/errors'
5
+ require 'fopost/unset'
6
+ require 'fopost/platforms'
7
+ require 'fopost/model'
8
+ require 'fopost/models'
9
+ require 'fopost/http/response'
10
+ require 'fopost/http/transport'
11
+ require 'fopost/http/net_http_transport'
12
+ require 'fopost/http/client'
13
+ require 'fopost/client'
14
+
15
+ # Official Ruby SDK for the FoPost API.
16
+ #
17
+ # require 'fopost'
18
+ #
19
+ # client = Fopost.new(api_key: 'fp_...')
20
+ # workspace = client.workspaces.list.first
21
+ # accounts = client.accounts.list(workspace_id: workspace.id)
22
+ #
23
+ # post = client.posts.create(
24
+ # workspace_id: workspace.id,
25
+ # content: 'Hello from Ruby',
26
+ # accounts: accounts.map(&:id)
27
+ # )
28
+ # client.posts.publish(post.id)
29
+ module Fopost
30
+ DEFAULT_BASE_URL = Client::DEFAULT_BASE_URL
31
+
32
+ # Shorthand for Fopost::Client.new.
33
+ def self.new(**options)
34
+ Client.new(**options)
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fopost
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - FoPost
8
+ - Porter Bridge, LLC
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Official Ruby SDK for the FoPost API. Schedule and publish to +30 social
14
+ platforms from your code.
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - CHANGELOG.md
20
+ - LICENSE
21
+ - README.md
22
+ - lib/fopost.rb
23
+ - lib/fopost/client.rb
24
+ - lib/fopost/errors.rb
25
+ - lib/fopost/http/client.rb
26
+ - lib/fopost/http/net_http_transport.rb
27
+ - lib/fopost/http/response.rb
28
+ - lib/fopost/http/transport.rb
29
+ - lib/fopost/model.rb
30
+ - lib/fopost/models.rb
31
+ - lib/fopost/platforms.rb
32
+ - lib/fopost/resources/accounts.rb
33
+ - lib/fopost/resources/ai.rb
34
+ - lib/fopost/resources/base.rb
35
+ - lib/fopost/resources/labels.rb
36
+ - lib/fopost/resources/posts.rb
37
+ - lib/fopost/resources/workspaces.rb
38
+ - lib/fopost/unset.rb
39
+ - lib/fopost/version.rb
40
+ homepage: https://fopost.com
41
+ licenses:
42
+ - MIT
43
+ metadata:
44
+ homepage_uri: https://fopost.com
45
+ source_code_uri: https://github.com/fopost/fopost-ruby
46
+ bug_tracker_uri: https://github.com/fopost/fopost-ruby/issues
47
+ documentation_uri: https://fopost.com/docs
48
+ changelog_uri: https://github.com/fopost/fopost-ruby/blob/main/CHANGELOG.md
49
+ rubygems_mfa_required: 'true'
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '3.1'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubygems_version: 3.6.9
65
+ specification_version: 4
66
+ summary: Official Ruby SDK for the FoPost API.
67
+ test_files: []