diff --git a/opensearchapi/api._.go b/opensearchapi/api._.go index 6062e191c..961aa212a 100755 --- a/opensearchapi/api._.go +++ b/opensearchapi/api._.go @@ -226,6 +226,7 @@ type Tasks struct { List TasksList } +// PointInTime contains the Point In Time APIs type PointInTime struct { Create PointInTimeCreate Delete PointInTimeDelete diff --git a/opensearchapi/api.pointintime.create.go b/opensearchapi/api.pointintime.create.go index 0b42213ab..9b52cf03f 100644 --- a/opensearchapi/api.pointintime.create.go +++ b/opensearchapi/api.pointintime.create.go @@ -46,10 +46,10 @@ func newPointInTimeCreateFunc(t Transport) PointInTimeCreate { // ----- API Definition ------------------------------------------------------- -// Point In Time ets you run different queries against a dataset that is fixed in time. +// PointInTimeCreate let you create a pit for searching with pagination type PointInTimeCreate func(o ...func(*PointInTimeCreateRequest)) (*Response, *PointInTimeCreateResp, error) -// PointInTimeRequest configures the Point In Time API request. +// PointInTimeCreateRequest configures the Point In Time Create API request. type PointInTimeCreateRequest struct { Index []string @@ -69,6 +69,7 @@ type PointInTimeCreateRequest struct { ctx context.Context } +// PointInTimeCreateResp is a custom type to parse the Point In Time Create Reponse type PointInTimeCreateResp struct { PitID string `json:"pit_id"` Shards struct { @@ -80,7 +81,7 @@ type PointInTimeCreateResp struct { CreationTime int `json:"creation_time"` } -// Do executes the request and returns response or error. +// Do executes the request and returns response, PointInTimeCreateResp and error. func (r PointInTimeCreateRequest) Do(ctx context.Context, transport Transport) (*Response, *PointInTimeCreateResp, error) { var ( path strings.Builder diff --git a/opensearchapi/api.pointintime.delete.go b/opensearchapi/api.pointintime.delete.go index ef4db2caf..c955fa09e 100644 --- a/opensearchapi/api.pointintime.delete.go +++ b/opensearchapi/api.pointintime.delete.go @@ -47,10 +47,10 @@ func newPointInTimeDeleteFunc(t Transport) PointInTimeDelete { // ----- API Definition ------------------------------------------------------- -// Point In Time ets you run different queries against a dataset that is fixed in time. +// PointInTimeDelete lets you delete pits used for searching with pagination type PointInTimeDelete func(o ...func(*PointInTimeDeleteRequest)) (*Response, *PointInTimeDeleteResp, error) -// PointInTimeRequest configures the Point In Time API request. +// PointInTimeDeleteRequest configures the Point In Time Delete API request. type PointInTimeDeleteRequest struct { PitID []string @@ -64,10 +64,12 @@ type PointInTimeDeleteRequest struct { ctx context.Context } +// PointInTimeDeleteRequestBody is used to from the delete request body type PointInTimeDeleteRequestBody struct { PitID []string `json:"pit_id"` } +// PointInTimeDeleteResp is a custom type to parse the Point In Time Delete Reponse type PointInTimeDeleteResp struct { Pits []struct { PitID string `json:"pit_id"` diff --git a/opensearchapi/api.pointintime.get.go b/opensearchapi/api.pointintime.get.go index a4631de20..e210342ee 100644 --- a/opensearchapi/api.pointintime.get.go +++ b/opensearchapi/api.pointintime.get.go @@ -46,10 +46,10 @@ func newPointInTimeGetFunc(t Transport) PointInTimeGet { // ----- API Definition ------------------------------------------------------- -// Point In Time ets you run different queries against a dataset that is fixed in time. +// PointInTimeGet lets you get all existing pits type PointInTimeGet func(o ...func(*PointInTimeGetRequest)) (*Response, *PointInTimeGetResp, error) -// PointInTimeRequest configures the Point In Time API request. +// PointInTimeGetRequest configures the Point In Time Get API request. type PointInTimeGetRequest struct { Pretty bool Human bool @@ -61,6 +61,7 @@ type PointInTimeGetRequest struct { ctx context.Context } +// PointInTimeGetResp is a custom type to parse the Point In Time Get Reponse type PointInTimeGetResp struct { Pits []struct { PitID string `json:"pit_id"`