Fetch Report Tags
Retrieves report tags from the server based on the given request, allowing users to access relevant tags for categorization or reporting purposes.
Steps to fetch report tags
- Create a GetReportTagsRequest object using the
GetReportTagsRequest
class by passing all the required parameters. - Call
getReportTags()
function using the instance ofLMFeedClient
. - Process the response LMResponse<GetReportTagsResponse> as per your requirement.
// Create an object of GetReportTagsRequest using the builder pattern
let request = GetReportTagsRequest.builder()
.type(1) // Specify the type as per your requirement
.build()
LMFeedClient.shared.getReportTags(request: request) { response in
if let result = response?.data {
// Handle success
print("Fetched tags: \(result.tags ?? [])")
} else if let error = response?.error {
// Handle error
print("Error fetching tags: \(error.localizedDescription)")
}
}
Models
GetReportTagsRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
type | Int | The type of report tags to retrieve |
GetReportTagsResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
tags | [ReportTag] | List of retrieved report tag objects | ✔️ |
ReportTag
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | Int | Unique identifier of the report tag | ✔️ |
name | String | Name of the report tag | ✔️ |