Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .generator/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,9 @@ def request_parameter(context, operation_id, api_version, operation_specs, name,
for parameter in parameters:
if parameter["name"] == name:
schema = parameter.get("schema", {})
value = schema.get("example", schema.get("default"))
value = schema.get("example", schema.get("default", parameter.get("example")))
if value is None:
type_ = schema.get("type")
format_ = schema.get("format")
value = {
primitive_lookup = {
"string": {
"date-time": "2021-11-11T11:11:11.111+00:00",
None: name,
Expand All @@ -369,10 +367,20 @@ def request_parameter(context, operation_id, api_version, operation_specs, name,
"int64": 9223372036854775807,
None: 1,
},
"array": {
None: [],
"boolean": {
None: True,
},
}[type_][format_]
}

if schema.get("type") == "array":
type_ = schema.get("items", {}).get("type")
items_format_ = schema.get("items", {}).get("format")
value = [primitive_lookup[type_][items_format_]]
else:
type_ = schema.get("type")
format_ = schema.get("format")
value = primitive_lookup[type_][format_]

break

context["api_request"]["kwargs"][name] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static void main(String[] args) {
ServiceLevelObjectivesApi apiInstance = new ServiceLevelObjectivesApi(defaultClient);

try {
CheckCanDeleteSLOResponse result = apiInstance.checkCanDeleteSLO("ids");
CheckCanDeleteSLOResponse result = apiInstance.checkCanDeleteSLO("id1, id2, id3");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServiceLevelObjectivesApi#checkCanDeleteSLO");
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/agentless-scanning/DeleteAwsScanOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static void main(String[] args) {
AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient);

try {
apiInstance.deleteAwsScanOptions("account_id");
apiInstance.deleteAwsScanOptions("123456789012");
} catch (ApiException e) {
System.err.println("Exception when calling AgentlessScanningApi#deleteAwsScanOptions");
System.err.println("Status code: " + e.getCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static void main(String[] args) {
ApplicationSecurityApi apiInstance = new ApplicationSecurityApi(defaultClient);

try {
apiInstance.deleteApplicationSecurityWafCustomRule("custom_rule_id");
apiInstance.deleteApplicationSecurityWafCustomRule("3b5-v82-ns6");
} catch (ApiException e) {
System.err.println(
"Exception when calling ApplicationSecurityApi#deleteApplicationSecurityWafCustomRule");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static void main(String[] args) {

try {
ApplicationSecurityWafCustomRuleResponse result =
apiInstance.getApplicationSecurityWafCustomRule("custom_rule_id");
apiInstance.getApplicationSecurityWafCustomRule("3b5-v82-ns6");
System.out.println(result);
} catch (ApiException e) {
System.err.println(
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/case-management/DeleteProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static void main(String[] args) {
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
apiInstance.deleteProject("project_id");
apiInstance.deleteProject("e555e290-ed65-49bd-ae18-8acbfcf18db7");
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#deleteProject");
System.err.println("Status code: " + e.getCode());
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/case-management/GetProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static void main(String[] args) {
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
ProjectResponse result = apiInstance.getProject("project_id");
ProjectResponse result = apiInstance.getProject("e555e290-ed65-49bd-ae18-8acbfcf18db7");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#getProject");
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/metrics/GetMetricTagCardinalityDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static void main(String[] args) {

try {
MetricTagCardinalitiesResponse result =
apiInstance.getMetricTagCardinalityDetails("metric_name");
apiInstance.getMetricTagCardinalityDetails("dist.http.endpoint.request");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MetricsApi#getMetricTagCardinalityDetails");
Expand Down