(IssueTracking.CollectionTicketComments)
- List - List Comments
- Create - Create Comment
- Get - Get Comment
- Update - Update Comment
- Delete - Delete Comment
List Comments
package main
import(
"context"
"os"
sdkgo "github.com/apideck-libraries/sdk-go"
"github.com/apideck-libraries/sdk-go/models/components"
"github.com/apideck-libraries/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
sdkgo.WithConsumerID("test-consumer"),
sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
)
res, err := s.IssueTracking.CollectionTicketComments.List(ctx, operations.IssueTrackingCollectionTicketCommentsAllRequest{
CollectionID: "apideck-io",
TicketID: "<id>",
ServiceID: sdkgo.String("salesforce"),
Sort: &components.CommentsSort{
By: components.CommentsSortByCreatedAt.ToPointer(),
Direction: components.SortDirectionDesc.ToPointer(),
},
PassThrough: map[string]any{
"search": "San Francisco",
},
Fields: sdkgo.String("id,updated_at"),
})
if err != nil {
log.Fatal(err)
}
if res.GetCommentsResponse != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.IssueTrackingCollectionTicketCommentsAllRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.IssueTrackingCollectionTicketCommentsAllResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.BadRequestResponse | 400 | application/json |
apierrors.UnauthorizedResponse | 401 | application/json |
apierrors.PaymentRequiredResponse | 402 | application/json |
apierrors.NotFoundResponse | 404 | application/json |
apierrors.UnprocessableResponse | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Create Comment
package main
import(
"context"
"os"
sdkgo "github.com/apideck-libraries/sdk-go"
"github.com/apideck-libraries/sdk-go/models/components"
"github.com/apideck-libraries/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
sdkgo.WithConsumerID("test-consumer"),
sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
)
res, err := s.IssueTracking.CollectionTicketComments.Create(ctx, operations.IssueTrackingCollectionTicketCommentsAddRequest{
ServiceID: sdkgo.String("salesforce"),
CollectionID: "apideck-io",
TicketID: "<id>",
CollectionTicketComment: components.CollectionTicketCommentInput{
Body: sdkgo.String("What internet provider do you use?"),
PassThrough: []components.PassThroughBody{
components.PassThroughBody{
ServiceID: "<id>",
ExtendPaths: []components.ExtendPaths{
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
},
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res.CreateCommentResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.IssueTrackingCollectionTicketCommentsAddRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.IssueTrackingCollectionTicketCommentsAddResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.BadRequestResponse | 400 | application/json |
apierrors.UnauthorizedResponse | 401 | application/json |
apierrors.PaymentRequiredResponse | 402 | application/json |
apierrors.NotFoundResponse | 404 | application/json |
apierrors.UnprocessableResponse | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Get Comment
package main
import(
"context"
"os"
sdkgo "github.com/apideck-libraries/sdk-go"
"github.com/apideck-libraries/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
sdkgo.WithConsumerID("test-consumer"),
sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
)
res, err := s.IssueTracking.CollectionTicketComments.Get(ctx, operations.IssueTrackingCollectionTicketCommentsOneRequest{
ID: "<id>",
CollectionID: "apideck-io",
TicketID: "<id>",
ServiceID: sdkgo.String("salesforce"),
Fields: sdkgo.String("id,updated_at"),
})
if err != nil {
log.Fatal(err)
}
if res.GetCommentResponse != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.IssueTrackingCollectionTicketCommentsOneRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.IssueTrackingCollectionTicketCommentsOneResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.BadRequestResponse | 400 | application/json |
apierrors.UnauthorizedResponse | 401 | application/json |
apierrors.PaymentRequiredResponse | 402 | application/json |
apierrors.NotFoundResponse | 404 | application/json |
apierrors.UnprocessableResponse | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update Comment
package main
import(
"context"
"os"
sdkgo "github.com/apideck-libraries/sdk-go"
"github.com/apideck-libraries/sdk-go/models/components"
"github.com/apideck-libraries/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
sdkgo.WithConsumerID("test-consumer"),
sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
)
res, err := s.IssueTracking.CollectionTicketComments.Update(ctx, operations.IssueTrackingCollectionTicketCommentsUpdateRequest{
ID: "<id>",
ServiceID: sdkgo.String("salesforce"),
CollectionID: "apideck-io",
TicketID: "<id>",
CollectionTicketComment: components.CollectionTicketCommentInput{
Body: sdkgo.String("What internet provider do you use?"),
PassThrough: []components.PassThroughBody{
components.PassThroughBody{
ServiceID: "<id>",
ExtendPaths: []components.ExtendPaths{
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
},
},
components.PassThroughBody{
ServiceID: "<id>",
ExtendPaths: []components.ExtendPaths{
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
},
},
components.PassThroughBody{
ServiceID: "<id>",
ExtendPaths: []components.ExtendPaths{
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
components.ExtendPaths{
Path: "$.nested.property",
Value: map[string]any{
"TaxClassificationRef": map[string]any{
"value": "EUC-99990201-V1-00020000",
},
},
},
},
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res.UpdateCommentResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.IssueTrackingCollectionTicketCommentsUpdateRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.IssueTrackingCollectionTicketCommentsUpdateResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.BadRequestResponse | 400 | application/json |
apierrors.UnauthorizedResponse | 401 | application/json |
apierrors.PaymentRequiredResponse | 402 | application/json |
apierrors.NotFoundResponse | 404 | application/json |
apierrors.UnprocessableResponse | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Delete Comment
package main
import(
"context"
"os"
sdkgo "github.com/apideck-libraries/sdk-go"
"github.com/apideck-libraries/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
sdkgo.WithConsumerID("test-consumer"),
sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
)
res, err := s.IssueTracking.CollectionTicketComments.Delete(ctx, operations.IssueTrackingCollectionTicketCommentsDeleteRequest{
ID: "<id>",
ServiceID: sdkgo.String("salesforce"),
CollectionID: "apideck-io",
TicketID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res.DeleteCommentResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.IssueTrackingCollectionTicketCommentsDeleteRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.IssueTrackingCollectionTicketCommentsDeleteResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.BadRequestResponse | 400 | application/json |
apierrors.UnauthorizedResponse | 401 | application/json |
apierrors.PaymentRequiredResponse | 402 | application/json |
apierrors.NotFoundResponse | 404 | application/json |
apierrors.UnprocessableResponse | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |