diff --git a/services/observability/api_default.go b/services/observability/api_default.go index 8727be181..e160597ab 100644 --- a/services/observability/api_default.go +++ b/services/observability/api_default.go @@ -84,6 +84,28 @@ type DefaultApi interface { */ CreateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) + /* + CreateAlertrecord Method for CreateAlertrecord + Create alert record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiCreateAlertrecordRequest + */ + CreateAlertrecord(ctx context.Context, groupName string, instanceId string, projectId string) ApiCreateAlertrecordRequest + /* + CreateAlertrecordExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return AlertRecordsResponse + + */ + CreateAlertrecordExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) /* CreateAlertrules Method for CreateAlertrules Create alert rule. @@ -106,6 +128,46 @@ type DefaultApi interface { */ CreateAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) + /* + CreateBackup Method for CreateBackup + Create a backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + /* + CreateBackupExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return Message + + */ + CreateBackupExecute(ctx context.Context, instanceId string, projectId string) (*Message, error) + /* + CreateBackupSchedule Method for CreateBackupSchedule + Create backup schedule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateBackupScheduleRequest + */ + CreateBackupSchedule(ctx context.Context, instanceId string, projectId string) ApiCreateBackupScheduleRequest + /* + CreateBackupScheduleExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return BackupSchedulePostResponse + + */ + CreateBackupScheduleExecute(ctx context.Context, instanceId string, projectId string) (*BackupSchedulePostResponse, error) /* CreateCertCheck Method for CreateCertCheck Create cert check. @@ -146,6 +208,26 @@ type DefaultApi interface { */ CreateCredentialsExecute(ctx context.Context, instanceId string, projectId string) (*CreateCredentialsResponse, error) + /* + CreateElasticsearchCheck Method for CreateElasticsearchCheck + Create elasticsearch check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateElasticsearchCheckRequest + */ + CreateElasticsearchCheck(ctx context.Context, instanceId string, projectId string) ApiCreateElasticsearchCheckRequest + /* + CreateElasticsearchCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ElasticsearchCheckResponse + + */ + CreateElasticsearchCheckExecute(ctx context.Context, instanceId string, projectId string) (*ElasticsearchCheckResponse, error) /* CreateHttpCheck Method for CreateHttpCheck Create http check. @@ -204,6 +286,146 @@ type DefaultApi interface { */ CreateLogsAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) + /* + CreateMongodbCheck Method for CreateMongodbCheck + Create mongodb check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateMongodbCheckRequest + */ + CreateMongodbCheck(ctx context.Context, instanceId string, projectId string) ApiCreateMongodbCheckRequest + /* + CreateMongodbCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return MongodbCheckResponse + + */ + CreateMongodbCheckExecute(ctx context.Context, instanceId string, projectId string) (*MongodbCheckResponse, error) + /* + CreateMysqlCheck Method for CreateMysqlCheck + Create mysql check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateMysqlCheckRequest + */ + CreateMysqlCheck(ctx context.Context, instanceId string, projectId string) ApiCreateMysqlCheckRequest + /* + CreateMysqlCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return MysqlCheckResponse + + */ + CreateMysqlCheckExecute(ctx context.Context, instanceId string, projectId string) (*MysqlCheckResponse, error) + /* + CreateNetworkCheck Method for CreateNetworkCheck + Create network check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateNetworkCheckRequest + */ + CreateNetworkCheck(ctx context.Context, instanceId string, projectId string) ApiCreateNetworkCheckRequest + /* + CreateNetworkCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return NetworkCheckResponse + + */ + CreateNetworkCheckExecute(ctx context.Context, instanceId string, projectId string) (*NetworkCheckResponse, error) + /* + CreatePingCheck Method for CreatePingCheck + Create ping check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreatePingCheckRequest + */ + CreatePingCheck(ctx context.Context, instanceId string, projectId string) ApiCreatePingCheckRequest + /* + CreatePingCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return PingCheckResponse + + */ + CreatePingCheckExecute(ctx context.Context, instanceId string, projectId string) (*PingCheckResponse, error) + /* + CreatePostgresqlCheck Method for CreatePostgresqlCheck + Create postgresql check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreatePostgresqlCheckRequest + */ + CreatePostgresqlCheck(ctx context.Context, instanceId string, projectId string) ApiCreatePostgresqlCheckRequest + /* + CreatePostgresqlCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return PostgresqlCheckResponse + + */ + CreatePostgresqlCheckExecute(ctx context.Context, instanceId string, projectId string) (*PostgresqlCheckResponse, error) + /* + CreateRabbitmqCheck Method for CreateRabbitmqCheck + Create rabbitmq check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateRabbitmqCheckRequest + */ + CreateRabbitmqCheck(ctx context.Context, instanceId string, projectId string) ApiCreateRabbitmqCheckRequest + /* + CreateRabbitmqCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return RabbitmqCheckResponse + + */ + CreateRabbitmqCheckExecute(ctx context.Context, instanceId string, projectId string) (*RabbitmqCheckResponse, error) + /* + CreateRedisCheck Method for CreateRedisCheck + Create redis check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateRedisCheckRequest + */ + CreateRedisCheck(ctx context.Context, instanceId string, projectId string) ApiCreateRedisCheckRequest + /* + CreateRedisCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return RedisCheckResponse + + */ + CreateRedisCheckExecute(ctx context.Context, instanceId string, projectId string) (*RedisCheckResponse, error) /* CreateScrapeConfig Method for CreateScrapeConfig Create scrape config. @@ -310,6 +532,76 @@ type DefaultApi interface { */ DeleteAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) + /* + DeleteAlertrecord Method for DeleteAlertrecord + Delete alert record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertrecordRequest + */ + DeleteAlertrecord(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) ApiDeleteAlertrecordRequest + /* + DeleteAlertrecordExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return AlertRecordsResponse + + */ + DeleteAlertrecordExecute(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) + /* + DeleteAlertrecords Method for DeleteAlertrecords + Delete alert records. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertrecordsRequest + */ + DeleteAlertrecords(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteAlertrecordsRequest + /* + DeleteAlertrecordsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return AlertRecordsResponse + + */ + DeleteAlertrecordsExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) + /* + DeleteAlertrule Method for DeleteAlertrule + Delete alert rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertruleRequest + */ + DeleteAlertrule(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) ApiDeleteAlertruleRequest + /* + DeleteAlertruleExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return AlertRulesResponse + + */ + DeleteAlertruleExecute(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) /* DeleteAlertrules Method for DeleteAlertrules Delete alert rules. @@ -398,6 +690,28 @@ type DefaultApi interface { */ DeleteCredentialsRemoteWriteConfigExecute(ctx context.Context, instanceId string, projectId string, username string) (*CredentialsRemoteWriteDeleteResponse, error) + /* + DeleteElasticsearchCheck Method for DeleteElasticsearchCheck + Delete elasticsearch check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteElasticsearchCheckRequest + */ + DeleteElasticsearchCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteElasticsearchCheckRequest + /* + DeleteElasticsearchCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ElasticsearchCheckResponse + + */ + DeleteElasticsearchCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*ElasticsearchCheckResponse, error) /* DeleteHttpCheck Method for DeleteHttpCheck Delete http check. @@ -463,104 +777,278 @@ type DefaultApi interface { */ DeleteLogsAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) /* - DeleteScrapeConfig Method for DeleteScrapeConfig - Delete scrape config. + DeleteMongodbCheck Method for DeleteMongodbCheck + Delete mongodb check. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId - @param jobName @param projectId - @return ApiDeleteScrapeConfigRequest + @return ApiDeleteMongodbCheckRequest */ - DeleteScrapeConfig(ctx context.Context, instanceId string, jobName string, projectId string) ApiDeleteScrapeConfigRequest + DeleteMongodbCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteMongodbCheckRequest /* - DeleteScrapeConfigExecute executes the request + DeleteMongodbCheckExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId - @param jobName @param projectId - @return DeleteScrapeConfigResponse + @return MongodbCheckResponse */ - DeleteScrapeConfigExecute(ctx context.Context, instanceId string, jobName string, projectId string) (*DeleteScrapeConfigResponse, error) + DeleteMongodbCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*MongodbCheckResponse, error) /* - GetAlertConfigReceiver Method for GetAlertConfigReceiver - Get alert config receivers. + DeleteMysqlCheck Method for DeleteMysqlCheck + Delete mysql check. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId @param projectId - @param receiver - @return ApiGetAlertConfigReceiverRequest + @return ApiDeleteMysqlCheckRequest */ - GetAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigReceiverRequest + DeleteMysqlCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteMysqlCheckRequest /* - GetAlertConfigReceiverExecute executes the request + DeleteMysqlCheckExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId @param projectId - @param receiver - @return Receiver + @return MysqlCheckResponse */ - GetAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*Receiver, error) + DeleteMysqlCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*MysqlCheckResponse, error) /* - GetAlertConfigRoute Method for GetAlertConfigRoute - Get alert receiver for route. + DeleteNetworkCheck Method for DeleteNetworkCheck + Delete network check. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId @param projectId - @param receiver - @return ApiGetAlertConfigRouteRequest + @return ApiDeleteNetworkCheckRequest */ - GetAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigRouteRequest + DeleteNetworkCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteNetworkCheckRequest /* - GetAlertConfigRouteExecute executes the request + DeleteNetworkCheckExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId @param projectId - @param receiver - @return AlertConfigRouteResponse + @return NetworkCheckResponse */ - GetAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) + DeleteNetworkCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*NetworkCheckResponse, error) /* - GetAlertConfigs Method for GetAlertConfigs - Get alert config. + DeletePingCheck Method for DeletePingCheck + Delete ping check. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId @param projectId - @return ApiGetAlertConfigsRequest + @return ApiDeletePingCheckRequest */ - GetAlertConfigs(ctx context.Context, instanceId string, projectId string) ApiGetAlertConfigsRequest + DeletePingCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeletePingCheckRequest /* - GetAlertConfigsExecute executes the request + DeletePingCheckExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id @param instanceId @param projectId - @return GetAlertConfigsResponse + @return PingCheckResponse */ - GetAlertConfigsExecute(ctx context.Context, instanceId string, projectId string) (*GetAlertConfigsResponse, error) + DeletePingCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*PingCheckResponse, error) /* - GetAlertgroup Method for GetAlertgroup - Get alert group. + DeletePostgresqlCheck Method for DeletePostgresqlCheck + Delete postgresql check. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName + @param id @param instanceId @param projectId - @return ApiGetAlertgroupRequest + @return ApiDeletePostgresqlCheckRequest */ - GetAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiGetAlertgroupRequest + DeletePostgresqlCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeletePostgresqlCheckRequest /* - GetAlertgroupExecute executes the request + DeletePostgresqlCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return PostgresqlCheckResponse + + */ + DeletePostgresqlCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*PostgresqlCheckResponse, error) + /* + DeleteRabbitmqCheck Method for DeleteRabbitmqCheck + Delete rabbitmq check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteRabbitmqCheckRequest + */ + DeleteRabbitmqCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteRabbitmqCheckRequest + /* + DeleteRabbitmqCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return RabbitmqCheckResponse + + */ + DeleteRabbitmqCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*RabbitmqCheckResponse, error) + /* + DeleteRedisCheck Method for DeleteRedisCheck + Delete redis check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteRedisCheckRequest + */ + DeleteRedisCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteRedisCheckRequest + /* + DeleteRedisCheckExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return RedisCheckResponse + + */ + DeleteRedisCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*RedisCheckResponse, error) + /* + DeleteScrapeConfig Method for DeleteScrapeConfig + Delete scrape config. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param jobName + @param projectId + @return ApiDeleteScrapeConfigRequest + */ + DeleteScrapeConfig(ctx context.Context, instanceId string, jobName string, projectId string) ApiDeleteScrapeConfigRequest + /* + DeleteScrapeConfigExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param jobName + @param projectId + @return DeleteScrapeConfigResponse + + */ + DeleteScrapeConfigExecute(ctx context.Context, instanceId string, jobName string, projectId string) (*DeleteScrapeConfigResponse, error) + /* + DeleteScrapeConfigs Method for DeleteScrapeConfigs + Delete scrape configs. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiDeleteScrapeConfigsRequest + */ + DeleteScrapeConfigs(ctx context.Context, instanceId string, projectId string) ApiDeleteScrapeConfigsRequest + /* + DeleteScrapeConfigsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ScrapeConfigsResponse + + */ + DeleteScrapeConfigsExecute(ctx context.Context, instanceId string, projectId string) (*ScrapeConfigsResponse, error) + /* + GetAlertConfigReceiver Method for GetAlertConfigReceiver + Get alert config receivers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param receiver + @return ApiGetAlertConfigReceiverRequest + */ + GetAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigReceiverRequest + /* + GetAlertConfigReceiverExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param receiver + @return Receiver + + */ + GetAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*Receiver, error) + /* + GetAlertConfigRoute Method for GetAlertConfigRoute + Get alert receiver for route. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param receiver + @return ApiGetAlertConfigRouteRequest + */ + GetAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigRouteRequest + /* + GetAlertConfigRouteExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param receiver + @return AlertConfigRouteResponse + + */ + GetAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) + /* + GetAlertConfigs Method for GetAlertConfigs + Get alert config. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiGetAlertConfigsRequest + */ + GetAlertConfigs(ctx context.Context, instanceId string, projectId string) ApiGetAlertConfigsRequest + /* + GetAlertConfigsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return GetAlertConfigsResponse + + */ + GetAlertConfigsExecute(ctx context.Context, instanceId string, projectId string) (*GetAlertConfigsResponse, error) + /* + GetAlertgroup Method for GetAlertgroup + Get alert group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiGetAlertgroupRequest + */ + GetAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiGetAlertgroupRequest + /* + GetAlertgroupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param groupName @@ -570,6 +1058,54 @@ type DefaultApi interface { */ GetAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupResponse, error) + /* + GetAlertrecord Method for GetAlertrecord + Get alert record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return ApiGetAlertrecordRequest + */ + GetAlertrecord(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) ApiGetAlertrecordRequest + /* + GetAlertrecordExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return AlertRecordResponse + + */ + GetAlertrecordExecute(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) (*AlertRecordResponse, error) + /* + GetAlertrule Method for GetAlertrule + Get alert rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return ApiGetAlertruleRequest + */ + GetAlertrule(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) ApiGetAlertruleRequest + /* + GetAlertruleExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return AlertRuleResponse + + */ + GetAlertruleExecute(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) (*AlertRuleResponse, error) /* GetCredentials Method for GetCredentials Get single technical credentials. @@ -838,6 +1374,28 @@ type DefaultApi interface { */ ListAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) + /* + ListAlertrecords Method for ListAlertrecords + Get alert records. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiListAlertrecordsRequest + */ + ListAlertrecords(ctx context.Context, groupName string, instanceId string, projectId string) ApiListAlertrecordsRequest + /* + ListAlertrecordsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return AlertRecordsResponse + + */ + ListAlertrecordsExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) /* ListAlertrules Method for ListAlertrules Get alert rules. @@ -860,6 +1418,66 @@ type DefaultApi interface { */ ListAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) + /* + ListBackupRetentions Method for ListBackupRetentions + Get backup retention. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListBackupRetentionsRequest + */ + ListBackupRetentions(ctx context.Context, instanceId string, projectId string) ApiListBackupRetentionsRequest + /* + ListBackupRetentionsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return BackupRetentionResponse + + */ + ListBackupRetentionsExecute(ctx context.Context, instanceId string, projectId string) (*BackupRetentionResponse, error) + /* + ListBackupSchedules Method for ListBackupSchedules + Get backup schedules. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListBackupSchedulesRequest + */ + ListBackupSchedules(ctx context.Context, instanceId string, projectId string) ApiListBackupSchedulesRequest + /* + ListBackupSchedulesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return BackupScheduleResponse + + */ + ListBackupSchedulesExecute(ctx context.Context, instanceId string, projectId string) (*BackupScheduleResponse, error) + /* + ListBackups Method for ListBackups + Get backups. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + /* + ListBackupsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return BackupResponse + + */ + ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*BackupResponse, error) /* ListCertChecks Method for ListCertChecks Get all cert checks configured. @@ -900,6 +1518,26 @@ type DefaultApi interface { */ ListCredentialsExecute(ctx context.Context, instanceId string, projectId string) (*ListCredentialsResponse, error) + /* + ListElasticsearchChecks Method for ListElasticsearchChecks + Get all elasticsearch checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListElasticsearchChecksRequest + */ + ListElasticsearchChecks(ctx context.Context, instanceId string, projectId string) ApiListElasticsearchChecksRequest + /* + ListElasticsearchChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ElasticsearchCheckResponse + + */ + ListElasticsearchChecksExecute(ctx context.Context, instanceId string, projectId string) (*ElasticsearchCheckResponse, error) /* ListHttpChecks Method for ListHttpChecks Get all http checks configured. @@ -959,23 +1597,181 @@ type DefaultApi interface { */ ListLogsAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) /* - ListPlans Method for ListPlans - Get all plans. + ListMongodbChecks Method for ListMongodbChecks + Get all mongodb checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId @param projectId - @return ApiListPlansRequest + @return ApiListMongodbChecksRequest */ - ListPlans(ctx context.Context, projectId string) ApiListPlansRequest + ListMongodbChecks(ctx context.Context, instanceId string, projectId string) ApiListMongodbChecksRequest /* - ListPlansExecute executes the request + ListMongodbChecksExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId @param projectId - @return PlansResponse + @return MongodbCheckResponse */ - ListPlansExecute(ctx context.Context, projectId string) (*PlansResponse, error) + ListMongodbChecksExecute(ctx context.Context, instanceId string, projectId string) (*MongodbCheckResponse, error) + /* + ListMysqlChecks Method for ListMysqlChecks + Get all mysql checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListMysqlChecksRequest + */ + ListMysqlChecks(ctx context.Context, instanceId string, projectId string) ApiListMysqlChecksRequest + /* + ListMysqlChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return MysqlCheckResponse + + */ + ListMysqlChecksExecute(ctx context.Context, instanceId string, projectId string) (*MysqlCheckResponse, error) + /* + ListNetworkChecks Method for ListNetworkChecks + Get all network checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListNetworkChecksRequest + */ + ListNetworkChecks(ctx context.Context, instanceId string, projectId string) ApiListNetworkChecksRequest + /* + ListNetworkChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return NetworkCheckResponse + + */ + ListNetworkChecksExecute(ctx context.Context, instanceId string, projectId string) (*NetworkCheckResponse, error) + /* + ListOfferings Method for ListOfferings + Get all plans. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + /* + ListOfferingsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return Offerings + + */ + ListOfferingsExecute(ctx context.Context, projectId string) (*Offerings, error) + /* + ListPingChecks Method for ListPingChecks + Get all ping checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListPingChecksRequest + */ + ListPingChecks(ctx context.Context, instanceId string, projectId string) ApiListPingChecksRequest + /* + ListPingChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return PingCheckResponse + + */ + ListPingChecksExecute(ctx context.Context, instanceId string, projectId string) (*PingCheckResponse, error) + /* + ListPlans Method for ListPlans + Get all plans. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListPlansRequest + */ + ListPlans(ctx context.Context, projectId string) ApiListPlansRequest + /* + ListPlansExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return PlansResponse + + */ + ListPlansExecute(ctx context.Context, projectId string) (*PlansResponse, error) + /* + ListPostgresqlChecks Method for ListPostgresqlChecks + Get all postgresql checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListPostgresqlChecksRequest + */ + ListPostgresqlChecks(ctx context.Context, instanceId string, projectId string) ApiListPostgresqlChecksRequest + /* + ListPostgresqlChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return PostgresqlCheckResponse + + */ + ListPostgresqlChecksExecute(ctx context.Context, instanceId string, projectId string) (*PostgresqlCheckResponse, error) + /* + ListRabbitmqChecks Method for ListRabbitmqChecks + Get all rabbitmq checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListRabbitmqChecksRequest + */ + ListRabbitmqChecks(ctx context.Context, instanceId string, projectId string) ApiListRabbitmqChecksRequest + /* + ListRabbitmqChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return RabbitmqCheckResponse + + */ + ListRabbitmqChecksExecute(ctx context.Context, instanceId string, projectId string) (*RabbitmqCheckResponse, error) + /* + ListRedisChecks Method for ListRedisChecks + Get all redis checks configured. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiListRedisChecksRequest + */ + ListRedisChecks(ctx context.Context, instanceId string, projectId string) ApiListRedisChecksRequest + /* + ListRedisChecksExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return RedisCheckResponse + + */ + ListRedisChecksExecute(ctx context.Context, instanceId string, projectId string) (*RedisCheckResponse, error) /* ListScrapeConfigs Method for ListScrapeConfigs Get scrape configs. @@ -1016,6 +1812,28 @@ type DefaultApi interface { */ PartialUpdateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) + /* + PartialUpdateAlertrecords Method for PartialUpdateAlertrecords + Patch alert records. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiPartialUpdateAlertrecordsRequest + */ + PartialUpdateAlertrecords(ctx context.Context, groupName string, instanceId string, projectId string) ApiPartialUpdateAlertrecordsRequest + /* + PartialUpdateAlertrecordsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return AlertRecordsResponse + + */ + PartialUpdateAlertrecordsExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) /* PartialUpdateAlertrules Method for PartialUpdateAlertrules Patch alert rules. @@ -1038,6 +1856,48 @@ type DefaultApi interface { */ PartialUpdateAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) + /* + PartialUpdateScrapeConfigs Method for PartialUpdateScrapeConfigs + Update scrape configs. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiPartialUpdateScrapeConfigsRequest + */ + PartialUpdateScrapeConfigs(ctx context.Context, instanceId string, projectId string) ApiPartialUpdateScrapeConfigsRequest + /* + PartialUpdateScrapeConfigsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ScrapeConfigsResponse + + */ + PartialUpdateScrapeConfigsExecute(ctx context.Context, instanceId string, projectId string) (*ScrapeConfigsResponse, error) + /* + RestoreBackup Method for RestoreBackup + Restore backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param backupDate + @param instanceId + @param projectId + @return ApiRestoreBackupRequest + */ + RestoreBackup(ctx context.Context, backupDate string, instanceId string, projectId string) ApiRestoreBackupRequest + /* + RestoreBackupExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param backupDate + @param instanceId + @param projectId + @return Message + + */ + RestoreBackupExecute(ctx context.Context, backupDate string, instanceId string, projectId string) (*Message, error) /* UpdateACL Method for UpdateACL Update acl config. @@ -1164,6 +2024,54 @@ type DefaultApi interface { */ UpdateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) + /* + UpdateAlertrecord Method for UpdateAlertrecord + Update alert record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return ApiUpdateAlertrecordRequest + */ + UpdateAlertrecord(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) ApiUpdateAlertrecordRequest + /* + UpdateAlertrecordExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return AlertRecordsResponse + + */ + UpdateAlertrecordExecute(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) + /* + UpdateAlertrule Method for UpdateAlertrule + Update alert rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return ApiUpdateAlertruleRequest + */ + UpdateAlertrule(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) ApiUpdateAlertruleRequest + /* + UpdateAlertruleExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return AlertRulesResponse + + */ + UpdateAlertruleExecute(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) /* UpdateCredentialsRemoteWriteConfig Method for UpdateCredentialsRemoteWriteConfig Update remote write config for credentials. @@ -1347,11 +2255,29 @@ type ApiCreateAlertgroupsRequest interface { Execute() (*AlertGroupsResponse, error) } +type ApiCreateAlertrecordRequest interface { + CreateAlertrecordPayload(createAlertrecordPayload CreateAlertrecordPayload) ApiCreateAlertrecordRequest + Execute() (*AlertRecordsResponse, error) +} + type ApiCreateAlertrulesRequest interface { CreateAlertrulesPayload(createAlertrulesPayload CreateAlertrulesPayload) ApiCreateAlertrulesRequest Execute() (*AlertRulesResponse, error) } +type ApiCreateBackupRequest interface { + // List of backup targets + BackupTarget(backupTarget []string) ApiCreateBackupRequest + Execute() (*Message, error) +} + +type ApiCreateBackupScheduleRequest interface { + CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest + // List of backup targets + BackupTarget(backupTarget []string) ApiCreateBackupScheduleRequest + Execute() (*BackupSchedulePostResponse, error) +} + type ApiCreateCertCheckRequest interface { CreateCertCheckPayload(createCertCheckPayload CreateCertCheckPayload) ApiCreateCertCheckRequest Execute() (*CertCheckResponse, error) @@ -1362,6 +2288,11 @@ type ApiCreateCredentialsRequest interface { Execute() (*CreateCredentialsResponse, error) } +type ApiCreateElasticsearchCheckRequest interface { + CreateElasticsearchCheckPayload(createElasticsearchCheckPayload CreateElasticsearchCheckPayload) ApiCreateElasticsearchCheckRequest + Execute() (*ElasticsearchCheckResponse, error) +} + type ApiCreateHttpCheckRequest interface { CreateHttpCheckPayload(createHttpCheckPayload CreateHttpCheckPayload) ApiCreateHttpCheckRequest Execute() (*HttpCheckResponse, error) @@ -1377,6 +2308,41 @@ type ApiCreateLogsAlertgroupsRequest interface { Execute() (*AlertGroupsResponse, error) } +type ApiCreateMongodbCheckRequest interface { + CreateMongodbCheckPayload(createMongodbCheckPayload CreateMongodbCheckPayload) ApiCreateMongodbCheckRequest + Execute() (*MongodbCheckResponse, error) +} + +type ApiCreateMysqlCheckRequest interface { + CreateMysqlCheckPayload(createMysqlCheckPayload CreateMysqlCheckPayload) ApiCreateMysqlCheckRequest + Execute() (*MysqlCheckResponse, error) +} + +type ApiCreateNetworkCheckRequest interface { + CreateNetworkCheckPayload(createNetworkCheckPayload CreateNetworkCheckPayload) ApiCreateNetworkCheckRequest + Execute() (*NetworkCheckResponse, error) +} + +type ApiCreatePingCheckRequest interface { + CreatePingCheckPayload(createPingCheckPayload CreatePingCheckPayload) ApiCreatePingCheckRequest + Execute() (*PingCheckResponse, error) +} + +type ApiCreatePostgresqlCheckRequest interface { + CreatePostgresqlCheckPayload(createPostgresqlCheckPayload CreatePostgresqlCheckPayload) ApiCreatePostgresqlCheckRequest + Execute() (*PostgresqlCheckResponse, error) +} + +type ApiCreateRabbitmqCheckRequest interface { + CreateRabbitmqCheckPayload(createRabbitmqCheckPayload CreateRabbitmqCheckPayload) ApiCreateRabbitmqCheckRequest + Execute() (*RabbitmqCheckResponse, error) +} + +type ApiCreateRedisCheckRequest interface { + CreateRedisCheckPayload(createRedisCheckPayload CreateRedisCheckPayload) ApiCreateRedisCheckRequest + Execute() (*RedisCheckResponse, error) +} + type ApiCreateScrapeConfigRequest interface { CreateScrapeConfigPayload(createScrapeConfigPayload CreateScrapeConfigPayload) ApiCreateScrapeConfigRequest Execute() (*ScrapeConfigsResponse, error) @@ -1400,6 +2366,20 @@ type ApiDeleteAlertgroupsRequest interface { Execute() (*AlertGroupsResponse, error) } +type ApiDeleteAlertrecordRequest interface { + Execute() (*AlertRecordsResponse, error) +} + +type ApiDeleteAlertrecordsRequest interface { + // Name of the records that should be deleted + AlertRecord(alertRecord []string) ApiDeleteAlertrecordsRequest + Execute() (*AlertRecordsResponse, error) +} + +type ApiDeleteAlertruleRequest interface { + Execute() (*AlertRulesResponse, error) +} + type ApiDeleteAlertrulesRequest interface { // Name of the alert rules that should be deleted AlertName(alertName []string) ApiDeleteAlertrulesRequest @@ -1418,6 +2398,10 @@ type ApiDeleteCredentialsRemoteWriteConfigRequest interface { Execute() (*CredentialsRemoteWriteDeleteResponse, error) } +type ApiDeleteElasticsearchCheckRequest interface { + Execute() (*ElasticsearchCheckResponse, error) +} + type ApiDeleteHttpCheckRequest interface { Execute() (*HttpCheckResponse, error) } @@ -1430,10 +2414,44 @@ type ApiDeleteLogsAlertgroupRequest interface { Execute() (*AlertGroupsResponse, error) } +type ApiDeleteMongodbCheckRequest interface { + Execute() (*MongodbCheckResponse, error) +} + +type ApiDeleteMysqlCheckRequest interface { + Execute() (*MysqlCheckResponse, error) +} + +type ApiDeleteNetworkCheckRequest interface { + Execute() (*NetworkCheckResponse, error) +} + +type ApiDeletePingCheckRequest interface { + Execute() (*PingCheckResponse, error) +} + +type ApiDeletePostgresqlCheckRequest interface { + Execute() (*PostgresqlCheckResponse, error) +} + +type ApiDeleteRabbitmqCheckRequest interface { + Execute() (*RabbitmqCheckResponse, error) +} + +type ApiDeleteRedisCheckRequest interface { + Execute() (*RedisCheckResponse, error) +} + type ApiDeleteScrapeConfigRequest interface { Execute() (*DeleteScrapeConfigResponse, error) } +type ApiDeleteScrapeConfigsRequest interface { + // Name of the jobs that should be deleted + JobName(jobName []string) ApiDeleteScrapeConfigsRequest + Execute() (*ScrapeConfigsResponse, error) +} + type ApiGetAlertConfigReceiverRequest interface { Execute() (*Receiver, error) } @@ -1450,6 +2468,14 @@ type ApiGetAlertgroupRequest interface { Execute() (*AlertGroupResponse, error) } +type ApiGetAlertrecordRequest interface { + Execute() (*AlertRecordResponse, error) +} + +type ApiGetAlertruleRequest interface { + Execute() (*AlertRuleResponse, error) +} + type ApiGetCredentialsRequest interface { Execute() (*GetCredentialsResponse, error) } @@ -1502,10 +2528,30 @@ type ApiListAlertgroupsRequest interface { Execute() (*AlertGroupsResponse, error) } +type ApiListAlertrecordsRequest interface { + Execute() (*AlertRecordsResponse, error) +} + type ApiListAlertrulesRequest interface { Execute() (*AlertRulesResponse, error) } +type ApiListBackupRetentionsRequest interface { + Execute() (*BackupRetentionResponse, error) +} + +type ApiListBackupSchedulesRequest interface { + // List of backup targets + BackupTarget(backupTarget []string) ApiListBackupSchedulesRequest + Execute() (*BackupScheduleResponse, error) +} + +type ApiListBackupsRequest interface { + // List of backup targets + BackupTarget(backupTarget []string) ApiListBackupsRequest + Execute() (*BackupResponse, error) +} + type ApiListCertChecksRequest interface { Execute() (*CertCheckResponse, error) } @@ -1514,6 +2560,10 @@ type ApiListCredentialsRequest interface { Execute() (*ListCredentialsResponse, error) } +type ApiListElasticsearchChecksRequest interface { + Execute() (*ElasticsearchCheckResponse, error) +} + type ApiListHttpChecksRequest interface { Execute() (*HttpCheckResponse, error) } @@ -1526,25 +2576,73 @@ type ApiListLogsAlertgroupsRequest interface { Execute() (*AlertGroupsResponse, error) } -type ApiListPlansRequest interface { - Execute() (*PlansResponse, error) +type ApiListMongodbChecksRequest interface { + Execute() (*MongodbCheckResponse, error) } -type ApiListScrapeConfigsRequest interface { - Execute() (*ListScrapeConfigsResponse, error) +type ApiListMysqlChecksRequest interface { + Execute() (*MysqlCheckResponse, error) } -type ApiPartialUpdateAlertgroupsRequest interface { - UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner []UpdateAlertgroupsRequestInner) ApiPartialUpdateAlertgroupsRequest - Execute() (*AlertGroupsResponse, error) +type ApiListNetworkChecksRequest interface { + Execute() (*NetworkCheckResponse, error) } -type ApiPartialUpdateAlertrulesRequest interface { - PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner []PartialUpdateAlertrulesRequestInner) ApiPartialUpdateAlertrulesRequest - Execute() (*AlertRulesResponse, error) +type ApiListOfferingsRequest interface { + Execute() (*Offerings, error) } -type ApiUpdateACLRequest interface { +type ApiListPingChecksRequest interface { + Execute() (*PingCheckResponse, error) +} + +type ApiListPlansRequest interface { + Execute() (*PlansResponse, error) +} + +type ApiListPostgresqlChecksRequest interface { + Execute() (*PostgresqlCheckResponse, error) +} + +type ApiListRabbitmqChecksRequest interface { + Execute() (*RabbitmqCheckResponse, error) +} + +type ApiListRedisChecksRequest interface { + Execute() (*RedisCheckResponse, error) +} + +type ApiListScrapeConfigsRequest interface { + Execute() (*ListScrapeConfigsResponse, error) +} + +type ApiPartialUpdateAlertgroupsRequest interface { + UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner []UpdateAlertgroupsRequestInner) ApiPartialUpdateAlertgroupsRequest + Execute() (*AlertGroupsResponse, error) +} + +type ApiPartialUpdateAlertrecordsRequest interface { + PartialUpdateAlertrecordsRequestInner(partialUpdateAlertrecordsRequestInner []PartialUpdateAlertrecordsRequestInner) ApiPartialUpdateAlertrecordsRequest + Execute() (*AlertRecordsResponse, error) +} + +type ApiPartialUpdateAlertrulesRequest interface { + PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner []PartialUpdateAlertrulesRequestInner) ApiPartialUpdateAlertrulesRequest + Execute() (*AlertRulesResponse, error) +} + +type ApiPartialUpdateScrapeConfigsRequest interface { + PartialUpdateScrapeConfigsRequestInner(partialUpdateScrapeConfigsRequestInner []PartialUpdateScrapeConfigsRequestInner) ApiPartialUpdateScrapeConfigsRequest + Execute() (*ScrapeConfigsResponse, error) +} + +type ApiRestoreBackupRequest interface { + // List of restore targets + RestoreTarget(restoreTarget string) ApiRestoreBackupRequest + Execute() (*Message, error) +} + +type ApiUpdateACLRequest interface { UpdateACLPayload(updateACLPayload UpdateACLPayload) ApiUpdateACLRequest Execute() (*Message, error) } @@ -1574,6 +2672,16 @@ type ApiUpdateAlertgroupsRequest interface { Execute() (*AlertGroupsResponse, error) } +type ApiUpdateAlertrecordRequest interface { + UpdateAlertrecordPayload(updateAlertrecordPayload UpdateAlertrecordPayload) ApiUpdateAlertrecordRequest + Execute() (*AlertRecordsResponse, error) +} + +type ApiUpdateAlertruleRequest interface { + UpdateAlertrulePayload(updateAlertrulePayload UpdateAlertrulePayload) ApiUpdateAlertruleRequest + Execute() (*AlertRulesResponse, error) +} + type ApiUpdateCredentialsRemoteWriteConfigRequest interface { UpdateCredentialsRemoteWriteConfigPayload(updateCredentialsRemoteWriteConfigPayload UpdateCredentialsRemoteWriteConfigPayload) ApiUpdateCredentialsRemoteWriteConfigRequest Execute() (*CredentialsRemoteWriteConfig, error) @@ -1647,19 +2755,6745 @@ func (r CreateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createAlertConfigReceiverPayload == nil { + return localVarReturnValue, fmt.Errorf("createAlertConfigReceiverPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAlertConfigReceiverPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateAlertConfigReceiver: Method for CreateAlertConfigReceiver + +Create alert config receiver. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateAlertConfigReceiverRequest +*/ +func (a *APIClient) CreateAlertConfigReceiver(ctx context.Context, instanceId string, projectId string) ApiCreateAlertConfigReceiverRequest { + return CreateAlertConfigReceiverRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigReceiversResponse, error) { + r := CreateAlertConfigReceiverRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateAlertConfigRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createAlertConfigRoutePayload *CreateAlertConfigRoutePayload +} + +func (r CreateAlertConfigRouteRequest) CreateAlertConfigRoutePayload(createAlertConfigRoutePayload CreateAlertConfigRoutePayload) ApiCreateAlertConfigRouteRequest { + r.createAlertConfigRoutePayload = &createAlertConfigRoutePayload + return r +} + +func (r CreateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertConfigRouteResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertConfigRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createAlertConfigRoutePayload == nil { + return localVarReturnValue, fmt.Errorf("createAlertConfigRoutePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAlertConfigRoutePayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateAlertConfigRoute: Method for CreateAlertConfigRoute + +Create alert config route in routes of route. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateAlertConfigRouteRequest +*/ +func (a *APIClient) CreateAlertConfigRoute(ctx context.Context, instanceId string, projectId string) ApiCreateAlertConfigRouteRequest { + return CreateAlertConfigRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigRouteResponse, error) { + r := CreateAlertConfigRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateAlertgroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createAlertgroupsPayload *CreateAlertgroupsPayload +} + +func (r CreateAlertgroupsRequest) CreateAlertgroupsPayload(createAlertgroupsPayload CreateAlertgroupsPayload) ApiCreateAlertgroupsRequest { + r.createAlertgroupsPayload = &createAlertgroupsPayload + return r +} + +func (r CreateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertGroupsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertgroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createAlertgroupsPayload == nil { + return localVarReturnValue, fmt.Errorf("createAlertgroupsPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAlertgroupsPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateAlertgroups: Method for CreateAlertgroups + +Create alert group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateAlertgroupsRequest +*/ +func (a *APIClient) CreateAlertgroups(ctx context.Context, instanceId string, projectId string) ApiCreateAlertgroupsRequest { + return CreateAlertgroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := CreateAlertgroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateAlertrecordRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + createAlertrecordPayload *CreateAlertrecordPayload +} + +func (r CreateAlertrecordRequest) CreateAlertrecordPayload(createAlertrecordPayload CreateAlertrecordPayload) ApiCreateAlertrecordRequest { + r.createAlertrecordPayload = &createAlertrecordPayload + return r +} + +func (r CreateAlertrecordRequest) Execute() (*AlertRecordsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertRecordsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertrecord") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createAlertrecordPayload == nil { + return localVarReturnValue, fmt.Errorf("createAlertrecordPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAlertrecordPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateAlertrecord: Method for CreateAlertrecord + +Create alert record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiCreateAlertrecordRequest +*/ +func (a *APIClient) CreateAlertrecord(ctx context.Context, groupName string, instanceId string, projectId string) ApiCreateAlertrecordRequest { + return CreateAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateAlertrecordExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) { + r := CreateAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateAlertrulesRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + createAlertrulesPayload *CreateAlertrulesPayload +} + +func (r CreateAlertrulesRequest) CreateAlertrulesPayload(createAlertrulesPayload CreateAlertrulesPayload) ApiCreateAlertrulesRequest { + r.createAlertrulesPayload = &createAlertrulesPayload + return r +} + +func (r CreateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertRulesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertrules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createAlertrulesPayload == nil { + return localVarReturnValue, fmt.Errorf("createAlertrulesPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAlertrulesPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateAlertrules: Method for CreateAlertrules + +Create alert rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiCreateAlertrulesRequest +*/ +func (a *APIClient) CreateAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiCreateAlertrulesRequest { + return CreateAlertrulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { + r := CreateAlertrulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + backupTarget *[]string +} + +// List of backup targets + +func (r CreateBackupRequest) BackupTarget(backupTarget []string) ApiCreateBackupRequest { + r.backupTarget = &backupTarget + return r +} + +func (r CreateBackupRequest) Execute() (*Message, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Message + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.backupTarget != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backupTarget", r.backupTarget, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateBackup: Method for CreateBackup + +Create a backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateBackupRequest +*/ +func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { + return CreateBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) (*Message, error) { + r := CreateBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateBackupScheduleRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createBackupSchedulePayload *CreateBackupSchedulePayload + backupTarget *[]string +} + +func (r CreateBackupScheduleRequest) CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest { + r.createBackupSchedulePayload = &createBackupSchedulePayload + return r +} + +// List of backup targets + +func (r CreateBackupScheduleRequest) BackupTarget(backupTarget []string) ApiCreateBackupScheduleRequest { + r.backupTarget = &backupTarget + return r +} + +func (r CreateBackupScheduleRequest) Execute() (*BackupSchedulePostResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedulePostResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backup-schedules" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createBackupSchedulePayload == nil { + return localVarReturnValue, fmt.Errorf("createBackupSchedulePayload is required and must be specified") + } + + if r.backupTarget != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backupTarget", r.backupTarget, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupSchedulePayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateBackupSchedule: Method for CreateBackupSchedule + +Create backup schedule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateBackupScheduleRequest +*/ +func (a *APIClient) CreateBackupSchedule(ctx context.Context, instanceId string, projectId string) ApiCreateBackupScheduleRequest { + return CreateBackupScheduleRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateBackupScheduleExecute(ctx context.Context, instanceId string, projectId string) (*BackupSchedulePostResponse, error) { + r := CreateBackupScheduleRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateCertCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createCertCheckPayload *CreateCertCheckPayload +} + +func (r CreateCertCheckRequest) CreateCertCheckPayload(createCertCheckPayload CreateCertCheckPayload) ApiCreateCertCheckRequest { + r.createCertCheckPayload = &createCertCheckPayload + return r +} + +func (r CreateCertCheckRequest) Execute() (*CertCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCertCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/cert-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createCertCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createCertCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCertCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateCertCheck: Method for CreateCertCheck + +Create cert check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateCertCheckRequest +*/ +func (a *APIClient) CreateCertCheck(ctx context.Context, instanceId string, projectId string) ApiCreateCertCheckRequest { + return CreateCertCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateCertCheckExecute(ctx context.Context, instanceId string, projectId string) (*CertCheckResponse, error) { + r := CreateCertCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createCredentialsPayload *CreateCredentialsPayload +} + +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateCredentialsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateCredentials: Method for CreateCredentials + +Create technical user credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateCredentialsRequest +*/ +func (a *APIClient) CreateCredentials(ctx context.Context, instanceId string, projectId string) ApiCreateCredentialsRequest { + return CreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, instanceId string, projectId string) (*CreateCredentialsResponse, error) { + r := CreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateElasticsearchCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createElasticsearchCheckPayload *CreateElasticsearchCheckPayload +} + +func (r CreateElasticsearchCheckRequest) CreateElasticsearchCheckPayload(createElasticsearchCheckPayload CreateElasticsearchCheckPayload) ApiCreateElasticsearchCheckRequest { + r.createElasticsearchCheckPayload = &createElasticsearchCheckPayload + return r +} + +func (r CreateElasticsearchCheckRequest) Execute() (*ElasticsearchCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ElasticsearchCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateElasticsearchCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/elasticsearch-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createElasticsearchCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createElasticsearchCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createElasticsearchCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateElasticsearchCheck: Method for CreateElasticsearchCheck + +Create elasticsearch check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateElasticsearchCheckRequest +*/ +func (a *APIClient) CreateElasticsearchCheck(ctx context.Context, instanceId string, projectId string) ApiCreateElasticsearchCheckRequest { + return CreateElasticsearchCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateElasticsearchCheckExecute(ctx context.Context, instanceId string, projectId string) (*ElasticsearchCheckResponse, error) { + r := CreateElasticsearchCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateHttpCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createHttpCheckPayload *CreateHttpCheckPayload +} + +func (r CreateHttpCheckRequest) CreateHttpCheckPayload(createHttpCheckPayload CreateHttpCheckPayload) ApiCreateHttpCheckRequest { + r.createHttpCheckPayload = &createHttpCheckPayload + return r +} + +func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HttpCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateHttpCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/http-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createHttpCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createHttpCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createHttpCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateHttpCheck: Method for CreateHttpCheck + +Create http check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateHttpCheckRequest +*/ +func (a *APIClient) CreateHttpCheck(ctx context.Context, instanceId string, projectId string) ApiCreateHttpCheckRequest { + return CreateHttpCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateHttpCheckExecute(ctx context.Context, instanceId string, projectId string) (*HttpCheckResponse, error) { + r := CreateHttpCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createInstancePayload *CreateInstancePayload +} + +func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, fmt.Errorf("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateInstance: Method for CreateInstance + +Create new instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateInstanceRequest +*/ +func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { + return CreateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { + r := CreateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type CreateLogsAlertgroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createLogsAlertgroupsPayload *CreateLogsAlertgroupsPayload +} + +func (r CreateLogsAlertgroupsRequest) CreateLogsAlertgroupsPayload(createLogsAlertgroupsPayload CreateLogsAlertgroupsPayload) ApiCreateLogsAlertgroupsRequest { + r.createLogsAlertgroupsPayload = &createLogsAlertgroupsPayload + return r +} + +func (r CreateLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertGroupsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLogsAlertgroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createLogsAlertgroupsPayload == nil { + return localVarReturnValue, fmt.Errorf("createLogsAlertgroupsPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createLogsAlertgroupsPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateLogsAlertgroups: Method for CreateLogsAlertgroups + +Create logs alert group config. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateLogsAlertgroupsRequest +*/ +func (a *APIClient) CreateLogsAlertgroups(ctx context.Context, instanceId string, projectId string) ApiCreateLogsAlertgroupsRequest { + return CreateLogsAlertgroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateLogsAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := CreateLogsAlertgroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateMongodbCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createMongodbCheckPayload *CreateMongodbCheckPayload +} + +func (r CreateMongodbCheckRequest) CreateMongodbCheckPayload(createMongodbCheckPayload CreateMongodbCheckPayload) ApiCreateMongodbCheckRequest { + r.createMongodbCheckPayload = &createMongodbCheckPayload + return r +} + +func (r CreateMongodbCheckRequest) Execute() (*MongodbCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MongodbCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateMongodbCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/mongodb-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createMongodbCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createMongodbCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createMongodbCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateMongodbCheck: Method for CreateMongodbCheck + +Create mongodb check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateMongodbCheckRequest +*/ +func (a *APIClient) CreateMongodbCheck(ctx context.Context, instanceId string, projectId string) ApiCreateMongodbCheckRequest { + return CreateMongodbCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateMongodbCheckExecute(ctx context.Context, instanceId string, projectId string) (*MongodbCheckResponse, error) { + r := CreateMongodbCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateMysqlCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createMysqlCheckPayload *CreateMysqlCheckPayload +} + +func (r CreateMysqlCheckRequest) CreateMysqlCheckPayload(createMysqlCheckPayload CreateMysqlCheckPayload) ApiCreateMysqlCheckRequest { + r.createMysqlCheckPayload = &createMysqlCheckPayload + return r +} + +func (r CreateMysqlCheckRequest) Execute() (*MysqlCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MysqlCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateMysqlCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/mysql-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createMysqlCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createMysqlCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createMysqlCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateMysqlCheck: Method for CreateMysqlCheck + +Create mysql check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateMysqlCheckRequest +*/ +func (a *APIClient) CreateMysqlCheck(ctx context.Context, instanceId string, projectId string) ApiCreateMysqlCheckRequest { + return CreateMysqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateMysqlCheckExecute(ctx context.Context, instanceId string, projectId string) (*MysqlCheckResponse, error) { + r := CreateMysqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateNetworkCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createNetworkCheckPayload *CreateNetworkCheckPayload +} + +func (r CreateNetworkCheckRequest) CreateNetworkCheckPayload(createNetworkCheckPayload CreateNetworkCheckPayload) ApiCreateNetworkCheckRequest { + r.createNetworkCheckPayload = &createNetworkCheckPayload + return r +} + +func (r CreateNetworkCheckRequest) Execute() (*NetworkCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/network-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createNetworkCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateNetworkCheck: Method for CreateNetworkCheck + +Create network check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateNetworkCheckRequest +*/ +func (a *APIClient) CreateNetworkCheck(ctx context.Context, instanceId string, projectId string) ApiCreateNetworkCheckRequest { + return CreateNetworkCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateNetworkCheckExecute(ctx context.Context, instanceId string, projectId string) (*NetworkCheckResponse, error) { + r := CreateNetworkCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreatePingCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createPingCheckPayload *CreatePingCheckPayload +} + +func (r CreatePingCheckRequest) CreatePingCheckPayload(createPingCheckPayload CreatePingCheckPayload) ApiCreatePingCheckRequest { + r.createPingCheckPayload = &createPingCheckPayload + return r +} + +func (r CreatePingCheckRequest) Execute() (*PingCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PingCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreatePingCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/ping-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createPingCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createPingCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createPingCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreatePingCheck: Method for CreatePingCheck + +Create ping check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreatePingCheckRequest +*/ +func (a *APIClient) CreatePingCheck(ctx context.Context, instanceId string, projectId string) ApiCreatePingCheckRequest { + return CreatePingCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreatePingCheckExecute(ctx context.Context, instanceId string, projectId string) (*PingCheckResponse, error) { + r := CreatePingCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreatePostgresqlCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createPostgresqlCheckPayload *CreatePostgresqlCheckPayload +} + +func (r CreatePostgresqlCheckRequest) CreatePostgresqlCheckPayload(createPostgresqlCheckPayload CreatePostgresqlCheckPayload) ApiCreatePostgresqlCheckRequest { + r.createPostgresqlCheckPayload = &createPostgresqlCheckPayload + return r +} + +func (r CreatePostgresqlCheckRequest) Execute() (*PostgresqlCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PostgresqlCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreatePostgresqlCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/postgresql-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createPostgresqlCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createPostgresqlCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createPostgresqlCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreatePostgresqlCheck: Method for CreatePostgresqlCheck + +Create postgresql check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreatePostgresqlCheckRequest +*/ +func (a *APIClient) CreatePostgresqlCheck(ctx context.Context, instanceId string, projectId string) ApiCreatePostgresqlCheckRequest { + return CreatePostgresqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreatePostgresqlCheckExecute(ctx context.Context, instanceId string, projectId string) (*PostgresqlCheckResponse, error) { + r := CreatePostgresqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateRabbitmqCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createRabbitmqCheckPayload *CreateRabbitmqCheckPayload +} + +func (r CreateRabbitmqCheckRequest) CreateRabbitmqCheckPayload(createRabbitmqCheckPayload CreateRabbitmqCheckPayload) ApiCreateRabbitmqCheckRequest { + r.createRabbitmqCheckPayload = &createRabbitmqCheckPayload + return r +} + +func (r CreateRabbitmqCheckRequest) Execute() (*RabbitmqCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RabbitmqCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateRabbitmqCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/rabbitmq-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createRabbitmqCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createRabbitmqCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createRabbitmqCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateRabbitmqCheck: Method for CreateRabbitmqCheck + +Create rabbitmq check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateRabbitmqCheckRequest +*/ +func (a *APIClient) CreateRabbitmqCheck(ctx context.Context, instanceId string, projectId string) ApiCreateRabbitmqCheckRequest { + return CreateRabbitmqCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateRabbitmqCheckExecute(ctx context.Context, instanceId string, projectId string) (*RabbitmqCheckResponse, error) { + r := CreateRabbitmqCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateRedisCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createRedisCheckPayload *CreateRedisCheckPayload +} + +func (r CreateRedisCheckRequest) CreateRedisCheckPayload(createRedisCheckPayload CreateRedisCheckPayload) ApiCreateRedisCheckRequest { + r.createRedisCheckPayload = &createRedisCheckPayload + return r +} + +func (r CreateRedisCheckRequest) Execute() (*RedisCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedisCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateRedisCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/redis-checks" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createRedisCheckPayload == nil { + return localVarReturnValue, fmt.Errorf("createRedisCheckPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createRedisCheckPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateRedisCheck: Method for CreateRedisCheck + +Create redis check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateRedisCheckRequest +*/ +func (a *APIClient) CreateRedisCheck(ctx context.Context, instanceId string, projectId string) ApiCreateRedisCheckRequest { + return CreateRedisCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateRedisCheckExecute(ctx context.Context, instanceId string, projectId string) (*RedisCheckResponse, error) { + r := CreateRedisCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type CreateScrapeConfigRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + createScrapeConfigPayload *CreateScrapeConfigPayload +} + +func (r CreateScrapeConfigRequest) CreateScrapeConfigPayload(createScrapeConfigPayload CreateScrapeConfigPayload) ApiCreateScrapeConfigRequest { + r.createScrapeConfigPayload = &createScrapeConfigPayload + return r +} + +func (r CreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScrapeConfigsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateScrapeConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createScrapeConfigPayload == nil { + return localVarReturnValue, fmt.Errorf("createScrapeConfigPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createScrapeConfigPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateScrapeConfig: Method for CreateScrapeConfig + +Create scrape config. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiCreateScrapeConfigRequest +*/ +func (a *APIClient) CreateScrapeConfig(ctx context.Context, instanceId string, projectId string) ApiCreateScrapeConfigRequest { + return CreateScrapeConfigRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) CreateScrapeConfigExecute(ctx context.Context, instanceId string, projectId string) (*ScrapeConfigsResponse, error) { + r := CreateScrapeConfigRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteAlertConfigReceiverRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + receiver string +} + +func (r DeleteAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertConfigReceiversResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertConfigReceiver") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertConfigReceiver: Method for DeleteAlertConfigReceiver + +Delete alert config receiver. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param receiver + @return ApiDeleteAlertConfigReceiverRequest +*/ +func (a *APIClient) DeleteAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiDeleteAlertConfigReceiverRequest { + return DeleteAlertConfigReceiverRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + receiver: receiver, + } +} + +func (a *APIClient) DeleteAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigReceiversResponse, error) { + r := DeleteAlertConfigReceiverRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + receiver: receiver, + } + return r.Execute() +} + +type DeleteAlertConfigRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + receiver string +} + +func (r DeleteAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertConfigRouteResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertConfigRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertConfigRoute: Method for DeleteAlertConfigRoute + +Delete alert receiver for route. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param receiver + @return ApiDeleteAlertConfigRouteRequest +*/ +func (a *APIClient) DeleteAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiDeleteAlertConfigRouteRequest { + return DeleteAlertConfigRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + receiver: receiver, + } +} + +func (a *APIClient) DeleteAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) { + r := DeleteAlertConfigRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + receiver: receiver, + } + return r.Execute() +} + +type DeleteAlertgroupRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string +} + +func (r DeleteAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertGroupsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertgroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertgroup: Method for DeleteAlertgroup + +Delete alert group config. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertgroupRequest +*/ +func (a *APIClient) DeleteAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteAlertgroupRequest { + return DeleteAlertgroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := DeleteAlertgroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteAlertgroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + groupName *[]string +} + +// Name of the groups that should be deleted + +func (r DeleteAlertgroupsRequest) GroupName(groupName []string) ApiDeleteAlertgroupsRequest { + r.groupName = &groupName + return r +} + +func (r DeleteAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertGroupsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertgroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupName == nil { + return localVarReturnValue, fmt.Errorf("groupName is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "groupName", r.groupName, "csv") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertgroups: Method for DeleteAlertgroups + +Delete alert groups. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiDeleteAlertgroupsRequest +*/ +func (a *APIClient) DeleteAlertgroups(ctx context.Context, instanceId string, projectId string) ApiDeleteAlertgroupsRequest { + return DeleteAlertgroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := DeleteAlertgroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteAlertrecordRequest struct { + ctx context.Context + apiService *DefaultApiService + alertRecord string + groupName string + instanceId string + projectId string +} + +func (r DeleteAlertrecordRequest) Execute() (*AlertRecordsResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertRecordsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertrecord") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records/{alertRecord}" + localVarPath = strings.Replace(localVarPath, "{"+"alertRecord"+"}", url.PathEscape(ParameterValueToString(r.alertRecord, "alertRecord")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertrecord: Method for DeleteAlertrecord + +Delete alert record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertrecordRequest +*/ +func (a *APIClient) DeleteAlertrecord(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) ApiDeleteAlertrecordRequest { + return DeleteAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertRecord: alertRecord, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteAlertrecordExecute(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) { + r := DeleteAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertRecord: alertRecord, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteAlertrecordsRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + alertRecord *[]string +} + +// Name of the records that should be deleted + +func (r DeleteAlertrecordsRequest) AlertRecord(alertRecord []string) ApiDeleteAlertrecordsRequest { + r.alertRecord = &alertRecord + return r +} + +func (r DeleteAlertrecordsRequest) Execute() (*AlertRecordsResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertRecordsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertrecords") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.alertRecord == nil { + return localVarReturnValue, fmt.Errorf("alertRecord is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "alertRecord", r.alertRecord, "csv") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertrecords: Method for DeleteAlertrecords + +Delete alert records. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertrecordsRequest +*/ +func (a *APIClient) DeleteAlertrecords(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteAlertrecordsRequest { + return DeleteAlertrecordsRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteAlertrecordsExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) { + r := DeleteAlertrecordsRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteAlertruleRequest struct { + ctx context.Context + apiService *DefaultApiService + alertName string + groupName string + instanceId string + projectId string +} + +func (r DeleteAlertruleRequest) Execute() (*AlertRulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertRulesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertrule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules/{alertName}" + localVarPath = strings.Replace(localVarPath, "{"+"alertName"+"}", url.PathEscape(ParameterValueToString(r.alertName, "alertName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertrule: Method for DeleteAlertrule + +Delete alert rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertruleRequest +*/ +func (a *APIClient) DeleteAlertrule(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) ApiDeleteAlertruleRequest { + return DeleteAlertruleRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertName: alertName, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteAlertruleExecute(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { + r := DeleteAlertruleRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertName: alertName, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteAlertrulesRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + alertName *[]string +} + +// Name of the alert rules that should be deleted + +func (r DeleteAlertrulesRequest) AlertName(alertName []string) ApiDeleteAlertrulesRequest { + r.alertName = &alertName + return r +} + +func (r DeleteAlertrulesRequest) Execute() (*AlertRulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertRulesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertrules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.alertName == nil { + return localVarReturnValue, fmt.Errorf("alertName is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "alertName", r.alertName, "csv") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteAlertrules: Method for DeleteAlertrules + +Delete alert rules. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiDeleteAlertrulesRequest +*/ +func (a *APIClient) DeleteAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteAlertrulesRequest { + return DeleteAlertrulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { + r := DeleteAlertrulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteCertCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + id string +} + +func (r DeleteCertCheckRequest) Execute() (*CertCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCertCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/cert-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCertCheck: Method for DeleteCertCheck + +Delete cert check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param id + @return ApiDeleteCertCheckRequest +*/ +func (a *APIClient) DeleteCertCheck(ctx context.Context, instanceId string, projectId string, id string) ApiDeleteCertCheckRequest { + return DeleteCertCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + id: id, + } +} + +func (a *APIClient) DeleteCertCheckExecute(ctx context.Context, instanceId string, projectId string, id string) (*CertCheckResponse, error) { + r := DeleteCertCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + id: id, + } + return r.Execute() +} + +type DeleteCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + username string +} + +func (r DeleteCredentialsRequest) Execute() (*Message, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Message + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCredentials: Method for DeleteCredentials + +Delete technical credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param username + @return ApiDeleteCredentialsRequest +*/ +func (a *APIClient) DeleteCredentials(ctx context.Context, instanceId string, projectId string, username string) ApiDeleteCredentialsRequest { + return DeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + username: username, + } +} + +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, instanceId string, projectId string, username string) (*Message, error) { + r := DeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + username: username, + } + return r.Execute() +} + +type DeleteCredentialsRemoteWriteConfigRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + username string +} + +func (r DeleteCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemoteWriteDeleteResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsRemoteWriteDeleteResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentialsRemoteWriteConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 502 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCredentialsRemoteWriteConfig: Method for DeleteCredentialsRemoteWriteConfig + +Delete remote write config for credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param username + @return ApiDeleteCredentialsRemoteWriteConfigRequest +*/ +func (a *APIClient) DeleteCredentialsRemoteWriteConfig(ctx context.Context, instanceId string, projectId string, username string) ApiDeleteCredentialsRemoteWriteConfigRequest { + return DeleteCredentialsRemoteWriteConfigRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + username: username, + } +} + +func (a *APIClient) DeleteCredentialsRemoteWriteConfigExecute(ctx context.Context, instanceId string, projectId string, username string) (*CredentialsRemoteWriteDeleteResponse, error) { + r := DeleteCredentialsRemoteWriteConfigRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + username: username, + } + return r.Execute() +} + +type DeleteElasticsearchCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeleteElasticsearchCheckRequest) Execute() (*ElasticsearchCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ElasticsearchCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteElasticsearchCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/elasticsearch-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteElasticsearchCheck: Method for DeleteElasticsearchCheck + +Delete elasticsearch check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteElasticsearchCheckRequest +*/ +func (a *APIClient) DeleteElasticsearchCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteElasticsearchCheckRequest { + return DeleteElasticsearchCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteElasticsearchCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*ElasticsearchCheckResponse, error) { + r := DeleteElasticsearchCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteHttpCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + id string +} + +func (r DeleteHttpCheckRequest) Execute() (*HttpCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HttpCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteHttpCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/http-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteHttpCheck: Method for DeleteHttpCheck + +Delete http check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @param id + @return ApiDeleteHttpCheckRequest +*/ +func (a *APIClient) DeleteHttpCheck(ctx context.Context, instanceId string, projectId string, id string) ApiDeleteHttpCheckRequest { + return DeleteHttpCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + id: id, + } +} + +func (a *APIClient) DeleteHttpCheckExecute(ctx context.Context, instanceId string, projectId string, id string) (*HttpCheckResponse, error) { + r := DeleteHttpCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + id: id, + } + return r.Execute() +} + +type DeleteInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string +} + +func (r DeleteInstanceRequest) Execute() (*InstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstanceResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteInstance: Method for DeleteInstance + +Delete instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId + @param projectId + @return ApiDeleteInstanceRequest +*/ +func (a *APIClient) DeleteInstance(ctx context.Context, instanceId string, projectId string) ApiDeleteInstanceRequest { + return DeleteInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, instanceId string, projectId string) (*InstanceResponse, error) { + r := DeleteInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteLogsAlertgroupRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string +} + +func (r DeleteLogsAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AlertGroupsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLogsAlertgroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteLogsAlertgroup: Method for DeleteLogsAlertgroup + +Delete logs alert group config. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId + @param projectId + @return ApiDeleteLogsAlertgroupRequest +*/ +func (a *APIClient) DeleteLogsAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteLogsAlertgroupRequest { + return DeleteLogsAlertgroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteLogsAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := DeleteLogsAlertgroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteMongodbCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeleteMongodbCheckRequest) Execute() (*MongodbCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MongodbCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteMongodbCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/mongodb-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteMongodbCheck: Method for DeleteMongodbCheck + +Delete mongodb check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteMongodbCheckRequest +*/ +func (a *APIClient) DeleteMongodbCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteMongodbCheckRequest { + return DeleteMongodbCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteMongodbCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*MongodbCheckResponse, error) { + r := DeleteMongodbCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteMysqlCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeleteMysqlCheckRequest) Execute() (*MysqlCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MysqlCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteMysqlCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/mysql-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteMysqlCheck: Method for DeleteMysqlCheck + +Delete mysql check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteMysqlCheckRequest +*/ +func (a *APIClient) DeleteMysqlCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteMysqlCheckRequest { + return DeleteMysqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteMysqlCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*MysqlCheckResponse, error) { + r := DeleteMysqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteNetworkCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeleteNetworkCheckRequest) Execute() (*NetworkCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/network-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteNetworkCheck: Method for DeleteNetworkCheck + +Delete network check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteNetworkCheckRequest +*/ +func (a *APIClient) DeleteNetworkCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteNetworkCheckRequest { + return DeleteNetworkCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteNetworkCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*NetworkCheckResponse, error) { + r := DeleteNetworkCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeletePingCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeletePingCheckRequest) Execute() (*PingCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PingCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePingCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/ping-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeletePingCheck: Method for DeletePingCheck + +Delete ping check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeletePingCheckRequest +*/ +func (a *APIClient) DeletePingCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeletePingCheckRequest { + return DeletePingCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeletePingCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*PingCheckResponse, error) { + r := DeletePingCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeletePostgresqlCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeletePostgresqlCheckRequest) Execute() (*PostgresqlCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PostgresqlCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePostgresqlCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/postgresql-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeletePostgresqlCheck: Method for DeletePostgresqlCheck + +Delete postgresql check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeletePostgresqlCheckRequest +*/ +func (a *APIClient) DeletePostgresqlCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeletePostgresqlCheckRequest { + return DeletePostgresqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeletePostgresqlCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*PostgresqlCheckResponse, error) { + r := DeletePostgresqlCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteRabbitmqCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeleteRabbitmqCheckRequest) Execute() (*RabbitmqCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RabbitmqCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRabbitmqCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/rabbitmq-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteRabbitmqCheck: Method for DeleteRabbitmqCheck + +Delete rabbitmq check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteRabbitmqCheckRequest +*/ +func (a *APIClient) DeleteRabbitmqCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteRabbitmqCheckRequest { + return DeleteRabbitmqCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteRabbitmqCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*RabbitmqCheckResponse, error) { + r := DeleteRabbitmqCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteRedisCheckRequest struct { + ctx context.Context + apiService *DefaultApiService + id string + instanceId string + projectId string +} + +func (r DeleteRedisCheckRequest) Execute() (*RedisCheckResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedisCheckResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRedisCheck") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/redis-checks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteRedisCheck: Method for DeleteRedisCheck + +Delete redis check. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @param instanceId + @param projectId + @return ApiDeleteRedisCheckRequest +*/ +func (a *APIClient) DeleteRedisCheck(ctx context.Context, id string, instanceId string, projectId string) ApiDeleteRedisCheckRequest { + return DeleteRedisCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) DeleteRedisCheckExecute(ctx context.Context, id string, instanceId string, projectId string) (*RedisCheckResponse, error) { + r := DeleteRedisCheckRequest{ + apiService: a.defaultApi, + ctx: ctx, + id: id, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type DeleteScrapeConfigRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + jobName string + projectId string +} + +func (r DeleteScrapeConfigRequest) Execute() (*DeleteScrapeConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteScrapeConfigResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteScrapeConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(r.jobName, "jobName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createAlertConfigReceiverPayload == nil { - return localVarReturnValue, fmt.Errorf("createAlertConfigReceiverPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1675,8 +9509,6 @@ func (r CreateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createAlertConfigReceiverPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -1709,8 +9541,8 @@ func (r CreateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1720,8 +9552,8 @@ func (r CreateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 404 { + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1747,77 +9579,83 @@ func (r CreateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon } /* -CreateAlertConfigReceiver: Method for CreateAlertConfigReceiver +DeleteScrapeConfig: Method for DeleteScrapeConfig -Create alert config receiver. +Delete scrape config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId + @param jobName @param projectId - @return ApiCreateAlertConfigReceiverRequest + @return ApiDeleteScrapeConfigRequest */ -func (a *APIClient) CreateAlertConfigReceiver(ctx context.Context, instanceId string, projectId string) ApiCreateAlertConfigReceiverRequest { - return CreateAlertConfigReceiverRequest{ +func (a *APIClient) DeleteScrapeConfig(ctx context.Context, instanceId string, jobName string, projectId string) ApiDeleteScrapeConfigRequest { + return DeleteScrapeConfigRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, + jobName: jobName, projectId: projectId, } } -func (a *APIClient) CreateAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigReceiversResponse, error) { - r := CreateAlertConfigReceiverRequest{ +func (a *APIClient) DeleteScrapeConfigExecute(ctx context.Context, instanceId string, jobName string, projectId string) (*DeleteScrapeConfigResponse, error) { + r := DeleteScrapeConfigRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, + jobName: jobName, projectId: projectId, } return r.Execute() } -type CreateAlertConfigRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createAlertConfigRoutePayload *CreateAlertConfigRoutePayload +type DeleteScrapeConfigsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + jobName *[]string } -func (r CreateAlertConfigRouteRequest) CreateAlertConfigRoutePayload(createAlertConfigRoutePayload CreateAlertConfigRoutePayload) ApiCreateAlertConfigRouteRequest { - r.createAlertConfigRoutePayload = &createAlertConfigRoutePayload +// Name of the jobs that should be deleted + +func (r DeleteScrapeConfigsRequest) JobName(jobName []string) ApiDeleteScrapeConfigsRequest { + r.jobName = &jobName return r } -func (r CreateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { +func (r DeleteScrapeConfigsRequest) Execute() (*ScrapeConfigsResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigRouteResponse + localVarReturnValue *ScrapeConfigsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertConfigRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteScrapeConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createAlertConfigRoutePayload == nil { - return localVarReturnValue, fmt.Errorf("createAlertConfigRoutePayload is required and must be specified") + if r.jobName == nil { + return localVarReturnValue, fmt.Errorf("jobName is required and must be specified") } + parameterAddToHeaderOrQuery(localVarQueryParams, "jobName", r.jobName, "csv") // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1833,8 +9671,6 @@ func (r CreateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createAlertConfigRoutePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -1867,17 +9703,6 @@ func (r CreateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1905,17 +9730,17 @@ func (r CreateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err } /* -CreateAlertConfigRoute: Method for CreateAlertConfigRoute +DeleteScrapeConfigs: Method for DeleteScrapeConfigs -Create alert config route in routes of route. +Delete scrape configs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiCreateAlertConfigRouteRequest + @return ApiDeleteScrapeConfigsRequest */ -func (a *APIClient) CreateAlertConfigRoute(ctx context.Context, instanceId string, projectId string) ApiCreateAlertConfigRouteRequest { - return CreateAlertConfigRouteRequest{ +func (a *APIClient) DeleteScrapeConfigs(ctx context.Context, instanceId string, projectId string) ApiDeleteScrapeConfigsRequest { + return DeleteScrapeConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -1923,8 +9748,8 @@ func (a *APIClient) CreateAlertConfigRoute(ctx context.Context, instanceId strin } } -func (a *APIClient) CreateAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigRouteResponse, error) { - r := CreateAlertConfigRouteRequest{ +func (a *APIClient) DeleteScrapeConfigsExecute(ctx context.Context, instanceId string, projectId string) (*ScrapeConfigsResponse, error) { + r := DeleteScrapeConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -1933,49 +9758,42 @@ func (a *APIClient) CreateAlertConfigRouteExecute(ctx context.Context, instanceI return r.Execute() } -type CreateAlertgroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createAlertgroupsPayload *CreateAlertgroupsPayload -} - -func (r CreateAlertgroupsRequest) CreateAlertgroupsPayload(createAlertgroupsPayload CreateAlertgroupsPayload) ApiCreateAlertgroupsRequest { - r.createAlertgroupsPayload = &createAlertgroupsPayload - return r +type GetAlertConfigReceiverRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + receiver string } -func (r CreateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r GetAlertConfigReceiverRequest) Execute() (*Receiver, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *Receiver ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertConfigReceiver") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createAlertgroupsPayload == nil { - return localVarReturnValue, fmt.Errorf("createAlertgroupsPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1991,8 +9809,6 @@ func (r CreateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createAlertgroupsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2025,8 +9841,8 @@ func (r CreateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2036,8 +9852,8 @@ func (r CreateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 404 { + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2063,79 +9879,73 @@ func (r CreateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } /* -CreateAlertgroups: Method for CreateAlertgroups +GetAlertConfigReceiver: Method for GetAlertConfigReceiver -Create alert group. +Get alert config receivers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiCreateAlertgroupsRequest + @param receiver + @return ApiGetAlertConfigReceiverRequest */ -func (a *APIClient) CreateAlertgroups(ctx context.Context, instanceId string, projectId string) ApiCreateAlertgroupsRequest { - return CreateAlertgroupsRequest{ +func (a *APIClient) GetAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigReceiverRequest { + return GetAlertConfigReceiverRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + receiver: receiver, } } -func (a *APIClient) CreateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := CreateAlertgroupsRequest{ +func (a *APIClient) GetAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*Receiver, error) { + r := GetAlertConfigReceiverRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + receiver: receiver, } return r.Execute() } -type CreateAlertrulesRequest struct { - ctx context.Context - apiService *DefaultApiService - groupName string - instanceId string - projectId string - createAlertrulesPayload *CreateAlertrulesPayload -} - -func (r CreateAlertrulesRequest) CreateAlertrulesPayload(createAlertrulesPayload CreateAlertrulesPayload) ApiCreateAlertrulesRequest { - r.createAlertrulesPayload = &createAlertrulesPayload - return r +type GetAlertConfigRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + receiver string } -func (r CreateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { +func (r GetAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertRulesResponse + localVarReturnValue *AlertConfigRouteResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAlertrules") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertConfigRoute") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createAlertrulesPayload == nil { - return localVarReturnValue, fmt.Errorf("createAlertrulesPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2151,8 +9961,6 @@ func (r CreateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createAlertrulesPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2185,17 +9993,6 @@ func (r CreateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2223,80 +10020,71 @@ func (r CreateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { } /* -CreateAlertrules: Method for CreateAlertrules +GetAlertConfigRoute: Method for GetAlertConfigRoute -Create alert rule. +Get alert receiver for route. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName @param instanceId @param projectId - @return ApiCreateAlertrulesRequest + @param receiver + @return ApiGetAlertConfigRouteRequest */ -func (a *APIClient) CreateAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiCreateAlertrulesRequest { - return CreateAlertrulesRequest{ +func (a *APIClient) GetAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigRouteRequest { + return GetAlertConfigRouteRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, + receiver: receiver, } } -func (a *APIClient) CreateAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { - r := CreateAlertrulesRequest{ +func (a *APIClient) GetAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) { + r := GetAlertConfigRouteRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, + receiver: receiver, } return r.Execute() } -type CreateCertCheckRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createCertCheckPayload *CreateCertCheckPayload -} - -func (r CreateCertCheckRequest) CreateCertCheckPayload(createCertCheckPayload CreateCertCheckPayload) ApiCreateCertCheckRequest { - r.createCertCheckPayload = &createCertCheckPayload - return r +type GetAlertConfigsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string } -func (r CreateCertCheckRequest) Execute() (*CertCheckResponse, error) { +func (r GetAlertConfigsRequest) Execute() (*GetAlertConfigsResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CertCheckResponse + localVarReturnValue *GetAlertConfigsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCertCheck") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/cert-checks" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createCertCheckPayload == nil { - return localVarReturnValue, fmt.Errorf("createCertCheckPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2312,8 +10100,6 @@ func (r CreateCertCheckRequest) Execute() (*CertCheckResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createCertCheckPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2342,20 +10128,9 @@ func (r CreateCertCheckRequest) Execute() (*CertCheckResponse, error) { if localVarHTTPResponse.StatusCode >= 300 { newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v CreateCertCheck400Response - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied @@ -2384,17 +10159,17 @@ func (r CreateCertCheckRequest) Execute() (*CertCheckResponse, error) { } /* -CreateCertCheck: Method for CreateCertCheck +GetAlertConfigs: Method for GetAlertConfigs -Create cert check. +Get alert config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiCreateCertCheckRequest + @return ApiGetAlertConfigsRequest */ -func (a *APIClient) CreateCertCheck(ctx context.Context, instanceId string, projectId string) ApiCreateCertCheckRequest { - return CreateCertCheckRequest{ +func (a *APIClient) GetAlertConfigs(ctx context.Context, instanceId string, projectId string) ApiGetAlertConfigsRequest { + return GetAlertConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -2402,8 +10177,8 @@ func (a *APIClient) CreateCertCheck(ctx context.Context, instanceId string, proj } } -func (a *APIClient) CreateCertCheckExecute(ctx context.Context, instanceId string, projectId string) (*CertCheckResponse, error) { - r := CreateCertCheckRequest{ +func (a *APIClient) GetAlertConfigsExecute(ctx context.Context, instanceId string, projectId string) (*GetAlertConfigsResponse, error) { + r := GetAlertConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -2412,37 +10187,33 @@ func (a *APIClient) CreateCertCheckExecute(ctx context.Context, instanceId strin return r.Execute() } -type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createCredentialsPayload *CreateCredentialsPayload -} - -func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { - r.createCredentialsPayload = &createCredentialsPayload - return r +type GetAlertgroupRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string } -func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) { +func (r GetAlertgroupRequest) Execute() (*AlertGroupResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CreateCredentialsResponse + localVarReturnValue *AlertGroupResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertgroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -2451,7 +10222,7 @@ func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2467,8 +10238,6 @@ func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2502,7 +10271,7 @@ func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v Error + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2521,6 +10290,17 @@ func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2539,77 +10319,75 @@ func (r CreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) } /* -CreateCredentials: Method for CreateCredentials +GetAlertgroup: Method for GetAlertgroup -Create technical user credentials. +Get alert group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName @param instanceId @param projectId - @return ApiCreateCredentialsRequest + @return ApiGetAlertgroupRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, instanceId string, projectId string) ApiCreateCredentialsRequest { - return CreateCredentialsRequest{ +func (a *APIClient) GetAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiGetAlertgroupRequest { + return GetAlertgroupRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, instanceId string, projectId string) (*CreateCredentialsResponse, error) { - r := CreateCredentialsRequest{ +func (a *APIClient) GetAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupResponse, error) { + r := GetAlertgroupRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type CreateHttpCheckRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createHttpCheckPayload *CreateHttpCheckPayload -} - -func (r CreateHttpCheckRequest) CreateHttpCheckPayload(createHttpCheckPayload CreateHttpCheckPayload) ApiCreateHttpCheckRequest { - r.createHttpCheckPayload = &createHttpCheckPayload - return r +type GetAlertrecordRequest struct { + ctx context.Context + apiService *DefaultApiService + alertRecord string + groupName string + instanceId string + projectId string } -func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { +func (r GetAlertrecordRequest) Execute() (*AlertRecordResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *HttpCheckResponse + localVarReturnValue *AlertRecordResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateHttpCheck") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertrecord") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/http-checks" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records/{alertRecord}" + localVarPath = strings.Replace(localVarPath, "{"+"alertRecord"+"}", url.PathEscape(ParameterValueToString(r.alertRecord, "alertRecord")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createHttpCheckPayload == nil { - return localVarReturnValue, fmt.Errorf("createHttpCheckPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2625,8 +10403,6 @@ func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createHttpCheckPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2660,7 +10436,7 @@ func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v CreateCertCheck400Response + var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2679,6 +10455,17 @@ func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2697,75 +10484,78 @@ func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { } /* -CreateHttpCheck: Method for CreateHttpCheck +GetAlertrecord: Method for GetAlertrecord -Create http check. +Get alert record. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord + @param groupName @param instanceId @param projectId - @return ApiCreateHttpCheckRequest + @return ApiGetAlertrecordRequest */ -func (a *APIClient) CreateHttpCheck(ctx context.Context, instanceId string, projectId string) ApiCreateHttpCheckRequest { - return CreateHttpCheckRequest{ - apiService: a.defaultApi, - ctx: ctx, - instanceId: instanceId, - projectId: projectId, - } -} - -func (a *APIClient) CreateHttpCheckExecute(ctx context.Context, instanceId string, projectId string) (*HttpCheckResponse, error) { - r := CreateHttpCheckRequest{ - apiService: a.defaultApi, - ctx: ctx, - instanceId: instanceId, - projectId: projectId, +func (a *APIClient) GetAlertrecord(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) ApiGetAlertrecordRequest { + return GetAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertRecord: alertRecord, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) GetAlertrecordExecute(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) (*AlertRecordResponse, error) { + r := GetAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertRecord: alertRecord, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, } return r.Execute() } -type CreateInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createInstancePayload *CreateInstancePayload -} - -func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { - r.createInstancePayload = &createInstancePayload - return r +type GetAlertruleRequest struct { + ctx context.Context + apiService *DefaultApiService + alertName string + groupName string + instanceId string + projectId string } -func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { +func (r GetAlertruleRequest) Execute() (*AlertRuleResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CreateInstanceResponse + localVarReturnValue *AlertRuleResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertrule") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules/{alertName}" + localVarPath = strings.Replace(localVarPath, "{"+"alertName"+"}", url.PathEscape(ParameterValueToString(r.alertName, "alertName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("createInstancePayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2781,8 +10571,6 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createInstancePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2815,8 +10603,8 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2826,8 +10614,8 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 404 { + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2853,74 +10641,76 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { } /* -CreateInstance: Method for CreateInstance +GetAlertrule: Method for GetAlertrule -Create new instance. +Get alert rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName + @param instanceId @param projectId - @return ApiCreateInstanceRequest + @return ApiGetAlertruleRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { - return CreateInstanceRequest{ +func (a *APIClient) GetAlertrule(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) ApiGetAlertruleRequest { + return GetAlertruleRequest{ apiService: a.defaultApi, ctx: ctx, + alertName: alertName, + groupName: groupName, + instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { - r := CreateInstanceRequest{ +func (a *APIClient) GetAlertruleExecute(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) (*AlertRuleResponse, error) { + r := GetAlertruleRequest{ apiService: a.defaultApi, ctx: ctx, + alertName: alertName, + groupName: groupName, + instanceId: instanceId, projectId: projectId, } return r.Execute() } -type CreateLogsAlertgroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createLogsAlertgroupsPayload *CreateLogsAlertgroupsPayload -} - -func (r CreateLogsAlertgroupsRequest) CreateLogsAlertgroupsPayload(createLogsAlertgroupsPayload CreateLogsAlertgroupsPayload) ApiCreateLogsAlertgroupsRequest { - r.createLogsAlertgroupsPayload = &createLogsAlertgroupsPayload - return r +type GetCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + username string } -func (r CreateLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r GetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *GetCredentialsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLogsAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createLogsAlertgroupsPayload == nil { - return localVarReturnValue, fmt.Errorf("createLogsAlertgroupsPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2936,8 +10726,6 @@ func (r CreateLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createLogsAlertgroupsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2970,8 +10758,8 @@ func (r CreateLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2981,8 +10769,8 @@ func (r CreateLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 404 { + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -3008,77 +10796,73 @@ func (r CreateLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } /* -CreateLogsAlertgroups: Method for CreateLogsAlertgroups +GetCredentials: Method for GetCredentials -Create logs alert group config. +Get single technical credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiCreateLogsAlertgroupsRequest + @param username + @return ApiGetCredentialsRequest */ -func (a *APIClient) CreateLogsAlertgroups(ctx context.Context, instanceId string, projectId string) ApiCreateLogsAlertgroupsRequest { - return CreateLogsAlertgroupsRequest{ +func (a *APIClient) GetCredentials(ctx context.Context, instanceId string, projectId string, username string) ApiGetCredentialsRequest { + return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + username: username, } } -func (a *APIClient) CreateLogsAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := CreateLogsAlertgroupsRequest{ +func (a *APIClient) GetCredentialsExecute(ctx context.Context, instanceId string, projectId string, username string) (*GetCredentialsResponse, error) { + r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + username: username, } - return r.Execute() -} - -type CreateScrapeConfigRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - createScrapeConfigPayload *CreateScrapeConfigPayload + return r.Execute() } -func (r CreateScrapeConfigRequest) CreateScrapeConfigPayload(createScrapeConfigPayload CreateScrapeConfigPayload) ApiCreateScrapeConfigRequest { - r.createScrapeConfigPayload = &createScrapeConfigPayload - return r +type GetCredentialsRemoteWriteConfigRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + username string } -func (r CreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) { +func (r GetCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemoteWriteConfig, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ScrapeConfigsResponse + localVarReturnValue *CredentialsRemoteWriteConfig ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateScrapeConfig") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsRemoteWriteConfig") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createScrapeConfigPayload == nil { - return localVarReturnValue, fmt.Errorf("createScrapeConfigPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3094,8 +10878,6 @@ func (r CreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createScrapeConfigPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -3128,8 +10910,8 @@ func (r CreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -3139,8 +10921,19 @@ func (r CreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 502 { + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -3166,63 +10959,64 @@ func (r CreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) { } /* -CreateScrapeConfig: Method for CreateScrapeConfig +GetCredentialsRemoteWriteConfig: Method for GetCredentialsRemoteWriteConfig -Create scrape config. +Get remote write config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiCreateScrapeConfigRequest + @param username + @return ApiGetCredentialsRemoteWriteConfigRequest */ -func (a *APIClient) CreateScrapeConfig(ctx context.Context, instanceId string, projectId string) ApiCreateScrapeConfigRequest { - return CreateScrapeConfigRequest{ +func (a *APIClient) GetCredentialsRemoteWriteConfig(ctx context.Context, instanceId string, projectId string, username string) ApiGetCredentialsRemoteWriteConfigRequest { + return GetCredentialsRemoteWriteConfigRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + username: username, } } -func (a *APIClient) CreateScrapeConfigExecute(ctx context.Context, instanceId string, projectId string) (*ScrapeConfigsResponse, error) { - r := CreateScrapeConfigRequest{ +func (a *APIClient) GetCredentialsRemoteWriteConfigExecute(ctx context.Context, instanceId string, projectId string, username string) (*CredentialsRemoteWriteConfig, error) { + r := GetCredentialsRemoteWriteConfigRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + username: username, } return r.Execute() } -type DeleteAlertConfigReceiverRequest struct { +type GetGrafanaConfigsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - receiver string } -func (r DeleteAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversResponse, error) { +func (r GetGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigReceiversResponse + localVarReturnValue *GrafanaConfigs ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertConfigReceiver") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetGrafanaConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/grafana-configs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3286,17 +11080,6 @@ func (r DeleteAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -3315,66 +11098,61 @@ func (r DeleteAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon } /* -DeleteAlertConfigReceiver: Method for DeleteAlertConfigReceiver +GetGrafanaConfigs: Method for GetGrafanaConfigs -Delete alert config receiver. +Get grafana config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param receiver - @return ApiDeleteAlertConfigReceiverRequest + @return ApiGetGrafanaConfigsRequest */ -func (a *APIClient) DeleteAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiDeleteAlertConfigReceiverRequest { - return DeleteAlertConfigReceiverRequest{ +func (a *APIClient) GetGrafanaConfigs(ctx context.Context, instanceId string, projectId string) ApiGetGrafanaConfigsRequest { + return GetGrafanaConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } } -func (a *APIClient) DeleteAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigReceiversResponse, error) { - r := DeleteAlertConfigReceiverRequest{ +func (a *APIClient) GetGrafanaConfigsExecute(ctx context.Context, instanceId string, projectId string) (*GrafanaConfigs, error) { + r := GetGrafanaConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } return r.Execute() } -type DeleteAlertConfigRouteRequest struct { +type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - receiver string } -func (r DeleteAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { +func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigRouteResponse + localVarReturnValue *GetInstanceResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertConfigRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3438,17 +11216,6 @@ func (r DeleteAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -3467,38 +11234,35 @@ func (r DeleteAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err } /* -DeleteAlertConfigRoute: Method for DeleteAlertConfigRoute +GetInstance: Method for GetInstance -Delete alert receiver for route. +Get instance information. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param receiver - @return ApiDeleteAlertConfigRouteRequest + @return ApiGetInstanceRequest */ -func (a *APIClient) DeleteAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiDeleteAlertConfigRouteRequest { - return DeleteAlertConfigRouteRequest{ +func (a *APIClient) GetInstance(ctx context.Context, instanceId string, projectId string) ApiGetInstanceRequest { + return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } } -func (a *APIClient) DeleteAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) { - r := DeleteAlertConfigRouteRequest{ +func (a *APIClient) GetInstanceExecute(ctx context.Context, instanceId string, projectId string) (*GetInstanceResponse, error) { + r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } return r.Execute() } -type DeleteAlertgroupRequest struct { +type GetLogsAlertgroupRequest struct { ctx context.Context apiService *DefaultApiService groupName string @@ -3506,24 +11270,24 @@ type DeleteAlertgroupRequest struct { projectId string } -func (r DeleteAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { +func (r GetLogsAlertgroupRequest) Execute() (*AlertGroupResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *AlertGroupResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertgroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLogsAlertgroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -3630,18 +11394,18 @@ func (r DeleteAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { } /* -DeleteAlertgroup: Method for DeleteAlertgroup +GetLogsAlertgroup: Method for GetLogsAlertgroup -Delete alert group config. +Get logs alert group config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param groupName @param instanceId @param projectId - @return ApiDeleteAlertgroupRequest + @return ApiGetLogsAlertgroupRequest */ -func (a *APIClient) DeleteAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteAlertgroupRequest { - return DeleteAlertgroupRequest{ +func (a *APIClient) GetLogsAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiGetLogsAlertgroupRequest { + return GetLogsAlertgroupRequest{ apiService: a.defaultApi, ctx: ctx, groupName: groupName, @@ -3650,8 +11414,8 @@ func (a *APIClient) DeleteAlertgroup(ctx context.Context, groupName string, inst } } -func (a *APIClient) DeleteAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := DeleteAlertgroupRequest{ +func (a *APIClient) GetLogsAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupResponse, error) { + r := GetLogsAlertgroupRequest{ apiService: a.defaultApi, ctx: ctx, groupName: groupName, @@ -3661,50 +11425,38 @@ func (a *APIClient) DeleteAlertgroupExecute(ctx context.Context, groupName strin return r.Execute() } -type DeleteAlertgroupsRequest struct { +type GetLogsConfigsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - groupName *[]string -} - -// Name of the groups that should be deleted - -func (r DeleteAlertgroupsRequest) GroupName(groupName []string) ApiDeleteAlertgroupsRequest { - r.groupName = &groupName - return r } -func (r DeleteAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r GetLogsConfigsRequest) Execute() (*LogsConfigResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *LogsConfigResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLogsConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-configs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.groupName == nil { - return localVarReturnValue, fmt.Errorf("groupName is required and must be specified") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "groupName", r.groupName, "csv") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3781,17 +11533,17 @@ func (r DeleteAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } /* -DeleteAlertgroups: Method for DeleteAlertgroups +GetLogsConfigs: Method for GetLogsConfigs -Delete alert groups. +Get logs configuration. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiDeleteAlertgroupsRequest + @return ApiGetLogsConfigsRequest */ -func (a *APIClient) DeleteAlertgroups(ctx context.Context, instanceId string, projectId string) ApiDeleteAlertgroupsRequest { - return DeleteAlertgroupsRequest{ +func (a *APIClient) GetLogsConfigs(ctx context.Context, instanceId string, projectId string) ApiGetLogsConfigsRequest { + return GetLogsConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -3799,8 +11551,8 @@ func (a *APIClient) DeleteAlertgroups(ctx context.Context, instanceId string, pr } } -func (a *APIClient) DeleteAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := DeleteAlertgroupsRequest{ +func (a *APIClient) GetLogsConfigsExecute(ctx context.Context, instanceId string, projectId string) (*LogsConfigResponse, error) { + r := GetLogsConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -3809,52 +11561,38 @@ func (a *APIClient) DeleteAlertgroupsExecute(ctx context.Context, instanceId str return r.Execute() } -type DeleteAlertrulesRequest struct { +type GetMetricsStorageRetentionRequest struct { ctx context.Context apiService *DefaultApiService - groupName string instanceId string projectId string - alertName *[]string } -// Name of the alert rules that should be deleted - -func (r DeleteAlertrulesRequest) AlertName(alertName []string) ApiDeleteAlertrulesRequest { - r.alertName = &alertName - return r -} - -func (r DeleteAlertrulesRequest) Execute() (*AlertRulesResponse, error) { +func (r GetMetricsStorageRetentionRequest) Execute() (*GetMetricsStorageRetentionResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertRulesResponse + localVarReturnValue *GetMetricsStorageRetentionResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlertrules") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMetricsStorageRetention") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.alertName == nil { - return localVarReturnValue, fmt.Errorf("alertName is required and must be specified") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "alertName", r.alertName, "csv") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3931,66 +11669,63 @@ func (r DeleteAlertrulesRequest) Execute() (*AlertRulesResponse, error) { } /* -DeleteAlertrules: Method for DeleteAlertrules +GetMetricsStorageRetention: Method for GetMetricsStorageRetention -Delete alert rules. +Get metric storage retention time. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName @param instanceId @param projectId - @return ApiDeleteAlertrulesRequest + @return ApiGetMetricsStorageRetentionRequest */ -func (a *APIClient) DeleteAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteAlertrulesRequest { - return DeleteAlertrulesRequest{ +func (a *APIClient) GetMetricsStorageRetention(ctx context.Context, instanceId string, projectId string) ApiGetMetricsStorageRetentionRequest { + return GetMetricsStorageRetentionRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) DeleteAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { - r := DeleteAlertrulesRequest{ +func (a *APIClient) GetMetricsStorageRetentionExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsStorageRetentionResponse, error) { + r := GetMetricsStorageRetentionRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type DeleteCertCheckRequest struct { +type GetScrapeConfigRequest struct { ctx context.Context apiService *DefaultApiService instanceId string + jobName string projectId string - id string } -func (r DeleteCertCheckRequest) Execute() (*CertCheckResponse, error) { +func (r GetScrapeConfigRequest) Execute() (*GetScrapeConfigResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CertCheckResponse + localVarReturnValue *GetScrapeConfigResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCertCheck") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetScrapeConfig") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/cert-checks/{id}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(r.jobName, "jobName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4045,17 +11780,6 @@ func (r DeleteCertCheckRequest) Execute() (*CertCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v []string - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4083,66 +11807,64 @@ func (r DeleteCertCheckRequest) Execute() (*CertCheckResponse, error) { } /* -DeleteCertCheck: Method for DeleteCertCheck +GetScrapeConfig: Method for GetScrapeConfig -Delete cert check. +Get scrape config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId + @param jobName @param projectId - @param id - @return ApiDeleteCertCheckRequest + @return ApiGetScrapeConfigRequest */ -func (a *APIClient) DeleteCertCheck(ctx context.Context, instanceId string, projectId string, id string) ApiDeleteCertCheckRequest { - return DeleteCertCheckRequest{ +func (a *APIClient) GetScrapeConfig(ctx context.Context, instanceId string, jobName string, projectId string) ApiGetScrapeConfigRequest { + return GetScrapeConfigRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, + jobName: jobName, projectId: projectId, - id: id, } } -func (a *APIClient) DeleteCertCheckExecute(ctx context.Context, instanceId string, projectId string, id string) (*CertCheckResponse, error) { - r := DeleteCertCheckRequest{ +func (a *APIClient) GetScrapeConfigExecute(ctx context.Context, instanceId string, jobName string, projectId string) (*GetScrapeConfigResponse, error) { + r := GetScrapeConfigRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, + jobName: jobName, projectId: projectId, - id: id, } return r.Execute() } -type DeleteCredentialsRequest struct { +type GetTracesConfigsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - username string } -func (r DeleteCredentialsRequest) Execute() (*Message, error) { +func (r GetTracesConfigsRequest) Execute() (*TracesConfigResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Message + localVarReturnValue *TracesConfigResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTracesConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/traces-configs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4206,28 +11928,6 @@ func (r DeleteCredentialsRequest) Execute() (*Message, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -4246,66 +11946,61 @@ func (r DeleteCredentialsRequest) Execute() (*Message, error) { } /* -DeleteCredentials: Method for DeleteCredentials +GetTracesConfigs: Method for GetTracesConfigs -Delete technical credentials. +Get traces config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param username - @return ApiDeleteCredentialsRequest + @return ApiGetTracesConfigsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, instanceId string, projectId string, username string) ApiDeleteCredentialsRequest { - return DeleteCredentialsRequest{ +func (a *APIClient) GetTracesConfigs(ctx context.Context, instanceId string, projectId string) ApiGetTracesConfigsRequest { + return GetTracesConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } } -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, instanceId string, projectId string, username string) (*Message, error) { - r := DeleteCredentialsRequest{ +func (a *APIClient) GetTracesConfigsExecute(ctx context.Context, instanceId string, projectId string) (*TracesConfigResponse, error) { + r := GetTracesConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } return r.Execute() } -type DeleteCredentialsRemoteWriteConfigRequest struct { +type ListACLRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - username string } -func (r DeleteCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemoteWriteDeleteResponse, error) { +func (r ListACLRequest) Execute() (*ListACLResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CredentialsRemoteWriteDeleteResponse + localVarReturnValue *ListACLResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentialsRemoteWriteConfig") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListACL") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acl" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4360,17 +12055,6 @@ func (r DeleteCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemote Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4380,28 +12064,6 @@ func (r DeleteCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemote } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 502 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -4420,66 +12082,61 @@ func (r DeleteCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemote } /* -DeleteCredentialsRemoteWriteConfig: Method for DeleteCredentialsRemoteWriteConfig +ListACL: Method for ListACL -Delete remote write config for credentials. +Get acl for instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param username - @return ApiDeleteCredentialsRemoteWriteConfigRequest + @return ApiListACLRequest */ -func (a *APIClient) DeleteCredentialsRemoteWriteConfig(ctx context.Context, instanceId string, projectId string, username string) ApiDeleteCredentialsRemoteWriteConfigRequest { - return DeleteCredentialsRemoteWriteConfigRequest{ +func (a *APIClient) ListACL(ctx context.Context, instanceId string, projectId string) ApiListACLRequest { + return ListACLRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } } -func (a *APIClient) DeleteCredentialsRemoteWriteConfigExecute(ctx context.Context, instanceId string, projectId string, username string) (*CredentialsRemoteWriteDeleteResponse, error) { - r := DeleteCredentialsRemoteWriteConfigRequest{ +func (a *APIClient) ListACLExecute(ctx context.Context, instanceId string, projectId string) (*ListACLResponse, error) { + r := ListACLRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } return r.Execute() } -type DeleteHttpCheckRequest struct { +type ListAlertConfigReceiversRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - id string } -func (r DeleteHttpCheckRequest) Execute() (*HttpCheckResponse, error) { +func (r ListAlertConfigReceiversRequest) Execute() (*AlertConfigReceiversResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *HttpCheckResponse + localVarReturnValue *AlertConfigReceiversResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteHttpCheck") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertConfigReceivers") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/http-checks/{id}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4534,17 +12191,6 @@ func (r DeleteHttpCheckRequest) Execute() (*HttpCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v []string - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4572,62 +12218,59 @@ func (r DeleteHttpCheckRequest) Execute() (*HttpCheckResponse, error) { } /* -DeleteHttpCheck: Method for DeleteHttpCheck +ListAlertConfigReceivers: Method for ListAlertConfigReceivers -Delete http check. +Get alert config receivers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param id - @return ApiDeleteHttpCheckRequest + @return ApiListAlertConfigReceiversRequest */ -func (a *APIClient) DeleteHttpCheck(ctx context.Context, instanceId string, projectId string, id string) ApiDeleteHttpCheckRequest { - return DeleteHttpCheckRequest{ +func (a *APIClient) ListAlertConfigReceivers(ctx context.Context, instanceId string, projectId string) ApiListAlertConfigReceiversRequest { + return ListAlertConfigReceiversRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - id: id, } } -func (a *APIClient) DeleteHttpCheckExecute(ctx context.Context, instanceId string, projectId string, id string) (*HttpCheckResponse, error) { - r := DeleteHttpCheckRequest{ +func (a *APIClient) ListAlertConfigReceiversExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigReceiversResponse, error) { + r := ListAlertConfigReceiversRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - id: id, } return r.Execute() } -type DeleteInstanceRequest struct { +type ListAlertConfigRoutesRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r DeleteInstanceRequest) Execute() (*InstanceResponse, error) { +func (r ListAlertConfigRoutesRequest) Execute() (*AlertConfigRouteResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *InstanceResponse + localVarReturnValue *AlertConfigRouteResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertConfigRoutes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -4711,17 +12354,17 @@ func (r DeleteInstanceRequest) Execute() (*InstanceResponse, error) { } /* -DeleteInstance: Method for DeleteInstance +ListAlertConfigRoutes: Method for ListAlertConfigRoutes -Delete instance. +Get alert config route. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiDeleteInstanceRequest + @return ApiListAlertConfigRoutesRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, instanceId string, projectId string) ApiDeleteInstanceRequest { - return DeleteInstanceRequest{ +func (a *APIClient) ListAlertConfigRoutes(ctx context.Context, instanceId string, projectId string) ApiListAlertConfigRoutesRequest { + return ListAlertConfigRoutesRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -4729,8 +12372,8 @@ func (a *APIClient) DeleteInstance(ctx context.Context, instanceId string, proje } } -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, instanceId string, projectId string) (*InstanceResponse, error) { - r := DeleteInstanceRequest{ +func (a *APIClient) ListAlertConfigRoutesExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigRouteResponse, error) { + r := ListAlertConfigRoutesRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -4739,17 +12382,16 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, instanceId string return r.Execute() } -type DeleteLogsAlertgroupRequest struct { +type ListAlertgroupsRequest struct { ctx context.Context apiService *DefaultApiService - groupName string instanceId string projectId string } -func (r DeleteLogsAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { +func (r ListAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue *AlertGroupsResponse @@ -4759,13 +12401,12 @@ func (r DeleteLogsAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLogsAlertgroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertgroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -4819,22 +12460,11 @@ func (r DeleteLogsAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { if localVarHTTPResponse.StatusCode >= 300 { newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 400 { + var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4844,8 +12474,8 @@ func (r DeleteLogsAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v Message + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4871,65 +12501,62 @@ func (r DeleteLogsAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { } /* -DeleteLogsAlertgroup: Method for DeleteLogsAlertgroup +ListAlertgroups: Method for ListAlertgroups -Delete logs alert group config. +Get alert groups. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName @param instanceId @param projectId - @return ApiDeleteLogsAlertgroupRequest + @return ApiListAlertgroupsRequest */ -func (a *APIClient) DeleteLogsAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiDeleteLogsAlertgroupRequest { - return DeleteLogsAlertgroupRequest{ +func (a *APIClient) ListAlertgroups(ctx context.Context, instanceId string, projectId string) ApiListAlertgroupsRequest { + return ListAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) DeleteLogsAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := DeleteLogsAlertgroupRequest{ +func (a *APIClient) ListAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := ListAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type DeleteScrapeConfigRequest struct { +type ListAlertrecordsRequest struct { ctx context.Context apiService *DefaultApiService + groupName string instanceId string - jobName string projectId string } -func (r DeleteScrapeConfigRequest) Execute() (*DeleteScrapeConfigResponse, error) { +func (r ListAlertrecordsRequest) Execute() (*AlertRecordsResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *DeleteScrapeConfigResponse + localVarReturnValue *AlertRecordsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteScrapeConfig") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertrecords") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(r.jobName, "jobName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -4994,17 +12621,6 @@ func (r DeleteScrapeConfigRequest) Execute() (*DeleteScrapeConfigResponse, error } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -5023,66 +12639,66 @@ func (r DeleteScrapeConfigRequest) Execute() (*DeleteScrapeConfigResponse, error } /* -DeleteScrapeConfig: Method for DeleteScrapeConfig +ListAlertrecords: Method for ListAlertrecords -Delete scrape config. +Get alert records. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName @param instanceId - @param jobName @param projectId - @return ApiDeleteScrapeConfigRequest + @return ApiListAlertrecordsRequest */ -func (a *APIClient) DeleteScrapeConfig(ctx context.Context, instanceId string, jobName string, projectId string) ApiDeleteScrapeConfigRequest { - return DeleteScrapeConfigRequest{ +func (a *APIClient) ListAlertrecords(ctx context.Context, groupName string, instanceId string, projectId string) ApiListAlertrecordsRequest { + return ListAlertrecordsRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, - jobName: jobName, projectId: projectId, } } -func (a *APIClient) DeleteScrapeConfigExecute(ctx context.Context, instanceId string, jobName string, projectId string) (*DeleteScrapeConfigResponse, error) { - r := DeleteScrapeConfigRequest{ +func (a *APIClient) ListAlertrecordsExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) { + r := ListAlertrecordsRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, - jobName: jobName, projectId: projectId, } return r.Execute() } -type GetAlertConfigReceiverRequest struct { +type ListAlertrulesRequest struct { ctx context.Context apiService *DefaultApiService + groupName string instanceId string projectId string - receiver string } -func (r GetAlertConfigReceiverRequest) Execute() (*Receiver, error) { +func (r ListAlertrulesRequest) Execute() (*AlertRulesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Receiver + localVarReturnValue *AlertRulesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertConfigReceiver") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertrules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5146,17 +12762,6 @@ func (r GetAlertConfigReceiverRequest) Execute() (*Receiver, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -5175,66 +12780,64 @@ func (r GetAlertConfigReceiverRequest) Execute() (*Receiver, error) { } /* -GetAlertConfigReceiver: Method for GetAlertConfigReceiver +ListAlertrules: Method for ListAlertrules -Get alert config receivers. +Get alert rules. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName @param instanceId @param projectId - @param receiver - @return ApiGetAlertConfigReceiverRequest + @return ApiListAlertrulesRequest */ -func (a *APIClient) GetAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigReceiverRequest { - return GetAlertConfigReceiverRequest{ +func (a *APIClient) ListAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiListAlertrulesRequest { + return ListAlertrulesRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, - receiver: receiver, } } -func (a *APIClient) GetAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*Receiver, error) { - r := GetAlertConfigReceiverRequest{ +func (a *APIClient) ListAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { + r := ListAlertrulesRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, - receiver: receiver, } return r.Execute() } -type GetAlertConfigRouteRequest struct { +type ListBackupRetentionsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - receiver string } -func (r GetAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { +func (r ListBackupRetentionsRequest) Execute() (*BackupRetentionResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigRouteResponse + localVarReturnValue *BackupRetentionResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertConfigRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackupRetentions") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backup-retentions" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5316,62 +12919,67 @@ func (r GetAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) } /* -GetAlertConfigRoute: Method for GetAlertConfigRoute +ListBackupRetentions: Method for ListBackupRetentions -Get alert receiver for route. +Get backup retention. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param receiver - @return ApiGetAlertConfigRouteRequest + @return ApiListBackupRetentionsRequest */ -func (a *APIClient) GetAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiGetAlertConfigRouteRequest { - return GetAlertConfigRouteRequest{ +func (a *APIClient) ListBackupRetentions(ctx context.Context, instanceId string, projectId string) ApiListBackupRetentionsRequest { + return ListBackupRetentionsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } } -func (a *APIClient) GetAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) { - r := GetAlertConfigRouteRequest{ +func (a *APIClient) ListBackupRetentionsExecute(ctx context.Context, instanceId string, projectId string) (*BackupRetentionResponse, error) { + r := ListBackupRetentionsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } return r.Execute() } -type GetAlertConfigsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string +type ListBackupSchedulesRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + backupTarget *[]string } -func (r GetAlertConfigsRequest) Execute() (*GetAlertConfigsResponse, error) { +// List of backup targets + +func (r ListBackupSchedulesRequest) BackupTarget(backupTarget []string) ApiListBackupSchedulesRequest { + r.backupTarget = &backupTarget + return r +} + +func (r ListBackupSchedulesRequest) Execute() (*BackupScheduleResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetAlertConfigsResponse + localVarReturnValue *BackupScheduleResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertConfigs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackupSchedules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backup-schedules" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -5379,6 +12987,9 @@ func (r GetAlertConfigsRequest) Execute() (*GetAlertConfigsResponse, error) { localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.backupTarget != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backupTarget", r.backupTarget, "csv") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5455,17 +13066,17 @@ func (r GetAlertConfigsRequest) Execute() (*GetAlertConfigsResponse, error) { } /* -GetAlertConfigs: Method for GetAlertConfigs +ListBackupSchedules: Method for ListBackupSchedules -Get alert config. +Get backup schedules. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiGetAlertConfigsRequest + @return ApiListBackupSchedulesRequest */ -func (a *APIClient) GetAlertConfigs(ctx context.Context, instanceId string, projectId string) ApiGetAlertConfigsRequest { - return GetAlertConfigsRequest{ +func (a *APIClient) ListBackupSchedules(ctx context.Context, instanceId string, projectId string) ApiListBackupSchedulesRequest { + return ListBackupSchedulesRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -5473,8 +13084,8 @@ func (a *APIClient) GetAlertConfigs(ctx context.Context, instanceId string, proj } } -func (a *APIClient) GetAlertConfigsExecute(ctx context.Context, instanceId string, projectId string) (*GetAlertConfigsResponse, error) { - r := GetAlertConfigsRequest{ +func (a *APIClient) ListBackupSchedulesExecute(ctx context.Context, instanceId string, projectId string) (*BackupScheduleResponse, error) { + r := ListBackupSchedulesRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -5483,33 +13094,39 @@ func (a *APIClient) GetAlertConfigsExecute(ctx context.Context, instanceId strin return r.Execute() } -type GetAlertgroupRequest struct { - ctx context.Context - apiService *DefaultApiService - groupName string - instanceId string - projectId string +type ListBackupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + backupTarget *[]string } -func (r GetAlertgroupRequest) Execute() (*AlertGroupResponse, error) { +// List of backup targets + +func (r ListBackupsRequest) BackupTarget(backupTarget []string) ApiListBackupsRequest { + r.backupTarget = &backupTarget + return r +} + +func (r ListBackupsRequest) Execute() (*BackupResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupResponse + localVarReturnValue *BackupResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAlertgroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -5517,6 +13134,9 @@ func (r GetAlertgroupRequest) Execute() (*AlertGroupResponse, error) { localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.backupTarget != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backupTarget", r.backupTarget, "csv") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5566,17 +13186,6 @@ func (r GetAlertgroupRequest) Execute() (*AlertGroupResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5588,7 +13197,7 @@ func (r GetAlertgroupRequest) Execute() (*AlertGroupResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 502 { var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -5615,66 +13224,61 @@ func (r GetAlertgroupRequest) Execute() (*AlertGroupResponse, error) { } /* -GetAlertgroup: Method for GetAlertgroup +ListBackups: Method for ListBackups -Get alert group. +Get backups. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName @param instanceId @param projectId - @return ApiGetAlertgroupRequest + @return ApiListBackupsRequest */ -func (a *APIClient) GetAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiGetAlertgroupRequest { - return GetAlertgroupRequest{ +func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { + return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) GetAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupResponse, error) { - r := GetAlertgroupRequest{ +func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*BackupResponse, error) { + r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type GetCredentialsRequest struct { +type ListCertChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - username string } -func (r GetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { +func (r ListCertChecksRequest) Execute() (*CertCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCredentialsResponse + localVarReturnValue *CertCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCertChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/cert-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5729,8 +13333,8 @@ func (r GetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 400 { + var v []string err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5740,8 +13344,8 @@ func (r GetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v Message + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5767,66 +13371,61 @@ func (r GetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { } /* -GetCredentials: Method for GetCredentials +ListCertChecks: Method for ListCertChecks -Get single technical credentials. +Get all cert checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param username - @return ApiGetCredentialsRequest + @return ApiListCertChecksRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, instanceId string, projectId string, username string) ApiGetCredentialsRequest { - return GetCredentialsRequest{ +func (a *APIClient) ListCertChecks(ctx context.Context, instanceId string, projectId string) ApiListCertChecksRequest { + return ListCertChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } } -func (a *APIClient) GetCredentialsExecute(ctx context.Context, instanceId string, projectId string, username string) (*GetCredentialsResponse, error) { - r := GetCredentialsRequest{ +func (a *APIClient) ListCertChecksExecute(ctx context.Context, instanceId string, projectId string) (*CertCheckResponse, error) { + r := ListCertChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } return r.Execute() } -type GetCredentialsRemoteWriteConfigRequest struct { +type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string - username string } -func (r GetCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemoteWriteConfig, error) { +func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CredentialsRemoteWriteConfig + localVarReturnValue *ListCredentialsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsRemoteWriteConfig") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCredentials") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5882,29 +13481,7 @@ func (r GetCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemoteWri ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 502 { - var v Message + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5930,62 +13507,59 @@ func (r GetCredentialsRemoteWriteConfigRequest) Execute() (*CredentialsRemoteWri } /* -GetCredentialsRemoteWriteConfig: Method for GetCredentialsRemoteWriteConfig +ListCredentials: Method for ListCredentials -Get remote write config. +Get all technical user credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param username - @return ApiGetCredentialsRemoteWriteConfigRequest + @return ApiListCredentialsRequest */ -func (a *APIClient) GetCredentialsRemoteWriteConfig(ctx context.Context, instanceId string, projectId string, username string) ApiGetCredentialsRemoteWriteConfigRequest { - return GetCredentialsRemoteWriteConfigRequest{ +func (a *APIClient) ListCredentials(ctx context.Context, instanceId string, projectId string) ApiListCredentialsRequest { + return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } } -func (a *APIClient) GetCredentialsRemoteWriteConfigExecute(ctx context.Context, instanceId string, projectId string, username string) (*CredentialsRemoteWriteConfig, error) { - r := GetCredentialsRemoteWriteConfigRequest{ +func (a *APIClient) ListCredentialsExecute(ctx context.Context, instanceId string, projectId string) (*ListCredentialsResponse, error) { + r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - username: username, } return r.Execute() } -type GetGrafanaConfigsRequest struct { +type ListElasticsearchChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r GetGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) { +func (r ListElasticsearchChecksRequest) Execute() (*ElasticsearchCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GrafanaConfigs + localVarReturnValue *ElasticsearchCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetGrafanaConfigs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListElasticsearchChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/grafana-configs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/elasticsearch-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -6042,6 +13616,17 @@ func (r GetGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6069,17 +13654,17 @@ func (r GetGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) { } /* -GetGrafanaConfigs: Method for GetGrafanaConfigs +ListElasticsearchChecks: Method for ListElasticsearchChecks -Get grafana config. +Get all elasticsearch checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiGetGrafanaConfigsRequest + @return ApiListElasticsearchChecksRequest */ -func (a *APIClient) GetGrafanaConfigs(ctx context.Context, instanceId string, projectId string) ApiGetGrafanaConfigsRequest { - return GetGrafanaConfigsRequest{ +func (a *APIClient) ListElasticsearchChecks(ctx context.Context, instanceId string, projectId string) ApiListElasticsearchChecksRequest { + return ListElasticsearchChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6087,8 +13672,8 @@ func (a *APIClient) GetGrafanaConfigs(ctx context.Context, instanceId string, pr } } -func (a *APIClient) GetGrafanaConfigsExecute(ctx context.Context, instanceId string, projectId string) (*GrafanaConfigs, error) { - r := GetGrafanaConfigsRequest{ +func (a *APIClient) ListElasticsearchChecksExecute(ctx context.Context, instanceId string, projectId string) (*ElasticsearchCheckResponse, error) { + r := ListElasticsearchChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6097,31 +13682,31 @@ func (a *APIClient) GetGrafanaConfigsExecute(ctx context.Context, instanceId str return r.Execute() } -type GetInstanceRequest struct { +type ListHttpChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { +func (r ListHttpChecksRequest) Execute() (*HttpCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetInstanceResponse + localVarReturnValue *HttpCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListHttpChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/http-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -6178,6 +13763,17 @@ func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6205,17 +13801,17 @@ func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { } /* -GetInstance: Method for GetInstance +ListHttpChecks: Method for ListHttpChecks -Get instance information. +Get all http checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiGetInstanceRequest + @return ApiListHttpChecksRequest */ -func (a *APIClient) GetInstance(ctx context.Context, instanceId string, projectId string) ApiGetInstanceRequest { - return GetInstanceRequest{ +func (a *APIClient) ListHttpChecks(ctx context.Context, instanceId string, projectId string) ApiListHttpChecksRequest { + return ListHttpChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6223,8 +13819,8 @@ func (a *APIClient) GetInstance(ctx context.Context, instanceId string, projectI } } -func (a *APIClient) GetInstanceExecute(ctx context.Context, instanceId string, projectId string) (*GetInstanceResponse, error) { - r := GetInstanceRequest{ +func (a *APIClient) ListHttpChecksExecute(ctx context.Context, instanceId string, projectId string) (*HttpCheckResponse, error) { + r := ListHttpChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6233,34 +13829,30 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, instanceId string, p return r.Execute() } -type GetLogsAlertgroupRequest struct { +type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService - groupName string - instanceId string projectId string } -func (r GetLogsAlertgroupRequest) Execute() (*AlertGroupResponse, error) { +func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupResponse + localVarReturnValue *ListInstancesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLogsAlertgroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListInstances") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -6316,17 +13908,6 @@ func (r GetLogsAlertgroupRequest) Execute() (*AlertGroupResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6336,17 +13917,6 @@ func (r GetLogsAlertgroupRequest) Execute() (*AlertGroupResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -6365,62 +13935,56 @@ func (r GetLogsAlertgroupRequest) Execute() (*AlertGroupResponse, error) { } /* -GetLogsAlertgroup: Method for GetLogsAlertgroup +ListInstances: Method for ListInstances -Get logs alert group config. +Get all instances for a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName - @param instanceId @param projectId - @return ApiGetLogsAlertgroupRequest + @return ApiListInstancesRequest */ -func (a *APIClient) GetLogsAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiGetLogsAlertgroupRequest { - return GetLogsAlertgroupRequest{ +func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { + return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, - instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) GetLogsAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupResponse, error) { - r := GetLogsAlertgroupRequest{ +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { + r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, - instanceId: instanceId, projectId: projectId, } return r.Execute() } -type GetLogsConfigsRequest struct { +type ListLogsAlertgroupsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r GetLogsConfigsRequest) Execute() (*LogsConfigResponse, error) { +func (r ListLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *LogsConfigResponse + localVarReturnValue *AlertGroupsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLogsConfigs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLogsAlertgroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-configs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -6477,6 +14041,17 @@ func (r GetLogsConfigsRequest) Execute() (*LogsConfigResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6504,17 +14079,17 @@ func (r GetLogsConfigsRequest) Execute() (*LogsConfigResponse, error) { } /* -GetLogsConfigs: Method for GetLogsConfigs +ListLogsAlertgroups: Method for ListLogsAlertgroups -Get logs configuration. +Get logs alert groups config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiGetLogsConfigsRequest + @return ApiListLogsAlertgroupsRequest */ -func (a *APIClient) GetLogsConfigs(ctx context.Context, instanceId string, projectId string) ApiGetLogsConfigsRequest { - return GetLogsConfigsRequest{ +func (a *APIClient) ListLogsAlertgroups(ctx context.Context, instanceId string, projectId string) ApiListLogsAlertgroupsRequest { + return ListLogsAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6522,8 +14097,8 @@ func (a *APIClient) GetLogsConfigs(ctx context.Context, instanceId string, proje } } -func (a *APIClient) GetLogsConfigsExecute(ctx context.Context, instanceId string, projectId string) (*LogsConfigResponse, error) { - r := GetLogsConfigsRequest{ +func (a *APIClient) ListLogsAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := ListLogsAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6532,31 +14107,31 @@ func (a *APIClient) GetLogsConfigsExecute(ctx context.Context, instanceId string return r.Execute() } -type GetMetricsStorageRetentionRequest struct { +type ListMongodbChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r GetMetricsStorageRetentionRequest) Execute() (*GetMetricsStorageRetentionResponse, error) { +func (r ListMongodbChecksRequest) Execute() (*MongodbCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetMetricsStorageRetentionResponse + localVarReturnValue *MongodbCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMetricsStorageRetention") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMongodbChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/mongodb-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -6613,6 +14188,17 @@ func (r GetMetricsStorageRetentionRequest) Execute() (*GetMetricsStorageRetentio Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6640,17 +14226,17 @@ func (r GetMetricsStorageRetentionRequest) Execute() (*GetMetricsStorageRetentio } /* -GetMetricsStorageRetention: Method for GetMetricsStorageRetention +ListMongodbChecks: Method for ListMongodbChecks -Get metric storage retention time. +Get all mongodb checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiGetMetricsStorageRetentionRequest + @return ApiListMongodbChecksRequest */ -func (a *APIClient) GetMetricsStorageRetention(ctx context.Context, instanceId string, projectId string) ApiGetMetricsStorageRetentionRequest { - return GetMetricsStorageRetentionRequest{ +func (a *APIClient) ListMongodbChecks(ctx context.Context, instanceId string, projectId string) ApiListMongodbChecksRequest { + return ListMongodbChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6658,8 +14244,8 @@ func (a *APIClient) GetMetricsStorageRetention(ctx context.Context, instanceId s } } -func (a *APIClient) GetMetricsStorageRetentionExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsStorageRetentionResponse, error) { - r := GetMetricsStorageRetentionRequest{ +func (a *APIClient) ListMongodbChecksExecute(ctx context.Context, instanceId string, projectId string) (*MongodbCheckResponse, error) { + r := ListMongodbChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6668,34 +14254,32 @@ func (a *APIClient) GetMetricsStorageRetentionExecute(ctx context.Context, insta return r.Execute() } -type GetScrapeConfigRequest struct { +type ListMysqlChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string - jobName string projectId string } -func (r GetScrapeConfigRequest) Execute() (*GetScrapeConfigResponse, error) { +func (r ListMysqlChecksRequest) Execute() (*MysqlCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetScrapeConfigResponse + localVarReturnValue *MysqlCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetScrapeConfig") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMysqlChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/mysql-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(r.jobName, "jobName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -6751,6 +14335,17 @@ func (r GetScrapeConfigRequest) Execute() (*GetScrapeConfigResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6778,62 +14373,59 @@ func (r GetScrapeConfigRequest) Execute() (*GetScrapeConfigResponse, error) { } /* -GetScrapeConfig: Method for GetScrapeConfig +ListMysqlChecks: Method for ListMysqlChecks -Get scrape config. +Get all mysql checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId - @param jobName @param projectId - @return ApiGetScrapeConfigRequest + @return ApiListMysqlChecksRequest */ -func (a *APIClient) GetScrapeConfig(ctx context.Context, instanceId string, jobName string, projectId string) ApiGetScrapeConfigRequest { - return GetScrapeConfigRequest{ +func (a *APIClient) ListMysqlChecks(ctx context.Context, instanceId string, projectId string) ApiListMysqlChecksRequest { + return ListMysqlChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, - jobName: jobName, projectId: projectId, } } -func (a *APIClient) GetScrapeConfigExecute(ctx context.Context, instanceId string, jobName string, projectId string) (*GetScrapeConfigResponse, error) { - r := GetScrapeConfigRequest{ +func (a *APIClient) ListMysqlChecksExecute(ctx context.Context, instanceId string, projectId string) (*MysqlCheckResponse, error) { + r := ListMysqlChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, - jobName: jobName, projectId: projectId, } return r.Execute() } -type GetTracesConfigsRequest struct { +type ListNetworkChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r GetTracesConfigsRequest) Execute() (*TracesConfigResponse, error) { +func (r ListNetworkChecksRequest) Execute() (*NetworkCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *TracesConfigResponse + localVarReturnValue *NetworkCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTracesConfigs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/traces-configs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/network-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -6890,6 +14482,17 @@ func (r GetTracesConfigsRequest) Execute() (*TracesConfigResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6917,17 +14520,17 @@ func (r GetTracesConfigsRequest) Execute() (*TracesConfigResponse, error) { } /* -GetTracesConfigs: Method for GetTracesConfigs +ListNetworkChecks: Method for ListNetworkChecks -Get traces config. +Get all network checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiGetTracesConfigsRequest + @return ApiListNetworkChecksRequest */ -func (a *APIClient) GetTracesConfigs(ctx context.Context, instanceId string, projectId string) ApiGetTracesConfigsRequest { - return GetTracesConfigsRequest{ +func (a *APIClient) ListNetworkChecks(ctx context.Context, instanceId string, projectId string) ApiListNetworkChecksRequest { + return ListNetworkChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6935,8 +14538,8 @@ func (a *APIClient) GetTracesConfigs(ctx context.Context, instanceId string, pro } } -func (a *APIClient) GetTracesConfigsExecute(ctx context.Context, instanceId string, projectId string) (*TracesConfigResponse, error) { - r := GetTracesConfigsRequest{ +func (a *APIClient) ListNetworkChecksExecute(ctx context.Context, instanceId string, projectId string) (*NetworkCheckResponse, error) { + r := ListNetworkChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -6945,32 +14548,30 @@ func (a *APIClient) GetTracesConfigsExecute(ctx context.Context, instanceId stri return r.Execute() } -type ListACLRequest struct { +type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string } -func (r ListACLRequest) Execute() (*ListACLResponse, error) { +func (r ListOfferingsRequest) Execute() (*Offerings, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListACLResponse + localVarReturnValue *Offerings ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListACL") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListOfferings") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acl" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -7053,59 +14654,56 @@ func (r ListACLRequest) Execute() (*ListACLResponse, error) { } /* -ListACL: Method for ListACL +ListOfferings: Method for ListOfferings -Get acl for instance. +Get all plans. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId @param projectId - @return ApiListACLRequest + @return ApiListOfferingsRequest */ -func (a *APIClient) ListACL(ctx context.Context, instanceId string, projectId string) ApiListACLRequest { - return ListACLRequest{ +func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { + return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListACLExecute(ctx context.Context, instanceId string, projectId string) (*ListACLResponse, error) { - r := ListACLRequest{ +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*Offerings, error) { + r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, } return r.Execute() } -type ListAlertConfigReceiversRequest struct { +type ListPingChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r ListAlertConfigReceiversRequest) Execute() (*AlertConfigReceiversResponse, error) { +func (r ListPingChecksRequest) Execute() (*PingCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigReceiversResponse + localVarReturnValue *PingCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertConfigReceivers") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPingChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/ping-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -7162,6 +14760,17 @@ func (r ListAlertConfigReceiversRequest) Execute() (*AlertConfigReceiversRespons Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -7189,17 +14798,17 @@ func (r ListAlertConfigReceiversRequest) Execute() (*AlertConfigReceiversRespons } /* -ListAlertConfigReceivers: Method for ListAlertConfigReceivers +ListPingChecks: Method for ListPingChecks -Get alert config receivers. +Get all ping checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiListAlertConfigReceiversRequest + @return ApiListPingChecksRequest */ -func (a *APIClient) ListAlertConfigReceivers(ctx context.Context, instanceId string, projectId string) ApiListAlertConfigReceiversRequest { - return ListAlertConfigReceiversRequest{ +func (a *APIClient) ListPingChecks(ctx context.Context, instanceId string, projectId string) ApiListPingChecksRequest { + return ListPingChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7207,8 +14816,8 @@ func (a *APIClient) ListAlertConfigReceivers(ctx context.Context, instanceId str } } -func (a *APIClient) ListAlertConfigReceiversExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigReceiversResponse, error) { - r := ListAlertConfigReceiversRequest{ +func (a *APIClient) ListPingChecksExecute(ctx context.Context, instanceId string, projectId string) (*PingCheckResponse, error) { + r := ListPingChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7217,32 +14826,30 @@ func (a *APIClient) ListAlertConfigReceiversExecute(ctx context.Context, instanc return r.Execute() } -type ListAlertConfigRoutesRequest struct { +type ListPlansRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string } -func (r ListAlertConfigRoutesRequest) Execute() (*AlertConfigRouteResponse, error) { +func (r ListPlansRequest) Execute() (*PlansResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigRouteResponse + localVarReturnValue *PlansResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertConfigRoutes") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPlans") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/plans" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -7325,59 +14932,56 @@ func (r ListAlertConfigRoutesRequest) Execute() (*AlertConfigRouteResponse, erro } /* -ListAlertConfigRoutes: Method for ListAlertConfigRoutes +ListPlans: Method for ListPlans -Get alert config route. +Get all plans. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId @param projectId - @return ApiListAlertConfigRoutesRequest + @return ApiListPlansRequest */ -func (a *APIClient) ListAlertConfigRoutes(ctx context.Context, instanceId string, projectId string) ApiListAlertConfigRoutesRequest { - return ListAlertConfigRoutesRequest{ +func (a *APIClient) ListPlans(ctx context.Context, projectId string) ApiListPlansRequest { + return ListPlansRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListAlertConfigRoutesExecute(ctx context.Context, instanceId string, projectId string) (*AlertConfigRouteResponse, error) { - r := ListAlertConfigRoutesRequest{ +func (a *APIClient) ListPlansExecute(ctx context.Context, projectId string) (*PlansResponse, error) { + r := ListPlansRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, } return r.Execute() } -type ListAlertgroupsRequest struct { +type ListPostgresqlChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r ListAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r ListPostgresqlChecksRequest) Execute() (*PostgresqlCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *PostgresqlCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPostgresqlChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/postgresql-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -7435,7 +15039,7 @@ func (r ListAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v Error + var v []string err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -7472,17 +15076,17 @@ func (r ListAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } /* -ListAlertgroups: Method for ListAlertgroups +ListPostgresqlChecks: Method for ListPostgresqlChecks -Get alert groups. +Get all postgresql checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiListAlertgroupsRequest + @return ApiListPostgresqlChecksRequest */ -func (a *APIClient) ListAlertgroups(ctx context.Context, instanceId string, projectId string) ApiListAlertgroupsRequest { - return ListAlertgroupsRequest{ +func (a *APIClient) ListPostgresqlChecks(ctx context.Context, instanceId string, projectId string) ApiListPostgresqlChecksRequest { + return ListPostgresqlChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7490,8 +15094,8 @@ func (a *APIClient) ListAlertgroups(ctx context.Context, instanceId string, proj } } -func (a *APIClient) ListAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := ListAlertgroupsRequest{ +func (a *APIClient) ListPostgresqlChecksExecute(ctx context.Context, instanceId string, projectId string) (*PostgresqlCheckResponse, error) { + r := ListPostgresqlChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7500,33 +15104,31 @@ func (a *APIClient) ListAlertgroupsExecute(ctx context.Context, instanceId strin return r.Execute() } -type ListAlertrulesRequest struct { +type ListRabbitmqChecksRequest struct { ctx context.Context apiService *DefaultApiService - groupName string instanceId string projectId string } -func (r ListAlertrulesRequest) Execute() (*AlertRulesResponse, error) { +func (r ListRabbitmqChecksRequest) Execute() (*RabbitmqCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertRulesResponse + localVarReturnValue *RabbitmqCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAlertrules") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRabbitmqChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/rabbitmq-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -7583,6 +15185,17 @@ func (r ListAlertrulesRequest) Execute() (*AlertRulesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -7610,62 +15223,59 @@ func (r ListAlertrulesRequest) Execute() (*AlertRulesResponse, error) { } /* -ListAlertrules: Method for ListAlertrules +ListRabbitmqChecks: Method for ListRabbitmqChecks -Get alert rules. +Get all rabbitmq checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName @param instanceId @param projectId - @return ApiListAlertrulesRequest + @return ApiListRabbitmqChecksRequest */ -func (a *APIClient) ListAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiListAlertrulesRequest { - return ListAlertrulesRequest{ +func (a *APIClient) ListRabbitmqChecks(ctx context.Context, instanceId string, projectId string) ApiListRabbitmqChecksRequest { + return ListRabbitmqChecksRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { - r := ListAlertrulesRequest{ +func (a *APIClient) ListRabbitmqChecksExecute(ctx context.Context, instanceId string, projectId string) (*RabbitmqCheckResponse, error) { + r := ListRabbitmqChecksRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type ListCertChecksRequest struct { +type ListRedisChecksRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r ListCertChecksRequest) Execute() (*CertCheckResponse, error) { +func (r ListRedisChecksRequest) Execute() (*RedisCheckResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CertCheckResponse + localVarReturnValue *RedisCheckResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCertChecks") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRedisChecks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/cert-checks" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/redis-checks" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -7760,17 +15370,17 @@ func (r ListCertChecksRequest) Execute() (*CertCheckResponse, error) { } /* -ListCertChecks: Method for ListCertChecks +ListRedisChecks: Method for ListRedisChecks -Get all cert checks configured. +Get all redis checks configured. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiListCertChecksRequest + @return ApiListRedisChecksRequest */ -func (a *APIClient) ListCertChecks(ctx context.Context, instanceId string, projectId string) ApiListCertChecksRequest { - return ListCertChecksRequest{ +func (a *APIClient) ListRedisChecks(ctx context.Context, instanceId string, projectId string) ApiListRedisChecksRequest { + return ListRedisChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7778,8 +15388,8 @@ func (a *APIClient) ListCertChecks(ctx context.Context, instanceId string, proje } } -func (a *APIClient) ListCertChecksExecute(ctx context.Context, instanceId string, projectId string) (*CertCheckResponse, error) { - r := ListCertChecksRequest{ +func (a *APIClient) ListRedisChecksExecute(ctx context.Context, instanceId string, projectId string) (*RedisCheckResponse, error) { + r := ListRedisChecksRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7788,31 +15398,31 @@ func (a *APIClient) ListCertChecksExecute(ctx context.Context, instanceId string return r.Execute() } -type ListCredentialsRequest struct { +type ListScrapeConfigsRequest struct { ctx context.Context apiService *DefaultApiService instanceId string projectId string } -func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { +func (r ListScrapeConfigsRequest) Execute() (*ListScrapeConfigsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListCredentialsResponse + localVarReturnValue *ListScrapeConfigsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCredentials") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListScrapeConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -7896,17 +15506,17 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { } /* -ListCredentials: Method for ListCredentials +ListScrapeConfigs: Method for ListScrapeConfigs -Get all technical user credentials. +Get scrape configs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiListCredentialsRequest + @return ApiListScrapeConfigsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, instanceId string, projectId string) ApiListCredentialsRequest { - return ListCredentialsRequest{ +func (a *APIClient) ListScrapeConfigs(ctx context.Context, instanceId string, projectId string) ApiListScrapeConfigsRequest { + return ListScrapeConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7914,8 +15524,8 @@ func (a *APIClient) ListCredentials(ctx context.Context, instanceId string, proj } } -func (a *APIClient) ListCredentialsExecute(ctx context.Context, instanceId string, projectId string) (*ListCredentialsResponse, error) { - r := ListCredentialsRequest{ +func (a *APIClient) ListScrapeConfigsExecute(ctx context.Context, instanceId string, projectId string) (*ListScrapeConfigsResponse, error) { + r := ListScrapeConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -7924,40 +15534,49 @@ func (a *APIClient) ListCredentialsExecute(ctx context.Context, instanceId strin return r.Execute() } -type ListHttpChecksRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string +type PartialUpdateAlertgroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + updateAlertgroupsRequestInner *[]UpdateAlertgroupsRequestInner } -func (r ListHttpChecksRequest) Execute() (*HttpCheckResponse, error) { +func (r PartialUpdateAlertgroupsRequest) UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner []UpdateAlertgroupsRequestInner) ApiPartialUpdateAlertgroupsRequest { + r.updateAlertgroupsRequestInner = &updateAlertgroupsRequestInner + return r +} + +func (r PartialUpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *HttpCheckResponse + localVarReturnValue *AlertGroupsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListHttpChecks") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateAlertgroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/http-checks" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.updateAlertgroupsRequestInner == nil { + return localVarReturnValue, fmt.Errorf("updateAlertgroupsRequestInner is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -7973,6 +15592,8 @@ func (r ListHttpChecksRequest) Execute() (*HttpCheckResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateAlertgroupsRequestInner req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8006,7 +15627,7 @@ func (r ListHttpChecksRequest) Execute() (*HttpCheckResponse, error) { ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v []string + var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -8043,17 +15664,17 @@ func (r ListHttpChecksRequest) Execute() (*HttpCheckResponse, error) { } /* -ListHttpChecks: Method for ListHttpChecks +PartialUpdateAlertgroups: Method for PartialUpdateAlertgroups -Get all http checks configured. +Patch alert groups. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiListHttpChecksRequest + @return ApiPartialUpdateAlertgroupsRequest */ -func (a *APIClient) ListHttpChecks(ctx context.Context, instanceId string, projectId string) ApiListHttpChecksRequest { - return ListHttpChecksRequest{ +func (a *APIClient) PartialUpdateAlertgroups(ctx context.Context, instanceId string, projectId string) ApiPartialUpdateAlertgroupsRequest { + return PartialUpdateAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -8061,8 +15682,8 @@ func (a *APIClient) ListHttpChecks(ctx context.Context, instanceId string, proje } } -func (a *APIClient) ListHttpChecksExecute(ctx context.Context, instanceId string, projectId string) (*HttpCheckResponse, error) { - r := ListHttpChecksRequest{ +func (a *APIClient) PartialUpdateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := PartialUpdateAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -8071,38 +15692,51 @@ func (a *APIClient) ListHttpChecksExecute(ctx context.Context, instanceId string return r.Execute() } -type ListInstancesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type PartialUpdateAlertrecordsRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + partialUpdateAlertrecordsRequestInner *[]PartialUpdateAlertrecordsRequestInner } -func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { +func (r PartialUpdateAlertrecordsRequest) PartialUpdateAlertrecordsRequestInner(partialUpdateAlertrecordsRequestInner []PartialUpdateAlertrecordsRequestInner) ApiPartialUpdateAlertrecordsRequest { + r.partialUpdateAlertrecordsRequestInner = &partialUpdateAlertrecordsRequestInner + return r +} + +func (r PartialUpdateAlertrecordsRequest) Execute() (*AlertRecordsResponse, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListInstancesResponse + localVarReturnValue *AlertRecordsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListInstances") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateAlertrecords") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.partialUpdateAlertrecordsRequestInner == nil { + return localVarReturnValue, fmt.Errorf("partialUpdateAlertrecordsRequestInner is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -8118,6 +15752,8 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.partialUpdateAlertrecordsRequestInner req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8150,6 +15786,17 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -8177,65 +15824,82 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { } /* -ListInstances: Method for ListInstances +PartialUpdateAlertrecords: Method for PartialUpdateAlertrecords -Get all instances for a project. +Patch alert records. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName + @param instanceId @param projectId - @return ApiListInstancesRequest + @return ApiPartialUpdateAlertrecordsRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { - return ListInstancesRequest{ +func (a *APIClient) PartialUpdateAlertrecords(ctx context.Context, groupName string, instanceId string, projectId string) ApiPartialUpdateAlertrecordsRequest { + return PartialUpdateAlertrecordsRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, + instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { - r := ListInstancesRequest{ +func (a *APIClient) PartialUpdateAlertrecordsExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) { + r := PartialUpdateAlertrecordsRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, + instanceId: instanceId, projectId: projectId, } return r.Execute() } -type ListLogsAlertgroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string +type PartialUpdateAlertrulesRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + partialUpdateAlertrulesRequestInner *[]PartialUpdateAlertrulesRequestInner } -func (r ListLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r PartialUpdateAlertrulesRequest) PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner []PartialUpdateAlertrulesRequestInner) ApiPartialUpdateAlertrulesRequest { + r.partialUpdateAlertrulesRequestInner = &partialUpdateAlertrulesRequestInner + return r +} + +func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *AlertRulesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLogsAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateAlertrules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.partialUpdateAlertrulesRequestInner == nil { + return localVarReturnValue, fmt.Errorf("partialUpdateAlertrulesRequestInner is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -8251,6 +15915,8 @@ func (r ListLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.partialUpdateAlertrulesRequestInner req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8321,66 +15987,80 @@ func (r ListLogsAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } /* -ListLogsAlertgroups: Method for ListLogsAlertgroups +PartialUpdateAlertrules: Method for PartialUpdateAlertrules -Get logs alert groups config. +Patch alert rules. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName @param instanceId @param projectId - @return ApiListLogsAlertgroupsRequest + @return ApiPartialUpdateAlertrulesRequest */ -func (a *APIClient) ListLogsAlertgroups(ctx context.Context, instanceId string, projectId string) ApiListLogsAlertgroupsRequest { - return ListLogsAlertgroupsRequest{ +func (a *APIClient) PartialUpdateAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiPartialUpdateAlertrulesRequest { + return PartialUpdateAlertrulesRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListLogsAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := ListLogsAlertgroupsRequest{ +func (a *APIClient) PartialUpdateAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { + r := PartialUpdateAlertrulesRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type ListPlansRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type PartialUpdateScrapeConfigsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + partialUpdateScrapeConfigsRequestInner *[]PartialUpdateScrapeConfigsRequestInner } -func (r ListPlansRequest) Execute() (*PlansResponse, error) { +func (r PartialUpdateScrapeConfigsRequest) PartialUpdateScrapeConfigsRequestInner(partialUpdateScrapeConfigsRequestInner []PartialUpdateScrapeConfigsRequestInner) ApiPartialUpdateScrapeConfigsRequest { + r.partialUpdateScrapeConfigsRequestInner = &partialUpdateScrapeConfigsRequestInner + return r +} + +func (r PartialUpdateScrapeConfigsRequest) Execute() (*ScrapeConfigsResponse, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PlansResponse + localVarReturnValue *ScrapeConfigsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPlans") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateScrapeConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/plans" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.partialUpdateScrapeConfigsRequestInner == nil { + return localVarReturnValue, fmt.Errorf("partialUpdateScrapeConfigsRequestInner is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -8396,6 +16076,8 @@ func (r ListPlansRequest) Execute() (*PlansResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.partialUpdateScrapeConfigsRequestInner req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8428,6 +16110,17 @@ func (r ListPlansRequest) Execute() (*PlansResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -8455,63 +16148,80 @@ func (r ListPlansRequest) Execute() (*PlansResponse, error) { } /* -ListPlans: Method for ListPlans +PartialUpdateScrapeConfigs: Method for PartialUpdateScrapeConfigs -Get all plans. +Update scrape configs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId @param projectId - @return ApiListPlansRequest + @return ApiPartialUpdateScrapeConfigsRequest */ -func (a *APIClient) ListPlans(ctx context.Context, projectId string) ApiListPlansRequest { - return ListPlansRequest{ +func (a *APIClient) PartialUpdateScrapeConfigs(ctx context.Context, instanceId string, projectId string) ApiPartialUpdateScrapeConfigsRequest { + return PartialUpdateScrapeConfigsRequest{ apiService: a.defaultApi, ctx: ctx, + instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListPlansExecute(ctx context.Context, projectId string) (*PlansResponse, error) { - r := ListPlansRequest{ +func (a *APIClient) PartialUpdateScrapeConfigsExecute(ctx context.Context, instanceId string, projectId string) (*ScrapeConfigsResponse, error) { + r := PartialUpdateScrapeConfigsRequest{ apiService: a.defaultApi, ctx: ctx, + instanceId: instanceId, projectId: projectId, } return r.Execute() } -type ListScrapeConfigsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string +type RestoreBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + backupDate string + instanceId string + projectId string + restoreTarget *string } -func (r ListScrapeConfigsRequest) Execute() (*ListScrapeConfigsResponse, error) { +// List of restore targets + +func (r RestoreBackupRequest) RestoreTarget(restoreTarget string) ApiRestoreBackupRequest { + r.restoreTarget = &restoreTarget + return r +} + +func (r RestoreBackupRequest) Execute() (*Message, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListScrapeConfigsResponse + localVarReturnValue *Message ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListScrapeConfigs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RestoreBackup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backup-restores/{backupDate}" + localVarPath = strings.Replace(localVarPath, "{"+"backupDate"+"}", url.PathEscape(ParameterValueToString(r.backupDate, "backupDate")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.restoreTarget == nil { + return localVarReturnValue, fmt.Errorf("restoreTarget is required and must be specified") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "restoreTarget", r.restoreTarget, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8570,6 +16280,17 @@ func (r ListScrapeConfigsRequest) Execute() (*ListScrapeConfigsResponse, error) } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -8588,74 +16309,74 @@ func (r ListScrapeConfigsRequest) Execute() (*ListScrapeConfigsResponse, error) } /* -ListScrapeConfigs: Method for ListScrapeConfigs +RestoreBackup: Method for RestoreBackup -Get scrape configs. +Restore backup. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param backupDate @param instanceId @param projectId - @return ApiListScrapeConfigsRequest + @return ApiRestoreBackupRequest */ -func (a *APIClient) ListScrapeConfigs(ctx context.Context, instanceId string, projectId string) ApiListScrapeConfigsRequest { - return ListScrapeConfigsRequest{ +func (a *APIClient) RestoreBackup(ctx context.Context, backupDate string, instanceId string, projectId string) ApiRestoreBackupRequest { + return RestoreBackupRequest{ apiService: a.defaultApi, ctx: ctx, + backupDate: backupDate, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) ListScrapeConfigsExecute(ctx context.Context, instanceId string, projectId string) (*ListScrapeConfigsResponse, error) { - r := ListScrapeConfigsRequest{ +func (a *APIClient) RestoreBackupExecute(ctx context.Context, backupDate string, instanceId string, projectId string) (*Message, error) { + r := RestoreBackupRequest{ apiService: a.defaultApi, ctx: ctx, + backupDate: backupDate, instanceId: instanceId, projectId: projectId, } return r.Execute() } -type PartialUpdateAlertgroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - updateAlertgroupsRequestInner *[]UpdateAlertgroupsRequestInner +type UpdateACLRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + updateACLPayload *UpdateACLPayload } -func (r PartialUpdateAlertgroupsRequest) UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner []UpdateAlertgroupsRequestInner) ApiPartialUpdateAlertgroupsRequest { - r.updateAlertgroupsRequestInner = &updateAlertgroupsRequestInner +func (r UpdateACLRequest) UpdateACLPayload(updateACLPayload UpdateACLPayload) ApiUpdateACLRequest { + r.updateACLPayload = &updateACLPayload return r } -func (r PartialUpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r UpdateACLRequest) Execute() (*Message, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *Message ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateACL") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acl" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertgroupsRequestInner == nil { - return localVarReturnValue, fmt.Errorf("updateAlertgroupsRequestInner is required and must be specified") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -8675,7 +16396,7 @@ func (r PartialUpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertgroupsRequestInner + localVarPostBody = r.updateACLPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8746,17 +16467,17 @@ func (r PartialUpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) } /* -PartialUpdateAlertgroups: Method for PartialUpdateAlertgroups +UpdateACL: Method for UpdateACL -Patch alert groups. +Update acl config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiPartialUpdateAlertgroupsRequest + @return ApiUpdateACLRequest */ -func (a *APIClient) PartialUpdateAlertgroups(ctx context.Context, instanceId string, projectId string) ApiPartialUpdateAlertgroupsRequest { - return PartialUpdateAlertgroupsRequest{ +func (a *APIClient) UpdateACL(ctx context.Context, instanceId string, projectId string) ApiUpdateACLRequest { + return UpdateACLRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -8764,8 +16485,8 @@ func (a *APIClient) PartialUpdateAlertgroups(ctx context.Context, instanceId str } } -func (a *APIClient) PartialUpdateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := PartialUpdateAlertgroupsRequest{ +func (a *APIClient) UpdateACLExecute(ctx context.Context, instanceId string, projectId string) (*Message, error) { + r := UpdateACLRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -8774,47 +16495,47 @@ func (a *APIClient) PartialUpdateAlertgroupsExecute(ctx context.Context, instanc return r.Execute() } -type PartialUpdateAlertrulesRequest struct { - ctx context.Context - apiService *DefaultApiService - groupName string - instanceId string - projectId string - partialUpdateAlertrulesRequestInner *[]PartialUpdateAlertrulesRequestInner +type UpdateAlertConfigReceiverRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + receiver string + updateAlertConfigReceiverPayload *UpdateAlertConfigReceiverPayload } -func (r PartialUpdateAlertrulesRequest) PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner []PartialUpdateAlertrulesRequestInner) ApiPartialUpdateAlertrulesRequest { - r.partialUpdateAlertrulesRequestInner = &partialUpdateAlertrulesRequestInner +func (r UpdateAlertConfigReceiverRequest) UpdateAlertConfigReceiverPayload(updateAlertConfigReceiverPayload UpdateAlertConfigReceiverPayload) ApiUpdateAlertConfigReceiverRequest { + r.updateAlertConfigReceiverPayload = &updateAlertConfigReceiverPayload return r } -func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { +func (r UpdateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversResponse, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertRulesResponse + localVarReturnValue *AlertConfigReceiversResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateAlertrules") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertConfigReceiver") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.partialUpdateAlertrulesRequestInner == nil { - return localVarReturnValue, fmt.Errorf("partialUpdateAlertrulesRequestInner is required and must be specified") + if r.updateAlertConfigReceiverPayload == nil { + return localVarReturnValue, fmt.Errorf("updateAlertConfigReceiverPayload is required and must be specified") } // to determine the Content-Type header @@ -8835,7 +16556,7 @@ func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.partialUpdateAlertrulesRequestInner + localVarPostBody = r.updateAlertConfigReceiverPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8888,6 +16609,17 @@ func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -8906,74 +16638,79 @@ func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { } /* -PartialUpdateAlertrules: Method for PartialUpdateAlertrules +UpdateAlertConfigReceiver: Method for UpdateAlertConfigReceiver -Patch alert rules. +Update alert config receiver. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param groupName @param instanceId @param projectId - @return ApiPartialUpdateAlertrulesRequest + @param receiver + @return ApiUpdateAlertConfigReceiverRequest */ -func (a *APIClient) PartialUpdateAlertrules(ctx context.Context, groupName string, instanceId string, projectId string) ApiPartialUpdateAlertrulesRequest { - return PartialUpdateAlertrulesRequest{ +func (a *APIClient) UpdateAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiUpdateAlertConfigReceiverRequest { + return UpdateAlertConfigReceiverRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, + receiver: receiver, } } -func (a *APIClient) PartialUpdateAlertrulesExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { - r := PartialUpdateAlertrulesRequest{ +func (a *APIClient) UpdateAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigReceiversResponse, error) { + r := UpdateAlertConfigReceiverRequest{ apiService: a.defaultApi, ctx: ctx, - groupName: groupName, instanceId: instanceId, projectId: projectId, + receiver: receiver, } return r.Execute() } -type UpdateACLRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - updateACLPayload *UpdateACLPayload +type UpdateAlertConfigRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + receiver string + updateAlertConfigRoutePayload *UpdateAlertConfigRoutePayload } -func (r UpdateACLRequest) UpdateACLPayload(updateACLPayload UpdateACLPayload) ApiUpdateACLRequest { - r.updateACLPayload = &updateACLPayload +func (r UpdateAlertConfigRouteRequest) UpdateAlertConfigRoutePayload(updateAlertConfigRoutePayload UpdateAlertConfigRoutePayload) ApiUpdateAlertConfigRouteRequest { + r.updateAlertConfigRoutePayload = &updateAlertConfigRoutePayload return r } -func (r UpdateACLRequest) Execute() (*Message, error) { +func (r UpdateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Message + localVarReturnValue *AlertConfigRouteResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateACL") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertConfigRoute") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acl" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.updateAlertConfigRoutePayload == nil { + return localVarReturnValue, fmt.Errorf("updateAlertConfigRoutePayload is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -8993,7 +16730,7 @@ func (r UpdateACLRequest) Execute() (*Message, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateACLPayload + localVarPostBody = r.updateAlertConfigRoutePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -9046,6 +16783,17 @@ func (r UpdateACLRequest) Execute() (*Message, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -9064,75 +16812,76 @@ func (r UpdateACLRequest) Execute() (*Message, error) { } /* -UpdateACL: Method for UpdateACL +UpdateAlertConfigRoute: Method for UpdateAlertConfigRoute -Update acl config. +Update alert receiver for route. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiUpdateACLRequest + @param receiver + @return ApiUpdateAlertConfigRouteRequest */ -func (a *APIClient) UpdateACL(ctx context.Context, instanceId string, projectId string) ApiUpdateACLRequest { - return UpdateACLRequest{ +func (a *APIClient) UpdateAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiUpdateAlertConfigRouteRequest { + return UpdateAlertConfigRouteRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + receiver: receiver, } } -func (a *APIClient) UpdateACLExecute(ctx context.Context, instanceId string, projectId string) (*Message, error) { - r := UpdateACLRequest{ +func (a *APIClient) UpdateAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) { + r := UpdateAlertConfigRouteRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, + receiver: receiver, } return r.Execute() } -type UpdateAlertConfigReceiverRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - receiver string - updateAlertConfigReceiverPayload *UpdateAlertConfigReceiverPayload +type UpdateAlertConfigsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + updateAlertConfigsPayload *UpdateAlertConfigsPayload } -func (r UpdateAlertConfigReceiverRequest) UpdateAlertConfigReceiverPayload(updateAlertConfigReceiverPayload UpdateAlertConfigReceiverPayload) ApiUpdateAlertConfigReceiverRequest { - r.updateAlertConfigReceiverPayload = &updateAlertConfigReceiverPayload +func (r UpdateAlertConfigsRequest) UpdateAlertConfigsPayload(updateAlertConfigsPayload UpdateAlertConfigsPayload) ApiUpdateAlertConfigsRequest { + r.updateAlertConfigsPayload = &updateAlertConfigsPayload return r } -func (r UpdateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversResponse, error) { +func (r UpdateAlertConfigsRequest) Execute() (*UpdateAlertConfigsResponse, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigReceiversResponse + localVarReturnValue *UpdateAlertConfigsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertConfigReceiver") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertConfigs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertConfigReceiverPayload == nil { - return localVarReturnValue, fmt.Errorf("updateAlertConfigReceiverPayload is required and must be specified") + if r.updateAlertConfigsPayload == nil { + return localVarReturnValue, fmt.Errorf("updateAlertConfigsPayload is required and must be specified") } // to determine the Content-Type header @@ -9153,7 +16902,7 @@ func (r UpdateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertConfigReceiverPayload + localVarPostBody = r.updateAlertConfigsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -9206,17 +16955,6 @@ func (r UpdateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Message - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -9235,78 +16973,75 @@ func (r UpdateAlertConfigReceiverRequest) Execute() (*AlertConfigReceiversRespon } /* -UpdateAlertConfigReceiver: Method for UpdateAlertConfigReceiver +UpdateAlertConfigs: Method for UpdateAlertConfigs -Update alert config receiver. +Update alert config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @param receiver - @return ApiUpdateAlertConfigReceiverRequest + @return ApiUpdateAlertConfigsRequest */ -func (a *APIClient) UpdateAlertConfigReceiver(ctx context.Context, instanceId string, projectId string, receiver string) ApiUpdateAlertConfigReceiverRequest { - return UpdateAlertConfigReceiverRequest{ +func (a *APIClient) UpdateAlertConfigs(ctx context.Context, instanceId string, projectId string) ApiUpdateAlertConfigsRequest { + return UpdateAlertConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } } -func (a *APIClient) UpdateAlertConfigReceiverExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigReceiversResponse, error) { - r := UpdateAlertConfigReceiverRequest{ +func (a *APIClient) UpdateAlertConfigsExecute(ctx context.Context, instanceId string, projectId string) (*UpdateAlertConfigsResponse, error) { + r := UpdateAlertConfigsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, projectId: projectId, - receiver: receiver, } return r.Execute() } -type UpdateAlertConfigRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - receiver string - updateAlertConfigRoutePayload *UpdateAlertConfigRoutePayload +type UpdateAlertgroupRequest struct { + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + updateAlertgroupPayload *UpdateAlertgroupPayload } -func (r UpdateAlertConfigRouteRequest) UpdateAlertConfigRoutePayload(updateAlertConfigRoutePayload UpdateAlertConfigRoutePayload) ApiUpdateAlertConfigRouteRequest { - r.updateAlertConfigRoutePayload = &updateAlertConfigRoutePayload +func (r UpdateAlertgroupRequest) UpdateAlertgroupPayload(updateAlertgroupPayload UpdateAlertgroupPayload) ApiUpdateAlertgroupRequest { + r.updateAlertgroupPayload = &updateAlertgroupPayload return r } -func (r UpdateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, error) { +func (r UpdateAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertConfigRouteResponse + localVarReturnValue *AlertGroupsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertConfigRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertgroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(r.receiver, "receiver")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertConfigRoutePayload == nil { - return localVarReturnValue, fmt.Errorf("updateAlertConfigRoutePayload is required and must be specified") + if r.updateAlertgroupPayload == nil { + return localVarReturnValue, fmt.Errorf("updateAlertgroupPayload is required and must be specified") } // to determine the Content-Type header @@ -9327,7 +17062,7 @@ func (r UpdateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertConfigRoutePayload + localVarPostBody = r.updateAlertgroupPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -9361,7 +17096,7 @@ func (r UpdateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v Error + var v Message err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -9409,76 +17144,76 @@ func (r UpdateAlertConfigRouteRequest) Execute() (*AlertConfigRouteResponse, err } /* -UpdateAlertConfigRoute: Method for UpdateAlertConfigRoute +UpdateAlertgroup: Method for UpdateAlertgroup -Update alert receiver for route. +Update alert group config. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupName @param instanceId @param projectId - @param receiver - @return ApiUpdateAlertConfigRouteRequest + @return ApiUpdateAlertgroupRequest */ -func (a *APIClient) UpdateAlertConfigRoute(ctx context.Context, instanceId string, projectId string, receiver string) ApiUpdateAlertConfigRouteRequest { - return UpdateAlertConfigRouteRequest{ +func (a *APIClient) UpdateAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiUpdateAlertgroupRequest { + return UpdateAlertgroupRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, - receiver: receiver, } } -func (a *APIClient) UpdateAlertConfigRouteExecute(ctx context.Context, instanceId string, projectId string, receiver string) (*AlertConfigRouteResponse, error) { - r := UpdateAlertConfigRouteRequest{ +func (a *APIClient) UpdateAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := UpdateAlertgroupRequest{ apiService: a.defaultApi, ctx: ctx, + groupName: groupName, instanceId: instanceId, projectId: projectId, - receiver: receiver, } return r.Execute() } -type UpdateAlertConfigsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - updateAlertConfigsPayload *UpdateAlertConfigsPayload +type UpdateAlertgroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string + updateAlertgroupsRequestInner *[]UpdateAlertgroupsRequestInner } -func (r UpdateAlertConfigsRequest) UpdateAlertConfigsPayload(updateAlertConfigsPayload UpdateAlertConfigsPayload) ApiUpdateAlertConfigsRequest { - r.updateAlertConfigsPayload = &updateAlertConfigsPayload +func (r UpdateAlertgroupsRequest) UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner []UpdateAlertgroupsRequestInner) ApiUpdateAlertgroupsRequest { + r.updateAlertgroupsRequestInner = &updateAlertgroupsRequestInner return r } -func (r UpdateAlertConfigsRequest) Execute() (*UpdateAlertConfigsResponse, error) { +func (r UpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *UpdateAlertConfigsResponse + localVarReturnValue *AlertGroupsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertConfigs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertgroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertConfigsPayload == nil { - return localVarReturnValue, fmt.Errorf("updateAlertConfigsPayload is required and must be specified") + if r.updateAlertgroupsRequestInner == nil { + return localVarReturnValue, fmt.Errorf("updateAlertgroupsRequestInner is required and must be specified") } // to determine the Content-Type header @@ -9499,7 +17234,7 @@ func (r UpdateAlertConfigsRequest) Execute() (*UpdateAlertConfigsResponse, error localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertConfigsPayload + localVarPostBody = r.updateAlertgroupsRequestInner req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -9570,17 +17305,17 @@ func (r UpdateAlertConfigsRequest) Execute() (*UpdateAlertConfigsResponse, error } /* -UpdateAlertConfigs: Method for UpdateAlertConfigs +UpdateAlertgroups: Method for UpdateAlertgroups -Update alert config. +Update alert groups. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId @param projectId - @return ApiUpdateAlertConfigsRequest + @return ApiUpdateAlertgroupsRequest */ -func (a *APIClient) UpdateAlertConfigs(ctx context.Context, instanceId string, projectId string) ApiUpdateAlertConfigsRequest { - return UpdateAlertConfigsRequest{ +func (a *APIClient) UpdateAlertgroups(ctx context.Context, instanceId string, projectId string) ApiUpdateAlertgroupsRequest { + return UpdateAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -9588,8 +17323,8 @@ func (a *APIClient) UpdateAlertConfigs(ctx context.Context, instanceId string, p } } -func (a *APIClient) UpdateAlertConfigsExecute(ctx context.Context, instanceId string, projectId string) (*UpdateAlertConfigsResponse, error) { - r := UpdateAlertConfigsRequest{ +func (a *APIClient) UpdateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { + r := UpdateAlertgroupsRequest{ apiService: a.defaultApi, ctx: ctx, instanceId: instanceId, @@ -9598,38 +17333,40 @@ func (a *APIClient) UpdateAlertConfigsExecute(ctx context.Context, instanceId st return r.Execute() } -type UpdateAlertgroupRequest struct { - ctx context.Context - apiService *DefaultApiService - groupName string - instanceId string - projectId string - updateAlertgroupPayload *UpdateAlertgroupPayload +type UpdateAlertrecordRequest struct { + ctx context.Context + apiService *DefaultApiService + alertRecord string + groupName string + instanceId string + projectId string + updateAlertrecordPayload *UpdateAlertrecordPayload } -func (r UpdateAlertgroupRequest) UpdateAlertgroupPayload(updateAlertgroupPayload UpdateAlertgroupPayload) ApiUpdateAlertgroupRequest { - r.updateAlertgroupPayload = &updateAlertgroupPayload +func (r UpdateAlertrecordRequest) UpdateAlertrecordPayload(updateAlertrecordPayload UpdateAlertrecordPayload) ApiUpdateAlertrecordRequest { + r.updateAlertrecordPayload = &updateAlertrecordPayload return r } -func (r UpdateAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { +func (r UpdateAlertrecordRequest) Execute() (*AlertRecordsResponse, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *AlertRecordsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertgroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertrecord") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records/{alertRecord}" + localVarPath = strings.Replace(localVarPath, "{"+"alertRecord"+"}", url.PathEscape(ParameterValueToString(r.alertRecord, "alertRecord")), -1) localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) @@ -9637,8 +17374,8 @@ func (r UpdateAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertgroupPayload == nil { - return localVarReturnValue, fmt.Errorf("updateAlertgroupPayload is required and must be specified") + if r.updateAlertrecordPayload == nil { + return localVarReturnValue, fmt.Errorf("updateAlertrecordPayload is required and must be specified") } // to determine the Content-Type header @@ -9659,7 +17396,7 @@ func (r UpdateAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertgroupPayload + localVarPostBody = r.updateAlertrecordPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -9693,7 +17430,7 @@ func (r UpdateAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v Message + var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -9741,76 +17478,83 @@ func (r UpdateAlertgroupRequest) Execute() (*AlertGroupsResponse, error) { } /* -UpdateAlertgroup: Method for UpdateAlertgroup +UpdateAlertrecord: Method for UpdateAlertrecord -Update alert group config. +Update alert record. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertRecord @param groupName @param instanceId @param projectId - @return ApiUpdateAlertgroupRequest + @return ApiUpdateAlertrecordRequest */ -func (a *APIClient) UpdateAlertgroup(ctx context.Context, groupName string, instanceId string, projectId string) ApiUpdateAlertgroupRequest { - return UpdateAlertgroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - groupName: groupName, - instanceId: instanceId, - projectId: projectId, - } -} - -func (a *APIClient) UpdateAlertgroupExecute(ctx context.Context, groupName string, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := UpdateAlertgroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - groupName: groupName, - instanceId: instanceId, - projectId: projectId, +func (a *APIClient) UpdateAlertrecord(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) ApiUpdateAlertrecordRequest { + return UpdateAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertRecord: alertRecord, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) UpdateAlertrecordExecute(ctx context.Context, alertRecord string, groupName string, instanceId string, projectId string) (*AlertRecordsResponse, error) { + r := UpdateAlertrecordRequest{ + apiService: a.defaultApi, + ctx: ctx, + alertRecord: alertRecord, + groupName: groupName, + instanceId: instanceId, + projectId: projectId, } return r.Execute() } -type UpdateAlertgroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - instanceId string - projectId string - updateAlertgroupsRequestInner *[]UpdateAlertgroupsRequestInner +type UpdateAlertruleRequest struct { + ctx context.Context + apiService *DefaultApiService + alertName string + groupName string + instanceId string + projectId string + updateAlertrulePayload *UpdateAlertrulePayload } -func (r UpdateAlertgroupsRequest) UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner []UpdateAlertgroupsRequestInner) ApiUpdateAlertgroupsRequest { - r.updateAlertgroupsRequestInner = &updateAlertgroupsRequestInner +func (r UpdateAlertruleRequest) UpdateAlertrulePayload(updateAlertrulePayload UpdateAlertrulePayload) ApiUpdateAlertruleRequest { + r.updateAlertrulePayload = &updateAlertrulePayload return r } -func (r UpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { +func (r UpdateAlertruleRequest) Execute() (*AlertRulesResponse, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AlertGroupsResponse + localVarReturnValue *AlertRulesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertgroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAlertrule") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules/{alertName}" + localVarPath = strings.Replace(localVarPath, "{"+"alertName"+"}", url.PathEscape(ParameterValueToString(r.alertName, "alertName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(r.groupName, "groupName")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertgroupsRequestInner == nil { - return localVarReturnValue, fmt.Errorf("updateAlertgroupsRequestInner is required and must be specified") + if r.updateAlertrulePayload == nil { + return localVarReturnValue, fmt.Errorf("updateAlertrulePayload is required and must be specified") } // to determine the Content-Type header @@ -9831,7 +17575,7 @@ func (r UpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertgroupsRequestInner + localVarPostBody = r.updateAlertrulePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -9884,6 +17628,17 @@ func (r UpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Message + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -9902,28 +17657,34 @@ func (r UpdateAlertgroupsRequest) Execute() (*AlertGroupsResponse, error) { } /* -UpdateAlertgroups: Method for UpdateAlertgroups +UpdateAlertrule: Method for UpdateAlertrule -Update alert groups. +Update alert rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param alertName + @param groupName @param instanceId @param projectId - @return ApiUpdateAlertgroupsRequest + @return ApiUpdateAlertruleRequest */ -func (a *APIClient) UpdateAlertgroups(ctx context.Context, instanceId string, projectId string) ApiUpdateAlertgroupsRequest { - return UpdateAlertgroupsRequest{ +func (a *APIClient) UpdateAlertrule(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) ApiUpdateAlertruleRequest { + return UpdateAlertruleRequest{ apiService: a.defaultApi, ctx: ctx, + alertName: alertName, + groupName: groupName, instanceId: instanceId, projectId: projectId, } } -func (a *APIClient) UpdateAlertgroupsExecute(ctx context.Context, instanceId string, projectId string) (*AlertGroupsResponse, error) { - r := UpdateAlertgroupsRequest{ +func (a *APIClient) UpdateAlertruleExecute(ctx context.Context, alertName string, groupName string, instanceId string, projectId string) (*AlertRulesResponse, error) { + r := UpdateAlertruleRequest{ apiService: a.defaultApi, ctx: ctx, + alertName: alertName, + groupName: groupName, instanceId: instanceId, projectId: projectId, } diff --git a/services/observability/api_default_test.go b/services/observability/api_default_test.go deleted file mode 100644 index 9cb832ba0..000000000 --- a/services/observability/api_default_test.go +++ /dev/null @@ -1,3586 +0,0 @@ -/* -STACKIT Observability API - -Testing DefaultApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package observability - -import ( - "context" - "encoding/json" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "testing" - - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -func Test_observability_DefaultApiService(t *testing.T) { - - t.Run("Test DefaultApiService CreateAlertConfigReceiver", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigReceiversResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createAlertConfigReceiverPayload := CreateAlertConfigReceiverPayload{} - - resp, reqErr := apiClient.CreateAlertConfigReceiver(context.Background(), instanceId, projectId).CreateAlertConfigReceiverPayload(createAlertConfigReceiverPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateAlertConfigRoute", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigRouteResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createAlertConfigRoutePayload := CreateAlertConfigRoutePayload{} - - resp, reqErr := apiClient.CreateAlertConfigRoute(context.Background(), instanceId, projectId).CreateAlertConfigRoutePayload(createAlertConfigRoutePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createAlertgroupsPayload := CreateAlertgroupsPayload{} - - resp, reqErr := apiClient.CreateAlertgroups(context.Background(), instanceId, projectId).CreateAlertgroupsPayload(createAlertgroupsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateAlertrules", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertRulesResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - createAlertrulesPayload := CreateAlertrulesPayload{} - - resp, reqErr := apiClient.CreateAlertrules(context.Background(), groupName, instanceId, projectId).CreateAlertrulesPayload(createAlertrulesPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateCertCheck", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/cert-checks" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CertCheckResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createCertCheckPayload := CreateCertCheckPayload{} - - resp, reqErr := apiClient.CreateCertCheck(context.Background(), instanceId, projectId).CreateCertCheckPayload(createCertCheckPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateCredentials", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CreateCredentialsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.CreateCredentials(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateHttpCheck", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/http-checks" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := HttpCheckResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createHttpCheckPayload := CreateHttpCheckPayload{} - - resp, reqErr := apiClient.CreateHttpCheck(context.Background(), instanceId, projectId).CreateHttpCheckPayload(createHttpCheckPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateInstance", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances" - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CreateInstanceResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - createInstancePayload := CreateInstancePayload{} - - resp, reqErr := apiClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateLogsAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createLogsAlertgroupsPayload := CreateLogsAlertgroupsPayload{} - - resp, reqErr := apiClient.CreateLogsAlertgroups(context.Background(), instanceId, projectId).CreateLogsAlertgroupsPayload(createLogsAlertgroupsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateScrapeConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ScrapeConfigsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - createScrapeConfigPayload := CreateScrapeConfigPayload{} - - resp, reqErr := apiClient.CreateScrapeConfig(context.Background(), instanceId, projectId).CreateScrapeConfigPayload(createScrapeConfigPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteAlertConfigReceiver", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - receiverValue := "receiver-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(receiverValue, "receiver")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigReceiversResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - receiver := receiverValue - - resp, reqErr := apiClient.DeleteAlertConfigReceiver(context.Background(), instanceId, projectId, receiver).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteAlertConfigRoute", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - receiverValue := "receiver-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(receiverValue, "receiver")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigRouteResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - receiver := receiverValue - - resp, reqErr := apiClient.DeleteAlertConfigRoute(context.Background(), instanceId, projectId, receiver).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteAlertgroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.DeleteAlertgroup(context.Background(), groupName, instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - groupName := []string{} - - resp, reqErr := apiClient.DeleteAlertgroups(context.Background(), instanceId, projectId).GroupName(groupName).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteAlertrules", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertRulesResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - alertName := []string{} - - resp, reqErr := apiClient.DeleteAlertrules(context.Background(), groupName, instanceId, projectId).AlertName(alertName).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteCertCheck", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/cert-checks/{id}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - idValue := "id-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CertCheckResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - id := idValue - - resp, reqErr := apiClient.DeleteCertCheck(context.Background(), instanceId, projectId, id).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteCredentials", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - usernameValue := "username-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(usernameValue, "username")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Message{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - username := usernameValue - - resp, reqErr := apiClient.DeleteCredentials(context.Background(), instanceId, projectId, username).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteCredentialsRemoteWriteConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - usernameValue := "username-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(usernameValue, "username")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CredentialsRemoteWriteDeleteResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - username := usernameValue - - resp, reqErr := apiClient.DeleteCredentialsRemoteWriteConfig(context.Background(), instanceId, projectId, username).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteHttpCheck", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/http-checks/{id}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - idValue := "id-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := HttpCheckResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - id := idValue - - resp, reqErr := apiClient.DeleteHttpCheck(context.Background(), instanceId, projectId, id).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteInstance", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := InstanceResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.DeleteInstance(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteLogsAlertgroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.DeleteLogsAlertgroup(context.Background(), groupName, instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteScrapeConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - jobNameValue := "jobName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(jobNameValue, "jobName")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := DeleteScrapeConfigResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - jobName := jobNameValue - projectId := projectIdValue - - resp, reqErr := apiClient.DeleteScrapeConfig(context.Background(), instanceId, jobName, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetAlertConfigReceiver", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - receiverValue := "receiver-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(receiverValue, "receiver")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Receiver{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - receiver := receiverValue - - resp, reqErr := apiClient.GetAlertConfigReceiver(context.Background(), instanceId, projectId, receiver).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetAlertConfigRoute", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - receiverValue := "receiver-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(receiverValue, "receiver")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigRouteResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - receiver := receiverValue - - resp, reqErr := apiClient.GetAlertConfigRoute(context.Background(), instanceId, projectId, receiver).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetAlertConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetAlertConfigsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetAlertConfigs(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetAlertgroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetAlertgroup(context.Background(), groupName, instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetCredentials", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - usernameValue := "username-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(usernameValue, "username")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetCredentialsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - username := usernameValue - - resp, reqErr := apiClient.GetCredentials(context.Background(), instanceId, projectId, username).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetCredentialsRemoteWriteConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - usernameValue := "username-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(usernameValue, "username")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CredentialsRemoteWriteConfig{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - username := usernameValue - - resp, reqErr := apiClient.GetCredentialsRemoteWriteConfig(context.Background(), instanceId, projectId, username).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetGrafanaConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/grafana-configs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GrafanaConfigs{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetGrafanaConfigs(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetInstance", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetInstanceResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetInstance(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetLogsAlertgroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetLogsAlertgroup(context.Background(), groupName, instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetLogsConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-configs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := LogsConfigResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetLogsConfigs(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetMetricsStorageRetention", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetMetricsStorageRetentionResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetMetricsStorageRetention(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetScrapeConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - jobNameValue := "jobName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(jobNameValue, "jobName")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetScrapeConfigResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - jobName := jobNameValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetScrapeConfig(context.Background(), instanceId, jobName, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetTracesConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/traces-configs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := TracesConfigResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.GetTracesConfigs(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListACL", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acl" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListACLResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListACL(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAlertConfigReceivers", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigReceiversResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListAlertConfigReceivers(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAlertConfigRoutes", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigRouteResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListAlertConfigRoutes(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListAlertgroups(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListAlertrules", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertRulesResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListAlertrules(context.Background(), groupName, instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListCertChecks", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/cert-checks" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CertCheckResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListCertChecks(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListCredentials", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListCredentialsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListCredentials(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListHttpChecks", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/http-checks" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := HttpCheckResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListHttpChecks(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListInstances", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances" - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListInstancesResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - - resp, reqErr := apiClient.ListInstances(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListLogsAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListLogsAlertgroups(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListPlans", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/plans" - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PlansResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - - resp, reqErr := apiClient.ListPlans(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListScrapeConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListScrapeConfigsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.ListScrapeConfigs(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService PartialUpdateAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateAlertgroupsRequestInner := []UpdateAlertgroupsRequestInner{} - - resp, reqErr := apiClient.PartialUpdateAlertgroups(context.Background(), instanceId, projectId).UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService PartialUpdateAlertrules", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertRulesResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - partialUpdateAlertrulesRequestInner := []PartialUpdateAlertrulesRequestInner{} - - resp, reqErr := apiClient.PartialUpdateAlertrules(context.Background(), groupName, instanceId, projectId).PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateACL", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acl" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Message{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - - resp, reqErr := apiClient.UpdateACL(context.Background(), instanceId, projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateAlertConfigReceiver", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - receiverValue := "receiver-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(receiverValue, "receiver")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigReceiversResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - receiver := receiverValue - updateAlertConfigReceiverPayload := UpdateAlertConfigReceiverPayload{} - - resp, reqErr := apiClient.UpdateAlertConfigReceiver(context.Background(), instanceId, projectId, receiver).UpdateAlertConfigReceiverPayload(updateAlertConfigReceiverPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateAlertConfigRoute", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - receiverValue := "receiver-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"receiver"+"}", url.PathEscape(ParameterValueToString(receiverValue, "receiver")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertConfigRouteResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - receiver := receiverValue - updateAlertConfigRoutePayload := UpdateAlertConfigRoutePayload{} - - resp, reqErr := apiClient.UpdateAlertConfigRoute(context.Background(), instanceId, projectId, receiver).UpdateAlertConfigRoutePayload(updateAlertConfigRoutePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateAlertConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := UpdateAlertConfigsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateAlertConfigsPayload := UpdateAlertConfigsPayload{} - - resp, reqErr := apiClient.UpdateAlertConfigs(context.Background(), instanceId, projectId).UpdateAlertConfigsPayload(updateAlertConfigsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateAlertgroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - updateAlertgroupPayload := UpdateAlertgroupPayload{} - - resp, reqErr := apiClient.UpdateAlertgroup(context.Background(), groupName, instanceId, projectId).UpdateAlertgroupPayload(updateAlertgroupPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateAlertgroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/alertgroups" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateAlertgroupsRequestInner := []UpdateAlertgroupsRequestInner{} - - resp, reqErr := apiClient.UpdateAlertgroups(context.Background(), instanceId, projectId).UpdateAlertgroupsRequestInner(updateAlertgroupsRequestInner).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateCredentialsRemoteWriteConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - usernameValue := "username-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(usernameValue, "username")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := CredentialsRemoteWriteConfig{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - username := usernameValue - updateCredentialsRemoteWriteConfigPayload := UpdateCredentialsRemoteWriteConfigPayload{} - - resp, reqErr := apiClient.UpdateCredentialsRemoteWriteConfig(context.Background(), instanceId, projectId, username).UpdateCredentialsRemoteWriteConfigPayload(updateCredentialsRemoteWriteConfigPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateGrafanaConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/grafana-configs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Message{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateGrafanaConfigsPayload := UpdateGrafanaConfigsPayload{} - - resp, reqErr := apiClient.UpdateGrafanaConfigs(context.Background(), instanceId, projectId).UpdateGrafanaConfigsPayload(updateGrafanaConfigsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateInstance", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := InstanceResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateInstancePayload := UpdateInstancePayload{} - - resp, reqErr := apiClient.UpdateInstance(context.Background(), instanceId, projectId).UpdateInstancePayload(updateInstancePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateLogsAlertgroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}" - groupNameValue := "groupName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"groupName"+"}", url.PathEscape(ParameterValueToString(groupNameValue, "groupName")), -1) - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AlertGroupsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - groupName := groupNameValue - instanceId := instanceIdValue - projectId := projectIdValue - updateLogsAlertgroupPayload := UpdateLogsAlertgroupPayload{} - - resp, reqErr := apiClient.UpdateLogsAlertgroup(context.Background(), groupName, instanceId, projectId).UpdateLogsAlertgroupPayload(updateLogsAlertgroupPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateLogsConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/logs-configs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Message{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateLogsConfigsPayload := UpdateLogsConfigsPayload{} - - resp, reqErr := apiClient.UpdateLogsConfigs(context.Background(), instanceId, projectId).UpdateLogsConfigsPayload(updateLogsConfigsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateMetricsStorageRetention", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Message{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateMetricsStorageRetentionPayload := UpdateMetricsStorageRetentionPayload{} - - resp, reqErr := apiClient.UpdateMetricsStorageRetention(context.Background(), instanceId, projectId).UpdateMetricsStorageRetentionPayload(updateMetricsStorageRetentionPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateScrapeConfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - jobNameValue := "jobName-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"jobName"+"}", url.PathEscape(ParameterValueToString(jobNameValue, "jobName")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ScrapeConfigsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - jobName := jobNameValue - projectId := projectIdValue - updateScrapeConfigPayload := UpdateScrapeConfigPayload{} - - resp, reqErr := apiClient.UpdateScrapeConfig(context.Background(), instanceId, jobName, projectId).UpdateScrapeConfigPayload(updateScrapeConfigPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateTracesConfigs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/traces-configs" - instanceIdValue := "instanceId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - projectIdValue := "projectId-value" - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Message{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for observability_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - instanceId := instanceIdValue - projectId := projectIdValue - updateTracesConfigsPayload := UpdateTracesConfigsPayload{} - - resp, reqErr := apiClient.UpdateTracesConfigs(context.Background(), instanceId, projectId).UpdateTracesConfigsPayload(updateTracesConfigsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - -} diff --git a/services/observability/model_alert_record_response.go b/services/observability/model_alert_record_response.go new file mode 100644 index 000000000..5198d3497 --- /dev/null +++ b/services/observability/model_alert_record_response.go @@ -0,0 +1,169 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the AlertRecordResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlertRecordResponse{} + +/* + types and functions for data +*/ + +// isModel +type AlertRecordResponseGetDataAttributeType = *AlertrecordResponse +type AlertRecordResponseGetDataArgType = AlertrecordResponse +type AlertRecordResponseGetDataRetType = AlertrecordResponse + +func getAlertRecordResponseGetDataAttributeTypeOk(arg AlertRecordResponseGetDataAttributeType) (ret AlertRecordResponseGetDataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertRecordResponseGetDataAttributeType(arg *AlertRecordResponseGetDataAttributeType, val AlertRecordResponseGetDataRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type AlertRecordResponseGetMessageAttributeType = *string + +func getAlertRecordResponseGetMessageAttributeTypeOk(arg AlertRecordResponseGetMessageAttributeType) (ret AlertRecordResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertRecordResponseGetMessageAttributeType(arg *AlertRecordResponseGetMessageAttributeType, val AlertRecordResponseGetMessageRetType) { + *arg = &val +} + +type AlertRecordResponseGetMessageArgType = string +type AlertRecordResponseGetMessageRetType = string + +// AlertRecordResponse struct for AlertRecordResponse +type AlertRecordResponse struct { + // REQUIRED + Data AlertRecordResponseGetDataAttributeType `json:"data" required:"true"` + // REQUIRED + Message AlertRecordResponseGetMessageAttributeType `json:"message" required:"true"` +} + +type _AlertRecordResponse AlertRecordResponse + +// NewAlertRecordResponse instantiates a new AlertRecordResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertRecordResponse(data AlertRecordResponseGetDataArgType, message AlertRecordResponseGetMessageArgType) *AlertRecordResponse { + this := AlertRecordResponse{} + setAlertRecordResponseGetDataAttributeType(&this.Data, data) + setAlertRecordResponseGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewAlertRecordResponseWithDefaults instantiates a new AlertRecordResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertRecordResponseWithDefaults() *AlertRecordResponse { + this := AlertRecordResponse{} + return &this +} + +// GetData returns the Data field value +func (o *AlertRecordResponse) GetData() (ret AlertRecordResponseGetDataRetType) { + ret, _ = o.GetDataOk() + return ret +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AlertRecordResponse) GetDataOk() (ret AlertRecordResponseGetDataRetType, ok bool) { + return getAlertRecordResponseGetDataAttributeTypeOk(o.Data) +} + +// SetData sets field value +func (o *AlertRecordResponse) SetData(v AlertRecordResponseGetDataRetType) { + setAlertRecordResponseGetDataAttributeType(&o.Data, v) +} + +// GetMessage returns the Message field value +func (o *AlertRecordResponse) GetMessage() (ret AlertRecordResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *AlertRecordResponse) GetMessageOk() (ret AlertRecordResponseGetMessageRetType, ok bool) { + return getAlertRecordResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *AlertRecordResponse) SetMessage(v AlertRecordResponseGetMessageRetType) { + setAlertRecordResponseGetMessageAttributeType(&o.Message, v) +} + +func (o AlertRecordResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAlertRecordResponseGetDataAttributeTypeOk(o.Data); ok { + toSerialize["Data"] = val + } + if val, ok := getAlertRecordResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + return toSerialize, nil +} + +type NullableAlertRecordResponse struct { + value *AlertRecordResponse + isSet bool +} + +func (v NullableAlertRecordResponse) Get() *AlertRecordResponse { + return v.value +} + +func (v *NullableAlertRecordResponse) Set(val *AlertRecordResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAlertRecordResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertRecordResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertRecordResponse(val *AlertRecordResponse) *NullableAlertRecordResponse { + return &NullableAlertRecordResponse{value: val, isSet: true} +} + +func (v NullableAlertRecordResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertRecordResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_alert_rule_test.go b/services/observability/model_alert_record_response_test.go similarity index 100% rename from services/observability/model_alert_rule_test.go rename to services/observability/model_alert_record_response_test.go diff --git a/services/observability/model_alert_records_response.go b/services/observability/model_alert_records_response.go new file mode 100644 index 000000000..755e3b5f3 --- /dev/null +++ b/services/observability/model_alert_records_response.go @@ -0,0 +1,169 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the AlertRecordsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlertRecordsResponse{} + +/* + types and functions for data +*/ + +// isArray +type AlertRecordsResponseGetDataAttributeType = *[]AlertrecordResponse +type AlertRecordsResponseGetDataArgType = []AlertrecordResponse +type AlertRecordsResponseGetDataRetType = []AlertrecordResponse + +func getAlertRecordsResponseGetDataAttributeTypeOk(arg AlertRecordsResponseGetDataAttributeType) (ret AlertRecordsResponseGetDataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertRecordsResponseGetDataAttributeType(arg *AlertRecordsResponseGetDataAttributeType, val AlertRecordsResponseGetDataRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type AlertRecordsResponseGetMessageAttributeType = *string + +func getAlertRecordsResponseGetMessageAttributeTypeOk(arg AlertRecordsResponseGetMessageAttributeType) (ret AlertRecordsResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertRecordsResponseGetMessageAttributeType(arg *AlertRecordsResponseGetMessageAttributeType, val AlertRecordsResponseGetMessageRetType) { + *arg = &val +} + +type AlertRecordsResponseGetMessageArgType = string +type AlertRecordsResponseGetMessageRetType = string + +// AlertRecordsResponse struct for AlertRecordsResponse +type AlertRecordsResponse struct { + // REQUIRED + Data AlertRecordsResponseGetDataAttributeType `json:"data" required:"true"` + // REQUIRED + Message AlertRecordsResponseGetMessageAttributeType `json:"message" required:"true"` +} + +type _AlertRecordsResponse AlertRecordsResponse + +// NewAlertRecordsResponse instantiates a new AlertRecordsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertRecordsResponse(data AlertRecordsResponseGetDataArgType, message AlertRecordsResponseGetMessageArgType) *AlertRecordsResponse { + this := AlertRecordsResponse{} + setAlertRecordsResponseGetDataAttributeType(&this.Data, data) + setAlertRecordsResponseGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewAlertRecordsResponseWithDefaults instantiates a new AlertRecordsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertRecordsResponseWithDefaults() *AlertRecordsResponse { + this := AlertRecordsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *AlertRecordsResponse) GetData() (ret AlertRecordsResponseGetDataRetType) { + ret, _ = o.GetDataOk() + return ret +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AlertRecordsResponse) GetDataOk() (ret AlertRecordsResponseGetDataRetType, ok bool) { + return getAlertRecordsResponseGetDataAttributeTypeOk(o.Data) +} + +// SetData sets field value +func (o *AlertRecordsResponse) SetData(v AlertRecordsResponseGetDataRetType) { + setAlertRecordsResponseGetDataAttributeType(&o.Data, v) +} + +// GetMessage returns the Message field value +func (o *AlertRecordsResponse) GetMessage() (ret AlertRecordsResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *AlertRecordsResponse) GetMessageOk() (ret AlertRecordsResponseGetMessageRetType, ok bool) { + return getAlertRecordsResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *AlertRecordsResponse) SetMessage(v AlertRecordsResponseGetMessageRetType) { + setAlertRecordsResponseGetMessageAttributeType(&o.Message, v) +} + +func (o AlertRecordsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAlertRecordsResponseGetDataAttributeTypeOk(o.Data); ok { + toSerialize["Data"] = val + } + if val, ok := getAlertRecordsResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + return toSerialize, nil +} + +type NullableAlertRecordsResponse struct { + value *AlertRecordsResponse + isSet bool +} + +func (v NullableAlertRecordsResponse) Get() *AlertRecordsResponse { + return v.value +} + +func (v *NullableAlertRecordsResponse) Set(val *AlertRecordsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAlertRecordsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertRecordsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertRecordsResponse(val *AlertRecordsResponse) *NullableAlertRecordsResponse { + return &NullableAlertRecordsResponse{value: val, isSet: true} +} + +func (v NullableAlertRecordsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertRecordsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_scrape_config_payload_basic_auth_test.go b/services/observability/model_alert_records_response_test.go similarity index 100% rename from services/observability/model_create_scrape_config_payload_basic_auth_test.go rename to services/observability/model_alert_records_response_test.go diff --git a/services/observability/model_alert_rule.go b/services/observability/model_alert_rule.go deleted file mode 100644 index 8f52c25cb..000000000 --- a/services/observability/model_alert_rule.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" -) - -// checks if the AlertRule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AlertRule{} - -/* - types and functions for alert -*/ - -// isNotNullableString -type AlertRuleGetAlertAttributeType = *string - -func getAlertRuleGetAlertAttributeTypeOk(arg AlertRuleGetAlertAttributeType) (ret AlertRuleGetAlertRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAlertRuleGetAlertAttributeType(arg *AlertRuleGetAlertAttributeType, val AlertRuleGetAlertRetType) { - *arg = &val -} - -type AlertRuleGetAlertArgType = string -type AlertRuleGetAlertRetType = string - -/* - types and functions for annotations -*/ - -// isContainer -type AlertRuleGetAnnotationsAttributeType = *map[string]string -type AlertRuleGetAnnotationsArgType = map[string]string -type AlertRuleGetAnnotationsRetType = map[string]string - -func getAlertRuleGetAnnotationsAttributeTypeOk(arg AlertRuleGetAnnotationsAttributeType) (ret AlertRuleGetAnnotationsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAlertRuleGetAnnotationsAttributeType(arg *AlertRuleGetAnnotationsAttributeType, val AlertRuleGetAnnotationsRetType) { - *arg = &val -} - -/* - types and functions for expr -*/ - -// isNotNullableString -type AlertRuleGetExprAttributeType = *string - -func getAlertRuleGetExprAttributeTypeOk(arg AlertRuleGetExprAttributeType) (ret AlertRuleGetExprRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAlertRuleGetExprAttributeType(arg *AlertRuleGetExprAttributeType, val AlertRuleGetExprRetType) { - *arg = &val -} - -type AlertRuleGetExprArgType = string -type AlertRuleGetExprRetType = string - -/* - types and functions for for -*/ - -// isNotNullableString -type AlertRuleGetForAttributeType = *string - -func getAlertRuleGetForAttributeTypeOk(arg AlertRuleGetForAttributeType) (ret AlertRuleGetForRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAlertRuleGetForAttributeType(arg *AlertRuleGetForAttributeType, val AlertRuleGetForRetType) { - *arg = &val -} - -type AlertRuleGetForArgType = string -type AlertRuleGetForRetType = string - -/* - types and functions for labels -*/ - -// isContainer -type AlertRuleGetLabelsAttributeType = *map[string]string -type AlertRuleGetLabelsArgType = map[string]string -type AlertRuleGetLabelsRetType = map[string]string - -func getAlertRuleGetLabelsAttributeTypeOk(arg AlertRuleGetLabelsAttributeType) (ret AlertRuleGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setAlertRuleGetLabelsAttributeType(arg *AlertRuleGetLabelsAttributeType, val AlertRuleGetLabelsRetType) { - *arg = &val -} - -// AlertRule struct for AlertRule -type AlertRule struct { - // REQUIRED - Alert AlertRuleGetAlertAttributeType `json:"alert" required:"true"` - Annotations AlertRuleGetAnnotationsAttributeType `json:"annotations,omitempty"` - // REQUIRED - Expr AlertRuleGetExprAttributeType `json:"expr" required:"true"` - For AlertRuleGetForAttributeType `json:"for,omitempty"` - Labels AlertRuleGetLabelsAttributeType `json:"labels,omitempty"` -} - -type _AlertRule AlertRule - -// NewAlertRule instantiates a new AlertRule object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAlertRule(alert AlertRuleGetAlertArgType, expr AlertRuleGetExprArgType) *AlertRule { - this := AlertRule{} - setAlertRuleGetAlertAttributeType(&this.Alert, alert) - setAlertRuleGetExprAttributeType(&this.Expr, expr) - return &this -} - -// NewAlertRuleWithDefaults instantiates a new AlertRule object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAlertRuleWithDefaults() *AlertRule { - this := AlertRule{} - var for_ string = "0s" - this.For = &for_ - return &this -} - -// GetAlert returns the Alert field value -func (o *AlertRule) GetAlert() (ret AlertRuleGetAlertRetType) { - ret, _ = o.GetAlertOk() - return ret -} - -// GetAlertOk returns a tuple with the Alert field value -// and a boolean to check if the value has been set. -func (o *AlertRule) GetAlertOk() (ret AlertRuleGetAlertRetType, ok bool) { - return getAlertRuleGetAlertAttributeTypeOk(o.Alert) -} - -// SetAlert sets field value -func (o *AlertRule) SetAlert(v AlertRuleGetAlertRetType) { - setAlertRuleGetAlertAttributeType(&o.Alert, v) -} - -// GetAnnotations returns the Annotations field value if set, zero value otherwise. -func (o *AlertRule) GetAnnotations() (res AlertRuleGetAnnotationsRetType) { - res, _ = o.GetAnnotationsOk() - return -} - -// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertRule) GetAnnotationsOk() (ret AlertRuleGetAnnotationsRetType, ok bool) { - return getAlertRuleGetAnnotationsAttributeTypeOk(o.Annotations) -} - -// HasAnnotations returns a boolean if a field has been set. -func (o *AlertRule) HasAnnotations() bool { - _, ok := o.GetAnnotationsOk() - return ok -} - -// SetAnnotations gets a reference to the given map[string]string and assigns it to the Annotations field. -func (o *AlertRule) SetAnnotations(v AlertRuleGetAnnotationsRetType) { - setAlertRuleGetAnnotationsAttributeType(&o.Annotations, v) -} - -// GetExpr returns the Expr field value -func (o *AlertRule) GetExpr() (ret AlertRuleGetExprRetType) { - ret, _ = o.GetExprOk() - return ret -} - -// GetExprOk returns a tuple with the Expr field value -// and a boolean to check if the value has been set. -func (o *AlertRule) GetExprOk() (ret AlertRuleGetExprRetType, ok bool) { - return getAlertRuleGetExprAttributeTypeOk(o.Expr) -} - -// SetExpr sets field value -func (o *AlertRule) SetExpr(v AlertRuleGetExprRetType) { - setAlertRuleGetExprAttributeType(&o.Expr, v) -} - -// GetFor returns the For field value if set, zero value otherwise. -func (o *AlertRule) GetFor() (res AlertRuleGetForRetType) { - res, _ = o.GetForOk() - return -} - -// GetForOk returns a tuple with the For field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertRule) GetForOk() (ret AlertRuleGetForRetType, ok bool) { - return getAlertRuleGetForAttributeTypeOk(o.For) -} - -// HasFor returns a boolean if a field has been set. -func (o *AlertRule) HasFor() bool { - _, ok := o.GetForOk() - return ok -} - -// SetFor gets a reference to the given string and assigns it to the For field. -func (o *AlertRule) SetFor(v AlertRuleGetForRetType) { - setAlertRuleGetForAttributeType(&o.For, v) -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *AlertRule) GetLabels() (res AlertRuleGetLabelsRetType) { - res, _ = o.GetLabelsOk() - return -} - -// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertRule) GetLabelsOk() (ret AlertRuleGetLabelsRetType, ok bool) { - return getAlertRuleGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *AlertRule) HasLabels() bool { - _, ok := o.GetLabelsOk() - return ok -} - -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *AlertRule) SetLabels(v AlertRuleGetLabelsRetType) { - setAlertRuleGetLabelsAttributeType(&o.Labels, v) -} - -func (o AlertRule) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAlertRuleGetAlertAttributeTypeOk(o.Alert); ok { - toSerialize["Alert"] = val - } - if val, ok := getAlertRuleGetAnnotationsAttributeTypeOk(o.Annotations); ok { - toSerialize["Annotations"] = val - } - if val, ok := getAlertRuleGetExprAttributeTypeOk(o.Expr); ok { - toSerialize["Expr"] = val - } - if val, ok := getAlertRuleGetForAttributeTypeOk(o.For); ok { - toSerialize["For"] = val - } - if val, ok := getAlertRuleGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - return toSerialize, nil -} - -type NullableAlertRule struct { - value *AlertRule - isSet bool -} - -func (v NullableAlertRule) Get() *AlertRule { - return v.value -} - -func (v *NullableAlertRule) Set(val *AlertRule) { - v.value = val - v.isSet = true -} - -func (v NullableAlertRule) IsSet() bool { - return v.isSet -} - -func (v *NullableAlertRule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAlertRule(val *AlertRule) *NullableAlertRule { - return &NullableAlertRule{value: val, isSet: true} -} - -func (v NullableAlertRule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAlertRule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_alert_rule_response.go b/services/observability/model_alert_rule_response.go new file mode 100644 index 000000000..7ede7a936 --- /dev/null +++ b/services/observability/model_alert_rule_response.go @@ -0,0 +1,169 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the AlertRuleResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlertRuleResponse{} + +/* + types and functions for data +*/ + +// isModel +type AlertRuleResponseGetDataAttributeType = *AlertruleResponse +type AlertRuleResponseGetDataArgType = AlertruleResponse +type AlertRuleResponseGetDataRetType = AlertruleResponse + +func getAlertRuleResponseGetDataAttributeTypeOk(arg AlertRuleResponseGetDataAttributeType) (ret AlertRuleResponseGetDataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertRuleResponseGetDataAttributeType(arg *AlertRuleResponseGetDataAttributeType, val AlertRuleResponseGetDataRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type AlertRuleResponseGetMessageAttributeType = *string + +func getAlertRuleResponseGetMessageAttributeTypeOk(arg AlertRuleResponseGetMessageAttributeType) (ret AlertRuleResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertRuleResponseGetMessageAttributeType(arg *AlertRuleResponseGetMessageAttributeType, val AlertRuleResponseGetMessageRetType) { + *arg = &val +} + +type AlertRuleResponseGetMessageArgType = string +type AlertRuleResponseGetMessageRetType = string + +// AlertRuleResponse struct for AlertRuleResponse +type AlertRuleResponse struct { + // REQUIRED + Data AlertRuleResponseGetDataAttributeType `json:"data" required:"true"` + // REQUIRED + Message AlertRuleResponseGetMessageAttributeType `json:"message" required:"true"` +} + +type _AlertRuleResponse AlertRuleResponse + +// NewAlertRuleResponse instantiates a new AlertRuleResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertRuleResponse(data AlertRuleResponseGetDataArgType, message AlertRuleResponseGetMessageArgType) *AlertRuleResponse { + this := AlertRuleResponse{} + setAlertRuleResponseGetDataAttributeType(&this.Data, data) + setAlertRuleResponseGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewAlertRuleResponseWithDefaults instantiates a new AlertRuleResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertRuleResponseWithDefaults() *AlertRuleResponse { + this := AlertRuleResponse{} + return &this +} + +// GetData returns the Data field value +func (o *AlertRuleResponse) GetData() (ret AlertRuleResponseGetDataRetType) { + ret, _ = o.GetDataOk() + return ret +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AlertRuleResponse) GetDataOk() (ret AlertRuleResponseGetDataRetType, ok bool) { + return getAlertRuleResponseGetDataAttributeTypeOk(o.Data) +} + +// SetData sets field value +func (o *AlertRuleResponse) SetData(v AlertRuleResponseGetDataRetType) { + setAlertRuleResponseGetDataAttributeType(&o.Data, v) +} + +// GetMessage returns the Message field value +func (o *AlertRuleResponse) GetMessage() (ret AlertRuleResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *AlertRuleResponse) GetMessageOk() (ret AlertRuleResponseGetMessageRetType, ok bool) { + return getAlertRuleResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *AlertRuleResponse) SetMessage(v AlertRuleResponseGetMessageRetType) { + setAlertRuleResponseGetMessageAttributeType(&o.Message, v) +} + +func (o AlertRuleResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAlertRuleResponseGetDataAttributeTypeOk(o.Data); ok { + toSerialize["Data"] = val + } + if val, ok := getAlertRuleResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + return toSerialize, nil +} + +type NullableAlertRuleResponse struct { + value *AlertRuleResponse + isSet bool +} + +func (v NullableAlertRuleResponse) Get() *AlertRuleResponse { + return v.value +} + +func (v *NullableAlertRuleResponse) Set(val *AlertRuleResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAlertRuleResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertRuleResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertRuleResponse(val *AlertRuleResponse) *NullableAlertRuleResponse { + return &NullableAlertRuleResponse{value: val, isSet: true} +} + +func (v NullableAlertRuleResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertRuleResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_test.go b/services/observability/model_alert_rule_response_test.go similarity index 100% rename from services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_test.go rename to services/observability/model_alert_rule_response_test.go diff --git a/services/observability/model_alert_rules_response.go b/services/observability/model_alert_rules_response.go index 00548cf68..b68c5495d 100644 --- a/services/observability/model_alert_rules_response.go +++ b/services/observability/model_alert_rules_response.go @@ -22,9 +22,9 @@ var _ MappedNullable = &AlertRulesResponse{} */ // isArray -type AlertRulesResponseGetDataAttributeType = *[]AlertRule -type AlertRulesResponseGetDataArgType = []AlertRule -type AlertRulesResponseGetDataRetType = []AlertRule +type AlertRulesResponseGetDataAttributeType = *[]AlertruleResponse +type AlertRulesResponseGetDataArgType = []AlertruleResponse +type AlertRulesResponseGetDataRetType = []AlertruleResponse func getAlertRulesResponseGetDataAttributeTypeOk(arg AlertRulesResponseGetDataAttributeType) (ret AlertRulesResponseGetDataRetType, ok bool) { if arg == nil { diff --git a/services/observability/model_alertrecord_response.go b/services/observability/model_alertrecord_response.go new file mode 100644 index 000000000..4d5f1322c --- /dev/null +++ b/services/observability/model_alertrecord_response.go @@ -0,0 +1,217 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the AlertrecordResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlertrecordResponse{} + +/* + types and functions for expr +*/ + +// isNotNullableString +type AlertrecordResponseGetExprAttributeType = *string + +func getAlertrecordResponseGetExprAttributeTypeOk(arg AlertrecordResponseGetExprAttributeType) (ret AlertrecordResponseGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertrecordResponseGetExprAttributeType(arg *AlertrecordResponseGetExprAttributeType, val AlertrecordResponseGetExprRetType) { + *arg = &val +} + +type AlertrecordResponseGetExprArgType = string +type AlertrecordResponseGetExprRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type AlertrecordResponseGetLabelsAttributeType = *map[string]string +type AlertrecordResponseGetLabelsArgType = map[string]string +type AlertrecordResponseGetLabelsRetType = map[string]string + +func getAlertrecordResponseGetLabelsAttributeTypeOk(arg AlertrecordResponseGetLabelsAttributeType) (ret AlertrecordResponseGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertrecordResponseGetLabelsAttributeType(arg *AlertrecordResponseGetLabelsAttributeType, val AlertrecordResponseGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for record +*/ + +// isNotNullableString +type AlertrecordResponseGetRecordAttributeType = *string + +func getAlertrecordResponseGetRecordAttributeTypeOk(arg AlertrecordResponseGetRecordAttributeType) (ret AlertrecordResponseGetRecordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertrecordResponseGetRecordAttributeType(arg *AlertrecordResponseGetRecordAttributeType, val AlertrecordResponseGetRecordRetType) { + *arg = &val +} + +type AlertrecordResponseGetRecordArgType = string +type AlertrecordResponseGetRecordRetType = string + +// AlertrecordResponse struct for AlertrecordResponse +type AlertrecordResponse struct { + // REQUIRED + Expr AlertrecordResponseGetExprAttributeType `json:"expr" required:"true"` + Labels AlertrecordResponseGetLabelsAttributeType `json:"labels,omitempty"` + // REQUIRED + Record AlertrecordResponseGetRecordAttributeType `json:"record" required:"true"` +} + +type _AlertrecordResponse AlertrecordResponse + +// NewAlertrecordResponse instantiates a new AlertrecordResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertrecordResponse(expr AlertrecordResponseGetExprArgType, record AlertrecordResponseGetRecordArgType) *AlertrecordResponse { + this := AlertrecordResponse{} + setAlertrecordResponseGetExprAttributeType(&this.Expr, expr) + setAlertrecordResponseGetRecordAttributeType(&this.Record, record) + return &this +} + +// NewAlertrecordResponseWithDefaults instantiates a new AlertrecordResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertrecordResponseWithDefaults() *AlertrecordResponse { + this := AlertrecordResponse{} + return &this +} + +// GetExpr returns the Expr field value +func (o *AlertrecordResponse) GetExpr() (ret AlertrecordResponseGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *AlertrecordResponse) GetExprOk() (ret AlertrecordResponseGetExprRetType, ok bool) { + return getAlertrecordResponseGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *AlertrecordResponse) SetExpr(v AlertrecordResponseGetExprRetType) { + setAlertrecordResponseGetExprAttributeType(&o.Expr, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *AlertrecordResponse) GetLabels() (res AlertrecordResponseGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertrecordResponse) GetLabelsOk() (ret AlertrecordResponseGetLabelsRetType, ok bool) { + return getAlertrecordResponseGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *AlertrecordResponse) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *AlertrecordResponse) SetLabels(v AlertrecordResponseGetLabelsRetType) { + setAlertrecordResponseGetLabelsAttributeType(&o.Labels, v) +} + +// GetRecord returns the Record field value +func (o *AlertrecordResponse) GetRecord() (ret AlertrecordResponseGetRecordRetType) { + ret, _ = o.GetRecordOk() + return ret +} + +// GetRecordOk returns a tuple with the Record field value +// and a boolean to check if the value has been set. +func (o *AlertrecordResponse) GetRecordOk() (ret AlertrecordResponseGetRecordRetType, ok bool) { + return getAlertrecordResponseGetRecordAttributeTypeOk(o.Record) +} + +// SetRecord sets field value +func (o *AlertrecordResponse) SetRecord(v AlertrecordResponseGetRecordRetType) { + setAlertrecordResponseGetRecordAttributeType(&o.Record, v) +} + +func (o AlertrecordResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAlertrecordResponseGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getAlertrecordResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getAlertrecordResponseGetRecordAttributeTypeOk(o.Record); ok { + toSerialize["Record"] = val + } + return toSerialize, nil +} + +type NullableAlertrecordResponse struct { + value *AlertrecordResponse + isSet bool +} + +func (v NullableAlertrecordResponse) Get() *AlertrecordResponse { + return v.value +} + +func (v *NullableAlertrecordResponse) Set(val *AlertrecordResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAlertrecordResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertrecordResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertrecordResponse(val *AlertrecordResponse) *NullableAlertrecordResponse { + return &NullableAlertrecordResponse{value: val, isSet: true} +} + +func (v NullableAlertrecordResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertrecordResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config_test.go b/services/observability/model_alertrecord_response_test.go similarity index 100% rename from services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config_test.go rename to services/observability/model_alertrecord_response_test.go diff --git a/services/observability/model_alertrule_response.go b/services/observability/model_alertrule_response.go new file mode 100644 index 000000000..52a25d49d --- /dev/null +++ b/services/observability/model_alertrule_response.go @@ -0,0 +1,314 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the AlertruleResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlertruleResponse{} + +/* + types and functions for alert +*/ + +// isNotNullableString +type AlertruleResponseGetAlertAttributeType = *string + +func getAlertruleResponseGetAlertAttributeTypeOk(arg AlertruleResponseGetAlertAttributeType) (ret AlertruleResponseGetAlertRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertruleResponseGetAlertAttributeType(arg *AlertruleResponseGetAlertAttributeType, val AlertruleResponseGetAlertRetType) { + *arg = &val +} + +type AlertruleResponseGetAlertArgType = string +type AlertruleResponseGetAlertRetType = string + +/* + types and functions for annotations +*/ + +// isContainer +type AlertruleResponseGetAnnotationsAttributeType = *map[string]string +type AlertruleResponseGetAnnotationsArgType = map[string]string +type AlertruleResponseGetAnnotationsRetType = map[string]string + +func getAlertruleResponseGetAnnotationsAttributeTypeOk(arg AlertruleResponseGetAnnotationsAttributeType) (ret AlertruleResponseGetAnnotationsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertruleResponseGetAnnotationsAttributeType(arg *AlertruleResponseGetAnnotationsAttributeType, val AlertruleResponseGetAnnotationsRetType) { + *arg = &val +} + +/* + types and functions for expr +*/ + +// isNotNullableString +type AlertruleResponseGetExprAttributeType = *string + +func getAlertruleResponseGetExprAttributeTypeOk(arg AlertruleResponseGetExprAttributeType) (ret AlertruleResponseGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertruleResponseGetExprAttributeType(arg *AlertruleResponseGetExprAttributeType, val AlertruleResponseGetExprRetType) { + *arg = &val +} + +type AlertruleResponseGetExprArgType = string +type AlertruleResponseGetExprRetType = string + +/* + types and functions for for +*/ + +// isNotNullableString +type AlertruleResponseGetForAttributeType = *string + +func getAlertruleResponseGetForAttributeTypeOk(arg AlertruleResponseGetForAttributeType) (ret AlertruleResponseGetForRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertruleResponseGetForAttributeType(arg *AlertruleResponseGetForAttributeType, val AlertruleResponseGetForRetType) { + *arg = &val +} + +type AlertruleResponseGetForArgType = string +type AlertruleResponseGetForRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type AlertruleResponseGetLabelsAttributeType = *map[string]string +type AlertruleResponseGetLabelsArgType = map[string]string +type AlertruleResponseGetLabelsRetType = map[string]string + +func getAlertruleResponseGetLabelsAttributeTypeOk(arg AlertruleResponseGetLabelsAttributeType) (ret AlertruleResponseGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAlertruleResponseGetLabelsAttributeType(arg *AlertruleResponseGetLabelsAttributeType, val AlertruleResponseGetLabelsRetType) { + *arg = &val +} + +// AlertruleResponse struct for AlertruleResponse +type AlertruleResponse struct { + // REQUIRED + Alert AlertruleResponseGetAlertAttributeType `json:"alert" required:"true"` + Annotations AlertruleResponseGetAnnotationsAttributeType `json:"annotations,omitempty"` + // REQUIRED + Expr AlertruleResponseGetExprAttributeType `json:"expr" required:"true"` + For AlertruleResponseGetForAttributeType `json:"for,omitempty"` + Labels AlertruleResponseGetLabelsAttributeType `json:"labels,omitempty"` +} + +type _AlertruleResponse AlertruleResponse + +// NewAlertruleResponse instantiates a new AlertruleResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlertruleResponse(alert AlertruleResponseGetAlertArgType, expr AlertruleResponseGetExprArgType) *AlertruleResponse { + this := AlertruleResponse{} + setAlertruleResponseGetAlertAttributeType(&this.Alert, alert) + setAlertruleResponseGetExprAttributeType(&this.Expr, expr) + return &this +} + +// NewAlertruleResponseWithDefaults instantiates a new AlertruleResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlertruleResponseWithDefaults() *AlertruleResponse { + this := AlertruleResponse{} + var for_ string = "0s" + this.For = &for_ + return &this +} + +// GetAlert returns the Alert field value +func (o *AlertruleResponse) GetAlert() (ret AlertruleResponseGetAlertRetType) { + ret, _ = o.GetAlertOk() + return ret +} + +// GetAlertOk returns a tuple with the Alert field value +// and a boolean to check if the value has been set. +func (o *AlertruleResponse) GetAlertOk() (ret AlertruleResponseGetAlertRetType, ok bool) { + return getAlertruleResponseGetAlertAttributeTypeOk(o.Alert) +} + +// SetAlert sets field value +func (o *AlertruleResponse) SetAlert(v AlertruleResponseGetAlertRetType) { + setAlertruleResponseGetAlertAttributeType(&o.Alert, v) +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *AlertruleResponse) GetAnnotations() (res AlertruleResponseGetAnnotationsRetType) { + res, _ = o.GetAnnotationsOk() + return +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertruleResponse) GetAnnotationsOk() (ret AlertruleResponseGetAnnotationsRetType, ok bool) { + return getAlertruleResponseGetAnnotationsAttributeTypeOk(o.Annotations) +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *AlertruleResponse) HasAnnotations() bool { + _, ok := o.GetAnnotationsOk() + return ok +} + +// SetAnnotations gets a reference to the given map[string]string and assigns it to the Annotations field. +func (o *AlertruleResponse) SetAnnotations(v AlertruleResponseGetAnnotationsRetType) { + setAlertruleResponseGetAnnotationsAttributeType(&o.Annotations, v) +} + +// GetExpr returns the Expr field value +func (o *AlertruleResponse) GetExpr() (ret AlertruleResponseGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *AlertruleResponse) GetExprOk() (ret AlertruleResponseGetExprRetType, ok bool) { + return getAlertruleResponseGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *AlertruleResponse) SetExpr(v AlertruleResponseGetExprRetType) { + setAlertruleResponseGetExprAttributeType(&o.Expr, v) +} + +// GetFor returns the For field value if set, zero value otherwise. +func (o *AlertruleResponse) GetFor() (res AlertruleResponseGetForRetType) { + res, _ = o.GetForOk() + return +} + +// GetForOk returns a tuple with the For field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertruleResponse) GetForOk() (ret AlertruleResponseGetForRetType, ok bool) { + return getAlertruleResponseGetForAttributeTypeOk(o.For) +} + +// HasFor returns a boolean if a field has been set. +func (o *AlertruleResponse) HasFor() bool { + _, ok := o.GetForOk() + return ok +} + +// SetFor gets a reference to the given string and assigns it to the For field. +func (o *AlertruleResponse) SetFor(v AlertruleResponseGetForRetType) { + setAlertruleResponseGetForAttributeType(&o.For, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *AlertruleResponse) GetLabels() (res AlertruleResponseGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlertruleResponse) GetLabelsOk() (ret AlertruleResponseGetLabelsRetType, ok bool) { + return getAlertruleResponseGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *AlertruleResponse) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *AlertruleResponse) SetLabels(v AlertruleResponseGetLabelsRetType) { + setAlertruleResponseGetLabelsAttributeType(&o.Labels, v) +} + +func (o AlertruleResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAlertruleResponseGetAlertAttributeTypeOk(o.Alert); ok { + toSerialize["Alert"] = val + } + if val, ok := getAlertruleResponseGetAnnotationsAttributeTypeOk(o.Annotations); ok { + toSerialize["Annotations"] = val + } + if val, ok := getAlertruleResponseGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getAlertruleResponseGetForAttributeTypeOk(o.For); ok { + toSerialize["For"] = val + } + if val, ok := getAlertruleResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullableAlertruleResponse struct { + value *AlertruleResponse + isSet bool +} + +func (v NullableAlertruleResponse) Get() *AlertruleResponse { + return v.value +} + +func (v *NullableAlertruleResponse) Set(val *AlertruleResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAlertruleResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAlertruleResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlertruleResponse(val *AlertruleResponse) *NullableAlertruleResponse { + return &NullableAlertruleResponse{value: val, isSet: true} +} + +func (v NullableAlertruleResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlertruleResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_test.go b/services/observability/model_alertrule_response_test.go similarity index 100% rename from services/observability/model_create_scrape_config_payload_http_sd_configs_inner_test.go rename to services/observability/model_alertrule_response_test.go diff --git a/services/observability/model_backup_response.go b/services/observability/model_backup_response.go new file mode 100644 index 000000000..2f82322e9 --- /dev/null +++ b/services/observability/model_backup_response.go @@ -0,0 +1,298 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the BackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupResponse{} + +/* + types and functions for alertConfigBackups +*/ + +// isArray +type BackupResponseGetAlertConfigBackupsAttributeType = *[]string +type BackupResponseGetAlertConfigBackupsArgType = []string +type BackupResponseGetAlertConfigBackupsRetType = []string + +func getBackupResponseGetAlertConfigBackupsAttributeTypeOk(arg BackupResponseGetAlertConfigBackupsAttributeType) (ret BackupResponseGetAlertConfigBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupResponseGetAlertConfigBackupsAttributeType(arg *BackupResponseGetAlertConfigBackupsAttributeType, val BackupResponseGetAlertConfigBackupsRetType) { + *arg = &val +} + +/* + types and functions for alertRulesBackups +*/ + +// isArray +type BackupResponseGetAlertRulesBackupsAttributeType = *[]string +type BackupResponseGetAlertRulesBackupsArgType = []string +type BackupResponseGetAlertRulesBackupsRetType = []string + +func getBackupResponseGetAlertRulesBackupsAttributeTypeOk(arg BackupResponseGetAlertRulesBackupsAttributeType) (ret BackupResponseGetAlertRulesBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupResponseGetAlertRulesBackupsAttributeType(arg *BackupResponseGetAlertRulesBackupsAttributeType, val BackupResponseGetAlertRulesBackupsRetType) { + *arg = &val +} + +/* + types and functions for grafanaBackups +*/ + +// isArray +type BackupResponseGetGrafanaBackupsAttributeType = *[]string +type BackupResponseGetGrafanaBackupsArgType = []string +type BackupResponseGetGrafanaBackupsRetType = []string + +func getBackupResponseGetGrafanaBackupsAttributeTypeOk(arg BackupResponseGetGrafanaBackupsAttributeType) (ret BackupResponseGetGrafanaBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupResponseGetGrafanaBackupsAttributeType(arg *BackupResponseGetGrafanaBackupsAttributeType, val BackupResponseGetGrafanaBackupsRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type BackupResponseGetMessageAttributeType = *string + +func getBackupResponseGetMessageAttributeTypeOk(arg BackupResponseGetMessageAttributeType) (ret BackupResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupResponseGetMessageAttributeType(arg *BackupResponseGetMessageAttributeType, val BackupResponseGetMessageRetType) { + *arg = &val +} + +type BackupResponseGetMessageArgType = string +type BackupResponseGetMessageRetType = string + +/* + types and functions for scrapeConfigBackups +*/ + +// isArray +type BackupResponseGetScrapeConfigBackupsAttributeType = *[]string +type BackupResponseGetScrapeConfigBackupsArgType = []string +type BackupResponseGetScrapeConfigBackupsRetType = []string + +func getBackupResponseGetScrapeConfigBackupsAttributeTypeOk(arg BackupResponseGetScrapeConfigBackupsAttributeType) (ret BackupResponseGetScrapeConfigBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupResponseGetScrapeConfigBackupsAttributeType(arg *BackupResponseGetScrapeConfigBackupsAttributeType, val BackupResponseGetScrapeConfigBackupsRetType) { + *arg = &val +} + +// BackupResponse struct for BackupResponse +type BackupResponse struct { + // REQUIRED + AlertConfigBackups BackupResponseGetAlertConfigBackupsAttributeType `json:"alertConfigBackups" required:"true"` + // REQUIRED + AlertRulesBackups BackupResponseGetAlertRulesBackupsAttributeType `json:"alertRulesBackups" required:"true"` + // REQUIRED + GrafanaBackups BackupResponseGetGrafanaBackupsAttributeType `json:"grafanaBackups" required:"true"` + // REQUIRED + Message BackupResponseGetMessageAttributeType `json:"message" required:"true"` + // REQUIRED + ScrapeConfigBackups BackupResponseGetScrapeConfigBackupsAttributeType `json:"scrapeConfigBackups" required:"true"` +} + +type _BackupResponse BackupResponse + +// NewBackupResponse instantiates a new BackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupResponse(alertConfigBackups BackupResponseGetAlertConfigBackupsArgType, alertRulesBackups BackupResponseGetAlertRulesBackupsArgType, grafanaBackups BackupResponseGetGrafanaBackupsArgType, message BackupResponseGetMessageArgType, scrapeConfigBackups BackupResponseGetScrapeConfigBackupsArgType) *BackupResponse { + this := BackupResponse{} + setBackupResponseGetAlertConfigBackupsAttributeType(&this.AlertConfigBackups, alertConfigBackups) + setBackupResponseGetAlertRulesBackupsAttributeType(&this.AlertRulesBackups, alertRulesBackups) + setBackupResponseGetGrafanaBackupsAttributeType(&this.GrafanaBackups, grafanaBackups) + setBackupResponseGetMessageAttributeType(&this.Message, message) + setBackupResponseGetScrapeConfigBackupsAttributeType(&this.ScrapeConfigBackups, scrapeConfigBackups) + return &this +} + +// NewBackupResponseWithDefaults instantiates a new BackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupResponseWithDefaults() *BackupResponse { + this := BackupResponse{} + return &this +} + +// GetAlertConfigBackups returns the AlertConfigBackups field value +func (o *BackupResponse) GetAlertConfigBackups() (ret BackupResponseGetAlertConfigBackupsRetType) { + ret, _ = o.GetAlertConfigBackupsOk() + return ret +} + +// GetAlertConfigBackupsOk returns a tuple with the AlertConfigBackups field value +// and a boolean to check if the value has been set. +func (o *BackupResponse) GetAlertConfigBackupsOk() (ret BackupResponseGetAlertConfigBackupsRetType, ok bool) { + return getBackupResponseGetAlertConfigBackupsAttributeTypeOk(o.AlertConfigBackups) +} + +// SetAlertConfigBackups sets field value +func (o *BackupResponse) SetAlertConfigBackups(v BackupResponseGetAlertConfigBackupsRetType) { + setBackupResponseGetAlertConfigBackupsAttributeType(&o.AlertConfigBackups, v) +} + +// GetAlertRulesBackups returns the AlertRulesBackups field value +func (o *BackupResponse) GetAlertRulesBackups() (ret BackupResponseGetAlertRulesBackupsRetType) { + ret, _ = o.GetAlertRulesBackupsOk() + return ret +} + +// GetAlertRulesBackupsOk returns a tuple with the AlertRulesBackups field value +// and a boolean to check if the value has been set. +func (o *BackupResponse) GetAlertRulesBackupsOk() (ret BackupResponseGetAlertRulesBackupsRetType, ok bool) { + return getBackupResponseGetAlertRulesBackupsAttributeTypeOk(o.AlertRulesBackups) +} + +// SetAlertRulesBackups sets field value +func (o *BackupResponse) SetAlertRulesBackups(v BackupResponseGetAlertRulesBackupsRetType) { + setBackupResponseGetAlertRulesBackupsAttributeType(&o.AlertRulesBackups, v) +} + +// GetGrafanaBackups returns the GrafanaBackups field value +func (o *BackupResponse) GetGrafanaBackups() (ret BackupResponseGetGrafanaBackupsRetType) { + ret, _ = o.GetGrafanaBackupsOk() + return ret +} + +// GetGrafanaBackupsOk returns a tuple with the GrafanaBackups field value +// and a boolean to check if the value has been set. +func (o *BackupResponse) GetGrafanaBackupsOk() (ret BackupResponseGetGrafanaBackupsRetType, ok bool) { + return getBackupResponseGetGrafanaBackupsAttributeTypeOk(o.GrafanaBackups) +} + +// SetGrafanaBackups sets field value +func (o *BackupResponse) SetGrafanaBackups(v BackupResponseGetGrafanaBackupsRetType) { + setBackupResponseGetGrafanaBackupsAttributeType(&o.GrafanaBackups, v) +} + +// GetMessage returns the Message field value +func (o *BackupResponse) GetMessage() (ret BackupResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *BackupResponse) GetMessageOk() (ret BackupResponseGetMessageRetType, ok bool) { + return getBackupResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *BackupResponse) SetMessage(v BackupResponseGetMessageRetType) { + setBackupResponseGetMessageAttributeType(&o.Message, v) +} + +// GetScrapeConfigBackups returns the ScrapeConfigBackups field value +func (o *BackupResponse) GetScrapeConfigBackups() (ret BackupResponseGetScrapeConfigBackupsRetType) { + ret, _ = o.GetScrapeConfigBackupsOk() + return ret +} + +// GetScrapeConfigBackupsOk returns a tuple with the ScrapeConfigBackups field value +// and a boolean to check if the value has been set. +func (o *BackupResponse) GetScrapeConfigBackupsOk() (ret BackupResponseGetScrapeConfigBackupsRetType, ok bool) { + return getBackupResponseGetScrapeConfigBackupsAttributeTypeOk(o.ScrapeConfigBackups) +} + +// SetScrapeConfigBackups sets field value +func (o *BackupResponse) SetScrapeConfigBackups(v BackupResponseGetScrapeConfigBackupsRetType) { + setBackupResponseGetScrapeConfigBackupsAttributeType(&o.ScrapeConfigBackups, v) +} + +func (o BackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBackupResponseGetAlertConfigBackupsAttributeTypeOk(o.AlertConfigBackups); ok { + toSerialize["AlertConfigBackups"] = val + } + if val, ok := getBackupResponseGetAlertRulesBackupsAttributeTypeOk(o.AlertRulesBackups); ok { + toSerialize["AlertRulesBackups"] = val + } + if val, ok := getBackupResponseGetGrafanaBackupsAttributeTypeOk(o.GrafanaBackups); ok { + toSerialize["GrafanaBackups"] = val + } + if val, ok := getBackupResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getBackupResponseGetScrapeConfigBackupsAttributeTypeOk(o.ScrapeConfigBackups); ok { + toSerialize["ScrapeConfigBackups"] = val + } + return toSerialize, nil +} + +type NullableBackupResponse struct { + value *BackupResponse + isSet bool +} + +func (v NullableBackupResponse) Get() *BackupResponse { + return v.value +} + +func (v *NullableBackupResponse) Set(val *BackupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupResponse(val *BackupResponse) *NullableBackupResponse { + return &NullableBackupResponse{value: val, isSet: true} +} + +func (v NullableBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_scrape_config_payload_static_configs_inner_test.go b/services/observability/model_backup_response_test.go similarity index 100% rename from services/observability/model_create_scrape_config_payload_static_configs_inner_test.go rename to services/observability/model_backup_response_test.go diff --git a/services/observability/model_backup_retention_response.go b/services/observability/model_backup_retention_response.go new file mode 100644 index 000000000..2a59d1401 --- /dev/null +++ b/services/observability/model_backup_retention_response.go @@ -0,0 +1,302 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the BackupRetentionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupRetentionResponse{} + +/* + types and functions for alertConfigBackupRetention +*/ + +// isNotNullableString +type BackupRetentionResponseGetAlertConfigBackupRetentionAttributeType = *string + +func getBackupRetentionResponseGetAlertConfigBackupRetentionAttributeTypeOk(arg BackupRetentionResponseGetAlertConfigBackupRetentionAttributeType) (ret BackupRetentionResponseGetAlertConfigBackupRetentionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupRetentionResponseGetAlertConfigBackupRetentionAttributeType(arg *BackupRetentionResponseGetAlertConfigBackupRetentionAttributeType, val BackupRetentionResponseGetAlertConfigBackupRetentionRetType) { + *arg = &val +} + +type BackupRetentionResponseGetAlertConfigBackupRetentionArgType = string +type BackupRetentionResponseGetAlertConfigBackupRetentionRetType = string + +/* + types and functions for alertRulesBackupRetention +*/ + +// isNotNullableString +type BackupRetentionResponseGetAlertRulesBackupRetentionAttributeType = *string + +func getBackupRetentionResponseGetAlertRulesBackupRetentionAttributeTypeOk(arg BackupRetentionResponseGetAlertRulesBackupRetentionAttributeType) (ret BackupRetentionResponseGetAlertRulesBackupRetentionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupRetentionResponseGetAlertRulesBackupRetentionAttributeType(arg *BackupRetentionResponseGetAlertRulesBackupRetentionAttributeType, val BackupRetentionResponseGetAlertRulesBackupRetentionRetType) { + *arg = &val +} + +type BackupRetentionResponseGetAlertRulesBackupRetentionArgType = string +type BackupRetentionResponseGetAlertRulesBackupRetentionRetType = string + +/* + types and functions for grafanaBackupRetention +*/ + +// isNotNullableString +type BackupRetentionResponseGetGrafanaBackupRetentionAttributeType = *string + +func getBackupRetentionResponseGetGrafanaBackupRetentionAttributeTypeOk(arg BackupRetentionResponseGetGrafanaBackupRetentionAttributeType) (ret BackupRetentionResponseGetGrafanaBackupRetentionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupRetentionResponseGetGrafanaBackupRetentionAttributeType(arg *BackupRetentionResponseGetGrafanaBackupRetentionAttributeType, val BackupRetentionResponseGetGrafanaBackupRetentionRetType) { + *arg = &val +} + +type BackupRetentionResponseGetGrafanaBackupRetentionArgType = string +type BackupRetentionResponseGetGrafanaBackupRetentionRetType = string + +/* + types and functions for message +*/ + +// isNotNullableString +type BackupRetentionResponseGetMessageAttributeType = *string + +func getBackupRetentionResponseGetMessageAttributeTypeOk(arg BackupRetentionResponseGetMessageAttributeType) (ret BackupRetentionResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupRetentionResponseGetMessageAttributeType(arg *BackupRetentionResponseGetMessageAttributeType, val BackupRetentionResponseGetMessageRetType) { + *arg = &val +} + +type BackupRetentionResponseGetMessageArgType = string +type BackupRetentionResponseGetMessageRetType = string + +/* + types and functions for scrapeConfigBackupRetention +*/ + +// isNotNullableString +type BackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType = *string + +func getBackupRetentionResponseGetScrapeConfigBackupRetentionAttributeTypeOk(arg BackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType) (ret BackupRetentionResponseGetScrapeConfigBackupRetentionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType(arg *BackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType, val BackupRetentionResponseGetScrapeConfigBackupRetentionRetType) { + *arg = &val +} + +type BackupRetentionResponseGetScrapeConfigBackupRetentionArgType = string +type BackupRetentionResponseGetScrapeConfigBackupRetentionRetType = string + +// BackupRetentionResponse struct for BackupRetentionResponse +type BackupRetentionResponse struct { + // REQUIRED + AlertConfigBackupRetention BackupRetentionResponseGetAlertConfigBackupRetentionAttributeType `json:"alertConfigBackupRetention" required:"true"` + // REQUIRED + AlertRulesBackupRetention BackupRetentionResponseGetAlertRulesBackupRetentionAttributeType `json:"alertRulesBackupRetention" required:"true"` + // REQUIRED + GrafanaBackupRetention BackupRetentionResponseGetGrafanaBackupRetentionAttributeType `json:"grafanaBackupRetention" required:"true"` + // REQUIRED + Message BackupRetentionResponseGetMessageAttributeType `json:"message" required:"true"` + // REQUIRED + ScrapeConfigBackupRetention BackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType `json:"scrapeConfigBackupRetention" required:"true"` +} + +type _BackupRetentionResponse BackupRetentionResponse + +// NewBackupRetentionResponse instantiates a new BackupRetentionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupRetentionResponse(alertConfigBackupRetention BackupRetentionResponseGetAlertConfigBackupRetentionArgType, alertRulesBackupRetention BackupRetentionResponseGetAlertRulesBackupRetentionArgType, grafanaBackupRetention BackupRetentionResponseGetGrafanaBackupRetentionArgType, message BackupRetentionResponseGetMessageArgType, scrapeConfigBackupRetention BackupRetentionResponseGetScrapeConfigBackupRetentionArgType) *BackupRetentionResponse { + this := BackupRetentionResponse{} + setBackupRetentionResponseGetAlertConfigBackupRetentionAttributeType(&this.AlertConfigBackupRetention, alertConfigBackupRetention) + setBackupRetentionResponseGetAlertRulesBackupRetentionAttributeType(&this.AlertRulesBackupRetention, alertRulesBackupRetention) + setBackupRetentionResponseGetGrafanaBackupRetentionAttributeType(&this.GrafanaBackupRetention, grafanaBackupRetention) + setBackupRetentionResponseGetMessageAttributeType(&this.Message, message) + setBackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType(&this.ScrapeConfigBackupRetention, scrapeConfigBackupRetention) + return &this +} + +// NewBackupRetentionResponseWithDefaults instantiates a new BackupRetentionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupRetentionResponseWithDefaults() *BackupRetentionResponse { + this := BackupRetentionResponse{} + return &this +} + +// GetAlertConfigBackupRetention returns the AlertConfigBackupRetention field value +func (o *BackupRetentionResponse) GetAlertConfigBackupRetention() (ret BackupRetentionResponseGetAlertConfigBackupRetentionRetType) { + ret, _ = o.GetAlertConfigBackupRetentionOk() + return ret +} + +// GetAlertConfigBackupRetentionOk returns a tuple with the AlertConfigBackupRetention field value +// and a boolean to check if the value has been set. +func (o *BackupRetentionResponse) GetAlertConfigBackupRetentionOk() (ret BackupRetentionResponseGetAlertConfigBackupRetentionRetType, ok bool) { + return getBackupRetentionResponseGetAlertConfigBackupRetentionAttributeTypeOk(o.AlertConfigBackupRetention) +} + +// SetAlertConfigBackupRetention sets field value +func (o *BackupRetentionResponse) SetAlertConfigBackupRetention(v BackupRetentionResponseGetAlertConfigBackupRetentionRetType) { + setBackupRetentionResponseGetAlertConfigBackupRetentionAttributeType(&o.AlertConfigBackupRetention, v) +} + +// GetAlertRulesBackupRetention returns the AlertRulesBackupRetention field value +func (o *BackupRetentionResponse) GetAlertRulesBackupRetention() (ret BackupRetentionResponseGetAlertRulesBackupRetentionRetType) { + ret, _ = o.GetAlertRulesBackupRetentionOk() + return ret +} + +// GetAlertRulesBackupRetentionOk returns a tuple with the AlertRulesBackupRetention field value +// and a boolean to check if the value has been set. +func (o *BackupRetentionResponse) GetAlertRulesBackupRetentionOk() (ret BackupRetentionResponseGetAlertRulesBackupRetentionRetType, ok bool) { + return getBackupRetentionResponseGetAlertRulesBackupRetentionAttributeTypeOk(o.AlertRulesBackupRetention) +} + +// SetAlertRulesBackupRetention sets field value +func (o *BackupRetentionResponse) SetAlertRulesBackupRetention(v BackupRetentionResponseGetAlertRulesBackupRetentionRetType) { + setBackupRetentionResponseGetAlertRulesBackupRetentionAttributeType(&o.AlertRulesBackupRetention, v) +} + +// GetGrafanaBackupRetention returns the GrafanaBackupRetention field value +func (o *BackupRetentionResponse) GetGrafanaBackupRetention() (ret BackupRetentionResponseGetGrafanaBackupRetentionRetType) { + ret, _ = o.GetGrafanaBackupRetentionOk() + return ret +} + +// GetGrafanaBackupRetentionOk returns a tuple with the GrafanaBackupRetention field value +// and a boolean to check if the value has been set. +func (o *BackupRetentionResponse) GetGrafanaBackupRetentionOk() (ret BackupRetentionResponseGetGrafanaBackupRetentionRetType, ok bool) { + return getBackupRetentionResponseGetGrafanaBackupRetentionAttributeTypeOk(o.GrafanaBackupRetention) +} + +// SetGrafanaBackupRetention sets field value +func (o *BackupRetentionResponse) SetGrafanaBackupRetention(v BackupRetentionResponseGetGrafanaBackupRetentionRetType) { + setBackupRetentionResponseGetGrafanaBackupRetentionAttributeType(&o.GrafanaBackupRetention, v) +} + +// GetMessage returns the Message field value +func (o *BackupRetentionResponse) GetMessage() (ret BackupRetentionResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *BackupRetentionResponse) GetMessageOk() (ret BackupRetentionResponseGetMessageRetType, ok bool) { + return getBackupRetentionResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *BackupRetentionResponse) SetMessage(v BackupRetentionResponseGetMessageRetType) { + setBackupRetentionResponseGetMessageAttributeType(&o.Message, v) +} + +// GetScrapeConfigBackupRetention returns the ScrapeConfigBackupRetention field value +func (o *BackupRetentionResponse) GetScrapeConfigBackupRetention() (ret BackupRetentionResponseGetScrapeConfigBackupRetentionRetType) { + ret, _ = o.GetScrapeConfigBackupRetentionOk() + return ret +} + +// GetScrapeConfigBackupRetentionOk returns a tuple with the ScrapeConfigBackupRetention field value +// and a boolean to check if the value has been set. +func (o *BackupRetentionResponse) GetScrapeConfigBackupRetentionOk() (ret BackupRetentionResponseGetScrapeConfigBackupRetentionRetType, ok bool) { + return getBackupRetentionResponseGetScrapeConfigBackupRetentionAttributeTypeOk(o.ScrapeConfigBackupRetention) +} + +// SetScrapeConfigBackupRetention sets field value +func (o *BackupRetentionResponse) SetScrapeConfigBackupRetention(v BackupRetentionResponseGetScrapeConfigBackupRetentionRetType) { + setBackupRetentionResponseGetScrapeConfigBackupRetentionAttributeType(&o.ScrapeConfigBackupRetention, v) +} + +func (o BackupRetentionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBackupRetentionResponseGetAlertConfigBackupRetentionAttributeTypeOk(o.AlertConfigBackupRetention); ok { + toSerialize["AlertConfigBackupRetention"] = val + } + if val, ok := getBackupRetentionResponseGetAlertRulesBackupRetentionAttributeTypeOk(o.AlertRulesBackupRetention); ok { + toSerialize["AlertRulesBackupRetention"] = val + } + if val, ok := getBackupRetentionResponseGetGrafanaBackupRetentionAttributeTypeOk(o.GrafanaBackupRetention); ok { + toSerialize["GrafanaBackupRetention"] = val + } + if val, ok := getBackupRetentionResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getBackupRetentionResponseGetScrapeConfigBackupRetentionAttributeTypeOk(o.ScrapeConfigBackupRetention); ok { + toSerialize["ScrapeConfigBackupRetention"] = val + } + return toSerialize, nil +} + +type NullableBackupRetentionResponse struct { + value *BackupRetentionResponse + isSet bool +} + +func (v NullableBackupRetentionResponse) Get() *BackupRetentionResponse { + return v.value +} + +func (v *NullableBackupRetentionResponse) Set(val *BackupRetentionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupRetentionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupRetentionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupRetentionResponse(val *BackupRetentionResponse) *NullableBackupRetentionResponse { + return &NullableBackupRetentionResponse{value: val, isSet: true} +} + +func (v NullableBackupRetentionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupRetentionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_backup_retention_response_test.go b/services/observability/model_backup_retention_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_backup_retention_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_backup_schedule.go b/services/observability/model_backup_schedule.go new file mode 100644 index 000000000..70f09d739 --- /dev/null +++ b/services/observability/model_backup_schedule.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the BackupSchedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSchedule{} + +/* + types and functions for schedule +*/ + +// isNotNullableString +type BackupScheduleGetScheduleAttributeType = *string + +func getBackupScheduleGetScheduleAttributeTypeOk(arg BackupScheduleGetScheduleAttributeType) (ret BackupScheduleGetScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleGetScheduleAttributeType(arg *BackupScheduleGetScheduleAttributeType, val BackupScheduleGetScheduleRetType) { + *arg = &val +} + +type BackupScheduleGetScheduleArgType = string +type BackupScheduleGetScheduleRetType = string + +/* + types and functions for scheduleId +*/ + +// isNotNullableString +type BackupScheduleGetScheduleIdAttributeType = *string + +func getBackupScheduleGetScheduleIdAttributeTypeOk(arg BackupScheduleGetScheduleIdAttributeType) (ret BackupScheduleGetScheduleIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleGetScheduleIdAttributeType(arg *BackupScheduleGetScheduleIdAttributeType, val BackupScheduleGetScheduleIdRetType) { + *arg = &val +} + +type BackupScheduleGetScheduleIdArgType = string +type BackupScheduleGetScheduleIdRetType = string + +// BackupSchedule struct for BackupSchedule +type BackupSchedule struct { + // REQUIRED + Schedule BackupScheduleGetScheduleAttributeType `json:"schedule" required:"true"` + // REQUIRED + ScheduleId BackupScheduleGetScheduleIdAttributeType `json:"scheduleId" required:"true"` +} + +type _BackupSchedule BackupSchedule + +// NewBackupSchedule instantiates a new BackupSchedule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupSchedule(schedule BackupScheduleGetScheduleArgType, scheduleId BackupScheduleGetScheduleIdArgType) *BackupSchedule { + this := BackupSchedule{} + setBackupScheduleGetScheduleAttributeType(&this.Schedule, schedule) + setBackupScheduleGetScheduleIdAttributeType(&this.ScheduleId, scheduleId) + return &this +} + +// NewBackupScheduleWithDefaults instantiates a new BackupSchedule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupScheduleWithDefaults() *BackupSchedule { + this := BackupSchedule{} + return &this +} + +// GetSchedule returns the Schedule field value +func (o *BackupSchedule) GetSchedule() (ret BackupScheduleGetScheduleRetType) { + ret, _ = o.GetScheduleOk() + return ret +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetScheduleOk() (ret BackupScheduleGetScheduleRetType, ok bool) { + return getBackupScheduleGetScheduleAttributeTypeOk(o.Schedule) +} + +// SetSchedule sets field value +func (o *BackupSchedule) SetSchedule(v BackupScheduleGetScheduleRetType) { + setBackupScheduleGetScheduleAttributeType(&o.Schedule, v) +} + +// GetScheduleId returns the ScheduleId field value +func (o *BackupSchedule) GetScheduleId() (ret BackupScheduleGetScheduleIdRetType) { + ret, _ = o.GetScheduleIdOk() + return ret +} + +// GetScheduleIdOk returns a tuple with the ScheduleId field value +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetScheduleIdOk() (ret BackupScheduleGetScheduleIdRetType, ok bool) { + return getBackupScheduleGetScheduleIdAttributeTypeOk(o.ScheduleId) +} + +// SetScheduleId sets field value +func (o *BackupSchedule) SetScheduleId(v BackupScheduleGetScheduleIdRetType) { + setBackupScheduleGetScheduleIdAttributeType(&o.ScheduleId, v) +} + +func (o BackupSchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBackupScheduleGetScheduleAttributeTypeOk(o.Schedule); ok { + toSerialize["Schedule"] = val + } + if val, ok := getBackupScheduleGetScheduleIdAttributeTypeOk(o.ScheduleId); ok { + toSerialize["ScheduleId"] = val + } + return toSerialize, nil +} + +type NullableBackupSchedule struct { + value *BackupSchedule + isSet bool +} + +func (v NullableBackupSchedule) Get() *BackupSchedule { + return v.value +} + +func (v *NullableBackupSchedule) Set(val *BackupSchedule) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSchedule(val *BackupSchedule) *NullableBackupSchedule { + return &NullableBackupSchedule{value: val, isSet: true} +} + +func (v NullableBackupSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_backup_schedule_post_response.go b/services/observability/model_backup_schedule_post_response.go new file mode 100644 index 000000000..94f4de8b1 --- /dev/null +++ b/services/observability/model_backup_schedule_post_response.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the BackupSchedulePostResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSchedulePostResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type BackupSchedulePostResponseGetMessageAttributeType = *string + +func getBackupSchedulePostResponseGetMessageAttributeTypeOk(arg BackupSchedulePostResponseGetMessageAttributeType) (ret BackupSchedulePostResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupSchedulePostResponseGetMessageAttributeType(arg *BackupSchedulePostResponseGetMessageAttributeType, val BackupSchedulePostResponseGetMessageRetType) { + *arg = &val +} + +type BackupSchedulePostResponseGetMessageArgType = string +type BackupSchedulePostResponseGetMessageRetType = string + +/* + types and functions for schedule +*/ + +// isNotNullableString +type BackupSchedulePostResponseGetScheduleAttributeType = *string + +func getBackupSchedulePostResponseGetScheduleAttributeTypeOk(arg BackupSchedulePostResponseGetScheduleAttributeType) (ret BackupSchedulePostResponseGetScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupSchedulePostResponseGetScheduleAttributeType(arg *BackupSchedulePostResponseGetScheduleAttributeType, val BackupSchedulePostResponseGetScheduleRetType) { + *arg = &val +} + +type BackupSchedulePostResponseGetScheduleArgType = string +type BackupSchedulePostResponseGetScheduleRetType = string + +// BackupSchedulePostResponse struct for BackupSchedulePostResponse +type BackupSchedulePostResponse struct { + // REQUIRED + Message BackupSchedulePostResponseGetMessageAttributeType `json:"message" required:"true"` + // REQUIRED + Schedule BackupSchedulePostResponseGetScheduleAttributeType `json:"schedule" required:"true"` +} + +type _BackupSchedulePostResponse BackupSchedulePostResponse + +// NewBackupSchedulePostResponse instantiates a new BackupSchedulePostResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupSchedulePostResponse(message BackupSchedulePostResponseGetMessageArgType, schedule BackupSchedulePostResponseGetScheduleArgType) *BackupSchedulePostResponse { + this := BackupSchedulePostResponse{} + setBackupSchedulePostResponseGetMessageAttributeType(&this.Message, message) + setBackupSchedulePostResponseGetScheduleAttributeType(&this.Schedule, schedule) + return &this +} + +// NewBackupSchedulePostResponseWithDefaults instantiates a new BackupSchedulePostResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupSchedulePostResponseWithDefaults() *BackupSchedulePostResponse { + this := BackupSchedulePostResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *BackupSchedulePostResponse) GetMessage() (ret BackupSchedulePostResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *BackupSchedulePostResponse) GetMessageOk() (ret BackupSchedulePostResponseGetMessageRetType, ok bool) { + return getBackupSchedulePostResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *BackupSchedulePostResponse) SetMessage(v BackupSchedulePostResponseGetMessageRetType) { + setBackupSchedulePostResponseGetMessageAttributeType(&o.Message, v) +} + +// GetSchedule returns the Schedule field value +func (o *BackupSchedulePostResponse) GetSchedule() (ret BackupSchedulePostResponseGetScheduleRetType) { + ret, _ = o.GetScheduleOk() + return ret +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *BackupSchedulePostResponse) GetScheduleOk() (ret BackupSchedulePostResponseGetScheduleRetType, ok bool) { + return getBackupSchedulePostResponseGetScheduleAttributeTypeOk(o.Schedule) +} + +// SetSchedule sets field value +func (o *BackupSchedulePostResponse) SetSchedule(v BackupSchedulePostResponseGetScheduleRetType) { + setBackupSchedulePostResponseGetScheduleAttributeType(&o.Schedule, v) +} + +func (o BackupSchedulePostResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBackupSchedulePostResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getBackupSchedulePostResponseGetScheduleAttributeTypeOk(o.Schedule); ok { + toSerialize["Schedule"] = val + } + return toSerialize, nil +} + +type NullableBackupSchedulePostResponse struct { + value *BackupSchedulePostResponse + isSet bool +} + +func (v NullableBackupSchedulePostResponse) Get() *BackupSchedulePostResponse { + return v.value +} + +func (v *NullableBackupSchedulePostResponse) Set(val *BackupSchedulePostResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSchedulePostResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSchedulePostResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSchedulePostResponse(val *BackupSchedulePostResponse) *NullableBackupSchedulePostResponse { + return &NullableBackupSchedulePostResponse{value: val, isSet: true} +} + +func (v NullableBackupSchedulePostResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSchedulePostResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_backup_schedule_post_response_test.go b/services/observability/model_backup_schedule_post_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_backup_schedule_post_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_backup_schedule_response.go b/services/observability/model_backup_schedule_response.go new file mode 100644 index 000000000..6764e8db8 --- /dev/null +++ b/services/observability/model_backup_schedule_response.go @@ -0,0 +1,314 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the BackupScheduleResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupScheduleResponse{} + +/* + types and functions for alertConfigBackupSchedules +*/ + +// isArray +type BackupScheduleResponseGetAlertConfigBackupSchedulesAttributeType = *[]BackupSchedule +type BackupScheduleResponseGetAlertConfigBackupSchedulesArgType = []BackupSchedule +type BackupScheduleResponseGetAlertConfigBackupSchedulesRetType = []BackupSchedule + +func getBackupScheduleResponseGetAlertConfigBackupSchedulesAttributeTypeOk(arg BackupScheduleResponseGetAlertConfigBackupSchedulesAttributeType) (ret BackupScheduleResponseGetAlertConfigBackupSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleResponseGetAlertConfigBackupSchedulesAttributeType(arg *BackupScheduleResponseGetAlertConfigBackupSchedulesAttributeType, val BackupScheduleResponseGetAlertConfigBackupSchedulesRetType) { + *arg = &val +} + +/* + types and functions for alertRulesBackupSchedules +*/ + +// isArray +type BackupScheduleResponseGetAlertRulesBackupSchedulesAttributeType = *[]BackupSchedule +type BackupScheduleResponseGetAlertRulesBackupSchedulesArgType = []BackupSchedule +type BackupScheduleResponseGetAlertRulesBackupSchedulesRetType = []BackupSchedule + +func getBackupScheduleResponseGetAlertRulesBackupSchedulesAttributeTypeOk(arg BackupScheduleResponseGetAlertRulesBackupSchedulesAttributeType) (ret BackupScheduleResponseGetAlertRulesBackupSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleResponseGetAlertRulesBackupSchedulesAttributeType(arg *BackupScheduleResponseGetAlertRulesBackupSchedulesAttributeType, val BackupScheduleResponseGetAlertRulesBackupSchedulesRetType) { + *arg = &val +} + +/* + types and functions for grafanaBackupSchedules +*/ + +// isArray +type BackupScheduleResponseGetGrafanaBackupSchedulesAttributeType = *[]BackupSchedule +type BackupScheduleResponseGetGrafanaBackupSchedulesArgType = []BackupSchedule +type BackupScheduleResponseGetGrafanaBackupSchedulesRetType = []BackupSchedule + +func getBackupScheduleResponseGetGrafanaBackupSchedulesAttributeTypeOk(arg BackupScheduleResponseGetGrafanaBackupSchedulesAttributeType) (ret BackupScheduleResponseGetGrafanaBackupSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleResponseGetGrafanaBackupSchedulesAttributeType(arg *BackupScheduleResponseGetGrafanaBackupSchedulesAttributeType, val BackupScheduleResponseGetGrafanaBackupSchedulesRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type BackupScheduleResponseGetMessageAttributeType = *string + +func getBackupScheduleResponseGetMessageAttributeTypeOk(arg BackupScheduleResponseGetMessageAttributeType) (ret BackupScheduleResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleResponseGetMessageAttributeType(arg *BackupScheduleResponseGetMessageAttributeType, val BackupScheduleResponseGetMessageRetType) { + *arg = &val +} + +type BackupScheduleResponseGetMessageArgType = string +type BackupScheduleResponseGetMessageRetType = string + +/* + types and functions for scrapeConfigBackupSchedules +*/ + +// isArray +type BackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeType = *[]BackupSchedule +type BackupScheduleResponseGetScrapeConfigBackupSchedulesArgType = []BackupSchedule +type BackupScheduleResponseGetScrapeConfigBackupSchedulesRetType = []BackupSchedule + +func getBackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeTypeOk(arg BackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeType) (ret BackupScheduleResponseGetScrapeConfigBackupSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeType(arg *BackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeType, val BackupScheduleResponseGetScrapeConfigBackupSchedulesRetType) { + *arg = &val +} + +// BackupScheduleResponse struct for BackupScheduleResponse +type BackupScheduleResponse struct { + AlertConfigBackupSchedules BackupScheduleResponseGetAlertConfigBackupSchedulesAttributeType `json:"alertConfigBackupSchedules,omitempty"` + AlertRulesBackupSchedules BackupScheduleResponseGetAlertRulesBackupSchedulesAttributeType `json:"alertRulesBackupSchedules,omitempty"` + GrafanaBackupSchedules BackupScheduleResponseGetGrafanaBackupSchedulesAttributeType `json:"grafanaBackupSchedules,omitempty"` + // REQUIRED + Message BackupScheduleResponseGetMessageAttributeType `json:"message" required:"true"` + ScrapeConfigBackupSchedules BackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeType `json:"scrapeConfigBackupSchedules,omitempty"` +} + +type _BackupScheduleResponse BackupScheduleResponse + +// NewBackupScheduleResponse instantiates a new BackupScheduleResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupScheduleResponse(message BackupScheduleResponseGetMessageArgType) *BackupScheduleResponse { + this := BackupScheduleResponse{} + setBackupScheduleResponseGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewBackupScheduleResponseWithDefaults instantiates a new BackupScheduleResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupScheduleResponseWithDefaults() *BackupScheduleResponse { + this := BackupScheduleResponse{} + return &this +} + +// GetAlertConfigBackupSchedules returns the AlertConfigBackupSchedules field value if set, zero value otherwise. +func (o *BackupScheduleResponse) GetAlertConfigBackupSchedules() (res BackupScheduleResponseGetAlertConfigBackupSchedulesRetType) { + res, _ = o.GetAlertConfigBackupSchedulesOk() + return +} + +// GetAlertConfigBackupSchedulesOk returns a tuple with the AlertConfigBackupSchedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupScheduleResponse) GetAlertConfigBackupSchedulesOk() (ret BackupScheduleResponseGetAlertConfigBackupSchedulesRetType, ok bool) { + return getBackupScheduleResponseGetAlertConfigBackupSchedulesAttributeTypeOk(o.AlertConfigBackupSchedules) +} + +// HasAlertConfigBackupSchedules returns a boolean if a field has been set. +func (o *BackupScheduleResponse) HasAlertConfigBackupSchedules() bool { + _, ok := o.GetAlertConfigBackupSchedulesOk() + return ok +} + +// SetAlertConfigBackupSchedules gets a reference to the given []BackupSchedule and assigns it to the AlertConfigBackupSchedules field. +func (o *BackupScheduleResponse) SetAlertConfigBackupSchedules(v BackupScheduleResponseGetAlertConfigBackupSchedulesRetType) { + setBackupScheduleResponseGetAlertConfigBackupSchedulesAttributeType(&o.AlertConfigBackupSchedules, v) +} + +// GetAlertRulesBackupSchedules returns the AlertRulesBackupSchedules field value if set, zero value otherwise. +func (o *BackupScheduleResponse) GetAlertRulesBackupSchedules() (res BackupScheduleResponseGetAlertRulesBackupSchedulesRetType) { + res, _ = o.GetAlertRulesBackupSchedulesOk() + return +} + +// GetAlertRulesBackupSchedulesOk returns a tuple with the AlertRulesBackupSchedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupScheduleResponse) GetAlertRulesBackupSchedulesOk() (ret BackupScheduleResponseGetAlertRulesBackupSchedulesRetType, ok bool) { + return getBackupScheduleResponseGetAlertRulesBackupSchedulesAttributeTypeOk(o.AlertRulesBackupSchedules) +} + +// HasAlertRulesBackupSchedules returns a boolean if a field has been set. +func (o *BackupScheduleResponse) HasAlertRulesBackupSchedules() bool { + _, ok := o.GetAlertRulesBackupSchedulesOk() + return ok +} + +// SetAlertRulesBackupSchedules gets a reference to the given []BackupSchedule and assigns it to the AlertRulesBackupSchedules field. +func (o *BackupScheduleResponse) SetAlertRulesBackupSchedules(v BackupScheduleResponseGetAlertRulesBackupSchedulesRetType) { + setBackupScheduleResponseGetAlertRulesBackupSchedulesAttributeType(&o.AlertRulesBackupSchedules, v) +} + +// GetGrafanaBackupSchedules returns the GrafanaBackupSchedules field value if set, zero value otherwise. +func (o *BackupScheduleResponse) GetGrafanaBackupSchedules() (res BackupScheduleResponseGetGrafanaBackupSchedulesRetType) { + res, _ = o.GetGrafanaBackupSchedulesOk() + return +} + +// GetGrafanaBackupSchedulesOk returns a tuple with the GrafanaBackupSchedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupScheduleResponse) GetGrafanaBackupSchedulesOk() (ret BackupScheduleResponseGetGrafanaBackupSchedulesRetType, ok bool) { + return getBackupScheduleResponseGetGrafanaBackupSchedulesAttributeTypeOk(o.GrafanaBackupSchedules) +} + +// HasGrafanaBackupSchedules returns a boolean if a field has been set. +func (o *BackupScheduleResponse) HasGrafanaBackupSchedules() bool { + _, ok := o.GetGrafanaBackupSchedulesOk() + return ok +} + +// SetGrafanaBackupSchedules gets a reference to the given []BackupSchedule and assigns it to the GrafanaBackupSchedules field. +func (o *BackupScheduleResponse) SetGrafanaBackupSchedules(v BackupScheduleResponseGetGrafanaBackupSchedulesRetType) { + setBackupScheduleResponseGetGrafanaBackupSchedulesAttributeType(&o.GrafanaBackupSchedules, v) +} + +// GetMessage returns the Message field value +func (o *BackupScheduleResponse) GetMessage() (ret BackupScheduleResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *BackupScheduleResponse) GetMessageOk() (ret BackupScheduleResponseGetMessageRetType, ok bool) { + return getBackupScheduleResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *BackupScheduleResponse) SetMessage(v BackupScheduleResponseGetMessageRetType) { + setBackupScheduleResponseGetMessageAttributeType(&o.Message, v) +} + +// GetScrapeConfigBackupSchedules returns the ScrapeConfigBackupSchedules field value if set, zero value otherwise. +func (o *BackupScheduleResponse) GetScrapeConfigBackupSchedules() (res BackupScheduleResponseGetScrapeConfigBackupSchedulesRetType) { + res, _ = o.GetScrapeConfigBackupSchedulesOk() + return +} + +// GetScrapeConfigBackupSchedulesOk returns a tuple with the ScrapeConfigBackupSchedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupScheduleResponse) GetScrapeConfigBackupSchedulesOk() (ret BackupScheduleResponseGetScrapeConfigBackupSchedulesRetType, ok bool) { + return getBackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeTypeOk(o.ScrapeConfigBackupSchedules) +} + +// HasScrapeConfigBackupSchedules returns a boolean if a field has been set. +func (o *BackupScheduleResponse) HasScrapeConfigBackupSchedules() bool { + _, ok := o.GetScrapeConfigBackupSchedulesOk() + return ok +} + +// SetScrapeConfigBackupSchedules gets a reference to the given []BackupSchedule and assigns it to the ScrapeConfigBackupSchedules field. +func (o *BackupScheduleResponse) SetScrapeConfigBackupSchedules(v BackupScheduleResponseGetScrapeConfigBackupSchedulesRetType) { + setBackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeType(&o.ScrapeConfigBackupSchedules, v) +} + +func (o BackupScheduleResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBackupScheduleResponseGetAlertConfigBackupSchedulesAttributeTypeOk(o.AlertConfigBackupSchedules); ok { + toSerialize["AlertConfigBackupSchedules"] = val + } + if val, ok := getBackupScheduleResponseGetAlertRulesBackupSchedulesAttributeTypeOk(o.AlertRulesBackupSchedules); ok { + toSerialize["AlertRulesBackupSchedules"] = val + } + if val, ok := getBackupScheduleResponseGetGrafanaBackupSchedulesAttributeTypeOk(o.GrafanaBackupSchedules); ok { + toSerialize["GrafanaBackupSchedules"] = val + } + if val, ok := getBackupScheduleResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getBackupScheduleResponseGetScrapeConfigBackupSchedulesAttributeTypeOk(o.ScrapeConfigBackupSchedules); ok { + toSerialize["ScrapeConfigBackupSchedules"] = val + } + return toSerialize, nil +} + +type NullableBackupScheduleResponse struct { + value *BackupScheduleResponse + isSet bool +} + +func (v NullableBackupScheduleResponse) Get() *BackupScheduleResponse { + return v.value +} + +func (v *NullableBackupScheduleResponse) Set(val *BackupScheduleResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupScheduleResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupScheduleResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupScheduleResponse(val *BackupScheduleResponse) *NullableBackupScheduleResponse { + return &NullableBackupScheduleResponse{value: val, isSet: true} +} + +func (v NullableBackupScheduleResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupScheduleResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_backup_schedule_response_test.go b/services/observability/model_backup_schedule_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_backup_schedule_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_backup_schedule_test.go b/services/observability/model_backup_schedule_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_backup_schedule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_alert_config_route_payload.go b/services/observability/model_create_alert_config_route_payload.go index 587c3608b..a620a09bb 100644 --- a/services/observability/model_create_alert_config_route_payload.go +++ b/services/observability/model_create_alert_config_route_payload.go @@ -223,7 +223,7 @@ func setCreateAlertConfigRoutePayloadGetRoutesAttributeType(arg *CreateAlertConf // CreateAlertConfigRoutePayload The root node of the routing tree. type CreateAlertConfigRoutePayload struct { - // Whether an alert should continue matching subsequent sibling nodes. + // The continue parameter cannot be set to true on the root route because there are no subsequent sibling nodes to match. It must always be false. Continue CreateAlertConfigRoutePayloadgetContinueAttributeType `json:"continue,omitempty"` // The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping. GroupBy CreateAlertConfigRoutePayloadGetGroupByAttributeType `json:"groupBy,omitempty"` diff --git a/services/observability/model_create_alert_config_route_payload_routes_inner.go b/services/observability/model_create_alert_config_route_payload_routes_inner.go index 9794e3e60..0672d4d7c 100644 --- a/services/observability/model_create_alert_config_route_payload_routes_inner.go +++ b/services/observability/model_create_alert_config_route_payload_routes_inner.go @@ -223,7 +223,7 @@ func setCreateAlertConfigRoutePayloadRoutesInnerGetRoutesAttributeType(arg *Crea // CreateAlertConfigRoutePayloadRoutesInner As in one level above type CreateAlertConfigRoutePayloadRoutesInner struct { - // As in one level above + // Whether an alert should continue matching subsequent sibling nodes. Continue CreateAlertConfigRoutePayloadRoutesInnergetContinueAttributeType `json:"continue,omitempty"` GroupBy CreateAlertConfigRoutePayloadRoutesInnerGetGroupByAttributeType `json:"groupBy,omitempty"` // As in one level above diff --git a/services/observability/model_create_alertrecord_payload.go b/services/observability/model_create_alertrecord_payload.go new file mode 100644 index 000000000..8e08c5832 --- /dev/null +++ b/services/observability/model_create_alertrecord_payload.go @@ -0,0 +1,220 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateAlertrecordPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAlertrecordPayload{} + +/* + types and functions for expr +*/ + +// isNotNullableString +type CreateAlertrecordPayloadGetExprAttributeType = *string + +func getCreateAlertrecordPayloadGetExprAttributeTypeOk(arg CreateAlertrecordPayloadGetExprAttributeType) (ret CreateAlertrecordPayloadGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAlertrecordPayloadGetExprAttributeType(arg *CreateAlertrecordPayloadGetExprAttributeType, val CreateAlertrecordPayloadGetExprRetType) { + *arg = &val +} + +type CreateAlertrecordPayloadGetExprArgType = string +type CreateAlertrecordPayloadGetExprRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateAlertrecordPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateAlertrecordPayloadGetLabelsArgType = map[string]interface{} +type CreateAlertrecordPayloadGetLabelsRetType = map[string]interface{} + +func getCreateAlertrecordPayloadGetLabelsAttributeTypeOk(arg CreateAlertrecordPayloadGetLabelsAttributeType) (ret CreateAlertrecordPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAlertrecordPayloadGetLabelsAttributeType(arg *CreateAlertrecordPayloadGetLabelsAttributeType, val CreateAlertrecordPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for record +*/ + +// isNotNullableString +type CreateAlertrecordPayloadGetRecordAttributeType = *string + +func getCreateAlertrecordPayloadGetRecordAttributeTypeOk(arg CreateAlertrecordPayloadGetRecordAttributeType) (ret CreateAlertrecordPayloadGetRecordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAlertrecordPayloadGetRecordAttributeType(arg *CreateAlertrecordPayloadGetRecordAttributeType, val CreateAlertrecordPayloadGetRecordRetType) { + *arg = &val +} + +type CreateAlertrecordPayloadGetRecordArgType = string +type CreateAlertrecordPayloadGetRecordRetType = string + +// CreateAlertrecordPayload Record. `Additional Validators:` * total config (all alert groups/rules/records) should not be bigger than 500000 characters as string since this the limitation of prometheus. +type CreateAlertrecordPayload struct { + // The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts. + // REQUIRED + Expr CreateAlertrecordPayloadGetExprAttributeType `json:"expr" required:"true"` + // map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters + Labels CreateAlertrecordPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the record. `Additional Validators:` * is the identifier and so unique in the group + // REQUIRED + Record CreateAlertrecordPayloadGetRecordAttributeType `json:"record" required:"true"` +} + +type _CreateAlertrecordPayload CreateAlertrecordPayload + +// NewCreateAlertrecordPayload instantiates a new CreateAlertrecordPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAlertrecordPayload(expr CreateAlertrecordPayloadGetExprArgType, record CreateAlertrecordPayloadGetRecordArgType) *CreateAlertrecordPayload { + this := CreateAlertrecordPayload{} + setCreateAlertrecordPayloadGetExprAttributeType(&this.Expr, expr) + setCreateAlertrecordPayloadGetRecordAttributeType(&this.Record, record) + return &this +} + +// NewCreateAlertrecordPayloadWithDefaults instantiates a new CreateAlertrecordPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAlertrecordPayloadWithDefaults() *CreateAlertrecordPayload { + this := CreateAlertrecordPayload{} + return &this +} + +// GetExpr returns the Expr field value +func (o *CreateAlertrecordPayload) GetExpr() (ret CreateAlertrecordPayloadGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *CreateAlertrecordPayload) GetExprOk() (ret CreateAlertrecordPayloadGetExprRetType, ok bool) { + return getCreateAlertrecordPayloadGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *CreateAlertrecordPayload) SetExpr(v CreateAlertrecordPayloadGetExprRetType) { + setCreateAlertrecordPayloadGetExprAttributeType(&o.Expr, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateAlertrecordPayload) GetLabels() (res CreateAlertrecordPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAlertrecordPayload) GetLabelsOk() (ret CreateAlertrecordPayloadGetLabelsRetType, ok bool) { + return getCreateAlertrecordPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateAlertrecordPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateAlertrecordPayload) SetLabels(v CreateAlertrecordPayloadGetLabelsRetType) { + setCreateAlertrecordPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetRecord returns the Record field value +func (o *CreateAlertrecordPayload) GetRecord() (ret CreateAlertrecordPayloadGetRecordRetType) { + ret, _ = o.GetRecordOk() + return ret +} + +// GetRecordOk returns a tuple with the Record field value +// and a boolean to check if the value has been set. +func (o *CreateAlertrecordPayload) GetRecordOk() (ret CreateAlertrecordPayloadGetRecordRetType, ok bool) { + return getCreateAlertrecordPayloadGetRecordAttributeTypeOk(o.Record) +} + +// SetRecord sets field value +func (o *CreateAlertrecordPayload) SetRecord(v CreateAlertrecordPayloadGetRecordRetType) { + setCreateAlertrecordPayloadGetRecordAttributeType(&o.Record, v) +} + +func (o CreateAlertrecordPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateAlertrecordPayloadGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getCreateAlertrecordPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateAlertrecordPayloadGetRecordAttributeTypeOk(o.Record); ok { + toSerialize["Record"] = val + } + return toSerialize, nil +} + +type NullableCreateAlertrecordPayload struct { + value *CreateAlertrecordPayload + isSet bool +} + +func (v NullableCreateAlertrecordPayload) Get() *CreateAlertrecordPayload { + return v.value +} + +func (v *NullableCreateAlertrecordPayload) Set(val *CreateAlertrecordPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAlertrecordPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAlertrecordPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAlertrecordPayload(val *CreateAlertrecordPayload) *NullableCreateAlertrecordPayload { + return &NullableCreateAlertrecordPayload{value: val, isSet: true} +} + +func (v NullableCreateAlertrecordPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAlertrecordPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_alertrecord_payload_test.go b/services/observability/model_create_alertrecord_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_alertrecord_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_backup_schedule_payload.go b/services/observability/model_create_backup_schedule_payload.go new file mode 100644 index 000000000..f89d7aa66 --- /dev/null +++ b/services/observability/model_create_backup_schedule_payload.go @@ -0,0 +1,127 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateBackupSchedulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupSchedulePayload{} + +/* + types and functions for schedule +*/ + +// isNotNullableString +type CreateBackupSchedulePayloadGetScheduleAttributeType = *string + +func getCreateBackupSchedulePayloadGetScheduleAttributeTypeOk(arg CreateBackupSchedulePayloadGetScheduleAttributeType) (ret CreateBackupSchedulePayloadGetScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateBackupSchedulePayloadGetScheduleAttributeType(arg *CreateBackupSchedulePayloadGetScheduleAttributeType, val CreateBackupSchedulePayloadGetScheduleRetType) { + *arg = &val +} + +type CreateBackupSchedulePayloadGetScheduleArgType = string +type CreateBackupSchedulePayloadGetScheduleRetType = string + +// CreateBackupSchedulePayload struct for CreateBackupSchedulePayload +type CreateBackupSchedulePayload struct { + // The schedule for how often to create a backup. `Additional Validators:` * must be a valid cronjob format * must run less than hourly + // REQUIRED + Schedule CreateBackupSchedulePayloadGetScheduleAttributeType `json:"schedule" required:"true"` +} + +type _CreateBackupSchedulePayload CreateBackupSchedulePayload + +// NewCreateBackupSchedulePayload instantiates a new CreateBackupSchedulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupSchedulePayload(schedule CreateBackupSchedulePayloadGetScheduleArgType) *CreateBackupSchedulePayload { + this := CreateBackupSchedulePayload{} + setCreateBackupSchedulePayloadGetScheduleAttributeType(&this.Schedule, schedule) + return &this +} + +// NewCreateBackupSchedulePayloadWithDefaults instantiates a new CreateBackupSchedulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupSchedulePayloadWithDefaults() *CreateBackupSchedulePayload { + this := CreateBackupSchedulePayload{} + return &this +} + +// GetSchedule returns the Schedule field value +func (o *CreateBackupSchedulePayload) GetSchedule() (ret CreateBackupSchedulePayloadGetScheduleRetType) { + ret, _ = o.GetScheduleOk() + return ret +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *CreateBackupSchedulePayload) GetScheduleOk() (ret CreateBackupSchedulePayloadGetScheduleRetType, ok bool) { + return getCreateBackupSchedulePayloadGetScheduleAttributeTypeOk(o.Schedule) +} + +// SetSchedule sets field value +func (o *CreateBackupSchedulePayload) SetSchedule(v CreateBackupSchedulePayloadGetScheduleRetType) { + setCreateBackupSchedulePayloadGetScheduleAttributeType(&o.Schedule, v) +} + +func (o CreateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateBackupSchedulePayloadGetScheduleAttributeTypeOk(o.Schedule); ok { + toSerialize["Schedule"] = val + } + return toSerialize, nil +} + +type NullableCreateBackupSchedulePayload struct { + value *CreateBackupSchedulePayload + isSet bool +} + +func (v NullableCreateBackupSchedulePayload) Get() *CreateBackupSchedulePayload { + return v.value +} + +func (v *NullableCreateBackupSchedulePayload) Set(val *CreateBackupSchedulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupSchedulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupSchedulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupSchedulePayload(val *CreateBackupSchedulePayload) *NullableCreateBackupSchedulePayload { + return &NullableCreateBackupSchedulePayload{value: val, isSet: true} +} + +func (v NullableCreateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupSchedulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_backup_schedule_payload_test.go b/services/observability/model_create_backup_schedule_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_backup_schedule_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_elasticsearch_check_payload.go b/services/observability/model_create_elasticsearch_check_payload.go new file mode 100644 index 000000000..b3f89b3d6 --- /dev/null +++ b/services/observability/model_create_elasticsearch_check_payload.go @@ -0,0 +1,225 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateElasticsearchCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateElasticsearchCheckPayload{} + +/* + types and functions for password +*/ + +// isNotNullableString +type CreateElasticsearchCheckPayloadGetPasswordAttributeType = *string + +func getCreateElasticsearchCheckPayloadGetPasswordAttributeTypeOk(arg CreateElasticsearchCheckPayloadGetPasswordAttributeType) (ret CreateElasticsearchCheckPayloadGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateElasticsearchCheckPayloadGetPasswordAttributeType(arg *CreateElasticsearchCheckPayloadGetPasswordAttributeType, val CreateElasticsearchCheckPayloadGetPasswordRetType) { + *arg = &val +} + +type CreateElasticsearchCheckPayloadGetPasswordArgType = string +type CreateElasticsearchCheckPayloadGetPasswordRetType = string + +/* + types and functions for server +*/ + +// isNotNullableString +type CreateElasticsearchCheckPayloadGetServerAttributeType = *string + +func getCreateElasticsearchCheckPayloadGetServerAttributeTypeOk(arg CreateElasticsearchCheckPayloadGetServerAttributeType) (ret CreateElasticsearchCheckPayloadGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateElasticsearchCheckPayloadGetServerAttributeType(arg *CreateElasticsearchCheckPayloadGetServerAttributeType, val CreateElasticsearchCheckPayloadGetServerRetType) { + *arg = &val +} + +type CreateElasticsearchCheckPayloadGetServerArgType = string +type CreateElasticsearchCheckPayloadGetServerRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type CreateElasticsearchCheckPayloadGetUsernameAttributeType = *string + +func getCreateElasticsearchCheckPayloadGetUsernameAttributeTypeOk(arg CreateElasticsearchCheckPayloadGetUsernameAttributeType) (ret CreateElasticsearchCheckPayloadGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateElasticsearchCheckPayloadGetUsernameAttributeType(arg *CreateElasticsearchCheckPayloadGetUsernameAttributeType, val CreateElasticsearchCheckPayloadGetUsernameRetType) { + *arg = &val +} + +type CreateElasticsearchCheckPayloadGetUsernameArgType = string +type CreateElasticsearchCheckPayloadGetUsernameRetType = string + +// CreateElasticsearchCheckPayload Elasticsearch check body. +type CreateElasticsearchCheckPayload struct { + // password + Password CreateElasticsearchCheckPayloadGetPasswordAttributeType `json:"password,omitempty"` + // url to check + // REQUIRED + Server CreateElasticsearchCheckPayloadGetServerAttributeType `json:"server" required:"true"` + // username + Username CreateElasticsearchCheckPayloadGetUsernameAttributeType `json:"username,omitempty"` +} + +type _CreateElasticsearchCheckPayload CreateElasticsearchCheckPayload + +// NewCreateElasticsearchCheckPayload instantiates a new CreateElasticsearchCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateElasticsearchCheckPayload(server CreateElasticsearchCheckPayloadGetServerArgType) *CreateElasticsearchCheckPayload { + this := CreateElasticsearchCheckPayload{} + setCreateElasticsearchCheckPayloadGetServerAttributeType(&this.Server, server) + return &this +} + +// NewCreateElasticsearchCheckPayloadWithDefaults instantiates a new CreateElasticsearchCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateElasticsearchCheckPayloadWithDefaults() *CreateElasticsearchCheckPayload { + this := CreateElasticsearchCheckPayload{} + return &this +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *CreateElasticsearchCheckPayload) GetPassword() (res CreateElasticsearchCheckPayloadGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateElasticsearchCheckPayload) GetPasswordOk() (ret CreateElasticsearchCheckPayloadGetPasswordRetType, ok bool) { + return getCreateElasticsearchCheckPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *CreateElasticsearchCheckPayload) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *CreateElasticsearchCheckPayload) SetPassword(v CreateElasticsearchCheckPayloadGetPasswordRetType) { + setCreateElasticsearchCheckPayloadGetPasswordAttributeType(&o.Password, v) +} + +// GetServer returns the Server field value +func (o *CreateElasticsearchCheckPayload) GetServer() (ret CreateElasticsearchCheckPayloadGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *CreateElasticsearchCheckPayload) GetServerOk() (ret CreateElasticsearchCheckPayloadGetServerRetType, ok bool) { + return getCreateElasticsearchCheckPayloadGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *CreateElasticsearchCheckPayload) SetServer(v CreateElasticsearchCheckPayloadGetServerRetType) { + setCreateElasticsearchCheckPayloadGetServerAttributeType(&o.Server, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateElasticsearchCheckPayload) GetUsername() (res CreateElasticsearchCheckPayloadGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateElasticsearchCheckPayload) GetUsernameOk() (ret CreateElasticsearchCheckPayloadGetUsernameRetType, ok bool) { + return getCreateElasticsearchCheckPayloadGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateElasticsearchCheckPayload) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateElasticsearchCheckPayload) SetUsername(v CreateElasticsearchCheckPayloadGetUsernameRetType) { + setCreateElasticsearchCheckPayloadGetUsernameAttributeType(&o.Username, v) +} + +func (o CreateElasticsearchCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateElasticsearchCheckPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getCreateElasticsearchCheckPayloadGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + if val, ok := getCreateElasticsearchCheckPayloadGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullableCreateElasticsearchCheckPayload struct { + value *CreateElasticsearchCheckPayload + isSet bool +} + +func (v NullableCreateElasticsearchCheckPayload) Get() *CreateElasticsearchCheckPayload { + return v.value +} + +func (v *NullableCreateElasticsearchCheckPayload) Set(val *CreateElasticsearchCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateElasticsearchCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateElasticsearchCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateElasticsearchCheckPayload(val *CreateElasticsearchCheckPayload) *NullableCreateElasticsearchCheckPayload { + return &NullableCreateElasticsearchCheckPayload{value: val, isSet: true} +} + +func (v NullableCreateElasticsearchCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateElasticsearchCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_elasticsearch_check_payload_test.go b/services/observability/model_create_elasticsearch_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_elasticsearch_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_mongodb_check_payload.go b/services/observability/model_create_mongodb_check_payload.go new file mode 100644 index 000000000..98f39fac6 --- /dev/null +++ b/services/observability/model_create_mongodb_check_payload.go @@ -0,0 +1,127 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateMongodbCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateMongodbCheckPayload{} + +/* + types and functions for server +*/ + +// isNotNullableString +type CreateMongodbCheckPayloadGetServerAttributeType = *string + +func getCreateMongodbCheckPayloadGetServerAttributeTypeOk(arg CreateMongodbCheckPayloadGetServerAttributeType) (ret CreateMongodbCheckPayloadGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateMongodbCheckPayloadGetServerAttributeType(arg *CreateMongodbCheckPayloadGetServerAttributeType, val CreateMongodbCheckPayloadGetServerRetType) { + *arg = &val +} + +type CreateMongodbCheckPayloadGetServerArgType = string +type CreateMongodbCheckPayloadGetServerRetType = string + +// CreateMongodbCheckPayload Mongodb check body. +type CreateMongodbCheckPayload struct { + // url to check + // REQUIRED + Server CreateMongodbCheckPayloadGetServerAttributeType `json:"server" required:"true"` +} + +type _CreateMongodbCheckPayload CreateMongodbCheckPayload + +// NewCreateMongodbCheckPayload instantiates a new CreateMongodbCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateMongodbCheckPayload(server CreateMongodbCheckPayloadGetServerArgType) *CreateMongodbCheckPayload { + this := CreateMongodbCheckPayload{} + setCreateMongodbCheckPayloadGetServerAttributeType(&this.Server, server) + return &this +} + +// NewCreateMongodbCheckPayloadWithDefaults instantiates a new CreateMongodbCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateMongodbCheckPayloadWithDefaults() *CreateMongodbCheckPayload { + this := CreateMongodbCheckPayload{} + return &this +} + +// GetServer returns the Server field value +func (o *CreateMongodbCheckPayload) GetServer() (ret CreateMongodbCheckPayloadGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *CreateMongodbCheckPayload) GetServerOk() (ret CreateMongodbCheckPayloadGetServerRetType, ok bool) { + return getCreateMongodbCheckPayloadGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *CreateMongodbCheckPayload) SetServer(v CreateMongodbCheckPayloadGetServerRetType) { + setCreateMongodbCheckPayloadGetServerAttributeType(&o.Server, v) +} + +func (o CreateMongodbCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateMongodbCheckPayloadGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + return toSerialize, nil +} + +type NullableCreateMongodbCheckPayload struct { + value *CreateMongodbCheckPayload + isSet bool +} + +func (v NullableCreateMongodbCheckPayload) Get() *CreateMongodbCheckPayload { + return v.value +} + +func (v *NullableCreateMongodbCheckPayload) Set(val *CreateMongodbCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateMongodbCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateMongodbCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateMongodbCheckPayload(val *CreateMongodbCheckPayload) *NullableCreateMongodbCheckPayload { + return &NullableCreateMongodbCheckPayload{value: val, isSet: true} +} + +func (v NullableCreateMongodbCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateMongodbCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_mongodb_check_payload_test.go b/services/observability/model_create_mongodb_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_mongodb_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_mysql_check_payload.go b/services/observability/model_create_mysql_check_payload.go new file mode 100644 index 000000000..a4270c0e2 --- /dev/null +++ b/services/observability/model_create_mysql_check_payload.go @@ -0,0 +1,127 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateMysqlCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateMysqlCheckPayload{} + +/* + types and functions for server +*/ + +// isNotNullableString +type CreateMysqlCheckPayloadGetServerAttributeType = *string + +func getCreateMysqlCheckPayloadGetServerAttributeTypeOk(arg CreateMysqlCheckPayloadGetServerAttributeType) (ret CreateMysqlCheckPayloadGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateMysqlCheckPayloadGetServerAttributeType(arg *CreateMysqlCheckPayloadGetServerAttributeType, val CreateMysqlCheckPayloadGetServerRetType) { + *arg = &val +} + +type CreateMysqlCheckPayloadGetServerArgType = string +type CreateMysqlCheckPayloadGetServerRetType = string + +// CreateMysqlCheckPayload MySQL check body. +type CreateMysqlCheckPayload struct { + // url to check + // REQUIRED + Server CreateMysqlCheckPayloadGetServerAttributeType `json:"server" required:"true"` +} + +type _CreateMysqlCheckPayload CreateMysqlCheckPayload + +// NewCreateMysqlCheckPayload instantiates a new CreateMysqlCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateMysqlCheckPayload(server CreateMysqlCheckPayloadGetServerArgType) *CreateMysqlCheckPayload { + this := CreateMysqlCheckPayload{} + setCreateMysqlCheckPayloadGetServerAttributeType(&this.Server, server) + return &this +} + +// NewCreateMysqlCheckPayloadWithDefaults instantiates a new CreateMysqlCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateMysqlCheckPayloadWithDefaults() *CreateMysqlCheckPayload { + this := CreateMysqlCheckPayload{} + return &this +} + +// GetServer returns the Server field value +func (o *CreateMysqlCheckPayload) GetServer() (ret CreateMysqlCheckPayloadGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *CreateMysqlCheckPayload) GetServerOk() (ret CreateMysqlCheckPayloadGetServerRetType, ok bool) { + return getCreateMysqlCheckPayloadGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *CreateMysqlCheckPayload) SetServer(v CreateMysqlCheckPayloadGetServerRetType) { + setCreateMysqlCheckPayloadGetServerAttributeType(&o.Server, v) +} + +func (o CreateMysqlCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateMysqlCheckPayloadGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + return toSerialize, nil +} + +type NullableCreateMysqlCheckPayload struct { + value *CreateMysqlCheckPayload + isSet bool +} + +func (v NullableCreateMysqlCheckPayload) Get() *CreateMysqlCheckPayload { + return v.value +} + +func (v *NullableCreateMysqlCheckPayload) Set(val *CreateMysqlCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateMysqlCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateMysqlCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateMysqlCheckPayload(val *CreateMysqlCheckPayload) *NullableCreateMysqlCheckPayload { + return &NullableCreateMysqlCheckPayload{value: val, isSet: true} +} + +func (v NullableCreateMysqlCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateMysqlCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_mysql_check_payload_test.go b/services/observability/model_create_mysql_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_mysql_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_network_check_payload.go b/services/observability/model_create_network_check_payload.go new file mode 100644 index 000000000..cbfa4c3b3 --- /dev/null +++ b/services/observability/model_create_network_check_payload.go @@ -0,0 +1,127 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateNetworkCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkCheckPayload{} + +/* + types and functions for address +*/ + +// isNotNullableString +type CreateNetworkCheckPayloadGetAddressAttributeType = *string + +func getCreateNetworkCheckPayloadGetAddressAttributeTypeOk(arg CreateNetworkCheckPayloadGetAddressAttributeType) (ret CreateNetworkCheckPayloadGetAddressRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkCheckPayloadGetAddressAttributeType(arg *CreateNetworkCheckPayloadGetAddressAttributeType, val CreateNetworkCheckPayloadGetAddressRetType) { + *arg = &val +} + +type CreateNetworkCheckPayloadGetAddressArgType = string +type CreateNetworkCheckPayloadGetAddressRetType = string + +// CreateNetworkCheckPayload Network check body. +type CreateNetworkCheckPayload struct { + // network to check + // REQUIRED + Address CreateNetworkCheckPayloadGetAddressAttributeType `json:"address" required:"true"` +} + +type _CreateNetworkCheckPayload CreateNetworkCheckPayload + +// NewCreateNetworkCheckPayload instantiates a new CreateNetworkCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkCheckPayload(address CreateNetworkCheckPayloadGetAddressArgType) *CreateNetworkCheckPayload { + this := CreateNetworkCheckPayload{} + setCreateNetworkCheckPayloadGetAddressAttributeType(&this.Address, address) + return &this +} + +// NewCreateNetworkCheckPayloadWithDefaults instantiates a new CreateNetworkCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkCheckPayloadWithDefaults() *CreateNetworkCheckPayload { + this := CreateNetworkCheckPayload{} + return &this +} + +// GetAddress returns the Address field value +func (o *CreateNetworkCheckPayload) GetAddress() (ret CreateNetworkCheckPayloadGetAddressRetType) { + ret, _ = o.GetAddressOk() + return ret +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkCheckPayload) GetAddressOk() (ret CreateNetworkCheckPayloadGetAddressRetType, ok bool) { + return getCreateNetworkCheckPayloadGetAddressAttributeTypeOk(o.Address) +} + +// SetAddress sets field value +func (o *CreateNetworkCheckPayload) SetAddress(v CreateNetworkCheckPayloadGetAddressRetType) { + setCreateNetworkCheckPayloadGetAddressAttributeType(&o.Address, v) +} + +func (o CreateNetworkCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateNetworkCheckPayloadGetAddressAttributeTypeOk(o.Address); ok { + toSerialize["Address"] = val + } + return toSerialize, nil +} + +type NullableCreateNetworkCheckPayload struct { + value *CreateNetworkCheckPayload + isSet bool +} + +func (v NullableCreateNetworkCheckPayload) Get() *CreateNetworkCheckPayload { + return v.value +} + +func (v *NullableCreateNetworkCheckPayload) Set(val *CreateNetworkCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkCheckPayload(val *CreateNetworkCheckPayload) *NullableCreateNetworkCheckPayload { + return &NullableCreateNetworkCheckPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_network_check_payload_test.go b/services/observability/model_create_network_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_network_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_ping_check_payload.go b/services/observability/model_create_ping_check_payload.go new file mode 100644 index 000000000..414c0e808 --- /dev/null +++ b/services/observability/model_create_ping_check_payload.go @@ -0,0 +1,127 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreatePingCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreatePingCheckPayload{} + +/* + types and functions for url +*/ + +// isNotNullableString +type CreatePingCheckPayloadGetUrlAttributeType = *string + +func getCreatePingCheckPayloadGetUrlAttributeTypeOk(arg CreatePingCheckPayloadGetUrlAttributeType) (ret CreatePingCheckPayloadGetUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreatePingCheckPayloadGetUrlAttributeType(arg *CreatePingCheckPayloadGetUrlAttributeType, val CreatePingCheckPayloadGetUrlRetType) { + *arg = &val +} + +type CreatePingCheckPayloadGetUrlArgType = string +type CreatePingCheckPayloadGetUrlRetType = string + +// CreatePingCheckPayload Ping check body. +type CreatePingCheckPayload struct { + // domain to check + // REQUIRED + Url CreatePingCheckPayloadGetUrlAttributeType `json:"url" required:"true"` +} + +type _CreatePingCheckPayload CreatePingCheckPayload + +// NewCreatePingCheckPayload instantiates a new CreatePingCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePingCheckPayload(url CreatePingCheckPayloadGetUrlArgType) *CreatePingCheckPayload { + this := CreatePingCheckPayload{} + setCreatePingCheckPayloadGetUrlAttributeType(&this.Url, url) + return &this +} + +// NewCreatePingCheckPayloadWithDefaults instantiates a new CreatePingCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePingCheckPayloadWithDefaults() *CreatePingCheckPayload { + this := CreatePingCheckPayload{} + return &this +} + +// GetUrl returns the Url field value +func (o *CreatePingCheckPayload) GetUrl() (ret CreatePingCheckPayloadGetUrlRetType) { + ret, _ = o.GetUrlOk() + return ret +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CreatePingCheckPayload) GetUrlOk() (ret CreatePingCheckPayloadGetUrlRetType, ok bool) { + return getCreatePingCheckPayloadGetUrlAttributeTypeOk(o.Url) +} + +// SetUrl sets field value +func (o *CreatePingCheckPayload) SetUrl(v CreatePingCheckPayloadGetUrlRetType) { + setCreatePingCheckPayloadGetUrlAttributeType(&o.Url, v) +} + +func (o CreatePingCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreatePingCheckPayloadGetUrlAttributeTypeOk(o.Url); ok { + toSerialize["Url"] = val + } + return toSerialize, nil +} + +type NullableCreatePingCheckPayload struct { + value *CreatePingCheckPayload + isSet bool +} + +func (v NullableCreatePingCheckPayload) Get() *CreatePingCheckPayload { + return v.value +} + +func (v *NullableCreatePingCheckPayload) Set(val *CreatePingCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePingCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePingCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePingCheckPayload(val *CreatePingCheckPayload) *NullableCreatePingCheckPayload { + return &NullableCreatePingCheckPayload{value: val, isSet: true} +} + +func (v NullableCreatePingCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePingCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_ping_check_payload_test.go b/services/observability/model_create_ping_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_ping_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_postgresql_check_payload.go b/services/observability/model_create_postgresql_check_payload.go new file mode 100644 index 000000000..fac995679 --- /dev/null +++ b/services/observability/model_create_postgresql_check_payload.go @@ -0,0 +1,127 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreatePostgresqlCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreatePostgresqlCheckPayload{} + +/* + types and functions for address +*/ + +// isNotNullableString +type CreatePostgresqlCheckPayloadGetAddressAttributeType = *string + +func getCreatePostgresqlCheckPayloadGetAddressAttributeTypeOk(arg CreatePostgresqlCheckPayloadGetAddressAttributeType) (ret CreatePostgresqlCheckPayloadGetAddressRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreatePostgresqlCheckPayloadGetAddressAttributeType(arg *CreatePostgresqlCheckPayloadGetAddressAttributeType, val CreatePostgresqlCheckPayloadGetAddressRetType) { + *arg = &val +} + +type CreatePostgresqlCheckPayloadGetAddressArgType = string +type CreatePostgresqlCheckPayloadGetAddressRetType = string + +// CreatePostgresqlCheckPayload Postgresql check body. +type CreatePostgresqlCheckPayload struct { + // url to check + // REQUIRED + Address CreatePostgresqlCheckPayloadGetAddressAttributeType `json:"address" required:"true"` +} + +type _CreatePostgresqlCheckPayload CreatePostgresqlCheckPayload + +// NewCreatePostgresqlCheckPayload instantiates a new CreatePostgresqlCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePostgresqlCheckPayload(address CreatePostgresqlCheckPayloadGetAddressArgType) *CreatePostgresqlCheckPayload { + this := CreatePostgresqlCheckPayload{} + setCreatePostgresqlCheckPayloadGetAddressAttributeType(&this.Address, address) + return &this +} + +// NewCreatePostgresqlCheckPayloadWithDefaults instantiates a new CreatePostgresqlCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePostgresqlCheckPayloadWithDefaults() *CreatePostgresqlCheckPayload { + this := CreatePostgresqlCheckPayload{} + return &this +} + +// GetAddress returns the Address field value +func (o *CreatePostgresqlCheckPayload) GetAddress() (ret CreatePostgresqlCheckPayloadGetAddressRetType) { + ret, _ = o.GetAddressOk() + return ret +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *CreatePostgresqlCheckPayload) GetAddressOk() (ret CreatePostgresqlCheckPayloadGetAddressRetType, ok bool) { + return getCreatePostgresqlCheckPayloadGetAddressAttributeTypeOk(o.Address) +} + +// SetAddress sets field value +func (o *CreatePostgresqlCheckPayload) SetAddress(v CreatePostgresqlCheckPayloadGetAddressRetType) { + setCreatePostgresqlCheckPayloadGetAddressAttributeType(&o.Address, v) +} + +func (o CreatePostgresqlCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreatePostgresqlCheckPayloadGetAddressAttributeTypeOk(o.Address); ok { + toSerialize["Address"] = val + } + return toSerialize, nil +} + +type NullableCreatePostgresqlCheckPayload struct { + value *CreatePostgresqlCheckPayload + isSet bool +} + +func (v NullableCreatePostgresqlCheckPayload) Get() *CreatePostgresqlCheckPayload { + return v.value +} + +func (v *NullableCreatePostgresqlCheckPayload) Set(val *CreatePostgresqlCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePostgresqlCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePostgresqlCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePostgresqlCheckPayload(val *CreatePostgresqlCheckPayload) *NullableCreatePostgresqlCheckPayload { + return &NullableCreatePostgresqlCheckPayload{value: val, isSet: true} +} + +func (v NullableCreatePostgresqlCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePostgresqlCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_postgresql_check_payload_test.go b/services/observability/model_create_postgresql_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_postgresql_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_rabbitmq_check_payload.go b/services/observability/model_create_rabbitmq_check_payload.go new file mode 100644 index 000000000..0e5bcb2c1 --- /dev/null +++ b/services/observability/model_create_rabbitmq_check_payload.go @@ -0,0 +1,225 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateRabbitmqCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRabbitmqCheckPayload{} + +/* + types and functions for password +*/ + +// isNotNullableString +type CreateRabbitmqCheckPayloadGetPasswordAttributeType = *string + +func getCreateRabbitmqCheckPayloadGetPasswordAttributeTypeOk(arg CreateRabbitmqCheckPayloadGetPasswordAttributeType) (ret CreateRabbitmqCheckPayloadGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateRabbitmqCheckPayloadGetPasswordAttributeType(arg *CreateRabbitmqCheckPayloadGetPasswordAttributeType, val CreateRabbitmqCheckPayloadGetPasswordRetType) { + *arg = &val +} + +type CreateRabbitmqCheckPayloadGetPasswordArgType = string +type CreateRabbitmqCheckPayloadGetPasswordRetType = string + +/* + types and functions for url +*/ + +// isNotNullableString +type CreateRabbitmqCheckPayloadGetUrlAttributeType = *string + +func getCreateRabbitmqCheckPayloadGetUrlAttributeTypeOk(arg CreateRabbitmqCheckPayloadGetUrlAttributeType) (ret CreateRabbitmqCheckPayloadGetUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateRabbitmqCheckPayloadGetUrlAttributeType(arg *CreateRabbitmqCheckPayloadGetUrlAttributeType, val CreateRabbitmqCheckPayloadGetUrlRetType) { + *arg = &val +} + +type CreateRabbitmqCheckPayloadGetUrlArgType = string +type CreateRabbitmqCheckPayloadGetUrlRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type CreateRabbitmqCheckPayloadGetUsernameAttributeType = *string + +func getCreateRabbitmqCheckPayloadGetUsernameAttributeTypeOk(arg CreateRabbitmqCheckPayloadGetUsernameAttributeType) (ret CreateRabbitmqCheckPayloadGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateRabbitmqCheckPayloadGetUsernameAttributeType(arg *CreateRabbitmqCheckPayloadGetUsernameAttributeType, val CreateRabbitmqCheckPayloadGetUsernameRetType) { + *arg = &val +} + +type CreateRabbitmqCheckPayloadGetUsernameArgType = string +type CreateRabbitmqCheckPayloadGetUsernameRetType = string + +// CreateRabbitmqCheckPayload RabbitMQ check body. +type CreateRabbitmqCheckPayload struct { + // password + Password CreateRabbitmqCheckPayloadGetPasswordAttributeType `json:"password,omitempty"` + // url to check + // REQUIRED + Url CreateRabbitmqCheckPayloadGetUrlAttributeType `json:"url" required:"true"` + // username + Username CreateRabbitmqCheckPayloadGetUsernameAttributeType `json:"username,omitempty"` +} + +type _CreateRabbitmqCheckPayload CreateRabbitmqCheckPayload + +// NewCreateRabbitmqCheckPayload instantiates a new CreateRabbitmqCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRabbitmqCheckPayload(url CreateRabbitmqCheckPayloadGetUrlArgType) *CreateRabbitmqCheckPayload { + this := CreateRabbitmqCheckPayload{} + setCreateRabbitmqCheckPayloadGetUrlAttributeType(&this.Url, url) + return &this +} + +// NewCreateRabbitmqCheckPayloadWithDefaults instantiates a new CreateRabbitmqCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRabbitmqCheckPayloadWithDefaults() *CreateRabbitmqCheckPayload { + this := CreateRabbitmqCheckPayload{} + return &this +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *CreateRabbitmqCheckPayload) GetPassword() (res CreateRabbitmqCheckPayloadGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRabbitmqCheckPayload) GetPasswordOk() (ret CreateRabbitmqCheckPayloadGetPasswordRetType, ok bool) { + return getCreateRabbitmqCheckPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *CreateRabbitmqCheckPayload) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *CreateRabbitmqCheckPayload) SetPassword(v CreateRabbitmqCheckPayloadGetPasswordRetType) { + setCreateRabbitmqCheckPayloadGetPasswordAttributeType(&o.Password, v) +} + +// GetUrl returns the Url field value +func (o *CreateRabbitmqCheckPayload) GetUrl() (ret CreateRabbitmqCheckPayloadGetUrlRetType) { + ret, _ = o.GetUrlOk() + return ret +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CreateRabbitmqCheckPayload) GetUrlOk() (ret CreateRabbitmqCheckPayloadGetUrlRetType, ok bool) { + return getCreateRabbitmqCheckPayloadGetUrlAttributeTypeOk(o.Url) +} + +// SetUrl sets field value +func (o *CreateRabbitmqCheckPayload) SetUrl(v CreateRabbitmqCheckPayloadGetUrlRetType) { + setCreateRabbitmqCheckPayloadGetUrlAttributeType(&o.Url, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateRabbitmqCheckPayload) GetUsername() (res CreateRabbitmqCheckPayloadGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRabbitmqCheckPayload) GetUsernameOk() (ret CreateRabbitmqCheckPayloadGetUsernameRetType, ok bool) { + return getCreateRabbitmqCheckPayloadGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateRabbitmqCheckPayload) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateRabbitmqCheckPayload) SetUsername(v CreateRabbitmqCheckPayloadGetUsernameRetType) { + setCreateRabbitmqCheckPayloadGetUsernameAttributeType(&o.Username, v) +} + +func (o CreateRabbitmqCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateRabbitmqCheckPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getCreateRabbitmqCheckPayloadGetUrlAttributeTypeOk(o.Url); ok { + toSerialize["Url"] = val + } + if val, ok := getCreateRabbitmqCheckPayloadGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullableCreateRabbitmqCheckPayload struct { + value *CreateRabbitmqCheckPayload + isSet bool +} + +func (v NullableCreateRabbitmqCheckPayload) Get() *CreateRabbitmqCheckPayload { + return v.value +} + +func (v *NullableCreateRabbitmqCheckPayload) Set(val *CreateRabbitmqCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRabbitmqCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRabbitmqCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRabbitmqCheckPayload(val *CreateRabbitmqCheckPayload) *NullableCreateRabbitmqCheckPayload { + return &NullableCreateRabbitmqCheckPayload{value: val, isSet: true} +} + +func (v NullableCreateRabbitmqCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRabbitmqCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_rabbitmq_check_payload_test.go b/services/observability/model_create_rabbitmq_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_rabbitmq_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_redis_check_payload.go b/services/observability/model_create_redis_check_payload.go new file mode 100644 index 000000000..590b45357 --- /dev/null +++ b/services/observability/model_create_redis_check_payload.go @@ -0,0 +1,225 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateRedisCheckPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRedisCheckPayload{} + +/* + types and functions for password +*/ + +// isNotNullableString +type CreateRedisCheckPayloadGetPasswordAttributeType = *string + +func getCreateRedisCheckPayloadGetPasswordAttributeTypeOk(arg CreateRedisCheckPayloadGetPasswordAttributeType) (ret CreateRedisCheckPayloadGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateRedisCheckPayloadGetPasswordAttributeType(arg *CreateRedisCheckPayloadGetPasswordAttributeType, val CreateRedisCheckPayloadGetPasswordRetType) { + *arg = &val +} + +type CreateRedisCheckPayloadGetPasswordArgType = string +type CreateRedisCheckPayloadGetPasswordRetType = string + +/* + types and functions for server +*/ + +// isNotNullableString +type CreateRedisCheckPayloadGetServerAttributeType = *string + +func getCreateRedisCheckPayloadGetServerAttributeTypeOk(arg CreateRedisCheckPayloadGetServerAttributeType) (ret CreateRedisCheckPayloadGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateRedisCheckPayloadGetServerAttributeType(arg *CreateRedisCheckPayloadGetServerAttributeType, val CreateRedisCheckPayloadGetServerRetType) { + *arg = &val +} + +type CreateRedisCheckPayloadGetServerArgType = string +type CreateRedisCheckPayloadGetServerRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type CreateRedisCheckPayloadGetUsernameAttributeType = *string + +func getCreateRedisCheckPayloadGetUsernameAttributeTypeOk(arg CreateRedisCheckPayloadGetUsernameAttributeType) (ret CreateRedisCheckPayloadGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateRedisCheckPayloadGetUsernameAttributeType(arg *CreateRedisCheckPayloadGetUsernameAttributeType, val CreateRedisCheckPayloadGetUsernameRetType) { + *arg = &val +} + +type CreateRedisCheckPayloadGetUsernameArgType = string +type CreateRedisCheckPayloadGetUsernameRetType = string + +// CreateRedisCheckPayload Redis check body. +type CreateRedisCheckPayload struct { + // password + Password CreateRedisCheckPayloadGetPasswordAttributeType `json:"password,omitempty"` + // url to check + // REQUIRED + Server CreateRedisCheckPayloadGetServerAttributeType `json:"server" required:"true"` + // username + Username CreateRedisCheckPayloadGetUsernameAttributeType `json:"username,omitempty"` +} + +type _CreateRedisCheckPayload CreateRedisCheckPayload + +// NewCreateRedisCheckPayload instantiates a new CreateRedisCheckPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRedisCheckPayload(server CreateRedisCheckPayloadGetServerArgType) *CreateRedisCheckPayload { + this := CreateRedisCheckPayload{} + setCreateRedisCheckPayloadGetServerAttributeType(&this.Server, server) + return &this +} + +// NewCreateRedisCheckPayloadWithDefaults instantiates a new CreateRedisCheckPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRedisCheckPayloadWithDefaults() *CreateRedisCheckPayload { + this := CreateRedisCheckPayload{} + return &this +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *CreateRedisCheckPayload) GetPassword() (res CreateRedisCheckPayloadGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRedisCheckPayload) GetPasswordOk() (ret CreateRedisCheckPayloadGetPasswordRetType, ok bool) { + return getCreateRedisCheckPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *CreateRedisCheckPayload) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *CreateRedisCheckPayload) SetPassword(v CreateRedisCheckPayloadGetPasswordRetType) { + setCreateRedisCheckPayloadGetPasswordAttributeType(&o.Password, v) +} + +// GetServer returns the Server field value +func (o *CreateRedisCheckPayload) GetServer() (ret CreateRedisCheckPayloadGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *CreateRedisCheckPayload) GetServerOk() (ret CreateRedisCheckPayloadGetServerRetType, ok bool) { + return getCreateRedisCheckPayloadGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *CreateRedisCheckPayload) SetServer(v CreateRedisCheckPayloadGetServerRetType) { + setCreateRedisCheckPayloadGetServerAttributeType(&o.Server, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateRedisCheckPayload) GetUsername() (res CreateRedisCheckPayloadGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRedisCheckPayload) GetUsernameOk() (ret CreateRedisCheckPayloadGetUsernameRetType, ok bool) { + return getCreateRedisCheckPayloadGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateRedisCheckPayload) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateRedisCheckPayload) SetUsername(v CreateRedisCheckPayloadGetUsernameRetType) { + setCreateRedisCheckPayloadGetUsernameAttributeType(&o.Username, v) +} + +func (o CreateRedisCheckPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateRedisCheckPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getCreateRedisCheckPayloadGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + if val, ok := getCreateRedisCheckPayloadGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullableCreateRedisCheckPayload struct { + value *CreateRedisCheckPayload + isSet bool +} + +func (v NullableCreateRedisCheckPayload) Get() *CreateRedisCheckPayload { + return v.value +} + +func (v *NullableCreateRedisCheckPayload) Set(val *CreateRedisCheckPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRedisCheckPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRedisCheckPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRedisCheckPayload(val *CreateRedisCheckPayload) *NullableCreateRedisCheckPayload { + return &NullableCreateRedisCheckPayload{value: val, isSet: true} +} + +func (v NullableCreateRedisCheckPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRedisCheckPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_redis_check_payload_test.go b/services/observability/model_create_redis_check_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_redis_check_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_create_scrape_config_payload.go b/services/observability/model_create_scrape_config_payload.go index 1fcff0cde..6c7db53fd 100644 --- a/services/observability/model_create_scrape_config_payload.go +++ b/services/observability/model_create_scrape_config_payload.go @@ -23,9 +23,9 @@ var _ MappedNullable = &CreateScrapeConfigPayload{} */ // isModel -type CreateScrapeConfigPayloadGetBasicAuthAttributeType = *CreateScrapeConfigPayloadBasicAuth -type CreateScrapeConfigPayloadGetBasicAuthArgType = CreateScrapeConfigPayloadBasicAuth -type CreateScrapeConfigPayloadGetBasicAuthRetType = CreateScrapeConfigPayloadBasicAuth +type CreateScrapeConfigPayloadGetBasicAuthAttributeType = *PartialUpdateScrapeConfigsRequestInnerBasicAuth +type CreateScrapeConfigPayloadGetBasicAuthArgType = PartialUpdateScrapeConfigsRequestInnerBasicAuth +type CreateScrapeConfigPayloadGetBasicAuthRetType = PartialUpdateScrapeConfigsRequestInnerBasicAuth func getCreateScrapeConfigPayloadGetBasicAuthAttributeTypeOk(arg CreateScrapeConfigPayloadGetBasicAuthAttributeType) (ret CreateScrapeConfigPayloadGetBasicAuthRetType, ok bool) { if arg == nil { @@ -104,9 +104,9 @@ func setCreateScrapeConfigPayloadgetHonorTimeStampsAttributeType(arg *CreateScra */ // isArray -type CreateScrapeConfigPayloadGetHttpSdConfigsAttributeType = *[]CreateScrapeConfigPayloadHttpSdConfigsInner -type CreateScrapeConfigPayloadGetHttpSdConfigsArgType = []CreateScrapeConfigPayloadHttpSdConfigsInner -type CreateScrapeConfigPayloadGetHttpSdConfigsRetType = []CreateScrapeConfigPayloadHttpSdConfigsInner +type CreateScrapeConfigPayloadGetHttpSdConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner +type CreateScrapeConfigPayloadGetHttpSdConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner +type CreateScrapeConfigPayloadGetHttpSdConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner func getCreateScrapeConfigPayloadGetHttpSdConfigsAttributeTypeOk(arg CreateScrapeConfigPayloadGetHttpSdConfigsAttributeType) (ret CreateScrapeConfigPayloadGetHttpSdConfigsRetType, ok bool) { if arg == nil { @@ -166,9 +166,9 @@ type CreateScrapeConfigPayloadGetMetricsPathRetType = string */ // isArray -type CreateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType = *[]CreateScrapeConfigPayloadMetricsRelabelConfigsInner -type CreateScrapeConfigPayloadGetMetricsRelabelConfigsArgType = []CreateScrapeConfigPayloadMetricsRelabelConfigsInner -type CreateScrapeConfigPayloadGetMetricsRelabelConfigsRetType = []CreateScrapeConfigPayloadMetricsRelabelConfigsInner +type CreateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type CreateScrapeConfigPayloadGetMetricsRelabelConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type CreateScrapeConfigPayloadGetMetricsRelabelConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner func getCreateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeTypeOk(arg CreateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType) (ret CreateScrapeConfigPayloadGetMetricsRelabelConfigsRetType, ok bool) { if arg == nil { @@ -186,9 +186,9 @@ func setCreateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType(arg *Crea */ // isModel -type CreateScrapeConfigPayloadGetOauth2AttributeType = *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 -type CreateScrapeConfigPayloadGetOauth2ArgType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 -type CreateScrapeConfigPayloadGetOauth2RetType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 +type CreateScrapeConfigPayloadGetOauth2AttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 +type CreateScrapeConfigPayloadGetOauth2ArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 +type CreateScrapeConfigPayloadGetOauth2RetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 func getCreateScrapeConfigPayloadGetOauth2AttributeTypeOk(arg CreateScrapeConfigPayloadGetOauth2AttributeType) (ret CreateScrapeConfigPayloadGetOauth2RetType, ok bool) { if arg == nil { @@ -412,9 +412,9 @@ type CreateScrapeConfigPayloadGetScrapeTimeoutRetType = string */ // isArray -type CreateScrapeConfigPayloadGetStaticConfigsAttributeType = *[]CreateScrapeConfigPayloadStaticConfigsInner -type CreateScrapeConfigPayloadGetStaticConfigsArgType = []CreateScrapeConfigPayloadStaticConfigsInner -type CreateScrapeConfigPayloadGetStaticConfigsRetType = []CreateScrapeConfigPayloadStaticConfigsInner +type CreateScrapeConfigPayloadGetStaticConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner +type CreateScrapeConfigPayloadGetStaticConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner +type CreateScrapeConfigPayloadGetStaticConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner func getCreateScrapeConfigPayloadGetStaticConfigsAttributeTypeOk(arg CreateScrapeConfigPayloadGetStaticConfigsAttributeType) (ret CreateScrapeConfigPayloadGetStaticConfigsRetType, ok bool) { if arg == nil { @@ -432,9 +432,9 @@ func setCreateScrapeConfigPayloadGetStaticConfigsAttributeType(arg *CreateScrape */ // isModel -type CreateScrapeConfigPayloadGetTlsConfigAttributeType = *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type CreateScrapeConfigPayloadGetTlsConfigArgType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type CreateScrapeConfigPayloadGetTlsConfigRetType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig +type CreateScrapeConfigPayloadGetTlsConfigAttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type CreateScrapeConfigPayloadGetTlsConfigArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type CreateScrapeConfigPayloadGetTlsConfigRetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig func getCreateScrapeConfigPayloadGetTlsConfigAttributeTypeOk(arg CreateScrapeConfigPayloadGetTlsConfigAttributeType) (ret CreateScrapeConfigPayloadGetTlsConfigRetType, ok bool) { if arg == nil { @@ -533,7 +533,7 @@ func (o *CreateScrapeConfigPayload) HasBasicAuth() bool { return ok } -// SetBasicAuth gets a reference to the given CreateScrapeConfigPayloadBasicAuth and assigns it to the BasicAuth field. +// SetBasicAuth gets a reference to the given PartialUpdateScrapeConfigsRequestInnerBasicAuth and assigns it to the BasicAuth field. func (o *CreateScrapeConfigPayload) SetBasicAuth(v CreateScrapeConfigPayloadGetBasicAuthRetType) { setCreateScrapeConfigPayloadGetBasicAuthAttributeType(&o.BasicAuth, v) } @@ -625,7 +625,7 @@ func (o *CreateScrapeConfigPayload) HasHttpSdConfigs() bool { return ok } -// SetHttpSdConfigs gets a reference to the given []CreateScrapeConfigPayloadHttpSdConfigsInner and assigns it to the HttpSdConfigs field. +// SetHttpSdConfigs gets a reference to the given []PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner and assigns it to the HttpSdConfigs field. func (o *CreateScrapeConfigPayload) SetHttpSdConfigs(v CreateScrapeConfigPayloadGetHttpSdConfigsRetType) { setCreateScrapeConfigPayloadGetHttpSdConfigsAttributeType(&o.HttpSdConfigs, v) } @@ -688,7 +688,7 @@ func (o *CreateScrapeConfigPayload) HasMetricsRelabelConfigs() bool { return ok } -// SetMetricsRelabelConfigs gets a reference to the given []CreateScrapeConfigPayloadMetricsRelabelConfigsInner and assigns it to the MetricsRelabelConfigs field. +// SetMetricsRelabelConfigs gets a reference to the given []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner and assigns it to the MetricsRelabelConfigs field. func (o *CreateScrapeConfigPayload) SetMetricsRelabelConfigs(v CreateScrapeConfigPayloadGetMetricsRelabelConfigsRetType) { setCreateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType(&o.MetricsRelabelConfigs, v) } @@ -711,7 +711,7 @@ func (o *CreateScrapeConfigPayload) HasOauth2() bool { return ok } -// SetOauth2 gets a reference to the given CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 and assigns it to the Oauth2 field. +// SetOauth2 gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 and assigns it to the Oauth2 field. func (o *CreateScrapeConfigPayload) SetOauth2(v CreateScrapeConfigPayloadGetOauth2RetType) { setCreateScrapeConfigPayloadGetOauth2AttributeType(&o.Oauth2, v) } @@ -848,7 +848,7 @@ func (o *CreateScrapeConfigPayload) HasTlsConfig() bool { return ok } -// SetTlsConfig gets a reference to the given CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. +// SetTlsConfig gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. func (o *CreateScrapeConfigPayload) SetTlsConfig(v CreateScrapeConfigPayloadGetTlsConfigRetType) { setCreateScrapeConfigPayloadGetTlsConfigAttributeType(&o.TlsConfig, v) } diff --git a/services/observability/model_create_scrape_config_payload_basic_auth.go b/services/observability/model_create_scrape_config_payload_basic_auth.go deleted file mode 100644 index 8b2551856..000000000 --- a/services/observability/model_create_scrape_config_payload_basic_auth.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" -) - -// checks if the CreateScrapeConfigPayloadBasicAuth type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateScrapeConfigPayloadBasicAuth{} - -/* - types and functions for password -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadBasicAuthGetPasswordAttributeType = *string - -func getCreateScrapeConfigPayloadBasicAuthGetPasswordAttributeTypeOk(arg CreateScrapeConfigPayloadBasicAuthGetPasswordAttributeType) (ret CreateScrapeConfigPayloadBasicAuthGetPasswordRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadBasicAuthGetPasswordAttributeType(arg *CreateScrapeConfigPayloadBasicAuthGetPasswordAttributeType, val CreateScrapeConfigPayloadBasicAuthGetPasswordRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadBasicAuthGetPasswordArgType = string -type CreateScrapeConfigPayloadBasicAuthGetPasswordRetType = string - -/* - types and functions for username -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadBasicAuthGetUsernameAttributeType = *string - -func getCreateScrapeConfigPayloadBasicAuthGetUsernameAttributeTypeOk(arg CreateScrapeConfigPayloadBasicAuthGetUsernameAttributeType) (ret CreateScrapeConfigPayloadBasicAuthGetUsernameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadBasicAuthGetUsernameAttributeType(arg *CreateScrapeConfigPayloadBasicAuthGetUsernameAttributeType, val CreateScrapeConfigPayloadBasicAuthGetUsernameRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadBasicAuthGetUsernameArgType = string -type CreateScrapeConfigPayloadBasicAuthGetUsernameRetType = string - -// CreateScrapeConfigPayloadBasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password. `Additional Validators:` * if basicAuth is in the body no other authentication method should be in the body -type CreateScrapeConfigPayloadBasicAuth struct { - // password - Password CreateScrapeConfigPayloadBasicAuthGetPasswordAttributeType `json:"password,omitempty"` - // username - Username CreateScrapeConfigPayloadBasicAuthGetUsernameAttributeType `json:"username,omitempty"` -} - -// NewCreateScrapeConfigPayloadBasicAuth instantiates a new CreateScrapeConfigPayloadBasicAuth object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateScrapeConfigPayloadBasicAuth() *CreateScrapeConfigPayloadBasicAuth { - this := CreateScrapeConfigPayloadBasicAuth{} - return &this -} - -// NewCreateScrapeConfigPayloadBasicAuthWithDefaults instantiates a new CreateScrapeConfigPayloadBasicAuth object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateScrapeConfigPayloadBasicAuthWithDefaults() *CreateScrapeConfigPayloadBasicAuth { - this := CreateScrapeConfigPayloadBasicAuth{} - return &this -} - -// GetPassword returns the Password field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadBasicAuth) GetPassword() (res CreateScrapeConfigPayloadBasicAuthGetPasswordRetType) { - res, _ = o.GetPasswordOk() - return -} - -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadBasicAuth) GetPasswordOk() (ret CreateScrapeConfigPayloadBasicAuthGetPasswordRetType, ok bool) { - return getCreateScrapeConfigPayloadBasicAuthGetPasswordAttributeTypeOk(o.Password) -} - -// HasPassword returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadBasicAuth) HasPassword() bool { - _, ok := o.GetPasswordOk() - return ok -} - -// SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *CreateScrapeConfigPayloadBasicAuth) SetPassword(v CreateScrapeConfigPayloadBasicAuthGetPasswordRetType) { - setCreateScrapeConfigPayloadBasicAuthGetPasswordAttributeType(&o.Password, v) -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadBasicAuth) GetUsername() (res CreateScrapeConfigPayloadBasicAuthGetUsernameRetType) { - res, _ = o.GetUsernameOk() - return -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadBasicAuth) GetUsernameOk() (ret CreateScrapeConfigPayloadBasicAuthGetUsernameRetType, ok bool) { - return getCreateScrapeConfigPayloadBasicAuthGetUsernameAttributeTypeOk(o.Username) -} - -// HasUsername returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadBasicAuth) HasUsername() bool { - _, ok := o.GetUsernameOk() - return ok -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *CreateScrapeConfigPayloadBasicAuth) SetUsername(v CreateScrapeConfigPayloadBasicAuthGetUsernameRetType) { - setCreateScrapeConfigPayloadBasicAuthGetUsernameAttributeType(&o.Username, v) -} - -func (o CreateScrapeConfigPayloadBasicAuth) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateScrapeConfigPayloadBasicAuthGetPasswordAttributeTypeOk(o.Password); ok { - toSerialize["Password"] = val - } - if val, ok := getCreateScrapeConfigPayloadBasicAuthGetUsernameAttributeTypeOk(o.Username); ok { - toSerialize["Username"] = val - } - return toSerialize, nil -} - -type NullableCreateScrapeConfigPayloadBasicAuth struct { - value *CreateScrapeConfigPayloadBasicAuth - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadBasicAuth) Get() *CreateScrapeConfigPayloadBasicAuth { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadBasicAuth) Set(val *CreateScrapeConfigPayloadBasicAuth) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadBasicAuth) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadBasicAuth) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadBasicAuth(val *CreateScrapeConfigPayloadBasicAuth) *NullableCreateScrapeConfigPayloadBasicAuth { - return &NullableCreateScrapeConfigPayloadBasicAuth{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadBasicAuth) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadBasicAuth) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner.go b/services/observability/model_create_scrape_config_payload_http_sd_configs_inner.go deleted file mode 100644 index 369b532df..000000000 --- a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner.go +++ /dev/null @@ -1,319 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" -) - -// checks if the CreateScrapeConfigPayloadHttpSdConfigsInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateScrapeConfigPayloadHttpSdConfigsInner{} - -/* - types and functions for basicAuth -*/ - -// isModel -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeType = *CreateScrapeConfigPayloadBasicAuth -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthArgType = CreateScrapeConfigPayloadBasicAuth -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthRetType = CreateScrapeConfigPayloadBasicAuth - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthRetType) { - *arg = &val -} - -/* - types and functions for oauth2 -*/ - -// isModel -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeType = *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2ArgType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2RetType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2RetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2RetType) { - *arg = &val -} - -/* - types and functions for refreshInterval -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeType = *string - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalArgType = string -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalRetType = string - -/* - types and functions for tlsConfig -*/ - -// isModel -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeType = *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigArgType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigRetType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigRetType) { - *arg = &val -} - -/* - types and functions for url -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType = *string - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlArgType = string -type CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlRetType = string - -// CreateScrapeConfigPayloadHttpSdConfigsInner struct for CreateScrapeConfigPayloadHttpSdConfigsInner -type CreateScrapeConfigPayloadHttpSdConfigsInner struct { - BasicAuth CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeType `json:"basicAuth,omitempty"` - Oauth2 CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeType `json:"oauth2,omitempty"` - // Refresh interval to re-query the endpoint. E.g. 60s `Additional Validators:` * must be a valid time format* must be >= 60s - RefreshInterval CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeType `json:"refreshInterval,omitempty"` - TlsConfig CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeType `json:"tlsConfig,omitempty"` - // URL from which the targets are fetched. - // REQUIRED - Url CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType `json:"url" required:"true"` -} - -type _CreateScrapeConfigPayloadHttpSdConfigsInner CreateScrapeConfigPayloadHttpSdConfigsInner - -// NewCreateScrapeConfigPayloadHttpSdConfigsInner instantiates a new CreateScrapeConfigPayloadHttpSdConfigsInner object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateScrapeConfigPayloadHttpSdConfigsInner(url CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlArgType) *CreateScrapeConfigPayloadHttpSdConfigsInner { - this := CreateScrapeConfigPayloadHttpSdConfigsInner{} - setCreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType(&this.Url, url) - return &this -} - -// NewCreateScrapeConfigPayloadHttpSdConfigsInnerWithDefaults instantiates a new CreateScrapeConfigPayloadHttpSdConfigsInner object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateScrapeConfigPayloadHttpSdConfigsInnerWithDefaults() *CreateScrapeConfigPayloadHttpSdConfigsInner { - this := CreateScrapeConfigPayloadHttpSdConfigsInner{} - var refreshInterval string = "60s" - this.RefreshInterval = &refreshInterval - return &this -} - -// GetBasicAuth returns the BasicAuth field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetBasicAuth() (res CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthRetType) { - res, _ = o.GetBasicAuthOk() - return -} - -// GetBasicAuthOk returns a tuple with the BasicAuth field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetBasicAuthOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeTypeOk(o.BasicAuth) -} - -// HasBasicAuth returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) HasBasicAuth() bool { - _, ok := o.GetBasicAuthOk() - return ok -} - -// SetBasicAuth gets a reference to the given CreateScrapeConfigPayloadBasicAuth and assigns it to the BasicAuth field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) SetBasicAuth(v CreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeType(&o.BasicAuth, v) -} - -// GetOauth2 returns the Oauth2 field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetOauth2() (res CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2RetType) { - res, _ = o.GetOauth2Ok() - return -} - -// GetOauth2Ok returns a tuple with the Oauth2 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetOauth2Ok() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2RetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeTypeOk(o.Oauth2) -} - -// HasOauth2 returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) HasOauth2() bool { - _, ok := o.GetOauth2Ok() - return ok -} - -// SetOauth2 gets a reference to the given CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 and assigns it to the Oauth2 field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) SetOauth2(v CreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2RetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeType(&o.Oauth2, v) -} - -// GetRefreshInterval returns the RefreshInterval field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetRefreshInterval() (res CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalRetType) { - res, _ = o.GetRefreshIntervalOk() - return -} - -// GetRefreshIntervalOk returns a tuple with the RefreshInterval field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetRefreshIntervalOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeTypeOk(o.RefreshInterval) -} - -// HasRefreshInterval returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) HasRefreshInterval() bool { - _, ok := o.GetRefreshIntervalOk() - return ok -} - -// SetRefreshInterval gets a reference to the given string and assigns it to the RefreshInterval field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) SetRefreshInterval(v CreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeType(&o.RefreshInterval, v) -} - -// GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetTlsConfig() (res CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigRetType) { - res, _ = o.GetTlsConfigOk() - return -} - -// GetTlsConfigOk returns a tuple with the TlsConfig field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetTlsConfigOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeTypeOk(o.TlsConfig) -} - -// HasTlsConfig returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) HasTlsConfig() bool { - _, ok := o.GetTlsConfigOk() - return ok -} - -// SetTlsConfig gets a reference to the given CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) SetTlsConfig(v CreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeType(&o.TlsConfig, v) -} - -// GetUrl returns the Url field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetUrl() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlRetType) { - ret, _ = o.GetUrlOk() - return ret -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) GetUrlOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeTypeOk(o.Url) -} - -// SetUrl sets field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInner) SetUrl(v CreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeType(&o.Url, v) -} - -func (o CreateScrapeConfigPayloadHttpSdConfigsInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerGetBasicAuthAttributeTypeOk(o.BasicAuth); ok { - toSerialize["BasicAuth"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerGetOauth2AttributeTypeOk(o.Oauth2); ok { - toSerialize["Oauth2"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerGetRefreshIntervalAttributeTypeOk(o.RefreshInterval); ok { - toSerialize["RefreshInterval"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerGetTlsConfigAttributeTypeOk(o.TlsConfig); ok { - toSerialize["TlsConfig"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerGetUrlAttributeTypeOk(o.Url); ok { - toSerialize["Url"] = val - } - return toSerialize, nil -} - -type NullableCreateScrapeConfigPayloadHttpSdConfigsInner struct { - value *CreateScrapeConfigPayloadHttpSdConfigsInner - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInner) Get() *CreateScrapeConfigPayloadHttpSdConfigsInner { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInner) Set(val *CreateScrapeConfigPayloadHttpSdConfigsInner) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInner) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadHttpSdConfigsInner(val *CreateScrapeConfigPayloadHttpSdConfigsInner) *NullableCreateScrapeConfigPayloadHttpSdConfigsInner { - return &NullableCreateScrapeConfigPayloadHttpSdConfigsInner{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2.go b/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2.go deleted file mode 100644 index 87d1edcad..000000000 --- a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" -) - -// checks if the CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2{} - -/* - types and functions for clientId -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType = *string - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdArgType = string -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdRetType = string - -/* - types and functions for clientSecret -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType = *string - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretArgType = string -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretRetType = string - -/* - types and functions for scopes -*/ - -// isArray -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeType = *[]string -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesArgType = []string -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesRetType = []string - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesRetType) { - *arg = &val -} - -/* - types and functions for tlsConfig -*/ - -// isModel -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeType = *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigArgType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigRetType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigRetType) { - *arg = &val -} - -/* - types and functions for tokenUrl -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType = *string - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlArgType = string -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlRetType = string - -// CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys. `Additional Validators:` * if oauth2 is in the body no other authentication method should be in the body -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 struct { - // clientId - // REQUIRED - ClientId CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType `json:"clientId" required:"true"` - // clientSecret - // REQUIRED - ClientSecret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType `json:"clientSecret" required:"true"` - // The URL to fetch the token from. - Scopes CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeType `json:"scopes,omitempty"` - TlsConfig CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeType `json:"tlsConfig,omitempty"` - // The URL to fetch the token from. - // REQUIRED - TokenUrl CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType `json:"tokenUrl" required:"true"` -} - -type _CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 - -// NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 instantiates a new CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2(clientId CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdArgType, clientSecret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretArgType, tokenUrl CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlArgType) *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 { - this := CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2{} - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType(&this.ClientId, clientId) - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType(&this.ClientSecret, clientSecret) - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType(&this.TokenUrl, tokenUrl) - return &this -} - -// NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2WithDefaults instantiates a new CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2WithDefaults() *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 { - this := CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2{} - return &this -} - -// GetClientId returns the ClientId field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetClientId() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdRetType) { - ret, _ = o.GetClientIdOk() - return ret -} - -// GetClientIdOk returns a tuple with the ClientId field value -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetClientIdOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeTypeOk(o.ClientId) -} - -// SetClientId sets field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) SetClientId(v CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeType(&o.ClientId, v) -} - -// GetClientSecret returns the ClientSecret field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetClientSecret() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretRetType) { - ret, _ = o.GetClientSecretOk() - return ret -} - -// GetClientSecretOk returns a tuple with the ClientSecret field value -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetClientSecretOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeTypeOk(o.ClientSecret) -} - -// SetClientSecret sets field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) SetClientSecret(v CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeType(&o.ClientSecret, v) -} - -// GetScopes returns the Scopes field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetScopes() (res CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesRetType) { - res, _ = o.GetScopesOk() - return -} - -// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetScopesOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeTypeOk(o.Scopes) -} - -// HasScopes returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) HasScopes() bool { - _, ok := o.GetScopesOk() - return ok -} - -// SetScopes gets a reference to the given []string and assigns it to the Scopes field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) SetScopes(v CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeType(&o.Scopes, v) -} - -// GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetTlsConfig() (res CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigRetType) { - res, _ = o.GetTlsConfigOk() - return -} - -// GetTlsConfigOk returns a tuple with the TlsConfig field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetTlsConfigOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeTypeOk(o.TlsConfig) -} - -// HasTlsConfig returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) HasTlsConfig() bool { - _, ok := o.GetTlsConfigOk() - return ok -} - -// SetTlsConfig gets a reference to the given CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) SetTlsConfig(v CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeType(&o.TlsConfig, v) -} - -// GetTokenUrl returns the TokenUrl field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetTokenUrl() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlRetType) { - ret, _ = o.GetTokenUrlOk() - return ret -} - -// GetTokenUrlOk returns a tuple with the TokenUrl field value -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) GetTokenUrlOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeTypeOk(o.TokenUrl) -} - -// SetTokenUrl sets field value -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) SetTokenUrl(v CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeType(&o.TokenUrl, v) -} - -func (o CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientIdAttributeTypeOk(o.ClientId); ok { - toSerialize["ClientId"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetClientSecretAttributeTypeOk(o.ClientSecret); ok { - toSerialize["ClientSecret"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetScopesAttributeTypeOk(o.Scopes); ok { - toSerialize["Scopes"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTlsConfigAttributeTypeOk(o.TlsConfig); ok { - toSerialize["TlsConfig"] = val - } - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2GetTokenUrlAttributeTypeOk(o.TokenUrl); ok { - toSerialize["TokenUrl"] = val - } - return toSerialize, nil -} - -type NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 struct { - value *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) Get() *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) Set(val *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2(val *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 { - return &NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.go b/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.go deleted file mode 100644 index 8c9c34f38..000000000 --- a/services/observability/model_create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" -) - -// checks if the CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig{} - -/* - types and functions for insecureSkipVerify -*/ - -// isBoolean -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType = *bool -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyArgType = bool -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType = bool - -func getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeTypeOk(arg CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType) (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType(arg *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType, val CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType) { - *arg = &val -} - -// CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig Configures the scrape request's TLS settings. -type CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig struct { - // Disable validation of the server certificate. - InsecureSkipVerify CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType `json:"insecureSkipVerify,omitempty"` -} - -// NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig instantiates a new CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig() *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig { - this := CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig{} - return &this -} - -// NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfigWithDefaults instantiates a new CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfigWithDefaults() *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig { - this := CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig{} - var insecureSkipVerify bool = false - this.InsecureSkipVerify = &insecureSkipVerify - return &this -} - -// GetInsecureSkipVerify returns the InsecureSkipVerify field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) GetInsecureSkipVerify() (res CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType) { - res, _ = o.GetInsecureSkipVerifyOk() - return -} - -// GetInsecureSkipVerifyOk returns a tuple with the InsecureSkipVerify field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) GetInsecureSkipVerifyOk() (ret CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType, ok bool) { - return getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeTypeOk(o.InsecureSkipVerify) -} - -// HasInsecureSkipVerify returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) HasInsecureSkipVerify() bool { - _, ok := o.GetInsecureSkipVerifyOk() - return ok -} - -// SetInsecureSkipVerify gets a reference to the given bool and assigns it to the InsecureSkipVerify field. -func (o *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) SetInsecureSkipVerify(v CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType) { - setCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType(&o.InsecureSkipVerify, v) -} - -func (o CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeTypeOk(o.InsecureSkipVerify); ok { - toSerialize["InsecureSkipVerify"] = val - } - return toSerialize, nil -} - -type NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig struct { - value *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) Get() *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) Set(val *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig(val *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig { - return &NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_create_scrape_config_payload_metrics_relabel_configs_inner.go b/services/observability/model_create_scrape_config_payload_metrics_relabel_configs_inner.go deleted file mode 100644 index 6169f8142..000000000 --- a/services/observability/model_create_scrape_config_payload_metrics_relabel_configs_inner.go +++ /dev/null @@ -1,543 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateScrapeConfigPayloadMetricsRelabelConfigsInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateScrapeConfigPayloadMetricsRelabelConfigsInner{} - -/* - types and functions for action -*/ - -// isEnum - -// CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body -// value type for enums -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction string - -// List of Action -const ( - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "replace" - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_KEEP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "keep" - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_DROP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "drop" - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_HASHMOD CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "hashmod" - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELMAP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labelmap" - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELDROP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labeldrop" - CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELKEEP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labelkeep" -) - -// All allowed values of CreateScrapeConfigPayloadMetricsRelabelConfigsInner enum -var AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues = []CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction{ - "replace", - "keep", - "drop", - "hashmod", - "labelmap", - "labeldrop", - "labelkeep", -} - -func (v *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { - // use a type alias to prevent infinite recursion during unmarshal, - // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers - type TmpJson CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction - var value TmpJson - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue TmpJson - if value == zeroValue { - return nil - } - enumTypeValue := CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(value) - for _, existing := range AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid CreateScrapeConfigPayloadMetricsRelabelConfigsInner", value) -} - -// NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionFromValue returns a pointer to a valid CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionFromValue(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) (*CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction, error) { - ev := CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction: valid values are %v", v, AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) IsValid() bool { - for _, existing := range AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ActionAction value -func (v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Ptr() *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { - return &v -} - -type NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction struct { - value *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Get() *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Set(val *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(val *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { - return &NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType = *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionArgType = CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionRetType = CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionRetType) { - *arg = &val -} - -/* - types and functions for modulus -*/ - -// isNumber -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeType = *float64 -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusArgType = float64 -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusRetType = float64 - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusRetType) { - *arg = &val -} - -/* - types and functions for regex -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeType = *string - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexArgType = string -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexRetType = string - -/* - types and functions for replacement -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeType = *string - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementArgType = string -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementRetType = string - -/* - types and functions for separator -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeType = *string - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorArgType = string -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorRetType = string - -/* - types and functions for sourceLabels -*/ - -// isArray -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeType = *[]string -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsArgType = []string -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsRetType = []string - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsRetType) { - *arg = &val -} - -/* - types and functions for targetLabel -*/ - -// isNotNullableString -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeType = *string - -func getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeTypeOk(arg CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeType) (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeType(arg *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeType, val CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelRetType) { - *arg = &val -} - -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelArgType = string -type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelRetType = string - -// CreateScrapeConfigPayloadMetricsRelabelConfigsInner struct for CreateScrapeConfigPayloadMetricsRelabelConfigsInner -type CreateScrapeConfigPayloadMetricsRelabelConfigsInner struct { - // Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body - Action CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType `json:"action,omitempty"` - // Modulus to take of the hash of the source label values. - Modulus CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeType `json:"modulus,omitempty"` - // Regular expression against which the extracted value is matched. - Regex CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeType `json:"regex,omitempty"` - // Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. - Replacement CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeType `json:"replacement,omitempty"` - // Separator placed between concatenated source label values. - Separator CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeType `json:"separator,omitempty"` - // The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. - SourceLabels CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeType `json:"sourceLabels,omitempty"` - // Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. - TargetLabel CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeType `json:"targetLabel,omitempty"` -} - -// NewCreateScrapeConfigPayloadMetricsRelabelConfigsInner instantiates a new CreateScrapeConfigPayloadMetricsRelabelConfigsInner object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInner() *CreateScrapeConfigPayloadMetricsRelabelConfigsInner { - this := CreateScrapeConfigPayloadMetricsRelabelConfigsInner{} - return &this -} - -// NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerWithDefaults instantiates a new CreateScrapeConfigPayloadMetricsRelabelConfigsInner object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerWithDefaults() *CreateScrapeConfigPayloadMetricsRelabelConfigsInner { - this := CreateScrapeConfigPayloadMetricsRelabelConfigsInner{} - var action CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "replace" - this.Action = &action - var regex string = ".*" - this.Regex = ®ex - var replacement string = "$1" - this.Replacement = &replacement - var separator string = ";" - this.Separator = &separator - return &this -} - -// GetAction returns the Action field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionRetType) { - res, _ = o.GetActionOk() - return -} - -// GetActionOk returns a tuple with the Action field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetActionOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeTypeOk(o.Action) -} - -// HasAction returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasAction() bool { - _, ok := o.GetActionOk() - return ok -} - -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetAction(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType(&o.Action, v) -} - -// GetModulus returns the Modulus field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetModulus() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusRetType) { - res, _ = o.GetModulusOk() - return -} - -// GetModulusOk returns a tuple with the Modulus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetModulusOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeTypeOk(o.Modulus) -} - -// HasModulus returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasModulus() bool { - _, ok := o.GetModulusOk() - return ok -} - -// SetModulus gets a reference to the given float64 and assigns it to the Modulus field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetModulus(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeType(&o.Modulus, v) -} - -// GetRegex returns the Regex field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetRegex() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexRetType) { - res, _ = o.GetRegexOk() - return -} - -// GetRegexOk returns a tuple with the Regex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetRegexOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeTypeOk(o.Regex) -} - -// HasRegex returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasRegex() bool { - _, ok := o.GetRegexOk() - return ok -} - -// SetRegex gets a reference to the given string and assigns it to the Regex field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetRegex(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeType(&o.Regex, v) -} - -// GetReplacement returns the Replacement field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetReplacement() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementRetType) { - res, _ = o.GetReplacementOk() - return -} - -// GetReplacementOk returns a tuple with the Replacement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetReplacementOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeTypeOk(o.Replacement) -} - -// HasReplacement returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasReplacement() bool { - _, ok := o.GetReplacementOk() - return ok -} - -// SetReplacement gets a reference to the given string and assigns it to the Replacement field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetReplacement(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeType(&o.Replacement, v) -} - -// GetSeparator returns the Separator field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetSeparator() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorRetType) { - res, _ = o.GetSeparatorOk() - return -} - -// GetSeparatorOk returns a tuple with the Separator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetSeparatorOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeTypeOk(o.Separator) -} - -// HasSeparator returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasSeparator() bool { - _, ok := o.GetSeparatorOk() - return ok -} - -// SetSeparator gets a reference to the given string and assigns it to the Separator field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetSeparator(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeType(&o.Separator, v) -} - -// GetSourceLabels returns the SourceLabels field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetSourceLabels() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsRetType) { - res, _ = o.GetSourceLabelsOk() - return -} - -// GetSourceLabelsOk returns a tuple with the SourceLabels field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetSourceLabelsOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeTypeOk(o.SourceLabels) -} - -// HasSourceLabels returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasSourceLabels() bool { - _, ok := o.GetSourceLabelsOk() - return ok -} - -// SetSourceLabels gets a reference to the given []string and assigns it to the SourceLabels field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetSourceLabels(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeType(&o.SourceLabels, v) -} - -// GetTargetLabel returns the TargetLabel field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetTargetLabel() (res CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelRetType) { - res, _ = o.GetTargetLabelOk() - return -} - -// GetTargetLabelOk returns a tuple with the TargetLabel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetTargetLabelOk() (ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelRetType, ok bool) { - return getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeTypeOk(o.TargetLabel) -} - -// HasTargetLabel returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasTargetLabel() bool { - _, ok := o.GetTargetLabelOk() - return ok -} - -// SetTargetLabel gets a reference to the given string and assigns it to the TargetLabel field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetTargetLabel(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelRetType) { - setCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeType(&o.TargetLabel, v) -} - -func (o CreateScrapeConfigPayloadMetricsRelabelConfigsInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeTypeOk(o.Action); ok { - toSerialize["Action"] = val - } - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetModulusAttributeTypeOk(o.Modulus); ok { - toSerialize["Modulus"] = val - } - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetRegexAttributeTypeOk(o.Regex); ok { - toSerialize["Regex"] = val - } - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetReplacementAttributeTypeOk(o.Replacement); ok { - toSerialize["Replacement"] = val - } - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSeparatorAttributeTypeOk(o.Separator); ok { - toSerialize["Separator"] = val - } - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetSourceLabelsAttributeTypeOk(o.SourceLabels); ok { - toSerialize["SourceLabels"] = val - } - if val, ok := getCreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetTargetLabelAttributeTypeOk(o.TargetLabel); ok { - toSerialize["TargetLabel"] = val - } - return toSerialize, nil -} - -type NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner struct { - value *CreateScrapeConfigPayloadMetricsRelabelConfigsInner - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner) Get() *CreateScrapeConfigPayloadMetricsRelabelConfigsInner { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner) Set(val *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner(val *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner { - return &NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_create_scrape_config_payload_static_configs_inner.go b/services/observability/model_create_scrape_config_payload_static_configs_inner.go deleted file mode 100644 index c6b557a66..000000000 --- a/services/observability/model_create_scrape_config_payload_static_configs_inner.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -STACKIT Observability API - -API endpoints for Observability on STACKIT - -API version: 1.1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package observability - -import ( - "encoding/json" -) - -// checks if the CreateScrapeConfigPayloadStaticConfigsInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateScrapeConfigPayloadStaticConfigsInner{} - -/* - types and functions for labels -*/ - -// isFreeform -type CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeType = *map[string]interface{} -type CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsArgType = map[string]interface{} -type CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsRetType = map[string]interface{} - -func getCreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeTypeOk(arg CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeType) (ret CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeType(arg *CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeType, val CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for targets -*/ - -// isArray -type CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType = *[]string -type CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsArgType = []string -type CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsRetType = []string - -func getCreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeTypeOk(arg CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType) (ret CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType(arg *CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType, val CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsRetType) { - *arg = &val -} - -// CreateScrapeConfigPayloadStaticConfigsInner struct for CreateScrapeConfigPayloadStaticConfigsInner -type CreateScrapeConfigPayloadStaticConfigsInner struct { - // Labels assigned to all metrics scraped from the targets. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters - Labels CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeType `json:"labels,omitempty"` - // The targets specified by the static config. - // REQUIRED - Targets CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType `json:"targets" required:"true"` -} - -type _CreateScrapeConfigPayloadStaticConfigsInner CreateScrapeConfigPayloadStaticConfigsInner - -// NewCreateScrapeConfigPayloadStaticConfigsInner instantiates a new CreateScrapeConfigPayloadStaticConfigsInner object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateScrapeConfigPayloadStaticConfigsInner(targets CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsArgType) *CreateScrapeConfigPayloadStaticConfigsInner { - this := CreateScrapeConfigPayloadStaticConfigsInner{} - setCreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType(&this.Targets, targets) - return &this -} - -// NewCreateScrapeConfigPayloadStaticConfigsInnerWithDefaults instantiates a new CreateScrapeConfigPayloadStaticConfigsInner object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateScrapeConfigPayloadStaticConfigsInnerWithDefaults() *CreateScrapeConfigPayloadStaticConfigsInner { - this := CreateScrapeConfigPayloadStaticConfigsInner{} - return &this -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadStaticConfigsInner) GetLabels() (res CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsRetType) { - res, _ = o.GetLabelsOk() - return -} - -// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadStaticConfigsInner) GetLabelsOk() (ret CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsRetType, ok bool) { - return getCreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateScrapeConfigPayloadStaticConfigsInner) HasLabels() bool { - _, ok := o.GetLabelsOk() - return ok -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *CreateScrapeConfigPayloadStaticConfigsInner) SetLabels(v CreateScrapeConfigPayloadStaticConfigsInnerGetLabelsRetType) { - setCreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeType(&o.Labels, v) -} - -// GetTargets returns the Targets field value -func (o *CreateScrapeConfigPayloadStaticConfigsInner) GetTargets() (ret CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsRetType) { - ret, _ = o.GetTargetsOk() - return ret -} - -// GetTargetsOk returns a tuple with the Targets field value -// and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadStaticConfigsInner) GetTargetsOk() (ret CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsRetType, ok bool) { - return getCreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeTypeOk(o.Targets) -} - -// SetTargets sets field value -func (o *CreateScrapeConfigPayloadStaticConfigsInner) SetTargets(v CreateScrapeConfigPayloadStaticConfigsInnerGetTargetsRetType) { - setCreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeType(&o.Targets, v) -} - -func (o CreateScrapeConfigPayloadStaticConfigsInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateScrapeConfigPayloadStaticConfigsInnerGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val - } - if val, ok := getCreateScrapeConfigPayloadStaticConfigsInnerGetTargetsAttributeTypeOk(o.Targets); ok { - toSerialize["Targets"] = val - } - return toSerialize, nil -} - -type NullableCreateScrapeConfigPayloadStaticConfigsInner struct { - value *CreateScrapeConfigPayloadStaticConfigsInner - isSet bool -} - -func (v NullableCreateScrapeConfigPayloadStaticConfigsInner) Get() *CreateScrapeConfigPayloadStaticConfigsInner { - return v.value -} - -func (v *NullableCreateScrapeConfigPayloadStaticConfigsInner) Set(val *CreateScrapeConfigPayloadStaticConfigsInner) { - v.value = val - v.isSet = true -} - -func (v NullableCreateScrapeConfigPayloadStaticConfigsInner) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateScrapeConfigPayloadStaticConfigsInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateScrapeConfigPayloadStaticConfigsInner(val *CreateScrapeConfigPayloadStaticConfigsInner) *NullableCreateScrapeConfigPayloadStaticConfigsInner { - return &NullableCreateScrapeConfigPayloadStaticConfigsInner{value: val, isSet: true} -} - -func (v NullableCreateScrapeConfigPayloadStaticConfigsInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateScrapeConfigPayloadStaticConfigsInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/observability/model_elasticsearch_check_child_response.go b/services/observability/model_elasticsearch_check_child_response.go new file mode 100644 index 000000000..f75ca984b --- /dev/null +++ b/services/observability/model_elasticsearch_check_child_response.go @@ -0,0 +1,266 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the ElasticsearchCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ElasticsearchCheckChildResponse{} + +/* + types and functions for id +*/ + +// isNotNullableString +type ElasticsearchCheckChildResponseGetIdAttributeType = *string + +func getElasticsearchCheckChildResponseGetIdAttributeTypeOk(arg ElasticsearchCheckChildResponseGetIdAttributeType) (ret ElasticsearchCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckChildResponseGetIdAttributeType(arg *ElasticsearchCheckChildResponseGetIdAttributeType, val ElasticsearchCheckChildResponseGetIdRetType) { + *arg = &val +} + +type ElasticsearchCheckChildResponseGetIdArgType = string +type ElasticsearchCheckChildResponseGetIdRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +type ElasticsearchCheckChildResponseGetPasswordAttributeType = *string + +func getElasticsearchCheckChildResponseGetPasswordAttributeTypeOk(arg ElasticsearchCheckChildResponseGetPasswordAttributeType) (ret ElasticsearchCheckChildResponseGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckChildResponseGetPasswordAttributeType(arg *ElasticsearchCheckChildResponseGetPasswordAttributeType, val ElasticsearchCheckChildResponseGetPasswordRetType) { + *arg = &val +} + +type ElasticsearchCheckChildResponseGetPasswordArgType = string +type ElasticsearchCheckChildResponseGetPasswordRetType = string + +/* + types and functions for server +*/ + +// isNotNullableString +type ElasticsearchCheckChildResponseGetServerAttributeType = *string + +func getElasticsearchCheckChildResponseGetServerAttributeTypeOk(arg ElasticsearchCheckChildResponseGetServerAttributeType) (ret ElasticsearchCheckChildResponseGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckChildResponseGetServerAttributeType(arg *ElasticsearchCheckChildResponseGetServerAttributeType, val ElasticsearchCheckChildResponseGetServerRetType) { + *arg = &val +} + +type ElasticsearchCheckChildResponseGetServerArgType = string +type ElasticsearchCheckChildResponseGetServerRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type ElasticsearchCheckChildResponseGetUsernameAttributeType = *string + +func getElasticsearchCheckChildResponseGetUsernameAttributeTypeOk(arg ElasticsearchCheckChildResponseGetUsernameAttributeType) (ret ElasticsearchCheckChildResponseGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckChildResponseGetUsernameAttributeType(arg *ElasticsearchCheckChildResponseGetUsernameAttributeType, val ElasticsearchCheckChildResponseGetUsernameRetType) { + *arg = &val +} + +type ElasticsearchCheckChildResponseGetUsernameArgType = string +type ElasticsearchCheckChildResponseGetUsernameRetType = string + +// ElasticsearchCheckChildResponse struct for ElasticsearchCheckChildResponse +type ElasticsearchCheckChildResponse struct { + // REQUIRED + Id ElasticsearchCheckChildResponseGetIdAttributeType `json:"id" required:"true"` + Password ElasticsearchCheckChildResponseGetPasswordAttributeType `json:"password,omitempty"` + // REQUIRED + Server ElasticsearchCheckChildResponseGetServerAttributeType `json:"server" required:"true"` + Username ElasticsearchCheckChildResponseGetUsernameAttributeType `json:"username,omitempty"` +} + +type _ElasticsearchCheckChildResponse ElasticsearchCheckChildResponse + +// NewElasticsearchCheckChildResponse instantiates a new ElasticsearchCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewElasticsearchCheckChildResponse(id ElasticsearchCheckChildResponseGetIdArgType, server ElasticsearchCheckChildResponseGetServerArgType) *ElasticsearchCheckChildResponse { + this := ElasticsearchCheckChildResponse{} + setElasticsearchCheckChildResponseGetIdAttributeType(&this.Id, id) + setElasticsearchCheckChildResponseGetServerAttributeType(&this.Server, server) + return &this +} + +// NewElasticsearchCheckChildResponseWithDefaults instantiates a new ElasticsearchCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewElasticsearchCheckChildResponseWithDefaults() *ElasticsearchCheckChildResponse { + this := ElasticsearchCheckChildResponse{} + return &this +} + +// GetId returns the Id field value +func (o *ElasticsearchCheckChildResponse) GetId() (ret ElasticsearchCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckChildResponse) GetIdOk() (ret ElasticsearchCheckChildResponseGetIdRetType, ok bool) { + return getElasticsearchCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *ElasticsearchCheckChildResponse) SetId(v ElasticsearchCheckChildResponseGetIdRetType) { + setElasticsearchCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *ElasticsearchCheckChildResponse) GetPassword() (res ElasticsearchCheckChildResponseGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckChildResponse) GetPasswordOk() (ret ElasticsearchCheckChildResponseGetPasswordRetType, ok bool) { + return getElasticsearchCheckChildResponseGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *ElasticsearchCheckChildResponse) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *ElasticsearchCheckChildResponse) SetPassword(v ElasticsearchCheckChildResponseGetPasswordRetType) { + setElasticsearchCheckChildResponseGetPasswordAttributeType(&o.Password, v) +} + +// GetServer returns the Server field value +func (o *ElasticsearchCheckChildResponse) GetServer() (ret ElasticsearchCheckChildResponseGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckChildResponse) GetServerOk() (ret ElasticsearchCheckChildResponseGetServerRetType, ok bool) { + return getElasticsearchCheckChildResponseGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *ElasticsearchCheckChildResponse) SetServer(v ElasticsearchCheckChildResponseGetServerRetType) { + setElasticsearchCheckChildResponseGetServerAttributeType(&o.Server, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *ElasticsearchCheckChildResponse) GetUsername() (res ElasticsearchCheckChildResponseGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckChildResponse) GetUsernameOk() (ret ElasticsearchCheckChildResponseGetUsernameRetType, ok bool) { + return getElasticsearchCheckChildResponseGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *ElasticsearchCheckChildResponse) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *ElasticsearchCheckChildResponse) SetUsername(v ElasticsearchCheckChildResponseGetUsernameRetType) { + setElasticsearchCheckChildResponseGetUsernameAttributeType(&o.Username, v) +} + +func (o ElasticsearchCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getElasticsearchCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getElasticsearchCheckChildResponseGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getElasticsearchCheckChildResponseGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + if val, ok := getElasticsearchCheckChildResponseGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullableElasticsearchCheckChildResponse struct { + value *ElasticsearchCheckChildResponse + isSet bool +} + +func (v NullableElasticsearchCheckChildResponse) Get() *ElasticsearchCheckChildResponse { + return v.value +} + +func (v *NullableElasticsearchCheckChildResponse) Set(val *ElasticsearchCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableElasticsearchCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableElasticsearchCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableElasticsearchCheckChildResponse(val *ElasticsearchCheckChildResponse) *NullableElasticsearchCheckChildResponse { + return &NullableElasticsearchCheckChildResponse{value: val, isSet: true} +} + +func (v NullableElasticsearchCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableElasticsearchCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_elasticsearch_check_child_response_test.go b/services/observability/model_elasticsearch_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_elasticsearch_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_elasticsearch_check_response.go b/services/observability/model_elasticsearch_check_response.go new file mode 100644 index 000000000..0de594d8b --- /dev/null +++ b/services/observability/model_elasticsearch_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the ElasticsearchCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ElasticsearchCheckResponse{} + +/* + types and functions for elasticsearchCheck +*/ + +// isModel +type ElasticsearchCheckResponseGetElasticsearchCheckAttributeType = *ElasticsearchCheckChildResponse +type ElasticsearchCheckResponseGetElasticsearchCheckArgType = ElasticsearchCheckChildResponse +type ElasticsearchCheckResponseGetElasticsearchCheckRetType = ElasticsearchCheckChildResponse + +func getElasticsearchCheckResponseGetElasticsearchCheckAttributeTypeOk(arg ElasticsearchCheckResponseGetElasticsearchCheckAttributeType) (ret ElasticsearchCheckResponseGetElasticsearchCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckResponseGetElasticsearchCheckAttributeType(arg *ElasticsearchCheckResponseGetElasticsearchCheckAttributeType, val ElasticsearchCheckResponseGetElasticsearchCheckRetType) { + *arg = &val +} + +/* + types and functions for elasticsearchChecks +*/ + +// isArray +type ElasticsearchCheckResponseGetElasticsearchChecksAttributeType = *[]ElasticsearchCheckChildResponse +type ElasticsearchCheckResponseGetElasticsearchChecksArgType = []ElasticsearchCheckChildResponse +type ElasticsearchCheckResponseGetElasticsearchChecksRetType = []ElasticsearchCheckChildResponse + +func getElasticsearchCheckResponseGetElasticsearchChecksAttributeTypeOk(arg ElasticsearchCheckResponseGetElasticsearchChecksAttributeType) (ret ElasticsearchCheckResponseGetElasticsearchChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckResponseGetElasticsearchChecksAttributeType(arg *ElasticsearchCheckResponseGetElasticsearchChecksAttributeType, val ElasticsearchCheckResponseGetElasticsearchChecksRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type ElasticsearchCheckResponseGetMessageAttributeType = *string + +func getElasticsearchCheckResponseGetMessageAttributeTypeOk(arg ElasticsearchCheckResponseGetMessageAttributeType) (ret ElasticsearchCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setElasticsearchCheckResponseGetMessageAttributeType(arg *ElasticsearchCheckResponseGetMessageAttributeType, val ElasticsearchCheckResponseGetMessageRetType) { + *arg = &val +} + +type ElasticsearchCheckResponseGetMessageArgType = string +type ElasticsearchCheckResponseGetMessageRetType = string + +// ElasticsearchCheckResponse struct for ElasticsearchCheckResponse +type ElasticsearchCheckResponse struct { + ElasticsearchCheck ElasticsearchCheckResponseGetElasticsearchCheckAttributeType `json:"elasticsearchCheck,omitempty"` + // REQUIRED + ElasticsearchChecks ElasticsearchCheckResponseGetElasticsearchChecksAttributeType `json:"elasticsearchChecks" required:"true"` + // REQUIRED + Message ElasticsearchCheckResponseGetMessageAttributeType `json:"message" required:"true"` +} + +type _ElasticsearchCheckResponse ElasticsearchCheckResponse + +// NewElasticsearchCheckResponse instantiates a new ElasticsearchCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewElasticsearchCheckResponse(elasticsearchChecks ElasticsearchCheckResponseGetElasticsearchChecksArgType, message ElasticsearchCheckResponseGetMessageArgType) *ElasticsearchCheckResponse { + this := ElasticsearchCheckResponse{} + setElasticsearchCheckResponseGetElasticsearchChecksAttributeType(&this.ElasticsearchChecks, elasticsearchChecks) + setElasticsearchCheckResponseGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewElasticsearchCheckResponseWithDefaults instantiates a new ElasticsearchCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewElasticsearchCheckResponseWithDefaults() *ElasticsearchCheckResponse { + this := ElasticsearchCheckResponse{} + return &this +} + +// GetElasticsearchCheck returns the ElasticsearchCheck field value if set, zero value otherwise. +func (o *ElasticsearchCheckResponse) GetElasticsearchCheck() (res ElasticsearchCheckResponseGetElasticsearchCheckRetType) { + res, _ = o.GetElasticsearchCheckOk() + return +} + +// GetElasticsearchCheckOk returns a tuple with the ElasticsearchCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckResponse) GetElasticsearchCheckOk() (ret ElasticsearchCheckResponseGetElasticsearchCheckRetType, ok bool) { + return getElasticsearchCheckResponseGetElasticsearchCheckAttributeTypeOk(o.ElasticsearchCheck) +} + +// HasElasticsearchCheck returns a boolean if a field has been set. +func (o *ElasticsearchCheckResponse) HasElasticsearchCheck() bool { + _, ok := o.GetElasticsearchCheckOk() + return ok +} + +// SetElasticsearchCheck gets a reference to the given ElasticsearchCheckChildResponse and assigns it to the ElasticsearchCheck field. +func (o *ElasticsearchCheckResponse) SetElasticsearchCheck(v ElasticsearchCheckResponseGetElasticsearchCheckRetType) { + setElasticsearchCheckResponseGetElasticsearchCheckAttributeType(&o.ElasticsearchCheck, v) +} + +// GetElasticsearchChecks returns the ElasticsearchChecks field value +func (o *ElasticsearchCheckResponse) GetElasticsearchChecks() (ret ElasticsearchCheckResponseGetElasticsearchChecksRetType) { + ret, _ = o.GetElasticsearchChecksOk() + return ret +} + +// GetElasticsearchChecksOk returns a tuple with the ElasticsearchChecks field value +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckResponse) GetElasticsearchChecksOk() (ret ElasticsearchCheckResponseGetElasticsearchChecksRetType, ok bool) { + return getElasticsearchCheckResponseGetElasticsearchChecksAttributeTypeOk(o.ElasticsearchChecks) +} + +// SetElasticsearchChecks sets field value +func (o *ElasticsearchCheckResponse) SetElasticsearchChecks(v ElasticsearchCheckResponseGetElasticsearchChecksRetType) { + setElasticsearchCheckResponseGetElasticsearchChecksAttributeType(&o.ElasticsearchChecks, v) +} + +// GetMessage returns the Message field value +func (o *ElasticsearchCheckResponse) GetMessage() (ret ElasticsearchCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ElasticsearchCheckResponse) GetMessageOk() (ret ElasticsearchCheckResponseGetMessageRetType, ok bool) { + return getElasticsearchCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *ElasticsearchCheckResponse) SetMessage(v ElasticsearchCheckResponseGetMessageRetType) { + setElasticsearchCheckResponseGetMessageAttributeType(&o.Message, v) +} + +func (o ElasticsearchCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getElasticsearchCheckResponseGetElasticsearchCheckAttributeTypeOk(o.ElasticsearchCheck); ok { + toSerialize["ElasticsearchCheck"] = val + } + if val, ok := getElasticsearchCheckResponseGetElasticsearchChecksAttributeTypeOk(o.ElasticsearchChecks); ok { + toSerialize["ElasticsearchChecks"] = val + } + if val, ok := getElasticsearchCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + return toSerialize, nil +} + +type NullableElasticsearchCheckResponse struct { + value *ElasticsearchCheckResponse + isSet bool +} + +func (v NullableElasticsearchCheckResponse) Get() *ElasticsearchCheckResponse { + return v.value +} + +func (v *NullableElasticsearchCheckResponse) Set(val *ElasticsearchCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableElasticsearchCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableElasticsearchCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableElasticsearchCheckResponse(val *ElasticsearchCheckResponse) *NullableElasticsearchCheckResponse { + return &NullableElasticsearchCheckResponse{value: val, isSet: true} +} + +func (v NullableElasticsearchCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableElasticsearchCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_elasticsearch_check_response_test.go b/services/observability/model_elasticsearch_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_elasticsearch_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_mongodb_check_child_response.go b/services/observability/model_mongodb_check_child_response.go new file mode 100644 index 000000000..b0c34a2e0 --- /dev/null +++ b/services/observability/model_mongodb_check_child_response.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the MongodbCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MongodbCheckChildResponse{} + +/* + types and functions for id +*/ + +// isNotNullableString +type MongodbCheckChildResponseGetIdAttributeType = *string + +func getMongodbCheckChildResponseGetIdAttributeTypeOk(arg MongodbCheckChildResponseGetIdAttributeType) (ret MongodbCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMongodbCheckChildResponseGetIdAttributeType(arg *MongodbCheckChildResponseGetIdAttributeType, val MongodbCheckChildResponseGetIdRetType) { + *arg = &val +} + +type MongodbCheckChildResponseGetIdArgType = string +type MongodbCheckChildResponseGetIdRetType = string + +/* + types and functions for server +*/ + +// isNotNullableString +type MongodbCheckChildResponseGetServerAttributeType = *string + +func getMongodbCheckChildResponseGetServerAttributeTypeOk(arg MongodbCheckChildResponseGetServerAttributeType) (ret MongodbCheckChildResponseGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMongodbCheckChildResponseGetServerAttributeType(arg *MongodbCheckChildResponseGetServerAttributeType, val MongodbCheckChildResponseGetServerRetType) { + *arg = &val +} + +type MongodbCheckChildResponseGetServerArgType = string +type MongodbCheckChildResponseGetServerRetType = string + +// MongodbCheckChildResponse struct for MongodbCheckChildResponse +type MongodbCheckChildResponse struct { + // REQUIRED + Id MongodbCheckChildResponseGetIdAttributeType `json:"id" required:"true"` + // REQUIRED + Server MongodbCheckChildResponseGetServerAttributeType `json:"server" required:"true"` +} + +type _MongodbCheckChildResponse MongodbCheckChildResponse + +// NewMongodbCheckChildResponse instantiates a new MongodbCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMongodbCheckChildResponse(id MongodbCheckChildResponseGetIdArgType, server MongodbCheckChildResponseGetServerArgType) *MongodbCheckChildResponse { + this := MongodbCheckChildResponse{} + setMongodbCheckChildResponseGetIdAttributeType(&this.Id, id) + setMongodbCheckChildResponseGetServerAttributeType(&this.Server, server) + return &this +} + +// NewMongodbCheckChildResponseWithDefaults instantiates a new MongodbCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMongodbCheckChildResponseWithDefaults() *MongodbCheckChildResponse { + this := MongodbCheckChildResponse{} + return &this +} + +// GetId returns the Id field value +func (o *MongodbCheckChildResponse) GetId() (ret MongodbCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MongodbCheckChildResponse) GetIdOk() (ret MongodbCheckChildResponseGetIdRetType, ok bool) { + return getMongodbCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *MongodbCheckChildResponse) SetId(v MongodbCheckChildResponseGetIdRetType) { + setMongodbCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +// GetServer returns the Server field value +func (o *MongodbCheckChildResponse) GetServer() (ret MongodbCheckChildResponseGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *MongodbCheckChildResponse) GetServerOk() (ret MongodbCheckChildResponseGetServerRetType, ok bool) { + return getMongodbCheckChildResponseGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *MongodbCheckChildResponse) SetServer(v MongodbCheckChildResponseGetServerRetType) { + setMongodbCheckChildResponseGetServerAttributeType(&o.Server, v) +} + +func (o MongodbCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getMongodbCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getMongodbCheckChildResponseGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + return toSerialize, nil +} + +type NullableMongodbCheckChildResponse struct { + value *MongodbCheckChildResponse + isSet bool +} + +func (v NullableMongodbCheckChildResponse) Get() *MongodbCheckChildResponse { + return v.value +} + +func (v *NullableMongodbCheckChildResponse) Set(val *MongodbCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMongodbCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMongodbCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMongodbCheckChildResponse(val *MongodbCheckChildResponse) *NullableMongodbCheckChildResponse { + return &NullableMongodbCheckChildResponse{value: val, isSet: true} +} + +func (v NullableMongodbCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMongodbCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_mongodb_check_child_response_test.go b/services/observability/model_mongodb_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_mongodb_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_mongodb_check_response.go b/services/observability/model_mongodb_check_response.go new file mode 100644 index 000000000..ab4e48f5f --- /dev/null +++ b/services/observability/model_mongodb_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the MongodbCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MongodbCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type MongodbCheckResponseGetMessageAttributeType = *string + +func getMongodbCheckResponseGetMessageAttributeTypeOk(arg MongodbCheckResponseGetMessageAttributeType) (ret MongodbCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMongodbCheckResponseGetMessageAttributeType(arg *MongodbCheckResponseGetMessageAttributeType, val MongodbCheckResponseGetMessageRetType) { + *arg = &val +} + +type MongodbCheckResponseGetMessageArgType = string +type MongodbCheckResponseGetMessageRetType = string + +/* + types and functions for mongodbCheck +*/ + +// isModel +type MongodbCheckResponseGetMongodbCheckAttributeType = *MongodbCheckChildResponse +type MongodbCheckResponseGetMongodbCheckArgType = MongodbCheckChildResponse +type MongodbCheckResponseGetMongodbCheckRetType = MongodbCheckChildResponse + +func getMongodbCheckResponseGetMongodbCheckAttributeTypeOk(arg MongodbCheckResponseGetMongodbCheckAttributeType) (ret MongodbCheckResponseGetMongodbCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMongodbCheckResponseGetMongodbCheckAttributeType(arg *MongodbCheckResponseGetMongodbCheckAttributeType, val MongodbCheckResponseGetMongodbCheckRetType) { + *arg = &val +} + +/* + types and functions for mongodbChecks +*/ + +// isArray +type MongodbCheckResponseGetMongodbChecksAttributeType = *[]MongodbCheckChildResponse +type MongodbCheckResponseGetMongodbChecksArgType = []MongodbCheckChildResponse +type MongodbCheckResponseGetMongodbChecksRetType = []MongodbCheckChildResponse + +func getMongodbCheckResponseGetMongodbChecksAttributeTypeOk(arg MongodbCheckResponseGetMongodbChecksAttributeType) (ret MongodbCheckResponseGetMongodbChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMongodbCheckResponseGetMongodbChecksAttributeType(arg *MongodbCheckResponseGetMongodbChecksAttributeType, val MongodbCheckResponseGetMongodbChecksRetType) { + *arg = &val +} + +// MongodbCheckResponse struct for MongodbCheckResponse +type MongodbCheckResponse struct { + // REQUIRED + Message MongodbCheckResponseGetMessageAttributeType `json:"message" required:"true"` + MongodbCheck MongodbCheckResponseGetMongodbCheckAttributeType `json:"mongodbCheck,omitempty"` + // REQUIRED + MongodbChecks MongodbCheckResponseGetMongodbChecksAttributeType `json:"mongodbChecks" required:"true"` +} + +type _MongodbCheckResponse MongodbCheckResponse + +// NewMongodbCheckResponse instantiates a new MongodbCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMongodbCheckResponse(message MongodbCheckResponseGetMessageArgType, mongodbChecks MongodbCheckResponseGetMongodbChecksArgType) *MongodbCheckResponse { + this := MongodbCheckResponse{} + setMongodbCheckResponseGetMessageAttributeType(&this.Message, message) + setMongodbCheckResponseGetMongodbChecksAttributeType(&this.MongodbChecks, mongodbChecks) + return &this +} + +// NewMongodbCheckResponseWithDefaults instantiates a new MongodbCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMongodbCheckResponseWithDefaults() *MongodbCheckResponse { + this := MongodbCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *MongodbCheckResponse) GetMessage() (ret MongodbCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *MongodbCheckResponse) GetMessageOk() (ret MongodbCheckResponseGetMessageRetType, ok bool) { + return getMongodbCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *MongodbCheckResponse) SetMessage(v MongodbCheckResponseGetMessageRetType) { + setMongodbCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetMongodbCheck returns the MongodbCheck field value if set, zero value otherwise. +func (o *MongodbCheckResponse) GetMongodbCheck() (res MongodbCheckResponseGetMongodbCheckRetType) { + res, _ = o.GetMongodbCheckOk() + return +} + +// GetMongodbCheckOk returns a tuple with the MongodbCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MongodbCheckResponse) GetMongodbCheckOk() (ret MongodbCheckResponseGetMongodbCheckRetType, ok bool) { + return getMongodbCheckResponseGetMongodbCheckAttributeTypeOk(o.MongodbCheck) +} + +// HasMongodbCheck returns a boolean if a field has been set. +func (o *MongodbCheckResponse) HasMongodbCheck() bool { + _, ok := o.GetMongodbCheckOk() + return ok +} + +// SetMongodbCheck gets a reference to the given MongodbCheckChildResponse and assigns it to the MongodbCheck field. +func (o *MongodbCheckResponse) SetMongodbCheck(v MongodbCheckResponseGetMongodbCheckRetType) { + setMongodbCheckResponseGetMongodbCheckAttributeType(&o.MongodbCheck, v) +} + +// GetMongodbChecks returns the MongodbChecks field value +func (o *MongodbCheckResponse) GetMongodbChecks() (ret MongodbCheckResponseGetMongodbChecksRetType) { + ret, _ = o.GetMongodbChecksOk() + return ret +} + +// GetMongodbChecksOk returns a tuple with the MongodbChecks field value +// and a boolean to check if the value has been set. +func (o *MongodbCheckResponse) GetMongodbChecksOk() (ret MongodbCheckResponseGetMongodbChecksRetType, ok bool) { + return getMongodbCheckResponseGetMongodbChecksAttributeTypeOk(o.MongodbChecks) +} + +// SetMongodbChecks sets field value +func (o *MongodbCheckResponse) SetMongodbChecks(v MongodbCheckResponseGetMongodbChecksRetType) { + setMongodbCheckResponseGetMongodbChecksAttributeType(&o.MongodbChecks, v) +} + +func (o MongodbCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getMongodbCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getMongodbCheckResponseGetMongodbCheckAttributeTypeOk(o.MongodbCheck); ok { + toSerialize["MongodbCheck"] = val + } + if val, ok := getMongodbCheckResponseGetMongodbChecksAttributeTypeOk(o.MongodbChecks); ok { + toSerialize["MongodbChecks"] = val + } + return toSerialize, nil +} + +type NullableMongodbCheckResponse struct { + value *MongodbCheckResponse + isSet bool +} + +func (v NullableMongodbCheckResponse) Get() *MongodbCheckResponse { + return v.value +} + +func (v *NullableMongodbCheckResponse) Set(val *MongodbCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMongodbCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMongodbCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMongodbCheckResponse(val *MongodbCheckResponse) *NullableMongodbCheckResponse { + return &NullableMongodbCheckResponse{value: val, isSet: true} +} + +func (v NullableMongodbCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMongodbCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_mongodb_check_response_test.go b/services/observability/model_mongodb_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_mongodb_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_mysql_check_child_response.go b/services/observability/model_mysql_check_child_response.go new file mode 100644 index 000000000..24c1fc369 --- /dev/null +++ b/services/observability/model_mysql_check_child_response.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the MysqlCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MysqlCheckChildResponse{} + +/* + types and functions for id +*/ + +// isNotNullableString +type MysqlCheckChildResponseGetIdAttributeType = *string + +func getMysqlCheckChildResponseGetIdAttributeTypeOk(arg MysqlCheckChildResponseGetIdAttributeType) (ret MysqlCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMysqlCheckChildResponseGetIdAttributeType(arg *MysqlCheckChildResponseGetIdAttributeType, val MysqlCheckChildResponseGetIdRetType) { + *arg = &val +} + +type MysqlCheckChildResponseGetIdArgType = string +type MysqlCheckChildResponseGetIdRetType = string + +/* + types and functions for server +*/ + +// isNotNullableString +type MysqlCheckChildResponseGetServerAttributeType = *string + +func getMysqlCheckChildResponseGetServerAttributeTypeOk(arg MysqlCheckChildResponseGetServerAttributeType) (ret MysqlCheckChildResponseGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMysqlCheckChildResponseGetServerAttributeType(arg *MysqlCheckChildResponseGetServerAttributeType, val MysqlCheckChildResponseGetServerRetType) { + *arg = &val +} + +type MysqlCheckChildResponseGetServerArgType = string +type MysqlCheckChildResponseGetServerRetType = string + +// MysqlCheckChildResponse struct for MysqlCheckChildResponse +type MysqlCheckChildResponse struct { + // REQUIRED + Id MysqlCheckChildResponseGetIdAttributeType `json:"id" required:"true"` + // REQUIRED + Server MysqlCheckChildResponseGetServerAttributeType `json:"server" required:"true"` +} + +type _MysqlCheckChildResponse MysqlCheckChildResponse + +// NewMysqlCheckChildResponse instantiates a new MysqlCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMysqlCheckChildResponse(id MysqlCheckChildResponseGetIdArgType, server MysqlCheckChildResponseGetServerArgType) *MysqlCheckChildResponse { + this := MysqlCheckChildResponse{} + setMysqlCheckChildResponseGetIdAttributeType(&this.Id, id) + setMysqlCheckChildResponseGetServerAttributeType(&this.Server, server) + return &this +} + +// NewMysqlCheckChildResponseWithDefaults instantiates a new MysqlCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMysqlCheckChildResponseWithDefaults() *MysqlCheckChildResponse { + this := MysqlCheckChildResponse{} + return &this +} + +// GetId returns the Id field value +func (o *MysqlCheckChildResponse) GetId() (ret MysqlCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MysqlCheckChildResponse) GetIdOk() (ret MysqlCheckChildResponseGetIdRetType, ok bool) { + return getMysqlCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *MysqlCheckChildResponse) SetId(v MysqlCheckChildResponseGetIdRetType) { + setMysqlCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +// GetServer returns the Server field value +func (o *MysqlCheckChildResponse) GetServer() (ret MysqlCheckChildResponseGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *MysqlCheckChildResponse) GetServerOk() (ret MysqlCheckChildResponseGetServerRetType, ok bool) { + return getMysqlCheckChildResponseGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *MysqlCheckChildResponse) SetServer(v MysqlCheckChildResponseGetServerRetType) { + setMysqlCheckChildResponseGetServerAttributeType(&o.Server, v) +} + +func (o MysqlCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getMysqlCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getMysqlCheckChildResponseGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + return toSerialize, nil +} + +type NullableMysqlCheckChildResponse struct { + value *MysqlCheckChildResponse + isSet bool +} + +func (v NullableMysqlCheckChildResponse) Get() *MysqlCheckChildResponse { + return v.value +} + +func (v *NullableMysqlCheckChildResponse) Set(val *MysqlCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMysqlCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMysqlCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMysqlCheckChildResponse(val *MysqlCheckChildResponse) *NullableMysqlCheckChildResponse { + return &NullableMysqlCheckChildResponse{value: val, isSet: true} +} + +func (v NullableMysqlCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMysqlCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_mysql_check_child_response_test.go b/services/observability/model_mysql_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_mysql_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_mysql_check_response.go b/services/observability/model_mysql_check_response.go new file mode 100644 index 000000000..d7c8ad93c --- /dev/null +++ b/services/observability/model_mysql_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the MysqlCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MysqlCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type MysqlCheckResponseGetMessageAttributeType = *string + +func getMysqlCheckResponseGetMessageAttributeTypeOk(arg MysqlCheckResponseGetMessageAttributeType) (ret MysqlCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMysqlCheckResponseGetMessageAttributeType(arg *MysqlCheckResponseGetMessageAttributeType, val MysqlCheckResponseGetMessageRetType) { + *arg = &val +} + +type MysqlCheckResponseGetMessageArgType = string +type MysqlCheckResponseGetMessageRetType = string + +/* + types and functions for mysqlCheck +*/ + +// isModel +type MysqlCheckResponseGetMysqlCheckAttributeType = *MysqlCheckChildResponse +type MysqlCheckResponseGetMysqlCheckArgType = MysqlCheckChildResponse +type MysqlCheckResponseGetMysqlCheckRetType = MysqlCheckChildResponse + +func getMysqlCheckResponseGetMysqlCheckAttributeTypeOk(arg MysqlCheckResponseGetMysqlCheckAttributeType) (ret MysqlCheckResponseGetMysqlCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMysqlCheckResponseGetMysqlCheckAttributeType(arg *MysqlCheckResponseGetMysqlCheckAttributeType, val MysqlCheckResponseGetMysqlCheckRetType) { + *arg = &val +} + +/* + types and functions for mysqlChecks +*/ + +// isArray +type MysqlCheckResponseGetMysqlChecksAttributeType = *[]MysqlCheckChildResponse +type MysqlCheckResponseGetMysqlChecksArgType = []MysqlCheckChildResponse +type MysqlCheckResponseGetMysqlChecksRetType = []MysqlCheckChildResponse + +func getMysqlCheckResponseGetMysqlChecksAttributeTypeOk(arg MysqlCheckResponseGetMysqlChecksAttributeType) (ret MysqlCheckResponseGetMysqlChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMysqlCheckResponseGetMysqlChecksAttributeType(arg *MysqlCheckResponseGetMysqlChecksAttributeType, val MysqlCheckResponseGetMysqlChecksRetType) { + *arg = &val +} + +// MysqlCheckResponse struct for MysqlCheckResponse +type MysqlCheckResponse struct { + // REQUIRED + Message MysqlCheckResponseGetMessageAttributeType `json:"message" required:"true"` + MysqlCheck MysqlCheckResponseGetMysqlCheckAttributeType `json:"mysqlCheck,omitempty"` + // REQUIRED + MysqlChecks MysqlCheckResponseGetMysqlChecksAttributeType `json:"mysqlChecks" required:"true"` +} + +type _MysqlCheckResponse MysqlCheckResponse + +// NewMysqlCheckResponse instantiates a new MysqlCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMysqlCheckResponse(message MysqlCheckResponseGetMessageArgType, mysqlChecks MysqlCheckResponseGetMysqlChecksArgType) *MysqlCheckResponse { + this := MysqlCheckResponse{} + setMysqlCheckResponseGetMessageAttributeType(&this.Message, message) + setMysqlCheckResponseGetMysqlChecksAttributeType(&this.MysqlChecks, mysqlChecks) + return &this +} + +// NewMysqlCheckResponseWithDefaults instantiates a new MysqlCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMysqlCheckResponseWithDefaults() *MysqlCheckResponse { + this := MysqlCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *MysqlCheckResponse) GetMessage() (ret MysqlCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *MysqlCheckResponse) GetMessageOk() (ret MysqlCheckResponseGetMessageRetType, ok bool) { + return getMysqlCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *MysqlCheckResponse) SetMessage(v MysqlCheckResponseGetMessageRetType) { + setMysqlCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetMysqlCheck returns the MysqlCheck field value if set, zero value otherwise. +func (o *MysqlCheckResponse) GetMysqlCheck() (res MysqlCheckResponseGetMysqlCheckRetType) { + res, _ = o.GetMysqlCheckOk() + return +} + +// GetMysqlCheckOk returns a tuple with the MysqlCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MysqlCheckResponse) GetMysqlCheckOk() (ret MysqlCheckResponseGetMysqlCheckRetType, ok bool) { + return getMysqlCheckResponseGetMysqlCheckAttributeTypeOk(o.MysqlCheck) +} + +// HasMysqlCheck returns a boolean if a field has been set. +func (o *MysqlCheckResponse) HasMysqlCheck() bool { + _, ok := o.GetMysqlCheckOk() + return ok +} + +// SetMysqlCheck gets a reference to the given MysqlCheckChildResponse and assigns it to the MysqlCheck field. +func (o *MysqlCheckResponse) SetMysqlCheck(v MysqlCheckResponseGetMysqlCheckRetType) { + setMysqlCheckResponseGetMysqlCheckAttributeType(&o.MysqlCheck, v) +} + +// GetMysqlChecks returns the MysqlChecks field value +func (o *MysqlCheckResponse) GetMysqlChecks() (ret MysqlCheckResponseGetMysqlChecksRetType) { + ret, _ = o.GetMysqlChecksOk() + return ret +} + +// GetMysqlChecksOk returns a tuple with the MysqlChecks field value +// and a boolean to check if the value has been set. +func (o *MysqlCheckResponse) GetMysqlChecksOk() (ret MysqlCheckResponseGetMysqlChecksRetType, ok bool) { + return getMysqlCheckResponseGetMysqlChecksAttributeTypeOk(o.MysqlChecks) +} + +// SetMysqlChecks sets field value +func (o *MysqlCheckResponse) SetMysqlChecks(v MysqlCheckResponseGetMysqlChecksRetType) { + setMysqlCheckResponseGetMysqlChecksAttributeType(&o.MysqlChecks, v) +} + +func (o MysqlCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getMysqlCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getMysqlCheckResponseGetMysqlCheckAttributeTypeOk(o.MysqlCheck); ok { + toSerialize["MysqlCheck"] = val + } + if val, ok := getMysqlCheckResponseGetMysqlChecksAttributeTypeOk(o.MysqlChecks); ok { + toSerialize["MysqlChecks"] = val + } + return toSerialize, nil +} + +type NullableMysqlCheckResponse struct { + value *MysqlCheckResponse + isSet bool +} + +func (v NullableMysqlCheckResponse) Get() *MysqlCheckResponse { + return v.value +} + +func (v *NullableMysqlCheckResponse) Set(val *MysqlCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMysqlCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMysqlCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMysqlCheckResponse(val *MysqlCheckResponse) *NullableMysqlCheckResponse { + return &NullableMysqlCheckResponse{value: val, isSet: true} +} + +func (v NullableMysqlCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMysqlCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_mysql_check_response_test.go b/services/observability/model_mysql_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_mysql_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_network_check_child_response.go b/services/observability/model_network_check_child_response.go new file mode 100644 index 000000000..35aaddb4c --- /dev/null +++ b/services/observability/model_network_check_child_response.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the NetworkCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkCheckChildResponse{} + +/* + types and functions for address +*/ + +// isNotNullableString +type NetworkCheckChildResponseGetAddressAttributeType = *string + +func getNetworkCheckChildResponseGetAddressAttributeTypeOk(arg NetworkCheckChildResponseGetAddressAttributeType) (ret NetworkCheckChildResponseGetAddressRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkCheckChildResponseGetAddressAttributeType(arg *NetworkCheckChildResponseGetAddressAttributeType, val NetworkCheckChildResponseGetAddressRetType) { + *arg = &val +} + +type NetworkCheckChildResponseGetAddressArgType = string +type NetworkCheckChildResponseGetAddressRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type NetworkCheckChildResponseGetIdAttributeType = *string + +func getNetworkCheckChildResponseGetIdAttributeTypeOk(arg NetworkCheckChildResponseGetIdAttributeType) (ret NetworkCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkCheckChildResponseGetIdAttributeType(arg *NetworkCheckChildResponseGetIdAttributeType, val NetworkCheckChildResponseGetIdRetType) { + *arg = &val +} + +type NetworkCheckChildResponseGetIdArgType = string +type NetworkCheckChildResponseGetIdRetType = string + +// NetworkCheckChildResponse struct for NetworkCheckChildResponse +type NetworkCheckChildResponse struct { + // REQUIRED + Address NetworkCheckChildResponseGetAddressAttributeType `json:"address" required:"true"` + // REQUIRED + Id NetworkCheckChildResponseGetIdAttributeType `json:"id" required:"true"` +} + +type _NetworkCheckChildResponse NetworkCheckChildResponse + +// NewNetworkCheckChildResponse instantiates a new NetworkCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkCheckChildResponse(address NetworkCheckChildResponseGetAddressArgType, id NetworkCheckChildResponseGetIdArgType) *NetworkCheckChildResponse { + this := NetworkCheckChildResponse{} + setNetworkCheckChildResponseGetAddressAttributeType(&this.Address, address) + setNetworkCheckChildResponseGetIdAttributeType(&this.Id, id) + return &this +} + +// NewNetworkCheckChildResponseWithDefaults instantiates a new NetworkCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkCheckChildResponseWithDefaults() *NetworkCheckChildResponse { + this := NetworkCheckChildResponse{} + return &this +} + +// GetAddress returns the Address field value +func (o *NetworkCheckChildResponse) GetAddress() (ret NetworkCheckChildResponseGetAddressRetType) { + ret, _ = o.GetAddressOk() + return ret +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *NetworkCheckChildResponse) GetAddressOk() (ret NetworkCheckChildResponseGetAddressRetType, ok bool) { + return getNetworkCheckChildResponseGetAddressAttributeTypeOk(o.Address) +} + +// SetAddress sets field value +func (o *NetworkCheckChildResponse) SetAddress(v NetworkCheckChildResponseGetAddressRetType) { + setNetworkCheckChildResponseGetAddressAttributeType(&o.Address, v) +} + +// GetId returns the Id field value +func (o *NetworkCheckChildResponse) GetId() (ret NetworkCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NetworkCheckChildResponse) GetIdOk() (ret NetworkCheckChildResponseGetIdRetType, ok bool) { + return getNetworkCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *NetworkCheckChildResponse) SetId(v NetworkCheckChildResponseGetIdRetType) { + setNetworkCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +func (o NetworkCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNetworkCheckChildResponseGetAddressAttributeTypeOk(o.Address); ok { + toSerialize["Address"] = val + } + if val, ok := getNetworkCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + return toSerialize, nil +} + +type NullableNetworkCheckChildResponse struct { + value *NetworkCheckChildResponse + isSet bool +} + +func (v NullableNetworkCheckChildResponse) Get() *NetworkCheckChildResponse { + return v.value +} + +func (v *NullableNetworkCheckChildResponse) Set(val *NetworkCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkCheckChildResponse(val *NetworkCheckChildResponse) *NullableNetworkCheckChildResponse { + return &NullableNetworkCheckChildResponse{value: val, isSet: true} +} + +func (v NullableNetworkCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_network_check_child_response_test.go b/services/observability/model_network_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_network_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_network_check_response.go b/services/observability/model_network_check_response.go new file mode 100644 index 000000000..b54461128 --- /dev/null +++ b/services/observability/model_network_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the NetworkCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type NetworkCheckResponseGetMessageAttributeType = *string + +func getNetworkCheckResponseGetMessageAttributeTypeOk(arg NetworkCheckResponseGetMessageAttributeType) (ret NetworkCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkCheckResponseGetMessageAttributeType(arg *NetworkCheckResponseGetMessageAttributeType, val NetworkCheckResponseGetMessageRetType) { + *arg = &val +} + +type NetworkCheckResponseGetMessageArgType = string +type NetworkCheckResponseGetMessageRetType = string + +/* + types and functions for networkCheck +*/ + +// isModel +type NetworkCheckResponseGetNetworkCheckAttributeType = *NetworkCheckChildResponse +type NetworkCheckResponseGetNetworkCheckArgType = NetworkCheckChildResponse +type NetworkCheckResponseGetNetworkCheckRetType = NetworkCheckChildResponse + +func getNetworkCheckResponseGetNetworkCheckAttributeTypeOk(arg NetworkCheckResponseGetNetworkCheckAttributeType) (ret NetworkCheckResponseGetNetworkCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkCheckResponseGetNetworkCheckAttributeType(arg *NetworkCheckResponseGetNetworkCheckAttributeType, val NetworkCheckResponseGetNetworkCheckRetType) { + *arg = &val +} + +/* + types and functions for networkChecks +*/ + +// isArray +type NetworkCheckResponseGetNetworkChecksAttributeType = *[]NetworkCheckChildResponse +type NetworkCheckResponseGetNetworkChecksArgType = []NetworkCheckChildResponse +type NetworkCheckResponseGetNetworkChecksRetType = []NetworkCheckChildResponse + +func getNetworkCheckResponseGetNetworkChecksAttributeTypeOk(arg NetworkCheckResponseGetNetworkChecksAttributeType) (ret NetworkCheckResponseGetNetworkChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkCheckResponseGetNetworkChecksAttributeType(arg *NetworkCheckResponseGetNetworkChecksAttributeType, val NetworkCheckResponseGetNetworkChecksRetType) { + *arg = &val +} + +// NetworkCheckResponse struct for NetworkCheckResponse +type NetworkCheckResponse struct { + // REQUIRED + Message NetworkCheckResponseGetMessageAttributeType `json:"message" required:"true"` + NetworkCheck NetworkCheckResponseGetNetworkCheckAttributeType `json:"networkCheck,omitempty"` + // REQUIRED + NetworkChecks NetworkCheckResponseGetNetworkChecksAttributeType `json:"networkChecks" required:"true"` +} + +type _NetworkCheckResponse NetworkCheckResponse + +// NewNetworkCheckResponse instantiates a new NetworkCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkCheckResponse(message NetworkCheckResponseGetMessageArgType, networkChecks NetworkCheckResponseGetNetworkChecksArgType) *NetworkCheckResponse { + this := NetworkCheckResponse{} + setNetworkCheckResponseGetMessageAttributeType(&this.Message, message) + setNetworkCheckResponseGetNetworkChecksAttributeType(&this.NetworkChecks, networkChecks) + return &this +} + +// NewNetworkCheckResponseWithDefaults instantiates a new NetworkCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkCheckResponseWithDefaults() *NetworkCheckResponse { + this := NetworkCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *NetworkCheckResponse) GetMessage() (ret NetworkCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *NetworkCheckResponse) GetMessageOk() (ret NetworkCheckResponseGetMessageRetType, ok bool) { + return getNetworkCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *NetworkCheckResponse) SetMessage(v NetworkCheckResponseGetMessageRetType) { + setNetworkCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetNetworkCheck returns the NetworkCheck field value if set, zero value otherwise. +func (o *NetworkCheckResponse) GetNetworkCheck() (res NetworkCheckResponseGetNetworkCheckRetType) { + res, _ = o.GetNetworkCheckOk() + return +} + +// GetNetworkCheckOk returns a tuple with the NetworkCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkCheckResponse) GetNetworkCheckOk() (ret NetworkCheckResponseGetNetworkCheckRetType, ok bool) { + return getNetworkCheckResponseGetNetworkCheckAttributeTypeOk(o.NetworkCheck) +} + +// HasNetworkCheck returns a boolean if a field has been set. +func (o *NetworkCheckResponse) HasNetworkCheck() bool { + _, ok := o.GetNetworkCheckOk() + return ok +} + +// SetNetworkCheck gets a reference to the given NetworkCheckChildResponse and assigns it to the NetworkCheck field. +func (o *NetworkCheckResponse) SetNetworkCheck(v NetworkCheckResponseGetNetworkCheckRetType) { + setNetworkCheckResponseGetNetworkCheckAttributeType(&o.NetworkCheck, v) +} + +// GetNetworkChecks returns the NetworkChecks field value +func (o *NetworkCheckResponse) GetNetworkChecks() (ret NetworkCheckResponseGetNetworkChecksRetType) { + ret, _ = o.GetNetworkChecksOk() + return ret +} + +// GetNetworkChecksOk returns a tuple with the NetworkChecks field value +// and a boolean to check if the value has been set. +func (o *NetworkCheckResponse) GetNetworkChecksOk() (ret NetworkCheckResponseGetNetworkChecksRetType, ok bool) { + return getNetworkCheckResponseGetNetworkChecksAttributeTypeOk(o.NetworkChecks) +} + +// SetNetworkChecks sets field value +func (o *NetworkCheckResponse) SetNetworkChecks(v NetworkCheckResponseGetNetworkChecksRetType) { + setNetworkCheckResponseGetNetworkChecksAttributeType(&o.NetworkChecks, v) +} + +func (o NetworkCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNetworkCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getNetworkCheckResponseGetNetworkCheckAttributeTypeOk(o.NetworkCheck); ok { + toSerialize["NetworkCheck"] = val + } + if val, ok := getNetworkCheckResponseGetNetworkChecksAttributeTypeOk(o.NetworkChecks); ok { + toSerialize["NetworkChecks"] = val + } + return toSerialize, nil +} + +type NullableNetworkCheckResponse struct { + value *NetworkCheckResponse + isSet bool +} + +func (v NullableNetworkCheckResponse) Get() *NetworkCheckResponse { + return v.value +} + +func (v *NullableNetworkCheckResponse) Set(val *NetworkCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkCheckResponse(val *NetworkCheckResponse) *NullableNetworkCheckResponse { + return &NullableNetworkCheckResponse{value: val, isSet: true} +} + +func (v NullableNetworkCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_network_check_response_test.go b/services/observability/model_network_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_network_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_offerings.go b/services/observability/model_offerings.go new file mode 100644 index 000000000..d1568eb29 --- /dev/null +++ b/services/observability/model_offerings.go @@ -0,0 +1,344 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the Offerings type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offerings{} + +/* + types and functions for description +*/ + +// isNotNullableString +type OfferingsGetDescriptionAttributeType = *string + +func getOfferingsGetDescriptionAttributeTypeOk(arg OfferingsGetDescriptionAttributeType) (ret OfferingsGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOfferingsGetDescriptionAttributeType(arg *OfferingsGetDescriptionAttributeType, val OfferingsGetDescriptionRetType) { + *arg = &val +} + +type OfferingsGetDescriptionArgType = string +type OfferingsGetDescriptionRetType = string + +/* + types and functions for documentationUrl +*/ + +// isNotNullableString +type OfferingsGetDocumentationUrlAttributeType = *string + +func getOfferingsGetDocumentationUrlAttributeTypeOk(arg OfferingsGetDocumentationUrlAttributeType) (ret OfferingsGetDocumentationUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOfferingsGetDocumentationUrlAttributeType(arg *OfferingsGetDocumentationUrlAttributeType, val OfferingsGetDocumentationUrlRetType) { + *arg = &val +} + +type OfferingsGetDocumentationUrlArgType = string +type OfferingsGetDocumentationUrlRetType = string + +/* + types and functions for imageUrl +*/ + +// isNotNullableString +type OfferingsGetImageUrlAttributeType = *string + +func getOfferingsGetImageUrlAttributeTypeOk(arg OfferingsGetImageUrlAttributeType) (ret OfferingsGetImageUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOfferingsGetImageUrlAttributeType(arg *OfferingsGetImageUrlAttributeType, val OfferingsGetImageUrlRetType) { + *arg = &val +} + +type OfferingsGetImageUrlArgType = string +type OfferingsGetImageUrlRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type OfferingsGetNameAttributeType = *string + +func getOfferingsGetNameAttributeTypeOk(arg OfferingsGetNameAttributeType) (ret OfferingsGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOfferingsGetNameAttributeType(arg *OfferingsGetNameAttributeType, val OfferingsGetNameRetType) { + *arg = &val +} + +type OfferingsGetNameArgType = string +type OfferingsGetNameRetType = string + +/* + types and functions for plans +*/ + +// isArray +type OfferingsGetPlansAttributeType = *[]Plan +type OfferingsGetPlansArgType = []Plan +type OfferingsGetPlansRetType = []Plan + +func getOfferingsGetPlansAttributeTypeOk(arg OfferingsGetPlansAttributeType) (ret OfferingsGetPlansRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOfferingsGetPlansAttributeType(arg *OfferingsGetPlansAttributeType, val OfferingsGetPlansRetType) { + *arg = &val +} + +/* + types and functions for tags +*/ + +// isArray +type OfferingsGetTagsAttributeType = *[]string +type OfferingsGetTagsArgType = []string +type OfferingsGetTagsRetType = []string + +func getOfferingsGetTagsAttributeTypeOk(arg OfferingsGetTagsAttributeType) (ret OfferingsGetTagsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOfferingsGetTagsAttributeType(arg *OfferingsGetTagsAttributeType, val OfferingsGetTagsRetType) { + *arg = &val +} + +// Offerings struct for Offerings +type Offerings struct { + // REQUIRED + Description OfferingsGetDescriptionAttributeType `json:"description" required:"true"` + // REQUIRED + DocumentationUrl OfferingsGetDocumentationUrlAttributeType `json:"documentationUrl" required:"true"` + // REQUIRED + ImageUrl OfferingsGetImageUrlAttributeType `json:"imageUrl" required:"true"` + // REQUIRED + Name OfferingsGetNameAttributeType `json:"name" required:"true"` + // REQUIRED + Plans OfferingsGetPlansAttributeType `json:"plans" required:"true"` + // REQUIRED + Tags OfferingsGetTagsAttributeType `json:"tags" required:"true"` +} + +type _Offerings Offerings + +// NewOfferings instantiates a new Offerings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOfferings(description OfferingsGetDescriptionArgType, documentationUrl OfferingsGetDocumentationUrlArgType, imageUrl OfferingsGetImageUrlArgType, name OfferingsGetNameArgType, plans OfferingsGetPlansArgType, tags OfferingsGetTagsArgType) *Offerings { + this := Offerings{} + setOfferingsGetDescriptionAttributeType(&this.Description, description) + setOfferingsGetDocumentationUrlAttributeType(&this.DocumentationUrl, documentationUrl) + setOfferingsGetImageUrlAttributeType(&this.ImageUrl, imageUrl) + setOfferingsGetNameAttributeType(&this.Name, name) + setOfferingsGetPlansAttributeType(&this.Plans, plans) + setOfferingsGetTagsAttributeType(&this.Tags, tags) + return &this +} + +// NewOfferingsWithDefaults instantiates a new Offerings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOfferingsWithDefaults() *Offerings { + this := Offerings{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offerings) GetDescription() (ret OfferingsGetDescriptionRetType) { + ret, _ = o.GetDescriptionOk() + return ret +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offerings) GetDescriptionOk() (ret OfferingsGetDescriptionRetType, ok bool) { + return getOfferingsGetDescriptionAttributeTypeOk(o.Description) +} + +// SetDescription sets field value +func (o *Offerings) SetDescription(v OfferingsGetDescriptionRetType) { + setOfferingsGetDescriptionAttributeType(&o.Description, v) +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offerings) GetDocumentationUrl() (ret OfferingsGetDocumentationUrlRetType) { + ret, _ = o.GetDocumentationUrlOk() + return ret +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offerings) GetDocumentationUrlOk() (ret OfferingsGetDocumentationUrlRetType, ok bool) { + return getOfferingsGetDocumentationUrlAttributeTypeOk(o.DocumentationUrl) +} + +// SetDocumentationUrl sets field value +func (o *Offerings) SetDocumentationUrl(v OfferingsGetDocumentationUrlRetType) { + setOfferingsGetDocumentationUrlAttributeType(&o.DocumentationUrl, v) +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offerings) GetImageUrl() (ret OfferingsGetImageUrlRetType) { + ret, _ = o.GetImageUrlOk() + return ret +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offerings) GetImageUrlOk() (ret OfferingsGetImageUrlRetType, ok bool) { + return getOfferingsGetImageUrlAttributeTypeOk(o.ImageUrl) +} + +// SetImageUrl sets field value +func (o *Offerings) SetImageUrl(v OfferingsGetImageUrlRetType) { + setOfferingsGetImageUrlAttributeType(&o.ImageUrl, v) +} + +// GetName returns the Name field value +func (o *Offerings) GetName() (ret OfferingsGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offerings) GetNameOk() (ret OfferingsGetNameRetType, ok bool) { + return getOfferingsGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +func (o *Offerings) SetName(v OfferingsGetNameRetType) { + setOfferingsGetNameAttributeType(&o.Name, v) +} + +// GetPlans returns the Plans field value +func (o *Offerings) GetPlans() (ret OfferingsGetPlansRetType) { + ret, _ = o.GetPlansOk() + return ret +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offerings) GetPlansOk() (ret OfferingsGetPlansRetType, ok bool) { + return getOfferingsGetPlansAttributeTypeOk(o.Plans) +} + +// SetPlans sets field value +func (o *Offerings) SetPlans(v OfferingsGetPlansRetType) { + setOfferingsGetPlansAttributeType(&o.Plans, v) +} + +// GetTags returns the Tags field value +func (o *Offerings) GetTags() (ret OfferingsGetTagsRetType) { + ret, _ = o.GetTagsOk() + return ret +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *Offerings) GetTagsOk() (ret OfferingsGetTagsRetType, ok bool) { + return getOfferingsGetTagsAttributeTypeOk(o.Tags) +} + +// SetTags sets field value +func (o *Offerings) SetTags(v OfferingsGetTagsRetType) { + setOfferingsGetTagsAttributeType(&o.Tags, v) +} + +func (o Offerings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getOfferingsGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getOfferingsGetDocumentationUrlAttributeTypeOk(o.DocumentationUrl); ok { + toSerialize["DocumentationUrl"] = val + } + if val, ok := getOfferingsGetImageUrlAttributeTypeOk(o.ImageUrl); ok { + toSerialize["ImageUrl"] = val + } + if val, ok := getOfferingsGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getOfferingsGetPlansAttributeTypeOk(o.Plans); ok { + toSerialize["Plans"] = val + } + if val, ok := getOfferingsGetTagsAttributeTypeOk(o.Tags); ok { + toSerialize["Tags"] = val + } + return toSerialize, nil +} + +type NullableOfferings struct { + value *Offerings + isSet bool +} + +func (v NullableOfferings) Get() *Offerings { + return v.value +} + +func (v *NullableOfferings) Set(val *Offerings) { + v.value = val + v.isSet = true +} + +func (v NullableOfferings) IsSet() bool { + return v.isSet +} + +func (v *NullableOfferings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOfferings(val *Offerings) *NullableOfferings { + return &NullableOfferings{value: val, isSet: true} +} + +func (v NullableOfferings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOfferings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_offerings_test.go b/services/observability/model_offerings_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_offerings_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_alertrecords_request_inner.go b/services/observability/model_partial_update_alertrecords_request_inner.go new file mode 100644 index 000000000..d0013eaf4 --- /dev/null +++ b/services/observability/model_partial_update_alertrecords_request_inner.go @@ -0,0 +1,220 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateAlertrecordsRequestInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateAlertrecordsRequestInner{} + +/* + types and functions for expr +*/ + +// isNotNullableString +type PartialUpdateAlertrecordsRequestInnerGetExprAttributeType = *string + +func getPartialUpdateAlertrecordsRequestInnerGetExprAttributeTypeOk(arg PartialUpdateAlertrecordsRequestInnerGetExprAttributeType) (ret PartialUpdateAlertrecordsRequestInnerGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrecordsRequestInnerGetExprAttributeType(arg *PartialUpdateAlertrecordsRequestInnerGetExprAttributeType, val PartialUpdateAlertrecordsRequestInnerGetExprRetType) { + *arg = &val +} + +type PartialUpdateAlertrecordsRequestInnerGetExprArgType = string +type PartialUpdateAlertrecordsRequestInnerGetExprRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type PartialUpdateAlertrecordsRequestInnerGetLabelsAttributeType = *map[string]interface{} +type PartialUpdateAlertrecordsRequestInnerGetLabelsArgType = map[string]interface{} +type PartialUpdateAlertrecordsRequestInnerGetLabelsRetType = map[string]interface{} + +func getPartialUpdateAlertrecordsRequestInnerGetLabelsAttributeTypeOk(arg PartialUpdateAlertrecordsRequestInnerGetLabelsAttributeType) (ret PartialUpdateAlertrecordsRequestInnerGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrecordsRequestInnerGetLabelsAttributeType(arg *PartialUpdateAlertrecordsRequestInnerGetLabelsAttributeType, val PartialUpdateAlertrecordsRequestInnerGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for record +*/ + +// isNotNullableString +type PartialUpdateAlertrecordsRequestInnerGetRecordAttributeType = *string + +func getPartialUpdateAlertrecordsRequestInnerGetRecordAttributeTypeOk(arg PartialUpdateAlertrecordsRequestInnerGetRecordAttributeType) (ret PartialUpdateAlertrecordsRequestInnerGetRecordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrecordsRequestInnerGetRecordAttributeType(arg *PartialUpdateAlertrecordsRequestInnerGetRecordAttributeType, val PartialUpdateAlertrecordsRequestInnerGetRecordRetType) { + *arg = &val +} + +type PartialUpdateAlertrecordsRequestInnerGetRecordArgType = string +type PartialUpdateAlertrecordsRequestInnerGetRecordRetType = string + +// PartialUpdateAlertrecordsRequestInner Record. `Additional Validators:` * total config (all alert groups/rules/records) should not be bigger than 500000 characters as string since this the limitation of prometheus. +type PartialUpdateAlertrecordsRequestInner struct { + // The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts. + // REQUIRED + Expr PartialUpdateAlertrecordsRequestInnerGetExprAttributeType `json:"expr" required:"true"` + // map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters + Labels PartialUpdateAlertrecordsRequestInnerGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the record. `Additional Validators:` * is the identifier and so unique in the group + // REQUIRED + Record PartialUpdateAlertrecordsRequestInnerGetRecordAttributeType `json:"record" required:"true"` +} + +type _PartialUpdateAlertrecordsRequestInner PartialUpdateAlertrecordsRequestInner + +// NewPartialUpdateAlertrecordsRequestInner instantiates a new PartialUpdateAlertrecordsRequestInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateAlertrecordsRequestInner(expr PartialUpdateAlertrecordsRequestInnerGetExprArgType, record PartialUpdateAlertrecordsRequestInnerGetRecordArgType) *PartialUpdateAlertrecordsRequestInner { + this := PartialUpdateAlertrecordsRequestInner{} + setPartialUpdateAlertrecordsRequestInnerGetExprAttributeType(&this.Expr, expr) + setPartialUpdateAlertrecordsRequestInnerGetRecordAttributeType(&this.Record, record) + return &this +} + +// NewPartialUpdateAlertrecordsRequestInnerWithDefaults instantiates a new PartialUpdateAlertrecordsRequestInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateAlertrecordsRequestInnerWithDefaults() *PartialUpdateAlertrecordsRequestInner { + this := PartialUpdateAlertrecordsRequestInner{} + return &this +} + +// GetExpr returns the Expr field value +func (o *PartialUpdateAlertrecordsRequestInner) GetExpr() (ret PartialUpdateAlertrecordsRequestInnerGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrecordsRequestInner) GetExprOk() (ret PartialUpdateAlertrecordsRequestInnerGetExprRetType, ok bool) { + return getPartialUpdateAlertrecordsRequestInnerGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *PartialUpdateAlertrecordsRequestInner) SetExpr(v PartialUpdateAlertrecordsRequestInnerGetExprRetType) { + setPartialUpdateAlertrecordsRequestInnerGetExprAttributeType(&o.Expr, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateAlertrecordsRequestInner) GetLabels() (res PartialUpdateAlertrecordsRequestInnerGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrecordsRequestInner) GetLabelsOk() (ret PartialUpdateAlertrecordsRequestInnerGetLabelsRetType, ok bool) { + return getPartialUpdateAlertrecordsRequestInnerGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateAlertrecordsRequestInner) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateAlertrecordsRequestInner) SetLabels(v PartialUpdateAlertrecordsRequestInnerGetLabelsRetType) { + setPartialUpdateAlertrecordsRequestInnerGetLabelsAttributeType(&o.Labels, v) +} + +// GetRecord returns the Record field value +func (o *PartialUpdateAlertrecordsRequestInner) GetRecord() (ret PartialUpdateAlertrecordsRequestInnerGetRecordRetType) { + ret, _ = o.GetRecordOk() + return ret +} + +// GetRecordOk returns a tuple with the Record field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrecordsRequestInner) GetRecordOk() (ret PartialUpdateAlertrecordsRequestInnerGetRecordRetType, ok bool) { + return getPartialUpdateAlertrecordsRequestInnerGetRecordAttributeTypeOk(o.Record) +} + +// SetRecord sets field value +func (o *PartialUpdateAlertrecordsRequestInner) SetRecord(v PartialUpdateAlertrecordsRequestInnerGetRecordRetType) { + setPartialUpdateAlertrecordsRequestInnerGetRecordAttributeType(&o.Record, v) +} + +func (o PartialUpdateAlertrecordsRequestInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateAlertrecordsRequestInnerGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getPartialUpdateAlertrecordsRequestInnerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getPartialUpdateAlertrecordsRequestInnerGetRecordAttributeTypeOk(o.Record); ok { + toSerialize["Record"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateAlertrecordsRequestInner struct { + value *PartialUpdateAlertrecordsRequestInner + isSet bool +} + +func (v NullablePartialUpdateAlertrecordsRequestInner) Get() *PartialUpdateAlertrecordsRequestInner { + return v.value +} + +func (v *NullablePartialUpdateAlertrecordsRequestInner) Set(val *PartialUpdateAlertrecordsRequestInner) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateAlertrecordsRequestInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateAlertrecordsRequestInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateAlertrecordsRequestInner(val *PartialUpdateAlertrecordsRequestInner) *NullablePartialUpdateAlertrecordsRequestInner { + return &NullablePartialUpdateAlertrecordsRequestInner{value: val, isSet: true} +} + +func (v NullablePartialUpdateAlertrecordsRequestInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateAlertrecordsRequestInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_alertrecords_request_inner_test.go b/services/observability/model_partial_update_alertrecords_request_inner_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_alertrecords_request_inner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_scrape_configs_request_inner.go b/services/observability/model_partial_update_scrape_configs_request_inner.go new file mode 100644 index 000000000..288509273 --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner.go @@ -0,0 +1,943 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" + "fmt" +) + +// checks if the PartialUpdateScrapeConfigsRequestInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInner{} + +/* + types and functions for basicAuth +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeType = *PartialUpdateScrapeConfigsRequestInnerBasicAuth +type PartialUpdateScrapeConfigsRequestInnerGetBasicAuthArgType = PartialUpdateScrapeConfigsRequestInnerBasicAuth +type PartialUpdateScrapeConfigsRequestInnerGetBasicAuthRetType = PartialUpdateScrapeConfigsRequestInnerBasicAuth + +func getPartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetBasicAuthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetBasicAuthRetType) { + *arg = &val +} + +/* + types and functions for bearerToken +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetBearerTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetBearerTokenRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerGetBearerTokenArgType = string +type PartialUpdateScrapeConfigsRequestInnerGetBearerTokenRetType = string + +/* + types and functions for honorLabels +*/ + +// isBoolean +type PartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeType = *bool +type PartialUpdateScrapeConfigsRequestInnergetHonorLabelsArgType = bool +type PartialUpdateScrapeConfigsRequestInnergetHonorLabelsRetType = bool + +func getPartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnergetHonorLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeType, val PartialUpdateScrapeConfigsRequestInnergetHonorLabelsRetType) { + *arg = &val +} + +/* + types and functions for honorTimeStamps +*/ + +// isBoolean +type PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeType = *bool +type PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsArgType = bool +type PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsRetType = bool + +func getPartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeType, val PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsRetType) { + *arg = &val +} + +/* + types and functions for httpSdConfigs +*/ + +// isArray +type PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner +type PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner +type PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner + +func getPartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsRetType) { + *arg = &val +} + +/* + types and functions for jobName +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetJobNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetJobNameRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerGetJobNameArgType = string +type PartialUpdateScrapeConfigsRequestInnerGetJobNameRetType = string + +/* + types and functions for metricsPath +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetMetricsPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetMetricsPathRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerGetMetricsPathArgType = string +type PartialUpdateScrapeConfigsRequestInnerGetMetricsPathRetType = string + +/* + types and functions for metricsRelabelConfigs +*/ + +// isArray +type PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner + +func getPartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsRetType) { + *arg = &val +} + +/* + types and functions for oauth2 +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 +type PartialUpdateScrapeConfigsRequestInnerGetOauth2ArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 +type PartialUpdateScrapeConfigsRequestInnerGetOauth2RetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 + +func getPartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetOauth2RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeType, val PartialUpdateScrapeConfigsRequestInnerGetOauth2RetType) { + *arg = &val +} + +/* + types and functions for params +*/ + +// isFreeform +type PartialUpdateScrapeConfigsRequestInnerGetParamsAttributeType = *map[string]interface{} +type PartialUpdateScrapeConfigsRequestInnerGetParamsArgType = map[string]interface{} +type PartialUpdateScrapeConfigsRequestInnerGetParamsRetType = map[string]interface{} + +func getPartialUpdateScrapeConfigsRequestInnerGetParamsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetParamsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetParamsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetParamsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetParamsAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetParamsRetType) { + *arg = &val +} + +/* + types and functions for sampleLimit +*/ + +// isNumber +type PartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeType = *float64 +type PartialUpdateScrapeConfigsRequestInnerGetSampleLimitArgType = float64 +type PartialUpdateScrapeConfigsRequestInnerGetSampleLimitRetType = float64 + +func getPartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetSampleLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetSampleLimitRetType) { + *arg = &val +} + +/* + types and functions for scheme +*/ + +// isEnum + +// PartialUpdateScrapeConfigsRequestInnerScheme Configures the protocol scheme used for requests. https or http +// value type for enums +type PartialUpdateScrapeConfigsRequestInnerScheme string + +// List of Scheme +const ( + PARTIALUPDATESCRAPECONFIGSREQUESTINNERSCHEME_HTTP PartialUpdateScrapeConfigsRequestInnerScheme = "http" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERSCHEME_HTTPS PartialUpdateScrapeConfigsRequestInnerScheme = "https" +) + +// All allowed values of PartialUpdateScrapeConfigsRequestInner enum +var AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues = []PartialUpdateScrapeConfigsRequestInnerScheme{ + "http", + "https", +} + +func (v *PartialUpdateScrapeConfigsRequestInnerScheme) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson PartialUpdateScrapeConfigsRequestInnerScheme + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := PartialUpdateScrapeConfigsRequestInnerScheme(value) + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PartialUpdateScrapeConfigsRequestInner", value) +} + +// NewPartialUpdateScrapeConfigsRequestInnerSchemeFromValue returns a pointer to a valid PartialUpdateScrapeConfigsRequestInnerScheme +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateScrapeConfigsRequestInnerSchemeFromValue(v PartialUpdateScrapeConfigsRequestInnerScheme) (*PartialUpdateScrapeConfigsRequestInnerScheme, error) { + ev := PartialUpdateScrapeConfigsRequestInnerScheme(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateScrapeConfigsRequestInnerScheme: valid values are %v", v, AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateScrapeConfigsRequestInnerScheme) IsValid() bool { + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SchemeScheme value +func (v PartialUpdateScrapeConfigsRequestInnerScheme) Ptr() *PartialUpdateScrapeConfigsRequestInnerScheme { + return &v +} + +type NullablePartialUpdateScrapeConfigsRequestInnerScheme struct { + value *PartialUpdateScrapeConfigsRequestInnerScheme + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerScheme) Get() *PartialUpdateScrapeConfigsRequestInnerScheme { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerScheme) Set(val *PartialUpdateScrapeConfigsRequestInnerScheme) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerScheme) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerScheme) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerScheme(val *PartialUpdateScrapeConfigsRequestInnerScheme) *NullablePartialUpdateScrapeConfigsRequestInnerScheme { + return &NullablePartialUpdateScrapeConfigsRequestInnerScheme{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerScheme) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerScheme) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type PartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType = *PartialUpdateScrapeConfigsRequestInnerScheme +type PartialUpdateScrapeConfigsRequestInnerGetSchemeArgType = PartialUpdateScrapeConfigsRequestInnerScheme +type PartialUpdateScrapeConfigsRequestInnerGetSchemeRetType = PartialUpdateScrapeConfigsRequestInnerScheme + +func getPartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetSchemeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetSchemeRetType) { + *arg = &val +} + +/* + types and functions for scrapeInterval +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalArgType = string +type PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalRetType = string + +/* + types and functions for scrapeTimeout +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutArgType = string +type PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutRetType = string + +/* + types and functions for staticConfigs +*/ + +// isArray +type PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner +type PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner +type PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner + +func getPartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsRetType) { + *arg = &val +} + +/* + types and functions for tlsConfig +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type PartialUpdateScrapeConfigsRequestInnerGetTlsConfigArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type PartialUpdateScrapeConfigsRequestInnerGetTlsConfigRetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig + +func getPartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerGetTlsConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeType, val PartialUpdateScrapeConfigsRequestInnerGetTlsConfigRetType) { + *arg = &val +} + +// PartialUpdateScrapeConfigsRequestInner struct for PartialUpdateScrapeConfigsRequestInner +type PartialUpdateScrapeConfigsRequestInner struct { + BasicAuth PartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeType `json:"basicAuth,omitempty"` + // Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'. `Additional Validators:` * needs to be a valid bearer token * if bearerToken is in the body no other authentication method should be in the body + BearerToken PartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeType `json:"bearerToken,omitempty"` + // Note that any globally configured 'external_labels' are unaffected by this setting. In communication with external systems, they are always applied only when a time series does not have a given label yet and are ignored otherwise. + HonorLabels PartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeType `json:"honorLabels,omitempty"` + // honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used. + HonorTimeStamps PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeType `json:"honorTimeStamps,omitempty"` + // HTTP-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms. + HttpSdConfigs PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeType `json:"httpSdConfigs,omitempty"` + // The job name assigned to scraped metrics by default. `Additional Validators:` * must be unique * key and values should only include the characters: a-zA-Z0-9- + // REQUIRED + JobName PartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType `json:"jobName" required:"true"` + // The HTTP resource path on which to fetch metrics from targets. E.g. /metrics + MetricsPath PartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeType `json:"metricsPath,omitempty"` + // List of metric relabel configurations + MetricsRelabelConfigs PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeType `json:"metricsRelabelConfigs,omitempty"` + Oauth2 PartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeType `json:"oauth2,omitempty"` + // Optional http params `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters + Params PartialUpdateScrapeConfigsRequestInnerGetParamsAttributeType `json:"params,omitempty"` + // Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples + SampleLimit PartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeType `json:"sampleLimit,omitempty"` + // Configures the protocol scheme used for requests. https or http + // REQUIRED + Scheme PartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType `json:"scheme" required:"true"` + // How frequently to scrape targets from this job. E.g. 5m `Additional Validators:` * must be a valid time format* must be >= 60s + // REQUIRED + ScrapeInterval PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType `json:"scrapeInterval" required:"true"` + // Per-scrape timeout when scraping this job. `Additional Validators:` * must be a valid time format* must be smaller than scrapeInterval + // REQUIRED + ScrapeTimeout PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType `json:"scrapeTimeout" required:"true"` + // A list of scrape configurations. + // REQUIRED + StaticConfigs PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType `json:"staticConfigs" required:"true"` + TlsConfig PartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeType `json:"tlsConfig,omitempty"` +} + +type _PartialUpdateScrapeConfigsRequestInner PartialUpdateScrapeConfigsRequestInner + +// NewPartialUpdateScrapeConfigsRequestInner instantiates a new PartialUpdateScrapeConfigsRequestInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInner(jobName PartialUpdateScrapeConfigsRequestInnerGetJobNameArgType, scheme PartialUpdateScrapeConfigsRequestInnerGetSchemeArgType, scrapeInterval PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalArgType, scrapeTimeout PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutArgType, staticConfigs PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsArgType) *PartialUpdateScrapeConfigsRequestInner { + this := PartialUpdateScrapeConfigsRequestInner{} + setPartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType(&this.JobName, jobName) + setPartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType(&this.Scheme, scheme) + setPartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType(&this.ScrapeInterval, scrapeInterval) + setPartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType(&this.ScrapeTimeout, scrapeTimeout) + setPartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType(&this.StaticConfigs, staticConfigs) + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerWithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerWithDefaults() *PartialUpdateScrapeConfigsRequestInner { + this := PartialUpdateScrapeConfigsRequestInner{} + var honorLabels bool = false + this.HonorLabels = &honorLabels + var honorTimeStamps bool = false + this.HonorTimeStamps = &honorTimeStamps + var metricsPath string = "/metrics" + this.MetricsPath = &metricsPath + return &this +} + +// GetBasicAuth returns the BasicAuth field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetBasicAuth() (res PartialUpdateScrapeConfigsRequestInnerGetBasicAuthRetType) { + res, _ = o.GetBasicAuthOk() + return +} + +// GetBasicAuthOk returns a tuple with the BasicAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetBasicAuthOk() (ret PartialUpdateScrapeConfigsRequestInnerGetBasicAuthRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeTypeOk(o.BasicAuth) +} + +// HasBasicAuth returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasBasicAuth() bool { + _, ok := o.GetBasicAuthOk() + return ok +} + +// SetBasicAuth gets a reference to the given PartialUpdateScrapeConfigsRequestInnerBasicAuth and assigns it to the BasicAuth field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetBasicAuth(v PartialUpdateScrapeConfigsRequestInnerGetBasicAuthRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeType(&o.BasicAuth, v) +} + +// GetBearerToken returns the BearerToken field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetBearerToken() (res PartialUpdateScrapeConfigsRequestInnerGetBearerTokenRetType) { + res, _ = o.GetBearerTokenOk() + return +} + +// GetBearerTokenOk returns a tuple with the BearerToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetBearerTokenOk() (ret PartialUpdateScrapeConfigsRequestInnerGetBearerTokenRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeTypeOk(o.BearerToken) +} + +// HasBearerToken returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasBearerToken() bool { + _, ok := o.GetBearerTokenOk() + return ok +} + +// SetBearerToken gets a reference to the given string and assigns it to the BearerToken field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetBearerToken(v PartialUpdateScrapeConfigsRequestInnerGetBearerTokenRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeType(&o.BearerToken, v) +} + +// GetHonorLabels returns the HonorLabels field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetHonorLabels() (res PartialUpdateScrapeConfigsRequestInnergetHonorLabelsRetType) { + res, _ = o.GetHonorLabelsOk() + return +} + +// GetHonorLabelsOk returns a tuple with the HonorLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetHonorLabelsOk() (ret PartialUpdateScrapeConfigsRequestInnergetHonorLabelsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeTypeOk(o.HonorLabels) +} + +// HasHonorLabels returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasHonorLabels() bool { + _, ok := o.GetHonorLabelsOk() + return ok +} + +// SetHonorLabels gets a reference to the given bool and assigns it to the HonorLabels field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetHonorLabels(v PartialUpdateScrapeConfigsRequestInnergetHonorLabelsRetType) { + setPartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeType(&o.HonorLabels, v) +} + +// GetHonorTimeStamps returns the HonorTimeStamps field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetHonorTimeStamps() (res PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsRetType) { + res, _ = o.GetHonorTimeStampsOk() + return +} + +// GetHonorTimeStampsOk returns a tuple with the HonorTimeStamps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetHonorTimeStampsOk() (ret PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeTypeOk(o.HonorTimeStamps) +} + +// HasHonorTimeStamps returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasHonorTimeStamps() bool { + _, ok := o.GetHonorTimeStampsOk() + return ok +} + +// SetHonorTimeStamps gets a reference to the given bool and assigns it to the HonorTimeStamps field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetHonorTimeStamps(v PartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsRetType) { + setPartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeType(&o.HonorTimeStamps, v) +} + +// GetHttpSdConfigs returns the HttpSdConfigs field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetHttpSdConfigs() (res PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsRetType) { + res, _ = o.GetHttpSdConfigsOk() + return +} + +// GetHttpSdConfigsOk returns a tuple with the HttpSdConfigs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetHttpSdConfigsOk() (ret PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeTypeOk(o.HttpSdConfigs) +} + +// HasHttpSdConfigs returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasHttpSdConfigs() bool { + _, ok := o.GetHttpSdConfigsOk() + return ok +} + +// SetHttpSdConfigs gets a reference to the given []PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner and assigns it to the HttpSdConfigs field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetHttpSdConfigs(v PartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeType(&o.HttpSdConfigs, v) +} + +// GetJobName returns the JobName field value +func (o *PartialUpdateScrapeConfigsRequestInner) GetJobName() (ret PartialUpdateScrapeConfigsRequestInnerGetJobNameRetType) { + ret, _ = o.GetJobNameOk() + return ret +} + +// GetJobNameOk returns a tuple with the JobName field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetJobNameOk() (ret PartialUpdateScrapeConfigsRequestInnerGetJobNameRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeTypeOk(o.JobName) +} + +// SetJobName sets field value +func (o *PartialUpdateScrapeConfigsRequestInner) SetJobName(v PartialUpdateScrapeConfigsRequestInnerGetJobNameRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeType(&o.JobName, v) +} + +// GetMetricsPath returns the MetricsPath field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetMetricsPath() (res PartialUpdateScrapeConfigsRequestInnerGetMetricsPathRetType) { + res, _ = o.GetMetricsPathOk() + return +} + +// GetMetricsPathOk returns a tuple with the MetricsPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetMetricsPathOk() (ret PartialUpdateScrapeConfigsRequestInnerGetMetricsPathRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeTypeOk(o.MetricsPath) +} + +// HasMetricsPath returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasMetricsPath() bool { + _, ok := o.GetMetricsPathOk() + return ok +} + +// SetMetricsPath gets a reference to the given string and assigns it to the MetricsPath field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetMetricsPath(v PartialUpdateScrapeConfigsRequestInnerGetMetricsPathRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeType(&o.MetricsPath, v) +} + +// GetMetricsRelabelConfigs returns the MetricsRelabelConfigs field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetMetricsRelabelConfigs() (res PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsRetType) { + res, _ = o.GetMetricsRelabelConfigsOk() + return +} + +// GetMetricsRelabelConfigsOk returns a tuple with the MetricsRelabelConfigs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetMetricsRelabelConfigsOk() (ret PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeTypeOk(o.MetricsRelabelConfigs) +} + +// HasMetricsRelabelConfigs returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasMetricsRelabelConfigs() bool { + _, ok := o.GetMetricsRelabelConfigsOk() + return ok +} + +// SetMetricsRelabelConfigs gets a reference to the given []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner and assigns it to the MetricsRelabelConfigs field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetMetricsRelabelConfigs(v PartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeType(&o.MetricsRelabelConfigs, v) +} + +// GetOauth2 returns the Oauth2 field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetOauth2() (res PartialUpdateScrapeConfigsRequestInnerGetOauth2RetType) { + res, _ = o.GetOauth2Ok() + return +} + +// GetOauth2Ok returns a tuple with the Oauth2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetOauth2Ok() (ret PartialUpdateScrapeConfigsRequestInnerGetOauth2RetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeTypeOk(o.Oauth2) +} + +// HasOauth2 returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasOauth2() bool { + _, ok := o.GetOauth2Ok() + return ok +} + +// SetOauth2 gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 and assigns it to the Oauth2 field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetOauth2(v PartialUpdateScrapeConfigsRequestInnerGetOauth2RetType) { + setPartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeType(&o.Oauth2, v) +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetParams() (res PartialUpdateScrapeConfigsRequestInnerGetParamsRetType) { + res, _ = o.GetParamsOk() + return +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetParamsOk() (ret PartialUpdateScrapeConfigsRequestInnerGetParamsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetParamsAttributeTypeOk(o.Params) +} + +// HasParams returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasParams() bool { + _, ok := o.GetParamsOk() + return ok +} + +// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetParams(v PartialUpdateScrapeConfigsRequestInnerGetParamsRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetParamsAttributeType(&o.Params, v) +} + +// GetSampleLimit returns the SampleLimit field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetSampleLimit() (res PartialUpdateScrapeConfigsRequestInnerGetSampleLimitRetType) { + res, _ = o.GetSampleLimitOk() + return +} + +// GetSampleLimitOk returns a tuple with the SampleLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetSampleLimitOk() (ret PartialUpdateScrapeConfigsRequestInnerGetSampleLimitRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeTypeOk(o.SampleLimit) +} + +// HasSampleLimit returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasSampleLimit() bool { + _, ok := o.GetSampleLimitOk() + return ok +} + +// SetSampleLimit gets a reference to the given float64 and assigns it to the SampleLimit field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetSampleLimit(v PartialUpdateScrapeConfigsRequestInnerGetSampleLimitRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeType(&o.SampleLimit, v) +} + +// GetScheme returns the Scheme field value +func (o *PartialUpdateScrapeConfigsRequestInner) GetScheme() (ret PartialUpdateScrapeConfigsRequestInnerGetSchemeRetType) { + ret, _ = o.GetSchemeOk() + return ret +} + +// GetSchemeOk returns a tuple with the Scheme field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetSchemeOk() (ret PartialUpdateScrapeConfigsRequestInnerGetSchemeRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeTypeOk(o.Scheme) +} + +// SetScheme sets field value +func (o *PartialUpdateScrapeConfigsRequestInner) SetScheme(v PartialUpdateScrapeConfigsRequestInnerGetSchemeRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeType(&o.Scheme, v) +} + +// GetScrapeInterval returns the ScrapeInterval field value +func (o *PartialUpdateScrapeConfigsRequestInner) GetScrapeInterval() (ret PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalRetType) { + ret, _ = o.GetScrapeIntervalOk() + return ret +} + +// GetScrapeIntervalOk returns a tuple with the ScrapeInterval field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetScrapeIntervalOk() (ret PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeTypeOk(o.ScrapeInterval) +} + +// SetScrapeInterval sets field value +func (o *PartialUpdateScrapeConfigsRequestInner) SetScrapeInterval(v PartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeType(&o.ScrapeInterval, v) +} + +// GetScrapeTimeout returns the ScrapeTimeout field value +func (o *PartialUpdateScrapeConfigsRequestInner) GetScrapeTimeout() (ret PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutRetType) { + ret, _ = o.GetScrapeTimeoutOk() + return ret +} + +// GetScrapeTimeoutOk returns a tuple with the ScrapeTimeout field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetScrapeTimeoutOk() (ret PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeTypeOk(o.ScrapeTimeout) +} + +// SetScrapeTimeout sets field value +func (o *PartialUpdateScrapeConfigsRequestInner) SetScrapeTimeout(v PartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeType(&o.ScrapeTimeout, v) +} + +// GetStaticConfigs returns the StaticConfigs field value +func (o *PartialUpdateScrapeConfigsRequestInner) GetStaticConfigs() (ret PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsRetType) { + ret, _ = o.GetStaticConfigsOk() + return ret +} + +// GetStaticConfigsOk returns a tuple with the StaticConfigs field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetStaticConfigsOk() (ret PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeTypeOk(o.StaticConfigs) +} + +// SetStaticConfigs sets field value +func (o *PartialUpdateScrapeConfigsRequestInner) SetStaticConfigs(v PartialUpdateScrapeConfigsRequestInnerGetStaticConfigsRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeType(&o.StaticConfigs, v) +} + +// GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInner) GetTlsConfig() (res PartialUpdateScrapeConfigsRequestInnerGetTlsConfigRetType) { + res, _ = o.GetTlsConfigOk() + return +} + +// GetTlsConfigOk returns a tuple with the TlsConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) GetTlsConfigOk() (ret PartialUpdateScrapeConfigsRequestInnerGetTlsConfigRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeTypeOk(o.TlsConfig) +} + +// HasTlsConfig returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInner) HasTlsConfig() bool { + _, ok := o.GetTlsConfigOk() + return ok +} + +// SetTlsConfig gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. +func (o *PartialUpdateScrapeConfigsRequestInner) SetTlsConfig(v PartialUpdateScrapeConfigsRequestInnerGetTlsConfigRetType) { + setPartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeType(&o.TlsConfig, v) +} + +func (o PartialUpdateScrapeConfigsRequestInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetBasicAuthAttributeTypeOk(o.BasicAuth); ok { + toSerialize["BasicAuth"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetBearerTokenAttributeTypeOk(o.BearerToken); ok { + toSerialize["BearerToken"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnergetHonorLabelsAttributeTypeOk(o.HonorLabels); ok { + toSerialize["HonorLabels"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnergetHonorTimeStampsAttributeTypeOk(o.HonorTimeStamps); ok { + toSerialize["HonorTimeStamps"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetHttpSdConfigsAttributeTypeOk(o.HttpSdConfigs); ok { + toSerialize["HttpSdConfigs"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetJobNameAttributeTypeOk(o.JobName); ok { + toSerialize["JobName"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetMetricsPathAttributeTypeOk(o.MetricsPath); ok { + toSerialize["MetricsPath"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetMetricsRelabelConfigsAttributeTypeOk(o.MetricsRelabelConfigs); ok { + toSerialize["MetricsRelabelConfigs"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetOauth2AttributeTypeOk(o.Oauth2); ok { + toSerialize["Oauth2"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetParamsAttributeTypeOk(o.Params); ok { + toSerialize["Params"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetSampleLimitAttributeTypeOk(o.SampleLimit); ok { + toSerialize["SampleLimit"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetSchemeAttributeTypeOk(o.Scheme); ok { + toSerialize["Scheme"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetScrapeIntervalAttributeTypeOk(o.ScrapeInterval); ok { + toSerialize["ScrapeInterval"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetScrapeTimeoutAttributeTypeOk(o.ScrapeTimeout); ok { + toSerialize["ScrapeTimeout"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetStaticConfigsAttributeTypeOk(o.StaticConfigs); ok { + toSerialize["StaticConfigs"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerGetTlsConfigAttributeTypeOk(o.TlsConfig); ok { + toSerialize["TlsConfig"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInner struct { + value *PartialUpdateScrapeConfigsRequestInner + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInner) Get() *PartialUpdateScrapeConfigsRequestInner { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInner) Set(val *PartialUpdateScrapeConfigsRequestInner) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInner(val *PartialUpdateScrapeConfigsRequestInner) *NullablePartialUpdateScrapeConfigsRequestInner { + return &NullablePartialUpdateScrapeConfigsRequestInner{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_basic_auth.go b/services/observability/model_partial_update_scrape_configs_request_inner_basic_auth.go new file mode 100644 index 000000000..434ccb4df --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_basic_auth.go @@ -0,0 +1,178 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateScrapeConfigsRequestInnerBasicAuth type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerBasicAuth{} + +/* + types and functions for password +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeType, val PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordArgType = string +type PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeType, val PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameArgType = string +type PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameRetType = string + +// PartialUpdateScrapeConfigsRequestInnerBasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password. `Additional Validators:` * if basicAuth is in the body no other authentication method should be in the body +type PartialUpdateScrapeConfigsRequestInnerBasicAuth struct { + // password + Password PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeType `json:"password,omitempty"` + // username + Username PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeType `json:"username,omitempty"` +} + +// NewPartialUpdateScrapeConfigsRequestInnerBasicAuth instantiates a new PartialUpdateScrapeConfigsRequestInnerBasicAuth object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInnerBasicAuth() *PartialUpdateScrapeConfigsRequestInnerBasicAuth { + this := PartialUpdateScrapeConfigsRequestInnerBasicAuth{} + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerBasicAuthWithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInnerBasicAuth object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerBasicAuthWithDefaults() *PartialUpdateScrapeConfigsRequestInnerBasicAuth { + this := PartialUpdateScrapeConfigsRequestInnerBasicAuth{} + return &this +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) GetPassword() (res PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) GetPasswordOk() (ret PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) SetPassword(v PartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordRetType) { + setPartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeType(&o.Password, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) GetUsername() (res PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) GetUsernameOk() (ret PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *PartialUpdateScrapeConfigsRequestInnerBasicAuth) SetUsername(v PartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameRetType) { + setPartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeType(&o.Username, v) +} + +func (o PartialUpdateScrapeConfigsRequestInnerBasicAuth) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerBasicAuthGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerBasicAuthGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth struct { + value *PartialUpdateScrapeConfigsRequestInnerBasicAuth + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth) Get() *PartialUpdateScrapeConfigsRequestInnerBasicAuth { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth) Set(val *PartialUpdateScrapeConfigsRequestInnerBasicAuth) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerBasicAuth(val *PartialUpdateScrapeConfigsRequestInnerBasicAuth) *NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth { + return &NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerBasicAuth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_basic_auth_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_basic_auth_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_basic_auth_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner.go b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner.go new file mode 100644 index 000000000..f3b4b4749 --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner.go @@ -0,0 +1,319 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner{} + +/* + types and functions for basicAuth +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeType = *PartialUpdateScrapeConfigsRequestInnerBasicAuth +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthArgType = PartialUpdateScrapeConfigsRequestInnerBasicAuth +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthRetType = PartialUpdateScrapeConfigsRequestInnerBasicAuth + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthRetType) { + *arg = &val +} + +/* + types and functions for oauth2 +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2ArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2RetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2RetType) { + *arg = &val +} + +/* + types and functions for refreshInterval +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalArgType = string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalRetType = string + +/* + types and functions for tlsConfig +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigRetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigRetType) { + *arg = &val +} + +/* + types and functions for url +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlArgType = string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlRetType = string + +// PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner struct for PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner struct { + BasicAuth PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeType `json:"basicAuth,omitempty"` + Oauth2 PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeType `json:"oauth2,omitempty"` + // Refresh interval to re-query the endpoint. E.g. 60s `Additional Validators:` * must be a valid time format* must be >= 60s + RefreshInterval PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeType `json:"refreshInterval,omitempty"` + TlsConfig PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeType `json:"tlsConfig,omitempty"` + // URL from which the targets are fetched. + // REQUIRED + Url PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType `json:"url" required:"true"` +} + +type _PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner + +// NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner instantiates a new PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner(url PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlArgType) *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner { + this := PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner{} + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType(&this.Url, url) + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerWithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerWithDefaults() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner { + this := PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner{} + var refreshInterval string = "60s" + this.RefreshInterval = &refreshInterval + return &this +} + +// GetBasicAuth returns the BasicAuth field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetBasicAuth() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthRetType) { + res, _ = o.GetBasicAuthOk() + return +} + +// GetBasicAuthOk returns a tuple with the BasicAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetBasicAuthOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeTypeOk(o.BasicAuth) +} + +// HasBasicAuth returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) HasBasicAuth() bool { + _, ok := o.GetBasicAuthOk() + return ok +} + +// SetBasicAuth gets a reference to the given PartialUpdateScrapeConfigsRequestInnerBasicAuth and assigns it to the BasicAuth field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) SetBasicAuth(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeType(&o.BasicAuth, v) +} + +// GetOauth2 returns the Oauth2 field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetOauth2() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2RetType) { + res, _ = o.GetOauth2Ok() + return +} + +// GetOauth2Ok returns a tuple with the Oauth2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetOauth2Ok() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2RetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeTypeOk(o.Oauth2) +} + +// HasOauth2 returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) HasOauth2() bool { + _, ok := o.GetOauth2Ok() + return ok +} + +// SetOauth2 gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 and assigns it to the Oauth2 field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) SetOauth2(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2RetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeType(&o.Oauth2, v) +} + +// GetRefreshInterval returns the RefreshInterval field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetRefreshInterval() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalRetType) { + res, _ = o.GetRefreshIntervalOk() + return +} + +// GetRefreshIntervalOk returns a tuple with the RefreshInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetRefreshIntervalOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeTypeOk(o.RefreshInterval) +} + +// HasRefreshInterval returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) HasRefreshInterval() bool { + _, ok := o.GetRefreshIntervalOk() + return ok +} + +// SetRefreshInterval gets a reference to the given string and assigns it to the RefreshInterval field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) SetRefreshInterval(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeType(&o.RefreshInterval, v) +} + +// GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetTlsConfig() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigRetType) { + res, _ = o.GetTlsConfigOk() + return +} + +// GetTlsConfigOk returns a tuple with the TlsConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetTlsConfigOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeTypeOk(o.TlsConfig) +} + +// HasTlsConfig returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) HasTlsConfig() bool { + _, ok := o.GetTlsConfigOk() + return ok +} + +// SetTlsConfig gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) SetTlsConfig(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeType(&o.TlsConfig, v) +} + +// GetUrl returns the Url field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetUrl() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlRetType) { + ret, _ = o.GetUrlOk() + return ret +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) GetUrlOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeTypeOk(o.Url) +} + +// SetUrl sets field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) SetUrl(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeType(&o.Url, v) +} + +func (o PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetBasicAuthAttributeTypeOk(o.BasicAuth); ok { + toSerialize["BasicAuth"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetOauth2AttributeTypeOk(o.Oauth2); ok { + toSerialize["Oauth2"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetRefreshIntervalAttributeTypeOk(o.RefreshInterval); ok { + toSerialize["RefreshInterval"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetTlsConfigAttributeTypeOk(o.TlsConfig); ok { + toSerialize["TlsConfig"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerGetUrlAttributeTypeOk(o.Url); ok { + toSerialize["Url"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner struct { + value *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) Get() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) Set(val *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner(val *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner { + return &NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2.go b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2.go new file mode 100644 index 000000000..d7d051b79 --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2.go @@ -0,0 +1,312 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2{} + +/* + types and functions for clientId +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdArgType = string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdRetType = string + +/* + types and functions for clientSecret +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretArgType = string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretRetType = string + +/* + types and functions for scopes +*/ + +// isArray +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeType = *[]string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesArgType = []string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesRetType = []string + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesRetType) { + *arg = &val +} + +/* + types and functions for tlsConfig +*/ + +// isModel +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigRetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigRetType) { + *arg = &val +} + +/* + types and functions for tokenUrl +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlArgType = string +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlRetType = string + +// PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys. `Additional Validators:` * if oauth2 is in the body no other authentication method should be in the body +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 struct { + // clientId + // REQUIRED + ClientId PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType `json:"clientId" required:"true"` + // clientSecret + // REQUIRED + ClientSecret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType `json:"clientSecret" required:"true"` + // The URL to fetch the token from. + Scopes PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeType `json:"scopes,omitempty"` + TlsConfig PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeType `json:"tlsConfig,omitempty"` + // The URL to fetch the token from. + // REQUIRED + TokenUrl PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType `json:"tokenUrl" required:"true"` +} + +type _PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 + +// NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 instantiates a new PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2(clientId PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdArgType, clientSecret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretArgType, tokenUrl PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlArgType) *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 { + this := PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2{} + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType(&this.ClientId, clientId) + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType(&this.ClientSecret, clientSecret) + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType(&this.TokenUrl, tokenUrl) + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2WithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2WithDefaults() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 { + this := PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetClientId() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdRetType) { + ret, _ = o.GetClientIdOk() + return ret +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetClientIdOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeTypeOk(o.ClientId) +} + +// SetClientId sets field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) SetClientId(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeType(&o.ClientId, v) +} + +// GetClientSecret returns the ClientSecret field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetClientSecret() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretRetType) { + ret, _ = o.GetClientSecretOk() + return ret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetClientSecretOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeTypeOk(o.ClientSecret) +} + +// SetClientSecret sets field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) SetClientSecret(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeType(&o.ClientSecret, v) +} + +// GetScopes returns the Scopes field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetScopes() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesRetType) { + res, _ = o.GetScopesOk() + return +} + +// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetScopesOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeTypeOk(o.Scopes) +} + +// HasScopes returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) HasScopes() bool { + _, ok := o.GetScopesOk() + return ok +} + +// SetScopes gets a reference to the given []string and assigns it to the Scopes field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) SetScopes(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeType(&o.Scopes, v) +} + +// GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetTlsConfig() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigRetType) { + res, _ = o.GetTlsConfigOk() + return +} + +// GetTlsConfigOk returns a tuple with the TlsConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetTlsConfigOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeTypeOk(o.TlsConfig) +} + +// HasTlsConfig returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) HasTlsConfig() bool { + _, ok := o.GetTlsConfigOk() + return ok +} + +// SetTlsConfig gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) SetTlsConfig(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeType(&o.TlsConfig, v) +} + +// GetTokenUrl returns the TokenUrl field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetTokenUrl() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlRetType) { + ret, _ = o.GetTokenUrlOk() + return ret +} + +// GetTokenUrlOk returns a tuple with the TokenUrl field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) GetTokenUrlOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeTypeOk(o.TokenUrl) +} + +// SetTokenUrl sets field value +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) SetTokenUrl(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeType(&o.TokenUrl, v) +} + +func (o PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientIdAttributeTypeOk(o.ClientId); ok { + toSerialize["ClientId"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetClientSecretAttributeTypeOk(o.ClientSecret); ok { + toSerialize["ClientSecret"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetScopesAttributeTypeOk(o.Scopes); ok { + toSerialize["Scopes"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTlsConfigAttributeTypeOk(o.TlsConfig); ok { + toSerialize["TlsConfig"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2GetTokenUrlAttributeTypeOk(o.TokenUrl); ok { + toSerialize["TokenUrl"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 struct { + value *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) Get() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) Set(val *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2(val *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 { + return &NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config.go b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config.go new file mode 100644 index 000000000..49c280ce5 --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config.go @@ -0,0 +1,130 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig{} + +/* + types and functions for insecureSkipVerify +*/ + +// isBoolean +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType = *bool +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyArgType = bool +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType = bool + +func getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType, val PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType) { + *arg = &val +} + +// PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig Configures the scrape request's TLS settings. +type PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig struct { + // Disable validation of the server certificate. + InsecureSkipVerify PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType `json:"insecureSkipVerify,omitempty"` +} + +// NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig instantiates a new PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig { + this := PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig{} + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfigWithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfigWithDefaults() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig { + this := PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig{} + var insecureSkipVerify bool = false + this.InsecureSkipVerify = &insecureSkipVerify + return &this +} + +// GetInsecureSkipVerify returns the InsecureSkipVerify field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) GetInsecureSkipVerify() (res PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType) { + res, _ = o.GetInsecureSkipVerifyOk() + return +} + +// GetInsecureSkipVerifyOk returns a tuple with the InsecureSkipVerify field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) GetInsecureSkipVerifyOk() (ret PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeTypeOk(o.InsecureSkipVerify) +} + +// HasInsecureSkipVerify returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) HasInsecureSkipVerify() bool { + _, ok := o.GetInsecureSkipVerifyOk() + return ok +} + +// SetInsecureSkipVerify gets a reference to the given bool and assigns it to the InsecureSkipVerify field. +func (o *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) SetInsecureSkipVerify(v PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyRetType) { + setPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeType(&o.InsecureSkipVerify, v) +} + +func (o PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfiggetInsecureSkipVerifyAttributeTypeOk(o.InsecureSkipVerify); ok { + toSerialize["InsecureSkipVerify"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig struct { + value *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) Get() *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) Set(val *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig(val *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig { + return &NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_http_sd_configs_inner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go b/services/observability/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go new file mode 100644 index 000000000..1523897a8 --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go @@ -0,0 +1,543 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" + "fmt" +) + +// checks if the PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner{} + +/* + types and functions for action +*/ + +// isEnum + +// PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body +// value type for enums +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction string + +// List of Action +const ( + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_REPLACE PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "replace" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_KEEP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "keep" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_DROP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "drop" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_HASHMOD PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "hashmod" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_LABELMAP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "labelmap" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_LABELDROP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "labeldrop" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_LABELKEEP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "labelkeep" +) + +// All allowed values of PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner enum +var AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction{ + "replace", + "keep", + "drop", + "hashmod", + "labelmap", + "labeldrop", + "labelkeep", +} + +func (v *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction(value) + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner", value) +} + +// NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionFromValue returns a pointer to a valid PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionFromValue(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) (*PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction, error) { + ev := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction: valid values are %v", v, AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) IsValid() bool { + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ActionAction value +func (v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Ptr() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { + return &v +} + +type NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction struct { + value *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Get() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Set(val *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction(val *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { + return &NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeType = *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionArgType = PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionRetType = PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionRetType) { + *arg = &val +} + +/* + types and functions for modulus +*/ + +// isNumber +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeType = *float64 +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusArgType = float64 +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusRetType = float64 + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusRetType) { + *arg = &val +} + +/* + types and functions for regex +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexArgType = string +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexRetType = string + +/* + types and functions for replacement +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementArgType = string +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementRetType = string + +/* + types and functions for separator +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorArgType = string +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorRetType = string + +/* + types and functions for sourceLabels +*/ + +// isArray +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeType = *[]string +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsArgType = []string +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsRetType = []string + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsRetType) { + *arg = &val +} + +/* + types and functions for targetLabel +*/ + +// isNotNullableString +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeType = *string + +func getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeType, val PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelRetType) { + *arg = &val +} + +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelArgType = string +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelRetType = string + +// PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner struct for PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner struct { + // Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body + Action PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeType `json:"action,omitempty"` + // Modulus to take of the hash of the source label values. + Modulus PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeType `json:"modulus,omitempty"` + // Regular expression against which the extracted value is matched. + Regex PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeType `json:"regex,omitempty"` + // Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. + Replacement PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeType `json:"replacement,omitempty"` + // Separator placed between concatenated source label values. + Separator PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeType `json:"separator,omitempty"` + // The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. + SourceLabels PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeType `json:"sourceLabels,omitempty"` + // Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. + TargetLabel PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeType `json:"targetLabel,omitempty"` +} + +// NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner instantiates a new PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner { + this := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner{} + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerWithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerWithDefaults() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner { + this := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner{} + var action PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "replace" + this.Action = &action + var regex string = ".*" + this.Regex = ®ex + var replacement string = "$1" + this.Replacement = &replacement + var separator string = ";" + this.Separator = &separator + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetAction() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionRetType) { + res, _ = o.GetActionOk() + return +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetActionOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeTypeOk(o.Action) +} + +// HasAction returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasAction() bool { + _, ok := o.GetActionOk() + return ok +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetAction(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeType(&o.Action, v) +} + +// GetModulus returns the Modulus field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetModulus() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusRetType) { + res, _ = o.GetModulusOk() + return +} + +// GetModulusOk returns a tuple with the Modulus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetModulusOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeTypeOk(o.Modulus) +} + +// HasModulus returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasModulus() bool { + _, ok := o.GetModulusOk() + return ok +} + +// SetModulus gets a reference to the given float64 and assigns it to the Modulus field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetModulus(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeType(&o.Modulus, v) +} + +// GetRegex returns the Regex field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetRegex() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexRetType) { + res, _ = o.GetRegexOk() + return +} + +// GetRegexOk returns a tuple with the Regex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetRegexOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeTypeOk(o.Regex) +} + +// HasRegex returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasRegex() bool { + _, ok := o.GetRegexOk() + return ok +} + +// SetRegex gets a reference to the given string and assigns it to the Regex field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetRegex(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeType(&o.Regex, v) +} + +// GetReplacement returns the Replacement field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetReplacement() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementRetType) { + res, _ = o.GetReplacementOk() + return +} + +// GetReplacementOk returns a tuple with the Replacement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetReplacementOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeTypeOk(o.Replacement) +} + +// HasReplacement returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasReplacement() bool { + _, ok := o.GetReplacementOk() + return ok +} + +// SetReplacement gets a reference to the given string and assigns it to the Replacement field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetReplacement(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeType(&o.Replacement, v) +} + +// GetSeparator returns the Separator field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetSeparator() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorRetType) { + res, _ = o.GetSeparatorOk() + return +} + +// GetSeparatorOk returns a tuple with the Separator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetSeparatorOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeTypeOk(o.Separator) +} + +// HasSeparator returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasSeparator() bool { + _, ok := o.GetSeparatorOk() + return ok +} + +// SetSeparator gets a reference to the given string and assigns it to the Separator field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetSeparator(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeType(&o.Separator, v) +} + +// GetSourceLabels returns the SourceLabels field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetSourceLabels() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsRetType) { + res, _ = o.GetSourceLabelsOk() + return +} + +// GetSourceLabelsOk returns a tuple with the SourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetSourceLabelsOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeTypeOk(o.SourceLabels) +} + +// HasSourceLabels returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasSourceLabels() bool { + _, ok := o.GetSourceLabelsOk() + return ok +} + +// SetSourceLabels gets a reference to the given []string and assigns it to the SourceLabels field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetSourceLabels(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeType(&o.SourceLabels, v) +} + +// GetTargetLabel returns the TargetLabel field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetTargetLabel() (res PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelRetType) { + res, _ = o.GetTargetLabelOk() + return +} + +// GetTargetLabelOk returns a tuple with the TargetLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetTargetLabelOk() (ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeTypeOk(o.TargetLabel) +} + +// HasTargetLabel returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasTargetLabel() bool { + _, ok := o.GetTargetLabelOk() + return ok +} + +// SetTargetLabel gets a reference to the given string and assigns it to the TargetLabel field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetTargetLabel(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelRetType) { + setPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeType(&o.TargetLabel, v) +} + +func (o PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetActionAttributeTypeOk(o.Action); ok { + toSerialize["Action"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetModulusAttributeTypeOk(o.Modulus); ok { + toSerialize["Modulus"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetRegexAttributeTypeOk(o.Regex); ok { + toSerialize["Regex"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetReplacementAttributeTypeOk(o.Replacement); ok { + toSerialize["Replacement"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSeparatorAttributeTypeOk(o.Separator); ok { + toSerialize["Separator"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetSourceLabelsAttributeTypeOk(o.SourceLabels); ok { + toSerialize["SourceLabels"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerGetTargetLabelAttributeTypeOk(o.TargetLabel); ok { + toSerialize["TargetLabel"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner struct { + value *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) Get() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) Set(val *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner(val *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner { + return &NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_scrape_config_payload_metrics_relabel_configs_inner_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_test.go similarity index 88% rename from services/observability/model_create_scrape_config_payload_metrics_relabel_configs_inner_test.go rename to services/observability/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_test.go index 341052154..5dce0755b 100644 --- a/services/observability/model_create_scrape_config_payload_metrics_relabel_configs_inner_test.go +++ b/services/observability/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_test.go @@ -16,7 +16,7 @@ import ( // isEnum -func TestCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction_UnmarshalJSON(t *testing.T) { +func TestPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction_UnmarshalJSON(t *testing.T) { type args struct { src []byte } @@ -84,7 +84,7 @@ func TestCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction_UnmarshalJSON } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - v := CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction("") + v := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction("") if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) } diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_static_configs_inner.go b/services/observability/model_partial_update_scrape_configs_request_inner_static_configs_inner.go new file mode 100644 index 000000000..2fa2f3023 --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_static_configs_inner.go @@ -0,0 +1,174 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner{} + +/* + types and functions for labels +*/ + +// isFreeform +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeType = *map[string]interface{} +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsArgType = map[string]interface{} +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsRetType = map[string]interface{} + +func getPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeType, val PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for targets +*/ + +// isArray +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType = *[]string +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsArgType = []string +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsRetType = []string + +func getPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeTypeOk(arg PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType) (ret PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType(arg *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType, val PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsRetType) { + *arg = &val +} + +// PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner struct for PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner +type PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner struct { + // Labels assigned to all metrics scraped from the targets. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters + Labels PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeType `json:"labels,omitempty"` + // The targets specified by the static config. + // REQUIRED + Targets PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType `json:"targets" required:"true"` +} + +type _PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner + +// NewPartialUpdateScrapeConfigsRequestInnerStaticConfigsInner instantiates a new PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateScrapeConfigsRequestInnerStaticConfigsInner(targets PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsArgType) *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner { + this := PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner{} + setPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType(&this.Targets, targets) + return &this +} + +// NewPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerWithDefaults instantiates a new PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerWithDefaults() *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner { + this := PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) GetLabels() (res PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) GetLabelsOk() (ret PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) SetLabels(v PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsRetType) { + setPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeType(&o.Labels, v) +} + +// GetTargets returns the Targets field value +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) GetTargets() (ret PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsRetType) { + ret, _ = o.GetTargetsOk() + return ret +} + +// GetTargetsOk returns a tuple with the Targets field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) GetTargetsOk() (ret PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsRetType, ok bool) { + return getPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeTypeOk(o.Targets) +} + +// SetTargets sets field value +func (o *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) SetTargets(v PartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsRetType) { + setPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeType(&o.Targets, v) +} + +func (o PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getPartialUpdateScrapeConfigsRequestInnerStaticConfigsInnerGetTargetsAttributeTypeOk(o.Targets); ok { + toSerialize["Targets"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner struct { + value *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) Get() *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) Set(val *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner(val *PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) *NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner { + return &NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_static_configs_inner_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_static_configs_inner_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_static_configs_inner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_scrape_configs_request_inner_test.go b/services/observability/model_partial_update_scrape_configs_request_inner_test.go new file mode 100644 index 000000000..bde0ca69d --- /dev/null +++ b/services/observability/model_partial_update_scrape_configs_request_inner_test.go @@ -0,0 +1,58 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "testing" +) + +// isEnum + +func TestPartialUpdateScrapeConfigsRequestInnerScheme_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"http"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"https"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := PartialUpdateScrapeConfigsRequestInnerScheme("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/observability/model_ping_check_child_response.go b/services/observability/model_ping_check_child_response.go new file mode 100644 index 000000000..cf397e7c9 --- /dev/null +++ b/services/observability/model_ping_check_child_response.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PingCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PingCheckChildResponse{} + +/* + types and functions for id +*/ + +// isNotNullableString +type PingCheckChildResponseGetIdAttributeType = *string + +func getPingCheckChildResponseGetIdAttributeTypeOk(arg PingCheckChildResponseGetIdAttributeType) (ret PingCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPingCheckChildResponseGetIdAttributeType(arg *PingCheckChildResponseGetIdAttributeType, val PingCheckChildResponseGetIdRetType) { + *arg = &val +} + +type PingCheckChildResponseGetIdArgType = string +type PingCheckChildResponseGetIdRetType = string + +/* + types and functions for url +*/ + +// isNotNullableString +type PingCheckChildResponseGetUrlAttributeType = *string + +func getPingCheckChildResponseGetUrlAttributeTypeOk(arg PingCheckChildResponseGetUrlAttributeType) (ret PingCheckChildResponseGetUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPingCheckChildResponseGetUrlAttributeType(arg *PingCheckChildResponseGetUrlAttributeType, val PingCheckChildResponseGetUrlRetType) { + *arg = &val +} + +type PingCheckChildResponseGetUrlArgType = string +type PingCheckChildResponseGetUrlRetType = string + +// PingCheckChildResponse struct for PingCheckChildResponse +type PingCheckChildResponse struct { + // REQUIRED + Id PingCheckChildResponseGetIdAttributeType `json:"id" required:"true"` + // REQUIRED + Url PingCheckChildResponseGetUrlAttributeType `json:"url" required:"true"` +} + +type _PingCheckChildResponse PingCheckChildResponse + +// NewPingCheckChildResponse instantiates a new PingCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPingCheckChildResponse(id PingCheckChildResponseGetIdArgType, url PingCheckChildResponseGetUrlArgType) *PingCheckChildResponse { + this := PingCheckChildResponse{} + setPingCheckChildResponseGetIdAttributeType(&this.Id, id) + setPingCheckChildResponseGetUrlAttributeType(&this.Url, url) + return &this +} + +// NewPingCheckChildResponseWithDefaults instantiates a new PingCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPingCheckChildResponseWithDefaults() *PingCheckChildResponse { + this := PingCheckChildResponse{} + return &this +} + +// GetId returns the Id field value +func (o *PingCheckChildResponse) GetId() (ret PingCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PingCheckChildResponse) GetIdOk() (ret PingCheckChildResponseGetIdRetType, ok bool) { + return getPingCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *PingCheckChildResponse) SetId(v PingCheckChildResponseGetIdRetType) { + setPingCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +// GetUrl returns the Url field value +func (o *PingCheckChildResponse) GetUrl() (ret PingCheckChildResponseGetUrlRetType) { + ret, _ = o.GetUrlOk() + return ret +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PingCheckChildResponse) GetUrlOk() (ret PingCheckChildResponseGetUrlRetType, ok bool) { + return getPingCheckChildResponseGetUrlAttributeTypeOk(o.Url) +} + +// SetUrl sets field value +func (o *PingCheckChildResponse) SetUrl(v PingCheckChildResponseGetUrlRetType) { + setPingCheckChildResponseGetUrlAttributeType(&o.Url, v) +} + +func (o PingCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPingCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getPingCheckChildResponseGetUrlAttributeTypeOk(o.Url); ok { + toSerialize["Url"] = val + } + return toSerialize, nil +} + +type NullablePingCheckChildResponse struct { + value *PingCheckChildResponse + isSet bool +} + +func (v NullablePingCheckChildResponse) Get() *PingCheckChildResponse { + return v.value +} + +func (v *NullablePingCheckChildResponse) Set(val *PingCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePingCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePingCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePingCheckChildResponse(val *PingCheckChildResponse) *NullablePingCheckChildResponse { + return &NullablePingCheckChildResponse{value: val, isSet: true} +} + +func (v NullablePingCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePingCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_ping_check_child_response_test.go b/services/observability/model_ping_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_ping_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_ping_check_response.go b/services/observability/model_ping_check_response.go new file mode 100644 index 000000000..84598a078 --- /dev/null +++ b/services/observability/model_ping_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PingCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PingCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type PingCheckResponseGetMessageAttributeType = *string + +func getPingCheckResponseGetMessageAttributeTypeOk(arg PingCheckResponseGetMessageAttributeType) (ret PingCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPingCheckResponseGetMessageAttributeType(arg *PingCheckResponseGetMessageAttributeType, val PingCheckResponseGetMessageRetType) { + *arg = &val +} + +type PingCheckResponseGetMessageArgType = string +type PingCheckResponseGetMessageRetType = string + +/* + types and functions for pingCheck +*/ + +// isModel +type PingCheckResponseGetPingCheckAttributeType = *PingCheckChildResponse +type PingCheckResponseGetPingCheckArgType = PingCheckChildResponse +type PingCheckResponseGetPingCheckRetType = PingCheckChildResponse + +func getPingCheckResponseGetPingCheckAttributeTypeOk(arg PingCheckResponseGetPingCheckAttributeType) (ret PingCheckResponseGetPingCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPingCheckResponseGetPingCheckAttributeType(arg *PingCheckResponseGetPingCheckAttributeType, val PingCheckResponseGetPingCheckRetType) { + *arg = &val +} + +/* + types and functions for pingChecks +*/ + +// isArray +type PingCheckResponseGetPingChecksAttributeType = *[]PingCheckChildResponse +type PingCheckResponseGetPingChecksArgType = []PingCheckChildResponse +type PingCheckResponseGetPingChecksRetType = []PingCheckChildResponse + +func getPingCheckResponseGetPingChecksAttributeTypeOk(arg PingCheckResponseGetPingChecksAttributeType) (ret PingCheckResponseGetPingChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPingCheckResponseGetPingChecksAttributeType(arg *PingCheckResponseGetPingChecksAttributeType, val PingCheckResponseGetPingChecksRetType) { + *arg = &val +} + +// PingCheckResponse struct for PingCheckResponse +type PingCheckResponse struct { + // REQUIRED + Message PingCheckResponseGetMessageAttributeType `json:"message" required:"true"` + PingCheck PingCheckResponseGetPingCheckAttributeType `json:"pingCheck,omitempty"` + // REQUIRED + PingChecks PingCheckResponseGetPingChecksAttributeType `json:"pingChecks" required:"true"` +} + +type _PingCheckResponse PingCheckResponse + +// NewPingCheckResponse instantiates a new PingCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPingCheckResponse(message PingCheckResponseGetMessageArgType, pingChecks PingCheckResponseGetPingChecksArgType) *PingCheckResponse { + this := PingCheckResponse{} + setPingCheckResponseGetMessageAttributeType(&this.Message, message) + setPingCheckResponseGetPingChecksAttributeType(&this.PingChecks, pingChecks) + return &this +} + +// NewPingCheckResponseWithDefaults instantiates a new PingCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPingCheckResponseWithDefaults() *PingCheckResponse { + this := PingCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *PingCheckResponse) GetMessage() (ret PingCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *PingCheckResponse) GetMessageOk() (ret PingCheckResponseGetMessageRetType, ok bool) { + return getPingCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *PingCheckResponse) SetMessage(v PingCheckResponseGetMessageRetType) { + setPingCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetPingCheck returns the PingCheck field value if set, zero value otherwise. +func (o *PingCheckResponse) GetPingCheck() (res PingCheckResponseGetPingCheckRetType) { + res, _ = o.GetPingCheckOk() + return +} + +// GetPingCheckOk returns a tuple with the PingCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PingCheckResponse) GetPingCheckOk() (ret PingCheckResponseGetPingCheckRetType, ok bool) { + return getPingCheckResponseGetPingCheckAttributeTypeOk(o.PingCheck) +} + +// HasPingCheck returns a boolean if a field has been set. +func (o *PingCheckResponse) HasPingCheck() bool { + _, ok := o.GetPingCheckOk() + return ok +} + +// SetPingCheck gets a reference to the given PingCheckChildResponse and assigns it to the PingCheck field. +func (o *PingCheckResponse) SetPingCheck(v PingCheckResponseGetPingCheckRetType) { + setPingCheckResponseGetPingCheckAttributeType(&o.PingCheck, v) +} + +// GetPingChecks returns the PingChecks field value +func (o *PingCheckResponse) GetPingChecks() (ret PingCheckResponseGetPingChecksRetType) { + ret, _ = o.GetPingChecksOk() + return ret +} + +// GetPingChecksOk returns a tuple with the PingChecks field value +// and a boolean to check if the value has been set. +func (o *PingCheckResponse) GetPingChecksOk() (ret PingCheckResponseGetPingChecksRetType, ok bool) { + return getPingCheckResponseGetPingChecksAttributeTypeOk(o.PingChecks) +} + +// SetPingChecks sets field value +func (o *PingCheckResponse) SetPingChecks(v PingCheckResponseGetPingChecksRetType) { + setPingCheckResponseGetPingChecksAttributeType(&o.PingChecks, v) +} + +func (o PingCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPingCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getPingCheckResponseGetPingCheckAttributeTypeOk(o.PingCheck); ok { + toSerialize["PingCheck"] = val + } + if val, ok := getPingCheckResponseGetPingChecksAttributeTypeOk(o.PingChecks); ok { + toSerialize["PingChecks"] = val + } + return toSerialize, nil +} + +type NullablePingCheckResponse struct { + value *PingCheckResponse + isSet bool +} + +func (v NullablePingCheckResponse) Get() *PingCheckResponse { + return v.value +} + +func (v *NullablePingCheckResponse) Set(val *PingCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePingCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePingCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePingCheckResponse(val *PingCheckResponse) *NullablePingCheckResponse { + return &NullablePingCheckResponse{value: val, isSet: true} +} + +func (v NullablePingCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePingCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_ping_check_response_test.go b/services/observability/model_ping_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_ping_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_postgresql_check_child_response.go b/services/observability/model_postgresql_check_child_response.go new file mode 100644 index 000000000..2f0bb577a --- /dev/null +++ b/services/observability/model_postgresql_check_child_response.go @@ -0,0 +1,170 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PostgresqlCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PostgresqlCheckChildResponse{} + +/* + types and functions for address +*/ + +// isNotNullableString +type PostgresqlCheckChildResponseGetAddressAttributeType = *string + +func getPostgresqlCheckChildResponseGetAddressAttributeTypeOk(arg PostgresqlCheckChildResponseGetAddressAttributeType) (ret PostgresqlCheckChildResponseGetAddressRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresqlCheckChildResponseGetAddressAttributeType(arg *PostgresqlCheckChildResponseGetAddressAttributeType, val PostgresqlCheckChildResponseGetAddressRetType) { + *arg = &val +} + +type PostgresqlCheckChildResponseGetAddressArgType = string +type PostgresqlCheckChildResponseGetAddressRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type PostgresqlCheckChildResponseGetIdAttributeType = *string + +func getPostgresqlCheckChildResponseGetIdAttributeTypeOk(arg PostgresqlCheckChildResponseGetIdAttributeType) (ret PostgresqlCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresqlCheckChildResponseGetIdAttributeType(arg *PostgresqlCheckChildResponseGetIdAttributeType, val PostgresqlCheckChildResponseGetIdRetType) { + *arg = &val +} + +type PostgresqlCheckChildResponseGetIdArgType = string +type PostgresqlCheckChildResponseGetIdRetType = string + +// PostgresqlCheckChildResponse struct for PostgresqlCheckChildResponse +type PostgresqlCheckChildResponse struct { + // REQUIRED + Address PostgresqlCheckChildResponseGetAddressAttributeType `json:"address" required:"true"` + // REQUIRED + Id PostgresqlCheckChildResponseGetIdAttributeType `json:"id" required:"true"` +} + +type _PostgresqlCheckChildResponse PostgresqlCheckChildResponse + +// NewPostgresqlCheckChildResponse instantiates a new PostgresqlCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPostgresqlCheckChildResponse(address PostgresqlCheckChildResponseGetAddressArgType, id PostgresqlCheckChildResponseGetIdArgType) *PostgresqlCheckChildResponse { + this := PostgresqlCheckChildResponse{} + setPostgresqlCheckChildResponseGetAddressAttributeType(&this.Address, address) + setPostgresqlCheckChildResponseGetIdAttributeType(&this.Id, id) + return &this +} + +// NewPostgresqlCheckChildResponseWithDefaults instantiates a new PostgresqlCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPostgresqlCheckChildResponseWithDefaults() *PostgresqlCheckChildResponse { + this := PostgresqlCheckChildResponse{} + return &this +} + +// GetAddress returns the Address field value +func (o *PostgresqlCheckChildResponse) GetAddress() (ret PostgresqlCheckChildResponseGetAddressRetType) { + ret, _ = o.GetAddressOk() + return ret +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *PostgresqlCheckChildResponse) GetAddressOk() (ret PostgresqlCheckChildResponseGetAddressRetType, ok bool) { + return getPostgresqlCheckChildResponseGetAddressAttributeTypeOk(o.Address) +} + +// SetAddress sets field value +func (o *PostgresqlCheckChildResponse) SetAddress(v PostgresqlCheckChildResponseGetAddressRetType) { + setPostgresqlCheckChildResponseGetAddressAttributeType(&o.Address, v) +} + +// GetId returns the Id field value +func (o *PostgresqlCheckChildResponse) GetId() (ret PostgresqlCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PostgresqlCheckChildResponse) GetIdOk() (ret PostgresqlCheckChildResponseGetIdRetType, ok bool) { + return getPostgresqlCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *PostgresqlCheckChildResponse) SetId(v PostgresqlCheckChildResponseGetIdRetType) { + setPostgresqlCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +func (o PostgresqlCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPostgresqlCheckChildResponseGetAddressAttributeTypeOk(o.Address); ok { + toSerialize["Address"] = val + } + if val, ok := getPostgresqlCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + return toSerialize, nil +} + +type NullablePostgresqlCheckChildResponse struct { + value *PostgresqlCheckChildResponse + isSet bool +} + +func (v NullablePostgresqlCheckChildResponse) Get() *PostgresqlCheckChildResponse { + return v.value +} + +func (v *NullablePostgresqlCheckChildResponse) Set(val *PostgresqlCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePostgresqlCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePostgresqlCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePostgresqlCheckChildResponse(val *PostgresqlCheckChildResponse) *NullablePostgresqlCheckChildResponse { + return &NullablePostgresqlCheckChildResponse{value: val, isSet: true} +} + +func (v NullablePostgresqlCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePostgresqlCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_postgresql_check_child_response_test.go b/services/observability/model_postgresql_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_postgresql_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_postgresql_check_response.go b/services/observability/model_postgresql_check_response.go new file mode 100644 index 000000000..91e5475a4 --- /dev/null +++ b/services/observability/model_postgresql_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PostgresqlCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PostgresqlCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type PostgresqlCheckResponseGetMessageAttributeType = *string + +func getPostgresqlCheckResponseGetMessageAttributeTypeOk(arg PostgresqlCheckResponseGetMessageAttributeType) (ret PostgresqlCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresqlCheckResponseGetMessageAttributeType(arg *PostgresqlCheckResponseGetMessageAttributeType, val PostgresqlCheckResponseGetMessageRetType) { + *arg = &val +} + +type PostgresqlCheckResponseGetMessageArgType = string +type PostgresqlCheckResponseGetMessageRetType = string + +/* + types and functions for postgresqlCheck +*/ + +// isModel +type PostgresqlCheckResponseGetPostgresqlCheckAttributeType = *PostgresqlCheckChildResponse +type PostgresqlCheckResponseGetPostgresqlCheckArgType = PostgresqlCheckChildResponse +type PostgresqlCheckResponseGetPostgresqlCheckRetType = PostgresqlCheckChildResponse + +func getPostgresqlCheckResponseGetPostgresqlCheckAttributeTypeOk(arg PostgresqlCheckResponseGetPostgresqlCheckAttributeType) (ret PostgresqlCheckResponseGetPostgresqlCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresqlCheckResponseGetPostgresqlCheckAttributeType(arg *PostgresqlCheckResponseGetPostgresqlCheckAttributeType, val PostgresqlCheckResponseGetPostgresqlCheckRetType) { + *arg = &val +} + +/* + types and functions for postgresqlChecks +*/ + +// isArray +type PostgresqlCheckResponseGetPostgresqlChecksAttributeType = *[]PostgresqlCheckChildResponse +type PostgresqlCheckResponseGetPostgresqlChecksArgType = []PostgresqlCheckChildResponse +type PostgresqlCheckResponseGetPostgresqlChecksRetType = []PostgresqlCheckChildResponse + +func getPostgresqlCheckResponseGetPostgresqlChecksAttributeTypeOk(arg PostgresqlCheckResponseGetPostgresqlChecksAttributeType) (ret PostgresqlCheckResponseGetPostgresqlChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresqlCheckResponseGetPostgresqlChecksAttributeType(arg *PostgresqlCheckResponseGetPostgresqlChecksAttributeType, val PostgresqlCheckResponseGetPostgresqlChecksRetType) { + *arg = &val +} + +// PostgresqlCheckResponse struct for PostgresqlCheckResponse +type PostgresqlCheckResponse struct { + // REQUIRED + Message PostgresqlCheckResponseGetMessageAttributeType `json:"message" required:"true"` + PostgresqlCheck PostgresqlCheckResponseGetPostgresqlCheckAttributeType `json:"postgresqlCheck,omitempty"` + // REQUIRED + PostgresqlChecks PostgresqlCheckResponseGetPostgresqlChecksAttributeType `json:"postgresqlChecks" required:"true"` +} + +type _PostgresqlCheckResponse PostgresqlCheckResponse + +// NewPostgresqlCheckResponse instantiates a new PostgresqlCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPostgresqlCheckResponse(message PostgresqlCheckResponseGetMessageArgType, postgresqlChecks PostgresqlCheckResponseGetPostgresqlChecksArgType) *PostgresqlCheckResponse { + this := PostgresqlCheckResponse{} + setPostgresqlCheckResponseGetMessageAttributeType(&this.Message, message) + setPostgresqlCheckResponseGetPostgresqlChecksAttributeType(&this.PostgresqlChecks, postgresqlChecks) + return &this +} + +// NewPostgresqlCheckResponseWithDefaults instantiates a new PostgresqlCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPostgresqlCheckResponseWithDefaults() *PostgresqlCheckResponse { + this := PostgresqlCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *PostgresqlCheckResponse) GetMessage() (ret PostgresqlCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *PostgresqlCheckResponse) GetMessageOk() (ret PostgresqlCheckResponseGetMessageRetType, ok bool) { + return getPostgresqlCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *PostgresqlCheckResponse) SetMessage(v PostgresqlCheckResponseGetMessageRetType) { + setPostgresqlCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetPostgresqlCheck returns the PostgresqlCheck field value if set, zero value otherwise. +func (o *PostgresqlCheckResponse) GetPostgresqlCheck() (res PostgresqlCheckResponseGetPostgresqlCheckRetType) { + res, _ = o.GetPostgresqlCheckOk() + return +} + +// GetPostgresqlCheckOk returns a tuple with the PostgresqlCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PostgresqlCheckResponse) GetPostgresqlCheckOk() (ret PostgresqlCheckResponseGetPostgresqlCheckRetType, ok bool) { + return getPostgresqlCheckResponseGetPostgresqlCheckAttributeTypeOk(o.PostgresqlCheck) +} + +// HasPostgresqlCheck returns a boolean if a field has been set. +func (o *PostgresqlCheckResponse) HasPostgresqlCheck() bool { + _, ok := o.GetPostgresqlCheckOk() + return ok +} + +// SetPostgresqlCheck gets a reference to the given PostgresqlCheckChildResponse and assigns it to the PostgresqlCheck field. +func (o *PostgresqlCheckResponse) SetPostgresqlCheck(v PostgresqlCheckResponseGetPostgresqlCheckRetType) { + setPostgresqlCheckResponseGetPostgresqlCheckAttributeType(&o.PostgresqlCheck, v) +} + +// GetPostgresqlChecks returns the PostgresqlChecks field value +func (o *PostgresqlCheckResponse) GetPostgresqlChecks() (ret PostgresqlCheckResponseGetPostgresqlChecksRetType) { + ret, _ = o.GetPostgresqlChecksOk() + return ret +} + +// GetPostgresqlChecksOk returns a tuple with the PostgresqlChecks field value +// and a boolean to check if the value has been set. +func (o *PostgresqlCheckResponse) GetPostgresqlChecksOk() (ret PostgresqlCheckResponseGetPostgresqlChecksRetType, ok bool) { + return getPostgresqlCheckResponseGetPostgresqlChecksAttributeTypeOk(o.PostgresqlChecks) +} + +// SetPostgresqlChecks sets field value +func (o *PostgresqlCheckResponse) SetPostgresqlChecks(v PostgresqlCheckResponseGetPostgresqlChecksRetType) { + setPostgresqlCheckResponseGetPostgresqlChecksAttributeType(&o.PostgresqlChecks, v) +} + +func (o PostgresqlCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPostgresqlCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getPostgresqlCheckResponseGetPostgresqlCheckAttributeTypeOk(o.PostgresqlCheck); ok { + toSerialize["PostgresqlCheck"] = val + } + if val, ok := getPostgresqlCheckResponseGetPostgresqlChecksAttributeTypeOk(o.PostgresqlChecks); ok { + toSerialize["PostgresqlChecks"] = val + } + return toSerialize, nil +} + +type NullablePostgresqlCheckResponse struct { + value *PostgresqlCheckResponse + isSet bool +} + +func (v NullablePostgresqlCheckResponse) Get() *PostgresqlCheckResponse { + return v.value +} + +func (v *NullablePostgresqlCheckResponse) Set(val *PostgresqlCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePostgresqlCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePostgresqlCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePostgresqlCheckResponse(val *PostgresqlCheckResponse) *NullablePostgresqlCheckResponse { + return &NullablePostgresqlCheckResponse{value: val, isSet: true} +} + +func (v NullablePostgresqlCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePostgresqlCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_postgresql_check_response_test.go b/services/observability/model_postgresql_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_postgresql_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_rabbit_mq_check_child_response.go b/services/observability/model_rabbit_mq_check_child_response.go new file mode 100644 index 000000000..9a7ae6b95 --- /dev/null +++ b/services/observability/model_rabbit_mq_check_child_response.go @@ -0,0 +1,266 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the RabbitMQCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RabbitMQCheckChildResponse{} + +/* + types and functions for id +*/ + +// isNotNullableString +type RabbitMQCheckChildResponseGetIdAttributeType = *string + +func getRabbitMQCheckChildResponseGetIdAttributeTypeOk(arg RabbitMQCheckChildResponseGetIdAttributeType) (ret RabbitMQCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitMQCheckChildResponseGetIdAttributeType(arg *RabbitMQCheckChildResponseGetIdAttributeType, val RabbitMQCheckChildResponseGetIdRetType) { + *arg = &val +} + +type RabbitMQCheckChildResponseGetIdArgType = string +type RabbitMQCheckChildResponseGetIdRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +type RabbitMQCheckChildResponseGetPasswordAttributeType = *string + +func getRabbitMQCheckChildResponseGetPasswordAttributeTypeOk(arg RabbitMQCheckChildResponseGetPasswordAttributeType) (ret RabbitMQCheckChildResponseGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitMQCheckChildResponseGetPasswordAttributeType(arg *RabbitMQCheckChildResponseGetPasswordAttributeType, val RabbitMQCheckChildResponseGetPasswordRetType) { + *arg = &val +} + +type RabbitMQCheckChildResponseGetPasswordArgType = string +type RabbitMQCheckChildResponseGetPasswordRetType = string + +/* + types and functions for url +*/ + +// isNotNullableString +type RabbitMQCheckChildResponseGetUrlAttributeType = *string + +func getRabbitMQCheckChildResponseGetUrlAttributeTypeOk(arg RabbitMQCheckChildResponseGetUrlAttributeType) (ret RabbitMQCheckChildResponseGetUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitMQCheckChildResponseGetUrlAttributeType(arg *RabbitMQCheckChildResponseGetUrlAttributeType, val RabbitMQCheckChildResponseGetUrlRetType) { + *arg = &val +} + +type RabbitMQCheckChildResponseGetUrlArgType = string +type RabbitMQCheckChildResponseGetUrlRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type RabbitMQCheckChildResponseGetUsernameAttributeType = *string + +func getRabbitMQCheckChildResponseGetUsernameAttributeTypeOk(arg RabbitMQCheckChildResponseGetUsernameAttributeType) (ret RabbitMQCheckChildResponseGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitMQCheckChildResponseGetUsernameAttributeType(arg *RabbitMQCheckChildResponseGetUsernameAttributeType, val RabbitMQCheckChildResponseGetUsernameRetType) { + *arg = &val +} + +type RabbitMQCheckChildResponseGetUsernameArgType = string +type RabbitMQCheckChildResponseGetUsernameRetType = string + +// RabbitMQCheckChildResponse struct for RabbitMQCheckChildResponse +type RabbitMQCheckChildResponse struct { + // REQUIRED + Id RabbitMQCheckChildResponseGetIdAttributeType `json:"id" required:"true"` + Password RabbitMQCheckChildResponseGetPasswordAttributeType `json:"password,omitempty"` + // REQUIRED + Url RabbitMQCheckChildResponseGetUrlAttributeType `json:"url" required:"true"` + Username RabbitMQCheckChildResponseGetUsernameAttributeType `json:"username,omitempty"` +} + +type _RabbitMQCheckChildResponse RabbitMQCheckChildResponse + +// NewRabbitMQCheckChildResponse instantiates a new RabbitMQCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRabbitMQCheckChildResponse(id RabbitMQCheckChildResponseGetIdArgType, url RabbitMQCheckChildResponseGetUrlArgType) *RabbitMQCheckChildResponse { + this := RabbitMQCheckChildResponse{} + setRabbitMQCheckChildResponseGetIdAttributeType(&this.Id, id) + setRabbitMQCheckChildResponseGetUrlAttributeType(&this.Url, url) + return &this +} + +// NewRabbitMQCheckChildResponseWithDefaults instantiates a new RabbitMQCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRabbitMQCheckChildResponseWithDefaults() *RabbitMQCheckChildResponse { + this := RabbitMQCheckChildResponse{} + return &this +} + +// GetId returns the Id field value +func (o *RabbitMQCheckChildResponse) GetId() (ret RabbitMQCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RabbitMQCheckChildResponse) GetIdOk() (ret RabbitMQCheckChildResponseGetIdRetType, ok bool) { + return getRabbitMQCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *RabbitMQCheckChildResponse) SetId(v RabbitMQCheckChildResponseGetIdRetType) { + setRabbitMQCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *RabbitMQCheckChildResponse) GetPassword() (res RabbitMQCheckChildResponseGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RabbitMQCheckChildResponse) GetPasswordOk() (ret RabbitMQCheckChildResponseGetPasswordRetType, ok bool) { + return getRabbitMQCheckChildResponseGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *RabbitMQCheckChildResponse) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *RabbitMQCheckChildResponse) SetPassword(v RabbitMQCheckChildResponseGetPasswordRetType) { + setRabbitMQCheckChildResponseGetPasswordAttributeType(&o.Password, v) +} + +// GetUrl returns the Url field value +func (o *RabbitMQCheckChildResponse) GetUrl() (ret RabbitMQCheckChildResponseGetUrlRetType) { + ret, _ = o.GetUrlOk() + return ret +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RabbitMQCheckChildResponse) GetUrlOk() (ret RabbitMQCheckChildResponseGetUrlRetType, ok bool) { + return getRabbitMQCheckChildResponseGetUrlAttributeTypeOk(o.Url) +} + +// SetUrl sets field value +func (o *RabbitMQCheckChildResponse) SetUrl(v RabbitMQCheckChildResponseGetUrlRetType) { + setRabbitMQCheckChildResponseGetUrlAttributeType(&o.Url, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *RabbitMQCheckChildResponse) GetUsername() (res RabbitMQCheckChildResponseGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RabbitMQCheckChildResponse) GetUsernameOk() (ret RabbitMQCheckChildResponseGetUsernameRetType, ok bool) { + return getRabbitMQCheckChildResponseGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *RabbitMQCheckChildResponse) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *RabbitMQCheckChildResponse) SetUsername(v RabbitMQCheckChildResponseGetUsernameRetType) { + setRabbitMQCheckChildResponseGetUsernameAttributeType(&o.Username, v) +} + +func (o RabbitMQCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRabbitMQCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getRabbitMQCheckChildResponseGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getRabbitMQCheckChildResponseGetUrlAttributeTypeOk(o.Url); ok { + toSerialize["Url"] = val + } + if val, ok := getRabbitMQCheckChildResponseGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullableRabbitMQCheckChildResponse struct { + value *RabbitMQCheckChildResponse + isSet bool +} + +func (v NullableRabbitMQCheckChildResponse) Get() *RabbitMQCheckChildResponse { + return v.value +} + +func (v *NullableRabbitMQCheckChildResponse) Set(val *RabbitMQCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRabbitMQCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRabbitMQCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRabbitMQCheckChildResponse(val *RabbitMQCheckChildResponse) *NullableRabbitMQCheckChildResponse { + return &NullableRabbitMQCheckChildResponse{value: val, isSet: true} +} + +func (v NullableRabbitMQCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRabbitMQCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_rabbit_mq_check_child_response_test.go b/services/observability/model_rabbit_mq_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_rabbit_mq_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_rabbitmq_check_response.go b/services/observability/model_rabbitmq_check_response.go new file mode 100644 index 000000000..186885927 --- /dev/null +++ b/services/observability/model_rabbitmq_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the RabbitmqCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RabbitmqCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type RabbitmqCheckResponseGetMessageAttributeType = *string + +func getRabbitmqCheckResponseGetMessageAttributeTypeOk(arg RabbitmqCheckResponseGetMessageAttributeType) (ret RabbitmqCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitmqCheckResponseGetMessageAttributeType(arg *RabbitmqCheckResponseGetMessageAttributeType, val RabbitmqCheckResponseGetMessageRetType) { + *arg = &val +} + +type RabbitmqCheckResponseGetMessageArgType = string +type RabbitmqCheckResponseGetMessageRetType = string + +/* + types and functions for rabbitmqCheck +*/ + +// isModel +type RabbitmqCheckResponseGetRabbitmqCheckAttributeType = *RabbitMQCheckChildResponse +type RabbitmqCheckResponseGetRabbitmqCheckArgType = RabbitMQCheckChildResponse +type RabbitmqCheckResponseGetRabbitmqCheckRetType = RabbitMQCheckChildResponse + +func getRabbitmqCheckResponseGetRabbitmqCheckAttributeTypeOk(arg RabbitmqCheckResponseGetRabbitmqCheckAttributeType) (ret RabbitmqCheckResponseGetRabbitmqCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitmqCheckResponseGetRabbitmqCheckAttributeType(arg *RabbitmqCheckResponseGetRabbitmqCheckAttributeType, val RabbitmqCheckResponseGetRabbitmqCheckRetType) { + *arg = &val +} + +/* + types and functions for rabbitmqChecks +*/ + +// isArray +type RabbitmqCheckResponseGetRabbitmqChecksAttributeType = *[]RabbitMQCheckChildResponse +type RabbitmqCheckResponseGetRabbitmqChecksArgType = []RabbitMQCheckChildResponse +type RabbitmqCheckResponseGetRabbitmqChecksRetType = []RabbitMQCheckChildResponse + +func getRabbitmqCheckResponseGetRabbitmqChecksAttributeTypeOk(arg RabbitmqCheckResponseGetRabbitmqChecksAttributeType) (ret RabbitmqCheckResponseGetRabbitmqChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRabbitmqCheckResponseGetRabbitmqChecksAttributeType(arg *RabbitmqCheckResponseGetRabbitmqChecksAttributeType, val RabbitmqCheckResponseGetRabbitmqChecksRetType) { + *arg = &val +} + +// RabbitmqCheckResponse struct for RabbitmqCheckResponse +type RabbitmqCheckResponse struct { + // REQUIRED + Message RabbitmqCheckResponseGetMessageAttributeType `json:"message" required:"true"` + RabbitmqCheck RabbitmqCheckResponseGetRabbitmqCheckAttributeType `json:"rabbitmqCheck,omitempty"` + // REQUIRED + RabbitmqChecks RabbitmqCheckResponseGetRabbitmqChecksAttributeType `json:"rabbitmqChecks" required:"true"` +} + +type _RabbitmqCheckResponse RabbitmqCheckResponse + +// NewRabbitmqCheckResponse instantiates a new RabbitmqCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRabbitmqCheckResponse(message RabbitmqCheckResponseGetMessageArgType, rabbitmqChecks RabbitmqCheckResponseGetRabbitmqChecksArgType) *RabbitmqCheckResponse { + this := RabbitmqCheckResponse{} + setRabbitmqCheckResponseGetMessageAttributeType(&this.Message, message) + setRabbitmqCheckResponseGetRabbitmqChecksAttributeType(&this.RabbitmqChecks, rabbitmqChecks) + return &this +} + +// NewRabbitmqCheckResponseWithDefaults instantiates a new RabbitmqCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRabbitmqCheckResponseWithDefaults() *RabbitmqCheckResponse { + this := RabbitmqCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *RabbitmqCheckResponse) GetMessage() (ret RabbitmqCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *RabbitmqCheckResponse) GetMessageOk() (ret RabbitmqCheckResponseGetMessageRetType, ok bool) { + return getRabbitmqCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *RabbitmqCheckResponse) SetMessage(v RabbitmqCheckResponseGetMessageRetType) { + setRabbitmqCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetRabbitmqCheck returns the RabbitmqCheck field value if set, zero value otherwise. +func (o *RabbitmqCheckResponse) GetRabbitmqCheck() (res RabbitmqCheckResponseGetRabbitmqCheckRetType) { + res, _ = o.GetRabbitmqCheckOk() + return +} + +// GetRabbitmqCheckOk returns a tuple with the RabbitmqCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RabbitmqCheckResponse) GetRabbitmqCheckOk() (ret RabbitmqCheckResponseGetRabbitmqCheckRetType, ok bool) { + return getRabbitmqCheckResponseGetRabbitmqCheckAttributeTypeOk(o.RabbitmqCheck) +} + +// HasRabbitmqCheck returns a boolean if a field has been set. +func (o *RabbitmqCheckResponse) HasRabbitmqCheck() bool { + _, ok := o.GetRabbitmqCheckOk() + return ok +} + +// SetRabbitmqCheck gets a reference to the given RabbitMQCheckChildResponse and assigns it to the RabbitmqCheck field. +func (o *RabbitmqCheckResponse) SetRabbitmqCheck(v RabbitmqCheckResponseGetRabbitmqCheckRetType) { + setRabbitmqCheckResponseGetRabbitmqCheckAttributeType(&o.RabbitmqCheck, v) +} + +// GetRabbitmqChecks returns the RabbitmqChecks field value +func (o *RabbitmqCheckResponse) GetRabbitmqChecks() (ret RabbitmqCheckResponseGetRabbitmqChecksRetType) { + ret, _ = o.GetRabbitmqChecksOk() + return ret +} + +// GetRabbitmqChecksOk returns a tuple with the RabbitmqChecks field value +// and a boolean to check if the value has been set. +func (o *RabbitmqCheckResponse) GetRabbitmqChecksOk() (ret RabbitmqCheckResponseGetRabbitmqChecksRetType, ok bool) { + return getRabbitmqCheckResponseGetRabbitmqChecksAttributeTypeOk(o.RabbitmqChecks) +} + +// SetRabbitmqChecks sets field value +func (o *RabbitmqCheckResponse) SetRabbitmqChecks(v RabbitmqCheckResponseGetRabbitmqChecksRetType) { + setRabbitmqCheckResponseGetRabbitmqChecksAttributeType(&o.RabbitmqChecks, v) +} + +func (o RabbitmqCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRabbitmqCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getRabbitmqCheckResponseGetRabbitmqCheckAttributeTypeOk(o.RabbitmqCheck); ok { + toSerialize["RabbitmqCheck"] = val + } + if val, ok := getRabbitmqCheckResponseGetRabbitmqChecksAttributeTypeOk(o.RabbitmqChecks); ok { + toSerialize["RabbitmqChecks"] = val + } + return toSerialize, nil +} + +type NullableRabbitmqCheckResponse struct { + value *RabbitmqCheckResponse + isSet bool +} + +func (v NullableRabbitmqCheckResponse) Get() *RabbitmqCheckResponse { + return v.value +} + +func (v *NullableRabbitmqCheckResponse) Set(val *RabbitmqCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRabbitmqCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRabbitmqCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRabbitmqCheckResponse(val *RabbitmqCheckResponse) *NullableRabbitmqCheckResponse { + return &NullableRabbitmqCheckResponse{value: val, isSet: true} +} + +func (v NullableRabbitmqCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRabbitmqCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_rabbitmq_check_response_test.go b/services/observability/model_rabbitmq_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_rabbitmq_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_redis_check_child_response.go b/services/observability/model_redis_check_child_response.go new file mode 100644 index 000000000..0f6338bac --- /dev/null +++ b/services/observability/model_redis_check_child_response.go @@ -0,0 +1,266 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the RedisCheckChildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedisCheckChildResponse{} + +/* + types and functions for id +*/ + +// isNotNullableString +type RedisCheckChildResponseGetIdAttributeType = *string + +func getRedisCheckChildResponseGetIdAttributeTypeOk(arg RedisCheckChildResponseGetIdAttributeType) (ret RedisCheckChildResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckChildResponseGetIdAttributeType(arg *RedisCheckChildResponseGetIdAttributeType, val RedisCheckChildResponseGetIdRetType) { + *arg = &val +} + +type RedisCheckChildResponseGetIdArgType = string +type RedisCheckChildResponseGetIdRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +type RedisCheckChildResponseGetPasswordAttributeType = *string + +func getRedisCheckChildResponseGetPasswordAttributeTypeOk(arg RedisCheckChildResponseGetPasswordAttributeType) (ret RedisCheckChildResponseGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckChildResponseGetPasswordAttributeType(arg *RedisCheckChildResponseGetPasswordAttributeType, val RedisCheckChildResponseGetPasswordRetType) { + *arg = &val +} + +type RedisCheckChildResponseGetPasswordArgType = string +type RedisCheckChildResponseGetPasswordRetType = string + +/* + types and functions for server +*/ + +// isNotNullableString +type RedisCheckChildResponseGetServerAttributeType = *string + +func getRedisCheckChildResponseGetServerAttributeTypeOk(arg RedisCheckChildResponseGetServerAttributeType) (ret RedisCheckChildResponseGetServerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckChildResponseGetServerAttributeType(arg *RedisCheckChildResponseGetServerAttributeType, val RedisCheckChildResponseGetServerRetType) { + *arg = &val +} + +type RedisCheckChildResponseGetServerArgType = string +type RedisCheckChildResponseGetServerRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type RedisCheckChildResponseGetUsernameAttributeType = *string + +func getRedisCheckChildResponseGetUsernameAttributeTypeOk(arg RedisCheckChildResponseGetUsernameAttributeType) (ret RedisCheckChildResponseGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckChildResponseGetUsernameAttributeType(arg *RedisCheckChildResponseGetUsernameAttributeType, val RedisCheckChildResponseGetUsernameRetType) { + *arg = &val +} + +type RedisCheckChildResponseGetUsernameArgType = string +type RedisCheckChildResponseGetUsernameRetType = string + +// RedisCheckChildResponse struct for RedisCheckChildResponse +type RedisCheckChildResponse struct { + // REQUIRED + Id RedisCheckChildResponseGetIdAttributeType `json:"id" required:"true"` + Password RedisCheckChildResponseGetPasswordAttributeType `json:"password,omitempty"` + // REQUIRED + Server RedisCheckChildResponseGetServerAttributeType `json:"server" required:"true"` + Username RedisCheckChildResponseGetUsernameAttributeType `json:"username,omitempty"` +} + +type _RedisCheckChildResponse RedisCheckChildResponse + +// NewRedisCheckChildResponse instantiates a new RedisCheckChildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedisCheckChildResponse(id RedisCheckChildResponseGetIdArgType, server RedisCheckChildResponseGetServerArgType) *RedisCheckChildResponse { + this := RedisCheckChildResponse{} + setRedisCheckChildResponseGetIdAttributeType(&this.Id, id) + setRedisCheckChildResponseGetServerAttributeType(&this.Server, server) + return &this +} + +// NewRedisCheckChildResponseWithDefaults instantiates a new RedisCheckChildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedisCheckChildResponseWithDefaults() *RedisCheckChildResponse { + this := RedisCheckChildResponse{} + return &this +} + +// GetId returns the Id field value +func (o *RedisCheckChildResponse) GetId() (ret RedisCheckChildResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RedisCheckChildResponse) GetIdOk() (ret RedisCheckChildResponseGetIdRetType, ok bool) { + return getRedisCheckChildResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *RedisCheckChildResponse) SetId(v RedisCheckChildResponseGetIdRetType) { + setRedisCheckChildResponseGetIdAttributeType(&o.Id, v) +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *RedisCheckChildResponse) GetPassword() (res RedisCheckChildResponseGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedisCheckChildResponse) GetPasswordOk() (ret RedisCheckChildResponseGetPasswordRetType, ok bool) { + return getRedisCheckChildResponseGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword returns a boolean if a field has been set. +func (o *RedisCheckChildResponse) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *RedisCheckChildResponse) SetPassword(v RedisCheckChildResponseGetPasswordRetType) { + setRedisCheckChildResponseGetPasswordAttributeType(&o.Password, v) +} + +// GetServer returns the Server field value +func (o *RedisCheckChildResponse) GetServer() (ret RedisCheckChildResponseGetServerRetType) { + ret, _ = o.GetServerOk() + return ret +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *RedisCheckChildResponse) GetServerOk() (ret RedisCheckChildResponseGetServerRetType, ok bool) { + return getRedisCheckChildResponseGetServerAttributeTypeOk(o.Server) +} + +// SetServer sets field value +func (o *RedisCheckChildResponse) SetServer(v RedisCheckChildResponseGetServerRetType) { + setRedisCheckChildResponseGetServerAttributeType(&o.Server, v) +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *RedisCheckChildResponse) GetUsername() (res RedisCheckChildResponseGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedisCheckChildResponse) GetUsernameOk() (ret RedisCheckChildResponseGetUsernameRetType, ok bool) { + return getRedisCheckChildResponseGetUsernameAttributeTypeOk(o.Username) +} + +// HasUsername returns a boolean if a field has been set. +func (o *RedisCheckChildResponse) HasUsername() bool { + _, ok := o.GetUsernameOk() + return ok +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *RedisCheckChildResponse) SetUsername(v RedisCheckChildResponseGetUsernameRetType) { + setRedisCheckChildResponseGetUsernameAttributeType(&o.Username, v) +} + +func (o RedisCheckChildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRedisCheckChildResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getRedisCheckChildResponseGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getRedisCheckChildResponseGetServerAttributeTypeOk(o.Server); ok { + toSerialize["Server"] = val + } + if val, ok := getRedisCheckChildResponseGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +type NullableRedisCheckChildResponse struct { + value *RedisCheckChildResponse + isSet bool +} + +func (v NullableRedisCheckChildResponse) Get() *RedisCheckChildResponse { + return v.value +} + +func (v *NullableRedisCheckChildResponse) Set(val *RedisCheckChildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRedisCheckChildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRedisCheckChildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedisCheckChildResponse(val *RedisCheckChildResponse) *NullableRedisCheckChildResponse { + return &NullableRedisCheckChildResponse{value: val, isSet: true} +} + +func (v NullableRedisCheckChildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedisCheckChildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_redis_check_child_response_test.go b/services/observability/model_redis_check_child_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_redis_check_child_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_redis_check_response.go b/services/observability/model_redis_check_response.go new file mode 100644 index 000000000..42d2b9ffd --- /dev/null +++ b/services/observability/model_redis_check_response.go @@ -0,0 +1,216 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the RedisCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedisCheckResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type RedisCheckResponseGetMessageAttributeType = *string + +func getRedisCheckResponseGetMessageAttributeTypeOk(arg RedisCheckResponseGetMessageAttributeType) (ret RedisCheckResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckResponseGetMessageAttributeType(arg *RedisCheckResponseGetMessageAttributeType, val RedisCheckResponseGetMessageRetType) { + *arg = &val +} + +type RedisCheckResponseGetMessageArgType = string +type RedisCheckResponseGetMessageRetType = string + +/* + types and functions for redisCheck +*/ + +// isModel +type RedisCheckResponseGetRedisCheckAttributeType = *RedisCheckChildResponse +type RedisCheckResponseGetRedisCheckArgType = RedisCheckChildResponse +type RedisCheckResponseGetRedisCheckRetType = RedisCheckChildResponse + +func getRedisCheckResponseGetRedisCheckAttributeTypeOk(arg RedisCheckResponseGetRedisCheckAttributeType) (ret RedisCheckResponseGetRedisCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckResponseGetRedisCheckAttributeType(arg *RedisCheckResponseGetRedisCheckAttributeType, val RedisCheckResponseGetRedisCheckRetType) { + *arg = &val +} + +/* + types and functions for redisChecks +*/ + +// isArray +type RedisCheckResponseGetRedisChecksAttributeType = *[]RedisCheckChildResponse +type RedisCheckResponseGetRedisChecksArgType = []RedisCheckChildResponse +type RedisCheckResponseGetRedisChecksRetType = []RedisCheckChildResponse + +func getRedisCheckResponseGetRedisChecksAttributeTypeOk(arg RedisCheckResponseGetRedisChecksAttributeType) (ret RedisCheckResponseGetRedisChecksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRedisCheckResponseGetRedisChecksAttributeType(arg *RedisCheckResponseGetRedisChecksAttributeType, val RedisCheckResponseGetRedisChecksRetType) { + *arg = &val +} + +// RedisCheckResponse struct for RedisCheckResponse +type RedisCheckResponse struct { + // REQUIRED + Message RedisCheckResponseGetMessageAttributeType `json:"message" required:"true"` + RedisCheck RedisCheckResponseGetRedisCheckAttributeType `json:"redisCheck,omitempty"` + // REQUIRED + RedisChecks RedisCheckResponseGetRedisChecksAttributeType `json:"redisChecks" required:"true"` +} + +type _RedisCheckResponse RedisCheckResponse + +// NewRedisCheckResponse instantiates a new RedisCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedisCheckResponse(message RedisCheckResponseGetMessageArgType, redisChecks RedisCheckResponseGetRedisChecksArgType) *RedisCheckResponse { + this := RedisCheckResponse{} + setRedisCheckResponseGetMessageAttributeType(&this.Message, message) + setRedisCheckResponseGetRedisChecksAttributeType(&this.RedisChecks, redisChecks) + return &this +} + +// NewRedisCheckResponseWithDefaults instantiates a new RedisCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedisCheckResponseWithDefaults() *RedisCheckResponse { + this := RedisCheckResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *RedisCheckResponse) GetMessage() (ret RedisCheckResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *RedisCheckResponse) GetMessageOk() (ret RedisCheckResponseGetMessageRetType, ok bool) { + return getRedisCheckResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *RedisCheckResponse) SetMessage(v RedisCheckResponseGetMessageRetType) { + setRedisCheckResponseGetMessageAttributeType(&o.Message, v) +} + +// GetRedisCheck returns the RedisCheck field value if set, zero value otherwise. +func (o *RedisCheckResponse) GetRedisCheck() (res RedisCheckResponseGetRedisCheckRetType) { + res, _ = o.GetRedisCheckOk() + return +} + +// GetRedisCheckOk returns a tuple with the RedisCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedisCheckResponse) GetRedisCheckOk() (ret RedisCheckResponseGetRedisCheckRetType, ok bool) { + return getRedisCheckResponseGetRedisCheckAttributeTypeOk(o.RedisCheck) +} + +// HasRedisCheck returns a boolean if a field has been set. +func (o *RedisCheckResponse) HasRedisCheck() bool { + _, ok := o.GetRedisCheckOk() + return ok +} + +// SetRedisCheck gets a reference to the given RedisCheckChildResponse and assigns it to the RedisCheck field. +func (o *RedisCheckResponse) SetRedisCheck(v RedisCheckResponseGetRedisCheckRetType) { + setRedisCheckResponseGetRedisCheckAttributeType(&o.RedisCheck, v) +} + +// GetRedisChecks returns the RedisChecks field value +func (o *RedisCheckResponse) GetRedisChecks() (ret RedisCheckResponseGetRedisChecksRetType) { + ret, _ = o.GetRedisChecksOk() + return ret +} + +// GetRedisChecksOk returns a tuple with the RedisChecks field value +// and a boolean to check if the value has been set. +func (o *RedisCheckResponse) GetRedisChecksOk() (ret RedisCheckResponseGetRedisChecksRetType, ok bool) { + return getRedisCheckResponseGetRedisChecksAttributeTypeOk(o.RedisChecks) +} + +// SetRedisChecks sets field value +func (o *RedisCheckResponse) SetRedisChecks(v RedisCheckResponseGetRedisChecksRetType) { + setRedisCheckResponseGetRedisChecksAttributeType(&o.RedisChecks, v) +} + +func (o RedisCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRedisCheckResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getRedisCheckResponseGetRedisCheckAttributeTypeOk(o.RedisCheck); ok { + toSerialize["RedisCheck"] = val + } + if val, ok := getRedisCheckResponseGetRedisChecksAttributeTypeOk(o.RedisChecks); ok { + toSerialize["RedisChecks"] = val + } + return toSerialize, nil +} + +type NullableRedisCheckResponse struct { + value *RedisCheckResponse + isSet bool +} + +func (v NullableRedisCheckResponse) Get() *RedisCheckResponse { + return v.value +} + +func (v *NullableRedisCheckResponse) Set(val *RedisCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRedisCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRedisCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedisCheckResponse(val *RedisCheckResponse) *NullableRedisCheckResponse { + return &NullableRedisCheckResponse{value: val, isSet: true} +} + +func (v NullableRedisCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedisCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_redis_check_response_test.go b/services/observability/model_redis_check_response_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_redis_check_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_update_alert_config_route_payload.go b/services/observability/model_update_alert_config_route_payload.go index 42d0cb9e9..5769c5ea3 100644 --- a/services/observability/model_update_alert_config_route_payload.go +++ b/services/observability/model_update_alert_config_route_payload.go @@ -223,7 +223,7 @@ func setUpdateAlertConfigRoutePayloadGetRoutesAttributeType(arg *UpdateAlertConf // UpdateAlertConfigRoutePayload The root node of the routing tree. type UpdateAlertConfigRoutePayload struct { - // Whether an alert should continue matching subsequent sibling nodes. + // The continue parameter cannot be set to true on the root route because there are no subsequent sibling nodes to match. It must always be false. Continue UpdateAlertConfigRoutePayloadgetContinueAttributeType `json:"continue,omitempty"` // The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping. GroupBy UpdateAlertConfigRoutePayloadGetGroupByAttributeType `json:"groupBy,omitempty"` diff --git a/services/observability/model_update_alert_configs_payload_route.go b/services/observability/model_update_alert_configs_payload_route.go index fbc86db7a..e70660d96 100644 --- a/services/observability/model_update_alert_configs_payload_route.go +++ b/services/observability/model_update_alert_configs_payload_route.go @@ -203,7 +203,7 @@ func setUpdateAlertConfigsPayloadRouteGetRoutesAttributeType(arg *UpdateAlertCon // UpdateAlertConfigsPayloadRoute The root node of the routing tree. type UpdateAlertConfigsPayloadRoute struct { - // Whether an alert should continue matching subsequent sibling nodes. + // The continue parameter cannot be set to true on the root route because there are no subsequent sibling nodes to match. It must always be false. Continue UpdateAlertConfigsPayloadRoutegetContinueAttributeType `json:"continue,omitempty"` // The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping. GroupBy UpdateAlertConfigsPayloadRouteGetGroupByAttributeType `json:"groupBy,omitempty"` diff --git a/services/observability/model_update_alert_configs_payload_route_routes_inner.go b/services/observability/model_update_alert_configs_payload_route_routes_inner.go index 4e3dfdc1a..cbd005d40 100644 --- a/services/observability/model_update_alert_configs_payload_route_routes_inner.go +++ b/services/observability/model_update_alert_configs_payload_route_routes_inner.go @@ -223,7 +223,7 @@ func setUpdateAlertConfigsPayloadRouteRoutesInnerGetRoutesAttributeType(arg *Upd // UpdateAlertConfigsPayloadRouteRoutesInner As in one level above type UpdateAlertConfigsPayloadRouteRoutesInner struct { - // As in one level above + // Whether an alert should continue matching subsequent sibling nodes. Continue UpdateAlertConfigsPayloadRouteRoutesInnergetContinueAttributeType `json:"continue,omitempty"` GroupBy UpdateAlertConfigsPayloadRouteRoutesInnerGetGroupByAttributeType `json:"groupBy,omitempty"` // As in one level above diff --git a/services/observability/model_update_alertrecord_payload.go b/services/observability/model_update_alertrecord_payload.go new file mode 100644 index 000000000..ce97a015f --- /dev/null +++ b/services/observability/model_update_alertrecord_payload.go @@ -0,0 +1,175 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the UpdateAlertrecordPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAlertrecordPayload{} + +/* + types and functions for expr +*/ + +// isNotNullableString +type UpdateAlertrecordPayloadGetExprAttributeType = *string + +func getUpdateAlertrecordPayloadGetExprAttributeTypeOk(arg UpdateAlertrecordPayloadGetExprAttributeType) (ret UpdateAlertrecordPayloadGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertrecordPayloadGetExprAttributeType(arg *UpdateAlertrecordPayloadGetExprAttributeType, val UpdateAlertrecordPayloadGetExprRetType) { + *arg = &val +} + +type UpdateAlertrecordPayloadGetExprArgType = string +type UpdateAlertrecordPayloadGetExprRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateAlertrecordPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateAlertrecordPayloadGetLabelsArgType = map[string]interface{} +type UpdateAlertrecordPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateAlertrecordPayloadGetLabelsAttributeTypeOk(arg UpdateAlertrecordPayloadGetLabelsAttributeType) (ret UpdateAlertrecordPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertrecordPayloadGetLabelsAttributeType(arg *UpdateAlertrecordPayloadGetLabelsAttributeType, val UpdateAlertrecordPayloadGetLabelsRetType) { + *arg = &val +} + +// UpdateAlertrecordPayload Record. `Additional Validators:` * total config (all alert groups/rules/records) should not be bigger than 500000 characters as string since this the limitation of prometheus. +type UpdateAlertrecordPayload struct { + // The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts. + // REQUIRED + Expr UpdateAlertrecordPayloadGetExprAttributeType `json:"expr" required:"true"` + // map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters + Labels UpdateAlertrecordPayloadGetLabelsAttributeType `json:"labels,omitempty"` +} + +type _UpdateAlertrecordPayload UpdateAlertrecordPayload + +// NewUpdateAlertrecordPayload instantiates a new UpdateAlertrecordPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAlertrecordPayload(expr UpdateAlertrecordPayloadGetExprArgType) *UpdateAlertrecordPayload { + this := UpdateAlertrecordPayload{} + setUpdateAlertrecordPayloadGetExprAttributeType(&this.Expr, expr) + return &this +} + +// NewUpdateAlertrecordPayloadWithDefaults instantiates a new UpdateAlertrecordPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAlertrecordPayloadWithDefaults() *UpdateAlertrecordPayload { + this := UpdateAlertrecordPayload{} + return &this +} + +// GetExpr returns the Expr field value +func (o *UpdateAlertrecordPayload) GetExpr() (ret UpdateAlertrecordPayloadGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *UpdateAlertrecordPayload) GetExprOk() (ret UpdateAlertrecordPayloadGetExprRetType, ok bool) { + return getUpdateAlertrecordPayloadGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *UpdateAlertrecordPayload) SetExpr(v UpdateAlertrecordPayloadGetExprRetType) { + setUpdateAlertrecordPayloadGetExprAttributeType(&o.Expr, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateAlertrecordPayload) GetLabels() (res UpdateAlertrecordPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAlertrecordPayload) GetLabelsOk() (ret UpdateAlertrecordPayloadGetLabelsRetType, ok bool) { + return getUpdateAlertrecordPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateAlertrecordPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateAlertrecordPayload) SetLabels(v UpdateAlertrecordPayloadGetLabelsRetType) { + setUpdateAlertrecordPayloadGetLabelsAttributeType(&o.Labels, v) +} + +func (o UpdateAlertrecordPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateAlertrecordPayloadGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getUpdateAlertrecordPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullableUpdateAlertrecordPayload struct { + value *UpdateAlertrecordPayload + isSet bool +} + +func (v NullableUpdateAlertrecordPayload) Get() *UpdateAlertrecordPayload { + return v.value +} + +func (v *NullableUpdateAlertrecordPayload) Set(val *UpdateAlertrecordPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAlertrecordPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAlertrecordPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAlertrecordPayload(val *UpdateAlertrecordPayload) *NullableUpdateAlertrecordPayload { + return &NullableUpdateAlertrecordPayload{value: val, isSet: true} +} + +func (v NullableUpdateAlertrecordPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAlertrecordPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_update_alertrecord_payload_test.go b/services/observability/model_update_alertrecord_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_update_alertrecord_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_update_alertrule_payload.go b/services/observability/model_update_alertrule_payload.go new file mode 100644 index 000000000..0890f56a8 --- /dev/null +++ b/services/observability/model_update_alertrule_payload.go @@ -0,0 +1,274 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the UpdateAlertrulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAlertrulePayload{} + +/* + types and functions for annotations +*/ + +// isFreeform +type UpdateAlertrulePayloadGetAnnotationsAttributeType = *map[string]interface{} +type UpdateAlertrulePayloadGetAnnotationsArgType = map[string]interface{} +type UpdateAlertrulePayloadGetAnnotationsRetType = map[string]interface{} + +func getUpdateAlertrulePayloadGetAnnotationsAttributeTypeOk(arg UpdateAlertrulePayloadGetAnnotationsAttributeType) (ret UpdateAlertrulePayloadGetAnnotationsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertrulePayloadGetAnnotationsAttributeType(arg *UpdateAlertrulePayloadGetAnnotationsAttributeType, val UpdateAlertrulePayloadGetAnnotationsRetType) { + *arg = &val +} + +/* + types and functions for expr +*/ + +// isNotNullableString +type UpdateAlertrulePayloadGetExprAttributeType = *string + +func getUpdateAlertrulePayloadGetExprAttributeTypeOk(arg UpdateAlertrulePayloadGetExprAttributeType) (ret UpdateAlertrulePayloadGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertrulePayloadGetExprAttributeType(arg *UpdateAlertrulePayloadGetExprAttributeType, val UpdateAlertrulePayloadGetExprRetType) { + *arg = &val +} + +type UpdateAlertrulePayloadGetExprArgType = string +type UpdateAlertrulePayloadGetExprRetType = string + +/* + types and functions for for +*/ + +// isNotNullableString +type UpdateAlertrulePayloadGetForAttributeType = *string + +func getUpdateAlertrulePayloadGetForAttributeTypeOk(arg UpdateAlertrulePayloadGetForAttributeType) (ret UpdateAlertrulePayloadGetForRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertrulePayloadGetForAttributeType(arg *UpdateAlertrulePayloadGetForAttributeType, val UpdateAlertrulePayloadGetForRetType) { + *arg = &val +} + +type UpdateAlertrulePayloadGetForArgType = string +type UpdateAlertrulePayloadGetForRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateAlertrulePayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateAlertrulePayloadGetLabelsArgType = map[string]interface{} +type UpdateAlertrulePayloadGetLabelsRetType = map[string]interface{} + +func getUpdateAlertrulePayloadGetLabelsAttributeTypeOk(arg UpdateAlertrulePayloadGetLabelsAttributeType) (ret UpdateAlertrulePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertrulePayloadGetLabelsAttributeType(arg *UpdateAlertrulePayloadGetLabelsAttributeType, val UpdateAlertrulePayloadGetLabelsRetType) { + *arg = &val +} + +// UpdateAlertrulePayload Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. +type UpdateAlertrulePayload struct { + // map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters + Annotations UpdateAlertrulePayloadGetAnnotationsAttributeType `json:"annotations,omitempty"` + // The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts. + // REQUIRED + Expr UpdateAlertrulePayloadGetExprAttributeType `json:"expr" required:"true"` + // Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string + For UpdateAlertrulePayloadGetForAttributeType `json:"for,omitempty"` + // map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters + Labels UpdateAlertrulePayloadGetLabelsAttributeType `json:"labels,omitempty"` +} + +type _UpdateAlertrulePayload UpdateAlertrulePayload + +// NewUpdateAlertrulePayload instantiates a new UpdateAlertrulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAlertrulePayload(expr UpdateAlertrulePayloadGetExprArgType) *UpdateAlertrulePayload { + this := UpdateAlertrulePayload{} + setUpdateAlertrulePayloadGetExprAttributeType(&this.Expr, expr) + return &this +} + +// NewUpdateAlertrulePayloadWithDefaults instantiates a new UpdateAlertrulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAlertrulePayloadWithDefaults() *UpdateAlertrulePayload { + this := UpdateAlertrulePayload{} + var for_ string = "0s" + this.For = &for_ + return &this +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *UpdateAlertrulePayload) GetAnnotations() (res UpdateAlertrulePayloadGetAnnotationsRetType) { + res, _ = o.GetAnnotationsOk() + return +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAlertrulePayload) GetAnnotationsOk() (ret UpdateAlertrulePayloadGetAnnotationsRetType, ok bool) { + return getUpdateAlertrulePayloadGetAnnotationsAttributeTypeOk(o.Annotations) +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *UpdateAlertrulePayload) HasAnnotations() bool { + _, ok := o.GetAnnotationsOk() + return ok +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *UpdateAlertrulePayload) SetAnnotations(v UpdateAlertrulePayloadGetAnnotationsRetType) { + setUpdateAlertrulePayloadGetAnnotationsAttributeType(&o.Annotations, v) +} + +// GetExpr returns the Expr field value +func (o *UpdateAlertrulePayload) GetExpr() (ret UpdateAlertrulePayloadGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *UpdateAlertrulePayload) GetExprOk() (ret UpdateAlertrulePayloadGetExprRetType, ok bool) { + return getUpdateAlertrulePayloadGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *UpdateAlertrulePayload) SetExpr(v UpdateAlertrulePayloadGetExprRetType) { + setUpdateAlertrulePayloadGetExprAttributeType(&o.Expr, v) +} + +// GetFor returns the For field value if set, zero value otherwise. +func (o *UpdateAlertrulePayload) GetFor() (res UpdateAlertrulePayloadGetForRetType) { + res, _ = o.GetForOk() + return +} + +// GetForOk returns a tuple with the For field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAlertrulePayload) GetForOk() (ret UpdateAlertrulePayloadGetForRetType, ok bool) { + return getUpdateAlertrulePayloadGetForAttributeTypeOk(o.For) +} + +// HasFor returns a boolean if a field has been set. +func (o *UpdateAlertrulePayload) HasFor() bool { + _, ok := o.GetForOk() + return ok +} + +// SetFor gets a reference to the given string and assigns it to the For field. +func (o *UpdateAlertrulePayload) SetFor(v UpdateAlertrulePayloadGetForRetType) { + setUpdateAlertrulePayloadGetForAttributeType(&o.For, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateAlertrulePayload) GetLabels() (res UpdateAlertrulePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAlertrulePayload) GetLabelsOk() (ret UpdateAlertrulePayloadGetLabelsRetType, ok bool) { + return getUpdateAlertrulePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateAlertrulePayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateAlertrulePayload) SetLabels(v UpdateAlertrulePayloadGetLabelsRetType) { + setUpdateAlertrulePayloadGetLabelsAttributeType(&o.Labels, v) +} + +func (o UpdateAlertrulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateAlertrulePayloadGetAnnotationsAttributeTypeOk(o.Annotations); ok { + toSerialize["Annotations"] = val + } + if val, ok := getUpdateAlertrulePayloadGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getUpdateAlertrulePayloadGetForAttributeTypeOk(o.For); ok { + toSerialize["For"] = val + } + if val, ok := getUpdateAlertrulePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullableUpdateAlertrulePayload struct { + value *UpdateAlertrulePayload + isSet bool +} + +func (v NullableUpdateAlertrulePayload) Get() *UpdateAlertrulePayload { + return v.value +} + +func (v *NullableUpdateAlertrulePayload) Set(val *UpdateAlertrulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAlertrulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAlertrulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAlertrulePayload(val *UpdateAlertrulePayload) *NullableUpdateAlertrulePayload { + return &NullableUpdateAlertrulePayload{value: val, isSet: true} +} + +func (v NullableUpdateAlertrulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAlertrulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_update_alertrule_payload_test.go b/services/observability/model_update_alertrule_payload_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_update_alertrule_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_update_scrape_config_payload.go b/services/observability/model_update_scrape_config_payload.go index 415637ed1..1d20b6c5e 100644 --- a/services/observability/model_update_scrape_config_payload.go +++ b/services/observability/model_update_scrape_config_payload.go @@ -23,9 +23,9 @@ var _ MappedNullable = &UpdateScrapeConfigPayload{} */ // isModel -type UpdateScrapeConfigPayloadGetBasicAuthAttributeType = *CreateScrapeConfigPayloadBasicAuth -type UpdateScrapeConfigPayloadGetBasicAuthArgType = CreateScrapeConfigPayloadBasicAuth -type UpdateScrapeConfigPayloadGetBasicAuthRetType = CreateScrapeConfigPayloadBasicAuth +type UpdateScrapeConfigPayloadGetBasicAuthAttributeType = *PartialUpdateScrapeConfigsRequestInnerBasicAuth +type UpdateScrapeConfigPayloadGetBasicAuthArgType = PartialUpdateScrapeConfigsRequestInnerBasicAuth +type UpdateScrapeConfigPayloadGetBasicAuthRetType = PartialUpdateScrapeConfigsRequestInnerBasicAuth func getUpdateScrapeConfigPayloadGetBasicAuthAttributeTypeOk(arg UpdateScrapeConfigPayloadGetBasicAuthAttributeType) (ret UpdateScrapeConfigPayloadGetBasicAuthRetType, ok bool) { if arg == nil { @@ -125,9 +125,9 @@ type UpdateScrapeConfigPayloadGetMetricsPathRetType = string */ // isArray -type UpdateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType = *[]CreateScrapeConfigPayloadMetricsRelabelConfigsInner -type UpdateScrapeConfigPayloadGetMetricsRelabelConfigsArgType = []CreateScrapeConfigPayloadMetricsRelabelConfigsInner -type UpdateScrapeConfigPayloadGetMetricsRelabelConfigsRetType = []CreateScrapeConfigPayloadMetricsRelabelConfigsInner +type UpdateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType = *[]PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type UpdateScrapeConfigPayloadGetMetricsRelabelConfigsArgType = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner +type UpdateScrapeConfigPayloadGetMetricsRelabelConfigsRetType = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner func getUpdateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeTypeOk(arg UpdateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType) (ret UpdateScrapeConfigPayloadGetMetricsRelabelConfigsRetType, ok bool) { if arg == nil { @@ -371,9 +371,9 @@ func setUpdateScrapeConfigPayloadGetStaticConfigsAttributeType(arg *UpdateScrape */ // isModel -type UpdateScrapeConfigPayloadGetTlsConfigAttributeType = *CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type UpdateScrapeConfigPayloadGetTlsConfigArgType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig -type UpdateScrapeConfigPayloadGetTlsConfigRetType = CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig +type UpdateScrapeConfigPayloadGetTlsConfigAttributeType = *PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type UpdateScrapeConfigPayloadGetTlsConfigArgType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig +type UpdateScrapeConfigPayloadGetTlsConfigRetType = PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig func getUpdateScrapeConfigPayloadGetTlsConfigAttributeTypeOk(arg UpdateScrapeConfigPayloadGetTlsConfigAttributeType) (ret UpdateScrapeConfigPayloadGetTlsConfigRetType, ok bool) { if arg == nil { @@ -467,7 +467,7 @@ func (o *UpdateScrapeConfigPayload) HasBasicAuth() bool { return ok } -// SetBasicAuth gets a reference to the given CreateScrapeConfigPayloadBasicAuth and assigns it to the BasicAuth field. +// SetBasicAuth gets a reference to the given PartialUpdateScrapeConfigsRequestInnerBasicAuth and assigns it to the BasicAuth field. func (o *UpdateScrapeConfigPayload) SetBasicAuth(v UpdateScrapeConfigPayloadGetBasicAuthRetType) { setUpdateScrapeConfigPayloadGetBasicAuthAttributeType(&o.BasicAuth, v) } @@ -576,7 +576,7 @@ func (o *UpdateScrapeConfigPayload) HasMetricsRelabelConfigs() bool { return ok } -// SetMetricsRelabelConfigs gets a reference to the given []CreateScrapeConfigPayloadMetricsRelabelConfigsInner and assigns it to the MetricsRelabelConfigs field. +// SetMetricsRelabelConfigs gets a reference to the given []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner and assigns it to the MetricsRelabelConfigs field. func (o *UpdateScrapeConfigPayload) SetMetricsRelabelConfigs(v UpdateScrapeConfigPayloadGetMetricsRelabelConfigsRetType) { setUpdateScrapeConfigPayloadGetMetricsRelabelConfigsAttributeType(&o.MetricsRelabelConfigs, v) } @@ -713,7 +713,7 @@ func (o *UpdateScrapeConfigPayload) HasTlsConfig() bool { return ok } -// SetTlsConfig gets a reference to the given CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. +// SetTlsConfig gets a reference to the given PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig and assigns it to the TlsConfig field. func (o *UpdateScrapeConfigPayload) SetTlsConfig(v UpdateScrapeConfigPayloadGetTlsConfigRetType) { setUpdateScrapeConfigPayloadGetTlsConfigAttributeType(&o.TlsConfig, v) } diff --git a/services/observability/oas_commit b/services/observability/oas_commit new file mode 100644 index 000000000..588ee296b --- /dev/null +++ b/services/observability/oas_commit @@ -0,0 +1 @@ +964ac4ce34f0b6417f2496a1d48585c4926dee3a