/
api_apache_kafka_connect_mirror_v2_service.go
82 lines (65 loc) · 4.65 KB
/
api_apache_kafka_connect_mirror_v2_service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Instaclustr API Documentation
*
*
*
* API version: Current
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"context"
"errors"
"net/http"
)
// ApacheKafkaConnectMirrorV2APIService is a service that implements the logic for the ApacheKafkaConnectMirrorV2APIServicer
// This service should implement the business logic for every endpoint for the ApacheKafkaConnectMirrorV2API API.
// Include any external packages or services that will be required by this service.
type ApacheKafkaConnectMirrorV2APIService struct {
MockKafkaMirror *KafkaConnectMirrorV2
}
// NewApacheKafkaConnectMirrorV2APIService creates a default api service
func NewApacheKafkaConnectMirrorV2APIService() ApacheKafkaConnectMirrorV2APIServicer {
return &ApacheKafkaConnectMirrorV2APIService{}
}
// ClusterManagementV2DataSourcesKafkaConnectClusterClusterIdMirrorsV2Get - List all Kafka connect mirrors.
func (s *ApacheKafkaConnectMirrorV2APIService) ClusterManagementV2DataSourcesKafkaConnectClusterClusterIdMirrorsV2Get(ctx context.Context, clusterId string) (ImplResponse, error) {
// TODO - update ClusterManagementV2DataSourcesKafkaConnectClusterClusterIdMirrorsV2Get with the required logic for this service method.
// Add api_apache_kafka_connect_mirror_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
// TODO: Uncomment the next line to return response Response(200, []KafkaConnectMirrorSummariesV2{}) or use other options such as http.Ok ...
// return Response(200, []KafkaConnectMirrorSummariesV2{}), nil
return Response(http.StatusNotImplemented, nil), errors.New("ClusterManagementV2DataSourcesKafkaConnectClusterClusterIdMirrorsV2Get method not implemented")
}
// ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdDelete - Delete a Kafka Connect Mirror
func (s *ApacheKafkaConnectMirrorV2APIService) ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdDelete(ctx context.Context, mirrorId string) (ImplResponse, error) {
// TODO - update ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdDelete with the required logic for this service method.
// Add api_apache_kafka_connect_mirror_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
s.MockKafkaMirror = nil
return Response(204, nil), nil
}
// ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdGet - Get the details of a kafka connect mirror
func (s *ApacheKafkaConnectMirrorV2APIService) ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdGet(ctx context.Context, mirrorId string) (ImplResponse, error) {
// TODO - update ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdGet with the required logic for this service method.
// Add api_apache_kafka_connect_mirror_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
if s.MockKafkaMirror != nil {
s.MockKafkaMirror.Status = RUNNING
} else {
return Response(404, nil), nil
}
return Response(200, s.MockKafkaMirror), nil
}
// ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdPut - Update a Kafka Connect mirror.
func (s *ApacheKafkaConnectMirrorV2APIService) ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdPut(ctx context.Context, mirrorId string, kafkaConnectMirrorUpdateV2 KafkaConnectMirrorUpdateV2) (ImplResponse, error) {
// TODO - update ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2MirrorIdPut with the required logic for this service method.
// Add api_apache_kafka_connect_mirror_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
s.MockKafkaMirror.TargetLatency = kafkaConnectMirrorUpdateV2.TargetLatency
return Response(202, s.MockKafkaMirror), nil
}
// ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2Post - Create a Kafka Connect mirror
func (s *ApacheKafkaConnectMirrorV2APIService) ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2Post(ctx context.Context, kafkaConnectMirrorV2 KafkaConnectMirrorV2) (ImplResponse, error) {
// TODO - update ClusterManagementV2ResourcesApplicationsKafkaConnectMirrorsV2Post with the required logic for this service method.
// Add api_apache_kafka_connect_mirror_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
s.MockKafkaMirror = &kafkaConnectMirrorV2
s.MockKafkaMirror.Id = CreatedID
return Response(202, s.MockKafkaMirror), nil
}