nexus-invision 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d88d57f0af3901d607a6f6e0a0344747aa4217a1f9d398ef4531a91f589a42f4
4
- data.tar.gz: 0a7be56f1d7cbe83fdde608d7f70b79f39bdd914046ccba329e4b48051af9f62
3
+ metadata.gz: 0d4f567b2a4319ba9f7370165b9f88461134e1a6265f18effcdcb35339c16e32
4
+ data.tar.gz: 6bb7205017fe2d53d1030da35b1679dc2404b6b269a6e82415b542a591ce1448
5
5
  SHA512:
6
- metadata.gz: 8bc18fab0d7f5bbcc148c5547298cd626227a3d16cfff1be1e1a82c07a93c9cd5daf5668587f5fc61a5b1c3c4b3ea89340efbb6ee74ee1562586b2574b135abb
7
- data.tar.gz: 41070303e3a93200e8ebbded1f0bfd6ac1975c5fa769503a7bd1ce82d586fa25bbd966c7221f8816c64e131d4341ac001488de0bda9abf9dbd7e4420efe44deb
6
+ metadata.gz: c97adf9ba3d36c361ab8c1674ed7935dc09fb6ef281f2d1ff34382293e8d74ef0edcedbc2099aef8a1bdf28ac100c8388b3a090a598a861684916ca15be9535d
7
+ data.tar.gz: f3010a5fe7410a594456f45c3d95700ca6fc6e2ef9f70770c1c6370fd194747d94f6867dbacdc395f0f9655f25841c21f9b5299da2f6194d8ef621375533176e
@@ -5,12 +5,14 @@ require "faraday"
5
5
  require "nexus/invision/errors/bad_request"
6
6
  require "nexus/invision/errors/unexpected_response"
7
7
  require "nexus/invision/requests/add_member_to_secondary_group"
8
+ require "nexus/invision/requests/create_forum_post"
8
9
  require "nexus/invision/requests/create_forum_topic"
9
10
  require "nexus/invision/requests/create_member_warning"
10
11
  require "nexus/invision/requests/list_forum_topics"
11
12
  require "nexus/invision/requests/remove_member_from_secondary_group"
12
13
  require "nexus/invision/resources/login_link"
13
14
  require "nexus/invision/resources/page"
15
+ require "nexus/invision/resources/post"
14
16
  require "nexus/invision/resources/topic"
15
17
  require "nexus/invision/resources/user"
16
18
  require "nexus/invision/resources/warning"
@@ -87,6 +89,17 @@ module Nexus
87
89
  Resources::Topic.from_hash(response.body)
88
90
  end
89
91
 
92
+ sig { params(request: Requests::CreateForumPost).returns(Resources::Post) }
93
+ def create_forum_post(request)
94
+ response = request(
95
+ http_method: HTTPMethod::POST,
96
+ endpoint: URI("forums/posts"),
97
+ params: request.serialize,
98
+ )
99
+
100
+ Resources::Post.from_hash(response.body)
101
+ end
102
+
90
103
  sig { params(nexusmods_member_id: Integer).returns(Resources::LoginLink) }
91
104
  def login_link(nexusmods_member_id)
92
105
  response = request(
@@ -0,0 +1,19 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require "nexus/invision/value_object"
5
+ require "sorbet-runtime"
6
+
7
+ module Nexus
8
+ module Invision
9
+ module Requests
10
+ class CreateForumPost < T::Struct
11
+ include ValueObject
12
+
13
+ const :topic, Integer
14
+ const :author, Integer
15
+ const :post, String
16
+ end
17
+ end
18
+ end
19
+ end
@@ -10,7 +10,7 @@ module Nexus
10
10
  class CreateForumTopic < T::Struct
11
11
  include ValueObject
12
12
 
13
- const :forum_id, Integer
13
+ const :forum, Integer
14
14
  const :title, String
15
15
  const :post, String
16
16
  const :author, T.nilable(Integer)
@@ -0,0 +1,18 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require "nexus/invision/value_object"
5
+ require "sorbet-runtime"
6
+
7
+ module Nexus
8
+ module Invision
9
+ module Resources
10
+ class Post < T::Struct
11
+ include ValueObject
12
+
13
+ const :id, Integer
14
+ const :item_id, Integer
15
+ end
16
+ end
17
+ end
18
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Nexus
5
5
  module Invision
6
- # Leave this as 1.1.0 in order for CI process to replace with the tagged version.
7
- VERSION = "1.1.0"
6
+ # Leave this as 1.2.0 in order for CI process to replace with the tagged version.
7
+ VERSION = "1.2.0"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus-invision
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Robertson
@@ -27,12 +27,14 @@ files:
27
27
  - lib/nexus/invision/errors/client_error.rb
28
28
  - lib/nexus/invision/errors/unexpected_response.rb
29
29
  - lib/nexus/invision/requests/add_member_to_secondary_group.rb
30
+ - lib/nexus/invision/requests/create_forum_post.rb
30
31
  - lib/nexus/invision/requests/create_forum_topic.rb
31
32
  - lib/nexus/invision/requests/create_member_warning.rb
32
33
  - lib/nexus/invision/requests/list_forum_topics.rb
33
34
  - lib/nexus/invision/requests/remove_member_from_secondary_group.rb
34
35
  - lib/nexus/invision/resources/login_link.rb
35
36
  - lib/nexus/invision/resources/page.rb
37
+ - lib/nexus/invision/resources/post.rb
36
38
  - lib/nexus/invision/resources/topic.rb
37
39
  - lib/nexus/invision/resources/user.rb
38
40
  - lib/nexus/invision/resources/warning.rb