Skip to content

Latest commit

 

History

History
434 lines (287 loc) · 13 KB

TemplateAssignmentsApi.md

File metadata and controls

434 lines (287 loc) · 13 KB

\TemplateAssignmentsApi

All URIs are relative to http://localhost

Method HTTP request Description
BatchAssignTemplate Post /template/api/v8/templates/{id}/assignments/add Assigns a template to one or more tenants.
BatchUnassignTemplate Post /template/api/v8/templates/{id}/assignments/remove Unassigns a template from one or more tenants.
GetAssignment Get /template/api/v8/templates/assignments/{id} Gets a template assignment.
GetAssignmentHistory Get /template/api/v8/templates/assignments/{id}/history Gets a template assignment history.
GetTemplateAssignmentsPage Get /template/api/v8/templates/assignments Returns a page of template assignments.
UpdateAssignmentStatus Patch /template/api/v8/templates/assignments/{id} Updates a template assignment status.

BatchAssignTemplate

[]TemplateAssignmentResponse BatchAssignTemplate(ctx, id).RequestBody(requestBody).Inheritable(inheritable).Execute()

Assigns a template to one or more tenants.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    requestBody := []string{"Property_example"} // []string | 
    inheritable := true // bool |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TemplateAssignmentsApi.BatchAssignTemplate(context.Background(), id).RequestBody(requestBody).Inheritable(inheritable).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TemplateAssignmentsApi.BatchAssignTemplate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `BatchAssignTemplate`: []TemplateAssignmentResponse
    fmt.Fprintf(os.Stdout, "Response from `TemplateAssignmentsApi.BatchAssignTemplate`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

Other parameters are passed through a pointer to a apiBatchAssignTemplateRequest struct via the builder pattern

Name Type Description Notes

requestBody | []string | | inheritable | bool | |

Return type

[]TemplateAssignmentResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BatchUnassignTemplate

[]TemplateAssignmentResponse BatchUnassignTemplate(ctx, id).RequestBody(requestBody).Execute()

Unassigns a template from one or more tenants.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    requestBody := []string{"Property_example"} // []string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TemplateAssignmentsApi.BatchUnassignTemplate(context.Background(), id).RequestBody(requestBody).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TemplateAssignmentsApi.BatchUnassignTemplate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `BatchUnassignTemplate`: []TemplateAssignmentResponse
    fmt.Fprintf(os.Stdout, "Response from `TemplateAssignmentsApi.BatchUnassignTemplate`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

Other parameters are passed through a pointer to a apiBatchUnassignTemplateRequest struct via the builder pattern

Name Type Description Notes

requestBody | []string | |

Return type

[]TemplateAssignmentResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAssignment

TemplateAssignment GetAssignment(ctx, id).Execute()

Gets a template assignment.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ID of template assignment record.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TemplateAssignmentsApi.GetAssignment(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TemplateAssignmentsApi.GetAssignment``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAssignment`: TemplateAssignment
    fmt.Fprintf(os.Stdout, "Response from `TemplateAssignmentsApi.GetAssignment`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID of template assignment record.

Other Parameters

Other parameters are passed through a pointer to a apiGetAssignmentRequest struct via the builder pattern

Name Type Description Notes

Return type

TemplateAssignment

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAssignmentHistory

[]TemplateAssignment GetAssignmentHistory(ctx, id).Execute()

Gets a template assignment history.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TemplateAssignmentsApi.GetAssignmentHistory(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TemplateAssignmentsApi.GetAssignmentHistory``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAssignmentHistory`: []TemplateAssignment
    fmt.Fprintf(os.Stdout, "Response from `TemplateAssignmentsApi.GetAssignmentHistory`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string

Other Parameters

Other parameters are passed through a pointer to a apiGetAssignmentHistoryRequest struct via the builder pattern

Name Type Description Notes

Return type

[]TemplateAssignment

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetTemplateAssignmentsPage

TemplateAssignmentsPage GetTemplateAssignmentsPage(ctx).Page(page).PageSize(pageSize).TemplateId(templateId).TenantId(tenantId).CalculateTotalItems(calculateTotalItems).Execute()

Returns a page of template assignments.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    page := int32(0) // int32 | 
    pageSize := int32(10) // int32 | 
    templateId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string |  (optional)
    tenantId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string |  (optional)
    calculateTotalItems := true // bool |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TemplateAssignmentsApi.GetTemplateAssignmentsPage(context.Background()).Page(page).PageSize(pageSize).TemplateId(templateId).TenantId(tenantId).CalculateTotalItems(calculateTotalItems).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TemplateAssignmentsApi.GetTemplateAssignmentsPage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetTemplateAssignmentsPage`: TemplateAssignmentsPage
    fmt.Fprintf(os.Stdout, "Response from `TemplateAssignmentsApi.GetTemplateAssignmentsPage`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetTemplateAssignmentsPageRequest struct via the builder pattern

Name Type Description Notes
page int32
pageSize int32
templateId string
tenantId string
calculateTotalItems bool

Return type

TemplateAssignmentsPage

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateAssignmentStatus

TemplateAssignment UpdateAssignmentStatus(ctx, id).TemplateAssignmentStatusPatch(templateAssignmentStatusPatch).Execute()

Updates a template assignment status.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ID of template assignment record.
    templateAssignmentStatusPatch := *openapiclient.NewTemplateAssignmentStatusPatch(openapiclient.TemplateStatus("NEW")) // TemplateAssignmentStatusPatch | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.TemplateAssignmentsApi.UpdateAssignmentStatus(context.Background(), id).TemplateAssignmentStatusPatch(templateAssignmentStatusPatch).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TemplateAssignmentsApi.UpdateAssignmentStatus``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateAssignmentStatus`: TemplateAssignment
    fmt.Fprintf(os.Stdout, "Response from `TemplateAssignmentsApi.UpdateAssignmentStatus`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string ID of template assignment record.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateAssignmentStatusRequest struct via the builder pattern

Name Type Description Notes

templateAssignmentStatusPatch | TemplateAssignmentStatusPatch | |

Return type

TemplateAssignment

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]