Skip to content

Latest commit

 

History

History
236 lines (180 loc) · 14 KB

File metadata and controls

236 lines (180 loc) · 14 KB

Communication

(Communication)

Overview

Operations related to Communication

Available Operations

ListTemplates

List all status update templates for your organization

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Communication.ListTemplates(ctx, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.StatusUpdateTemplateEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
page *int N/A
perPage *int N/A
opts []operations.Option The options for this request.

Response

*operations.ListStatusUpdateTemplatesResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetTemplate

Get a single status update template by ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Communication.GetTemplate(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.StatusUpdateTemplateEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
statusUpdateTemplateID string ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.GetStatusUpdateTemplateResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

DeleteStatusUpdateTemplate

Delete a single status update template

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Communication.DeleteStatusUpdateTemplate(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.StatusUpdateTemplateEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
statusUpdateTemplateID string ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.DeleteStatusUpdateTemplateResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

UpdateTemplate

Update a single status update template

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Communication.UpdateTemplate(ctx, "<id>", components.PatchV1StatusUpdateTemplatesStatusUpdateTemplateID{})
    if err != nil {
        log.Fatal(err)
    }
    if res.StatusUpdateTemplateEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
statusUpdateTemplateID string ✔️ N/A
patchV1StatusUpdateTemplatesStatusUpdateTemplateID components.PatchV1StatusUpdateTemplatesStatusUpdateTemplateID ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.UpdateStatusUpdateTemplateResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*