Skip to content

Latest commit

 

History

History
211 lines (136 loc) · 5.37 KB

File metadata and controls

211 lines (136 loc) · 5.37 KB

\CommentsAPI

All URIs are relative to https://api.eduframe.nl/api/v1

Method HTTP request Description
CreateComment Post /comments Create a comment.
DeleteCommentById Delete /comments/{id} Delete a comment.
UpdateCommentById Patch /comments/{id} Update a comment.

CreateComment

Comment CreateComment(ctx).CreateCommentRequest(createCommentRequest).Execute()

Create a comment.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	createCommentRequest := *openapiclient.NewCreateCommentRequest("Content_example", int32(123), openapiclient.CommentType("Account")) // CreateCommentRequest | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createCommentRequest CreateCommentRequest

Return type

Comment

Authorization

Bearer

HTTP request headers

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

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

DeleteCommentById

DeleteCommentById(ctx, id).Execute()

Delete a comment.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	id := int32(56) // int32 | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.CommentsAPI.DeleteCommentById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CommentsAPI.DeleteCommentById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

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

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

UpdateCommentById

Comment UpdateCommentById(ctx, id).UpdateCommentByIdRequest(updateCommentByIdRequest).Execute()

Update a comment.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	id := int32(56) // int32 | 
	updateCommentByIdRequest := *openapiclient.NewUpdateCommentByIdRequest() // UpdateCommentByIdRequest | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

updateCommentByIdRequest | UpdateCommentByIdRequest | |

Return type

Comment

Authorization

Bearer

HTTP request headers

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

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