@@ -4,15 +4,32 @@ module XIVAPI::Request
4
4
LODESTONE_LIMIT = 50 . freeze
5
5
ALL_CHARACTER_DATA = 'AC,FR,FC,FCM,PVP' . freeze
6
6
7
- # Search
7
+ # @param indexes [String, Array <String>] One or more indexes to search on
8
+ # @param string [String] Value to search for in the string column
9
+ # @param string_column [String] Column to perform the string search on
10
+ # @param string_algo [String] Algorithm to use for the search
11
+ # @param sort_field [String] Column to sort results by
12
+ # @param sort_order [String] Order to sort results by
13
+ # @param limit [Integer] Total number of results to limit to
14
+ # @param filters [String, Array <String>] One or more filters to search on
15
+ # @param columns [String, Array <String>] One or more columns to limit results to
16
+ # @return [XIVAPI::Paginator] Enumerable search results
8
17
def search ( indexes : [ ] , string : '' , string_column : 'Name_en' , string_algo : 'wildcard_plus' ,
9
18
sort_field : nil , sort_order : nil , limit : 100 , filters : [ ] , columns : [ ] )
10
19
params = { indexes : [ *indexes ] . join ( ',' ) , string : string , string_column : string_column , string_algo : string_algo ,
11
20
sort_field : sort_field , sort_order : sort_order , filters : [ *filters ] . join ( ',' ) , columns : [ *columns ] . join ( ',' ) }
12
21
XIVAPI ::Paginator . new ( self , params , 'search' , limit )
13
22
end
14
23
15
- # Content
24
+ # @param name [String] Name of the content (e.g. Achievement, Action, Item)
25
+ # @param ids [Integer, Array<Integer>] One or more IDs to retrieve
26
+ # @param minify [true, false] Minify resulting data where depth > 1
27
+ # @param limit [Integer] Total number of results to limit to
28
+ # @param columns [String, Array <String>] One or more columns to limit results to
29
+ # @return [Array<String>, OpenStruct, XIVAPI::Paginator]
30
+ # Calling with no parameters will return the list of content names
31
+ # Calling with a name and a single ID will return that specific content
32
+ # Calling with a name and not a singe ID will return enumerable results
16
33
def content ( name : nil , ids : [ ] , minify : false , limit : 100 , columns : [ ] )
17
34
if name . nil?
18
35
request ( self , 'content' )
@@ -25,74 +42,113 @@ def content(name: nil, ids: [], minify: false, limit: 100, columns: [])
25
42
end
26
43
end
27
44
45
+ # @return [Array<String>] list of servers
28
46
def servers
29
47
request ( self , 'servers' )
30
48
end
31
49
32
- # Character
50
+ # @param id [Integer] Character ID
51
+ # @param all_data [true, false] Return the full set of character data
52
+ # @param poll [true, false] Continuously call the API until a result is cached and returned
53
+ # @param columns [String, Array <String>] One or more columns to limit results to
54
+ # @return [OpenStruct] The requested character
33
55
def character ( id : nil , all_data : false , poll : false , columns : [ ] )
34
56
params = { data : all_data ? ALL_CHARACTER_DATA : nil , columns : [ *columns ] . join ( ',' ) }
35
57
request_cached ( self , "character/#{ id } " , :character , params , poll )
36
58
end
37
59
60
+ # @param name [String] Character name
61
+ # @param server [String] Character server
62
+ # @param columns [String, Array <String>] One or more columns to limit results to
63
+ # @return [XIVAPI::Paginator] Enumerable search results
38
64
def character_search ( name : nil , server : nil , columns : [ ] )
39
65
params = { name : name , server : server &.capitalize , columns : [ *columns ] . join ( ',' ) }
40
66
XIVAPI ::Paginator . new ( self , params , 'character/search' , LODESTONE_LIMIT )
41
67
end
42
68
69
+ # @param id [Integer] Character ID
70
+ # @param duplicate_id [Integer] Duplicate character ID
71
+ # @return [true, false] Whether or not the character was deleted successfully
43
72
def character_delete ( id : nil , duplicate_id : nil )
44
73
params = { duplicate : duplicate_id }
45
74
!!request ( self , "character/#{ id } /delete" , params )
46
75
end
47
76
77
+ # @param id [Integer] Character ID
78
+ # @return [true, false] Whether or not the character update was requested successfully
48
79
def character_update ( id : nil )
49
80
request ( self , "character/#{ id } /update" ) == 1
50
81
end
51
82
83
+ # @param id [Integer] Character ID
84
+ # @return [true, false] Whether or not the character is verified
52
85
def character_verified? ( id : nil )
53
86
request ( self , "character/#{ id } /verification" ) . verification_token_pass
54
87
end
55
88
56
- # FreeCompany
89
+ # @param id [Integer] Free company ID
90
+ # @param members [true, false] Return member data
91
+ # @param poll [true, false] Continuously call the API until a result is cached and returned
92
+ # @param columns [String, Array <String>] One or more columns to limit results to
93
+ # @return [OpenStruct] The requested free company
57
94
def free_company ( id : nil , members : false , poll : false , columns : [ ] )
58
95
params = { data : members ? 'FCM' : nil , columns : [ *columns ] . join ( ',' ) }
59
96
request_cached ( self , "freecompany/#{ id } " , :free_company , params , poll )
60
97
end
61
98
99
+ # @param name [String] Free company name
100
+ # @param server [String] Free company server
101
+ # @param columns [String, Array <String>] One or more columns to limit results to
102
+ # @return [XIVAPI::Paginator] Enumerable search results
62
103
def free_company_search ( name : nil , server : nil , columns : [ ] )
63
104
params = { name : name , server : server &.capitalize , columns : [ *columns ] . join ( ',' ) }
64
105
XIVAPI ::Paginator . new ( self , params , 'freecompany/search' , LODESTONE_LIMIT )
65
106
end
66
107
67
- # Linkshell
108
+ # @param id [Integer] Linkshell ID
109
+ # @param poll [true, false] Continuously call the API until a result is cached and returned
110
+ # @param columns [String, Array <String>] One or more columns to limit results to
111
+ # @return [OpenStruct] The requested linkshell
68
112
def linkshell ( id : nil , poll : false , columns : [ ] )
69
113
params = { columns : [ *columns ] . join ( ',' ) }
70
114
request_cached ( self , "linkshell/#{ id } " , :linkshell , params , poll )
71
115
end
72
116
117
+ # @param name [String] Linkshell name
118
+ # @param server [String] Linkshell server
119
+ # @param columns [String, Array <String>] One or more columns to limit results to
120
+ # @return [XIVAPI::Paginator] Enumerable search results
73
121
def linkshell_search ( name : nil , server : nil , columns : [ ] )
74
122
params = { name : name , server : server &.capitalize , columns : [ *columns ] . join ( ',' ) }
75
123
XIVAPI ::Paginator . new ( self , params , 'linkshell/search' , LODESTONE_LIMIT )
76
124
end
77
125
78
- # PvPTeam
126
+ # @param id [Integer] PVP team ID
127
+ # @param poll [true, false] Continuously call the API until a result is cached and returned
128
+ # @param columns [String, Array <String>] One or more columns to limit results to
129
+ # @return [OpenStruct] The requested PVP team
79
130
def pvp_team ( id : nil , poll : false , columns : [ ] )
80
131
params = { columns : [ *columns ] . join ( ',' ) }
81
132
request_cached ( self , "pvpteam/#{ id } " , :pvp_team , params , poll )
82
133
end
83
134
135
+ # @param name [String] PVP team name
136
+ # @param server [String] PVP team server
137
+ # @param columns [String, Array <String>] One or more columns to limit results to
138
+ # @return [XIVAPI::Paginator] Enumerable search results
84
139
def pvp_team_search ( name : nil , server : nil , columns : [ ] )
85
140
params = { name : name , server : server &.capitalize , columns : [ *columns ] . join ( ',' ) }
86
141
XIVAPI ::Paginator . new ( self , params , 'pvpteam/search' , LODESTONE_LIMIT )
87
142
end
88
143
89
- # Lodestone
144
+ # @param category [String, Symbol] Category to retrieve (e.g. News, Updates, DevBlog)
145
+ # @return [Array<OpenStruct>] The requested Lodestone data
90
146
def lodestone ( category )
91
147
endpoint = category . to_s . downcase . delete ( '_' )
92
148
request ( self , "lodestone/#{ endpoint } " )
93
149
end
94
150
95
- # PatchList
151
+ # @return [Array<OpenStruct>] List of game patches
96
152
def patch_list
97
153
request ( self , 'patchlist' )
98
154
end
0 commit comments