diff --git a/.gen/anchore/.openapi-generator/FILES b/.gen/anchore/.openapi-generator/FILES new file mode 100644 index 0000000000..6b06d2f722 --- /dev/null +++ b/.gen/anchore/.openapi-generator/FILES @@ -0,0 +1,328 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_archives.go +api_default.go +api_events.go +api_identity.go +api_images.go +api_import.go +api_imports.go +api_policies.go +api_query.go +api_registries.go +api_repository_credentials.go +api_subscriptions.go +api_summaries.go +api_system.go +api_user_management.go +client.go +configuration.go +docs/AccessCredential.md +docs/Account.md +docs/AccountCreationRequest.md +docs/AccountStatus.md +docs/AnalysisArchiveAddResult.md +docs/AnalysisArchiveRulesSummary.md +docs/AnalysisArchiveSource.md +docs/AnalysisArchiveSummary.md +docs/AnalysisArchiveTransitionHistory.md +docs/AnalysisArchiveTransitionRule.md +docs/AnalysisArchiveTransitionRuleExclude.md +docs/AnalysisUpdateEval.md +docs/AnalysisUpdateNotification.md +docs/AnalysisUpdateNotificationAllOf.md +docs/AnalysisUpdateNotificationData.md +docs/AnalysisUpdateNotificationDataAllOf.md +docs/AnalysisUpdateNotificationPayload.md +docs/AnalysisUpdateNotificationPayloadAllOf.md +docs/AnchoreErrorCode.md +docs/AnchoreImage.md +docs/AnchoreImageTagSummary.md +docs/ApiErrorResponse.md +docs/ArchiveSummary.md +docs/ArchivedAnalysis.md +docs/ArchivesApi.md +docs/BaseNotificationData.md +docs/CVSSV2Scores.md +docs/CVSSV3Scores.md +docs/ContentFilesResponse.md +docs/ContentFilesResponseContentInner.md +docs/ContentJAVAPackageResponse.md +docs/ContentJAVAPackageResponseContentInner.md +docs/ContentMalwareResponse.md +docs/ContentPackageResponse.md +docs/ContentPackageResponseContentInner.md +docs/ContentResponse.md +docs/DefaultApi.md +docs/DeleteImageResponse.md +docs/EventCategory.md +docs/EventDescription.md +docs/EventResponse.md +docs/EventResponseEvent.md +docs/EventResponseEventResource.md +docs/EventResponseEventSource.md +docs/EventSubcategory.md +docs/EventsApi.md +docs/EventsList.md +docs/FeedGroupMetadata.md +docs/FeedMetadata.md +docs/FeedSyncResult.md +docs/FileContentSearchResult.md +docs/GateSpec.md +docs/GenericNotificationPayload.md +docs/GroupSyncResult.md +docs/IdentityApi.md +docs/ImageAnalysisRequest.md +docs/ImageDetail.md +docs/ImageFilter.md +docs/ImageImportContentResponse.md +docs/ImageImportManifest.md +docs/ImageImportOperation.md +docs/ImagePackageManifest.md +docs/ImageRef.md +docs/ImageReference.md +docs/ImageSelectionRule.md +docs/ImageSelector.md +docs/ImageSource.md +docs/ImageWithPackages.md +docs/ImagesApi.md +docs/ImportApi.md +docs/ImportContentDigests.md +docs/ImportDescriptor.md +docs/ImportDistribution.md +docs/ImportPackage.md +docs/ImportPackageLocation.md +docs/ImportPackageRelationship.md +docs/ImportSchema.md +docs/ImportSource.md +docs/ImportsApi.md +docs/LocalAnalysisSource.md +docs/MalwareScan.md +docs/MalwareScanFindingsInner.md +docs/MappingRule.md +docs/MetadataResponse.md +docs/NotificationBase.md +docs/NvdDataObject.md +docs/PackageReference.md +docs/PaginatedImageList.md +docs/PaginatedImageListAllOf.md +docs/PaginatedVulnerabilityList.md +docs/PaginatedVulnerabilityListAllOf.md +docs/PaginatedVulnerableImageList.md +docs/PaginatedVulnerableImageListAllOf.md +docs/PaginationProperties.md +docs/PoliciesApi.md +docs/Policy.md +docs/PolicyBundle.md +docs/PolicyBundleRecord.md +docs/PolicyEvalNotification.md +docs/PolicyEvalNotificationAllOf.md +docs/PolicyEvalNotificationData.md +docs/PolicyEvalNotificationDataAllOf.md +docs/PolicyEvalNotificationPayload.md +docs/PolicyEvalNotificationPayloadAllOf.md +docs/PolicyRule.md +docs/PolicyRuleParamsInner.md +docs/QueryApi.md +docs/RegexContentMatch.md +docs/RegistriesApi.md +docs/RegistryConfiguration.md +docs/RegistryConfigurationRequest.md +docs/RegistryDigestSource.md +docs/RegistryTagSource.md +docs/RepositoryCredentialsApi.md +docs/RetrievedFile.md +docs/SecretSearchResult.md +docs/Service.md +docs/ServiceVersion.md +docs/ServiceVersionApi.md +docs/ServiceVersionDb.md +docs/ServiceVersionService.md +docs/StandaloneVulnerability.md +docs/StatusResponse.md +docs/Subscription.md +docs/SubscriptionRequest.md +docs/SubscriptionUpdate.md +docs/SubscriptionsApi.md +docs/SummariesApi.md +docs/SystemApi.md +docs/SystemStatusResponse.md +docs/TagEntry.md +docs/TagUpdateNotification.md +docs/TagUpdateNotificationAllOf.md +docs/TagUpdateNotificationData.md +docs/TagUpdateNotificationDataAllOf.md +docs/TagUpdateNotificationPayload.md +docs/TagUpdateNotificationPayloadAllOf.md +docs/TokenResponse.md +docs/TriggerParamSpec.md +docs/TriggerSpec.md +docs/User.md +docs/UserCreationRequest.md +docs/UserManagementApi.md +docs/VendorDataObject.md +docs/VulnDiffResult.md +docs/VulnUpdateNotification.md +docs/VulnUpdateNotificationAllOf.md +docs/VulnUpdateNotificationData.md +docs/VulnUpdateNotificationDataAllOf.md +docs/VulnUpdateNotificationPayload.md +docs/VulnUpdateNotificationPayloadAllOf.md +docs/Vulnerability.md +docs/VulnerabilityReference.md +docs/VulnerabilityResponse.md +docs/VulnerableImage.md +docs/VulnerablePackageReference.md +docs/Whitelist.md +docs/WhitelistItem.md +git_push.sh +go.mod +go.sum +model_access_credential.go +model_account.go +model_account_creation_request.go +model_account_status.go +model_analysis_archive_add_result.go +model_analysis_archive_rules_summary.go +model_analysis_archive_source.go +model_analysis_archive_summary.go +model_analysis_archive_transition_history.go +model_analysis_archive_transition_rule.go +model_analysis_archive_transition_rule_exclude.go +model_analysis_update_eval.go +model_analysis_update_notification.go +model_analysis_update_notification_all_of.go +model_analysis_update_notification_data.go +model_analysis_update_notification_data_all_of.go +model_analysis_update_notification_payload.go +model_analysis_update_notification_payload_all_of.go +model_anchore_error_code.go +model_anchore_image.go +model_anchore_image_tag_summary.go +model_api_error_response.go +model_archive_summary.go +model_archived_analysis.go +model_base_notification_data.go +model_content_files_response.go +model_content_files_response_content_inner.go +model_content_java_package_response.go +model_content_java_package_response_content_inner.go +model_content_malware_response.go +model_content_package_response.go +model_content_package_response_content_inner.go +model_content_response.go +model_cvssv2_scores.go +model_cvssv3_scores.go +model_delete_image_response.go +model_event_category.go +model_event_description.go +model_event_response.go +model_event_response_event.go +model_event_response_event_resource.go +model_event_response_event_source.go +model_event_subcategory.go +model_events_list.go +model_feed_group_metadata.go +model_feed_metadata.go +model_feed_sync_result.go +model_file_content_search_result.go +model_gate_spec.go +model_generic_notification_payload.go +model_group_sync_result.go +model_image_analysis_request.go +model_image_detail.go +model_image_filter.go +model_image_import_content_response.go +model_image_import_manifest.go +model_image_import_operation.go +model_image_package_manifest.go +model_image_ref.go +model_image_reference.go +model_image_selection_rule.go +model_image_selector.go +model_image_source.go +model_image_with_packages.go +model_import_content_digests.go +model_import_descriptor.go +model_import_distribution.go +model_import_package.go +model_import_package_location.go +model_import_package_relationship.go +model_import_schema.go +model_import_source.go +model_local_analysis_source.go +model_malware_scan.go +model_malware_scan_findings_inner.go +model_mapping_rule.go +model_metadata_response.go +model_notification_base.go +model_nvd_data_object.go +model_package_reference.go +model_paginated_image_list.go +model_paginated_image_list_all_of.go +model_paginated_vulnerability_list.go +model_paginated_vulnerability_list_all_of.go +model_paginated_vulnerable_image_list.go +model_paginated_vulnerable_image_list_all_of.go +model_pagination_properties.go +model_policy.go +model_policy_bundle.go +model_policy_bundle_record.go +model_policy_eval_notification.go +model_policy_eval_notification_all_of.go +model_policy_eval_notification_data.go +model_policy_eval_notification_data_all_of.go +model_policy_eval_notification_payload.go +model_policy_eval_notification_payload_all_of.go +model_policy_rule.go +model_policy_rule_params_inner.go +model_regex_content_match.go +model_registry_configuration.go +model_registry_configuration_request.go +model_registry_digest_source.go +model_registry_tag_source.go +model_retrieved_file.go +model_secret_search_result.go +model_service.go +model_service_version.go +model_service_version_api.go +model_service_version_db.go +model_service_version_service.go +model_standalone_vulnerability.go +model_status_response.go +model_subscription.go +model_subscription_request.go +model_subscription_update.go +model_system_status_response.go +model_tag_entry.go +model_tag_update_notification.go +model_tag_update_notification_all_of.go +model_tag_update_notification_data.go +model_tag_update_notification_data_all_of.go +model_tag_update_notification_payload.go +model_tag_update_notification_payload_all_of.go +model_token_response.go +model_trigger_param_spec.go +model_trigger_spec.go +model_user.go +model_user_creation_request.go +model_vendor_data_object.go +model_vuln_diff_result.go +model_vuln_update_notification.go +model_vuln_update_notification_all_of.go +model_vuln_update_notification_data.go +model_vuln_update_notification_data_all_of.go +model_vuln_update_notification_payload.go +model_vuln_update_notification_payload_all_of.go +model_vulnerability.go +model_vulnerability_reference.go +model_vulnerability_response.go +model_vulnerable_image.go +model_vulnerable_package_reference.go +model_whitelist.go +model_whitelist_item.go +response.go +utils.go diff --git a/.gen/anchore/.openapi-generator/VERSION b/.gen/anchore/.openapi-generator/VERSION index ecedc98d1d..4ac4fded49 100644 --- a/.gen/anchore/.openapi-generator/VERSION +++ b/.gen/anchore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1 \ No newline at end of file +6.2.0 \ No newline at end of file diff --git a/.gen/anchore/BUILD.plz b/.gen/anchore/BUILD.plz index f10f6dc356..3b9b6da328 100644 --- a/.gen/anchore/BUILD.plz +++ b/.gen/anchore/BUILD.plz @@ -3,7 +3,6 @@ go_library( srcs = glob(["*.go"], exclude = ["*_test.go"]), visibility = ["PUBLIC"], deps = [ - "//third_party/go:github.com__antihax__optional", "//third_party/go:golang.org__x__oauth2", ], ) diff --git a/.gen/anchore/README.md b/.gen/anchore/README.md index 1650b84305..3d1efe60f5 100644 --- a/.gen/anchore/README.md +++ b/.gen/anchore/README.md @@ -5,7 +5,7 @@ This is the Anchore Engine API. Provides the primary external API for users of t ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 0.1.12 +- API version: 0.1.20 - Package version: 1.0.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen @@ -17,13 +17,59 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import "./anchore" +import anchore "github.com/GIT_USER_ID/GIT_REPO_ID" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), anchore.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), anchore.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), anchore.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), anchore.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) ``` ## Documentation for API Endpoints @@ -42,13 +88,16 @@ Class | Method | HTTP request | Description *ArchivesApi* | [**ListAnalysisArchiveRules**](docs/ArchivesApi.md#listanalysisarchiverules) | **Get** /archives/rules | *ArchivesApi* | [**ListArchives**](docs/ArchivesApi.md#listarchives) | **Get** /archives | *DefaultApi* | [**GetOauthToken**](docs/DefaultApi.md#getoauthtoken) | **Post** /oauth/token | -*DefaultApi* | [**HealthNoop**](docs/DefaultApi.md#healthnoop) | **Get** /health | +*DefaultApi* | [**HealthCheck**](docs/DefaultApi.md#healthcheck) | **Get** /health | +*DefaultApi* | [**ListFileContentSearchResults**](docs/DefaultApi.md#listfilecontentsearchresults) | **Get** /images/{imageDigest}/artifacts/file_content_search | Return a list of analyzer artifacts of the specified type +*DefaultApi* | [**ListRetrievedFiles**](docs/DefaultApi.md#listretrievedfiles) | **Get** /images/{imageDigest}/artifacts/retrieved_files | Return a list of analyzer artifacts of the specified type +*DefaultApi* | [**ListSecretSearchResults**](docs/DefaultApi.md#listsecretsearchresults) | **Get** /images/{imageDigest}/artifacts/secret_search | Return a list of analyzer artifacts of the specified type *DefaultApi* | [**Ping**](docs/DefaultApi.md#ping) | **Get** / | -*DefaultApi* | [**QueryImagesByPackage**](docs/DefaultApi.md#queryimagesbypackage) | **Get** /query/images/by_package | List of images containing given package -*DefaultApi* | [**VersionNoop**](docs/DefaultApi.md#versionnoop) | **Get** /version | +*DefaultApi* | [**VersionCheck**](docs/DefaultApi.md#versioncheck) | **Get** /version | *EventsApi* | [**DeleteEvent**](docs/EventsApi.md#deleteevent) | **Delete** /events/{eventId} | Delete Event *EventsApi* | [**DeleteEvents**](docs/EventsApi.md#deleteevents) | **Delete** /events | Delete Events *EventsApi* | [**GetEvent**](docs/EventsApi.md#getevent) | **Get** /events/{eventId} | Get Event +*EventsApi* | [**ListEventTypes**](docs/EventsApi.md#listeventtypes) | **Get** /event_types | List Event Types *EventsApi* | [**ListEvents**](docs/EventsApi.md#listevents) | **Get** /events | List Events *IdentityApi* | [**AddCredential**](docs/IdentityApi.md#addcredential) | **Post** /user/credentials | add/replace credential *IdentityApi* | [**GetCredentials**](docs/IdentityApi.md#getcredentials) | **Get** /user/credentials | Get current credential summary @@ -57,6 +106,7 @@ Class | Method | HTTP request | Description *ImagesApi* | [**AddImage**](docs/ImagesApi.md#addimage) | **Post** /images | Submit a new image for analysis by the engine *ImagesApi* | [**DeleteImage**](docs/ImagesApi.md#deleteimage) | **Delete** /images/{imageDigest} | Delete an image analysis *ImagesApi* | [**DeleteImageByImageId**](docs/ImagesApi.md#deleteimagebyimageid) | **Delete** /images/by_id/{imageId} | Delete image by docker imageId +*ImagesApi* | [**DeleteImagesAsync**](docs/ImagesApi.md#deleteimagesasync) | **Delete** /images | Bulk mark images for deletion *ImagesApi* | [**GetImage**](docs/ImagesApi.md#getimage) | **Get** /images/{imageDigest} | Get image metadata *ImagesApi* | [**GetImageByImageId**](docs/ImagesApi.md#getimagebyimageid) | **Get** /images/by_id/{imageId} | Lookup image by docker imageId *ImagesApi* | [**GetImageContentByType**](docs/ImagesApi.md#getimagecontentbytype) | **Get** /images/{imageDigest}/content/{ctype} | Get the content of an image by type @@ -65,6 +115,7 @@ Class | Method | HTTP request | Description *ImagesApi* | [**GetImageContentByTypeImageIdFiles**](docs/ImagesApi.md#getimagecontentbytypeimageidfiles) | **Get** /images/by_id/{imageId}/content/files | Get the content of an image by type files *ImagesApi* | [**GetImageContentByTypeImageIdJavapackage**](docs/ImagesApi.md#getimagecontentbytypeimageidjavapackage) | **Get** /images/by_id/{imageId}/content/java | Get the content of an image by type java *ImagesApi* | [**GetImageContentByTypeJavapackage**](docs/ImagesApi.md#getimagecontentbytypejavapackage) | **Get** /images/{imageDigest}/content/java | Get the content of an image by type java +*ImagesApi* | [**GetImageContentByTypeMalware**](docs/ImagesApi.md#getimagecontentbytypemalware) | **Get** /images/{imageDigest}/content/malware | Get the content of an image by type malware *ImagesApi* | [**GetImageMetadataByType**](docs/ImagesApi.md#getimagemetadatabytype) | **Get** /images/{imageDigest}/metadata/{mtype} | Get the metadata of an image by type *ImagesApi* | [**GetImagePolicyCheck**](docs/ImagesApi.md#getimagepolicycheck) | **Get** /images/{imageDigest}/check | Check policy evaluation status for image *ImagesApi* | [**GetImagePolicyCheckByImageId**](docs/ImagesApi.md#getimagepolicycheckbyimageid) | **Get** /images/by_id/{imageId}/check | Check policy evaluation status for image @@ -76,29 +127,43 @@ Class | Method | HTTP request | Description *ImagesApi* | [**ListImageContentByImageid**](docs/ImagesApi.md#listimagecontentbyimageid) | **Get** /images/by_id/{imageId}/content | List image content types *ImagesApi* | [**ListImageMetadata**](docs/ImagesApi.md#listimagemetadata) | **Get** /images/{imageDigest}/metadata | List image metadata types *ImagesApi* | [**ListImages**](docs/ImagesApi.md#listimages) | **Get** /images | List all visible images -*ImportApi* | [**ImportImageArchive**](docs/ImportApi.md#importimagearchive) | **Post** /import/images | Import an anchore image tar.gz archive file. +*ImportApi* | [**ImportImageArchive**](docs/ImportApi.md#importimagearchive) | **Post** /import/images | Import an anchore image tar.gz archive file. This is a deprecated API replaced by the \"/imports/images\" route +*ImportsApi* | [**CreateOperation**](docs/ImportsApi.md#createoperation) | **Post** /imports/images | Begin the import of an image analyzed by Syft into the system +*ImportsApi* | [**GetOperation**](docs/ImportsApi.md#getoperation) | **Get** /imports/images/{operation_id} | Get detail on a single import +*ImportsApi* | [**ImportImageConfig**](docs/ImportsApi.md#importimageconfig) | **Post** /imports/images/{operation_id}/image_config | Import a docker or OCI image config to associate with the image +*ImportsApi* | [**ImportImageDockerfile**](docs/ImportsApi.md#importimagedockerfile) | **Post** /imports/images/{operation_id}/dockerfile | Begin the import of an image analyzed by Syft into the system +*ImportsApi* | [**ImportImageManifest**](docs/ImportsApi.md#importimagemanifest) | **Post** /imports/images/{operation_id}/manifest | Import a docker or OCI distribution manifest to associate with the image +*ImportsApi* | [**ImportImagePackages**](docs/ImportsApi.md#importimagepackages) | **Post** /imports/images/{operation_id}/packages | Begin the import of an image analyzed by Syft into the system +*ImportsApi* | [**ImportImageParentManifest**](docs/ImportsApi.md#importimageparentmanifest) | **Post** /imports/images/{operation_id}/parent_manifest | Import a docker or OCI distribution manifest list to associate with the image +*ImportsApi* | [**InvalidateOperation**](docs/ImportsApi.md#invalidateoperation) | **Delete** /imports/images/{operation_id} | Invalidate operation ID so it can be garbage collected +*ImportsApi* | [**ListImportDockerfiles**](docs/ImportsApi.md#listimportdockerfiles) | **Get** /imports/images/{operation_id}/dockerfile | List uploaded dockerfiles +*ImportsApi* | [**ListImportImageConfigs**](docs/ImportsApi.md#listimportimageconfigs) | **Get** /imports/images/{operation_id}/image_config | List uploaded image configs +*ImportsApi* | [**ListImportImageManifests**](docs/ImportsApi.md#listimportimagemanifests) | **Get** /imports/images/{operation_id}/manifest | List uploaded image manifests +*ImportsApi* | [**ListImportPackages**](docs/ImportsApi.md#listimportpackages) | **Get** /imports/images/{operation_id}/packages | List uploaded package manifests +*ImportsApi* | [**ListImportParentManifests**](docs/ImportsApi.md#listimportparentmanifests) | **Get** /imports/images/{operation_id}/parent_manifest | List uploaded parent manifests (manifest lists for a tag) +*ImportsApi* | [**ListOperations**](docs/ImportsApi.md#listoperations) | **Get** /imports/images | Lists in-progress imports *PoliciesApi* | [**AddPolicy**](docs/PoliciesApi.md#addpolicy) | **Post** /policies | Add a new policy *PoliciesApi* | [**DeletePolicy**](docs/PoliciesApi.md#deletepolicy) | **Delete** /policies/{policyId} | Delete policy *PoliciesApi* | [**GetPolicy**](docs/PoliciesApi.md#getpolicy) | **Get** /policies/{policyId} | Get specific policy *PoliciesApi* | [**ListPolicies**](docs/PoliciesApi.md#listpolicies) | **Get** /policies | List policies *PoliciesApi* | [**UpdatePolicy**](docs/PoliciesApi.md#updatepolicy) | **Put** /policies/{policyId} | Update policy -*PolicyApi* | [**DescribePolicy**](docs/PolicyApi.md#describepolicy) | **Get** /system/policy_spec | Describe the policy language spec implemented by this service. +*QueryApi* | [**QueryImagesByPackage**](docs/QueryApi.md#queryimagesbypackage) | **Get** /query/images/by_package | List of images containing given package +*QueryApi* | [**QueryImagesByVulnerability**](docs/QueryApi.md#queryimagesbyvulnerability) | **Get** /query/images/by_vulnerability | List images vulnerable to the specific vulnerability ID. +*QueryApi* | [**QueryVulnerabilities**](docs/QueryApi.md#queryvulnerabilities) | **Get** /query/vulnerabilities | Listing information about given vulnerability *RegistriesApi* | [**CreateRegistry**](docs/RegistriesApi.md#createregistry) | **Post** /registries | Add a new registry *RegistriesApi* | [**DeleteRegistry**](docs/RegistriesApi.md#deleteregistry) | **Delete** /registries/{registry} | Delete a registry configuration *RegistriesApi* | [**GetRegistry**](docs/RegistriesApi.md#getregistry) | **Get** /registries/{registry} | Get a specific registry configuration *RegistriesApi* | [**ListRegistries**](docs/RegistriesApi.md#listregistries) | **Get** /registries | List configured registries *RegistriesApi* | [**UpdateRegistry**](docs/RegistriesApi.md#updateregistry) | **Put** /registries/{registry} | Update/replace a registry configuration *RepositoryCredentialsApi* | [**AddRepository**](docs/RepositoryCredentialsApi.md#addrepository) | **Post** /repositories | Add repository to watch -*ServicesApi* | [**DeleteService**](docs/ServicesApi.md#deleteservice) | **Delete** /system/services/{servicename}/{hostid} | Delete the service config -*ServicesApi* | [**GetServicesByName**](docs/ServicesApi.md#getservicesbyname) | **Get** /system/services/{servicename} | Get a service configuration and state -*ServicesApi* | [**GetServicesByNameAndHost**](docs/ServicesApi.md#getservicesbynameandhost) | **Get** /system/services/{servicename}/{hostid} | Get service config for a specific host -*ServicesApi* | [**ListServices**](docs/ServicesApi.md#listservices) | **Get** /system/services | List system services *SubscriptionsApi* | [**AddSubscription**](docs/SubscriptionsApi.md#addsubscription) | **Post** /subscriptions | Add a subscription of a specific type *SubscriptionsApi* | [**DeleteSubscription**](docs/SubscriptionsApi.md#deletesubscription) | **Delete** /subscriptions/{subscriptionId} | Delete subscriptions of a specific type *SubscriptionsApi* | [**GetSubscription**](docs/SubscriptionsApi.md#getsubscription) | **Get** /subscriptions/{subscriptionId} | Get a specific subscription set *SubscriptionsApi* | [**ListSubscriptions**](docs/SubscriptionsApi.md#listsubscriptions) | **Get** /subscriptions | List all subscriptions *SubscriptionsApi* | [**UpdateSubscription**](docs/SubscriptionsApi.md#updatesubscription) | **Put** /subscriptions/{subscriptionId} | Update an existing and specific subscription *SummariesApi* | [**ListImagetags**](docs/SummariesApi.md#listimagetags) | **Get** /summaries/imagetags | List all visible image digests and tags +*SystemApi* | [**DeleteFeed**](docs/SystemApi.md#deletefeed) | **Delete** /system/feeds/{feed} | +*SystemApi* | [**DeleteFeedGroup**](docs/SystemApi.md#deletefeedgroup) | **Delete** /system/feeds/{feed}/{group} | *SystemApi* | [**DeleteService**](docs/SystemApi.md#deleteservice) | **Delete** /system/services/{servicename}/{hostid} | Delete the service config *SystemApi* | [**DescribeErrorCodes**](docs/SystemApi.md#describeerrorcodes) | **Get** /system/error_codes | Describe anchore engine error codes. *SystemApi* | [**DescribePolicy**](docs/SystemApi.md#describepolicy) | **Get** /system/policy_spec | Describe the policy language spec implemented by this service. @@ -109,6 +174,9 @@ Class | Method | HTTP request | Description *SystemApi* | [**GetSystemFeeds**](docs/SystemApi.md#getsystemfeeds) | **Get** /system/feeds | list feeds operations and information *SystemApi* | [**ListServices**](docs/SystemApi.md#listservices) | **Get** /system/services | List system services *SystemApi* | [**PostSystemFeeds**](docs/SystemApi.md#postsystemfeeds) | **Post** /system/feeds | trigger feeds operations +*SystemApi* | [**TestWebhook**](docs/SystemApi.md#testwebhook) | **Post** /system/webhooks/{webhook_type}/test | Adds the capabilities to test a webhook delivery for the given notification type +*SystemApi* | [**ToggleFeedEnabled**](docs/SystemApi.md#togglefeedenabled) | **Put** /system/feeds/{feed} | +*SystemApi* | [**ToggleGroupEnabled**](docs/SystemApi.md#togglegroupenabled) | **Put** /system/feeds/{feed}/{group} | *UserManagementApi* | [**CreateAccount**](docs/UserManagementApi.md#createaccount) | **Post** /accounts | Create a new user. Only avaialble to admin user. *UserManagementApi* | [**CreateUser**](docs/UserManagementApi.md#createuser) | **Post** /accounts/{accountname}/users | Create a new user *UserManagementApi* | [**CreateUserCredential**](docs/UserManagementApi.md#createusercredential) | **Post** /accounts/{accountname}/users/{username}/credentials | add/replace credential @@ -121,8 +189,6 @@ Class | Method | HTTP request | Description *UserManagementApi* | [**ListUserCredentials**](docs/UserManagementApi.md#listusercredentials) | **Get** /accounts/{accountname}/users/{username}/credentials | Get current credential summary *UserManagementApi* | [**ListUsers**](docs/UserManagementApi.md#listusers) | **Get** /accounts/{accountname}/users | List accounts for the user *UserManagementApi* | [**UpdateAccountState**](docs/UserManagementApi.md#updateaccountstate) | **Put** /accounts/{accountname}/state | Update the state of an account to either enabled or disabled. For deletion use the DELETE route -*VulnerabilitiesApi* | [**QueryImagesByVulnerability**](docs/VulnerabilitiesApi.md#queryimagesbyvulnerability) | **Get** /query/images/by_vulnerability | List images vulnerable to the specific vulnerability ID. -*VulnerabilitiesApi* | [**QueryVulnerabilities**](docs/VulnerabilitiesApi.md#queryvulnerabilities) | **Get** /query/vulnerabilities | Listing information about given vulnerability ## Documentation For Models @@ -137,42 +203,74 @@ Class | Method | HTTP request | Description - [AnalysisArchiveSummary](docs/AnalysisArchiveSummary.md) - [AnalysisArchiveTransitionHistory](docs/AnalysisArchiveTransitionHistory.md) - [AnalysisArchiveTransitionRule](docs/AnalysisArchiveTransitionRule.md) + - [AnalysisArchiveTransitionRuleExclude](docs/AnalysisArchiveTransitionRuleExclude.md) + - [AnalysisUpdateEval](docs/AnalysisUpdateEval.md) + - [AnalysisUpdateNotification](docs/AnalysisUpdateNotification.md) + - [AnalysisUpdateNotificationAllOf](docs/AnalysisUpdateNotificationAllOf.md) + - [AnalysisUpdateNotificationData](docs/AnalysisUpdateNotificationData.md) + - [AnalysisUpdateNotificationDataAllOf](docs/AnalysisUpdateNotificationDataAllOf.md) + - [AnalysisUpdateNotificationPayload](docs/AnalysisUpdateNotificationPayload.md) + - [AnalysisUpdateNotificationPayloadAllOf](docs/AnalysisUpdateNotificationPayloadAllOf.md) - [AnchoreErrorCode](docs/AnchoreErrorCode.md) - [AnchoreImage](docs/AnchoreImage.md) - [AnchoreImageTagSummary](docs/AnchoreImageTagSummary.md) - [ApiErrorResponse](docs/ApiErrorResponse.md) - [ArchiveSummary](docs/ArchiveSummary.md) - [ArchivedAnalysis](docs/ArchivedAnalysis.md) + - [BaseNotificationData](docs/BaseNotificationData.md) + - [CVSSV2Scores](docs/CVSSV2Scores.md) + - [CVSSV3Scores](docs/CVSSV3Scores.md) - [ContentFilesResponse](docs/ContentFilesResponse.md) - - [ContentFilesResponseContent](docs/ContentFilesResponseContent.md) - - [ContentJavaPackageResponse](docs/ContentJavaPackageResponse.md) - - [ContentJavaPackageResponseContent](docs/ContentJavaPackageResponseContent.md) + - [ContentFilesResponseContentInner](docs/ContentFilesResponseContentInner.md) + - [ContentJAVAPackageResponse](docs/ContentJAVAPackageResponse.md) + - [ContentJAVAPackageResponseContentInner](docs/ContentJAVAPackageResponseContentInner.md) + - [ContentMalwareResponse](docs/ContentMalwareResponse.md) - [ContentPackageResponse](docs/ContentPackageResponse.md) - - [ContentPackageResponseContent](docs/ContentPackageResponseContent.md) + - [ContentPackageResponseContentInner](docs/ContentPackageResponseContentInner.md) - [ContentResponse](docs/ContentResponse.md) - - [Cvssv2Scores](docs/Cvssv2Scores.md) - - [Cvssv3Scores](docs/Cvssv3Scores.md) + - [DeleteImageResponse](docs/DeleteImageResponse.md) + - [EventCategory](docs/EventCategory.md) + - [EventDescription](docs/EventDescription.md) - [EventResponse](docs/EventResponse.md) - [EventResponseEvent](docs/EventResponseEvent.md) - [EventResponseEventResource](docs/EventResponseEventResource.md) - [EventResponseEventSource](docs/EventResponseEventSource.md) + - [EventSubcategory](docs/EventSubcategory.md) - [EventsList](docs/EventsList.md) - [FeedGroupMetadata](docs/FeedGroupMetadata.md) - [FeedMetadata](docs/FeedMetadata.md) - [FeedSyncResult](docs/FeedSyncResult.md) + - [FileContentSearchResult](docs/FileContentSearchResult.md) - [GateSpec](docs/GateSpec.md) + - [GenericNotificationPayload](docs/GenericNotificationPayload.md) - [GroupSyncResult](docs/GroupSyncResult.md) - [ImageAnalysisRequest](docs/ImageAnalysisRequest.md) - [ImageDetail](docs/ImageDetail.md) - [ImageFilter](docs/ImageFilter.md) + - [ImageImportContentResponse](docs/ImageImportContentResponse.md) + - [ImageImportManifest](docs/ImageImportManifest.md) + - [ImageImportOperation](docs/ImageImportOperation.md) + - [ImagePackageManifest](docs/ImagePackageManifest.md) - [ImageRef](docs/ImageRef.md) - [ImageReference](docs/ImageReference.md) - [ImageSelectionRule](docs/ImageSelectionRule.md) - [ImageSelector](docs/ImageSelector.md) - [ImageSource](docs/ImageSource.md) - [ImageWithPackages](docs/ImageWithPackages.md) + - [ImportContentDigests](docs/ImportContentDigests.md) + - [ImportDescriptor](docs/ImportDescriptor.md) + - [ImportDistribution](docs/ImportDistribution.md) + - [ImportPackage](docs/ImportPackage.md) + - [ImportPackageLocation](docs/ImportPackageLocation.md) + - [ImportPackageRelationship](docs/ImportPackageRelationship.md) + - [ImportSchema](docs/ImportSchema.md) + - [ImportSource](docs/ImportSource.md) + - [LocalAnalysisSource](docs/LocalAnalysisSource.md) + - [MalwareScan](docs/MalwareScan.md) + - [MalwareScanFindingsInner](docs/MalwareScanFindingsInner.md) - [MappingRule](docs/MappingRule.md) - [MetadataResponse](docs/MetadataResponse.md) + - [NotificationBase](docs/NotificationBase.md) - [NvdDataObject](docs/NvdDataObject.md) - [PackageReference](docs/PackageReference.md) - [PaginatedImageList](docs/PaginatedImageList.md) @@ -185,12 +283,21 @@ Class | Method | HTTP request | Description - [Policy](docs/Policy.md) - [PolicyBundle](docs/PolicyBundle.md) - [PolicyBundleRecord](docs/PolicyBundleRecord.md) + - [PolicyEvalNotification](docs/PolicyEvalNotification.md) + - [PolicyEvalNotificationAllOf](docs/PolicyEvalNotificationAllOf.md) + - [PolicyEvalNotificationData](docs/PolicyEvalNotificationData.md) + - [PolicyEvalNotificationDataAllOf](docs/PolicyEvalNotificationDataAllOf.md) + - [PolicyEvalNotificationPayload](docs/PolicyEvalNotificationPayload.md) + - [PolicyEvalNotificationPayloadAllOf](docs/PolicyEvalNotificationPayloadAllOf.md) - [PolicyRule](docs/PolicyRule.md) - - [PolicyRuleParams](docs/PolicyRuleParams.md) + - [PolicyRuleParamsInner](docs/PolicyRuleParamsInner.md) + - [RegexContentMatch](docs/RegexContentMatch.md) - [RegistryConfiguration](docs/RegistryConfiguration.md) - [RegistryConfigurationRequest](docs/RegistryConfigurationRequest.md) - [RegistryDigestSource](docs/RegistryDigestSource.md) - [RegistryTagSource](docs/RegistryTagSource.md) + - [RetrievedFile](docs/RetrievedFile.md) + - [SecretSearchResult](docs/SecretSearchResult.md) - [Service](docs/Service.md) - [ServiceVersion](docs/ServiceVersion.md) - [ServiceVersionApi](docs/ServiceVersionApi.md) @@ -203,13 +310,27 @@ Class | Method | HTTP request | Description - [SubscriptionUpdate](docs/SubscriptionUpdate.md) - [SystemStatusResponse](docs/SystemStatusResponse.md) - [TagEntry](docs/TagEntry.md) + - [TagUpdateNotification](docs/TagUpdateNotification.md) + - [TagUpdateNotificationAllOf](docs/TagUpdateNotificationAllOf.md) + - [TagUpdateNotificationData](docs/TagUpdateNotificationData.md) + - [TagUpdateNotificationDataAllOf](docs/TagUpdateNotificationDataAllOf.md) + - [TagUpdateNotificationPayload](docs/TagUpdateNotificationPayload.md) + - [TagUpdateNotificationPayloadAllOf](docs/TagUpdateNotificationPayloadAllOf.md) - [TokenResponse](docs/TokenResponse.md) - [TriggerParamSpec](docs/TriggerParamSpec.md) - [TriggerSpec](docs/TriggerSpec.md) - [User](docs/User.md) - [UserCreationRequest](docs/UserCreationRequest.md) - [VendorDataObject](docs/VendorDataObject.md) + - [VulnDiffResult](docs/VulnDiffResult.md) + - [VulnUpdateNotification](docs/VulnUpdateNotification.md) + - [VulnUpdateNotificationAllOf](docs/VulnUpdateNotificationAllOf.md) + - [VulnUpdateNotificationData](docs/VulnUpdateNotificationData.md) + - [VulnUpdateNotificationDataAllOf](docs/VulnUpdateNotificationDataAllOf.md) + - [VulnUpdateNotificationPayload](docs/VulnUpdateNotificationPayload.md) + - [VulnUpdateNotificationPayloadAllOf](docs/VulnUpdateNotificationPayloadAllOf.md) - [Vulnerability](docs/Vulnerability.md) + - [VulnerabilityReference](docs/VulnerabilityReference.md) - [VulnerabilityResponse](docs/VulnerabilityResponse.md) - [VulnerableImage](docs/VulnerableImage.md) - [VulnerablePackageReference](docs/VulnerablePackageReference.md) @@ -219,23 +340,24 @@ Class | Method | HTTP request | Description ## Documentation For Authorization + Endpoints do not require authorization. -## basicAuth - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` +## Documentation for Utility Methods +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` ## Author diff --git a/.gen/anchore/api/openapi.yaml b/.gen/anchore/api/openapi.yaml index d5f84b9229..de13414ffc 100644 --- a/.gen/anchore/api/openapi.yaml +++ b/.gen/anchore/api/openapi.yaml @@ -8,11 +8,9 @@ info: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: Anchore Engine API Server - version: 0.1.12 + version: 0.1.20 servers: - url: / -security: -- basicAuth: [] tags: - description: Subscription Management name: Subscriptions @@ -40,7 +38,7 @@ tags: name: Events - description: Resource Queries name: Queries -- description: Manage Accounts, Users, and Credentials +- description: "Manage Accounts, Users, and Credentials" name: User Management - description: Get and operate on the authenticated user's identity name: Identity @@ -57,25 +55,25 @@ paths: application/json: schema: type: string - description: Version check response, returns the api version prefix (e.g. - 'v1') + description: "Version check response, returns the api version prefix (e.g.\ + \ 'v1')" x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system x-anchore-authz-action: None /health: get: - description: Health check, returns 200 and no body if service is running - operationId: health_noop + description: "Health check, returns 200 and no body if service is running" + operationId: health_check responses: "200": content: {} description: Empty body on success - x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-swagger-router-controller: anchore_engine.apis.common x-anchore-authz-action: None /version: get: - description: Returns the version object for the service, including db schema - version info - operationId: version_noop + description: "Returns the version object for the service, including db schema\ + \ version info" + operationId: version_check responses: "200": content: @@ -83,7 +81,7 @@ paths: schema: $ref: '#/components/schemas/ServiceVersion' description: Version object describing version state - x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-swagger-router-controller: anchore_engine.apis.common x-anchore-authz-action: None /policies: get: @@ -96,8 +94,8 @@ paths: name: detail schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -118,8 +116,8 @@ paths: description: Adds a new policy bundle to the system operationId: add_policy parameters: - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -159,8 +157,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -201,8 +199,8 @@ paths: name: detail schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -239,8 +237,8 @@ paths: name: active schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -284,8 +282,8 @@ paths: name: subscription_type schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -313,8 +311,8 @@ paths: of changes operationId: add_subscription parameters: - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -347,8 +345,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -376,8 +374,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -408,8 +406,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -438,8 +436,23 @@ paths: description: List all image tags visible to the user operationId: list_imagetags parameters: - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "Filter images in one or more states such as active, deleting.\ + \ Defaults to active images only if unspecified" + explode: false + in: query + name: image_status + schema: + default: "[\"active\"]" + items: + enum: + - all + - active + - deleting + type: string + type: array + style: form + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -463,6 +476,48 @@ paths: x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images x-anchore-authz-action: listImages /images: + delete: + description: Delete analysis for image digests in the list asynchronously + operationId: delete_images_async + parameters: + - explode: false + in: query + name: imageDigests + required: true + schema: + items: + type: string + nullable: false + type: array + style: form + - in: query + name: force + schema: + type: boolean + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" + in: header + name: x-anchore-account + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteImageResponseList' + description: successful operation + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorResponse' + description: Internal Error + summary: Bulk mark images for deletion + tags: + - Images + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + x-anchore-authz-action: deleteImage get: description: List all images visible to the user operationId: list_images @@ -472,24 +527,39 @@ paths: name: history schema: type: boolean - - description: Full docker-pull string to filter results by (e.g. docker.io/library/nginx:latest, - or myhost.com:5000/testimages:v1.1.1) + - description: "Full docker-pull string to filter results by (e.g. docker.io/library/nginx:latest,\ + \ or myhost.com:5000/testimages:v1.1.1)" in: query name: fulltag schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: Filter by image_status value on the record. Default if omitted + is 'active'. + in: query + name: image_status + schema: + default: active + enum: + - all + - active + - deleting + type: string + - description: Filter by analysis_status value on the record. + in: query + name: analysis_status + schema: + enum: + - not_analyzed + - analyzed + - analyzing + - analysis_failed + type: string + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ImageFilter' - required: false responses: "200": content: @@ -508,7 +578,6 @@ paths: - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images x-anchore-authz-action: listImages - x-codegen-request-body-name: image_to_get post: description: Creates a new analysis task that is executed asynchronously operationId: add_image @@ -524,8 +593,8 @@ paths: name: autosubscribe schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -562,13 +631,7 @@ paths: content: multipart/form-data: schema: - properties: - archive_file: - description: anchore image tar archive. - format: binary - type: string - required: - - archive_file + $ref: '#/components/schemas/import_image_archive_request' required: true responses: "200": @@ -583,7 +646,8 @@ paths: schema: $ref: '#/components/schemas/ApiErrorResponse' description: Internal Error - summary: Import an anchore image tar.gz archive file. + summary: Import an anchore image tar.gz archive file. This is a deprecated API + replaced by the "/imports/images" route tags: - Import x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images @@ -601,15 +665,18 @@ paths: name: force schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: type: string responses: "200": - content: {} + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteImageResponse' description: Image deletion success summary: Delete an image analysis tags: @@ -624,8 +691,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -661,15 +728,18 @@ paths: name: force schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: type: string responses: "200": - content: {} + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteImageResponse' description: Image deletion success "500": content: @@ -690,8 +760,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -745,8 +815,8 @@ paths: name: interactive schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -796,8 +866,8 @@ paths: name: history schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -829,8 +899,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -877,12 +947,16 @@ paths: name: force_refresh schema: type: boolean - - in: query + - description: "Filter results to include only vulnerabilities that are not\ + \ marked as invalid by upstream OS vendor data. When set to true, it will\ + \ filter out all vulnerabilities where `will_not_fix` is False. If false\ + \ all vulnerabilities are returned regardless of `will_not_fix`" + in: query name: vendor_only schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -914,8 +988,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -958,8 +1032,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -991,8 +1065,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1026,8 +1100,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1066,8 +1140,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1099,8 +1173,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1132,8 +1206,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1156,6 +1230,39 @@ paths: - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images x-anchore-authz-action: getImage + /images/{imageDigest}/content/malware: + get: + operationId: get_image_content_by_type_malware + parameters: + - in: path + name: imageDigest + required: true + schema: + type: string + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" + in: header + name: x-anchore-account + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ContentMalwareResponse' + description: Content of specified type from the image + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorResponse' + description: Internal error + summary: Get the content of an image by type malware + tags: + - Images + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + x-anchore-authz-action: getImage /images/by_id/{imageId}/content/{ctype}: get: operationId: get_image_content_by_type_imageId @@ -1170,8 +1277,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1203,8 +1310,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1236,8 +1343,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1260,6 +1367,72 @@ paths: - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images x-anchore-authz-action: getImage + /images/{imageDigest}/artifacts/retrieved_files: + get: + operationId: list_retrieved_files + parameters: + - in: path + name: imageDigest + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RetrievedFileList' + description: List of file metadata objects + "404": + content: {} + description: Image not found in this service + summary: Return a list of analyzer artifacts of the specified type + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + x-anchore-authz-action: getImage + /images/{imageDigest}/artifacts/file_content_search: + get: + operationId: list_file_content_search_results + parameters: + - in: path + name: imageDigest + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FileContentSearchList' + description: List of file metadata objects + "404": + content: {} + description: Image not found in this service + summary: Return a list of analyzer artifacts of the specified type + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + x-anchore-authz-action: getImage + /images/{imageDigest}/artifacts/secret_search: + get: + operationId: list_secret_search_results + parameters: + - in: path + name: imageDigest + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SecretSearchList' + description: List of file metadata objects + "404": + content: {} + description: Image not found in this service + summary: Return a list of analyzer artifacts of the specified type + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + x-anchore-authz-action: getImage /images/{imageDigest}/metadata: get: operationId: list_image_metadata @@ -1269,8 +1442,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1309,8 +1482,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1349,13 +1522,14 @@ paths: name: autosubscribe schema: type: boolean - - description: use specified existing tag to perform repo scan (default is 'latest') + - description: "flag to return tags in the repository without actually watching\ + \ the repository, default is false" in: query - name: lookuptag + name: dryrun schema: - type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + type: boolean + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1377,8 +1551,8 @@ paths: description: List all configured registries the system can/will watch operationId: list_registries parameters: - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1405,8 +1579,8 @@ paths: name: validate schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1448,8 +1622,8 @@ paths: schema: format: path type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1479,8 +1653,8 @@ paths: schema: format: path type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1513,8 +1687,8 @@ paths: name: validate schema: type: boolean - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1590,6 +1764,9 @@ paths: x-anchore-authz-action: None /system/feeds: get: + description: "Return a list of feed and their groups along with update and record\ + \ count information. This data reflects the state of the policy engine, not\ + \ the upstream feed service itself." operationId: get_system_feeds responses: "200": @@ -1612,6 +1789,8 @@ paths: x-anchore-authz-action: listFeeds x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system post: + description: "Execute a synchronous feed sync operation. The response will block\ + \ until complete, then return the result summary." operationId: post_system_feeds parameters: - description: instruct system to flush existing data feeds records from anchore-engine @@ -1642,6 +1821,128 @@ paths: - System x-anchore-authz-action: updateFeeds x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + /system/feeds/{feed}: + delete: + description: Delete the groups and data for the feed and disable the feed itself + operationId: delete_feed + parameters: + - in: path + name: feed + required: true + schema: + type: string + responses: + "200": + content: {} + description: Successfully deleted + "500": + content: {} + description: Internal server error processing the request. Retry expected + "404": + content: {} + description: Not found + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-anchore-authz-action: updateFeeds + put: + description: Disable the feed so that it does not sync on subsequent sync operations + operationId: toggle_feed_enabled + parameters: + - in: path + name: feed + required: true + schema: + type: string + - in: query + name: enabled + required: true + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FeedMetadata' + description: FeedInfo + "500": + content: {} + description: Internal server error processing the request. Retry expected + "400": + content: {} + description: "Bad request, fix and resend" + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-anchore-authz-action: updateFeeds + /system/feeds/{feed}/{group}: + delete: + description: Delete the group data and disable the group itself + operationId: delete_feed_group + parameters: + - in: path + name: feed + required: true + schema: + type: string + - in: path + name: group + required: true + schema: + type: string + responses: + "200": + content: {} + description: Successfully deleted + "500": + content: {} + description: Internal server error processing the request. Retry expected + "404": + content: {} + description: Not found + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-anchore-authz-action: updateFeeds + put: + description: Disable a specific group within a feed to not sync + operationId: toggle_group_enabled + parameters: + - in: path + name: feed + required: true + schema: + type: string + - in: path + name: group + required: true + schema: + type: string + - in: query + name: enabled + required: true + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/FeedMetadata' + type: array + description: FeedInfo listing + "500": + content: {} + description: Internal server error processing the request. Retry expected + "400": + content: {} + description: "Bad request, fix and resend" + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-anchore-authz-action: updateFeeds /system/services: get: operationId: list_services @@ -1661,7 +1962,6 @@ paths: summary: List system services tags: - System - - Services x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system x-anchore-authz-action: listServices /system/services/{servicename}: @@ -1689,7 +1989,6 @@ paths: summary: Get a service configuration and state tags: - System - - Services x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system x-anchore-authz-action: getService /system/services/{servicename}/{hostid}: @@ -1719,7 +2018,6 @@ paths: summary: Delete the service config tags: - System - - Services x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system x-anchore-authz-action: deleteService get: @@ -1751,7 +2049,6 @@ paths: summary: Get service config for a specific host tags: - System - - Services x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system x-anchore-authz-action: getService /system/policy_spec: @@ -1771,7 +2068,6 @@ paths: summary: Describe the policy language spec implemented by this service. tags: - System - - Policy x-anchore-authz-action: None x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system /system/error_codes: @@ -1793,6 +2089,22 @@ paths: - System x-anchore-authz-action: None x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + /event_types: + get: + description: Returns list of event types in the category hierarchy + operationId: list_event_types + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventTypesList' + description: List of event types + summary: List Event Types + tags: + - Events + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.events + x-anchore-authz-action: listEvents /events: delete: description: Delete all or a subset of events filtered using the optional query @@ -1814,8 +2126,8 @@ paths: name: level schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1855,8 +2167,14 @@ paths: name: source_hostid schema: type: string - - description: Filter events by the type of resource - tag, imageDigest, repository - etc + - description: Filter events by a prefix match on the event type (e.g. "user.image.") + in: query + name: event_type + schema: + pattern: "^[a-z0-9-_.*]+$" + type: string + - description: "Filter events by the type of resource - tag, imageDigest, repository\ + \ etc" in: query name: resource_type schema: @@ -1894,8 +2212,8 @@ paths: schema: default: 100 type: integer - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1923,8 +2241,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1948,8 +2266,8 @@ paths: required: true schema: type: string - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -1979,8 +2297,8 @@ paths: required: true schema: type: string - - description: Filter results to images within the given vulnerability namespace - (e.g. debian:8, ubuntu:14.04) + - description: "Filter results to images within the given vulnerability namespace\ + \ (e.g. debian:8, ubuntu:14.04)" in: query name: namespace schema: @@ -2016,14 +2334,14 @@ paths: name: page schema: type: integer - - description: Limit the number of records for the requested page. If omitted - or set to 0, return all results in a single page + - description: "Limit the number of records for the requested page. If omitted\ + \ or set to 0, return all results in a single page" in: query name: limit schema: type: integer - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -2043,7 +2361,7 @@ paths: description: Invalid filter parameters summary: List images vulnerable to the specific vulnerability ID. tags: - - Vulnerabilities + - Query x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.query x-anchore-authz-action: listImages /query/images/by_package: @@ -2073,14 +2391,14 @@ paths: name: page schema: type: string - - description: Limit the number of records for the requested page. If omitted - or set to 0, return all results in a single page + - description: "Limit the number of records for the requested page. If omitted\ + \ or set to 0, return all results in a single page" in: query name: limit schema: type: integer - - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) + - description: "An account name to change the resource scope of the request\ + \ to that account, if permissions allow (admin only)" in: header name: x-anchore-account schema: @@ -2099,20 +2417,26 @@ paths: $ref: '#/components/schemas/ApiErrorResponse' description: Bad filter parameters summary: List of images containing given package + tags: + - Query x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.query x-anchore-authz-action: listImages /query/vulnerabilities: get: - description: List (w/filters) vulnerability records known by the system, with - affected packages information if present + description: "List (w/filters) vulnerability records known by the system, with\ + \ affected packages information if present" operationId: query_vulnerabilities parameters: - description: The ID of the vulnerability (e.g. CVE-1999-0001) + explode: false in: query name: id required: true schema: - type: string + items: + type: string + type: array + style: form - description: Filter results by specified package name (e.g. sed) in: query name: affected_package @@ -2129,14 +2453,23 @@ paths: schema: default: "1" type: string - - description: Limit the number of records for the requested page. If omitted - or set to 0, return all results in a single page + - description: "Limit the number of records for the requested page. If omitted\ + \ or set to 0, return all results in a single page" in: query name: limit schema: type: integer - responses: - "200": + - description: Namespace(s) to filter vulnerability records by + explode: false + in: query + name: namespace + schema: + items: + type: string + type: array + style: form + responses: + "200": content: application/json: schema: @@ -2150,7 +2483,7 @@ paths: description: Invalid filter parameters summary: Listing information about given vulnerability tags: - - Vulnerabilities + - Query x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.query x-anchore-authz-action: None /accounts: @@ -2162,7 +2495,7 @@ paths: name: state schema: enum: - - active + - enabled - disabled - deleting type: string @@ -2236,9 +2569,9 @@ paths: schema: $ref: '#/components/schemas/ApiErrorResponse' description: Internal error - summary: Delete the specified account, only allowed if the account is in the - disabled state. All users will be deleted along with the account and all resources - will be garbage collected + summary: "Delete the specified account, only allowed if the account is in the\ + \ disabled state. All users will be deleted along with the account and all\ + \ resources will be garbage collected" tags: - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts @@ -2264,8 +2597,8 @@ paths: schema: $ref: '#/components/schemas/ApiErrorResponse' description: Internal error - summary: Get info about an user. Only available to admin user. Uses the main - user Id, not a username. + summary: "Get info about an user. Only available to admin user. Uses the main\ + \ user Id, not a username." tags: - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts @@ -2456,8 +2789,8 @@ paths: description: Successful deletion "400": content: {} - description: Conflict, cannot delete the credential used to authenticate - this request + description: "Conflict, cannot delete the credential used to authenticate\ + \ this request" "500": content: application/json: @@ -2525,7 +2858,7 @@ paths: application/json: schema: $ref: '#/components/schemas/User' - description: Add a credential, overwritting if already exists + description: "Add a credential, overwritting if already exists" "500": content: application/json: @@ -2615,7 +2948,7 @@ paths: application/json: schema: $ref: '#/components/schemas/User' - description: Add a credential, overwritting if already exists + description: "Add a credential, overwritting if already exists" "500": content: application/json: @@ -2713,11 +3046,8 @@ paths: type: string responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/AnalysisArchiveTransitionRule' - description: Archive transition rule + content: {} + description: Analysis archive rule succesfuly deleted "500": content: application/json: @@ -2816,11 +3146,8 @@ paths: type: boolean responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ArchivedAnalysis' - description: ArchivdImageAnalysis record but with status 'deleted' + content: {} + description: ArchivdImageAnalysis successfully deleted "500": content: application/json: @@ -2861,9 +3188,14 @@ paths: x-anchore-authz-action: getArchivedImageAnalysis /oauth/token: post: - description: Request a jwt token for subsequent operations, this request is - authenticated with normal HTTP auth + description: "Request a jwt token for subsequent operations, this request is\ + \ authenticated with normal HTTP auth" operationId: get_oauth_token + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/get_oauth_token_request' responses: "200": content: @@ -2879,79 +3211,497 @@ paths: description: Internal error x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.oauth x-anchore-authz-action: None -components: - parameters: - AsAccountParameter: - description: An account name to change the resource scope of the request to - that account, if permissions allow (admin only) - in: header - name: x-anchore-account - schema: - type: string - schemas: - PaginationProperties: - description: Properties for common pagination handling to be included in any - wrapping object that needs pagination elements - properties: - page: - description: The page number returned (should match the requested page query - string param) - type: string - next_page: - description: True if additional pages exist (page + 1) or False if this - is the last page + /system/webhooks/{webhook_type}/test: + post: + description: "Loads the Webhook configuration for webhook_type, and sends the\ + \ notification out as a test" + operationId: test_webhook + parameters: + - description: The Webhook Type that we should test + in: path + name: webhook_type + required: true + schema: type: string - returned_count: - description: The number of items sent in this response - type: integer - type: object - PackageReference: - description: A record of a software item which is vulnerable or carries a fix - for a vulnerability - properties: - name: - description: Package name + - description: What kind of Notification to send + in: query + name: notification_type + schema: + default: tag_update + enum: + - tag_update + - analysis_update + - vuln_update + - policy_eval type: string - version: - description: A version for the package. If null, then references all versions - nullable: true + responses: + "200": + content: {} + description: "The Webhook was sent successfully. Schemas may be found under\ + \ Models (PolicyEvalNotification, TagUpdateNotification, VulnUpdateNotification,\ + \ AnalysisUpdateNotification)" + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorResponse' + description: The Webhook failed to send due to misconfiguration + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorResponse' + description: The Webhook failed to send due to an Internal Error + summary: Adds the capabilities to test a webhook delivery for the given notification + type + tags: + - System + x-anchore-authz-action: None + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + /imports/images: + get: + operationId: list_operations + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImports' + description: success + "500": + content: {} + description: Internal Error + summary: Lists in-progress imports + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + post: + operationId: create_operation + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportOperation' + description: success + "500": + content: {} + description: Internal Error + summary: Begin the import of an image analyzed by Syft into the system + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + /imports/images/{operation_id}: + delete: + operationId: invalidate_operation + parameters: + - in: path + name: operation_id + required: true + schema: type: string - type: - description: Package type (e.g. package, rpm, deb, apk, jar, npm, gem, ...) + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportOperation' + description: success + "500": + content: {} + description: Internal Error + summary: Invalidate operation ID so it can be garbage collected + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + get: + operationId: get_operation + parameters: + - in: path + name: operation_id + required: true + schema: type: string - type: object - VulnerablePackageReference: - description: A record of a software item which is vulnerable or carries a fix - for a vulnerability - properties: - name: - description: Package name + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportOperation' + description: success + "500": + content: {} + description: Internal Error + summary: Get detail on a single import + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + /imports/images/{operation_id}/packages: + get: + operationId: list_import_packages + parameters: + - in: path + name: operation_id + required: true + schema: type: string - version: - description: A version for the package. If null, then references all versions - nullable: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportContentDigestList' + description: success + "500": + content: {} + description: Internal Error + summary: List uploaded package manifests + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + post: + operationId: import_image_packages + parameters: + - in: path + name: operation_id + required: true + schema: type: string - type: - description: Package type (e.g. package, rpm, deb, apk, jar, npm, gem, ...) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePackageManifest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportContentResponse' + description: success + "500": + content: {} + description: Internal Error + summary: Begin the import of an image analyzed by Syft into the system + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + x-codegen-request-body-name: sbom + /imports/images/{operation_id}/dockerfile: + get: + operationId: list_import_dockerfiles + parameters: + - in: path + name: operation_id + required: true + schema: type: string - severity: - description: Severity of vulnerability affecting package + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportContentDigestList' + description: success + "500": + content: {} + description: Internal Error + summary: List uploaded dockerfiles + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + post: + operationId: import_image_dockerfile + parameters: + - in: path + name: operation_id + required: true + schema: type: string - namespace: - description: Vulnerability namespace of affected package + requestBody: + content: + text/plain; utf-8: + schema: + type: string + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportContentResponse' + description: success + "500": + content: {} + description: Internal Error + summary: Begin the import of an image analyzed by Syft into the system + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + x-codegen-request-body-name: contents + /imports/images/{operation_id}/manifest: + get: + operationId: list_import_image_manifests + parameters: + - in: path + name: operation_id + required: true + schema: type: string - type: object - StandaloneVulnerability: - description: A single vulnerability record in a single namespace, the unique - key is the combinatino of the id and namespace - properties: - id: - description: Vulnerability identifier. May be CVE-X, RHSA-X, etc. Not necessarily - unique across namespaces + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportContentDigestList' + description: success + "500": + content: {} + description: Internal Error + summary: List uploaded image manifests + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + post: + operationId: import_image_manifest + parameters: + - in: path + name: operation_id + required: true + schema: type: string - namespace: - description: The namespace for the vulnerability record to avoid conflicts - for the same id in different distros or sources (e.g. deb vs ubuntu for + requestBody: + content: + application/vnd.oci.image.manifest.v1+json: + schema: + type: object + application/vnd.docker.distribution.manifest.v2+json: + schema: + type: object + application/vnd.docker.distribution.manifest.v1+json: + schema: + type: object + application/vnd.docker.distribution.manifest.v1+prettyjws: + schema: + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportContentResponse' + description: success + "500": + content: {} + description: Internal Error + summary: Import a docker or OCI distribution manifest to associate with the + image + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + x-codegen-request-body-name: contents + /imports/images/{operation_id}/parent_manifest: + get: + operationId: list_import_parent_manifests + parameters: + - in: path + name: operation_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportContentDigestList' + description: success + "500": + content: {} + description: Internal Error + summary: List uploaded parent manifests (manifest lists for a tag) + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + post: + operationId: import_image_parent_manifest + parameters: + - in: path + name: operation_id + required: true + schema: + type: string + requestBody: + content: + application/vnd.docker.distribution.manifest.list.v2+json: + schema: + type: object + application/vnd.oci.image.index.v1+json: + schema: + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportContentResponse' + description: success + "500": + content: {} + description: Internal Error + summary: Import a docker or OCI distribution manifest list to associate with + the image + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + x-codegen-request-body-name: contents + /imports/images/{operation_id}/image_config: + get: + operationId: list_import_image_configs + parameters: + - in: path + name: operation_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImportContentDigestList' + description: success + "500": + content: {} + description: Internal Error + summary: List uploaded image configs + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + post: + operationId: import_image_config + parameters: + - in: path + name: operation_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ImageImportContentResponse' + description: success + "500": + content: {} + description: Internal Error + summary: Import a docker or OCI image config to associate with the image + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + x-anchore-authz-action: importImage + x-codegen-request-body-name: contents +components: + parameters: + AsAccountParameter: + description: "An account name to change the resource scope of the request to\ + \ that account, if permissions allow (admin only)" + in: header + name: x-anchore-account + schema: + type: string + schemas: + PaginationProperties: + description: Properties for common pagination handling to be included in any + wrapping object that needs pagination elements + properties: + page: + description: The page number returned (should match the requested page query + string param) + type: string + next_page: + description: True if additional pages exist (page + 1) or False if this + is the last page + type: string + returned_count: + description: The number of items sent in this response + type: integer + type: object + PackageReference: + description: A record of a software item which is vulnerable or carries a fix + for a vulnerability + properties: + name: + description: Package name + type: string + version: + description: "A version for the package. If null, then references all versions" + nullable: true + type: string + type: + description: "Package type (e.g. package, rpm, deb, apk, jar, npm, gem,\ + \ ...)" + type: string + will_not_fix: + description: Whether a vendor will or will not fix a vulnerabitlity + type: boolean + type: object + VulnerablePackageReference: + description: A record of a software item which is vulnerable or carries a fix + for a vulnerability + properties: + name: + description: Package name + type: string + version: + description: "A version for the package. If null, then references all versions" + nullable: true + type: string + type: + description: "Package type (e.g. package, rpm, deb, apk, jar, npm, gem,\ + \ ...)" + type: string + severity: + description: Severity of vulnerability affecting package + type: string + namespace: + description: Vulnerability namespace of affected package + type: string + type: object + StandaloneVulnerability: + description: "A single vulnerability record in a single namespace, the unique\ + \ key is the combination of the id and namespace" + properties: + id: + description: "Vulnerability identifier. May be CVE-X, RHSA-X, etc. Not necessarily\ + \ unique across namespaces" + type: string + namespace: + description: The namespace for the vulnerability record to avoid conflicts + for the same id in different distros or sources (e.g. deb vs ubuntu for same CVE) type: string affected_packages: @@ -2984,10 +3734,32 @@ components: items: $ref: '#/components/schemas/VendorDataObject' type: array + description: + description: Description of the vulnerability if available + type: string + references: + description: List of references including + items: + $ref: '#/components/schemas/VulnerabilityReference' + type: array + type: object + VulnerabilityReference: + description: An external link/reference + properties: + source: + description: The reference source + type: string + tags: + items: + type: string + type: array + url: + description: The reference url + type: string type: object ImageReference: - description: A summary of an image identity, including digest, id (if available), - and any tags known to have ever been mapped to the digest + description: "A summary of an image identity, including digest, id (if available),\ + \ and any tags known to have ever been mapped to the digest" properties: digest: description: The image digest @@ -2996,8 +3768,8 @@ components: description: The image id if available type: string analyzed_at: - description: Timestamp, in rfc3339 format, indicating when the image state - became 'analyzed' in Anchore Engine. + description: "Timestamp, in rfc3339 format, indicating when the image state\ + \ became 'analyzed' in Anchore Engine." type: string tag_history: items: @@ -3071,16 +3843,30 @@ components: - $ref: '#/components/schemas/PaginatedImageList_allOf' description: Pagination wrapped list of images that match some filter ImageAnalysisRequest: - description: A request to add an image to be watched and analyzed by the engine. - Optionally include the dockerfile content. Either source, digest or tag must - be present. + description: "A request to add an image to be watched and analyzed by the engine.\ + \ Optionally include the dockerfile content. Either source, digest or tag\ + \ must be present." example: dockerfile: dockerfile digest: digest created_at: 2000-01-23T04:56:07.000+00:00 - annotations: '{}' + annotations: "{}" tag: tag source: + import: + local_image_id: local_image_id + operation_uuid: operation_uuid + contents: + parent_manifest: parent_manifest + manifest: manifest + dockerfile: dockerfile + image_config: image_config + packages: packages + digest: digest + parent_digest: parent_digest + tags: + - docker.io/library/nginx:latest + - docker.io/library/nginx:latest digest: creation_timestamp_override: 2000-01-23T04:56:07.000+00:00 dockerfile: dockerfile @@ -3094,29 +3880,29 @@ components: image_type: image_type properties: dockerfile: - description: Base64 encoded content of the dockerfile for the image, if - available. Deprecated in favor of the 'source' field. - pattern: ^[a-zA-Z0-9+/=]+$ + description: "Base64 encoded content of the dockerfile for the image, if\ + \ available. Deprecated in favor of the 'source' field." + pattern: "^[a-zA-Z0-9+/=]+$" type: string digest: - description: A digest string for an image, maybe a pull string or just a - digest. e.g. nginx@sha256:123 or sha256:abc123. If a pull string, it must - have same regisry/repo as the tag field. Deprecated in favor of the 'source' - field + description: "A digest string for an image, maybe a pull string or just\ + \ a digest. e.g. nginx@sha256:123 or sha256:abc123. If a pull string,\ + \ it must have same regisry/repo as the tag field. Deprecated in favor\ + \ of the 'source' field" type: string tag: description: Full pullable tag reference for image. e.g. docker.io/nginx:latest. Deprecated in favor of the 'source' field type: string created_at: - description: Optional override of the image creation time, only honored - when both tag and digest are also supplied e.g. 2018-10-17T18:14:00Z. - Deprecated in favor of the 'source' field + description: "Optional override of the image creation time, only honored\ + \ when both tag and digest are also supplied e.g. 2018-10-17T18:14:00Z.\ + \ Deprecated in favor of the 'source' field" format: date-time type: string image_type: - description: Optional. The type of image this is adding, defaults to "docker". - This can be ommitted until multiple image types are supported. + description: "Optional. The type of image this is adding, defaults to \"\ + docker\". This can be ommitted until multiple image types are supported." type: string annotations: description: Annotations to be associated with the added image in key/value @@ -3130,6 +3916,20 @@ components: description: A set of analysis source types. Only one may be set in any given request. example: + import: + local_image_id: local_image_id + operation_uuid: operation_uuid + contents: + parent_manifest: parent_manifest + manifest: manifest + dockerfile: dockerfile + image_config: image_config + packages: packages + digest: digest + parent_digest: parent_digest + tags: + - docker.io/library/nginx:latest + - docker.io/library/nginx:latest digest: creation_timestamp_override: 2000-01-23T04:56:07.000+00:00 dockerfile: dockerfile @@ -3147,42 +3947,47 @@ components: $ref: '#/components/schemas/RegistryDigestSource' archive: $ref: '#/components/schemas/AnalysisArchiveSource' + import: + $ref: '#/components/schemas/ImageImportManifest' type: object RegistryTagSource: - description: An image reference using a tag in a registry, this is the most - common source type. + description: "An image reference using a tag in a registry, this is the most\ + \ common source type." example: dockerfile: dockerfile pullstring: pullstring + nullable: true properties: pullstring: - description: A docker pull string (e.g. docker.io/nginx:latest, or docker.io/nginx@sha256:abd) - to retrieve the image + description: "A docker pull string (e.g. docker.io/nginx:latest, or docker.io/nginx@sha256:abd)\ + \ to retrieve the image" type: string dockerfile: - description: Base64 encoded content of the dockerfile used to build the - image, if available. - pattern: ^[a-zA-Z0-9+/=]+$ + description: "Base64 encoded content of the dockerfile used to build the\ + \ image, if available." + pattern: "^[a-zA-Z0-9+/=]+$" type: string required: - pullstring type: object + x-nullable: true RegistryDigestSource: - description: An image reference using a digest in a registry, includes some - extra tag and timestamp info in addition to the pull string to allow proper - tag history reconstruction. + description: "An image reference using a digest in a registry, includes some\ + \ extra tag and timestamp info in addition to the pull string to allow proper\ + \ tag history reconstruction." example: creation_timestamp_override: 2000-01-23T04:56:07.000+00:00 dockerfile: dockerfile pullstring: pullstring tag: tag + nullable: true properties: pullstring: description: A digest-based pullstring (e.g. docker.io/nginx@sha256:123abc) type: string tag: - description: A docker pull string (e.g. docker.io/nginx:latest, or docker.io/nginx@sha256:abd) - to retrieve the image + description: A valid docker tag reference (e.g. docker.io/nginx:latest) + that will be associated with the image but not used to pull the image. type: string creation_timestamp_override: description: Optional override of the image creation time to support proper @@ -3191,32 +3996,39 @@ components: format: date-time type: string dockerfile: - description: Base64 encoded content of the dockerfile used to build the - image, if available. - pattern: ^[a-zA-Z0-9+/=]+$ + description: "Base64 encoded content of the dockerfile used to build the\ + \ image, if available." + pattern: "^[a-zA-Z0-9+/=]+$" type: string required: - - creation_timestamp_override - pullstring - tag type: object + x-nullable: true AnalysisArchiveSource: description: An image reference in the analysis archive for the purposes of loading analysis from the archive into th working set example: digest: digest + nullable: true properties: digest: - description: The image digest identify the analysis. Archived analyses are - based on digest, tag records are restored as analysis is restored. - pattern: ^sha256:[a-fA-F0-9]{64}$ + description: "The image digest identify the analysis. Archived analyses\ + \ are based on digest, tag records are restored as analysis is restored." + pattern: "^sha256:[a-fA-F0-9]{64}$" type: string required: - digest type: object + x-nullable: true + LocalAnalysisSource: + properties: + digest: + type: string + type: object PolicyBundle: - description: A bundle containing a set of policies, whitelists, and rules for - mapping them to specific images + description: "A bundle containing a set of policies, whitelists, and rules for\ + \ mapping them to specific images" example: blacklisted_images: - registry: registry @@ -3269,9 +4081,11 @@ components: version: version items: - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - name: name @@ -3280,9 +4094,11 @@ components: version: version items: - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate name: name @@ -3359,7 +4175,7 @@ components: description: Human readable name for the bundle type: string comment: - description: Description of the bundle, human readable + description: "Description of the bundle, human readable" type: string version: description: Version id for this bundle format @@ -3384,8 +4200,8 @@ components: $ref: '#/components/schemas/MappingRule' type: array whitelisted_images: - description: List of mapping rules that define which images should always - be passed (unless also on the blacklist), regardless of policy result. + description: "List of mapping rules that define which images should always\ + \ be passed (unless also on the blacklist), regardless of policy result." items: $ref: '#/components/schemas/ImageSelectionRule' type: array @@ -3407,6 +4223,7 @@ components: an image and indicates it should be ignored in final policy decisions example: trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate properties: @@ -3416,6 +4233,9 @@ components: type: string trigger_id: type: string + expires_on: + format: date-time + type: string required: - gate - trigger_id @@ -3448,7 +4268,7 @@ components: type: string params: items: - $ref: '#/components/schemas/PolicyRule_params' + $ref: '#/components/schemas/PolicyRule_params_inner' type: array required: - action @@ -3464,9 +4284,11 @@ components: version: version items: - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate properties: @@ -3504,6 +4326,33 @@ components: - type - value type: object + DeleteImageResponse: + description: Image deletion response containing status and details + example: + digest: digest + detail: detail + status: not_found + properties: + digest: + type: string + status: + description: Current status of the image deletion + enum: + - not_found + - deleting + - delete_failed + type: string + detail: + type: string + required: + - digest + - status + type: object + DeleteImageResponseList: + description: A list of delete image responses + items: + $ref: '#/components/schemas/DeleteImageResponse' + type: array Policy: example: name: name @@ -3598,12 +4447,12 @@ components: type: string type: array policy_id: - description: Optional single policy to evalute, if set will override any - value in policy_ids, for backwards compatibility. Generally, policy_ids - should be used even with a array of length 1. + description: "Optional single policy to evalute, if set will override any\ + \ value in policy_ids, for backwards compatibility. Generally, policy_ids\ + \ should be used even with a array of length 1." type: string policy_ids: - description: List of policyIds to evaluate in order, to completion + description: "List of policyIds to evaluate in order, to completion" items: description: PolicyId to evaluate type: string @@ -3675,9 +4524,11 @@ components: version: version items: - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - name: name @@ -3686,9 +4537,11 @@ components: version: version items: - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate - trigger_id: trigger_id + expires_on: 2000-01-23T04:56:07.000+00:00 id: id gate: gate name: name @@ -3791,8 +4644,8 @@ components: $ref: '#/components/schemas/PolicyBundleRecord' type: array ImageContent: - description: A metadata content record for a specific image, containing different - content type entries + description: "A metadata content record for a specific image, containing different\ + \ content type entries" type: object ImageDetail: description: A metadata detail record for a specific image. Multiple detail @@ -3851,6 +4704,7 @@ components: parentDigest: parentDigest analyzed_at: 6 created_at: 0 + image_status: image_status fulltag: fulltag imageDigest: imageDigest properties: @@ -3870,6 +4724,8 @@ components: type: integer tag_detected_at: type: integer + image_status: + type: string type: object AnchoreImage: description: A unique image in the engine. May have multiple tags or references. @@ -3878,10 +4734,10 @@ components: last_updated: 2000-01-23T04:56:07.000+00:00 analysis_status: not_analyzed created_at: 2000-01-23T04:56:07.000+00:00 - annotations: '{}' + annotations: "{}" image_status: active userId: userId - image_content: '{}' + image_content: "{}" image_detail: - registry: registry last_updated: 2000-01-23T04:56:07.000+00:00 @@ -3906,8 +4762,8 @@ components: imageDigest: imageDigest properties: image_content: - description: A metadata content record for a specific image, containing - different content type entries + description: "A metadata content record for a specific image, containing\ + \ different content type entries" type: object image_detail: description: Details specific to an image reference and type such as tag @@ -3963,7 +4819,7 @@ components: busy: true available: true up: true - detail: '{}' + detail: "{}" message: message version: version version: version @@ -3977,7 +4833,7 @@ components: busy: true available: true up: true - detail: '{}' + detail: "{}" message: message version: version version: version @@ -3996,7 +4852,7 @@ components: busy: true available: true up: true - detail: '{}' + detail: "{}" message: message version: version properties: @@ -4047,7 +4903,7 @@ components: busy: true available: true up: true - detail: '{}' + detail: "{}" message: message version: version version: version @@ -4060,7 +4916,7 @@ components: description: Registered service name type: string base_url: - description: The url to reach the service, including port as needed + description: "The url to reach the service, including port as needed" type: string status_message: description: A state indicating the condition of the service. Normal operation @@ -4122,7 +4978,7 @@ components: type: string content: items: - $ref: '#/components/schemas/ContentFilesResponse_content' + $ref: '#/components/schemas/ContentFilesResponse_content_inner' type: array type: object ContentPackageResponse: @@ -4131,15 +4987,27 @@ components: content_type: content_type content: - license: license + licenses: + - licenses + - licenses package: package size: size + cpes: + - cpes + - cpes origin: origin location: location type: type version: version - license: license + licenses: + - licenses + - licenses package: package size: size + cpes: + - cpes + - cpes origin: origin location: location type: type @@ -4152,7 +5020,69 @@ components: type: string content: items: - $ref: '#/components/schemas/ContentPackageResponse_content' + $ref: '#/components/schemas/ContentPackageResponse_content_inner' + type: array + type: object + ContentMalwareResponse: + description: Malware listing response + example: + content_type: content_type + content: + - metadata: "{}" + findings: + - path: path + signature: signature + - path: path + signature: signature + scanner: scanner + enabled: true + - metadata: "{}" + findings: + - path: path + signature: signature + - path: path + signature: signature + scanner: scanner + enabled: true + imageDigest: imageDigest + properties: + imageDigest: + type: string + content_type: + type: string + content: + description: "List of malware scan results, one per scanner configured to\ + \ run" + items: + $ref: '#/components/schemas/MalwareScan' + type: array + type: object + MalwareScan: + description: A single scan from a scanner + example: + metadata: "{}" + findings: + - path: path + signature: signature + - path: path + signature: signature + scanner: scanner + enabled: true + properties: + enabled: + description: Indicates if the scanner is enabled + type: boolean + scanner: + description: The name of the scanner that produced the finding + type: string + metadata: + description: Open schema for scanner-specific metadata related to the scan + result + properties: {} + type: object + findings: + items: + $ref: '#/components/schemas/MalwareScan_findings_inner' type: array type: object ContentJAVAPackageResponse: @@ -4162,6 +5092,9 @@ components: content: - package: package implementation-version: implementation-version + cpes: + - cpes + - cpes origin: origin maven-version: maven-version location: location @@ -4169,6 +5102,9 @@ components: specification-version: specification-version - package: package implementation-version: implementation-version + cpes: + - cpes + - cpes origin: origin maven-version: maven-version location: location @@ -4182,13 +5118,13 @@ components: type: string content: items: - $ref: '#/components/schemas/ContentJAVAPackageResponse_content' + $ref: '#/components/schemas/ContentJAVAPackageResponse_content_inner' type: array type: object MetadataResponse: description: Generic wrapper for metadata listings from images example: - metadata: '{}' + metadata: "{}" metadata_type: metadata_type imageDigest: imageDigest properties: @@ -4215,8 +5151,8 @@ components: active: true properties: subscription_value: - description: The new subscription value, e.g. the new tag to be subscribed - to + description: "The new subscription value, e.g. the new tag to be subscribed\ + \ to" nullable: true type: string active: @@ -4228,7 +5164,7 @@ components: example: subscription_value: subscription_value subscription_key: subscription_key - subscription_type: policy_eval + subscription_type: subscription_type properties: subscription_key: type: string @@ -4236,12 +5172,6 @@ components: nullable: true type: string subscription_type: - enum: - - policy_eval - - tag_update - - vuln_update - - repo_update - - analysis_update type: string type: object Subscription: @@ -4251,7 +5181,7 @@ components: subscription_value: subscription_value active: true subscription_key: subscription_key - subscription_type: policy_eval + subscription_type: subscription_type userId: userId properties: subscription_key: @@ -4260,12 +5190,6 @@ components: type: string subscription_type: description: The type of the subscription - enum: - - policy_eval - - tag_update - - vuln_update - - repo_update - - analysis_update type: string subscription_value: description: The value of the subscription target @@ -4317,9 +5241,9 @@ components: description: Type of registry type: string registry: - description: hostname:port string for accessing the registry, as would be - used in a docker pull operation. May include some or all of a repository - and wildcards (e.g. docker.io/library/* or gcr.io/myproject/myrepository) + description: "hostname:port string for accessing the registry, as would\ + \ be used in a docker pull operation. May include some or all of a repository\ + \ and wildcards (e.g. docker.io/library/* or gcr.io/myproject/myrepository)" type: string registry_name: description: human readable name associated with registry record @@ -4357,8 +5281,8 @@ components: description: Engine user that owns this registry entry type: string registry: - description: hostname:port string for accessing the registry, as would be - used in a docker pull operation + description: "hostname:port string for accessing the registry, as would\ + \ be used in a docker pull operation" type: string registry_name: description: human readable name associated with registry record @@ -4413,6 +5337,7 @@ components: package_type: package_type package_cpe: package_cpe url: url + will_not_fix: true feed: feed package_version: package_version fix: fix @@ -4421,10 +5346,10 @@ components: package_name: package_name properties: vuln: - description: The vulnerability identifier, such as CVE-2017-100, or RHSA-2017123 + description: "The vulnerability identifier, such as CVE-2017-100, or RHSA-2017123" type: string fix: - description: The package containing a fix, if available + description: "The package containing a fix, if available" type: string severity: description: The severity of the vulnerability @@ -4458,6 +5383,9 @@ components: description: The location (if applicable) of the vulnerable package in the container filesystem type: string + will_not_fix: + description: Whether a vendor will fix or not fix the vulnerability + type: boolean nvd_data: description: List of Nvd Data objects items: @@ -4605,6 +5533,7 @@ components: package_type: package_type package_cpe: package_cpe url: url + will_not_fix: true feed: feed package_version: package_version fix: fix @@ -4655,6 +5584,7 @@ components: package_type: package_type package_cpe: package_cpe url: url + will_not_fix: true feed: feed package_version: package_version fix: fix @@ -4674,10 +5604,7 @@ components: type: array type: object ImageFilter: - description: Filter for an image list by id, tag, or digest, but not both - example: - digest: digest - tag: tag + description: "Filter for an image list by id, tag, or digest, but not both" properties: tag: type: string @@ -4685,7 +5612,7 @@ components: type: string type: object AnchoreErrorCode: - description: A description of an anchore error code (name, description) + description: "A description of an anchore error code (name, description)" example: name: name description: description @@ -4712,14 +5639,14 @@ components: state: active parameters: - name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active required: true example: example - name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active @@ -4731,14 +5658,14 @@ components: state: active parameters: - name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active required: true example: example - name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active @@ -4746,7 +5673,7 @@ components: example: example properties: name: - description: Gate name, as it would appear in a policy document + description: "Gate name, as it would appear in a policy document" type: string description: description: Description of the gate @@ -4779,14 +5706,14 @@ components: state: active parameters: - name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active required: true example: example - name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active @@ -4821,7 +5748,7 @@ components: TriggerParamSpec: example: name: name - validator: '{}' + validator: "{}" description: description superceded_by: superceded_by state: active @@ -4854,8 +5781,8 @@ components: description: Is this a required parameter or optional type: boolean validator: - description: If present, a definition for validation of input. Typically - a jsonschema object that can be used to validate an input against. + description: "If present, a definition for validation of input. Typically\ + \ a jsonschema object that can be used to validate an input against." properties: {} type: object type: object @@ -4927,13 +5854,14 @@ components: id: id type: type level: level - details: '{}' + details: "{}" source: base_url: base_url hostid: hostid servicename: servicename request_id: request_id type: type + category: category message: message timestamp: 2000-01-23T04:56:07.000+00:00 properties: @@ -4960,13 +5888,14 @@ components: id: id type: type level: level - details: '{}' + details: "{}" source: base_url: base_url hostid: hostid servicename: servicename request_id: request_id type: type + category: category message: message timestamp: 2000-01-23T04:56:07.000+00:00 - generated_uuid: generated_uuid @@ -4977,13 +5906,14 @@ components: id: id type: type level: level - details: '{}' + details: "{}" source: base_url: base_url hostid: hostid servicename: servicename request_id: request_id type: type + category: category message: message timestamp: 2000-01-23T04:56:07.000+00:00 properties: @@ -4993,8 +5923,8 @@ components: $ref: '#/components/schemas/EventResponse' type: array next_page: - description: Boolean flag, True indicates there are more events and False - otherwise + description: "Boolean flag, True indicates there are more events and False\ + \ otherwise" type: boolean item_count: description: Number of events in this page @@ -5013,12 +5943,13 @@ components: name: description: The account name to use. This will identify the account and must be globally unique in the system. - pattern: ^[a-zA-Z0-9][a-zA-Z0-9@.!#$+-=^_`~;]{1,126}[a-zA-Z0-9]$ + pattern: "^[a-zA-Z0-9][a-zA-Z0-9@.!#$+-=^_`~;]{1,126}[a-zA-Z0-9]$" type: string email: description: An optional email to associate with the account for contact purposes - pattern: '[a-z0-9!#$%&''*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?' + pattern: "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\ + .)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" type: string required: - name @@ -5034,21 +5965,21 @@ components: email: email properties: name: - description: The account identifier, not updatable after creation + description: "The account identifier, not updatable after creation" type: string type: - description: The user type (admin vs user). If not specified in a POST request, - 'user' is default + description: "The user type (admin vs user). If not specified in a POST\ + \ request, 'user' is default" enum: - user - admin - service type: string state: - description: State of the account. Disabled accounts prevent member users - from logging in, deleting accounts are disabled and pending deletion and - will be removed once all owned resources are garbage collected by the - system + description: "State of the account. Disabled accounts prevent member users\ + \ from logging in, deleting accounts are disabled and pending deletion\ + \ and will be removed once all owned resources are garbage collected by\ + \ the system" enum: - enabled - disabled @@ -5082,10 +6013,10 @@ components: type: string type: object User: - description: A username for authenticating with one or more types of credentials. - User type defines the expected credentials allowed for the user. Native users - have passwords, External users have no credential internally. Internal users - are service/system users for inter-service communication. + description: "A username for authenticating with one or more types of credentials.\ + \ User type defines the expected credentials allowed for the user. Native\ + \ users have passwords, External users have no credential internally. Internal\ + \ users are service/system users for inter-service communication." example: last_updated: 2000-01-23T04:56:07.000+00:00 created_at: 2000-01-23T04:56:07.000+00:00 @@ -5104,8 +6035,8 @@ components: - external type: string source: - description: If the user is external, this is the source that the user was - initialized from. All other user types have this set to null + description: "If the user is external, this is the source that the user\ + \ was initialized from. All other user types have this set to null" type: string created_at: description: The timestampt the user record was created @@ -5119,29 +6050,29 @@ components: - username type: object UserCreationRequest: - description: A payload for creating a new user, includes the username and password - in a single request + description: "A payload for creating a new user, includes the username and password\ + \ in a single request" example: password: password username: username properties: username: description: The username to create - pattern: ^[a-zA-Z0-9][a-zA-Z0-9@.!#$+-=^_`~;]{1,126}[a-zA-Z0-9]$ + pattern: "^[a-zA-Z0-9][a-zA-Z0-9@.!#$+-=^_`~;]{1,126}[a-zA-Z0-9]$" type: string password: - description: The initial password for the user, must be at least 6 characters, - up to 128 - pattern: .{6,128}$ + description: "The initial password for the user, must be at least 6 characters,\ + \ up to 128" + pattern: ".{6,128}$" type: string required: - password - username type: object AccessCredential: - description: A login credential mapped to a user identity. For password credentials, - the username to present for Basic auth is the user's username from the user - record + description: "A login credential mapped to a user identity. For password credentials,\ + \ the username to present for Basic auth is the user's username from the user\ + \ record" example: created_at: created_at type: password @@ -5192,9 +6123,9 @@ components: $ref: '#/components/schemas/ServiceVersion_db' type: object ArchiveSummary: - description: A summarization of the available archives, a place to for long-term - storage of audit, analysis, or other data to remove it from the system's working - set but keep it available. + description: "A summarization of the available archives, a place to for long-term\ + \ storage of audit, analysis, or other data to remove it from the system's\ + \ working set but keep it available." example: images: last_updated: 2000-01-23T04:56:07.000+00:00 @@ -5211,9 +6142,9 @@ components: $ref: '#/components/schemas/AnalysisArchiveRulesSummary' type: object AnalysisArchiveSummary: - description: A summarization of the analysis archive, including size, counts, - etc. This archive stores image analysis only, never the actual image content - or layers. + description: "A summarization of the analysis archive, including size, counts,\ + \ etc. This archive stores image analysis only, never the actual image content\ + \ or layers." example: last_updated: 2000-01-23T04:56:07.000+00:00 total_image_count: 0 @@ -5229,9 +6160,9 @@ components: unique tag->digest mapping per record. type: integer total_data_bytes: - description: The total sum of all the bytes stored to the backing storage. - Accounts for anchore-applied compression, but not compression by the underlying - storage system. + description: "The total sum of all the bytes stored to the backing storage.\ + \ Accounts for anchore-applied compression, but not compression by the\ + \ underlying storage system." type: integer last_updated: description: The timestamp of the most recent archived image @@ -5282,7 +6213,7 @@ components: - error type: string detail: - description: Details on the status, e.g. the error message + description: "Details on the status, e.g. the error message" type: string type: object ArchivedAnalyses: @@ -5295,7 +6226,7 @@ components: last_updated: 2000-01-23T04:56:07.000+00:00 parentDigest: parentDigest analyzed_at: 2000-01-23T04:56:07.000+00:00 - annotations: '{}' + annotations: "{}" created_at: 2000-01-23T04:56:07.000+00:00 archive_size_bytes: 0 imageDigest: imageDigest @@ -5313,8 +6244,8 @@ components: repository: repository properties: imageDigest: - description: The image digest (digest of the manifest describing the image, - per docker spec) + description: "The image digest (digest of the manifest describing the image,\ + \ per docker spec)" type: string parentDigest: description: The digest of a parent manifest (for manifest-list images) @@ -5346,7 +6277,7 @@ components: format: date-time type: string archive_size_bytes: - description: The size, in bytes, of the analysis archive file + description: "The size, in bytes, of the analysis archive file" type: integer type: object AnalysisArchiveRules: @@ -5358,6 +6289,8 @@ components: AnalysisArchiveTransitionRule: description: A rule for auto-archiving image analysis by time and/or tag-history example: + rule_id: rule_id + max_images_per_account: 5 tag_versions_newer: 0 last_updated: 2000-01-23T04:56:07.000+00:00 created_at: 2000-01-23T04:56:07.000+00:00 @@ -5365,12 +6298,21 @@ components: registry: registry tag: tag repository: repository + exclude: + expiration_days: 1 + selector: + registry: registry + tag: tag + repository: repository analysis_age_days: 6 system_global: true transition: archive properties: selector: $ref: '#/components/schemas/ImageSelector' + rule_id: + description: Unique identifier for archive rule + type: string tag_versions_newer: description: Number of images mapped to the tag that are newer type: integer @@ -5379,17 +6321,18 @@ components: of days type: integer transition: - description: The type of transition to make. If "archive", then archive - an image from the working set and remove it from the working set. If "delete", - then match against archived images and delete from the archive if match. + description: "The type of transition to make. If \"archive\", then archive\ + \ an image from the working set and remove it from the working set. If\ + \ \"delete\", then match against archived images and delete from the archive\ + \ if match." enum: - archive - delete type: string system_global: - description: True if the rule applies to all accounts in the system. This - is only available to admin users to update/modify, but all users with - permission to list rules can see them + description: "True if the rule applies to all accounts in the system. This\ + \ is only available to admin users to update/modify, but all users with\ + \ permission to list rules can see them" type: boolean created_at: format: date-time @@ -5397,9 +6340,31 @@ components: last_updated: format: date-time type: string + exclude: + $ref: '#/components/schemas/AnalysisArchiveTransitionRuleExclude' + max_images_per_account: + description: This is the maximum number of image analyses an account can + have. Can only be set on system_global rules + type: integer required: - transition type: object + AnalysisArchiveTransitionRuleExclude: + description: Which Images to exclude from auto-archiving logic + example: + expiration_days: 1 + selector: + registry: registry + tag: tag + repository: repository + properties: + selector: + $ref: '#/components/schemas/ImageSelector' + expiration_days: + description: How long the image selected will be excluded from the archive + transition + type: integer + type: object AnalysisArchiveTransitionHistory: description: A rule for auto-archiving image analysis by time and/or tag-history properties: @@ -5423,24 +6388,24 @@ components: type: string type: object ImageSelector: - description: A set of selection criteria to match an image by a tagged pullstring - based on its components, with regex support in each field + description: "A set of selection criteria to match an image by a tagged pullstring\ + \ based on its components, with regex support in each field" example: registry: registry tag: tag repository: repository properties: registry: - description: The registry section of a pull string. e.g. with "docker.io/anchore/anchore-engine:latest", - this is "docker.io" + description: "The registry section of a pull string. e.g. with \"docker.io/anchore/anchore-engine:latest\"\ + , this is \"docker.io\"" type: string repository: - description: The repository section of a pull string. e.g. with "docker.io/anchore/anchore-engine:latest", - this is "anchore/anchore-engine" + description: "The repository section of a pull string. e.g. with \"docker.io/anchore/anchore-engine:latest\"\ + , this is \"anchore/anchore-engine\"" type: string tag: - description: The tag-only section of a pull string. e.g. with "docker.io/anchore/anchore-engine:latest", - this is "latest" + description: "The tag-only section of a pull string. e.g. with \"docker.io/anchore/anchore-engine:latest\"\ + , this is \"latest\"" type: string type: object FeedSyncResults: @@ -5471,14 +6436,14 @@ components: description: The name of the feed synced type: string status: - description: The result of the sync operations, either co + description: "The result of the sync operations, either co" enum: - success - failure type: string total_time_seconds: - description: The duratin, in seconds, of the sync of the feed, the sum of - all the group syncs + description: "The duratin, in seconds, of the sync of the feed, the sum\ + \ of all the group syncs" type: number groups: description: Array of group sync results @@ -5503,9 +6468,9 @@ components: - failure type: string updated_image_count: - description: The number of images updated by the this group sync, across - all accounts. This is typically only non-zero for vulnerability feeds - which update images' vulnerability results during the sync. + description: "The number of images updated by the this group sync, across\ + \ all accounts. This is typically only non-zero for vulnerability feeds\ + \ which update images' vulnerability results during the sync." type: integer updated_record_count: description: The number of feed data records synced down as either updates @@ -5525,12 +6490,704 @@ components: required: - token type: object + RetrievedFile: + description: The retrieved file entry including content (b64 encoded) + example: + path: path + b64_content: b64_content + properties: + path: + type: string + b64_content: + type: string + type: object + RetrievedFileList: + description: Simple array of RetrievedFileMetadata objects + items: + $ref: '#/components/schemas/RetrievedFile' + type: array + SecretSearchResult: + description: The retrieved file entry including content (b64 encoded) + example: + path: path + matches: + - regex: regex + name: name + lines: + - 0 + - 0 + - regex: regex + name: name + lines: + - 0 + - 0 + properties: + path: + type: string + matches: + items: + $ref: '#/components/schemas/RegexContentMatch' + type: array + type: object + SecretSearchList: + description: Simple array of RetrievedFileMetadata objects + items: + $ref: '#/components/schemas/SecretSearchResult' + type: array + FileContentSearchResult: + description: The retrieved file entry including content (b64 encoded) + example: + path: path + matches: + - regex: regex + name: name + lines: + - 0 + - 0 + - regex: regex + name: name + lines: + - 0 + - 0 + properties: + path: + type: string + matches: + items: + $ref: '#/components/schemas/RegexContentMatch' + type: array + type: object + FileContentSearchList: + description: Simple array of RetrievedFileMetadata objects + items: + $ref: '#/components/schemas/FileContentSearchResult' + type: array + RegexContentMatch: + description: Match of a named regex on a file + example: + regex: regex + name: name + lines: + - 0 + - 0 + properties: + name: + description: The name associated with the regular expression + type: string + regex: + description: The regular expression used for the match + type: string + lines: + description: A list of line numbers in the file that matched the regex + items: + type: integer + type: array + type: object + EventTypesList: + description: Array of EventCategory objects + items: + $ref: '#/components/schemas/EventCategory' + type: array + EventCategory: + description: A collection of event subcategories + example: + description: description + category: category + subcategories: + - name: name + description: description + events: + - name: name + resource_type: resource_type + type: type + message: message + - name: name + resource_type: resource_type + type: type + message: message + - name: name + description: description + events: + - name: name + resource_type: resource_type + type: type + message: message + - name: name + resource_type: resource_type + type: type + message: message + properties: + category: + type: string + description: + type: string + subcategories: + items: + $ref: '#/components/schemas/EventSubcategory' + type: array + type: object + EventSubcategory: + description: A collection of events related to each other + example: + name: name + description: description + events: + - name: name + resource_type: resource_type + type: type + message: message + - name: name + resource_type: resource_type + type: type + message: message + properties: + name: + type: string + description: + type: string + events: + items: + $ref: '#/components/schemas/EventDescription' + type: array + type: object + EventDescription: + description: A description of an event type + example: + name: name + resource_type: resource_type + type: type + message: message + properties: + name: + description: The event type. The last component of the fully-qualified event_type + (category.subcategory.event) + type: string + type: + description: The fully qualified event type as would be seen in the event + payload + type: string + message: + description: The message associated with the event type + type: string + resource_type: + description: The type of resource this event is generated from + type: string + type: object + NotificationBase: + description: base object for Notifications (every notification has this basic + structure) + properties: + queueId: + type: string + userId: + type: string + dataId: + type: string + created_at: + type: integer + last_updated: + type: integer + record_state_key: + default: active + type: string + record_state_val: + nullable: true + type: string + tries: + type: integer + max_tries: + type: integer + type: object + PolicyEvalNotification: + allOf: + - $ref: '#/components/schemas/NotificationBase' + - $ref: '#/components/schemas/PolicyEvalNotification_allOf' + TagUpdateNotification: + allOf: + - $ref: '#/components/schemas/NotificationBase' + - $ref: '#/components/schemas/TagUpdateNotification_allOf' + VulnUpdateNotification: + allOf: + - $ref: '#/components/schemas/NotificationBase' + - $ref: '#/components/schemas/VulnUpdateNotification_allOf' + AnalysisUpdateNotification: + allOf: + - $ref: '#/components/schemas/NotificationBase' + - $ref: '#/components/schemas/AnalysisUpdateNotification_allOf' + BaseNotificationData: + description: "Every notification has a payload, which follows this basic structure" + properties: + notification_user: + type: string + notification_user_email: + type: string + notification_type: + type: string + type: object + PolicyEvalNotificationData: + allOf: + - $ref: '#/components/schemas/BaseNotificationData' + - $ref: '#/components/schemas/PolicyEvalNotificationData_allOf' + TagUpdateNotificationData: + allOf: + - $ref: '#/components/schemas/BaseNotificationData' + - $ref: '#/components/schemas/TagUpdateNotificationData_allOf' + VulnUpdateNotificationData: + allOf: + - $ref: '#/components/schemas/BaseNotificationData' + - $ref: '#/components/schemas/VulnUpdateNotificationData_allOf' + AnalysisUpdateNotificationData: + allOf: + - $ref: '#/components/schemas/BaseNotificationData' + - $ref: '#/components/schemas/AnalysisUpdateNotificationData_allOf' + GenericNotificationPayload: + description: Parent class for Notification Payloads + properties: + userId: + type: string + subscription_key: + type: string + subscription_type: + type: string + notificationId: + type: string + type: object + PolicyEvalNotificationPayload: + allOf: + - $ref: '#/components/schemas/GenericNotificationPayload' + - $ref: '#/components/schemas/PolicyEvalNotificationPayload_allOf' + TagUpdateNotificationPayload: + allOf: + - $ref: '#/components/schemas/GenericNotificationPayload' + - $ref: '#/components/schemas/TagUpdateNotificationPayload_allOf' + VulnUpdateNotificationPayload: + allOf: + - $ref: '#/components/schemas/GenericNotificationPayload' + - $ref: '#/components/schemas/VulnUpdateNotificationPayload_allOf' + AnalysisUpdateNotificationPayload: + allOf: + - $ref: '#/components/schemas/GenericNotificationPayload' + - $ref: '#/components/schemas/AnalysisUpdateNotificationPayload_allOf' + VulnDiffResult: + description: The results of the comparing two vulnerability records during an + update + properties: + added: + items: + type: object + type: array + updated: + items: + type: object + type: array + removed: + items: + type: object + type: array + type: object + AnalysisUpdateEval: + description: Evaluation Results for an entity (current or last) + properties: + analysis_status: + type: string + annotations: + properties: {} + type: object + image_digest: + type: string + type: object + ImageImportOperation: + description: "An import record, creating a unique identifier for referencing\ + \ the operation as well as its state" + example: + expires_at: 2000-01-23T04:56:07.000+00:00 + created_at: 2000-01-23T04:56:07.000+00:00 + uuid: uuid + status: pending + properties: + uuid: + type: string + status: + enum: + - pending + - queued + - processing + - complete + - failed + - expired + type: string + expires_at: + format: date-time + type: string + created_at: + format: date-time + type: string + type: object + ImageImportContentResponse: + example: + digest: digest + created_at: 2000-01-23T04:56:07.000+00:00 + properties: + digest: + type: string + created_at: + format: date-time + type: string + type: object + ImageContentDeleteResponse: + type: object + ImageImportManifest: + example: + local_image_id: local_image_id + operation_uuid: operation_uuid + contents: + parent_manifest: parent_manifest + manifest: manifest + dockerfile: dockerfile + image_config: image_config + packages: packages + digest: digest + parent_digest: parent_digest + tags: + - docker.io/library/nginx:latest + - docker.io/library/nginx:latest + nullable: true + properties: + contents: + $ref: '#/components/schemas/ImportContentDigests' + tags: + items: + description: Full docker reference tags + example: docker.io/library/nginx:latest + type: string + type: array + digest: + type: string + parent_digest: + description: The digest of the images's manifest-list parent if it was accessed + from a multi-arch tag where the tag pointed to a manifest-list. This allows + preservation of that relationship in the data + type: string + local_image_id: + description: An "imageId" as used by Docker if available + type: string + operation_uuid: + type: string + type: object + x-nullable: true + ImportContentDigests: + description: Digest of content to use in the final import + example: + parent_manifest: parent_manifest + manifest: manifest + dockerfile: dockerfile + image_config: image_config + packages: packages + properties: + packages: + description: Digest to use for the packages content + type: string + image_config: + description: Digest for reference content for image config + type: string + manifest: + description: Digest to reference content for the image manifest + type: string + parent_manifest: + description: Digest for reference content for parent manifest + type: string + dockerfile: + description: Digest for reference content for dockerfile + type: string + required: + - image_config + - manifest + - packages + type: object + Annotations: + description: Simple key/value pairs where the value may be optional + type: object + ImageImports: + items: + $ref: '#/components/schemas/ImageImportOperation' + type: array + ImportContentDigestList: + items: + description: String digest of an uploaded content + type: string + type: array + ImagePackageManifest: + example: + schema: + version: version + url: url + distro: + idLike: idLike + name: name + version: version + source: + type: type + target: "{}" + descriptor: + name: name + version: version + artifactRelationships: + - parent: parent + metadata: "{}" + type: type + child: child + - parent: parent + metadata: "{}" + type: type + child: child + artifacts: + - foundBy: foundBy + licenses: + - licenses + - licenses + metadata: "{}" + cpes: + - cpes + - cpes + name: name + locations: + - path: path + layerID: layerID + - path: path + layerID: layerID + language: language + id: id + purl: purl + type: type + version: version + metadataType: metadataType + - foundBy: foundBy + licenses: + - licenses + - licenses + metadata: "{}" + cpes: + - cpes + - cpes + name: name + locations: + - path: path + layerID: layerID + - path: path + layerID: layerID + language: language + id: id + purl: purl + type: type + version: version + metadataType: metadataType + properties: + artifacts: + items: + $ref: '#/components/schemas/ImportPackage' + type: array + source: + $ref: '#/components/schemas/ImportSource' + distro: + $ref: '#/components/schemas/ImportDistribution' + descriptor: + $ref: '#/components/schemas/ImportDescriptor' + schema: + $ref: '#/components/schemas/ImportSchema' + artifactRelationships: + items: + $ref: '#/components/schemas/ImportPackageRelationship' + type: array + required: + - artifacts + - distro + - source + type: object + ImportDescriptor: + example: + name: name + version: version + properties: + name: + type: string + version: + type: string + required: + - name + - version + type: object + ImportDistribution: + example: + idLike: idLike + name: name + version: version + properties: + name: + type: string + version: + type: string + idLike: + type: string + required: + - idLike + - name + - version + type: object + ImportPackageLocation: + example: + path: path + layerID: layerID + properties: + path: + type: string + layerID: + type: string + required: + - path + type: object + ImportPackage: + example: + foundBy: foundBy + licenses: + - licenses + - licenses + metadata: "{}" + cpes: + - cpes + - cpes + name: name + locations: + - path: path + layerID: layerID + - path: path + layerID: layerID + language: language + id: id + purl: purl + type: type + version: version + metadataType: metadataType + properties: + id: + type: string + name: + type: string + version: + type: string + type: + type: string + foundBy: + type: string + locations: + items: + $ref: '#/components/schemas/ImportPackageLocation' + type: array + licenses: + items: + type: string + type: array + language: + type: string + cpes: + items: + type: string + type: array + purl: + type: string + metadataType: + type: string + metadata: + properties: {} + type: object + required: + - cpes + - language + - licenses + - locations + - metadataType + - name + - type + - version + type: object + ImportSchema: + example: + version: version + url: url + properties: + version: + type: string + url: + type: string + required: + - url + - version + type: object + ImportSource: + example: + type: type + target: "{}" + properties: + type: + type: string + target: + type: object + required: + - target + - type + type: object + ImportPackageRelationship: + example: + parent: parent + metadata: "{}" + type: type + child: child + properties: + parent: + type: string + child: + type: string + type: + type: string + metadata: + properties: {} + type: object + required: + - child + - parent + - type + type: object + import_image_archive_request: + properties: + archive_file: + description: anchore image tar archive. + format: binary + type: string + required: + - archive_file + get_oauth_token_request: + properties: + grant_type: + default: password + description: OAuth Grant type for token + type: string + username: + description: User to assign OAuth token to + type: string + password: + description: Password for corresponding user + type: string + client_id: + default: anonymous + description: The type of client used for the OAuth token + type: string PaginatedVulnerableImageList_allOf: properties: images: items: $ref: '#/components/schemas/VulnerableImage' type: array + type: object + example: null PaginatedVulnerabilityList_allOf: properties: vulnerabilities: @@ -5539,13 +7196,17 @@ components: items: $ref: '#/components/schemas/StandaloneVulnerability' type: array + type: object + example: null PaginatedImageList_allOf: properties: images: items: $ref: '#/components/schemas/ImageWithPackages' type: array - PolicyRule_params: + type: object + example: null + PolicyRule_params_inner: example: name: name value: value @@ -5557,7 +7218,8 @@ components: required: - name - value - ContentFilesResponse_content: + type: object + ContentFilesResponse_content_inner: example: mode: mode uid: 1 @@ -5586,11 +7248,18 @@ components: type: string uid: type: integer - ContentPackageResponse_content: + type: object + ContentPackageResponse_content_inner: example: license: license + licenses: + - licenses + - licenses package: package size: size + cpes: + - cpes + - cpes origin: origin location: location type: type @@ -5607,13 +7276,40 @@ components: origin: type: string license: + description: Deprecated in favor of the 'licenses' field" type: string + licenses: + items: + type: string + type: array location: type: string - ContentJAVAPackageResponse_content: + cpes: + description: A list of Common Platform Enumerations that may uniquely identify + the package + items: + type: string + type: array + type: object + MalwareScan_findings_inner: + example: + path: path + signature: signature + properties: + path: + description: A path for a file in the image's rootfs + type: string + signature: + description: The malware signature found at the path + type: string + type: object + ContentJAVAPackageResponse_content_inner: example: package: package implementation-version: implementation-version + cpes: + - cpes + - cpes origin: origin maven-version: maven-version location: location @@ -5634,6 +7330,13 @@ components: type: string origin: type: string + cpes: + description: A list of Common Platform Enumerations that may uniquely identify + the package + items: + type: string + type: array + type: object EventResponse_event_source: example: base_url: base_url @@ -5649,6 +7352,7 @@ components: type: string request_id: type: string + type: object EventResponse_event_resource: example: user_id: user_id @@ -5661,6 +7365,7 @@ components: type: string type: type: string + type: object EventResponse_event: example: resource: @@ -5668,13 +7373,14 @@ components: id: id type: type level: level - details: '{}' + details: "{}" source: base_url: base_url hostid: hostid servicename: servicename request_id: request_id type: type + category: category message: message timestamp: 2000-01-23T04:56:07.000+00:00 properties: @@ -5684,6 +7390,8 @@ components: $ref: '#/components/schemas/EventResponse_event_resource' type: type: string + category: + type: string level: type: string message: @@ -5694,6 +7402,7 @@ components: timestamp: format: date-time type: string + type: object ServiceVersion_service: example: version: version @@ -5701,6 +7410,7 @@ components: version: description: Semantic Version string of the service implementation type: string + type: object ServiceVersion_api: description: Api Version string example: @@ -5709,6 +7419,7 @@ components: version: description: Semantic version of the api type: string + type: object ServiceVersion_db: example: schema_version: schema_version @@ -5716,7 +7427,119 @@ components: schema_version: description: Semantic version of the db schema type: string - securitySchemes: - basicAuth: - scheme: basic - type: http + type: object + PolicyEvalNotification_allOf: + description: The Notification Object definition for Policy Eval Notifications + properties: + data: + $ref: '#/components/schemas/PolicyEvalNotificationData' + type: object + example: null + TagUpdateNotification_allOf: + description: The Notification Object definition for Tag Update Notifications + properties: + data: + $ref: '#/components/schemas/TagUpdateNotificationData' + type: object + example: null + VulnUpdateNotification_allOf: + description: The Notification Object definition for Tag Update Notifications + properties: + data: + $ref: '#/components/schemas/VulnUpdateNotificationData' + type: object + example: null + AnalysisUpdateNotification_allOf: + description: The Notification Object definition for Tag Update Notifications + properties: + data: + $ref: '#/components/schemas/AnalysisUpdateNotificationData' + type: object + example: null + PolicyEvalNotificationData_allOf: + properties: + notification_payload: + $ref: '#/components/schemas/PolicyEvalNotificationPayload' + type: object + example: null + TagUpdateNotificationData_allOf: + properties: + notification_payload: + $ref: '#/components/schemas/TagUpdateNotificationPayload' + type: object + example: null + VulnUpdateNotificationData_allOf: + properties: + notification_payload: + $ref: '#/components/schemas/VulnUpdateNotificationPayload' + type: object + example: null + AnalysisUpdateNotificationData_allOf: + properties: + notification_payload: + $ref: '#/components/schemas/AnalysisUpdateNotificationPayload' + type: object + example: null + PolicyEvalNotificationPayload_allOf: + properties: + curr_eval: + description: The Current Policy Evaluation result + properties: {} + type: object + last_eval: + description: The Previous Policy Evaluation result + properties: {} + type: object + annotations: + description: List of Corresponding Image Annotations + nullable: true + properties: {} + type: object + type: object + example: null + TagUpdateNotificationPayload_allOf: + properties: + curr_eval: + description: A list containing the current image digest + items: + type: object + type: array + last_eval: + description: A list containing the previous image digests + items: + type: object + type: array + annotations: + description: List of Corresponding Image Annotations + nullable: true + properties: {} + type: object + type: object + example: null + VulnUpdateNotificationPayload_allOf: + properties: + diff_vulnerability_result: + $ref: '#/components/schemas/VulnDiffResult' + imageDigest: + type: string + annotations: + description: List of Corresponding Image Annotations + nullable: true + properties: {} + type: object + type: object + example: null + AnalysisUpdateNotificationPayload_allOf: + properties: + curr_eval: + $ref: '#/components/schemas/AnalysisUpdateEval' + last_eval: + $ref: '#/components/schemas/AnalysisUpdateEval' + annotations: + description: List of Corresponding Image Annotations + nullable: true + properties: {} + type: object + type: object + example: null +x-original-swagger-version: "2.0" diff --git a/.gen/anchore/api_archives.go b/.gen/anchore/api_archives.go index 9545c4e19d..219850259e 100644 --- a/.gen/anchore/api_archives.go +++ b/.gen/anchore/api_archives.go @@ -1,54 +1,80 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // ArchivesApiService ArchivesApi service type ArchivesApiService service +type ApiArchiveImageAnalysisRequest struct { + ctx context.Context + ApiService *ArchivesApiService + imageReferences *[]string +} + +func (r ApiArchiveImageAnalysisRequest) ImageReferences(imageReferences []string) ApiArchiveImageAnalysisRequest { + r.imageReferences = &imageReferences + return r +} + +func (r ApiArchiveImageAnalysisRequest) Execute() ([]AnalysisArchiveAddResult, *http.Response, error) { + return r.ApiService.ArchiveImageAnalysisExecute(r) +} + /* ArchiveImageAnalysis Method for ArchiveImageAnalysis - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageReferences -@return []AnalysisArchiveAddResult + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiArchiveImageAnalysisRequest */ -func (a *ArchivesApiService) ArchiveImageAnalysis(ctx _context.Context, imageReferences []string) ([]AnalysisArchiveAddResult, *_nethttp.Response, error) { +func (a *ArchivesApiService) ArchiveImageAnalysis(ctx context.Context) ApiArchiveImageAnalysisRequest { + return ApiArchiveImageAnalysisRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnalysisArchiveAddResult +func (a *ArchivesApiService) ArchiveImageAnalysisExecute(r ApiArchiveImageAnalysisRequest) ([]AnalysisArchiveAddResult, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnalysisArchiveAddResult ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/images" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.ArchiveImageAnalysis") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/images" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageReferences == nil { + return localVarReturnValue, nil, reportError("imageReferences is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -68,25 +94,26 @@ func (a *ArchivesApiService) ArchiveImageAnalysis(ctx _context.Context, imageRef localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &imageReferences - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.imageReferences + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -104,7 +131,7 @@ func (a *ArchivesApiService) ArchiveImageAnalysis(ctx _context.Context, imageRef err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -114,27 +141,57 @@ func (a *ArchivesApiService) ArchiveImageAnalysis(ctx _context.Context, imageRef return localVarReturnValue, localVarHTTPResponse, nil } +type ApiCreateAnalysisArchiveRuleRequest struct { + ctx context.Context + ApiService *ArchivesApiService + rule *AnalysisArchiveTransitionRule +} + +func (r ApiCreateAnalysisArchiveRuleRequest) Rule(rule AnalysisArchiveTransitionRule) ApiCreateAnalysisArchiveRuleRequest { + r.rule = &rule + return r +} + +func (r ApiCreateAnalysisArchiveRuleRequest) Execute() (*AnalysisArchiveTransitionRule, *http.Response, error) { + return r.ApiService.CreateAnalysisArchiveRuleExecute(r) +} + /* CreateAnalysisArchiveRule Method for CreateAnalysisArchiveRule - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param rule -@return AnalysisArchiveTransitionRule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateAnalysisArchiveRuleRequest */ -func (a *ArchivesApiService) CreateAnalysisArchiveRule(ctx _context.Context, rule AnalysisArchiveTransitionRule) (AnalysisArchiveTransitionRule, *_nethttp.Response, error) { +func (a *ArchivesApiService) CreateAnalysisArchiveRule(ctx context.Context) ApiCreateAnalysisArchiveRuleRequest { + return ApiCreateAnalysisArchiveRuleRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AnalysisArchiveTransitionRule +func (a *ArchivesApiService) CreateAnalysisArchiveRuleExecute(r ApiCreateAnalysisArchiveRuleRequest) (*AnalysisArchiveTransitionRule, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AnalysisArchiveTransitionRule + formFiles []formFile + localVarReturnValue *AnalysisArchiveTransitionRule ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/rules" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.CreateAnalysisArchiveRule") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/rules" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rule == nil { + return localVarReturnValue, nil, reportError("rule is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -154,25 +211,26 @@ func (a *ArchivesApiService) CreateAnalysisArchiveRule(ctx _context.Context, rul localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &rule - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.rule + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -190,7 +248,7 @@ func (a *ArchivesApiService) CreateAnalysisArchiveRule(ctx _context.Context, rul err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -200,29 +258,50 @@ func (a *ArchivesApiService) CreateAnalysisArchiveRule(ctx _context.Context, rul return localVarReturnValue, localVarHTTPResponse, nil } +type ApiDeleteAnalysisArchiveRuleRequest struct { + ctx context.Context + ApiService *ArchivesApiService + ruleId string +} + +func (r ApiDeleteAnalysisArchiveRuleRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteAnalysisArchiveRuleExecute(r) +} + /* DeleteAnalysisArchiveRule Method for DeleteAnalysisArchiveRule - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ruleId -@return AnalysisArchiveTransitionRule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ruleId + @return ApiDeleteAnalysisArchiveRuleRequest */ -func (a *ArchivesApiService) DeleteAnalysisArchiveRule(ctx _context.Context, ruleId string) (AnalysisArchiveTransitionRule, *_nethttp.Response, error) { +func (a *ArchivesApiService) DeleteAnalysisArchiveRule(ctx context.Context, ruleId string) ApiDeleteAnalysisArchiveRuleRequest { + return ApiDeleteAnalysisArchiveRuleRequest{ + ApiService: a, + ctx: ctx, + ruleId: ruleId, + } +} + +// Execute executes the request +func (a *ArchivesApiService) DeleteAnalysisArchiveRuleExecute(r ApiDeleteAnalysisArchiveRuleRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AnalysisArchiveTransitionRule + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/rules/{ruleId}" - localVarPath = strings.Replace(localVarPath, "{"+"ruleId"+"}", _neturl.QueryEscape(parameterToString(ruleId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.DeleteAnalysisArchiveRule") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/rules/{ruleId}" + localVarPath = strings.Replace(localVarPath, "{"+"ruleId"+"}", url.PathEscape(parameterToString(r.ruleId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -241,24 +320,25 @@ func (a *ArchivesApiService) DeleteAnalysisArchiveRule(ctx _context.Context, rul if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -267,59 +347,71 @@ func (a *ArchivesApiService) DeleteAnalysisArchiveRule(ctx _context.Context, rul err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } + return localVarHTTPResponse, nil +} - return localVarReturnValue, localVarHTTPResponse, nil +type ApiDeleteArchivedAnalysisRequest struct { + ctx context.Context + ApiService *ArchivesApiService + imageDigest string + force *bool +} + +func (r ApiDeleteArchivedAnalysisRequest) Force(force bool) ApiDeleteArchivedAnalysisRequest { + r.force = &force + return r } -// DeleteArchivedAnalysisOpts Optional parameters for the method 'DeleteArchivedAnalysis' -type DeleteArchivedAnalysisOpts struct { - Force optional.Bool +func (r ApiDeleteArchivedAnalysisRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteArchivedAnalysisExecute(r) } /* DeleteArchivedAnalysis Method for DeleteArchivedAnalysis + Performs a synchronous archive deletion - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *DeleteArchivedAnalysisOpts - Optional Parameters: - * @param "Force" (optional.Bool) - -@return ArchivedAnalysis + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiDeleteArchivedAnalysisRequest */ -func (a *ArchivesApiService) DeleteArchivedAnalysis(ctx _context.Context, imageDigest string, localVarOptionals *DeleteArchivedAnalysisOpts) (ArchivedAnalysis, *_nethttp.Response, error) { +func (a *ArchivesApiService) DeleteArchivedAnalysis(ctx context.Context, imageDigest string) ApiDeleteArchivedAnalysisRequest { + return ApiDeleteArchivedAnalysisRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +func (a *ArchivesApiService) DeleteArchivedAnalysisExecute(r ApiDeleteArchivedAnalysisRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ArchivedAnalysis + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/images/{imageDigest}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.DeleteArchivedAnalysis") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/images/{imageDigest}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Force.IsSet() { - localVarQueryParams.Add("force", parameterToString(localVarOptionals.Force.Value(), "")) + if r.force != nil { + localVarQueryParams.Add("force", parameterToString(*r.force, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -338,24 +430,25 @@ func (a *ArchivesApiService) DeleteArchivedAnalysis(ctx _context.Context, imageD if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -364,48 +457,62 @@ func (a *ArchivesApiService) DeleteArchivedAnalysis(ctx _context.Context, imageD err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } + return localVarHTTPResponse, nil +} - return localVarReturnValue, localVarHTTPResponse, nil +type ApiGetAnalysisArchiveRuleRequest struct { + ctx context.Context + ApiService *ArchivesApiService + ruleId string +} + +func (r ApiGetAnalysisArchiveRuleRequest) Execute() (*AnalysisArchiveTransitionRule, *http.Response, error) { + return r.ApiService.GetAnalysisArchiveRuleExecute(r) } /* GetAnalysisArchiveRule Method for GetAnalysisArchiveRule - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ruleId -@return AnalysisArchiveTransitionRule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ruleId + @return ApiGetAnalysisArchiveRuleRequest */ -func (a *ArchivesApiService) GetAnalysisArchiveRule(ctx _context.Context, ruleId string) (AnalysisArchiveTransitionRule, *_nethttp.Response, error) { +func (a *ArchivesApiService) GetAnalysisArchiveRule(ctx context.Context, ruleId string) ApiGetAnalysisArchiveRuleRequest { + return ApiGetAnalysisArchiveRuleRequest{ + ApiService: a, + ctx: ctx, + ruleId: ruleId, + } +} + +// Execute executes the request +// @return AnalysisArchiveTransitionRule +func (a *ArchivesApiService) GetAnalysisArchiveRuleExecute(r ApiGetAnalysisArchiveRuleRequest) (*AnalysisArchiveTransitionRule, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AnalysisArchiveTransitionRule + formFiles []formFile + localVarReturnValue *AnalysisArchiveTransitionRule ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/rules/{ruleId}" - localVarPath = strings.Replace(localVarPath, "{"+"ruleId"+"}", _neturl.QueryEscape(parameterToString(ruleId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.GetAnalysisArchiveRule") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/rules/{ruleId}" + localVarPath = strings.Replace(localVarPath, "{"+"ruleId"+"}", url.PathEscape(parameterToString(r.ruleId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -424,24 +531,25 @@ func (a *ArchivesApiService) GetAnalysisArchiveRule(ctx _context.Context, ruleId if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -459,7 +567,7 @@ func (a *ArchivesApiService) GetAnalysisArchiveRule(ctx _context.Context, ruleId err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -469,30 +577,54 @@ func (a *ArchivesApiService) GetAnalysisArchiveRule(ctx _context.Context, ruleId return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetArchivedAnalysisRequest struct { + ctx context.Context + ApiService *ArchivesApiService + imageDigest string +} + +func (r ApiGetArchivedAnalysisRequest) Execute() (*ArchivedAnalysis, *http.Response, error) { + return r.ApiService.GetArchivedAnalysisExecute(r) +} + /* GetArchivedAnalysis Method for GetArchivedAnalysis + Returns the archive metadata record identifying the image and tags for the analysis in the archive. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest The image digest to identify the image analysis -@return ArchivedAnalysis + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest The image digest to identify the image analysis + @return ApiGetArchivedAnalysisRequest */ -func (a *ArchivesApiService) GetArchivedAnalysis(ctx _context.Context, imageDigest string) (ArchivedAnalysis, *_nethttp.Response, error) { +func (a *ArchivesApiService) GetArchivedAnalysis(ctx context.Context, imageDigest string) ApiGetArchivedAnalysisRequest { + return ApiGetArchivedAnalysisRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return ArchivedAnalysis +func (a *ArchivesApiService) GetArchivedAnalysisExecute(r ApiGetArchivedAnalysisRequest) (*ArchivedAnalysis, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ArchivedAnalysis + formFiles []formFile + localVarReturnValue *ArchivedAnalysis ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/images/{imageDigest}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.GetArchivedAnalysis") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/images/{imageDigest}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -511,24 +643,25 @@ func (a *ArchivesApiService) GetArchivedAnalysis(ctx _context.Context, imageDige if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -546,7 +679,7 @@ func (a *ArchivesApiService) GetArchivedAnalysis(ctx _context.Context, imageDige err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -556,26 +689,48 @@ func (a *ArchivesApiService) GetArchivedAnalysis(ctx _context.Context, imageDige return localVarReturnValue, localVarHTTPResponse, nil } +type ApiListAnalysisArchiveRequest struct { + ctx context.Context + ApiService *ArchivesApiService +} + +func (r ApiListAnalysisArchiveRequest) Execute() ([]ArchivedAnalysis, *http.Response, error) { + return r.ApiService.ListAnalysisArchiveExecute(r) +} + /* ListAnalysisArchive Method for ListAnalysisArchive - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []ArchivedAnalysis + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListAnalysisArchiveRequest */ -func (a *ArchivesApiService) ListAnalysisArchive(ctx _context.Context) ([]ArchivedAnalysis, *_nethttp.Response, error) { +func (a *ArchivesApiService) ListAnalysisArchive(ctx context.Context) ApiListAnalysisArchiveRequest { + return ApiListAnalysisArchiveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []ArchivedAnalysis +func (a *ArchivesApiService) ListAnalysisArchiveExecute(r ApiListAnalysisArchiveRequest) ([]ArchivedAnalysis, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []ArchivedAnalysis ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/images" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.ListAnalysisArchive") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/images" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -594,24 +749,25 @@ func (a *ArchivesApiService) ListAnalysisArchive(ctx _context.Context) ([]Archiv if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -629,7 +785,7 @@ func (a *ArchivesApiService) ListAnalysisArchive(ctx _context.Context) ([]Archiv err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -639,36 +795,58 @@ func (a *ArchivesApiService) ListAnalysisArchive(ctx _context.Context) ([]Archiv return localVarReturnValue, localVarHTTPResponse, nil } -// ListAnalysisArchiveRulesOpts Optional parameters for the method 'ListAnalysisArchiveRules' -type ListAnalysisArchiveRulesOpts struct { - SystemGlobal optional.Bool +type ApiListAnalysisArchiveRulesRequest struct { + ctx context.Context + ApiService *ArchivesApiService + systemGlobal *bool +} + +// If true include system global rules (owned by admin) even for non-admin users. Defaults to true if not set. Can be set to false to exclude globals +func (r ApiListAnalysisArchiveRulesRequest) SystemGlobal(systemGlobal bool) ApiListAnalysisArchiveRulesRequest { + r.systemGlobal = &systemGlobal + return r +} + +func (r ApiListAnalysisArchiveRulesRequest) Execute() ([]AnalysisArchiveTransitionRule, *http.Response, error) { + return r.ApiService.ListAnalysisArchiveRulesExecute(r) } /* ListAnalysisArchiveRules Method for ListAnalysisArchiveRules - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListAnalysisArchiveRulesOpts - Optional Parameters: - * @param "SystemGlobal" (optional.Bool) - If true include system global rules (owned by admin) even for non-admin users. Defaults to true if not set. Can be set to false to exclude globals -@return []AnalysisArchiveTransitionRule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListAnalysisArchiveRulesRequest */ -func (a *ArchivesApiService) ListAnalysisArchiveRules(ctx _context.Context, localVarOptionals *ListAnalysisArchiveRulesOpts) ([]AnalysisArchiveTransitionRule, *_nethttp.Response, error) { +func (a *ArchivesApiService) ListAnalysisArchiveRules(ctx context.Context) ApiListAnalysisArchiveRulesRequest { + return ApiListAnalysisArchiveRulesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnalysisArchiveTransitionRule +func (a *ArchivesApiService) ListAnalysisArchiveRulesExecute(r ApiListAnalysisArchiveRulesRequest) ([]AnalysisArchiveTransitionRule, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnalysisArchiveTransitionRule ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives/rules" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.ListAnalysisArchiveRules") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives/rules" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.SystemGlobal.IsSet() { - localVarQueryParams.Add("system_global", parameterToString(localVarOptionals.SystemGlobal.Value(), "")) + if r.systemGlobal != nil { + localVarQueryParams.Add("system_global", parameterToString(*r.systemGlobal, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -687,24 +865,25 @@ func (a *ArchivesApiService) ListAnalysisArchiveRules(ctx _context.Context, loca if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -722,7 +901,7 @@ func (a *ArchivesApiService) ListAnalysisArchiveRules(ctx _context.Context, loca err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -732,26 +911,48 @@ func (a *ArchivesApiService) ListAnalysisArchiveRules(ctx _context.Context, loca return localVarReturnValue, localVarHTTPResponse, nil } +type ApiListArchivesRequest struct { + ctx context.Context + ApiService *ArchivesApiService +} + +func (r ApiListArchivesRequest) Execute() (*ArchiveSummary, *http.Response, error) { + return r.ApiService.ListArchivesExecute(r) +} + /* ListArchives Method for ListArchives - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return ArchiveSummary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListArchivesRequest */ -func (a *ArchivesApiService) ListArchives(ctx _context.Context) (ArchiveSummary, *_nethttp.Response, error) { +func (a *ArchivesApiService) ListArchives(ctx context.Context) ApiListArchivesRequest { + return ApiListArchivesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ArchiveSummary +func (a *ArchivesApiService) ListArchivesExecute(r ApiListArchivesRequest) (*ArchiveSummary, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ArchiveSummary + formFiles []formFile + localVarReturnValue *ArchiveSummary ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/archives" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArchivesApiService.ListArchives") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/archives" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -770,24 +971,25 @@ func (a *ArchivesApiService) ListArchives(ctx _context.Context) (ArchiveSummary, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -805,7 +1007,7 @@ func (a *ArchivesApiService) ListArchives(ctx _context.Context) (ArchiveSummary, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_default.go b/.gen/anchore/api_default.go index fa63e83535..1c5abed561 100644 --- a/.gen/anchore/api_default.go +++ b/.gen/anchore/api_default.go @@ -1,56 +1,104 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "github.com/antihax/optional" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" ) -// Linger please -var ( - _ _context.Context -) // DefaultApiService DefaultApi service type DefaultApiService service +type ApiGetOauthTokenRequest struct { + ctx context.Context + ApiService *DefaultApiService + grantType *string + username *string + password *string + clientId *string +} + +// OAuth Grant type for token +func (r ApiGetOauthTokenRequest) GrantType(grantType string) ApiGetOauthTokenRequest { + r.grantType = &grantType + return r +} + +// User to assign OAuth token to +func (r ApiGetOauthTokenRequest) Username(username string) ApiGetOauthTokenRequest { + r.username = &username + return r +} + +// Password for corresponding user +func (r ApiGetOauthTokenRequest) Password(password string) ApiGetOauthTokenRequest { + r.password = &password + return r +} + +// The type of client used for the OAuth token +func (r ApiGetOauthTokenRequest) ClientId(clientId string) ApiGetOauthTokenRequest { + r.clientId = &clientId + return r +} + +func (r ApiGetOauthTokenRequest) Execute() (*TokenResponse, *http.Response, error) { + return r.ApiService.GetOauthTokenExecute(r) +} + /* GetOauthToken Method for GetOauthToken + Request a jwt token for subsequent operations, this request is authenticated with normal HTTP auth - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return TokenResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOauthTokenRequest */ -func (a *DefaultApiService) GetOauthToken(ctx _context.Context) (TokenResponse, *_nethttp.Response, error) { +func (a *DefaultApiService) GetOauthToken(ctx context.Context) ApiGetOauthTokenRequest { + return ApiGetOauthTokenRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TokenResponse +func (a *DefaultApiService) GetOauthTokenExecute(r ApiGetOauthTokenRequest) (*TokenResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TokenResponse + formFiles []formFile + localVarReturnValue *TokenResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/oauth/token" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOauthToken") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth/token" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -66,24 +114,37 @@ func (a *DefaultApiService) GetOauthToken(ctx _context.Context) (TokenResponse, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if r.grantType != nil { + localVarFormParams.Add("grant_type", parameterToString(*r.grantType, "")) + } + if r.username != nil { + localVarFormParams.Add("username", parameterToString(*r.username, "")) + } + if r.password != nil { + localVarFormParams.Add("password", parameterToString(*r.password, "")) + } + if r.clientId != nil { + localVarFormParams.Add("client_id", parameterToString(*r.clientId, "")) + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -101,7 +162,7 @@ func (a *DefaultApiService) GetOauthToken(ctx _context.Context) (TokenResponse, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -111,25 +172,48 @@ func (a *DefaultApiService) GetOauthToken(ctx _context.Context) (TokenResponse, return localVarReturnValue, localVarHTTPResponse, nil } +type ApiHealthCheckRequest struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiHealthCheckRequest) Execute() (*http.Response, error) { + return r.ApiService.HealthCheckExecute(r) +} + /* -HealthNoop Method for HealthNoop +HealthCheck Method for HealthCheck + Health check, returns 200 and no body if service is running - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHealthCheckRequest */ -func (a *DefaultApiService) HealthNoop(ctx _context.Context) (*_nethttp.Response, error) { +func (a *DefaultApiService) HealthCheck(ctx context.Context) ApiHealthCheckRequest { + return ApiHealthCheckRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) HealthCheckExecute(r ApiHealthCheckRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/health" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HealthCheck") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/health" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -148,24 +232,25 @@ func (a *DefaultApiService) HealthNoop(ctx _context.Context) (*_nethttp.Response if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -175,27 +260,52 @@ func (a *DefaultApiService) HealthNoop(ctx _context.Context) (*_nethttp.Response return localVarHTTPResponse, nil } +type ApiListFileContentSearchResultsRequest struct { + ctx context.Context + ApiService *DefaultApiService + imageDigest string +} + +func (r ApiListFileContentSearchResultsRequest) Execute() ([]FileContentSearchResult, *http.Response, error) { + return r.ApiService.ListFileContentSearchResultsExecute(r) +} + /* -Ping Method for Ping -Simple status check - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return string +ListFileContentSearchResults Return a list of analyzer artifacts of the specified type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiListFileContentSearchResultsRequest */ -func (a *DefaultApiService) Ping(ctx _context.Context) (string, *_nethttp.Response, error) { +func (a *DefaultApiService) ListFileContentSearchResults(ctx context.Context, imageDigest string) ApiListFileContentSearchResultsRequest { + return ApiListFileContentSearchResultsRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []FileContentSearchResult +func (a *DefaultApiService) ListFileContentSearchResultsExecute(r ApiListFileContentSearchResultsRequest) ([]FileContentSearchResult, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string + formFiles []formFile + localVarReturnValue []FileContentSearchResult ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListFileContentSearchResults") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/artifacts/file_content_search" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -214,24 +324,25 @@ func (a *DefaultApiService) Ping(ctx _context.Context) (string, *_nethttp.Respon if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -240,7 +351,7 @@ func (a *DefaultApiService) Ping(ctx _context.Context) (string, *_nethttp.Respon err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -250,57 +361,154 @@ func (a *DefaultApiService) Ping(ctx _context.Context) (string, *_nethttp.Respon return localVarReturnValue, localVarHTTPResponse, nil } -// QueryImagesByPackageOpts Optional parameters for the method 'QueryImagesByPackage' -type QueryImagesByPackageOpts struct { - PackageType optional.String - Version optional.String - Page optional.String - Limit optional.Int32 - XAnchoreAccount optional.String +type ApiListRetrievedFilesRequest struct { + ctx context.Context + ApiService *DefaultApiService + imageDigest string +} + +func (r ApiListRetrievedFilesRequest) Execute() ([]RetrievedFile, *http.Response, error) { + return r.ApiService.ListRetrievedFilesExecute(r) } /* -QueryImagesByPackage List of images containing given package -Filterable query interface to search for images containing specified package - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param name Name of package to search for (e.g. sed) - * @param optional nil or *QueryImagesByPackageOpts - Optional Parameters: - * @param "PackageType" (optional.String) - Type of package to filter on (e.g. dpkg) - * @param "Version" (optional.String) - Version of named package to filter on (e.g. 4.4-1) - * @param "Page" (optional.String) - The page of results to fetch. Pages start at 1 - * @param "Limit" (optional.Int32) - Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return PaginatedImageList +ListRetrievedFiles Return a list of analyzer artifacts of the specified type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiListRetrievedFilesRequest */ -func (a *DefaultApiService) QueryImagesByPackage(ctx _context.Context, name string, localVarOptionals *QueryImagesByPackageOpts) (PaginatedImageList, *_nethttp.Response, error) { +func (a *DefaultApiService) ListRetrievedFiles(ctx context.Context, imageDigest string) ApiListRetrievedFilesRequest { + return ApiListRetrievedFilesRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []RetrievedFile +func (a *DefaultApiService) ListRetrievedFilesExecute(r ApiListRetrievedFilesRequest) ([]RetrievedFile, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PaginatedImageList + formFiles []formFile + localVarReturnValue []RetrievedFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/query/images/by_package" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRetrievedFiles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/artifacts/retrieved_files" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } - localVarQueryParams.Add("name", parameterToString(name, "")) - if localVarOptionals != nil && localVarOptionals.PackageType.IsSet() { - localVarQueryParams.Add("package_type", parameterToString(localVarOptionals.PackageType.Value(), "")) + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarOptionals != nil && localVarOptionals.Version.IsSet() { - localVarQueryParams.Add("version", parameterToString(localVarOptionals.Version.Value(), "")) + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarOptionals != nil && localVarOptionals.Page.IsSet() { - localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListSecretSearchResultsRequest struct { + ctx context.Context + ApiService *DefaultApiService + imageDigest string +} + +func (r ApiListSecretSearchResultsRequest) Execute() ([]SecretSearchResult, *http.Response, error) { + return r.ApiService.ListSecretSearchResultsExecute(r) +} + +/* +ListSecretSearchResults Return a list of analyzer artifacts of the specified type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiListSecretSearchResultsRequest +*/ +func (a *DefaultApiService) ListSecretSearchResults(ctx context.Context, imageDigest string) ApiListSecretSearchResultsRequest { + return ApiListSecretSearchResultsRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, } - if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { - localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) +} + +// Execute executes the request +// @return []SecretSearchResult +func (a *DefaultApiService) ListSecretSearchResultsExecute(r ApiListSecretSearchResultsRequest) ([]SecretSearchResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SecretSearchResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecretSearchResults") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } + + localVarPath := localBasePath + "/images/{imageDigest}/artifacts/secret_search" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -318,45 +526,133 @@ func (a *DefaultApiService) QueryImagesByPackage(ctx _context.Context, name stri if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPingRequest struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiPingRequest) Execute() (string, *http.Response, error) { + return r.ApiService.PingExecute(r) +} + +/* +Ping Method for Ping + +Simple status check + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPingRequest +*/ +func (a *DefaultApiService) Ping(ctx context.Context) ApiPingRequest { + return ApiPingRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) PingExecute(r ApiPingRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Ping") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/" + + 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -366,27 +662,50 @@ func (a *DefaultApiService) QueryImagesByPackage(ctx _context.Context, name stri return localVarReturnValue, localVarHTTPResponse, nil } +type ApiVersionCheckRequest struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiVersionCheckRequest) Execute() (*ServiceVersion, *http.Response, error) { + return r.ApiService.VersionCheckExecute(r) +} + /* -VersionNoop Method for VersionNoop +VersionCheck Method for VersionCheck + Returns the version object for the service, including db schema version info - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return ServiceVersion + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVersionCheckRequest */ -func (a *DefaultApiService) VersionNoop(ctx _context.Context) (ServiceVersion, *_nethttp.Response, error) { +func (a *DefaultApiService) VersionCheck(ctx context.Context) ApiVersionCheckRequest { + return ApiVersionCheckRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ServiceVersion +func (a *DefaultApiService) VersionCheckExecute(r ApiVersionCheckRequest) (*ServiceVersion, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ServiceVersion + formFiles []formFile + localVarReturnValue *ServiceVersion ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/version" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.VersionCheck") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/version" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -405,24 +724,25 @@ func (a *DefaultApiService) VersionNoop(ctx _context.Context) (ServiceVersion, * if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -431,7 +751,7 @@ func (a *DefaultApiService) VersionNoop(ctx _context.Context) (ServiceVersion, * err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_events.go b/.gen/anchore/api_events.go index 6fc2e1ea9b..3bf5414be7 100644 --- a/.gen/anchore/api_events.go +++ b/.gen/anchore/api_events.go @@ -1,62 +1,82 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // EventsApiService EventsApi service type EventsApiService service -// DeleteEventOpts Optional parameters for the method 'DeleteEvent' -type DeleteEventOpts struct { - XAnchoreAccount optional.String +type ApiDeleteEventRequest struct { + ctx context.Context + ApiService *EventsApiService + eventId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteEventRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteEventRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteEventRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteEventExecute(r) } /* DeleteEvent Delete Event + Delete an event by its event ID - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param eventId Event ID of the event to be deleted - * @param optional nil or *DeleteEventOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventId Event ID of the event to be deleted + @return ApiDeleteEventRequest */ -func (a *EventsApiService) DeleteEvent(ctx _context.Context, eventId string, localVarOptionals *DeleteEventOpts) (*_nethttp.Response, error) { +func (a *EventsApiService) DeleteEvent(ctx context.Context, eventId string) ApiDeleteEventRequest { + return ApiDeleteEventRequest{ + ApiService: a, + ctx: ctx, + eventId: eventId, + } +} + +// Execute executes the request +func (a *EventsApiService) DeleteEventExecute(r ApiDeleteEventRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/events/{eventId}" - localVarPath = strings.Replace(localVarPath, "{"+"eventId"+"}", _neturl.QueryEscape(parameterToString(eventId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.DeleteEvent") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/{eventId}" + localVarPath = strings.Replace(localVarPath, "{"+"eventId"+"}", url.PathEscape(parameterToString(r.eventId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -75,27 +95,28 @@ func (a *EventsApiService) DeleteEvent(ctx _context.Context, eventId string, loc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -105,49 +126,87 @@ func (a *EventsApiService) DeleteEvent(ctx _context.Context, eventId string, loc return localVarHTTPResponse, nil } -// DeleteEventsOpts Optional parameters for the method 'DeleteEvents' -type DeleteEventsOpts struct { - Before optional.String - Since optional.String - Level optional.String - XAnchoreAccount optional.String +type ApiDeleteEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + before *string + since *string + level *string + xAnchoreAccount *string +} + +// Delete events that occurred before the timestamp +func (r ApiDeleteEventsRequest) Before(before string) ApiDeleteEventsRequest { + r.before = &before + return r +} + +// Delete events that occurred after the timestamp +func (r ApiDeleteEventsRequest) Since(since string) ApiDeleteEventsRequest { + r.since = &since + return r +} + +// Delete events that match the level - INFO or ERROR +func (r ApiDeleteEventsRequest) Level(level string) ApiDeleteEventsRequest { + r.level = &level + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteEventsRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteEventsRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteEventsRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.DeleteEventsExecute(r) } /* DeleteEvents Delete Events + Delete all or a subset of events filtered using the optional query parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *DeleteEventsOpts - Optional Parameters: - * @param "Before" (optional.String) - Delete events that occurred before the timestamp - * @param "Since" (optional.String) - Delete events that occurred after the timestamp - * @param "Level" (optional.String) - Delete events that match the level - INFO or ERROR - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteEventsRequest */ -func (a *EventsApiService) DeleteEvents(ctx _context.Context, localVarOptionals *DeleteEventsOpts) ([]string, *_nethttp.Response, error) { +func (a *EventsApiService) DeleteEvents(ctx context.Context) ApiDeleteEventsRequest { + return ApiDeleteEventsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []string +func (a *EventsApiService) DeleteEventsExecute(r ApiDeleteEventsRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/events" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.DeleteEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Before.IsSet() { - localVarQueryParams.Add("before", parameterToString(localVarOptionals.Before.Value(), "")) + if r.before != nil { + localVarQueryParams.Add("before", parameterToString(*r.before, "")) } - if localVarOptionals != nil && localVarOptionals.Since.IsSet() { - localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + if r.since != nil { + localVarQueryParams.Add("since", parameterToString(*r.since, "")) } - if localVarOptionals != nil && localVarOptionals.Level.IsSet() { - localVarQueryParams.Add("level", parameterToString(localVarOptionals.Level.Value(), "")) + if r.level != nil { + localVarQueryParams.Add("level", parameterToString(*r.level, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -166,27 +225,28 @@ func (a *EventsApiService) DeleteEvents(ctx _context.Context, localVarOptionals if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -204,7 +264,7 @@ func (a *EventsApiService) DeleteEvents(ctx _context.Context, localVarOptionals err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -214,37 +274,61 @@ func (a *EventsApiService) DeleteEvents(ctx _context.Context, localVarOptionals return localVarReturnValue, localVarHTTPResponse, nil } -// GetEventOpts Optional parameters for the method 'GetEvent' -type GetEventOpts struct { - XAnchoreAccount optional.String +type ApiGetEventRequest struct { + ctx context.Context + ApiService *EventsApiService + eventId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetEventRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetEventRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetEventRequest) Execute() (*EventResponse, *http.Response, error) { + return r.ApiService.GetEventExecute(r) } /* GetEvent Get Event + Lookup an event by its event ID - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param eventId Event ID of the event for lookup - * @param optional nil or *GetEventOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return EventResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventId Event ID of the event for lookup + @return ApiGetEventRequest */ -func (a *EventsApiService) GetEvent(ctx _context.Context, eventId string, localVarOptionals *GetEventOpts) (EventResponse, *_nethttp.Response, error) { +func (a *EventsApiService) GetEvent(ctx context.Context, eventId string) ApiGetEventRequest { + return ApiGetEventRequest{ + ApiService: a, + ctx: ctx, + eventId: eventId, + } +} + +// Execute executes the request +// @return EventResponse +func (a *EventsApiService) GetEventExecute(r ApiGetEventRequest) (*EventResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventResponse + formFiles []formFile + localVarReturnValue *EventResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/events/{eventId}" - localVarPath = strings.Replace(localVarPath, "{"+"eventId"+"}", _neturl.QueryEscape(parameterToString(eventId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.GetEvent") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/{eventId}" + localVarPath = strings.Replace(localVarPath, "{"+"eventId"+"}", url.PathEscape(parameterToString(r.eventId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -263,27 +347,127 @@ func (a *EventsApiService) GetEvent(ctx _context.Context, eventId string, localV if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListEventTypesRequest struct { + ctx context.Context + ApiService *EventsApiService +} + +func (r ApiListEventTypesRequest) Execute() ([]EventCategory, *http.Response, error) { + return r.ApiService.ListEventTypesExecute(r) +} + +/* +ListEventTypes List Event Types + +Returns list of event types in the category hierarchy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListEventTypesRequest +*/ +func (a *EventsApiService) ListEventTypes(ctx context.Context) ApiListEventTypesRequest { + return ApiListEventTypesRequest{ + ApiService: a, + ctx: ctx, } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) +} + +// Execute executes the request +// @return []EventCategory +func (a *EventsApiService) ListEventTypesExecute(r ApiListEventTypesRequest) ([]EventCategory, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []EventCategory + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.ListEventTypes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/event_types" + + 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -292,7 +476,7 @@ func (a *EventsApiService) GetEvent(ctx _context.Context, eventId string, localV err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -302,79 +486,157 @@ func (a *EventsApiService) GetEvent(ctx _context.Context, eventId string, localV return localVarReturnValue, localVarHTTPResponse, nil } -// ListEventsOpts Optional parameters for the method 'ListEvents' -type ListEventsOpts struct { - SourceServicename optional.String - SourceHostid optional.String - ResourceType optional.String - ResourceId optional.String - Level optional.String - Since optional.String - Before optional.String - Page optional.Int32 - Limit optional.Int32 - XAnchoreAccount optional.String +type ApiListEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + sourceServicename *string + sourceHostid *string + eventType *string + resourceType *string + resourceId *string + level *string + since *string + before *string + page *int32 + limit *int32 + xAnchoreAccount *string +} + +// Filter events by the originating service +func (r ApiListEventsRequest) SourceServicename(sourceServicename string) ApiListEventsRequest { + r.sourceServicename = &sourceServicename + return r +} + +// Filter events by the originating host ID +func (r ApiListEventsRequest) SourceHostid(sourceHostid string) ApiListEventsRequest { + r.sourceHostid = &sourceHostid + return r +} + +// Filter events by a prefix match on the event type (e.g. \"user.image.\") +func (r ApiListEventsRequest) EventType(eventType string) ApiListEventsRequest { + r.eventType = &eventType + return r +} + +// Filter events by the type of resource - tag, imageDigest, repository etc +func (r ApiListEventsRequest) ResourceType(resourceType string) ApiListEventsRequest { + r.resourceType = &resourceType + return r +} + +// Filter events by the id of the resource +func (r ApiListEventsRequest) ResourceId(resourceId string) ApiListEventsRequest { + r.resourceId = &resourceId + return r +} + +// Filter events by the level - INFO or ERROR +func (r ApiListEventsRequest) Level(level string) ApiListEventsRequest { + r.level = &level + return r +} + +// Return events that occurred after the timestamp +func (r ApiListEventsRequest) Since(since string) ApiListEventsRequest { + r.since = &since + return r +} + +// Return events that occurred before the timestamp +func (r ApiListEventsRequest) Before(before string) ApiListEventsRequest { + r.before = &before + return r +} + +// Pagination controls - return the nth page of results. Defaults to first page if left empty +func (r ApiListEventsRequest) Page(page int32) ApiListEventsRequest { + r.page = &page + return r +} + +// Number of events in the result set. Defaults to 100 if left empty +func (r ApiListEventsRequest) Limit(limit int32) ApiListEventsRequest { + r.limit = &limit + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListEventsRequest) XAnchoreAccount(xAnchoreAccount string) ApiListEventsRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListEventsRequest) Execute() (*EventsList, *http.Response, error) { + return r.ApiService.ListEventsExecute(r) } /* ListEvents List Events + Returns a paginated list of events in the descending order of their occurrence. Optional query parameters may be used for filtering results - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListEventsOpts - Optional Parameters: - * @param "SourceServicename" (optional.String) - Filter events by the originating service - * @param "SourceHostid" (optional.String) - Filter events by the originating host ID - * @param "ResourceType" (optional.String) - Filter events by the type of resource - tag, imageDigest, repository etc - * @param "ResourceId" (optional.String) - Filter events by the id of the resource - * @param "Level" (optional.String) - Filter events by the level - INFO or ERROR - * @param "Since" (optional.String) - Return events that occurred after the timestamp - * @param "Before" (optional.String) - Return events that occurred before the timestamp - * @param "Page" (optional.Int32) - Pagination controls - return the nth page of results. Defaults to first page if left empty - * @param "Limit" (optional.Int32) - Number of events in the result set. Defaults to 100 if left empty - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return EventsList + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListEventsRequest */ -func (a *EventsApiService) ListEvents(ctx _context.Context, localVarOptionals *ListEventsOpts) (EventsList, *_nethttp.Response, error) { +func (a *EventsApiService) ListEvents(ctx context.Context) ApiListEventsRequest { + return ApiListEventsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return EventsList +func (a *EventsApiService) ListEventsExecute(r ApiListEventsRequest) (*EventsList, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventsList + formFiles []formFile + localVarReturnValue *EventsList ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/events" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.ListEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.SourceServicename.IsSet() { - localVarQueryParams.Add("source_servicename", parameterToString(localVarOptionals.SourceServicename.Value(), "")) + if r.sourceServicename != nil { + localVarQueryParams.Add("source_servicename", parameterToString(*r.sourceServicename, "")) + } + if r.sourceHostid != nil { + localVarQueryParams.Add("source_hostid", parameterToString(*r.sourceHostid, "")) } - if localVarOptionals != nil && localVarOptionals.SourceHostid.IsSet() { - localVarQueryParams.Add("source_hostid", parameterToString(localVarOptionals.SourceHostid.Value(), "")) + if r.eventType != nil { + localVarQueryParams.Add("event_type", parameterToString(*r.eventType, "")) } - if localVarOptionals != nil && localVarOptionals.ResourceType.IsSet() { - localVarQueryParams.Add("resource_type", parameterToString(localVarOptionals.ResourceType.Value(), "")) + if r.resourceType != nil { + localVarQueryParams.Add("resource_type", parameterToString(*r.resourceType, "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resource_id", parameterToString(localVarOptionals.ResourceId.Value(), "")) + if r.resourceId != nil { + localVarQueryParams.Add("resource_id", parameterToString(*r.resourceId, "")) } - if localVarOptionals != nil && localVarOptionals.Level.IsSet() { - localVarQueryParams.Add("level", parameterToString(localVarOptionals.Level.Value(), "")) + if r.level != nil { + localVarQueryParams.Add("level", parameterToString(*r.level, "")) } - if localVarOptionals != nil && localVarOptionals.Since.IsSet() { - localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + if r.since != nil { + localVarQueryParams.Add("since", parameterToString(*r.since, "")) } - if localVarOptionals != nil && localVarOptionals.Before.IsSet() { - localVarQueryParams.Add("before", parameterToString(localVarOptionals.Before.Value(), "")) + if r.before != nil { + localVarQueryParams.Add("before", parameterToString(*r.before, "")) } - if localVarOptionals != nil && localVarOptionals.Page.IsSet() { - localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) } - if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { - localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -393,27 +655,28 @@ func (a *EventsApiService) ListEvents(ctx _context.Context, localVarOptionals *L if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -422,7 +685,7 @@ func (a *EventsApiService) ListEvents(ctx _context.Context, localVarOptionals *L err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_identity.go b/.gen/anchore/api_identity.go index 8c41faab6a..be97def9c6 100644 --- a/.gen/anchore/api_identity.go +++ b/.gen/anchore/api_identity.go @@ -1,52 +1,79 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // IdentityApiService IdentityApi service type IdentityApiService service +type ApiAddCredentialRequest struct { + ctx context.Context + ApiService *IdentityApiService + credential *AccessCredential +} + +func (r ApiAddCredentialRequest) Credential(credential AccessCredential) ApiAddCredentialRequest { + r.credential = &credential + return r +} + +func (r ApiAddCredentialRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.AddCredentialExecute(r) +} + /* AddCredential add/replace credential - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param credential -@return User + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddCredentialRequest */ -func (a *IdentityApiService) AddCredential(ctx _context.Context, credential AccessCredential) (User, *_nethttp.Response, error) { +func (a *IdentityApiService) AddCredential(ctx context.Context) ApiAddCredentialRequest { + return ApiAddCredentialRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return User +func (a *IdentityApiService) AddCredentialExecute(r ApiAddCredentialRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User + formFiles []formFile + localVarReturnValue *User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/credentials" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IdentityApiService.AddCredential") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/credentials" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.credential == nil { + return localVarReturnValue, nil, reportError("credential is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -66,25 +93,26 @@ func (a *IdentityApiService) AddCredential(ctx _context.Context, credential Acce localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &credential - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.credential + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -102,7 +130,7 @@ func (a *IdentityApiService) AddCredential(ctx _context.Context, credential Acce err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -112,26 +140,48 @@ func (a *IdentityApiService) AddCredential(ctx _context.Context, credential Acce return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService *IdentityApiService +} + +func (r ApiGetCredentialsRequest) Execute() ([]AccessCredential, *http.Response, error) { + return r.ApiService.GetCredentialsExecute(r) +} + /* GetCredentials Get current credential summary - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []AccessCredential + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetCredentialsRequest */ -func (a *IdentityApiService) GetCredentials(ctx _context.Context) ([]AccessCredential, *_nethttp.Response, error) { +func (a *IdentityApiService) GetCredentials(ctx context.Context) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AccessCredential +func (a *IdentityApiService) GetCredentialsExecute(r ApiGetCredentialsRequest) ([]AccessCredential, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AccessCredential ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/credentials" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IdentityApiService.GetCredentials") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/credentials" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -150,24 +200,25 @@ func (a *IdentityApiService) GetCredentials(ctx _context.Context) ([]AccessCrede if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -185,7 +236,7 @@ func (a *IdentityApiService) GetCredentials(ctx _context.Context) ([]AccessCrede err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -195,26 +246,48 @@ func (a *IdentityApiService) GetCredentials(ctx _context.Context) ([]AccessCrede return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetUserRequest struct { + ctx context.Context + ApiService *IdentityApiService +} + +func (r ApiGetUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.GetUserExecute(r) +} + /* GetUser List authenticated user info - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return User + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetUserRequest */ -func (a *IdentityApiService) GetUser(ctx _context.Context) (User, *_nethttp.Response, error) { +func (a *IdentityApiService) GetUser(ctx context.Context) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return User +func (a *IdentityApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User + formFiles []formFile + localVarReturnValue *User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IdentityApiService.GetUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -233,24 +306,25 @@ func (a *IdentityApiService) GetUser(ctx _context.Context) (User, *_nethttp.Resp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -268,7 +342,7 @@ func (a *IdentityApiService) GetUser(ctx _context.Context) (User, *_nethttp.Resp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -278,26 +352,48 @@ func (a *IdentityApiService) GetUser(ctx _context.Context) (User, *_nethttp.Resp return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetUsersAccountRequest struct { + ctx context.Context + ApiService *IdentityApiService +} + +func (r ApiGetUsersAccountRequest) Execute() (*Account, *http.Response, error) { + return r.ApiService.GetUsersAccountExecute(r) +} + /* GetUsersAccount List the account for the authenticated user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return Account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetUsersAccountRequest */ -func (a *IdentityApiService) GetUsersAccount(ctx _context.Context) (Account, *_nethttp.Response, error) { +func (a *IdentityApiService) GetUsersAccount(ctx context.Context) ApiGetUsersAccountRequest { + return ApiGetUsersAccountRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Account +func (a *IdentityApiService) GetUsersAccountExecute(r ApiGetUsersAccountRequest) (*Account, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Account + formFiles []formFile + localVarReturnValue *Account ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/account" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IdentityApiService.GetUsersAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/account" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -316,24 +412,25 @@ func (a *IdentityApiService) GetUsersAccount(ctx _context.Context) (Account, *_n if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -351,7 +448,7 @@ func (a *IdentityApiService) GetUsersAccount(ctx _context.Context) (Account, *_n err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_images.go b/.gen/anchore/api_images.go index c700683ce0..fe8511b384 100644 --- a/.gen/anchore/api_images.go +++ b/.gen/anchore/api_images.go @@ -1,72 +1,109 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // ImagesApiService ImagesApi service type ImagesApiService service -// AddImageOpts Optional parameters for the method 'AddImage' -type AddImageOpts struct { - Force optional.Bool - Autosubscribe optional.Bool - XAnchoreAccount optional.String +type ApiAddImageRequest struct { + ctx context.Context + ApiService *ImagesApiService + image *ImageAnalysisRequest + force *bool + autosubscribe *bool + xAnchoreAccount *string +} + +func (r ApiAddImageRequest) Image(image ImageAnalysisRequest) ApiAddImageRequest { + r.image = &image + return r +} + +// Override any existing entry in the system +func (r ApiAddImageRequest) Force(force bool) ApiAddImageRequest { + r.force = &force + return r +} + +// Instruct engine to automatically begin watching the added tag for updates from registry +func (r ApiAddImageRequest) Autosubscribe(autosubscribe bool) ApiAddImageRequest { + r.autosubscribe = &autosubscribe + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiAddImageRequest) XAnchoreAccount(xAnchoreAccount string) ApiAddImageRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiAddImageRequest) Execute() ([]AnchoreImage, *http.Response, error) { + return r.ApiService.AddImageExecute(r) } /* AddImage Submit a new image for analysis by the engine + Creates a new analysis task that is executed asynchronously - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param image - * @param optional nil or *AddImageOpts - Optional Parameters: - * @param "Force" (optional.Bool) - Override any existing entry in the system - * @param "Autosubscribe" (optional.Bool) - Instruct engine to automatically begin watching the added tag for updates from registry - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []AnchoreImage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddImageRequest */ -func (a *ImagesApiService) AddImage(ctx _context.Context, image ImageAnalysisRequest, localVarOptionals *AddImageOpts) ([]AnchoreImage, *_nethttp.Response, error) { +func (a *ImagesApiService) AddImage(ctx context.Context) ApiAddImageRequest { + return ApiAddImageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnchoreImage +func (a *ImagesApiService) AddImageExecute(r ApiAddImageRequest) ([]AnchoreImage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreImage ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.AddImage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.image == nil { + return localVarReturnValue, nil, reportError("image is required and must be specified") + } - if localVarOptionals != nil && localVarOptionals.Force.IsSet() { - localVarQueryParams.Add("force", parameterToString(localVarOptionals.Force.Value(), "")) + if r.force != nil { + localVarQueryParams.Add("force", parameterToString(*r.force, "")) } - if localVarOptionals != nil && localVarOptionals.Autosubscribe.IsSet() { - localVarQueryParams.Add("autosubscribe", parameterToString(localVarOptionals.Autosubscribe.Value(), "")) + if r.autosubscribe != nil { + localVarQueryParams.Add("autosubscribe", parameterToString(*r.autosubscribe, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -85,29 +122,30 @@ func (a *ImagesApiService) AddImage(ctx _context.Context, image ImageAnalysisReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = &image - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.image + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -125,7 +163,7 @@ func (a *ImagesApiService) AddImage(ctx _context.Context, image ImageAnalysisReq err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -135,39 +173,68 @@ func (a *ImagesApiService) AddImage(ctx _context.Context, image ImageAnalysisReq return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteImageOpts Optional parameters for the method 'DeleteImage' -type DeleteImageOpts struct { - Force optional.Bool - XAnchoreAccount optional.String +type ApiDeleteImageRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + force *bool + xAnchoreAccount *string +} + +func (r ApiDeleteImageRequest) Force(force bool) ApiDeleteImageRequest { + r.force = &force + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteImageRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteImageRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteImageRequest) Execute() (*DeleteImageResponse, *http.Response, error) { + return r.ApiService.DeleteImageExecute(r) } /* DeleteImage Delete an image analysis - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *DeleteImageOpts - Optional Parameters: - * @param "Force" (optional.Bool) - - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiDeleteImageRequest */ -func (a *ImagesApiService) DeleteImage(ctx _context.Context, imageDigest string, localVarOptionals *DeleteImageOpts) (*_nethttp.Response, error) { +func (a *ImagesApiService) DeleteImage(ctx context.Context, imageDigest string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return DeleteImageResponse +func (a *ImagesApiService) DeleteImageExecute(r ApiDeleteImageRequest) (*DeleteImageResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile + localVarReturnValue *DeleteImageResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.DeleteImage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Force.IsSet() { - localVarQueryParams.Add("force", parameterToString(localVarOptionals.Force.Value(), "")) + if r.force != nil { + localVarQueryParams.Add("force", parameterToString(*r.force, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -179,76 +246,115 @@ func (a *ImagesApiService) DeleteImage(ctx _context.Context, imageDigest string, } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteImageByImageIdRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + force *bool + xAnchoreAccount *string +} + +func (r ApiDeleteImageByImageIdRequest) Force(force bool) ApiDeleteImageByImageIdRequest { + r.force = &force + return r } -// DeleteImageByImageIdOpts Optional parameters for the method 'DeleteImageByImageId' -type DeleteImageByImageIdOpts struct { - Force optional.Bool - XAnchoreAccount optional.String +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteImageByImageIdRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteImageByImageIdRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteImageByImageIdRequest) Execute() (*DeleteImageResponse, *http.Response, error) { + return r.ApiService.DeleteImageByImageIdExecute(r) } /* DeleteImageByImageId Delete image by docker imageId - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param optional nil or *DeleteImageByImageIdOpts - Optional Parameters: - * @param "Force" (optional.Bool) - - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiDeleteImageByImageIdRequest */ -func (a *ImagesApiService) DeleteImageByImageId(ctx _context.Context, imageId string, localVarOptionals *DeleteImageByImageIdOpts) (*_nethttp.Response, error) { +func (a *ImagesApiService) DeleteImageByImageId(ctx context.Context, imageId string) ApiDeleteImageByImageIdRequest { + return ApiDeleteImageByImageIdRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return DeleteImageResponse +func (a *ImagesApiService) DeleteImageByImageIdExecute(r ApiDeleteImageByImageIdRequest) (*DeleteImageResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile + localVarReturnValue *DeleteImageResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.DeleteImageByImageId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Force.IsSet() { - localVarQueryParams.Add("force", parameterToString(localVarOptionals.Force.Value(), "")) + if r.force != nil { + localVarQueryParams.Add("force", parameterToString(*r.force, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -267,27 +373,28 @@ func (a *ImagesApiService) DeleteImageByImageId(ctx _context.Context, imageId st if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -296,46 +403,215 @@ func (a *ImagesApiService) DeleteImageByImageId(ctx _context.Context, imageId st err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageOpts Optional parameters for the method 'GetImage' -type GetImageOpts struct { - XAnchoreAccount optional.String +type ApiDeleteImagesAsyncRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigests *[]string + force *bool + xAnchoreAccount *string +} + +func (r ApiDeleteImagesAsyncRequest) ImageDigests(imageDigests []string) ApiDeleteImagesAsyncRequest { + r.imageDigests = &imageDigests + return r +} + +func (r ApiDeleteImagesAsyncRequest) Force(force bool) ApiDeleteImagesAsyncRequest { + r.force = &force + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteImagesAsyncRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteImagesAsyncRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteImagesAsyncRequest) Execute() ([]DeleteImageResponse, *http.Response, error) { + return r.ApiService.DeleteImagesAsyncExecute(r) +} + +/* +DeleteImagesAsync Bulk mark images for deletion + +Delete analysis for image digests in the list asynchronously + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteImagesAsyncRequest +*/ +func (a *ImagesApiService) DeleteImagesAsync(ctx context.Context) ApiDeleteImagesAsyncRequest { + return ApiDeleteImagesAsyncRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []DeleteImageResponse +func (a *ImagesApiService) DeleteImagesAsyncExecute(r ApiDeleteImagesAsyncRequest) ([]DeleteImageResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeleteImageResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.DeleteImagesAsync") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageDigests == nil { + return localVarReturnValue, nil, reportError("imageDigests is required and must be specified") + } + + localVarQueryParams.Add("imageDigests", parameterToString(*r.imageDigests, "csv")) + if r.force != nil { + localVarQueryParams.Add("force", parameterToString(*r.force, "")) + } + // 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 + } + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetImageRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageRequest) Execute() ([]AnchoreImage, *http.Response, error) { + return r.ApiService.GetImageExecute(r) } /* GetImage Get image metadata - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *GetImageOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []AnchoreImage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiGetImageRequest */ -func (a *ImagesApiService) GetImage(ctx _context.Context, imageDigest string, localVarOptionals *GetImageOpts) ([]AnchoreImage, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImage(ctx context.Context, imageDigest string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []AnchoreImage +func (a *ImagesApiService) GetImageExecute(r ApiGetImageRequest) ([]AnchoreImage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreImage ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -354,27 +630,28 @@ func (a *ImagesApiService) GetImage(ctx _context.Context, imageDigest string, lo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -392,7 +669,7 @@ func (a *ImagesApiService) GetImage(ctx _context.Context, imageDigest string, lo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -402,36 +679,59 @@ func (a *ImagesApiService) GetImage(ctx _context.Context, imageDigest string, lo return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageByImageIdOpts Optional parameters for the method 'GetImageByImageId' -type GetImageByImageIdOpts struct { - XAnchoreAccount optional.String +type ApiGetImageByImageIdRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageByImageIdRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageByImageIdRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageByImageIdRequest) Execute() ([]AnchoreImage, *http.Response, error) { + return r.ApiService.GetImageByImageIdExecute(r) } /* GetImageByImageId Lookup image by docker imageId - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param optional nil or *GetImageByImageIdOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []AnchoreImage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiGetImageByImageIdRequest */ -func (a *ImagesApiService) GetImageByImageId(ctx _context.Context, imageId string, localVarOptionals *GetImageByImageIdOpts) ([]AnchoreImage, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageByImageId(ctx context.Context, imageId string) ApiGetImageByImageIdRequest { + return ApiGetImageByImageIdRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return []AnchoreImage +func (a *ImagesApiService) GetImageByImageIdExecute(r ApiGetImageByImageIdRequest) ([]AnchoreImage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreImage ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageByImageId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -450,27 +750,28 @@ func (a *ImagesApiService) GetImageByImageId(ctx _context.Context, imageId strin if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -488,7 +789,7 @@ func (a *ImagesApiService) GetImageByImageId(ctx _context.Context, imageId strin err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -498,39 +799,63 @@ func (a *ImagesApiService) GetImageByImageId(ctx _context.Context, imageId strin return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageContentByTypeOpts Optional parameters for the method 'GetImageContentByType' -type GetImageContentByTypeOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + ctype string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeRequest) Execute() (*ContentPackageResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeExecute(r) } /* GetImageContentByType Get the content of an image by type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param ctype - * @param optional nil or *GetImageContentByTypeOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return ContentPackageResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @param ctype + @return ApiGetImageContentByTypeRequest */ -func (a *ImagesApiService) GetImageContentByType(ctx _context.Context, imageDigest string, ctype string, localVarOptionals *GetImageContentByTypeOpts) (ContentPackageResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageContentByType(ctx context.Context, imageDigest string, ctype string) ApiGetImageContentByTypeRequest { + return ApiGetImageContentByTypeRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + ctype: ctype, + } +} + +// Execute executes the request +// @return ContentPackageResponse +func (a *ImagesApiService) GetImageContentByTypeExecute(r ApiGetImageContentByTypeRequest) (*ContentPackageResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ContentPackageResponse + formFiles []formFile + localVarReturnValue *ContentPackageResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/content/{ctype}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByType") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"ctype"+"}", _neturl.QueryEscape(parameterToString(ctype, "")) , -1) + localVarPath := localBasePath + "/images/{imageDigest}/content/{ctype}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ctype"+"}", url.PathEscape(parameterToString(r.ctype, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -549,27 +874,28 @@ func (a *ImagesApiService) GetImageContentByType(ctx _context.Context, imageDige if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -587,7 +913,7 @@ func (a *ImagesApiService) GetImageContentByType(ctx _context.Context, imageDige err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -597,36 +923,59 @@ func (a *ImagesApiService) GetImageContentByType(ctx _context.Context, imageDige return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageContentByTypeFilesOpts Optional parameters for the method 'GetImageContentByTypeFiles' -type GetImageContentByTypeFilesOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeFilesRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeFilesRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeFilesRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeFilesRequest) Execute() (*ContentFilesResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeFilesExecute(r) } /* GetImageContentByTypeFiles Get the content of an image by type files - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *GetImageContentByTypeFilesOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return ContentFilesResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiGetImageContentByTypeFilesRequest */ -func (a *ImagesApiService) GetImageContentByTypeFiles(ctx _context.Context, imageDigest string, localVarOptionals *GetImageContentByTypeFilesOpts) (ContentFilesResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageContentByTypeFiles(ctx context.Context, imageDigest string) ApiGetImageContentByTypeFilesRequest { + return ApiGetImageContentByTypeFilesRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return ContentFilesResponse +func (a *ImagesApiService) GetImageContentByTypeFilesExecute(r ApiGetImageContentByTypeFilesRequest) (*ContentFilesResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ContentFilesResponse + formFiles []formFile + localVarReturnValue *ContentFilesResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/content/files" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByTypeFiles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/content/files" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -645,27 +994,28 @@ func (a *ImagesApiService) GetImageContentByTypeFiles(ctx _context.Context, imag if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -683,7 +1033,7 @@ func (a *ImagesApiService) GetImageContentByTypeFiles(ctx _context.Context, imag err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -693,39 +1043,63 @@ func (a *ImagesApiService) GetImageContentByTypeFiles(ctx _context.Context, imag return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageContentByTypeImageIdOpts Optional parameters for the method 'GetImageContentByTypeImageId' -type GetImageContentByTypeImageIdOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeImageIdRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + ctype string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeImageIdRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeImageIdRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeImageIdRequest) Execute() (*ContentPackageResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeImageIdExecute(r) } /* GetImageContentByTypeImageId Get the content of an image by type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param ctype - * @param optional nil or *GetImageContentByTypeImageIdOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return ContentPackageResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @param ctype + @return ApiGetImageContentByTypeImageIdRequest */ -func (a *ImagesApiService) GetImageContentByTypeImageId(ctx _context.Context, imageId string, ctype string, localVarOptionals *GetImageContentByTypeImageIdOpts) (ContentPackageResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageContentByTypeImageId(ctx context.Context, imageId string, ctype string) ApiGetImageContentByTypeImageIdRequest { + return ApiGetImageContentByTypeImageIdRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + ctype: ctype, + } +} + +// Execute executes the request +// @return ContentPackageResponse +func (a *ImagesApiService) GetImageContentByTypeImageIdExecute(r ApiGetImageContentByTypeImageIdRequest) (*ContentPackageResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ContentPackageResponse + formFiles []formFile + localVarReturnValue *ContentPackageResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/content/{ctype}" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByTypeImageId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"ctype"+"}", _neturl.QueryEscape(parameterToString(ctype, "")) , -1) + localVarPath := localBasePath + "/images/by_id/{imageId}/content/{ctype}" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ctype"+"}", url.PathEscape(parameterToString(r.ctype, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -744,27 +1118,28 @@ func (a *ImagesApiService) GetImageContentByTypeImageId(ctx _context.Context, im if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -782,7 +1157,7 @@ func (a *ImagesApiService) GetImageContentByTypeImageId(ctx _context.Context, im err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -792,36 +1167,59 @@ func (a *ImagesApiService) GetImageContentByTypeImageId(ctx _context.Context, im return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageContentByTypeImageIdFilesOpts Optional parameters for the method 'GetImageContentByTypeImageIdFiles' -type GetImageContentByTypeImageIdFilesOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeImageIdFilesRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeImageIdFilesRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeImageIdFilesRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeImageIdFilesRequest) Execute() (*ContentFilesResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeImageIdFilesExecute(r) } /* GetImageContentByTypeImageIdFiles Get the content of an image by type files - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param optional nil or *GetImageContentByTypeImageIdFilesOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return ContentFilesResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiGetImageContentByTypeImageIdFilesRequest */ -func (a *ImagesApiService) GetImageContentByTypeImageIdFiles(ctx _context.Context, imageId string, localVarOptionals *GetImageContentByTypeImageIdFilesOpts) (ContentFilesResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageContentByTypeImageIdFiles(ctx context.Context, imageId string) ApiGetImageContentByTypeImageIdFilesRequest { + return ApiGetImageContentByTypeImageIdFilesRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return ContentFilesResponse +func (a *ImagesApiService) GetImageContentByTypeImageIdFilesExecute(r ApiGetImageContentByTypeImageIdFilesRequest) (*ContentFilesResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ContentFilesResponse + formFiles []formFile + localVarReturnValue *ContentFilesResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/content/files" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByTypeImageIdFiles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}/content/files" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -840,27 +1238,28 @@ func (a *ImagesApiService) GetImageContentByTypeImageIdFiles(ctx _context.Contex if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -878,7 +1277,7 @@ func (a *ImagesApiService) GetImageContentByTypeImageIdFiles(ctx _context.Contex err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -888,36 +1287,59 @@ func (a *ImagesApiService) GetImageContentByTypeImageIdFiles(ctx _context.Contex return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageContentByTypeImageIdJavapackageOpts Optional parameters for the method 'GetImageContentByTypeImageIdJavapackage' -type GetImageContentByTypeImageIdJavapackageOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeImageIdJavapackageRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeImageIdJavapackageRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeImageIdJavapackageRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeImageIdJavapackageRequest) Execute() (*ContentJAVAPackageResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeImageIdJavapackageExecute(r) } /* GetImageContentByTypeImageIdJavapackage Get the content of an image by type java - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param optional nil or *GetImageContentByTypeImageIdJavapackageOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return ContentJavaPackageResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiGetImageContentByTypeImageIdJavapackageRequest */ -func (a *ImagesApiService) GetImageContentByTypeImageIdJavapackage(ctx _context.Context, imageId string, localVarOptionals *GetImageContentByTypeImageIdJavapackageOpts) (ContentJavaPackageResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageContentByTypeImageIdJavapackage(ctx context.Context, imageId string) ApiGetImageContentByTypeImageIdJavapackageRequest { + return ApiGetImageContentByTypeImageIdJavapackageRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return ContentJAVAPackageResponse +func (a *ImagesApiService) GetImageContentByTypeImageIdJavapackageExecute(r ApiGetImageContentByTypeImageIdJavapackageRequest) (*ContentJAVAPackageResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ContentJavaPackageResponse + formFiles []formFile + localVarReturnValue *ContentJAVAPackageResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/content/java" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByTypeImageIdJavapackage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}/content/java" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -936,27 +1358,28 @@ func (a *ImagesApiService) GetImageContentByTypeImageIdJavapackage(ctx _context. if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -974,7 +1397,7 @@ func (a *ImagesApiService) GetImageContentByTypeImageIdJavapackage(ctx _context. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -984,36 +1407,59 @@ func (a *ImagesApiService) GetImageContentByTypeImageIdJavapackage(ctx _context. return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageContentByTypeJavapackageOpts Optional parameters for the method 'GetImageContentByTypeJavapackage' -type GetImageContentByTypeJavapackageOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeJavapackageRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeJavapackageRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeJavapackageRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeJavapackageRequest) Execute() (*ContentJAVAPackageResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeJavapackageExecute(r) } /* GetImageContentByTypeJavapackage Get the content of an image by type java - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *GetImageContentByTypeJavapackageOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return ContentJavaPackageResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiGetImageContentByTypeJavapackageRequest */ -func (a *ImagesApiService) GetImageContentByTypeJavapackage(ctx _context.Context, imageDigest string, localVarOptionals *GetImageContentByTypeJavapackageOpts) (ContentJavaPackageResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageContentByTypeJavapackage(ctx context.Context, imageDigest string) ApiGetImageContentByTypeJavapackageRequest { + return ApiGetImageContentByTypeJavapackageRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return ContentJAVAPackageResponse +func (a *ImagesApiService) GetImageContentByTypeJavapackageExecute(r ApiGetImageContentByTypeJavapackageRequest) (*ContentJAVAPackageResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ContentJavaPackageResponse + formFiles []formFile + localVarReturnValue *ContentJAVAPackageResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/content/java" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByTypeJavapackage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/content/java" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1032,27 +1478,28 @@ func (a *ImagesApiService) GetImageContentByTypeJavapackage(ctx _context.Context if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1070,7 +1517,7 @@ func (a *ImagesApiService) GetImageContentByTypeJavapackage(ctx _context.Context err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1080,39 +1527,183 @@ func (a *ImagesApiService) GetImageContentByTypeJavapackage(ctx _context.Context return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageMetadataByTypeOpts Optional parameters for the method 'GetImageMetadataByType' -type GetImageMetadataByTypeOpts struct { - XAnchoreAccount optional.String +type ApiGetImageContentByTypeMalwareRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageContentByTypeMalwareRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageContentByTypeMalwareRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageContentByTypeMalwareRequest) Execute() (*ContentMalwareResponse, *http.Response, error) { + return r.ApiService.GetImageContentByTypeMalwareExecute(r) +} + +/* +GetImageContentByTypeMalware Get the content of an image by type malware + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiGetImageContentByTypeMalwareRequest +*/ +func (a *ImagesApiService) GetImageContentByTypeMalware(ctx context.Context, imageDigest string) ApiGetImageContentByTypeMalwareRequest { + return ApiGetImageContentByTypeMalwareRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return ContentMalwareResponse +func (a *ImagesApiService) GetImageContentByTypeMalwareExecute(r ApiGetImageContentByTypeMalwareRequest) (*ContentMalwareResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContentMalwareResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageContentByTypeMalware") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/content/malware" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -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 + } + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetImageMetadataByTypeRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + mtype string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageMetadataByTypeRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageMetadataByTypeRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageMetadataByTypeRequest) Execute() (*MetadataResponse, *http.Response, error) { + return r.ApiService.GetImageMetadataByTypeExecute(r) } /* GetImageMetadataByType Get the metadata of an image by type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param mtype - * @param optional nil or *GetImageMetadataByTypeOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return MetadataResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @param mtype + @return ApiGetImageMetadataByTypeRequest */ -func (a *ImagesApiService) GetImageMetadataByType(ctx _context.Context, imageDigest string, mtype string, localVarOptionals *GetImageMetadataByTypeOpts) (MetadataResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageMetadataByType(ctx context.Context, imageDigest string, mtype string) ApiGetImageMetadataByTypeRequest { + return ApiGetImageMetadataByTypeRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + mtype: mtype, + } +} + +// Execute executes the request +// @return MetadataResponse +func (a *ImagesApiService) GetImageMetadataByTypeExecute(r ApiGetImageMetadataByTypeRequest) (*MetadataResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MetadataResponse + formFiles []formFile + localVarReturnValue *MetadataResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/metadata/{mtype}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageMetadataByType") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"mtype"+"}", _neturl.QueryEscape(parameterToString(mtype, "")) , -1) + localVarPath := localBasePath + "/images/{imageDigest}/metadata/{mtype}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"mtype"+"}", url.PathEscape(parameterToString(r.mtype, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1131,27 +1722,28 @@ func (a *ImagesApiService) GetImageMetadataByType(ctx _context.Context, imageDig if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1169,7 +1761,7 @@ func (a *ImagesApiService) GetImageMetadataByType(ctx _context.Context, imageDig err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1179,59 +1771,107 @@ func (a *ImagesApiService) GetImageMetadataByType(ctx _context.Context, imageDig return localVarReturnValue, localVarHTTPResponse, nil } -// GetImagePolicyCheckOpts Optional parameters for the method 'GetImagePolicyCheck' -type GetImagePolicyCheckOpts struct { - PolicyId optional.String - Detail optional.Bool - History optional.Bool - Interactive optional.Bool - XAnchoreAccount optional.String +type ApiGetImagePolicyCheckRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + tag *string + policyId *string + detail *bool + history *bool + interactive *bool + xAnchoreAccount *string +} + +func (r ApiGetImagePolicyCheckRequest) Tag(tag string) ApiGetImagePolicyCheckRequest { + r.tag = &tag + return r +} + +func (r ApiGetImagePolicyCheckRequest) PolicyId(policyId string) ApiGetImagePolicyCheckRequest { + r.policyId = &policyId + return r +} + +func (r ApiGetImagePolicyCheckRequest) Detail(detail bool) ApiGetImagePolicyCheckRequest { + r.detail = &detail + return r +} + +func (r ApiGetImagePolicyCheckRequest) History(history bool) ApiGetImagePolicyCheckRequest { + r.history = &history + return r +} + +func (r ApiGetImagePolicyCheckRequest) Interactive(interactive bool) ApiGetImagePolicyCheckRequest { + r.interactive = &interactive + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImagePolicyCheckRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImagePolicyCheckRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImagePolicyCheckRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.GetImagePolicyCheckExecute(r) } /* GetImagePolicyCheck Check policy evaluation status for image + Get the policy evaluation for the given image - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param tag - * @param optional nil or *GetImagePolicyCheckOpts - Optional Parameters: - * @param "PolicyId" (optional.String) - - * @param "Detail" (optional.Bool) - - * @param "History" (optional.Bool) - - * @param "Interactive" (optional.Bool) - - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []map[string]interface{} + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiGetImagePolicyCheckRequest */ -func (a *ImagesApiService) GetImagePolicyCheck(ctx _context.Context, imageDigest string, tag string, localVarOptionals *GetImagePolicyCheckOpts) ([]map[string]interface{}, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImagePolicyCheck(ctx context.Context, imageDigest string) ApiGetImagePolicyCheckRequest { + return ApiGetImagePolicyCheckRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *ImagesApiService) GetImagePolicyCheckExecute(r ApiGetImagePolicyCheckRequest) ([]map[string]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []map[string]interface{} ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/check" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImagePolicyCheck") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/check" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tag == nil { + return localVarReturnValue, nil, reportError("tag is required and must be specified") + } - if localVarOptionals != nil && localVarOptionals.PolicyId.IsSet() { - localVarQueryParams.Add("policyId", parameterToString(localVarOptionals.PolicyId.Value(), "")) + if r.policyId != nil { + localVarQueryParams.Add("policyId", parameterToString(*r.policyId, "")) } - localVarQueryParams.Add("tag", parameterToString(tag, "")) - if localVarOptionals != nil && localVarOptionals.Detail.IsSet() { - localVarQueryParams.Add("detail", parameterToString(localVarOptionals.Detail.Value(), "")) + localVarQueryParams.Add("tag", parameterToString(*r.tag, "")) + if r.detail != nil { + localVarQueryParams.Add("detail", parameterToString(*r.detail, "")) } - if localVarOptionals != nil && localVarOptionals.History.IsSet() { - localVarQueryParams.Add("history", parameterToString(localVarOptionals.History.Value(), "")) + if r.history != nil { + localVarQueryParams.Add("history", parameterToString(*r.history, "")) } - if localVarOptionals != nil && localVarOptionals.Interactive.IsSet() { - localVarQueryParams.Add("interactive", parameterToString(localVarOptionals.Interactive.Value(), "")) + if r.interactive != nil { + localVarQueryParams.Add("interactive", parameterToString(*r.interactive, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1250,27 +1890,28 @@ func (a *ImagesApiService) GetImagePolicyCheck(ctx _context.Context, imageDigest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1288,7 +1929,7 @@ func (a *ImagesApiService) GetImagePolicyCheck(ctx _context.Context, imageDigest err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1298,54 +1939,98 @@ func (a *ImagesApiService) GetImagePolicyCheck(ctx _context.Context, imageDigest return localVarReturnValue, localVarHTTPResponse, nil } -// GetImagePolicyCheckByImageIdOpts Optional parameters for the method 'GetImagePolicyCheckByImageId' -type GetImagePolicyCheckByImageIdOpts struct { - PolicyId optional.String - Detail optional.Bool - History optional.Bool - XAnchoreAccount optional.String +type ApiGetImagePolicyCheckByImageIdRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + tag *string + policyId *string + detail *bool + history *bool + xAnchoreAccount *string +} + +func (r ApiGetImagePolicyCheckByImageIdRequest) Tag(tag string) ApiGetImagePolicyCheckByImageIdRequest { + r.tag = &tag + return r +} + +func (r ApiGetImagePolicyCheckByImageIdRequest) PolicyId(policyId string) ApiGetImagePolicyCheckByImageIdRequest { + r.policyId = &policyId + return r +} + +func (r ApiGetImagePolicyCheckByImageIdRequest) Detail(detail bool) ApiGetImagePolicyCheckByImageIdRequest { + r.detail = &detail + return r +} + +func (r ApiGetImagePolicyCheckByImageIdRequest) History(history bool) ApiGetImagePolicyCheckByImageIdRequest { + r.history = &history + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImagePolicyCheckByImageIdRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImagePolicyCheckByImageIdRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImagePolicyCheckByImageIdRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.GetImagePolicyCheckByImageIdExecute(r) } /* GetImagePolicyCheckByImageId Check policy evaluation status for image + Get the policy evaluation for the given image - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param tag - * @param optional nil or *GetImagePolicyCheckByImageIdOpts - Optional Parameters: - * @param "PolicyId" (optional.String) - - * @param "Detail" (optional.Bool) - - * @param "History" (optional.Bool) - - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []map[string]interface{} + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiGetImagePolicyCheckByImageIdRequest */ -func (a *ImagesApiService) GetImagePolicyCheckByImageId(ctx _context.Context, imageId string, tag string, localVarOptionals *GetImagePolicyCheckByImageIdOpts) ([]map[string]interface{}, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImagePolicyCheckByImageId(ctx context.Context, imageId string) ApiGetImagePolicyCheckByImageIdRequest { + return ApiGetImagePolicyCheckByImageIdRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *ImagesApiService) GetImagePolicyCheckByImageIdExecute(r ApiGetImagePolicyCheckByImageIdRequest) ([]map[string]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []map[string]interface{} ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/check" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImagePolicyCheckByImageId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}/check" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tag == nil { + return localVarReturnValue, nil, reportError("tag is required and must be specified") + } - if localVarOptionals != nil && localVarOptionals.PolicyId.IsSet() { - localVarQueryParams.Add("policyId", parameterToString(localVarOptionals.PolicyId.Value(), "")) + if r.policyId != nil { + localVarQueryParams.Add("policyId", parameterToString(*r.policyId, "")) } - localVarQueryParams.Add("tag", parameterToString(tag, "")) - if localVarOptionals != nil && localVarOptionals.Detail.IsSet() { - localVarQueryParams.Add("detail", parameterToString(localVarOptionals.Detail.Value(), "")) + localVarQueryParams.Add("tag", parameterToString(*r.tag, "")) + if r.detail != nil { + localVarQueryParams.Add("detail", parameterToString(*r.detail, "")) } - if localVarOptionals != nil && localVarOptionals.History.IsSet() { - localVarQueryParams.Add("history", parameterToString(localVarOptionals.History.Value(), "")) + if r.history != nil { + localVarQueryParams.Add("history", parameterToString(*r.history, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1364,27 +2049,28 @@ func (a *ImagesApiService) GetImagePolicyCheckByImageId(ctx _context.Context, im if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1402,7 +2088,7 @@ func (a *ImagesApiService) GetImagePolicyCheckByImageId(ctx _context.Context, im err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1412,49 +2098,82 @@ func (a *ImagesApiService) GetImagePolicyCheckByImageId(ctx _context.Context, im return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageVulnerabilitiesByTypeOpts Optional parameters for the method 'GetImageVulnerabilitiesByType' -type GetImageVulnerabilitiesByTypeOpts struct { - ForceRefresh optional.Bool - VendorOnly optional.Bool - XAnchoreAccount optional.String +type ApiGetImageVulnerabilitiesByTypeRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + vtype string + forceRefresh *bool + vendorOnly *bool + xAnchoreAccount *string +} + +func (r ApiGetImageVulnerabilitiesByTypeRequest) ForceRefresh(forceRefresh bool) ApiGetImageVulnerabilitiesByTypeRequest { + r.forceRefresh = &forceRefresh + return r +} + +// Filter results to include only vulnerabilities that are not marked as invalid by upstream OS vendor data. When set to true, it will filter out all vulnerabilities where `will_not_fix` is False. If false all vulnerabilities are returned regardless of `will_not_fix` +func (r ApiGetImageVulnerabilitiesByTypeRequest) VendorOnly(vendorOnly bool) ApiGetImageVulnerabilitiesByTypeRequest { + r.vendorOnly = &vendorOnly + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageVulnerabilitiesByTypeRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageVulnerabilitiesByTypeRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageVulnerabilitiesByTypeRequest) Execute() (*VulnerabilityResponse, *http.Response, error) { + return r.ApiService.GetImageVulnerabilitiesByTypeExecute(r) } /* GetImageVulnerabilitiesByType Get vulnerabilities by type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param vtype - * @param optional nil or *GetImageVulnerabilitiesByTypeOpts - Optional Parameters: - * @param "ForceRefresh" (optional.Bool) - - * @param "VendorOnly" (optional.Bool) - - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return VulnerabilityResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @param vtype + @return ApiGetImageVulnerabilitiesByTypeRequest */ -func (a *ImagesApiService) GetImageVulnerabilitiesByType(ctx _context.Context, imageDigest string, vtype string, localVarOptionals *GetImageVulnerabilitiesByTypeOpts) (VulnerabilityResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageVulnerabilitiesByType(ctx context.Context, imageDigest string, vtype string) ApiGetImageVulnerabilitiesByTypeRequest { + return ApiGetImageVulnerabilitiesByTypeRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + vtype: vtype, + } +} + +// Execute executes the request +// @return VulnerabilityResponse +func (a *ImagesApiService) GetImageVulnerabilitiesByTypeExecute(r ApiGetImageVulnerabilitiesByTypeRequest) (*VulnerabilityResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VulnerabilityResponse + formFiles []formFile + localVarReturnValue *VulnerabilityResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/vuln/{vtype}" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageVulnerabilitiesByType") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"vtype"+"}", _neturl.QueryEscape(parameterToString(vtype, "")) , -1) + localVarPath := localBasePath + "/images/{imageDigest}/vuln/{vtype}" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vtype"+"}", url.PathEscape(parameterToString(r.vtype, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.ForceRefresh.IsSet() { - localVarQueryParams.Add("force_refresh", parameterToString(localVarOptionals.ForceRefresh.Value(), "")) + if r.forceRefresh != nil { + localVarQueryParams.Add("force_refresh", parameterToString(*r.forceRefresh, "")) } - if localVarOptionals != nil && localVarOptionals.VendorOnly.IsSet() { - localVarQueryParams.Add("vendor_only", parameterToString(localVarOptionals.VendorOnly.Value(), "")) + if r.vendorOnly != nil { + localVarQueryParams.Add("vendor_only", parameterToString(*r.vendorOnly, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1473,27 +2192,28 @@ func (a *ImagesApiService) GetImageVulnerabilitiesByType(ctx _context.Context, i if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1511,7 +2231,7 @@ func (a *ImagesApiService) GetImageVulnerabilitiesByType(ctx _context.Context, i err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1521,39 +2241,63 @@ func (a *ImagesApiService) GetImageVulnerabilitiesByType(ctx _context.Context, i return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageVulnerabilitiesByTypeImageIdOpts Optional parameters for the method 'GetImageVulnerabilitiesByTypeImageId' -type GetImageVulnerabilitiesByTypeImageIdOpts struct { - XAnchoreAccount optional.String +type ApiGetImageVulnerabilitiesByTypeImageIdRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + vtype string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageVulnerabilitiesByTypeImageIdRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageVulnerabilitiesByTypeImageIdRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageVulnerabilitiesByTypeImageIdRequest) Execute() (*VulnerabilityResponse, *http.Response, error) { + return r.ApiService.GetImageVulnerabilitiesByTypeImageIdExecute(r) } /* GetImageVulnerabilitiesByTypeImageId Get vulnerabilities by type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param vtype - * @param optional nil or *GetImageVulnerabilitiesByTypeImageIdOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return VulnerabilityResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @param vtype + @return ApiGetImageVulnerabilitiesByTypeImageIdRequest */ -func (a *ImagesApiService) GetImageVulnerabilitiesByTypeImageId(ctx _context.Context, imageId string, vtype string, localVarOptionals *GetImageVulnerabilitiesByTypeImageIdOpts) (VulnerabilityResponse, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageVulnerabilitiesByTypeImageId(ctx context.Context, imageId string, vtype string) ApiGetImageVulnerabilitiesByTypeImageIdRequest { + return ApiGetImageVulnerabilitiesByTypeImageIdRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + vtype: vtype, + } +} + +// Execute executes the request +// @return VulnerabilityResponse +func (a *ImagesApiService) GetImageVulnerabilitiesByTypeImageIdExecute(r ApiGetImageVulnerabilitiesByTypeImageIdRequest) (*VulnerabilityResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VulnerabilityResponse + formFiles []formFile + localVarReturnValue *VulnerabilityResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/vuln/{vtype}" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageVulnerabilitiesByTypeImageId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"vtype"+"}", _neturl.QueryEscape(parameterToString(vtype, "")) , -1) + localVarPath := localBasePath + "/images/by_id/{imageId}/vuln/{vtype}" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"vtype"+"}", url.PathEscape(parameterToString(r.vtype, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1572,27 +2316,28 @@ func (a *ImagesApiService) GetImageVulnerabilitiesByTypeImageId(ctx _context.Con if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1610,7 +2355,7 @@ func (a *ImagesApiService) GetImageVulnerabilitiesByTypeImageId(ctx _context.Con err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1620,36 +2365,59 @@ func (a *ImagesApiService) GetImageVulnerabilitiesByTypeImageId(ctx _context.Con return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageVulnerabilityTypesOpts Optional parameters for the method 'GetImageVulnerabilityTypes' -type GetImageVulnerabilityTypesOpts struct { - XAnchoreAccount optional.String +type ApiGetImageVulnerabilityTypesRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageVulnerabilityTypesRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageVulnerabilityTypesRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageVulnerabilityTypesRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.GetImageVulnerabilityTypesExecute(r) } /* GetImageVulnerabilityTypes Get vulnerability types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *GetImageVulnerabilityTypesOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiGetImageVulnerabilityTypesRequest */ -func (a *ImagesApiService) GetImageVulnerabilityTypes(ctx _context.Context, imageDigest string, localVarOptionals *GetImageVulnerabilityTypesOpts) ([]string, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageVulnerabilityTypes(ctx context.Context, imageDigest string) ApiGetImageVulnerabilityTypesRequest { + return ApiGetImageVulnerabilityTypesRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []string +func (a *ImagesApiService) GetImageVulnerabilityTypesExecute(r ApiGetImageVulnerabilityTypesRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/vuln" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageVulnerabilityTypes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/vuln" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1668,27 +2436,28 @@ func (a *ImagesApiService) GetImageVulnerabilityTypes(ctx _context.Context, imag if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1706,7 +2475,7 @@ func (a *ImagesApiService) GetImageVulnerabilityTypes(ctx _context.Context, imag err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1716,36 +2485,59 @@ func (a *ImagesApiService) GetImageVulnerabilityTypes(ctx _context.Context, imag return localVarReturnValue, localVarHTTPResponse, nil } -// GetImageVulnerabilityTypesByImageIdOpts Optional parameters for the method 'GetImageVulnerabilityTypesByImageId' -type GetImageVulnerabilityTypesByImageIdOpts struct { - XAnchoreAccount optional.String +type ApiGetImageVulnerabilityTypesByImageIdRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetImageVulnerabilityTypesByImageIdRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetImageVulnerabilityTypesByImageIdRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetImageVulnerabilityTypesByImageIdRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.GetImageVulnerabilityTypesByImageIdExecute(r) } /* GetImageVulnerabilityTypesByImageId Get vulnerability types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param optional nil or *GetImageVulnerabilityTypesByImageIdOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiGetImageVulnerabilityTypesByImageIdRequest */ -func (a *ImagesApiService) GetImageVulnerabilityTypesByImageId(ctx _context.Context, imageId string, localVarOptionals *GetImageVulnerabilityTypesByImageIdOpts) ([]string, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImageVulnerabilityTypesByImageId(ctx context.Context, imageId string) ApiGetImageVulnerabilityTypesByImageIdRequest { + return ApiGetImageVulnerabilityTypesByImageIdRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return []string +func (a *ImagesApiService) GetImageVulnerabilityTypesByImageIdExecute(r ApiGetImageVulnerabilityTypesByImageIdRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/vuln" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImageVulnerabilityTypesByImageId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}/vuln" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1764,27 +2556,28 @@ func (a *ImagesApiService) GetImageVulnerabilityTypesByImageId(ctx _context.Cont if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1802,7 +2595,7 @@ func (a *ImagesApiService) GetImageVulnerabilityTypesByImageId(ctx _context.Cont err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1812,36 +2605,59 @@ func (a *ImagesApiService) GetImageVulnerabilityTypesByImageId(ctx _context.Cont return localVarReturnValue, localVarHTTPResponse, nil } -// ListImageContentOpts Optional parameters for the method 'ListImageContent' -type ListImageContentOpts struct { - XAnchoreAccount optional.String +type ApiListImageContentRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListImageContentRequest) XAnchoreAccount(xAnchoreAccount string) ApiListImageContentRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListImageContentRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImageContentExecute(r) } /* ListImageContent List image content types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *ListImageContentOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiListImageContentRequest */ -func (a *ImagesApiService) ListImageContent(ctx _context.Context, imageDigest string, localVarOptionals *ListImageContentOpts) ([]string, *_nethttp.Response, error) { +func (a *ImagesApiService) ListImageContent(ctx context.Context, imageDigest string) ApiListImageContentRequest { + return ApiListImageContentRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []string +func (a *ImagesApiService) ListImageContentExecute(r ApiListImageContentRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/content" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ListImageContent") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/content" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1860,27 +2676,28 @@ func (a *ImagesApiService) ListImageContent(ctx _context.Context, imageDigest st if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1898,7 +2715,7 @@ func (a *ImagesApiService) ListImageContent(ctx _context.Context, imageDigest st err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1908,36 +2725,59 @@ func (a *ImagesApiService) ListImageContent(ctx _context.Context, imageDigest st return localVarReturnValue, localVarHTTPResponse, nil } -// ListImageContentByImageidOpts Optional parameters for the method 'ListImageContentByImageid' -type ListImageContentByImageidOpts struct { - XAnchoreAccount optional.String +type ApiListImageContentByImageidRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListImageContentByImageidRequest) XAnchoreAccount(xAnchoreAccount string) ApiListImageContentByImageidRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListImageContentByImageidRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImageContentByImageidExecute(r) } /* ListImageContentByImageid List image content types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId - * @param optional nil or *ListImageContentByImageidOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageId + @return ApiListImageContentByImageidRequest */ -func (a *ImagesApiService) ListImageContentByImageid(ctx _context.Context, imageId string, localVarOptionals *ListImageContentByImageidOpts) ([]string, *_nethttp.Response, error) { +func (a *ImagesApiService) ListImageContentByImageid(ctx context.Context, imageId string) ApiListImageContentByImageidRequest { + return ApiListImageContentByImageidRequest{ + ApiService: a, + ctx: ctx, + imageId: imageId, + } +} + +// Execute executes the request +// @return []string +func (a *ImagesApiService) ListImageContentByImageidExecute(r ApiListImageContentByImageidRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/by_id/{imageId}/content" - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", _neturl.QueryEscape(parameterToString(imageId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ListImageContentByImageid") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/by_id/{imageId}/content" + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterToString(r.imageId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1956,27 +2796,28 @@ func (a *ImagesApiService) ListImageContentByImageid(ctx _context.Context, image if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1994,7 +2835,7 @@ func (a *ImagesApiService) ListImageContentByImageid(ctx _context.Context, image err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2004,36 +2845,59 @@ func (a *ImagesApiService) ListImageContentByImageid(ctx _context.Context, image return localVarReturnValue, localVarHTTPResponse, nil } -// ListImageMetadataOpts Optional parameters for the method 'ListImageMetadata' -type ListImageMetadataOpts struct { - XAnchoreAccount optional.String +type ApiListImageMetadataRequest struct { + ctx context.Context + ApiService *ImagesApiService + imageDigest string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListImageMetadataRequest) XAnchoreAccount(xAnchoreAccount string) ApiListImageMetadataRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListImageMetadataRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImageMetadataExecute(r) } /* ListImageMetadata List image metadata types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageDigest - * @param optional nil or *ListImageMetadataOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param imageDigest + @return ApiListImageMetadataRequest */ -func (a *ImagesApiService) ListImageMetadata(ctx _context.Context, imageDigest string, localVarOptionals *ListImageMetadataOpts) ([]string, *_nethttp.Response, error) { +func (a *ImagesApiService) ListImageMetadata(ctx context.Context, imageDigest string) ApiListImageMetadataRequest { + return ApiListImageMetadataRequest{ + ApiService: a, + ctx: ctx, + imageDigest: imageDigest, + } +} + +// Execute executes the request +// @return []string +func (a *ImagesApiService) ListImageMetadataExecute(r ApiListImageMetadataRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{imageDigest}/metadata" - localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", _neturl.QueryEscape(parameterToString(imageDigest, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ListImageMetadata") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images/{imageDigest}/metadata" + localVarPath = strings.Replace(localVarPath, "{"+"imageDigest"+"}", url.PathEscape(parameterToString(r.imageDigest, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2052,27 +2916,28 @@ func (a *ImagesApiService) ListImageMetadata(ctx _context.Context, imageDigest s if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2090,7 +2955,7 @@ func (a *ImagesApiService) ListImageMetadata(ctx _context.Context, imageDigest s err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2100,49 +2965,100 @@ func (a *ImagesApiService) ListImageMetadata(ctx _context.Context, imageDigest s return localVarReturnValue, localVarHTTPResponse, nil } -// ListImagesOpts Optional parameters for the method 'ListImages' -type ListImagesOpts struct { - History optional.Bool - Fulltag optional.String - XAnchoreAccount optional.String - ImageToGet optional.Interface +type ApiListImagesRequest struct { + ctx context.Context + ApiService *ImagesApiService + history *bool + fulltag *string + imageStatus *string + analysisStatus *string + xAnchoreAccount *string +} + +// Include image history in the response +func (r ApiListImagesRequest) History(history bool) ApiListImagesRequest { + r.history = &history + return r +} + +// Full docker-pull string to filter results by (e.g. docker.io/library/nginx:latest, or myhost.com:5000/testimages:v1.1.1) +func (r ApiListImagesRequest) Fulltag(fulltag string) ApiListImagesRequest { + r.fulltag = &fulltag + return r +} + +// Filter by image_status value on the record. Default if omitted is 'active'. +func (r ApiListImagesRequest) ImageStatus(imageStatus string) ApiListImagesRequest { + r.imageStatus = &imageStatus + return r +} + +// Filter by analysis_status value on the record. +func (r ApiListImagesRequest) AnalysisStatus(analysisStatus string) ApiListImagesRequest { + r.analysisStatus = &analysisStatus + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListImagesRequest) XAnchoreAccount(xAnchoreAccount string) ApiListImagesRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListImagesRequest) Execute() ([]AnchoreImage, *http.Response, error) { + return r.ApiService.ListImagesExecute(r) } /* ListImages List all visible images + List all images visible to the user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListImagesOpts - Optional Parameters: - * @param "History" (optional.Bool) - Include image history in the response - * @param "Fulltag" (optional.String) - Full docker-pull string to filter results by (e.g. docker.io/library/nginx:latest, or myhost.com:5000/testimages:v1.1.1) - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) - * @param "ImageToGet" (optional.Interface of ImageFilter) - -@return []AnchoreImage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListImagesRequest */ -func (a *ImagesApiService) ListImages(ctx _context.Context, localVarOptionals *ListImagesOpts) ([]AnchoreImage, *_nethttp.Response, error) { +func (a *ImagesApiService) ListImages(ctx context.Context) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnchoreImage +func (a *ImagesApiService) ListImagesExecute(r ApiListImagesRequest) ([]AnchoreImage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreImage ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ListImages") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/images" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.History.IsSet() { - localVarQueryParams.Add("history", parameterToString(localVarOptionals.History.Value(), "")) + if r.history != nil { + localVarQueryParams.Add("history", parameterToString(*r.history, "")) + } + if r.fulltag != nil { + localVarQueryParams.Add("fulltag", parameterToString(*r.fulltag, "")) } - if localVarOptionals != nil && localVarOptionals.Fulltag.IsSet() { - localVarQueryParams.Add("fulltag", parameterToString(localVarOptionals.Fulltag.Value(), "")) + if r.imageStatus != nil { + localVarQueryParams.Add("image_status", parameterToString(*r.imageStatus, "")) + } + if r.analysisStatus != nil { + localVarQueryParams.Add("analysis_status", parameterToString(*r.analysisStatus, "")) } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2158,36 +3074,28 @@ func (a *ImagesApiService) ListImages(ctx _context.Context, localVarOptionals *L if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - // body params - if localVarOptionals != nil && localVarOptionals.ImageToGet.IsSet() { - localVarOptionalImageToGet, localVarOptionalImageToGetok := localVarOptionals.ImageToGet.Value().(ImageFilter) - if !localVarOptionalImageToGetok { - return localVarReturnValue, nil, reportError("imageToGet should be ImageFilter") - } - localVarPostBody = &localVarOptionalImageToGet - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2205,7 +3113,7 @@ func (a *ImagesApiService) ListImages(ctx _context.Context, localVarOptionals *L err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_import.go b/.gen/anchore/api_import.go index 7642aa6a4b..57f4d5d957 100644 --- a/.gen/anchore/api_import.go +++ b/.gen/anchore/api_import.go @@ -1,53 +1,81 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "os" ) -// Linger please -var ( - _ _context.Context -) // ImportApiService ImportApi service type ImportApiService service +type ApiImportImageArchiveRequest struct { + ctx context.Context + ApiService *ImportApiService + archiveFile **os.File +} + +// anchore image tar archive. +func (r ApiImportImageArchiveRequest) ArchiveFile(archiveFile *os.File) ApiImportImageArchiveRequest { + r.archiveFile = &archiveFile + return r +} + +func (r ApiImportImageArchiveRequest) Execute() ([]AnchoreImage, *http.Response, error) { + return r.ApiService.ImportImageArchiveExecute(r) +} + /* -ImportImageArchive Import an anchore image tar.gz archive file. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param archiveFile anchore image tar archive. -@return []AnchoreImage +ImportImageArchive Import an anchore image tar.gz archive file. This is a deprecated API replaced by the \"/imports/images\" route + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiImportImageArchiveRequest */ -func (a *ImportApiService) ImportImageArchive(ctx _context.Context, archiveFile *os.File) ([]AnchoreImage, *_nethttp.Response, error) { +func (a *ImportApiService) ImportImageArchive(ctx context.Context) ApiImportImageArchiveRequest { + return ApiImportImageArchiveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnchoreImage +func (a *ImportApiService) ImportImageArchiveExecute(r ApiImportImageArchiveRequest) ([]AnchoreImage, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreImage ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/import/images" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportApiService.ImportImageArchive") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/import/images" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.archiveFile == nil { + return localVarReturnValue, nil, reportError("archiveFile is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -66,32 +94,39 @@ func (a *ImportApiService) ImportImageArchive(ctx _context.Context, archiveFile if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - localVarFormFileName = "archive_file" - localVarFile := archiveFile - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + var archiveFileLocalVarFormFileName string + var archiveFileLocalVarFileName string + var archiveFileLocalVarFileBytes []byte + + archiveFileLocalVarFormFileName = "archive_file" + + archiveFileLocalVarFile := *r.archiveFile + if archiveFileLocalVarFile != nil { + fbs, _ := ioutil.ReadAll(archiveFileLocalVarFile) + archiveFileLocalVarFileBytes = fbs + archiveFileLocalVarFileName = archiveFileLocalVarFile.Name() + archiveFileLocalVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + formFiles = append(formFiles, formFile{fileBytes: archiveFileLocalVarFileBytes, fileName: archiveFileLocalVarFileName, formFileName: archiveFileLocalVarFormFileName}) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -109,7 +144,7 @@ func (a *ImportApiService) ImportImageArchive(ctx _context.Context, archiveFile err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_imports.go b/.gen/anchore/api_imports.go new file mode 100644 index 0000000000..6a7b947576 --- /dev/null +++ b/.gen/anchore/api_imports.go @@ -0,0 +1,1486 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// ImportsApiService ImportsApi service +type ImportsApiService service + +type ApiCreateOperationRequest struct { + ctx context.Context + ApiService *ImportsApiService +} + +func (r ApiCreateOperationRequest) Execute() (*ImageImportOperation, *http.Response, error) { + return r.ApiService.CreateOperationExecute(r) +} + +/* +CreateOperation Begin the import of an image analyzed by Syft into the system + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateOperationRequest +*/ +func (a *ImportsApiService) CreateOperation(ctx context.Context) ApiCreateOperationRequest { + return ApiCreateOperationRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ImageImportOperation +func (a *ImportsApiService) CreateOperationExecute(r ApiCreateOperationRequest) (*ImageImportOperation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportOperation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.CreateOperation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images" + + 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetOperationRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiGetOperationRequest) Execute() (*ImageImportOperation, *http.Response, error) { + return r.ApiService.GetOperationExecute(r) +} + +/* +GetOperation Get detail on a single import + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiGetOperationRequest +*/ +func (a *ImportsApiService) GetOperation(ctx context.Context, operationId string) ApiGetOperationRequest { + return ApiGetOperationRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportOperation +func (a *ImportsApiService) GetOperationExecute(r ApiGetOperationRequest) (*ImageImportOperation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportOperation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.GetOperation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiImportImageConfigRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string + contents *map[string]interface{} +} + +func (r ApiImportImageConfigRequest) Contents(contents map[string]interface{}) ApiImportImageConfigRequest { + r.contents = &contents + return r +} + +func (r ApiImportImageConfigRequest) Execute() (*ImageImportContentResponse, *http.Response, error) { + return r.ApiService.ImportImageConfigExecute(r) +} + +/* +ImportImageConfig Import a docker or OCI image config to associate with the image + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiImportImageConfigRequest +*/ +func (a *ImportsApiService) ImportImageConfig(ctx context.Context, operationId string) ApiImportImageConfigRequest { + return ApiImportImageConfigRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportContentResponse +func (a *ImportsApiService) ImportImageConfigExecute(r ApiImportImageConfigRequest) (*ImageImportContentResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportContentResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ImportImageConfig") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/image_config" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contents == nil { + return localVarReturnValue, nil, reportError("contents 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.contents + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiImportImageDockerfileRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string + contents *string +} + +func (r ApiImportImageDockerfileRequest) Contents(contents string) ApiImportImageDockerfileRequest { + r.contents = &contents + return r +} + +func (r ApiImportImageDockerfileRequest) Execute() (*ImageImportContentResponse, *http.Response, error) { + return r.ApiService.ImportImageDockerfileExecute(r) +} + +/* +ImportImageDockerfile Begin the import of an image analyzed by Syft into the system + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiImportImageDockerfileRequest +*/ +func (a *ImportsApiService) ImportImageDockerfile(ctx context.Context, operationId string) ApiImportImageDockerfileRequest { + return ApiImportImageDockerfileRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportContentResponse +func (a *ImportsApiService) ImportImageDockerfileExecute(r ApiImportImageDockerfileRequest) (*ImageImportContentResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportContentResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ImportImageDockerfile") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/dockerfile" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contents == nil { + return localVarReturnValue, nil, reportError("contents is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"text/plain; utf-8"} + + // 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.contents + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiImportImageManifestRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string + contents *map[string]interface{} +} + +func (r ApiImportImageManifestRequest) Contents(contents map[string]interface{}) ApiImportImageManifestRequest { + r.contents = &contents + return r +} + +func (r ApiImportImageManifestRequest) Execute() (*ImageImportContentResponse, *http.Response, error) { + return r.ApiService.ImportImageManifestExecute(r) +} + +/* +ImportImageManifest Import a docker or OCI distribution manifest to associate with the image + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiImportImageManifestRequest +*/ +func (a *ImportsApiService) ImportImageManifest(ctx context.Context, operationId string) ApiImportImageManifestRequest { + return ApiImportImageManifestRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportContentResponse +func (a *ImportsApiService) ImportImageManifestExecute(r ApiImportImageManifestRequest) (*ImageImportContentResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportContentResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ImportImageManifest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/manifest" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contents == nil { + return localVarReturnValue, nil, reportError("contents is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.oci.image.manifest.v1+json", "application/vnd.docker.distribution.manifest.v2+json", "application/vnd.docker.distribution.manifest.v1+json", "application/vnd.docker.distribution.manifest.v1+prettyjws"} + + // 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.contents + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiImportImagePackagesRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string + sbom *ImagePackageManifest +} + +func (r ApiImportImagePackagesRequest) Sbom(sbom ImagePackageManifest) ApiImportImagePackagesRequest { + r.sbom = &sbom + return r +} + +func (r ApiImportImagePackagesRequest) Execute() (*ImageImportContentResponse, *http.Response, error) { + return r.ApiService.ImportImagePackagesExecute(r) +} + +/* +ImportImagePackages Begin the import of an image analyzed by Syft into the system + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiImportImagePackagesRequest +*/ +func (a *ImportsApiService) ImportImagePackages(ctx context.Context, operationId string) ApiImportImagePackagesRequest { + return ApiImportImagePackagesRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportContentResponse +func (a *ImportsApiService) ImportImagePackagesExecute(r ApiImportImagePackagesRequest) (*ImageImportContentResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportContentResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ImportImagePackages") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/packages" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sbom == nil { + return localVarReturnValue, nil, reportError("sbom 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.sbom + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiImportImageParentManifestRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string + contents *map[string]interface{} +} + +func (r ApiImportImageParentManifestRequest) Contents(contents map[string]interface{}) ApiImportImageParentManifestRequest { + r.contents = &contents + return r +} + +func (r ApiImportImageParentManifestRequest) Execute() (*ImageImportContentResponse, *http.Response, error) { + return r.ApiService.ImportImageParentManifestExecute(r) +} + +/* +ImportImageParentManifest Import a docker or OCI distribution manifest list to associate with the image + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiImportImageParentManifestRequest +*/ +func (a *ImportsApiService) ImportImageParentManifest(ctx context.Context, operationId string) ApiImportImageParentManifestRequest { + return ApiImportImageParentManifestRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportContentResponse +func (a *ImportsApiService) ImportImageParentManifestExecute(r ApiImportImageParentManifestRequest) (*ImageImportContentResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportContentResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ImportImageParentManifest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/parent_manifest" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contents == nil { + return localVarReturnValue, nil, reportError("contents is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.docker.distribution.manifest.list.v2+json", "application/vnd.oci.image.index.v1+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.contents + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvalidateOperationRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiInvalidateOperationRequest) Execute() (*ImageImportOperation, *http.Response, error) { + return r.ApiService.InvalidateOperationExecute(r) +} + +/* +InvalidateOperation Invalidate operation ID so it can be garbage collected + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiInvalidateOperationRequest +*/ +func (a *ImportsApiService) InvalidateOperation(ctx context.Context, operationId string) ApiInvalidateOperationRequest { + return ApiInvalidateOperationRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return ImageImportOperation +func (a *ImportsApiService) InvalidateOperationExecute(r ApiInvalidateOperationRequest) (*ImageImportOperation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageImportOperation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.InvalidateOperation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListImportDockerfilesRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiListImportDockerfilesRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImportDockerfilesExecute(r) +} + +/* +ListImportDockerfiles List uploaded dockerfiles + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiListImportDockerfilesRequest +*/ +func (a *ImportsApiService) ListImportDockerfiles(ctx context.Context, operationId string) ApiListImportDockerfilesRequest { + return ApiListImportDockerfilesRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return []string +func (a *ImportsApiService) ListImportDockerfilesExecute(r ApiListImportDockerfilesRequest) ([]string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ListImportDockerfiles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/dockerfile" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListImportImageConfigsRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiListImportImageConfigsRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImportImageConfigsExecute(r) +} + +/* +ListImportImageConfigs List uploaded image configs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiListImportImageConfigsRequest +*/ +func (a *ImportsApiService) ListImportImageConfigs(ctx context.Context, operationId string) ApiListImportImageConfigsRequest { + return ApiListImportImageConfigsRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return []string +func (a *ImportsApiService) ListImportImageConfigsExecute(r ApiListImportImageConfigsRequest) ([]string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ListImportImageConfigs") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/image_config" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListImportImageManifestsRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiListImportImageManifestsRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImportImageManifestsExecute(r) +} + +/* +ListImportImageManifests List uploaded image manifests + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiListImportImageManifestsRequest +*/ +func (a *ImportsApiService) ListImportImageManifests(ctx context.Context, operationId string) ApiListImportImageManifestsRequest { + return ApiListImportImageManifestsRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return []string +func (a *ImportsApiService) ListImportImageManifestsExecute(r ApiListImportImageManifestsRequest) ([]string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ListImportImageManifests") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/manifest" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListImportPackagesRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiListImportPackagesRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImportPackagesExecute(r) +} + +/* +ListImportPackages List uploaded package manifests + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiListImportPackagesRequest +*/ +func (a *ImportsApiService) ListImportPackages(ctx context.Context, operationId string) ApiListImportPackagesRequest { + return ApiListImportPackagesRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return []string +func (a *ImportsApiService) ListImportPackagesExecute(r ApiListImportPackagesRequest) ([]string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ListImportPackages") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/packages" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListImportParentManifestsRequest struct { + ctx context.Context + ApiService *ImportsApiService + operationId string +} + +func (r ApiListImportParentManifestsRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.ListImportParentManifestsExecute(r) +} + +/* +ListImportParentManifests List uploaded parent manifests (manifest lists for a tag) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param operationId + @return ApiListImportParentManifestsRequest +*/ +func (a *ImportsApiService) ListImportParentManifests(ctx context.Context, operationId string) ApiListImportParentManifestsRequest { + return ApiListImportParentManifestsRequest{ + ApiService: a, + ctx: ctx, + operationId: operationId, + } +} + +// Execute executes the request +// @return []string +func (a *ImportsApiService) ListImportParentManifestsExecute(r ApiListImportParentManifestsRequest) ([]string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ListImportParentManifests") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images/{operation_id}/parent_manifest" + localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterToString(r.operationId, "")), -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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListOperationsRequest struct { + ctx context.Context + ApiService *ImportsApiService +} + +func (r ApiListOperationsRequest) Execute() ([]ImageImportOperation, *http.Response, error) { + return r.ApiService.ListOperationsExecute(r) +} + +/* +ListOperations Lists in-progress imports + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListOperationsRequest +*/ +func (a *ImportsApiService) ListOperations(ctx context.Context) ApiListOperationsRequest { + return ApiListOperationsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []ImageImportOperation +func (a *ImportsApiService) ListOperationsExecute(r ApiListOperationsRequest) ([]ImageImportOperation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ImageImportOperation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportsApiService.ListOperations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/imports/images" + + 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/.gen/anchore/api_policies.go b/.gen/anchore/api_policies.go index 5086bfb225..57b2a1c725 100644 --- a/.gen/anchore/api_policies.go +++ b/.gen/anchore/api_policies.go @@ -1,62 +1,89 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // PoliciesApiService PoliciesApi service type PoliciesApiService service -// AddPolicyOpts Optional parameters for the method 'AddPolicy' -type AddPolicyOpts struct { - XAnchoreAccount optional.String +type ApiAddPolicyRequest struct { + ctx context.Context + ApiService *PoliciesApiService + bundle *PolicyBundle + xAnchoreAccount *string +} + +func (r ApiAddPolicyRequest) Bundle(bundle PolicyBundle) ApiAddPolicyRequest { + r.bundle = &bundle + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiAddPolicyRequest) XAnchoreAccount(xAnchoreAccount string) ApiAddPolicyRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiAddPolicyRequest) Execute() (*PolicyBundleRecord, *http.Response, error) { + return r.ApiService.AddPolicyExecute(r) } /* AddPolicy Add a new policy + Adds a new policy bundle to the system - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param bundle - * @param optional nil or *AddPolicyOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return PolicyBundleRecord + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddPolicyRequest */ -func (a *PoliciesApiService) AddPolicy(ctx _context.Context, bundle PolicyBundle, localVarOptionals *AddPolicyOpts) (PolicyBundleRecord, *_nethttp.Response, error) { +func (a *PoliciesApiService) AddPolicy(ctx context.Context) ApiAddPolicyRequest { + return ApiAddPolicyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PolicyBundleRecord +func (a *PoliciesApiService) AddPolicyExecute(r ApiAddPolicyRequest) (*PolicyBundleRecord, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PolicyBundleRecord + formFiles []formFile + localVarReturnValue *PolicyBundleRecord ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesApiService.AddPolicy") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bundle == nil { + return localVarReturnValue, nil, reportError("bundle is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -75,29 +102,30 @@ func (a *PoliciesApiService) AddPolicy(ctx _context.Context, bundle PolicyBundle if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = &bundle - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.bundle + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -115,7 +143,7 @@ func (a *PoliciesApiService) AddPolicy(ctx _context.Context, bundle PolicyBundle err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -125,35 +153,59 @@ func (a *PoliciesApiService) AddPolicy(ctx _context.Context, bundle PolicyBundle return localVarReturnValue, localVarHTTPResponse, nil } -// DeletePolicyOpts Optional parameters for the method 'DeletePolicy' -type DeletePolicyOpts struct { - XAnchoreAccount optional.String +type ApiDeletePolicyRequest struct { + ctx context.Context + ApiService *PoliciesApiService + policyId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeletePolicyRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeletePolicyRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeletePolicyRequest) Execute() (*http.Response, error) { + return r.ApiService.DeletePolicyExecute(r) } /* DeletePolicy Delete policy + Delete the specified policy - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyId - * @param optional nil or *DeletePolicyOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyId + @return ApiDeletePolicyRequest */ -func (a *PoliciesApiService) DeletePolicy(ctx _context.Context, policyId string, localVarOptionals *DeletePolicyOpts) (*_nethttp.Response, error) { +func (a *PoliciesApiService) DeletePolicy(ctx context.Context, policyId string) ApiDeletePolicyRequest { + return ApiDeletePolicyRequest{ + ApiService: a, + ctx: ctx, + policyId: policyId, + } +} + +// Execute executes the request +func (a *PoliciesApiService) DeletePolicyExecute(r ApiDeletePolicyRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policyId}" - localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", _neturl.QueryEscape(parameterToString(policyId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesApiService.DeletePolicy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/{policyId}" + localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", url.PathEscape(parameterToString(r.policyId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -172,27 +224,28 @@ func (a *PoliciesApiService) DeletePolicy(ctx _context.Context, policyId string, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -221,42 +274,71 @@ func (a *PoliciesApiService) DeletePolicy(ctx _context.Context, policyId string, return localVarHTTPResponse, nil } -// GetPolicyOpts Optional parameters for the method 'GetPolicy' -type GetPolicyOpts struct { - Detail optional.Bool - XAnchoreAccount optional.String +type ApiGetPolicyRequest struct { + ctx context.Context + ApiService *PoliciesApiService + policyId string + detail *bool + xAnchoreAccount *string +} + +// Include policy bundle detail in the form of the full bundle content for each entry +func (r ApiGetPolicyRequest) Detail(detail bool) ApiGetPolicyRequest { + r.detail = &detail + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetPolicyRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetPolicyRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetPolicyRequest) Execute() ([]PolicyBundleRecord, *http.Response, error) { + return r.ApiService.GetPolicyExecute(r) } /* GetPolicy Get specific policy + Get the policy bundle content - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyId - * @param optional nil or *GetPolicyOpts - Optional Parameters: - * @param "Detail" (optional.Bool) - Include policy bundle detail in the form of the full bundle content for each entry - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []PolicyBundleRecord + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyId + @return ApiGetPolicyRequest */ -func (a *PoliciesApiService) GetPolicy(ctx _context.Context, policyId string, localVarOptionals *GetPolicyOpts) ([]PolicyBundleRecord, *_nethttp.Response, error) { +func (a *PoliciesApiService) GetPolicy(ctx context.Context, policyId string) ApiGetPolicyRequest { + return ApiGetPolicyRequest{ + ApiService: a, + ctx: ctx, + policyId: policyId, + } +} + +// Execute executes the request +// @return []PolicyBundleRecord +func (a *PoliciesApiService) GetPolicyExecute(r ApiGetPolicyRequest) ([]PolicyBundleRecord, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []PolicyBundleRecord ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policyId}" - localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", _neturl.QueryEscape(parameterToString(policyId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesApiService.GetPolicy") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/{policyId}" + localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", url.PathEscape(parameterToString(r.policyId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Detail.IsSet() { - localVarQueryParams.Add("detail", parameterToString(localVarOptionals.Detail.Value(), "")) + if r.detail != nil { + localVarQueryParams.Add("detail", parameterToString(*r.detail, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -275,27 +357,28 @@ func (a *PoliciesApiService) GetPolicy(ctx _context.Context, policyId string, lo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -313,7 +396,7 @@ func (a *PoliciesApiService) GetPolicy(ctx _context.Context, policyId string, lo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -323,39 +406,67 @@ func (a *PoliciesApiService) GetPolicy(ctx _context.Context, policyId string, lo return localVarReturnValue, localVarHTTPResponse, nil } -// ListPoliciesOpts Optional parameters for the method 'ListPolicies' -type ListPoliciesOpts struct { - Detail optional.Bool - XAnchoreAccount optional.String +type ApiListPoliciesRequest struct { + ctx context.Context + ApiService *PoliciesApiService + detail *bool + xAnchoreAccount *string +} + +// Include policy bundle detail in the form of the full bundle content for each entry +func (r ApiListPoliciesRequest) Detail(detail bool) ApiListPoliciesRequest { + r.detail = &detail + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListPoliciesRequest) XAnchoreAccount(xAnchoreAccount string) ApiListPoliciesRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListPoliciesRequest) Execute() ([]PolicyBundleRecord, *http.Response, error) { + return r.ApiService.ListPoliciesExecute(r) } /* ListPolicies List policies + List all saved policy bundles - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListPoliciesOpts - Optional Parameters: - * @param "Detail" (optional.Bool) - Include policy bundle detail in the form of the full bundle content for each entry - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []PolicyBundleRecord + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPoliciesRequest */ -func (a *PoliciesApiService) ListPolicies(ctx _context.Context, localVarOptionals *ListPoliciesOpts) ([]PolicyBundleRecord, *_nethttp.Response, error) { +func (a *PoliciesApiService) ListPolicies(ctx context.Context) ApiListPoliciesRequest { + return ApiListPoliciesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []PolicyBundleRecord +func (a *PoliciesApiService) ListPoliciesExecute(r ApiListPoliciesRequest) ([]PolicyBundleRecord, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []PolicyBundleRecord ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesApiService.ListPolicies") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Detail.IsSet() { - localVarQueryParams.Add("detail", parameterToString(localVarOptionals.Detail.Value(), "")) + if r.detail != nil { + localVarQueryParams.Add("detail", parameterToString(*r.detail, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -374,27 +485,28 @@ func (a *PoliciesApiService) ListPolicies(ctx _context.Context, localVarOptional if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -403,7 +515,7 @@ func (a *PoliciesApiService) ListPolicies(ctx _context.Context, localVarOptional err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -413,43 +525,80 @@ func (a *PoliciesApiService) ListPolicies(ctx _context.Context, localVarOptional return localVarReturnValue, localVarHTTPResponse, nil } -// UpdatePolicyOpts Optional parameters for the method 'UpdatePolicy' -type UpdatePolicyOpts struct { - Active optional.Bool - XAnchoreAccount optional.String +type ApiUpdatePolicyRequest struct { + ctx context.Context + ApiService *PoliciesApiService + policyId string + bundle *PolicyBundleRecord + active *bool + xAnchoreAccount *string +} + +func (r ApiUpdatePolicyRequest) Bundle(bundle PolicyBundleRecord) ApiUpdatePolicyRequest { + r.bundle = &bundle + return r +} + +// Mark policy as active +func (r ApiUpdatePolicyRequest) Active(active bool) ApiUpdatePolicyRequest { + r.active = &active + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiUpdatePolicyRequest) XAnchoreAccount(xAnchoreAccount string) ApiUpdatePolicyRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiUpdatePolicyRequest) Execute() ([]PolicyBundleRecord, *http.Response, error) { + return r.ApiService.UpdatePolicyExecute(r) } /* UpdatePolicy Update policy + Update/replace and existing policy - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param policyId - * @param bundle - * @param optional nil or *UpdatePolicyOpts - Optional Parameters: - * @param "Active" (optional.Bool) - Mark policy as active - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []PolicyBundleRecord + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyId + @return ApiUpdatePolicyRequest */ -func (a *PoliciesApiService) UpdatePolicy(ctx _context.Context, policyId string, bundle PolicyBundleRecord, localVarOptionals *UpdatePolicyOpts) ([]PolicyBundleRecord, *_nethttp.Response, error) { +func (a *PoliciesApiService) UpdatePolicy(ctx context.Context, policyId string) ApiUpdatePolicyRequest { + return ApiUpdatePolicyRequest{ + ApiService: a, + ctx: ctx, + policyId: policyId, + } +} + +// Execute executes the request +// @return []PolicyBundleRecord +func (a *PoliciesApiService) UpdatePolicyExecute(r ApiUpdatePolicyRequest) ([]PolicyBundleRecord, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []PolicyBundleRecord ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policyId}" - localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", _neturl.QueryEscape(parameterToString(policyId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesApiService.UpdatePolicy") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/{policyId}" + localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", url.PathEscape(parameterToString(r.policyId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bundle == nil { + return localVarReturnValue, nil, reportError("bundle is required and must be specified") + } - if localVarOptionals != nil && localVarOptionals.Active.IsSet() { - localVarQueryParams.Add("active", parameterToString(localVarOptionals.Active.Value(), "")) + if r.active != nil { + localVarQueryParams.Add("active", parameterToString(*r.active, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -468,29 +617,30 @@ func (a *PoliciesApiService) UpdatePolicy(ctx _context.Context, policyId string, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = &bundle - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.bundle + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -508,7 +658,7 @@ func (a *PoliciesApiService) UpdatePolicy(ctx _context.Context, policyId string, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_policy.go b/.gen/anchore/api_policy.go deleted file mode 100644 index aedcaf6e15..0000000000 --- a/.gen/anchore/api_policy.go +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -) - -// Linger please -var ( - _ _context.Context -) - -// PolicyApiService PolicyApi service -type PolicyApiService service - -/* -DescribePolicy Describe the policy language spec implemented by this service. -Get the policy language spec for this service - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []GateSpec -*/ -func (a *PolicyApiService) DescribePolicy(ctx _context.Context) ([]GateSpec, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []GateSpec - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/policy_spec" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.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 - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/.gen/anchore/api_query.go b/.gen/anchore/api_query.go new file mode 100644 index 0000000000..7ea166a742 --- /dev/null +++ b/.gen/anchore/api_query.go @@ -0,0 +1,551 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// QueryApiService QueryApi service +type QueryApiService service + +type ApiQueryImagesByPackageRequest struct { + ctx context.Context + ApiService *QueryApiService + name *string + packageType *string + version *string + page *string + limit *int32 + xAnchoreAccount *string +} + +// Name of package to search for (e.g. sed) +func (r ApiQueryImagesByPackageRequest) Name(name string) ApiQueryImagesByPackageRequest { + r.name = &name + return r +} + +// Type of package to filter on (e.g. dpkg) +func (r ApiQueryImagesByPackageRequest) PackageType(packageType string) ApiQueryImagesByPackageRequest { + r.packageType = &packageType + return r +} + +// Version of named package to filter on (e.g. 4.4-1) +func (r ApiQueryImagesByPackageRequest) Version(version string) ApiQueryImagesByPackageRequest { + r.version = &version + return r +} + +// The page of results to fetch. Pages start at 1 +func (r ApiQueryImagesByPackageRequest) Page(page string) ApiQueryImagesByPackageRequest { + r.page = &page + return r +} + +// Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page +func (r ApiQueryImagesByPackageRequest) Limit(limit int32) ApiQueryImagesByPackageRequest { + r.limit = &limit + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiQueryImagesByPackageRequest) XAnchoreAccount(xAnchoreAccount string) ApiQueryImagesByPackageRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiQueryImagesByPackageRequest) Execute() (*PaginatedImageList, *http.Response, error) { + return r.ApiService.QueryImagesByPackageExecute(r) +} + +/* +QueryImagesByPackage List of images containing given package + +Filterable query interface to search for images containing specified package + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiQueryImagesByPackageRequest +*/ +func (a *QueryApiService) QueryImagesByPackage(ctx context.Context) ApiQueryImagesByPackageRequest { + return ApiQueryImagesByPackageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaginatedImageList +func (a *QueryApiService) QueryImagesByPackageExecute(r ApiQueryImagesByPackageRequest) (*PaginatedImageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedImageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QueryApiService.QueryImagesByPackage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/query/images/by_package" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.name == nil { + return localVarReturnValue, nil, reportError("name is required and must be specified") + } + + localVarQueryParams.Add("name", parameterToString(*r.name, "")) + if r.packageType != nil { + localVarQueryParams.Add("package_type", parameterToString(*r.packageType, "")) + } + if r.version != nil { + localVarQueryParams.Add("version", parameterToString(*r.version, "")) + } + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiQueryImagesByVulnerabilityRequest struct { + ctx context.Context + ApiService *QueryApiService + vulnerabilityId *string + namespace *string + affectedPackage *string + severity *string + vendorOnly *bool + page *int32 + limit *int32 + xAnchoreAccount *string +} + +// The ID of the vulnerability to search for within all images stored in anchore-engine (e.g. CVE-1999-0001) +func (r ApiQueryImagesByVulnerabilityRequest) VulnerabilityId(vulnerabilityId string) ApiQueryImagesByVulnerabilityRequest { + r.vulnerabilityId = &vulnerabilityId + return r +} + +// Filter results to images within the given vulnerability namespace (e.g. debian:8, ubuntu:14.04) +func (r ApiQueryImagesByVulnerabilityRequest) Namespace(namespace string) ApiQueryImagesByVulnerabilityRequest { + r.namespace = &namespace + return r +} + +// Filter results to images with vulnable packages with the given package name (e.g. libssl) +func (r ApiQueryImagesByVulnerabilityRequest) AffectedPackage(affectedPackage string) ApiQueryImagesByVulnerabilityRequest { + r.affectedPackage = &affectedPackage + return r +} + +// Filter results to vulnerable package/vulnerability with the given severity +func (r ApiQueryImagesByVulnerabilityRequest) Severity(severity string) ApiQueryImagesByVulnerabilityRequest { + r.severity = &severity + return r +} + +// Filter results to include only vulnerabilities that are not marked as invalid by upstream OS vendor data +func (r ApiQueryImagesByVulnerabilityRequest) VendorOnly(vendorOnly bool) ApiQueryImagesByVulnerabilityRequest { + r.vendorOnly = &vendorOnly + return r +} + +// The page of results to fetch. Pages start at 1 +func (r ApiQueryImagesByVulnerabilityRequest) Page(page int32) ApiQueryImagesByVulnerabilityRequest { + r.page = &page + return r +} + +// Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page +func (r ApiQueryImagesByVulnerabilityRequest) Limit(limit int32) ApiQueryImagesByVulnerabilityRequest { + r.limit = &limit + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiQueryImagesByVulnerabilityRequest) XAnchoreAccount(xAnchoreAccount string) ApiQueryImagesByVulnerabilityRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiQueryImagesByVulnerabilityRequest) Execute() (*PaginatedVulnerableImageList, *http.Response, error) { + return r.ApiService.QueryImagesByVulnerabilityExecute(r) +} + +/* +QueryImagesByVulnerability List images vulnerable to the specific vulnerability ID. + +Returns a listing of images and their respective packages vulnerable to the given vulnerability ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiQueryImagesByVulnerabilityRequest +*/ +func (a *QueryApiService) QueryImagesByVulnerability(ctx context.Context) ApiQueryImagesByVulnerabilityRequest { + return ApiQueryImagesByVulnerabilityRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaginatedVulnerableImageList +func (a *QueryApiService) QueryImagesByVulnerabilityExecute(r ApiQueryImagesByVulnerabilityRequest) (*PaginatedVulnerableImageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVulnerableImageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QueryApiService.QueryImagesByVulnerability") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/query/images/by_vulnerability" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vulnerabilityId == nil { + return localVarReturnValue, nil, reportError("vulnerabilityId is required and must be specified") + } + + localVarQueryParams.Add("vulnerability_id", parameterToString(*r.vulnerabilityId, "")) + if r.namespace != nil { + localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) + } + if r.affectedPackage != nil { + localVarQueryParams.Add("affected_package", parameterToString(*r.affectedPackage, "")) + } + if r.severity != nil { + localVarQueryParams.Add("severity", parameterToString(*r.severity, "")) + } + if r.vendorOnly != nil { + localVarQueryParams.Add("vendor_only", parameterToString(*r.vendorOnly, "")) + } + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiQueryVulnerabilitiesRequest struct { + ctx context.Context + ApiService *QueryApiService + id *[]string + affectedPackage *string + affectedPackageVersion *string + page *string + limit *int32 + namespace *[]string +} + +// The ID of the vulnerability (e.g. CVE-1999-0001) +func (r ApiQueryVulnerabilitiesRequest) Id(id []string) ApiQueryVulnerabilitiesRequest { + r.id = &id + return r +} + +// Filter results by specified package name (e.g. sed) +func (r ApiQueryVulnerabilitiesRequest) AffectedPackage(affectedPackage string) ApiQueryVulnerabilitiesRequest { + r.affectedPackage = &affectedPackage + return r +} + +// Filter results by specified package version (e.g. 4.4-1) +func (r ApiQueryVulnerabilitiesRequest) AffectedPackageVersion(affectedPackageVersion string) ApiQueryVulnerabilitiesRequest { + r.affectedPackageVersion = &affectedPackageVersion + return r +} + +// The page of results to fetch. Pages start at 1 +func (r ApiQueryVulnerabilitiesRequest) Page(page string) ApiQueryVulnerabilitiesRequest { + r.page = &page + return r +} + +// Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page +func (r ApiQueryVulnerabilitiesRequest) Limit(limit int32) ApiQueryVulnerabilitiesRequest { + r.limit = &limit + return r +} + +// Namespace(s) to filter vulnerability records by +func (r ApiQueryVulnerabilitiesRequest) Namespace(namespace []string) ApiQueryVulnerabilitiesRequest { + r.namespace = &namespace + return r +} + +func (r ApiQueryVulnerabilitiesRequest) Execute() (*PaginatedVulnerabilityList, *http.Response, error) { + return r.ApiService.QueryVulnerabilitiesExecute(r) +} + +/* +QueryVulnerabilities Listing information about given vulnerability + +List (w/filters) vulnerability records known by the system, with affected packages information if present + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiQueryVulnerabilitiesRequest +*/ +func (a *QueryApiService) QueryVulnerabilities(ctx context.Context) ApiQueryVulnerabilitiesRequest { + return ApiQueryVulnerabilitiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaginatedVulnerabilityList +func (a *QueryApiService) QueryVulnerabilitiesExecute(r ApiQueryVulnerabilitiesRequest) (*PaginatedVulnerabilityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVulnerabilityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QueryApiService.QueryVulnerabilities") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/query/vulnerabilities" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.id == nil { + return localVarReturnValue, nil, reportError("id is required and must be specified") + } + + localVarQueryParams.Add("id", parameterToString(*r.id, "csv")) + if r.affectedPackage != nil { + localVarQueryParams.Add("affected_package", parameterToString(*r.affectedPackage, "")) + } + if r.affectedPackageVersion != nil { + localVarQueryParams.Add("affected_package_version", parameterToString(*r.affectedPackageVersion, "")) + } + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.namespace != nil { + localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/.gen/anchore/api_registries.go b/.gen/anchore/api_registries.go index 202ed7afad..ee8485613d 100644 --- a/.gen/anchore/api_registries.go +++ b/.gen/anchore/api_registries.go @@ -1,67 +1,99 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // RegistriesApiService RegistriesApi service type RegistriesApiService service -// CreateRegistryOpts Optional parameters for the method 'CreateRegistry' -type CreateRegistryOpts struct { - Validate optional.Bool - XAnchoreAccount optional.String +type ApiCreateRegistryRequest struct { + ctx context.Context + ApiService *RegistriesApiService + registrydata *RegistryConfigurationRequest + validate *bool + xAnchoreAccount *string +} + +func (r ApiCreateRegistryRequest) Registrydata(registrydata RegistryConfigurationRequest) ApiCreateRegistryRequest { + r.registrydata = ®istrydata + return r +} + +// flag to determine whether or not to validate registry/credential at registry add time +func (r ApiCreateRegistryRequest) Validate(validate bool) ApiCreateRegistryRequest { + r.validate = &validate + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiCreateRegistryRequest) XAnchoreAccount(xAnchoreAccount string) ApiCreateRegistryRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiCreateRegistryRequest) Execute() ([]RegistryConfiguration, *http.Response, error) { + return r.ApiService.CreateRegistryExecute(r) } /* CreateRegistry Add a new registry + Adds a new registry to the system - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param registrydata - * @param optional nil or *CreateRegistryOpts - Optional Parameters: - * @param "Validate" (optional.Bool) - flag to determine whether or not to validate registry/credential at registry add time - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []RegistryConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateRegistryRequest */ -func (a *RegistriesApiService) CreateRegistry(ctx _context.Context, registrydata RegistryConfigurationRequest, localVarOptionals *CreateRegistryOpts) ([]RegistryConfiguration, *_nethttp.Response, error) { +func (a *RegistriesApiService) CreateRegistry(ctx context.Context) ApiCreateRegistryRequest { + return ApiCreateRegistryRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []RegistryConfiguration +func (a *RegistriesApiService) CreateRegistryExecute(r ApiCreateRegistryRequest) ([]RegistryConfiguration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []RegistryConfiguration ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/registries" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegistriesApiService.CreateRegistry") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/registries" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.registrydata == nil { + return localVarReturnValue, nil, reportError("registrydata is required and must be specified") + } - if localVarOptionals != nil && localVarOptionals.Validate.IsSet() { - localVarQueryParams.Add("validate", parameterToString(localVarOptionals.Validate.Value(), "")) + if r.validate != nil { + localVarQueryParams.Add("validate", parameterToString(*r.validate, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -80,29 +112,30 @@ func (a *RegistriesApiService) CreateRegistry(ctx _context.Context, registrydata if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = ®istrydata - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.registrydata + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -120,7 +153,7 @@ func (a *RegistriesApiService) CreateRegistry(ctx _context.Context, registrydata err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -130,35 +163,59 @@ func (a *RegistriesApiService) CreateRegistry(ctx _context.Context, registrydata return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteRegistryOpts Optional parameters for the method 'DeleteRegistry' -type DeleteRegistryOpts struct { - XAnchoreAccount optional.String +type ApiDeleteRegistryRequest struct { + ctx context.Context + ApiService *RegistriesApiService + registry string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteRegistryRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteRegistryRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteRegistryRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteRegistryExecute(r) } /* DeleteRegistry Delete a registry configuration + Delete a registry configuration record from the system. Does not remove any images. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param registry - * @param optional nil or *DeleteRegistryOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param registry + @return ApiDeleteRegistryRequest */ -func (a *RegistriesApiService) DeleteRegistry(ctx _context.Context, registry string, localVarOptionals *DeleteRegistryOpts) (*_nethttp.Response, error) { +func (a *RegistriesApiService) DeleteRegistry(ctx context.Context, registry string) ApiDeleteRegistryRequest { + return ApiDeleteRegistryRequest{ + ApiService: a, + ctx: ctx, + registry: registry, + } +} + +// Execute executes the request +func (a *RegistriesApiService) DeleteRegistryExecute(r ApiDeleteRegistryRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/registries/{registry}" - localVarPath = strings.Replace(localVarPath, "{"+"registry"+"}", _neturl.QueryEscape(parameterToString(registry, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegistriesApiService.DeleteRegistry") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/registries/{registry}" + localVarPath = strings.Replace(localVarPath, "{"+"registry"+"}", url.PathEscape(parameterToString(r.registry, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -177,27 +234,28 @@ func (a *RegistriesApiService) DeleteRegistry(ctx _context.Context, registry str if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -216,37 +274,61 @@ func (a *RegistriesApiService) DeleteRegistry(ctx _context.Context, registry str return localVarHTTPResponse, nil } -// GetRegistryOpts Optional parameters for the method 'GetRegistry' -type GetRegistryOpts struct { - XAnchoreAccount optional.String +type ApiGetRegistryRequest struct { + ctx context.Context + ApiService *RegistriesApiService + registry string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetRegistryRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetRegistryRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetRegistryRequest) Execute() ([]RegistryConfiguration, *http.Response, error) { + return r.ApiService.GetRegistryExecute(r) } /* GetRegistry Get a specific registry configuration + Get information on a specific registry - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param registry - * @param optional nil or *GetRegistryOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []RegistryConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param registry + @return ApiGetRegistryRequest */ -func (a *RegistriesApiService) GetRegistry(ctx _context.Context, registry string, localVarOptionals *GetRegistryOpts) ([]RegistryConfiguration, *_nethttp.Response, error) { +func (a *RegistriesApiService) GetRegistry(ctx context.Context, registry string) ApiGetRegistryRequest { + return ApiGetRegistryRequest{ + ApiService: a, + ctx: ctx, + registry: registry, + } +} + +// Execute executes the request +// @return []RegistryConfiguration +func (a *RegistriesApiService) GetRegistryExecute(r ApiGetRegistryRequest) ([]RegistryConfiguration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []RegistryConfiguration ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/registries/{registry}" - localVarPath = strings.Replace(localVarPath, "{"+"registry"+"}", _neturl.QueryEscape(parameterToString(registry, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegistriesApiService.GetRegistry") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/registries/{registry}" + localVarPath = strings.Replace(localVarPath, "{"+"registry"+"}", url.PathEscape(parameterToString(r.registry, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -265,27 +347,28 @@ func (a *RegistriesApiService) GetRegistry(ctx _context.Context, registry string if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -294,7 +377,7 @@ func (a *RegistriesApiService) GetRegistry(ctx _context.Context, registry string err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -304,34 +387,57 @@ func (a *RegistriesApiService) GetRegistry(ctx _context.Context, registry string return localVarReturnValue, localVarHTTPResponse, nil } -// ListRegistriesOpts Optional parameters for the method 'ListRegistries' -type ListRegistriesOpts struct { - XAnchoreAccount optional.String +type ApiListRegistriesRequest struct { + ctx context.Context + ApiService *RegistriesApiService + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListRegistriesRequest) XAnchoreAccount(xAnchoreAccount string) ApiListRegistriesRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListRegistriesRequest) Execute() ([]RegistryConfiguration, *http.Response, error) { + return r.ApiService.ListRegistriesExecute(r) } /* ListRegistries List configured registries + List all configured registries the system can/will watch - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListRegistriesOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []RegistryConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListRegistriesRequest */ -func (a *RegistriesApiService) ListRegistries(ctx _context.Context, localVarOptionals *ListRegistriesOpts) ([]RegistryConfiguration, *_nethttp.Response, error) { +func (a *RegistriesApiService) ListRegistries(ctx context.Context) ApiListRegistriesRequest { + return ApiListRegistriesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []RegistryConfiguration +func (a *RegistriesApiService) ListRegistriesExecute(r ApiListRegistriesRequest) ([]RegistryConfiguration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []RegistryConfiguration ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/registries" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegistriesApiService.ListRegistries") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/registries" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -350,27 +456,28 @@ func (a *RegistriesApiService) ListRegistries(ctx _context.Context, localVarOpti if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -379,7 +486,7 @@ func (a *RegistriesApiService) ListRegistries(ctx _context.Context, localVarOpti err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -389,43 +496,80 @@ func (a *RegistriesApiService) ListRegistries(ctx _context.Context, localVarOpti return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateRegistryOpts Optional parameters for the method 'UpdateRegistry' -type UpdateRegistryOpts struct { - Validate optional.Bool - XAnchoreAccount optional.String +type ApiUpdateRegistryRequest struct { + ctx context.Context + ApiService *RegistriesApiService + registry string + registrydata *RegistryConfigurationRequest + validate *bool + xAnchoreAccount *string +} + +func (r ApiUpdateRegistryRequest) Registrydata(registrydata RegistryConfigurationRequest) ApiUpdateRegistryRequest { + r.registrydata = ®istrydata + return r +} + +// flag to determine whether or not to validate registry/credential at registry update time +func (r ApiUpdateRegistryRequest) Validate(validate bool) ApiUpdateRegistryRequest { + r.validate = &validate + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiUpdateRegistryRequest) XAnchoreAccount(xAnchoreAccount string) ApiUpdateRegistryRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiUpdateRegistryRequest) Execute() ([]RegistryConfiguration, *http.Response, error) { + return r.ApiService.UpdateRegistryExecute(r) } /* UpdateRegistry Update/replace a registry configuration + Replaces an existing registry record with the given record - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param registry - * @param registrydata - * @param optional nil or *UpdateRegistryOpts - Optional Parameters: - * @param "Validate" (optional.Bool) - flag to determine whether or not to validate registry/credential at registry update time - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []RegistryConfiguration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param registry + @return ApiUpdateRegistryRequest */ -func (a *RegistriesApiService) UpdateRegistry(ctx _context.Context, registry string, registrydata RegistryConfigurationRequest, localVarOptionals *UpdateRegistryOpts) ([]RegistryConfiguration, *_nethttp.Response, error) { +func (a *RegistriesApiService) UpdateRegistry(ctx context.Context, registry string) ApiUpdateRegistryRequest { + return ApiUpdateRegistryRequest{ + ApiService: a, + ctx: ctx, + registry: registry, + } +} + +// Execute executes the request +// @return []RegistryConfiguration +func (a *RegistriesApiService) UpdateRegistryExecute(r ApiUpdateRegistryRequest) ([]RegistryConfiguration, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []RegistryConfiguration ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/registries/{registry}" - localVarPath = strings.Replace(localVarPath, "{"+"registry"+"}", _neturl.QueryEscape(parameterToString(registry, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegistriesApiService.UpdateRegistry") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/registries/{registry}" + localVarPath = strings.Replace(localVarPath, "{"+"registry"+"}", url.PathEscape(parameterToString(r.registry, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.registrydata == nil { + return localVarReturnValue, nil, reportError("registrydata is required and must be specified") + } - if localVarOptionals != nil && localVarOptionals.Validate.IsSet() { - localVarQueryParams.Add("validate", parameterToString(localVarOptionals.Validate.Value(), "")) + if r.validate != nil { + localVarQueryParams.Add("validate", parameterToString(*r.validate, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -444,29 +588,30 @@ func (a *RegistriesApiService) UpdateRegistry(ctx _context.Context, registry str if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = ®istrydata - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.registrydata + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -484,7 +629,7 @@ func (a *RegistriesApiService) UpdateRegistry(ctx _context.Context, registry str err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_repository_credentials.go b/.gen/anchore/api_repository_credentials.go index f457eea5f0..1b2b9950e1 100644 --- a/.gen/anchore/api_repository_credentials.go +++ b/.gen/anchore/api_repository_credentials.go @@ -1,71 +1,108 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "github.com/antihax/optional" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // RepositoryCredentialsApiService RepositoryCredentialsApi service type RepositoryCredentialsApiService service -// AddRepositoryOpts Optional parameters for the method 'AddRepository' -type AddRepositoryOpts struct { - Autosubscribe optional.Bool - Lookuptag optional.String - XAnchoreAccount optional.String +type ApiAddRepositoryRequest struct { + ctx context.Context + ApiService *RepositoryCredentialsApiService + repository *string + autosubscribe *bool + dryrun *bool + xAnchoreAccount *string +} + +// full repository to add e.g. docker.io/library/alpine +func (r ApiAddRepositoryRequest) Repository(repository string) ApiAddRepositoryRequest { + r.repository = &repository + return r +} + +// flag to enable/disable auto tag_update activation when new images from a repo are added +func (r ApiAddRepositoryRequest) Autosubscribe(autosubscribe bool) ApiAddRepositoryRequest { + r.autosubscribe = &autosubscribe + return r +} + +// flag to return tags in the repository without actually watching the repository, default is false +func (r ApiAddRepositoryRequest) Dryrun(dryrun bool) ApiAddRepositoryRequest { + r.dryrun = &dryrun + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiAddRepositoryRequest) XAnchoreAccount(xAnchoreAccount string) ApiAddRepositoryRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiAddRepositoryRequest) Execute() ([]Subscription, *http.Response, error) { + return r.ApiService.AddRepositoryExecute(r) } /* AddRepository Add repository to watch - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param repository full repository to add e.g. docker.io/library/alpine - * @param optional nil or *AddRepositoryOpts - Optional Parameters: - * @param "Autosubscribe" (optional.Bool) - flag to enable/disable auto tag_update activation when new images from a repo are added - * @param "Lookuptag" (optional.String) - use specified existing tag to perform repo scan (default is 'latest') - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []Subscription + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddRepositoryRequest */ -func (a *RepositoryCredentialsApiService) AddRepository(ctx _context.Context, repository string, localVarOptionals *AddRepositoryOpts) ([]Subscription, *_nethttp.Response, error) { +func (a *RepositoryCredentialsApiService) AddRepository(ctx context.Context) ApiAddRepositoryRequest { + return ApiAddRepositoryRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Subscription +func (a *RepositoryCredentialsApiService) AddRepositoryExecute(r ApiAddRepositoryRequest) ([]Subscription, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Subscription ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/repositories" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RepositoryCredentialsApiService.AddRepository") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/repositories" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.repository == nil { + return localVarReturnValue, nil, reportError("repository is required and must be specified") + } - localVarQueryParams.Add("repository", parameterToString(repository, "")) - if localVarOptionals != nil && localVarOptionals.Autosubscribe.IsSet() { - localVarQueryParams.Add("autosubscribe", parameterToString(localVarOptionals.Autosubscribe.Value(), "")) + localVarQueryParams.Add("repository", parameterToString(*r.repository, "")) + if r.autosubscribe != nil { + localVarQueryParams.Add("autosubscribe", parameterToString(*r.autosubscribe, "")) } - if localVarOptionals != nil && localVarOptionals.Lookuptag.IsSet() { - localVarQueryParams.Add("lookuptag", parameterToString(localVarOptionals.Lookuptag.Value(), "")) + if r.dryrun != nil { + localVarQueryParams.Add("dryrun", parameterToString(*r.dryrun, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -84,27 +121,28 @@ func (a *RepositoryCredentialsApiService) AddRepository(ctx _context.Context, re if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -113,7 +151,7 @@ func (a *RepositoryCredentialsApiService) AddRepository(ctx _context.Context, re err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_services.go b/.gen/anchore/api_services.go deleted file mode 100644 index 64f63a8ecb..0000000000 --- a/.gen/anchore/api_services.go +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -// ServicesApiService ServicesApi service -type ServicesApiService service - -/* -DeleteService Delete the service config - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param servicename - * @param hostid -*/ -func (a *ServicesApiService) DeleteService(ctx _context.Context, servicename string, hostid string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services/{servicename}/{hostid}" - localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", _neturl.QueryEscape(parameterToString(servicename, "")) , -1) - - localVarPath = strings.Replace(localVarPath, "{"+"hostid"+"}", _neturl.QueryEscape(parameterToString(hostid, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.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 - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* -GetServicesByName Get a service configuration and state - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param servicename -@return []Service -*/ -func (a *ServicesApiService) GetServicesByName(ctx _context.Context, servicename string) ([]Service, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Service - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services/{servicename}" - localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", _neturl.QueryEscape(parameterToString(servicename, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.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 - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* -GetServicesByNameAndHost Get service config for a specific host - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param servicename - * @param hostid -@return []Service -*/ -func (a *ServicesApiService) GetServicesByNameAndHost(ctx _context.Context, servicename string, hostid string) ([]Service, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Service - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services/{servicename}/{hostid}" - localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", _neturl.QueryEscape(parameterToString(servicename, "")) , -1) - - localVarPath = strings.Replace(localVarPath, "{"+"hostid"+"}", _neturl.QueryEscape(parameterToString(hostid, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.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 - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* -ListServices List system services - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []Service -*/ -func (a *ServicesApiService) ListServices(ctx _context.Context) ([]Service, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Service - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.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 - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/.gen/anchore/api_subscriptions.go b/.gen/anchore/api_subscriptions.go index 047c57f681..56949daf7b 100644 --- a/.gen/anchore/api_subscriptions.go +++ b/.gen/anchore/api_subscriptions.go @@ -1,62 +1,89 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // SubscriptionsApiService SubscriptionsApi service type SubscriptionsApiService service -// AddSubscriptionOpts Optional parameters for the method 'AddSubscription' -type AddSubscriptionOpts struct { - XAnchoreAccount optional.String +type ApiAddSubscriptionRequest struct { + ctx context.Context + ApiService *SubscriptionsApiService + subscription *SubscriptionRequest + xAnchoreAccount *string +} + +func (r ApiAddSubscriptionRequest) Subscription(subscription SubscriptionRequest) ApiAddSubscriptionRequest { + r.subscription = &subscription + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiAddSubscriptionRequest) XAnchoreAccount(xAnchoreAccount string) ApiAddSubscriptionRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiAddSubscriptionRequest) Execute() ([]Subscription, *http.Response, error) { + return r.ApiService.AddSubscriptionExecute(r) } /* AddSubscription Add a subscription of a specific type + Create a new subscription to watch a tag and get notifications of changes - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param subscription - * @param optional nil or *AddSubscriptionOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []Subscription + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddSubscriptionRequest */ -func (a *SubscriptionsApiService) AddSubscription(ctx _context.Context, subscription SubscriptionRequest, localVarOptionals *AddSubscriptionOpts) ([]Subscription, *_nethttp.Response, error) { +func (a *SubscriptionsApiService) AddSubscription(ctx context.Context) ApiAddSubscriptionRequest { + return ApiAddSubscriptionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Subscription +func (a *SubscriptionsApiService) AddSubscriptionExecute(r ApiAddSubscriptionRequest) ([]Subscription, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Subscription ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subscriptions" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SubscriptionsApiService.AddSubscription") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/subscriptions" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.subscription == nil { + return localVarReturnValue, nil, reportError("subscription is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -75,29 +102,30 @@ func (a *SubscriptionsApiService) AddSubscription(ctx _context.Context, subscrip if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = &subscription - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.subscription + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -106,7 +134,7 @@ func (a *SubscriptionsApiService) AddSubscription(ctx _context.Context, subscrip err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -116,34 +144,57 @@ func (a *SubscriptionsApiService) AddSubscription(ctx _context.Context, subscrip return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteSubscriptionOpts Optional parameters for the method 'DeleteSubscription' -type DeleteSubscriptionOpts struct { - XAnchoreAccount optional.String +type ApiDeleteSubscriptionRequest struct { + ctx context.Context + ApiService *SubscriptionsApiService + subscriptionId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiDeleteSubscriptionRequest) XAnchoreAccount(xAnchoreAccount string) ApiDeleteSubscriptionRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiDeleteSubscriptionRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteSubscriptionExecute(r) } /* DeleteSubscription Delete subscriptions of a specific type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param subscriptionId - * @param optional nil or *DeleteSubscriptionOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param subscriptionId + @return ApiDeleteSubscriptionRequest */ -func (a *SubscriptionsApiService) DeleteSubscription(ctx _context.Context, subscriptionId string, localVarOptionals *DeleteSubscriptionOpts) (*_nethttp.Response, error) { +func (a *SubscriptionsApiService) DeleteSubscription(ctx context.Context, subscriptionId string) ApiDeleteSubscriptionRequest { + return ApiDeleteSubscriptionRequest{ + ApiService: a, + ctx: ctx, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +func (a *SubscriptionsApiService) DeleteSubscriptionExecute(r ApiDeleteSubscriptionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subscriptions/{subscriptionId}" - localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", _neturl.QueryEscape(parameterToString(subscriptionId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SubscriptionsApiService.DeleteSubscription") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/subscriptions/{subscriptionId}" + localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -162,27 +213,28 @@ func (a *SubscriptionsApiService) DeleteSubscription(ctx _context.Context, subsc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -201,36 +253,59 @@ func (a *SubscriptionsApiService) DeleteSubscription(ctx _context.Context, subsc return localVarHTTPResponse, nil } -// GetSubscriptionOpts Optional parameters for the method 'GetSubscription' -type GetSubscriptionOpts struct { - XAnchoreAccount optional.String +type ApiGetSubscriptionRequest struct { + ctx context.Context + ApiService *SubscriptionsApiService + subscriptionId string + xAnchoreAccount *string +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiGetSubscriptionRequest) XAnchoreAccount(xAnchoreAccount string) ApiGetSubscriptionRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiGetSubscriptionRequest) Execute() ([]Subscription, *http.Response, error) { + return r.ApiService.GetSubscriptionExecute(r) } /* GetSubscription Get a specific subscription set - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param subscriptionId - * @param optional nil or *GetSubscriptionOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []Subscription + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param subscriptionId + @return ApiGetSubscriptionRequest */ -func (a *SubscriptionsApiService) GetSubscription(ctx _context.Context, subscriptionId string, localVarOptionals *GetSubscriptionOpts) ([]Subscription, *_nethttp.Response, error) { +func (a *SubscriptionsApiService) GetSubscription(ctx context.Context, subscriptionId string) ApiGetSubscriptionRequest { + return ApiGetSubscriptionRequest{ + ApiService: a, + ctx: ctx, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +// @return []Subscription +func (a *SubscriptionsApiService) GetSubscriptionExecute(r ApiGetSubscriptionRequest) ([]Subscription, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Subscription ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subscriptions/{subscriptionId}" - localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", _neturl.QueryEscape(parameterToString(subscriptionId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SubscriptionsApiService.GetSubscription") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/subscriptions/{subscriptionId}" + localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -249,27 +324,28 @@ func (a *SubscriptionsApiService) GetSubscription(ctx _context.Context, subscrip if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -287,7 +363,7 @@ func (a *SubscriptionsApiService) GetSubscription(ctx _context.Context, subscrip err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -297,43 +373,75 @@ func (a *SubscriptionsApiService) GetSubscription(ctx _context.Context, subscrip return localVarReturnValue, localVarHTTPResponse, nil } -// ListSubscriptionsOpts Optional parameters for the method 'ListSubscriptions' -type ListSubscriptionsOpts struct { - SubscriptionKey optional.String - SubscriptionType optional.String - XAnchoreAccount optional.String +type ApiListSubscriptionsRequest struct { + ctx context.Context + ApiService *SubscriptionsApiService + subscriptionKey *string + subscriptionType *string + xAnchoreAccount *string +} + +// filter only subscriptions matching key +func (r ApiListSubscriptionsRequest) SubscriptionKey(subscriptionKey string) ApiListSubscriptionsRequest { + r.subscriptionKey = &subscriptionKey + return r +} + +// filter only subscriptions matching type +func (r ApiListSubscriptionsRequest) SubscriptionType(subscriptionType string) ApiListSubscriptionsRequest { + r.subscriptionType = &subscriptionType + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListSubscriptionsRequest) XAnchoreAccount(xAnchoreAccount string) ApiListSubscriptionsRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListSubscriptionsRequest) Execute() ([]Subscription, *http.Response, error) { + return r.ApiService.ListSubscriptionsExecute(r) } /* ListSubscriptions List all subscriptions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListSubscriptionsOpts - Optional Parameters: - * @param "SubscriptionKey" (optional.String) - filter only subscriptions matching key - * @param "SubscriptionType" (optional.String) - filter only subscriptions matching type - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []Subscription + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListSubscriptionsRequest */ -func (a *SubscriptionsApiService) ListSubscriptions(ctx _context.Context, localVarOptionals *ListSubscriptionsOpts) ([]Subscription, *_nethttp.Response, error) { +func (a *SubscriptionsApiService) ListSubscriptions(ctx context.Context) ApiListSubscriptionsRequest { + return ApiListSubscriptionsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Subscription +func (a *SubscriptionsApiService) ListSubscriptionsExecute(r ApiListSubscriptionsRequest) ([]Subscription, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Subscription ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subscriptions" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SubscriptionsApiService.ListSubscriptions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/subscriptions" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.SubscriptionKey.IsSet() { - localVarQueryParams.Add("subscription_key", parameterToString(localVarOptionals.SubscriptionKey.Value(), "")) + if r.subscriptionKey != nil { + localVarQueryParams.Add("subscription_key", parameterToString(*r.subscriptionKey, "")) } - if localVarOptionals != nil && localVarOptionals.SubscriptionType.IsSet() { - localVarQueryParams.Add("subscription_type", parameterToString(localVarOptionals.SubscriptionType.Value(), "")) + if r.subscriptionType != nil { + localVarQueryParams.Add("subscription_type", parameterToString(*r.subscriptionType, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -352,27 +460,28 @@ func (a *SubscriptionsApiService) ListSubscriptions(ctx _context.Context, localV if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -390,7 +499,7 @@ func (a *SubscriptionsApiService) ListSubscriptions(ctx _context.Context, localV err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -400,37 +509,68 @@ func (a *SubscriptionsApiService) ListSubscriptions(ctx _context.Context, localV return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateSubscriptionOpts Optional parameters for the method 'UpdateSubscription' -type UpdateSubscriptionOpts struct { - XAnchoreAccount optional.String +type ApiUpdateSubscriptionRequest struct { + ctx context.Context + ApiService *SubscriptionsApiService + subscriptionId string + subscription *SubscriptionUpdate + xAnchoreAccount *string +} + +func (r ApiUpdateSubscriptionRequest) Subscription(subscription SubscriptionUpdate) ApiUpdateSubscriptionRequest { + r.subscription = &subscription + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiUpdateSubscriptionRequest) XAnchoreAccount(xAnchoreAccount string) ApiUpdateSubscriptionRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiUpdateSubscriptionRequest) Execute() ([]Subscription, *http.Response, error) { + return r.ApiService.UpdateSubscriptionExecute(r) } /* UpdateSubscription Update an existing and specific subscription - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param subscriptionId - * @param subscription - * @param optional nil or *UpdateSubscriptionOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []Subscription + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param subscriptionId + @return ApiUpdateSubscriptionRequest */ -func (a *SubscriptionsApiService) UpdateSubscription(ctx _context.Context, subscriptionId string, subscription SubscriptionUpdate, localVarOptionals *UpdateSubscriptionOpts) ([]Subscription, *_nethttp.Response, error) { +func (a *SubscriptionsApiService) UpdateSubscription(ctx context.Context, subscriptionId string) ApiUpdateSubscriptionRequest { + return ApiUpdateSubscriptionRequest{ + ApiService: a, + ctx: ctx, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +// @return []Subscription +func (a *SubscriptionsApiService) UpdateSubscriptionExecute(r ApiUpdateSubscriptionRequest) ([]Subscription, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Subscription ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subscriptions/{subscriptionId}" - localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", _neturl.QueryEscape(parameterToString(subscriptionId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SubscriptionsApiService.UpdateSubscription") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/subscriptions/{subscriptionId}" + localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.subscription == nil { + return localVarReturnValue, nil, reportError("subscription is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -449,29 +589,30 @@ func (a *SubscriptionsApiService) UpdateSubscription(ctx _context.Context, subsc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } // body params - localVarPostBody = &subscription - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.subscription + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -480,7 +621,7 @@ func (a *SubscriptionsApiService) UpdateSubscription(ctx _context.Context, subsc err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_summaries.go b/.gen/anchore/api_summaries.go index 1e87622f94..9e30aa5134 100644 --- a/.gen/anchore/api_summaries.go +++ b/.gen/anchore/api_summaries.go @@ -1,61 +1,90 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "github.com/antihax/optional" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // SummariesApiService SummariesApi service type SummariesApiService service -// ListImagetagsOpts Optional parameters for the method 'ListImagetags' -type ListImagetagsOpts struct { - XAnchoreAccount optional.String +type ApiListImagetagsRequest struct { + ctx context.Context + ApiService *SummariesApiService + imageStatus *[]string + xAnchoreAccount *string +} + +// Filter images in one or more states such as active, deleting. Defaults to active images only if unspecified +func (r ApiListImagetagsRequest) ImageStatus(imageStatus []string) ApiListImagetagsRequest { + r.imageStatus = &imageStatus + return r +} + +// An account name to change the resource scope of the request to that account, if permissions allow (admin only) +func (r ApiListImagetagsRequest) XAnchoreAccount(xAnchoreAccount string) ApiListImagetagsRequest { + r.xAnchoreAccount = &xAnchoreAccount + return r +} + +func (r ApiListImagetagsRequest) Execute() ([]AnchoreImageTagSummary, *http.Response, error) { + return r.ApiService.ListImagetagsExecute(r) } /* ListImagetags List all visible image digests and tags + List all image tags visible to the user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListImagetagsOpts - Optional Parameters: - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return []AnchoreImageTagSummary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListImagetagsRequest */ -func (a *SummariesApiService) ListImagetags(ctx _context.Context, localVarOptionals *ListImagetagsOpts) ([]AnchoreImageTagSummary, *_nethttp.Response, error) { +func (a *SummariesApiService) ListImagetags(ctx context.Context) ApiListImagetagsRequest { + return ApiListImagetagsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnchoreImageTagSummary +func (a *SummariesApiService) ListImagetagsExecute(r ApiListImagetagsRequest) ([]AnchoreImageTagSummary, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreImageTagSummary ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/summaries/imagetags" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SummariesApiService.ListImagetags") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/summaries/imagetags" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageStatus != nil { + localVarQueryParams.Add("image_status", parameterToString(*r.imageStatus, "csv")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -73,27 +102,28 @@ func (a *SummariesApiService) ListImagetags(ctx _context.Context, localVarOption if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") + if r.xAnchoreAccount != nil { + localVarHeaderParams["x-anchore-account"] = parameterToString(*r.xAnchoreAccount, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -111,7 +141,7 @@ func (a *SummariesApiService) ListImagetags(ctx _context.Context, localVarOption err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_system.go b/.gen/anchore/api_system.go index 8a14e8bd67..fce11b2966 100644 --- a/.gen/anchore/api_system.go +++ b/.gen/anchore/api_system.go @@ -1,57 +1,265 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // SystemApiService SystemApi service type SystemApiService service +type ApiDeleteFeedRequest struct { + ctx context.Context + ApiService *SystemApiService + feed string +} + +func (r ApiDeleteFeedRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteFeedExecute(r) +} + +/* +DeleteFeed Method for DeleteFeed + +Delete the groups and data for the feed and disable the feed itself + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param feed + @return ApiDeleteFeedRequest +*/ +func (a *SystemApiService) DeleteFeed(ctx context.Context, feed string) ApiDeleteFeedRequest { + return ApiDeleteFeedRequest{ + ApiService: a, + ctx: ctx, + feed: feed, + } +} + +// Execute executes the request +func (a *SystemApiService) DeleteFeedExecute(r ApiDeleteFeedRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.DeleteFeed") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/feeds/{feed}" + localVarPath = strings.Replace(localVarPath, "{"+"feed"+"}", url.PathEscape(parameterToString(r.feed, "")), -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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteFeedGroupRequest struct { + ctx context.Context + ApiService *SystemApiService + feed string + group string +} + +func (r ApiDeleteFeedGroupRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteFeedGroupExecute(r) +} + +/* +DeleteFeedGroup Method for DeleteFeedGroup + +Delete the group data and disable the group itself + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param feed + @param group + @return ApiDeleteFeedGroupRequest +*/ +func (a *SystemApiService) DeleteFeedGroup(ctx context.Context, feed string, group string) ApiDeleteFeedGroupRequest { + return ApiDeleteFeedGroupRequest{ + ApiService: a, + ctx: ctx, + feed: feed, + group: group, + } +} + +// Execute executes the request +func (a *SystemApiService) DeleteFeedGroupExecute(r ApiDeleteFeedGroupRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.DeleteFeedGroup") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/feeds/{feed}/{group}" + localVarPath = strings.Replace(localVarPath, "{"+"feed"+"}", url.PathEscape(parameterToString(r.feed, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"group"+"}", url.PathEscape(parameterToString(r.group, "")), -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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteServiceRequest struct { + ctx context.Context + ApiService *SystemApiService + servicename string + hostid string +} + +func (r ApiDeleteServiceRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteServiceExecute(r) +} + /* DeleteService Delete the service config - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param servicename - * @param hostid + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param servicename + @param hostid + @return ApiDeleteServiceRequest */ -func (a *SystemApiService) DeleteService(ctx _context.Context, servicename string, hostid string) (*_nethttp.Response, error) { +func (a *SystemApiService) DeleteService(ctx context.Context, servicename string, hostid string) ApiDeleteServiceRequest { + return ApiDeleteServiceRequest{ + ApiService: a, + ctx: ctx, + servicename: servicename, + hostid: hostid, + } +} + +// Execute executes the request +func (a *SystemApiService) DeleteServiceExecute(r ApiDeleteServiceRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services/{servicename}/{hostid}" - localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", _neturl.QueryEscape(parameterToString(servicename, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.DeleteService") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"hostid"+"}", _neturl.QueryEscape(parameterToString(hostid, "")) , -1) + localVarPath := localBasePath + "/system/services/{servicename}/{hostid}" + localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", url.PathEscape(parameterToString(r.servicename, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"hostid"+"}", url.PathEscape(parameterToString(r.hostid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -70,24 +278,25 @@ func (a *SystemApiService) DeleteService(ctx _context.Context, servicename strin if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -106,27 +315,50 @@ func (a *SystemApiService) DeleteService(ctx _context.Context, servicename strin return localVarHTTPResponse, nil } +type ApiDescribeErrorCodesRequest struct { + ctx context.Context + ApiService *SystemApiService +} + +func (r ApiDescribeErrorCodesRequest) Execute() ([]AnchoreErrorCode, *http.Response, error) { + return r.ApiService.DescribeErrorCodesExecute(r) +} + /* DescribeErrorCodes Describe anchore engine error codes. + Describe anchore engine error codes. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []AnchoreErrorCode + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDescribeErrorCodesRequest */ -func (a *SystemApiService) DescribeErrorCodes(ctx _context.Context) ([]AnchoreErrorCode, *_nethttp.Response, error) { +func (a *SystemApiService) DescribeErrorCodes(ctx context.Context) ApiDescribeErrorCodesRequest { + return ApiDescribeErrorCodesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AnchoreErrorCode +func (a *SystemApiService) DescribeErrorCodesExecute(r ApiDescribeErrorCodesRequest) ([]AnchoreErrorCode, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AnchoreErrorCode ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/error_codes" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.DescribeErrorCodes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/error_codes" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -145,24 +377,25 @@ func (a *SystemApiService) DescribeErrorCodes(ctx _context.Context) ([]AnchoreEr if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -171,7 +404,7 @@ func (a *SystemApiService) DescribeErrorCodes(ctx _context.Context) ([]AnchoreEr err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -181,27 +414,50 @@ func (a *SystemApiService) DescribeErrorCodes(ctx _context.Context) ([]AnchoreEr return localVarReturnValue, localVarHTTPResponse, nil } +type ApiDescribePolicyRequest struct { + ctx context.Context + ApiService *SystemApiService +} + +func (r ApiDescribePolicyRequest) Execute() ([]GateSpec, *http.Response, error) { + return r.ApiService.DescribePolicyExecute(r) +} + /* DescribePolicy Describe the policy language spec implemented by this service. + Get the policy language spec for this service - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []GateSpec + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDescribePolicyRequest */ -func (a *SystemApiService) DescribePolicy(ctx _context.Context) ([]GateSpec, *_nethttp.Response, error) { +func (a *SystemApiService) DescribePolicy(ctx context.Context) ApiDescribePolicyRequest { + return ApiDescribePolicyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []GateSpec +func (a *SystemApiService) DescribePolicyExecute(r ApiDescribePolicyRequest) ([]GateSpec, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []GateSpec ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/policy_spec" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.DescribePolicy") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/policy_spec" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -220,24 +476,25 @@ func (a *SystemApiService) DescribePolicy(ctx _context.Context) ([]GateSpec, *_n if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -246,7 +503,7 @@ func (a *SystemApiService) DescribePolicy(ctx _context.Context) ([]GateSpec, *_n err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -256,27 +513,50 @@ func (a *SystemApiService) DescribePolicy(ctx _context.Context) ([]GateSpec, *_n return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetServiceDetailRequest struct { + ctx context.Context + ApiService *SystemApiService +} + +func (r ApiGetServiceDetailRequest) Execute() (*SystemStatusResponse, *http.Response, error) { + return r.ApiService.GetServiceDetailExecute(r) +} + /* GetServiceDetail System status + Get the system status including queue lengths - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return SystemStatusResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetServiceDetailRequest */ -func (a *SystemApiService) GetServiceDetail(ctx _context.Context) (SystemStatusResponse, *_nethttp.Response, error) { +func (a *SystemApiService) GetServiceDetail(ctx context.Context) ApiGetServiceDetailRequest { + return ApiGetServiceDetailRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SystemStatusResponse +func (a *SystemApiService) GetServiceDetailExecute(r ApiGetServiceDetailRequest) (*SystemStatusResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue SystemStatusResponse + formFiles []formFile + localVarReturnValue *SystemStatusResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.GetServiceDetail") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -295,24 +575,25 @@ func (a *SystemApiService) GetServiceDetail(ctx _context.Context) (SystemStatusR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -330,7 +611,7 @@ func (a *SystemApiService) GetServiceDetail(ctx _context.Context) (SystemStatusR err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -340,29 +621,52 @@ func (a *SystemApiService) GetServiceDetail(ctx _context.Context) (SystemStatusR return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetServicesByNameRequest struct { + ctx context.Context + ApiService *SystemApiService + servicename string +} + +func (r ApiGetServicesByNameRequest) Execute() ([]Service, *http.Response, error) { + return r.ApiService.GetServicesByNameExecute(r) +} + /* GetServicesByName Get a service configuration and state - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param servicename -@return []Service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param servicename + @return ApiGetServicesByNameRequest */ -func (a *SystemApiService) GetServicesByName(ctx _context.Context, servicename string) ([]Service, *_nethttp.Response, error) { +func (a *SystemApiService) GetServicesByName(ctx context.Context, servicename string) ApiGetServicesByNameRequest { + return ApiGetServicesByNameRequest{ + ApiService: a, + ctx: ctx, + servicename: servicename, + } +} + +// Execute executes the request +// @return []Service +func (a *SystemApiService) GetServicesByNameExecute(r ApiGetServicesByNameRequest) ([]Service, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Service ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services/{servicename}" - localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", _neturl.QueryEscape(parameterToString(servicename, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.GetServicesByName") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/services/{servicename}" + localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", url.PathEscape(parameterToString(r.servicename, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -381,24 +685,25 @@ func (a *SystemApiService) GetServicesByName(ctx _context.Context, servicename s if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -416,7 +721,7 @@ func (a *SystemApiService) GetServicesByName(ctx _context.Context, servicename s err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -426,32 +731,56 @@ func (a *SystemApiService) GetServicesByName(ctx _context.Context, servicename s return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetServicesByNameAndHostRequest struct { + ctx context.Context + ApiService *SystemApiService + servicename string + hostid string +} + +func (r ApiGetServicesByNameAndHostRequest) Execute() ([]Service, *http.Response, error) { + return r.ApiService.GetServicesByNameAndHostExecute(r) +} + /* GetServicesByNameAndHost Get service config for a specific host - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param servicename - * @param hostid -@return []Service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param servicename + @param hostid + @return ApiGetServicesByNameAndHostRequest */ -func (a *SystemApiService) GetServicesByNameAndHost(ctx _context.Context, servicename string, hostid string) ([]Service, *_nethttp.Response, error) { +func (a *SystemApiService) GetServicesByNameAndHost(ctx context.Context, servicename string, hostid string) ApiGetServicesByNameAndHostRequest { + return ApiGetServicesByNameAndHostRequest{ + ApiService: a, + ctx: ctx, + servicename: servicename, + hostid: hostid, + } +} + +// Execute executes the request +// @return []Service +func (a *SystemApiService) GetServicesByNameAndHostExecute(r ApiGetServicesByNameAndHostRequest) ([]Service, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Service ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services/{servicename}/{hostid}" - localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", _neturl.QueryEscape(parameterToString(servicename, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.GetServicesByNameAndHost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"hostid"+"}", _neturl.QueryEscape(parameterToString(hostid, "")) , -1) + localVarPath := localBasePath + "/system/services/{servicename}/{hostid}" + localVarPath = strings.Replace(localVarPath, "{"+"servicename"+"}", url.PathEscape(parameterToString(r.servicename, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"hostid"+"}", url.PathEscape(parameterToString(r.hostid, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -470,24 +799,25 @@ func (a *SystemApiService) GetServicesByNameAndHost(ctx _context.Context, servic if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -505,7 +835,7 @@ func (a *SystemApiService) GetServicesByNameAndHost(ctx _context.Context, servic err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -515,27 +845,50 @@ func (a *SystemApiService) GetServicesByNameAndHost(ctx _context.Context, servic return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetStatusRequest struct { + ctx context.Context + ApiService *SystemApiService +} + +func (r ApiGetStatusRequest) Execute() (*StatusResponse, *http.Response, error) { + return r.ApiService.GetStatusExecute(r) +} + /* GetStatus Service status + Get the API service status - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return StatusResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusRequest */ -func (a *SystemApiService) GetStatus(ctx _context.Context) (StatusResponse, *_nethttp.Response, error) { +func (a *SystemApiService) GetStatus(ctx context.Context) ApiGetStatusRequest { + return ApiGetStatusRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StatusResponse +func (a *SystemApiService) GetStatusExecute(r ApiGetStatusRequest) (*StatusResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue StatusResponse + formFiles []formFile + localVarReturnValue *StatusResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/status" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.GetStatus") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/status" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -554,24 +907,25 @@ func (a *SystemApiService) GetStatus(ctx _context.Context) (StatusResponse, *_ne if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -589,7 +943,7 @@ func (a *SystemApiService) GetStatus(ctx _context.Context) (StatusResponse, *_ne err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -599,26 +953,50 @@ func (a *SystemApiService) GetStatus(ctx _context.Context) (StatusResponse, *_ne return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetSystemFeedsRequest struct { + ctx context.Context + ApiService *SystemApiService +} + +func (r ApiGetSystemFeedsRequest) Execute() ([]FeedMetadata, *http.Response, error) { + return r.ApiService.GetSystemFeedsExecute(r) +} + /* GetSystemFeeds list feeds operations and information - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []FeedMetadata + +Return a list of feed and their groups along with update and record count information. This data reflects the state of the policy engine, not the upstream feed service itself. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSystemFeedsRequest */ -func (a *SystemApiService) GetSystemFeeds(ctx _context.Context) ([]FeedMetadata, *_nethttp.Response, error) { +func (a *SystemApiService) GetSystemFeeds(ctx context.Context) ApiGetSystemFeedsRequest { + return ApiGetSystemFeedsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []FeedMetadata +func (a *SystemApiService) GetSystemFeedsExecute(r ApiGetSystemFeedsRequest) ([]FeedMetadata, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []FeedMetadata ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/feeds" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.GetSystemFeeds") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/feeds" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -637,24 +1015,25 @@ func (a *SystemApiService) GetSystemFeeds(ctx _context.Context) ([]FeedMetadata, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -672,7 +1051,7 @@ func (a *SystemApiService) GetSystemFeeds(ctx _context.Context) ([]FeedMetadata, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -682,26 +1061,48 @@ func (a *SystemApiService) GetSystemFeeds(ctx _context.Context) ([]FeedMetadata, return localVarReturnValue, localVarHTTPResponse, nil } +type ApiListServicesRequest struct { + ctx context.Context + ApiService *SystemApiService +} + +func (r ApiListServicesRequest) Execute() ([]Service, *http.Response, error) { + return r.ApiService.ListServicesExecute(r) +} + /* ListServices List system services - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []Service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListServicesRequest */ -func (a *SystemApiService) ListServices(ctx _context.Context) ([]Service, *_nethttp.Response, error) { +func (a *SystemApiService) ListServices(ctx context.Context) ApiListServicesRequest { + return ApiListServicesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Service +func (a *SystemApiService) ListServicesExecute(r ApiListServicesRequest) ([]Service, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Service ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/services" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.ListServices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/services" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -720,24 +1121,25 @@ func (a *SystemApiService) ListServices(ctx _context.Context) ([]Service, *_neth if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -755,7 +1157,7 @@ func (a *SystemApiService) ListServices(ctx _context.Context) ([]Service, *_neth err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -765,41 +1167,70 @@ func (a *SystemApiService) ListServices(ctx _context.Context) ([]Service, *_neth return localVarReturnValue, localVarHTTPResponse, nil } -// PostSystemFeedsOpts Optional parameters for the method 'PostSystemFeeds' -type PostSystemFeedsOpts struct { - Flush optional.Bool - Sync optional.Bool +type ApiPostSystemFeedsRequest struct { + ctx context.Context + ApiService *SystemApiService + flush *bool + sync *bool +} + +// instruct system to flush existing data feeds records from anchore-engine +func (r ApiPostSystemFeedsRequest) Flush(flush bool) ApiPostSystemFeedsRequest { + r.flush = &flush + return r +} + +// instruct system to re-sync data feeds +func (r ApiPostSystemFeedsRequest) Sync(sync bool) ApiPostSystemFeedsRequest { + r.sync = &sync + return r +} + +func (r ApiPostSystemFeedsRequest) Execute() ([]FeedSyncResult, *http.Response, error) { + return r.ApiService.PostSystemFeedsExecute(r) } /* PostSystemFeeds trigger feeds operations - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *PostSystemFeedsOpts - Optional Parameters: - * @param "Flush" (optional.Bool) - instruct system to flush existing data feeds records from anchore-engine - * @param "Sync" (optional.Bool) - instruct system to re-sync data feeds -@return []FeedSyncResult + +Execute a synchronous feed sync operation. The response will block until complete, then return the result summary. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostSystemFeedsRequest */ -func (a *SystemApiService) PostSystemFeeds(ctx _context.Context, localVarOptionals *PostSystemFeedsOpts) ([]FeedSyncResult, *_nethttp.Response, error) { +func (a *SystemApiService) PostSystemFeeds(ctx context.Context) ApiPostSystemFeedsRequest { + return ApiPostSystemFeedsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []FeedSyncResult +func (a *SystemApiService) PostSystemFeedsExecute(r ApiPostSystemFeedsRequest) ([]FeedSyncResult, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []FeedSyncResult ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/system/feeds" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.PostSystemFeeds") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/feeds" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Flush.IsSet() { - localVarQueryParams.Add("flush", parameterToString(localVarOptionals.Flush.Value(), "")) + if r.flush != nil { + localVarQueryParams.Add("flush", parameterToString(*r.flush, "")) } - if localVarOptionals != nil && localVarOptionals.Sync.IsSet() { - localVarQueryParams.Add("sync", parameterToString(localVarOptionals.Sync.Value(), "")) + if r.sync != nil { + localVarQueryParams.Add("sync", parameterToString(*r.sync, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -818,24 +1249,25 @@ func (a *SystemApiService) PostSystemFeeds(ctx _context.Context, localVarOptiona if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -853,7 +1285,358 @@ func (a *SystemApiService) PostSystemFeeds(ctx _context.Context, localVarOptiona err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTestWebhookRequest struct { + ctx context.Context + ApiService *SystemApiService + webhookType string + notificationType *string +} + +// What kind of Notification to send +func (r ApiTestWebhookRequest) NotificationType(notificationType string) ApiTestWebhookRequest { + r.notificationType = ¬ificationType + return r +} + +func (r ApiTestWebhookRequest) Execute() (*http.Response, error) { + return r.ApiService.TestWebhookExecute(r) +} + +/* +TestWebhook Adds the capabilities to test a webhook delivery for the given notification type + +Loads the Webhook configuration for webhook_type, and sends the notification out as a test + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param webhookType The Webhook Type that we should test + @return ApiTestWebhookRequest +*/ +func (a *SystemApiService) TestWebhook(ctx context.Context, webhookType string) ApiTestWebhookRequest { + return ApiTestWebhookRequest{ + ApiService: a, + ctx: ctx, + webhookType: webhookType, + } +} + +// Execute executes the request +func (a *SystemApiService) TestWebhookExecute(r ApiTestWebhookRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.TestWebhook") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/webhooks/{webhook_type}/test" + localVarPath = strings.Replace(localVarPath, "{"+"webhook_type"+"}", url.PathEscape(parameterToString(r.webhookType, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.notificationType != nil { + localVarQueryParams.Add("notification_type", parameterToString(*r.notificationType, "")) + } + // 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ApiErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiToggleFeedEnabledRequest struct { + ctx context.Context + ApiService *SystemApiService + feed string + enabled *bool +} + +func (r ApiToggleFeedEnabledRequest) Enabled(enabled bool) ApiToggleFeedEnabledRequest { + r.enabled = &enabled + return r +} + +func (r ApiToggleFeedEnabledRequest) Execute() (*FeedMetadata, *http.Response, error) { + return r.ApiService.ToggleFeedEnabledExecute(r) +} + +/* +ToggleFeedEnabled Method for ToggleFeedEnabled + +Disable the feed so that it does not sync on subsequent sync operations + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param feed + @return ApiToggleFeedEnabledRequest +*/ +func (a *SystemApiService) ToggleFeedEnabled(ctx context.Context, feed string) ApiToggleFeedEnabledRequest { + return ApiToggleFeedEnabledRequest{ + ApiService: a, + ctx: ctx, + feed: feed, + } +} + +// Execute executes the request +// @return FeedMetadata +func (a *SystemApiService) ToggleFeedEnabledExecute(r ApiToggleFeedEnabledRequest) (*FeedMetadata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FeedMetadata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.ToggleFeedEnabled") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/feeds/{feed}" + localVarPath = strings.Replace(localVarPath, "{"+"feed"+"}", url.PathEscape(parameterToString(r.feed, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.enabled == nil { + return localVarReturnValue, nil, reportError("enabled is required and must be specified") + } + + localVarQueryParams.Add("enabled", parameterToString(*r.enabled, "")) + // 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiToggleGroupEnabledRequest struct { + ctx context.Context + ApiService *SystemApiService + feed string + group string + enabled *bool +} + +func (r ApiToggleGroupEnabledRequest) Enabled(enabled bool) ApiToggleGroupEnabledRequest { + r.enabled = &enabled + return r +} + +func (r ApiToggleGroupEnabledRequest) Execute() ([]FeedMetadata, *http.Response, error) { + return r.ApiService.ToggleGroupEnabledExecute(r) +} + +/* +ToggleGroupEnabled Method for ToggleGroupEnabled + +Disable a specific group within a feed to not sync + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param feed + @param group + @return ApiToggleGroupEnabledRequest +*/ +func (a *SystemApiService) ToggleGroupEnabled(ctx context.Context, feed string, group string) ApiToggleGroupEnabledRequest { + return ApiToggleGroupEnabledRequest{ + ApiService: a, + ctx: ctx, + feed: feed, + group: group, + } +} + +// Execute executes the request +// @return []FeedMetadata +func (a *SystemApiService) ToggleGroupEnabledExecute(r ApiToggleGroupEnabledRequest) ([]FeedMetadata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FeedMetadata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemApiService.ToggleGroupEnabled") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/feeds/{feed}/{group}" + localVarPath = strings.Replace(localVarPath, "{"+"feed"+"}", url.PathEscape(parameterToString(r.feed, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"group"+"}", url.PathEscape(parameterToString(r.group, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.enabled == nil { + return localVarReturnValue, nil, reportError("enabled is required and must be specified") + } + + localVarQueryParams.Add("enabled", parameterToString(*r.enabled, "")) + // 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 := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_user_management.go b/.gen/anchore/api_user_management.go index ceb06a17b5..d84fe4fe93 100644 --- a/.gen/anchore/api_user_management.go +++ b/.gen/anchore/api_user_management.go @@ -1,54 +1,80 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // UserManagementApiService UserManagementApi service type UserManagementApiService service +type ApiCreateAccountRequest struct { + ctx context.Context + ApiService *UserManagementApiService + account *AccountCreationRequest +} + +func (r ApiCreateAccountRequest) Account(account AccountCreationRequest) ApiCreateAccountRequest { + r.account = &account + return r +} + +func (r ApiCreateAccountRequest) Execute() (*Account, *http.Response, error) { + return r.ApiService.CreateAccountExecute(r) +} + /* CreateAccount Create a new user. Only avaialble to admin user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param account -@return Account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateAccountRequest */ -func (a *UserManagementApiService) CreateAccount(ctx _context.Context, account AccountCreationRequest) (Account, *_nethttp.Response, error) { +func (a *UserManagementApiService) CreateAccount(ctx context.Context) ApiCreateAccountRequest { + return ApiCreateAccountRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Account +func (a *UserManagementApiService) CreateAccountExecute(r ApiCreateAccountRequest) (*Account, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Account + formFiles []formFile + localVarReturnValue *Account ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.CreateAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.account == nil { + return localVarReturnValue, nil, reportError("account is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -68,25 +94,26 @@ func (a *UserManagementApiService) CreateAccount(ctx _context.Context, account A localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &account - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.account + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -114,7 +141,7 @@ func (a *UserManagementApiService) CreateAccount(ctx _context.Context, account A err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -124,30 +151,61 @@ func (a *UserManagementApiService) CreateAccount(ctx _context.Context, account A return localVarReturnValue, localVarHTTPResponse, nil } +type ApiCreateUserRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + user *UserCreationRequest +} + +func (r ApiCreateUserRequest) User(user UserCreationRequest) ApiCreateUserRequest { + r.user = &user + return r +} + +func (r ApiCreateUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CreateUserExecute(r) +} + /* CreateUser Create a new user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param user -@return User + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @return ApiCreateUserRequest */ -func (a *UserManagementApiService) CreateUser(ctx _context.Context, accountname string, user UserCreationRequest) (User, *_nethttp.Response, error) { +func (a *UserManagementApiService) CreateUser(ctx context.Context, accountname string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + } +} + +// Execute executes the request +// @return User +func (a *UserManagementApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User + formFiles []formFile + localVarReturnValue *User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.CreateUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts/{accountname}/users" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.user == nil { + return localVarReturnValue, nil, reportError("user is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -167,25 +225,26 @@ func (a *UserManagementApiService) CreateUser(ctx _context.Context, accountname localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -194,7 +253,7 @@ func (a *UserManagementApiService) CreateUser(ctx _context.Context, accountname err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -204,33 +263,65 @@ func (a *UserManagementApiService) CreateUser(ctx _context.Context, accountname return localVarReturnValue, localVarHTTPResponse, nil } +type ApiCreateUserCredentialRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + username string + credential *AccessCredential +} + +func (r ApiCreateUserCredentialRequest) Credential(credential AccessCredential) ApiCreateUserCredentialRequest { + r.credential = &credential + return r +} + +func (r ApiCreateUserCredentialRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CreateUserCredentialExecute(r) +} + /* CreateUserCredential add/replace credential - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param username - * @param credential -@return User + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @param username + @return ApiCreateUserCredentialRequest */ -func (a *UserManagementApiService) CreateUserCredential(ctx _context.Context, accountname string, username string, credential AccessCredential) (User, *_nethttp.Response, error) { +func (a *UserManagementApiService) CreateUserCredential(ctx context.Context, accountname string, username string) ApiCreateUserCredentialRequest { + return ApiCreateUserCredentialRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + username: username, + } +} + +// Execute executes the request +// @return User +func (a *UserManagementApiService) CreateUserCredentialExecute(r ApiCreateUserCredentialRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User + formFiles []formFile + localVarReturnValue *User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users/{username}/credentials" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.CreateUserCredential") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(parameterToString(username, "")) , -1) + localVarPath := localBasePath + "/accounts/{accountname}/users/{username}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.credential == nil { + return localVarReturnValue, nil, reportError("credential is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -250,25 +341,26 @@ func (a *UserManagementApiService) CreateUserCredential(ctx _context.Context, ac localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &credential - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.credential + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -286,7 +378,7 @@ func (a *UserManagementApiService) CreateUserCredential(ctx _context.Context, ac err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -296,27 +388,50 @@ func (a *UserManagementApiService) CreateUserCredential(ctx _context.Context, ac return localVarReturnValue, localVarHTTPResponse, nil } +type ApiDeleteAccountRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string +} + +func (r ApiDeleteAccountRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteAccountExecute(r) +} + /* DeleteAccount Delete the specified account, only allowed if the account is in the disabled state. All users will be deleted along with the account and all resources will be garbage collected - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @return ApiDeleteAccountRequest */ -func (a *UserManagementApiService) DeleteAccount(ctx _context.Context, accountname string) (*_nethttp.Response, error) { +func (a *UserManagementApiService) DeleteAccount(ctx context.Context, accountname string) ApiDeleteAccountRequest { + return ApiDeleteAccountRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + } +} + +// Execute executes the request +func (a *UserManagementApiService) DeleteAccountExecute(r ApiDeleteAccountRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.DeleteAccount") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts/{accountname}" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -335,24 +450,25 @@ func (a *UserManagementApiService) DeleteAccount(ctx _context.Context, accountna if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -371,30 +487,54 @@ func (a *UserManagementApiService) DeleteAccount(ctx _context.Context, accountna return localVarHTTPResponse, nil } +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + username string +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + /* DeleteUser Delete a specific user credential by username of the credential. Cannot be the credential used to authenticate the request. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param username + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @param username + @return ApiDeleteUserRequest */ -func (a *UserManagementApiService) DeleteUser(ctx _context.Context, accountname string, username string) (*_nethttp.Response, error) { +func (a *UserManagementApiService) DeleteUser(ctx context.Context, accountname string, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + username: username, + } +} + +// Execute executes the request +func (a *UserManagementApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.DeleteUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(parameterToString(username, "")) , -1) + localVarPath := localBasePath + "/accounts/{accountname}/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -413,24 +553,25 @@ func (a *UserManagementApiService) DeleteUser(ctx _context.Context, accountname if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -449,33 +590,65 @@ func (a *UserManagementApiService) DeleteUser(ctx _context.Context, accountname return localVarHTTPResponse, nil } +type ApiDeleteUserCredentialRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + username string + credentialType *string +} + +func (r ApiDeleteUserCredentialRequest) CredentialType(credentialType string) ApiDeleteUserCredentialRequest { + r.credentialType = &credentialType + return r +} + +func (r ApiDeleteUserCredentialRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserCredentialExecute(r) +} + /* DeleteUserCredential Delete a credential by type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param username - * @param credentialType + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @param username + @return ApiDeleteUserCredentialRequest */ -func (a *UserManagementApiService) DeleteUserCredential(ctx _context.Context, accountname string, username string, credentialType string) (*_nethttp.Response, error) { +func (a *UserManagementApiService) DeleteUserCredential(ctx context.Context, accountname string, username string) ApiDeleteUserCredentialRequest { + return ApiDeleteUserCredentialRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + username: username, + } +} + +// Execute executes the request +func (a *UserManagementApiService) DeleteUserCredentialExecute(r ApiDeleteUserCredentialRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users/{username}/credentials" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.DeleteUserCredential") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(parameterToString(username, "")) , -1) + localVarPath := localBasePath + "/accounts/{accountname}/users/{username}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.credentialType == nil { + return nil, reportError("credentialType is required and must be specified") + } - localVarQueryParams.Add("credential_type", parameterToString(credentialType, "")) + localVarQueryParams.Add("credential_type", parameterToString(*r.credentialType, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -493,24 +666,25 @@ func (a *UserManagementApiService) DeleteUserCredential(ctx _context.Context, ac if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -529,29 +703,52 @@ func (a *UserManagementApiService) DeleteUserCredential(ctx _context.Context, ac return localVarHTTPResponse, nil } +type ApiGetAccountRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string +} + +func (r ApiGetAccountRequest) Execute() (*Account, *http.Response, error) { + return r.ApiService.GetAccountExecute(r) +} + /* GetAccount Get info about an user. Only available to admin user. Uses the main user Id, not a username. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname -@return Account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @return ApiGetAccountRequest */ -func (a *UserManagementApiService) GetAccount(ctx _context.Context, accountname string) (Account, *_nethttp.Response, error) { +func (a *UserManagementApiService) GetAccount(ctx context.Context, accountname string) ApiGetAccountRequest { + return ApiGetAccountRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + } +} + +// Execute executes the request +// @return Account +func (a *UserManagementApiService) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Account + formFiles []formFile + localVarReturnValue *Account ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.GetAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts/{accountname}" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -570,24 +767,25 @@ func (a *UserManagementApiService) GetAccount(ctx _context.Context, accountname if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -605,7 +803,7 @@ func (a *UserManagementApiService) GetAccount(ctx _context.Context, accountname err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -615,32 +813,56 @@ func (a *UserManagementApiService) GetAccount(ctx _context.Context, accountname return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetAccountUserRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + username string +} + +func (r ApiGetAccountUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.GetAccountUserExecute(r) +} + /* GetAccountUser Get a specific user in the specified account - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param username -@return User + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @param username + @return ApiGetAccountUserRequest */ -func (a *UserManagementApiService) GetAccountUser(ctx _context.Context, accountname string, username string) (User, *_nethttp.Response, error) { +func (a *UserManagementApiService) GetAccountUser(ctx context.Context, accountname string, username string) ApiGetAccountUserRequest { + return ApiGetAccountUserRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + username: username, + } +} + +// Execute executes the request +// @return User +func (a *UserManagementApiService) GetAccountUserExecute(r ApiGetAccountUserRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User + formFiles []formFile + localVarReturnValue *User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.GetAccountUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(parameterToString(username, "")) , -1) + localVarPath := localBasePath + "/accounts/{accountname}/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -659,24 +881,25 @@ func (a *UserManagementApiService) GetAccountUser(ctx _context.Context, accountn if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -694,7 +917,7 @@ func (a *UserManagementApiService) GetAccountUser(ctx _context.Context, accountn err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -704,36 +927,58 @@ func (a *UserManagementApiService) GetAccountUser(ctx _context.Context, accountn return localVarReturnValue, localVarHTTPResponse, nil } -// ListAccountsOpts Optional parameters for the method 'ListAccounts' -type ListAccountsOpts struct { - State optional.String +type ApiListAccountsRequest struct { + ctx context.Context + ApiService *UserManagementApiService + state *string +} + +// Filter accounts by state +func (r ApiListAccountsRequest) State(state string) ApiListAccountsRequest { + r.state = &state + return r +} + +func (r ApiListAccountsRequest) Execute() ([]Account, *http.Response, error) { + return r.ApiService.ListAccountsExecute(r) } /* ListAccounts List user summaries. Only available to the system admin user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *ListAccountsOpts - Optional Parameters: - * @param "State" (optional.String) - Filter accounts by state -@return []Account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListAccountsRequest */ -func (a *UserManagementApiService) ListAccounts(ctx _context.Context, localVarOptionals *ListAccountsOpts) ([]Account, *_nethttp.Response, error) { +func (a *UserManagementApiService) ListAccounts(ctx context.Context) ApiListAccountsRequest { + return ApiListAccountsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Account +func (a *UserManagementApiService) ListAccountsExecute(r ApiListAccountsRequest) ([]Account, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Account ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.ListAccounts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.State.IsSet() { - localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + if r.state != nil { + localVarQueryParams.Add("state", parameterToString(*r.state, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -752,24 +997,25 @@ func (a *UserManagementApiService) ListAccounts(ctx _context.Context, localVarOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -787,7 +1033,7 @@ func (a *UserManagementApiService) ListAccounts(ctx _context.Context, localVarOp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -797,32 +1043,56 @@ func (a *UserManagementApiService) ListAccounts(ctx _context.Context, localVarOp return localVarReturnValue, localVarHTTPResponse, nil } +type ApiListUserCredentialsRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + username string +} + +func (r ApiListUserCredentialsRequest) Execute() ([]AccessCredential, *http.Response, error) { + return r.ApiService.ListUserCredentialsExecute(r) +} + /* ListUserCredentials Get current credential summary - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param username -@return []AccessCredential + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @param username + @return ApiListUserCredentialsRequest */ -func (a *UserManagementApiService) ListUserCredentials(ctx _context.Context, accountname string, username string) ([]AccessCredential, *_nethttp.Response, error) { +func (a *UserManagementApiService) ListUserCredentials(ctx context.Context, accountname string, username string) ApiListUserCredentialsRequest { + return ApiListUserCredentialsRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + username: username, + } +} + +// Execute executes the request +// @return []AccessCredential +func (a *UserManagementApiService) ListUserCredentialsExecute(r ApiListUserCredentialsRequest) ([]AccessCredential, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []AccessCredential ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users/{username}/credentials" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.ListUserCredentials") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(parameterToString(username, "")) , -1) + localVarPath := localBasePath + "/accounts/{accountname}/users/{username}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -841,24 +1111,25 @@ func (a *UserManagementApiService) ListUserCredentials(ctx _context.Context, acc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -876,7 +1147,7 @@ func (a *UserManagementApiService) ListUserCredentials(ctx _context.Context, acc err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -886,29 +1157,52 @@ func (a *UserManagementApiService) ListUserCredentials(ctx _context.Context, acc return localVarReturnValue, localVarHTTPResponse, nil } +type ApiListUsersRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string +} + +func (r ApiListUsersRequest) Execute() ([]User, *http.Response, error) { + return r.ApiService.ListUsersExecute(r) +} + /* ListUsers List accounts for the user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname -@return []User + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @return ApiListUsersRequest */ -func (a *UserManagementApiService) ListUsers(ctx _context.Context, accountname string) ([]User, *_nethttp.Response, error) { +func (a *UserManagementApiService) ListUsers(ctx context.Context, accountname string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + } +} + +// Execute executes the request +// @return []User +func (a *UserManagementApiService) ListUsersExecute(r ApiListUsersRequest) ([]User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/users" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.ListUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts/{accountname}/users" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -927,24 +1221,25 @@ func (a *UserManagementApiService) ListUsers(ctx _context.Context, accountname s if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -962,7 +1257,7 @@ func (a *UserManagementApiService) ListUsers(ctx _context.Context, accountname s err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -972,30 +1267,61 @@ func (a *UserManagementApiService) ListUsers(ctx _context.Context, accountname s return localVarReturnValue, localVarHTTPResponse, nil } +type ApiUpdateAccountStateRequest struct { + ctx context.Context + ApiService *UserManagementApiService + accountname string + desiredState *AccountStatus +} + +func (r ApiUpdateAccountStateRequest) DesiredState(desiredState AccountStatus) ApiUpdateAccountStateRequest { + r.desiredState = &desiredState + return r +} + +func (r ApiUpdateAccountStateRequest) Execute() (*AccountStatus, *http.Response, error) { + return r.ApiService.UpdateAccountStateExecute(r) +} + /* UpdateAccountState Update the state of an account to either enabled or disabled. For deletion use the DELETE route - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param accountname - * @param desiredState -@return AccountStatus + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountname + @return ApiUpdateAccountStateRequest */ -func (a *UserManagementApiService) UpdateAccountState(ctx _context.Context, accountname string, desiredState AccountStatus) (AccountStatus, *_nethttp.Response, error) { +func (a *UserManagementApiService) UpdateAccountState(ctx context.Context, accountname string) ApiUpdateAccountStateRequest { + return ApiUpdateAccountStateRequest{ + ApiService: a, + ctx: ctx, + accountname: accountname, + } +} + +// Execute executes the request +// @return AccountStatus +func (a *UserManagementApiService) UpdateAccountStateExecute(r ApiUpdateAccountStateRequest) (*AccountStatus, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AccountStatus + formFiles []formFile + localVarReturnValue *AccountStatus ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/accounts/{accountname}/state" - localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", _neturl.QueryEscape(parameterToString(accountname, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UpdateAccountState") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/accounts/{accountname}/state" + localVarPath = strings.Replace(localVarPath, "{"+"accountname"+"}", url.PathEscape(parameterToString(r.accountname, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.desiredState == nil { + return localVarReturnValue, nil, reportError("desiredState is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1015,25 +1341,26 @@ func (a *UserManagementApiService) UpdateAccountState(ctx _context.Context, acco localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &desiredState - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.desiredState + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1061,7 +1388,7 @@ func (a *UserManagementApiService) UpdateAccountState(ctx _context.Context, acco err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/anchore/api_vulnerabilities.go b/.gen/anchore/api_vulnerabilities.go deleted file mode 100644 index 45e56cc934..0000000000 --- a/.gen/anchore/api_vulnerabilities.go +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "github.com/antihax/optional" -) - -// Linger please -var ( - _ _context.Context -) - -// VulnerabilitiesApiService VulnerabilitiesApi service -type VulnerabilitiesApiService service - -// QueryImagesByVulnerabilityOpts Optional parameters for the method 'QueryImagesByVulnerability' -type QueryImagesByVulnerabilityOpts struct { - Namespace optional.String - AffectedPackage optional.String - Severity optional.String - VendorOnly optional.Bool - Page optional.Int32 - Limit optional.Int32 - XAnchoreAccount optional.String -} - -/* -QueryImagesByVulnerability List images vulnerable to the specific vulnerability ID. -Returns a listing of images and their respective packages vulnerable to the given vulnerability ID - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param vulnerabilityId The ID of the vulnerability to search for within all images stored in anchore-engine (e.g. CVE-1999-0001) - * @param optional nil or *QueryImagesByVulnerabilityOpts - Optional Parameters: - * @param "Namespace" (optional.String) - Filter results to images within the given vulnerability namespace (e.g. debian:8, ubuntu:14.04) - * @param "AffectedPackage" (optional.String) - Filter results to images with vulnable packages with the given package name (e.g. libssl) - * @param "Severity" (optional.String) - Filter results to vulnerable package/vulnerability with the given severity - * @param "VendorOnly" (optional.Bool) - Filter results to include only vulnerabilities that are not marked as invalid by upstream OS vendor data - * @param "Page" (optional.Int32) - The page of results to fetch. Pages start at 1 - * @param "Limit" (optional.Int32) - Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page - * @param "XAnchoreAccount" (optional.String) - An account name to change the resource scope of the request to that account, if permissions allow (admin only) -@return PaginatedVulnerableImageList -*/ -func (a *VulnerabilitiesApiService) QueryImagesByVulnerability(ctx _context.Context, vulnerabilityId string, localVarOptionals *QueryImagesByVulnerabilityOpts) (PaginatedVulnerableImageList, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PaginatedVulnerableImageList - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/query/images/by_vulnerability" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("vulnerability_id", parameterToString(vulnerabilityId, "")) - if localVarOptionals != nil && localVarOptionals.Namespace.IsSet() { - localVarQueryParams.Add("namespace", parameterToString(localVarOptionals.Namespace.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.AffectedPackage.IsSet() { - localVarQueryParams.Add("affected_package", parameterToString(localVarOptionals.AffectedPackage.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Severity.IsSet() { - localVarQueryParams.Add("severity", parameterToString(localVarOptionals.Severity.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.VendorOnly.IsSet() { - localVarQueryParams.Add("vendor_only", parameterToString(localVarOptionals.VendorOnly.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Page.IsSet() { - localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { - localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) - } - // 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 - } - if localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() { - localVarHeaderParams["x-anchore-account"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// QueryVulnerabilitiesOpts Optional parameters for the method 'QueryVulnerabilities' -type QueryVulnerabilitiesOpts struct { - AffectedPackage optional.String - AffectedPackageVersion optional.String - Page optional.String - Limit optional.Int32 -} - -/* -QueryVulnerabilities Listing information about given vulnerability -List (w/filters) vulnerability records known by the system, with affected packages information if present - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param id The ID of the vulnerability (e.g. CVE-1999-0001) - * @param optional nil or *QueryVulnerabilitiesOpts - Optional Parameters: - * @param "AffectedPackage" (optional.String) - Filter results by specified package name (e.g. sed) - * @param "AffectedPackageVersion" (optional.String) - Filter results by specified package version (e.g. 4.4-1) - * @param "Page" (optional.String) - The page of results to fetch. Pages start at 1 - * @param "Limit" (optional.Int32) - Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page -@return PaginatedVulnerabilityList -*/ -func (a *VulnerabilitiesApiService) QueryVulnerabilities(ctx _context.Context, id string, localVarOptionals *QueryVulnerabilitiesOpts) (PaginatedVulnerabilityList, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PaginatedVulnerabilityList - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/query/vulnerabilities" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("id", parameterToString(id, "")) - if localVarOptionals != nil && localVarOptionals.AffectedPackage.IsSet() { - localVarQueryParams.Add("affected_package", parameterToString(localVarOptionals.AffectedPackage.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.AffectedPackageVersion.IsSet() { - localVarQueryParams.Add("affected_package_version", parameterToString(localVarOptionals.AffectedPackageVersion.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Page.IsSet() { - localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { - localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) - } - // 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 - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ApiErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/.gen/anchore/client.go b/.gen/anchore/client.go index c34cbf38d8..3cd6cb694c 100644 --- a/.gen/anchore/client.go +++ b/.gen/anchore/client.go @@ -1,11 +1,11 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) -// APIClient manages communication with the Anchore Engine API Server API v0.1.12 +// APIClient manages communication with the Anchore Engine API Server API v0.1.20 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -62,16 +62,16 @@ type APIClient struct { ImportApi *ImportApiService + ImportsApi *ImportsApiService + PoliciesApi *PoliciesApiService - PolicyApi *PolicyApiService + QueryApi *QueryApiService RegistriesApi *RegistriesApiService RepositoryCredentialsApi *RepositoryCredentialsApiService - ServicesApi *ServicesApiService - SubscriptionsApi *SubscriptionsApiService SummariesApi *SummariesApiService @@ -79,8 +79,6 @@ type APIClient struct { SystemApi *SystemApiService UserManagementApi *UserManagementApiService - - VulnerabilitiesApi *VulnerabilitiesApiService } type service struct { @@ -105,16 +103,15 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.IdentityApi = (*IdentityApiService)(&c.common) c.ImagesApi = (*ImagesApiService)(&c.common) c.ImportApi = (*ImportApiService)(&c.common) + c.ImportsApi = (*ImportsApiService)(&c.common) c.PoliciesApi = (*PoliciesApiService)(&c.common) - c.PolicyApi = (*PolicyApiService)(&c.common) + c.QueryApi = (*QueryApiService)(&c.common) c.RegistriesApi = (*RegistriesApiService)(&c.common) c.RepositoryCredentialsApi = (*RepositoryCredentialsApiService)(&c.common) - c.ServicesApi = (*ServicesApiService)(&c.common) c.SubscriptionsApi = (*SubscriptionsApiService)(&c.common) c.SummariesApi = (*SummariesApiService)(&c.common) c.SystemApi = (*SystemApiService)(&c.common) c.UserManagementApi = (*UserManagementApiService)(&c.common) - c.VulnerabilitiesApi = (*VulnerabilitiesApiService)(&c.common) return c } @@ -147,10 +144,10 @@ func selectHeaderAccept(accepts []string) string { return strings.Join(accepts, ",") } -// contains is a case insenstive match, finding needle in a haystack +// contains is a case insensitive match, finding needle in a haystack func contains(haystack []string, needle string) bool { for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { + if strings.EqualFold(a, needle) { return true } } @@ -204,13 +201,12 @@ func parameterToJson(obj interface{}) (string, error) { return string(jsonBuf), err } - // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } @@ -227,21 +223,21 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } log.Printf("\n%s\n", string(dump)) } - return resp, err } -// ChangeBasePath changes base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -250,9 +246,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -271,7 +265,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -290,16 +284,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } @@ -362,7 +357,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } @@ -402,7 +397,6 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - return localVarRequest, nil } @@ -420,6 +414,9 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = (*f).Write(b) + if err != nil { + return + } _, err = (*f).Seek(0, io.SeekStart) return } @@ -430,7 +427,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if err = json.Unmarshal(b, v); err != nil { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil @@ -440,11 +445,14 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() if err != nil { return err } - defer file.Close() part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { @@ -460,6 +468,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { @@ -468,6 +483,8 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e if reader, ok := body.(io.Reader); ok { _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(**os.File); ok { + _, err = bodyBuf.ReadFrom(*fp) } else if b, ok := body.([]byte); ok { _, err = bodyBuf.Write(b) } else if s, ok := body.(string); ok { diff --git a/.gen/anchore/configuration.go b/.gen/anchore/configuration.go index 1c10692a7e..00ffb1fff1 100644 --- a/.gen/anchore/configuration.go +++ b/.gen/anchore/configuration.go @@ -1,17 +1,18 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore import ( + "context" "fmt" "net/http" "strings" @@ -37,9 +38,23 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -54,7 +69,6 @@ type APIKey struct { Prefix string } - // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -64,36 +78,40 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - Url string + URL string Description string Variables map[string]ServerVariable } +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + // Configuration stores the configuration of the API client type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers []ServerConfiguration - HTTPClient *http.Client + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client } // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://localhost", - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: []ServerConfiguration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ { - Url: "/", + URL: "", Description: "No description provided", }, }, + OperationServers: map[string]ServerConfigurations{ + }, } return cfg } @@ -103,13 +121,13 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } -// ServerUrl returns URL based on server settings -func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { - if index < 0 || len(c.Servers) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) } - server := c.Servers[index] - url := server.Url + server := sc[index] + url := server.URL // go through variables and replace placeholders for name, variable := range server.Variables { @@ -130,3 +148,84 @@ func (c *Configuration) ServerUrl(index int, variables map[string]string) (strin } return url, nil } + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/.gen/anchore/model_access_credential.go b/.gen/anchore/model_access_credential.go index 126ef16fed..09dabca4dd 100644 --- a/.gen/anchore/model_access_credential.go +++ b/.gen/anchore/model_access_credential.go @@ -1,15 +1,20 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AccessCredential A login credential mapped to a user identity. For password credentials, the username to present for Basic auth is the user's username from the user record type AccessCredential struct { // The type of credential @@ -17,5 +22,156 @@ type AccessCredential struct { // The credential value (e.g. the password) Value string `json:"value"` // The timestamp of creation of the credential - CreatedAt string `json:"created_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// NewAccessCredential instantiates a new AccessCredential 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 NewAccessCredential(type_ string, value string) *AccessCredential { + this := AccessCredential{} + this.Type = type_ + this.Value = value + return &this +} + +// NewAccessCredentialWithDefaults instantiates a new AccessCredential 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 NewAccessCredentialWithDefaults() *AccessCredential { + this := AccessCredential{} + return &this +} + +// GetType returns the Type field value +func (o *AccessCredential) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AccessCredential) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AccessCredential) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *AccessCredential) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *AccessCredential) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *AccessCredential) SetValue(v string) { + o.Value = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AccessCredential) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessCredential) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true } + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AccessCredential) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *AccessCredential) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +func (o AccessCredential) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["type"] = o.Type + } + if true { + toSerialize["value"] = o.Value + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + return json.Marshal(toSerialize) +} + +type NullableAccessCredential struct { + value *AccessCredential + isSet bool +} + +func (v NullableAccessCredential) Get() *AccessCredential { + return v.value +} + +func (v *NullableAccessCredential) Set(val *AccessCredential) { + v.value = val + v.isSet = true +} + +func (v NullableAccessCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessCredential(val *AccessCredential) *NullableAccessCredential { + return &NullableAccessCredential{value: val, isSet: true} +} + +func (v NullableAccessCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_account.go b/.gen/anchore/model_account.go index f5466194e1..f4ba5a9153 100644 --- a/.gen/anchore/model_account.go +++ b/.gen/anchore/model_account.go @@ -1,30 +1,296 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // Account Account information type Account struct { // The account identifier, not updatable after creation Name string `json:"name"` // The user type (admin vs user). If not specified in a POST request, 'user' is default - Type string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` // State of the account. Disabled accounts prevent member users from logging in, deleting accounts are disabled and pending deletion and will be removed once all owned resources are garbage collected by the system - State string `json:"state,omitempty"` + State *string `json:"state,omitempty"` // Optional email address associated with the account - Email string `json:"email,omitempty"` + Email *string `json:"email,omitempty"` // The timestamp when the account was created - CreatedAt time.Time `json:"created_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` // The timestamp of the last update to the account metadata itself (not users or creds) - LastUpdated time.Time `json:"last_updated,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` +} + +// NewAccount instantiates a new Account 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 NewAccount(name string) *Account { + this := Account{} + this.Name = name + return &this +} + +// NewAccountWithDefaults instantiates a new Account 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 NewAccountWithDefaults() *Account { + this := Account{} + return &this +} + +// GetName returns the Name field value +func (o *Account) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Account) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Account) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Account) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Account) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Account) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Account) SetType(v string) { + o.Type = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Account) GetState() string { + if o == nil || o.State == nil { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Account) GetStateOk() (*string, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Account) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *Account) SetState(v string) { + o.State = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *Account) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Account) GetEmailOk() (*string, bool) { + if o == nil || o.Email == nil { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *Account) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false } + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *Account) SetEmail(v string) { + o.Email = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Account) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Account) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Account) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Account) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *Account) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Account) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *Account) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *Account) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +func (o Account) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.State != nil { + toSerialize["state"] = o.State + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + return json.Marshal(toSerialize) +} + +type NullableAccount struct { + value *Account + isSet bool +} + +func (v NullableAccount) Get() *Account { + return v.value +} + +func (v *NullableAccount) Set(val *Account) { + v.value = val + v.isSet = true +} + +func (v NullableAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccount(val *Account) *NullableAccount { + return &NullableAccount{value: val, isSet: true} +} + +func (v NullableAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_account_creation_request.go b/.gen/anchore/model_account_creation_request.go index 4ab9983052..73a59a4a5a 100644 --- a/.gen/anchore/model_account_creation_request.go +++ b/.gen/anchore/model_account_creation_request.go @@ -1,19 +1,147 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AccountCreationRequest An account to create/add to the system. If already exists will return 400. type AccountCreationRequest struct { // The account name to use. This will identify the account and must be globally unique in the system. Name string `json:"name"` // An optional email to associate with the account for contact purposes - Email string `json:"email,omitempty"` + Email *string `json:"email,omitempty"` +} + +// NewAccountCreationRequest instantiates a new AccountCreationRequest 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 NewAccountCreationRequest(name string) *AccountCreationRequest { + this := AccountCreationRequest{} + this.Name = name + return &this +} + +// NewAccountCreationRequestWithDefaults instantiates a new AccountCreationRequest 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 NewAccountCreationRequestWithDefaults() *AccountCreationRequest { + this := AccountCreationRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AccountCreationRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AccountCreationRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AccountCreationRequest) SetName(v string) { + o.Name = v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *AccountCreationRequest) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountCreationRequest) GetEmailOk() (*string, bool) { + if o == nil || o.Email == nil { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *AccountCreationRequest) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false } + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *AccountCreationRequest) SetEmail(v string) { + o.Email = &v +} + +func (o AccountCreationRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + return json.Marshal(toSerialize) +} + +type NullableAccountCreationRequest struct { + value *AccountCreationRequest + isSet bool +} + +func (v NullableAccountCreationRequest) Get() *AccountCreationRequest { + return v.value +} + +func (v *NullableAccountCreationRequest) Set(val *AccountCreationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAccountCreationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountCreationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountCreationRequest(val *AccountCreationRequest) *NullableAccountCreationRequest { + return &NullableAccountCreationRequest{value: val, isSet: true} +} + +func (v NullableAccountCreationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountCreationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_account_status.go b/.gen/anchore/model_account_status.go index 0760f9686c..53aedd567c 100644 --- a/.gen/anchore/model_account_status.go +++ b/.gen/anchore/model_account_status.go @@ -1,17 +1,117 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AccountStatus A summary of account status type AccountStatus struct { // The status of the account - State string `json:"state,omitempty"` + State *string `json:"state,omitempty"` +} + +// NewAccountStatus instantiates a new AccountStatus 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 NewAccountStatus() *AccountStatus { + this := AccountStatus{} + return &this +} + +// NewAccountStatusWithDefaults instantiates a new AccountStatus 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 NewAccountStatusWithDefaults() *AccountStatus { + this := AccountStatus{} + return &this +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *AccountStatus) GetState() string { + if o == nil || o.State == nil { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountStatus) GetStateOk() (*string, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *AccountStatus) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *AccountStatus) SetState(v string) { + o.State = &v +} + +func (o AccountStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.State != nil { + toSerialize["state"] = o.State + } + return json.Marshal(toSerialize) } + +type NullableAccountStatus struct { + value *AccountStatus + isSet bool +} + +func (v NullableAccountStatus) Get() *AccountStatus { + return v.value +} + +func (v *NullableAccountStatus) Set(val *AccountStatus) { + v.value = val + v.isSet = true +} + +func (v NullableAccountStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountStatus(val *AccountStatus) *NullableAccountStatus { + return &NullableAccountStatus{value: val, isSet: true} +} + +func (v NullableAccountStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_add_result.go b/.gen/anchore/model_analysis_archive_add_result.go index f87aae7d39..a29c1d60c2 100644 --- a/.gen/anchore/model_analysis_archive_add_result.go +++ b/.gen/anchore/model_analysis_archive_add_result.go @@ -1,21 +1,191 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AnalysisArchiveAddResult The result of adding a single digest to the archive type AnalysisArchiveAddResult struct { // The image digest requested to be added - Digest string `json:"digest,omitempty"` + Digest *string `json:"digest,omitempty"` // The status of the archive add operation. Typically either 'archived' or 'error' - Status string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` // Details on the status, e.g. the error message - Detail string `json:"detail,omitempty"` + Detail *string `json:"detail,omitempty"` +} + +// NewAnalysisArchiveAddResult instantiates a new AnalysisArchiveAddResult 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 NewAnalysisArchiveAddResult() *AnalysisArchiveAddResult { + this := AnalysisArchiveAddResult{} + return &this +} + +// NewAnalysisArchiveAddResultWithDefaults instantiates a new AnalysisArchiveAddResult 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 NewAnalysisArchiveAddResultWithDefaults() *AnalysisArchiveAddResult { + this := AnalysisArchiveAddResult{} + return &this +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *AnalysisArchiveAddResult) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveAddResult) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *AnalysisArchiveAddResult) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *AnalysisArchiveAddResult) SetDigest(v string) { + o.Digest = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *AnalysisArchiveAddResult) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveAddResult) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *AnalysisArchiveAddResult) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *AnalysisArchiveAddResult) SetStatus(v string) { + o.Status = &v +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *AnalysisArchiveAddResult) GetDetail() string { + if o == nil || o.Detail == nil { + var ret string + return ret + } + return *o.Detail } + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveAddResult) GetDetailOk() (*string, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *AnalysisArchiveAddResult) HasDetail() bool { + if o != nil && o.Detail != nil { + return true + } + + return false +} + +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *AnalysisArchiveAddResult) SetDetail(v string) { + o.Detail = &v +} + +func (o AnalysisArchiveAddResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveAddResult struct { + value *AnalysisArchiveAddResult + isSet bool +} + +func (v NullableAnalysisArchiveAddResult) Get() *AnalysisArchiveAddResult { + return v.value +} + +func (v *NullableAnalysisArchiveAddResult) Set(val *AnalysisArchiveAddResult) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveAddResult) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveAddResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveAddResult(val *AnalysisArchiveAddResult) *NullableAnalysisArchiveAddResult { + return &NullableAnalysisArchiveAddResult{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveAddResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveAddResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_rules_summary.go b/.gen/anchore/model_analysis_archive_rules_summary.go index b145589eef..528feebda9 100644 --- a/.gen/anchore/model_analysis_archive_rules_summary.go +++ b/.gen/anchore/model_analysis_archive_rules_summary.go @@ -1,22 +1,155 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // AnalysisArchiveRulesSummary Summary of the transition rule set type AnalysisArchiveRulesSummary struct { // The number of rules for this account - Count int32 `json:"count,omitempty"` + Count *int32 `json:"count,omitempty"` // The newest last_updated timestamp from the set of rules - LastUpdated time.Time `json:"last_updated,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` +} + +// NewAnalysisArchiveRulesSummary instantiates a new AnalysisArchiveRulesSummary 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 NewAnalysisArchiveRulesSummary() *AnalysisArchiveRulesSummary { + this := AnalysisArchiveRulesSummary{} + return &this +} + +// NewAnalysisArchiveRulesSummaryWithDefaults instantiates a new AnalysisArchiveRulesSummary 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 NewAnalysisArchiveRulesSummaryWithDefaults() *AnalysisArchiveRulesSummary { + this := AnalysisArchiveRulesSummary{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *AnalysisArchiveRulesSummary) GetCount() int32 { + if o == nil || o.Count == nil { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveRulesSummary) GetCountOk() (*int32, bool) { + if o == nil || o.Count == nil { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *AnalysisArchiveRulesSummary) HasCount() bool { + if o != nil && o.Count != nil { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *AnalysisArchiveRulesSummary) SetCount(v int32) { + o.Count = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AnalysisArchiveRulesSummary) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveRulesSummary) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AnalysisArchiveRulesSummary) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AnalysisArchiveRulesSummary) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +func (o AnalysisArchiveRulesSummary) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Count != nil { + toSerialize["count"] = o.Count + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveRulesSummary struct { + value *AnalysisArchiveRulesSummary + isSet bool +} + +func (v NullableAnalysisArchiveRulesSummary) Get() *AnalysisArchiveRulesSummary { + return v.value } + +func (v *NullableAnalysisArchiveRulesSummary) Set(val *AnalysisArchiveRulesSummary) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveRulesSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveRulesSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveRulesSummary(val *AnalysisArchiveRulesSummary) *NullableAnalysisArchiveRulesSummary { + return &NullableAnalysisArchiveRulesSummary{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveRulesSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveRulesSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_source.go b/.gen/anchore/model_analysis_archive_source.go index 39b5f68f48..b4b0272bc3 100644 --- a/.gen/anchore/model_analysis_archive_source.go +++ b/.gen/anchore/model_analysis_archive_source.go @@ -1,17 +1,110 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AnalysisArchiveSource An image reference in the analysis archive for the purposes of loading analysis from the archive into th working set type AnalysisArchiveSource struct { // The image digest identify the analysis. Archived analyses are based on digest, tag records are restored as analysis is restored. Digest string `json:"digest"` } + +// NewAnalysisArchiveSource instantiates a new AnalysisArchiveSource 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 NewAnalysisArchiveSource(digest string) *AnalysisArchiveSource { + this := AnalysisArchiveSource{} + this.Digest = digest + return &this +} + +// NewAnalysisArchiveSourceWithDefaults instantiates a new AnalysisArchiveSource 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 NewAnalysisArchiveSourceWithDefaults() *AnalysisArchiveSource { + this := AnalysisArchiveSource{} + return &this +} + +// GetDigest returns the Digest field value +func (o *AnalysisArchiveSource) GetDigest() string { + if o == nil { + var ret string + return ret + } + + return o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveSource) GetDigestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Digest, true +} + +// SetDigest sets field value +func (o *AnalysisArchiveSource) SetDigest(v string) { + o.Digest = v +} + +func (o AnalysisArchiveSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["digest"] = o.Digest + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveSource struct { + value *AnalysisArchiveSource + isSet bool +} + +func (v NullableAnalysisArchiveSource) Get() *AnalysisArchiveSource { + return v.value +} + +func (v *NullableAnalysisArchiveSource) Set(val *AnalysisArchiveSource) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveSource) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveSource(val *AnalysisArchiveSource) *NullableAnalysisArchiveSource { + return &NullableAnalysisArchiveSource{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_summary.go b/.gen/anchore/model_analysis_archive_summary.go index 3de9602b83..69f0ec7393 100644 --- a/.gen/anchore/model_analysis_archive_summary.go +++ b/.gen/anchore/model_analysis_archive_summary.go @@ -1,26 +1,229 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // AnalysisArchiveSummary A summarization of the analysis archive, including size, counts, etc. This archive stores image analysis only, never the actual image content or layers. type AnalysisArchiveSummary struct { // The number of unique images (digests) in the archive - TotalImageCount int32 `json:"total_image_count,omitempty"` + TotalImageCount *int32 `json:"total_image_count,omitempty"` // The number of tag records (registry/repo:tag pull strings) in the archive. This may include repeated tags but will always have a unique tag->digest mapping per record. - TotalTagCount int32 `json:"total_tag_count,omitempty"` + TotalTagCount *int32 `json:"total_tag_count,omitempty"` // The total sum of all the bytes stored to the backing storage. Accounts for anchore-applied compression, but not compression by the underlying storage system. - TotalDataBytes int32 `json:"total_data_bytes,omitempty"` + TotalDataBytes *int32 `json:"total_data_bytes,omitempty"` // The timestamp of the most recent archived image - LastUpdated time.Time `json:"last_updated,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` +} + +// NewAnalysisArchiveSummary instantiates a new AnalysisArchiveSummary 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 NewAnalysisArchiveSummary() *AnalysisArchiveSummary { + this := AnalysisArchiveSummary{} + return &this +} + +// NewAnalysisArchiveSummaryWithDefaults instantiates a new AnalysisArchiveSummary 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 NewAnalysisArchiveSummaryWithDefaults() *AnalysisArchiveSummary { + this := AnalysisArchiveSummary{} + return &this +} + +// GetTotalImageCount returns the TotalImageCount field value if set, zero value otherwise. +func (o *AnalysisArchiveSummary) GetTotalImageCount() int32 { + if o == nil || o.TotalImageCount == nil { + var ret int32 + return ret + } + return *o.TotalImageCount +} + +// GetTotalImageCountOk returns a tuple with the TotalImageCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveSummary) GetTotalImageCountOk() (*int32, bool) { + if o == nil || o.TotalImageCount == nil { + return nil, false + } + return o.TotalImageCount, true +} + +// HasTotalImageCount returns a boolean if a field has been set. +func (o *AnalysisArchiveSummary) HasTotalImageCount() bool { + if o != nil && o.TotalImageCount != nil { + return true + } + + return false +} + +// SetTotalImageCount gets a reference to the given int32 and assigns it to the TotalImageCount field. +func (o *AnalysisArchiveSummary) SetTotalImageCount(v int32) { + o.TotalImageCount = &v +} + +// GetTotalTagCount returns the TotalTagCount field value if set, zero value otherwise. +func (o *AnalysisArchiveSummary) GetTotalTagCount() int32 { + if o == nil || o.TotalTagCount == nil { + var ret int32 + return ret + } + return *o.TotalTagCount +} + +// GetTotalTagCountOk returns a tuple with the TotalTagCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveSummary) GetTotalTagCountOk() (*int32, bool) { + if o == nil || o.TotalTagCount == nil { + return nil, false + } + return o.TotalTagCount, true +} + +// HasTotalTagCount returns a boolean if a field has been set. +func (o *AnalysisArchiveSummary) HasTotalTagCount() bool { + if o != nil && o.TotalTagCount != nil { + return true + } + + return false +} + +// SetTotalTagCount gets a reference to the given int32 and assigns it to the TotalTagCount field. +func (o *AnalysisArchiveSummary) SetTotalTagCount(v int32) { + o.TotalTagCount = &v +} + +// GetTotalDataBytes returns the TotalDataBytes field value if set, zero value otherwise. +func (o *AnalysisArchiveSummary) GetTotalDataBytes() int32 { + if o == nil || o.TotalDataBytes == nil { + var ret int32 + return ret + } + return *o.TotalDataBytes +} + +// GetTotalDataBytesOk returns a tuple with the TotalDataBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveSummary) GetTotalDataBytesOk() (*int32, bool) { + if o == nil || o.TotalDataBytes == nil { + return nil, false + } + return o.TotalDataBytes, true +} + +// HasTotalDataBytes returns a boolean if a field has been set. +func (o *AnalysisArchiveSummary) HasTotalDataBytes() bool { + if o != nil && o.TotalDataBytes != nil { + return true + } + + return false +} + +// SetTotalDataBytes gets a reference to the given int32 and assigns it to the TotalDataBytes field. +func (o *AnalysisArchiveSummary) SetTotalDataBytes(v int32) { + o.TotalDataBytes = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AnalysisArchiveSummary) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveSummary) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AnalysisArchiveSummary) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AnalysisArchiveSummary) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +func (o AnalysisArchiveSummary) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.TotalImageCount != nil { + toSerialize["total_image_count"] = o.TotalImageCount + } + if o.TotalTagCount != nil { + toSerialize["total_tag_count"] = o.TotalTagCount + } + if o.TotalDataBytes != nil { + toSerialize["total_data_bytes"] = o.TotalDataBytes + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveSummary struct { + value *AnalysisArchiveSummary + isSet bool } + +func (v NullableAnalysisArchiveSummary) Get() *AnalysisArchiveSummary { + return v.value +} + +func (v *NullableAnalysisArchiveSummary) Set(val *AnalysisArchiveSummary) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveSummary(val *AnalysisArchiveSummary) *NullableAnalysisArchiveSummary { + return &NullableAnalysisArchiveSummary{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_transition_history.go b/.gen/anchore/model_analysis_archive_transition_history.go index 182b97422f..3f1031188e 100644 --- a/.gen/anchore/model_analysis_archive_transition_history.go +++ b/.gen/anchore/model_analysis_archive_transition_history.go @@ -1,25 +1,298 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // AnalysisArchiveTransitionHistory A rule for auto-archiving image analysis by time and/or tag-history type AnalysisArchiveTransitionHistory struct { // The task that created & updated this entry - TransitionTaskId string `json:"transition_task_id,omitempty"` - RuleId string `json:"rule_id,omitempty"` - ImageDigest string `json:"imageDigest,omitempty"` - Transition string `json:"transition,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - LastUpdated time.Time `json:"last_updated,omitempty"` + TransitionTaskId *string `json:"transition_task_id,omitempty"` + RuleId *string `json:"rule_id,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + Transition *string `json:"transition,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` +} + +// NewAnalysisArchiveTransitionHistory instantiates a new AnalysisArchiveTransitionHistory 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 NewAnalysisArchiveTransitionHistory() *AnalysisArchiveTransitionHistory { + this := AnalysisArchiveTransitionHistory{} + return &this +} + +// NewAnalysisArchiveTransitionHistoryWithDefaults instantiates a new AnalysisArchiveTransitionHistory 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 NewAnalysisArchiveTransitionHistoryWithDefaults() *AnalysisArchiveTransitionHistory { + this := AnalysisArchiveTransitionHistory{} + return &this +} + +// GetTransitionTaskId returns the TransitionTaskId field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionHistory) GetTransitionTaskId() string { + if o == nil || o.TransitionTaskId == nil { + var ret string + return ret + } + return *o.TransitionTaskId +} + +// GetTransitionTaskIdOk returns a tuple with the TransitionTaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionHistory) GetTransitionTaskIdOk() (*string, bool) { + if o == nil || o.TransitionTaskId == nil { + return nil, false + } + return o.TransitionTaskId, true +} + +// HasTransitionTaskId returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionHistory) HasTransitionTaskId() bool { + if o != nil && o.TransitionTaskId != nil { + return true + } + + return false +} + +// SetTransitionTaskId gets a reference to the given string and assigns it to the TransitionTaskId field. +func (o *AnalysisArchiveTransitionHistory) SetTransitionTaskId(v string) { + o.TransitionTaskId = &v +} + +// GetRuleId returns the RuleId field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionHistory) GetRuleId() string { + if o == nil || o.RuleId == nil { + var ret string + return ret + } + return *o.RuleId +} + +// GetRuleIdOk returns a tuple with the RuleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionHistory) GetRuleIdOk() (*string, bool) { + if o == nil || o.RuleId == nil { + return nil, false + } + return o.RuleId, true +} + +// HasRuleId returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionHistory) HasRuleId() bool { + if o != nil && o.RuleId != nil { + return true + } + + return false +} + +// SetRuleId gets a reference to the given string and assigns it to the RuleId field. +func (o *AnalysisArchiveTransitionHistory) SetRuleId(v string) { + o.RuleId = &v +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionHistory) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionHistory) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionHistory) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *AnalysisArchiveTransitionHistory) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetTransition returns the Transition field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionHistory) GetTransition() string { + if o == nil || o.Transition == nil { + var ret string + return ret + } + return *o.Transition +} + +// GetTransitionOk returns a tuple with the Transition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionHistory) GetTransitionOk() (*string, bool) { + if o == nil || o.Transition == nil { + return nil, false + } + return o.Transition, true +} + +// HasTransition returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionHistory) HasTransition() bool { + if o != nil && o.Transition != nil { + return true + } + + return false +} + +// SetTransition gets a reference to the given string and assigns it to the Transition field. +func (o *AnalysisArchiveTransitionHistory) SetTransition(v string) { + o.Transition = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionHistory) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionHistory) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionHistory) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AnalysisArchiveTransitionHistory) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionHistory) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionHistory) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionHistory) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AnalysisArchiveTransitionHistory) SetLastUpdated(v time.Time) { + o.LastUpdated = &v } + +func (o AnalysisArchiveTransitionHistory) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.TransitionTaskId != nil { + toSerialize["transition_task_id"] = o.TransitionTaskId + } + if o.RuleId != nil { + toSerialize["rule_id"] = o.RuleId + } + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.Transition != nil { + toSerialize["transition"] = o.Transition + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveTransitionHistory struct { + value *AnalysisArchiveTransitionHistory + isSet bool +} + +func (v NullableAnalysisArchiveTransitionHistory) Get() *AnalysisArchiveTransitionHistory { + return v.value +} + +func (v *NullableAnalysisArchiveTransitionHistory) Set(val *AnalysisArchiveTransitionHistory) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveTransitionHistory) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveTransitionHistory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveTransitionHistory(val *AnalysisArchiveTransitionHistory) *NullableAnalysisArchiveTransitionHistory { + return &NullableAnalysisArchiveTransitionHistory{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveTransitionHistory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveTransitionHistory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_transition_rule.go b/.gen/anchore/model_analysis_archive_transition_rule.go index 2cc250b11f..d3e660fed1 100644 --- a/.gen/anchore/model_analysis_archive_transition_rule.go +++ b/.gen/anchore/model_analysis_archive_transition_rule.go @@ -1,29 +1,440 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // AnalysisArchiveTransitionRule A rule for auto-archiving image analysis by time and/or tag-history type AnalysisArchiveTransitionRule struct { - Selector ImageSelector `json:"selector,omitempty"` + Selector *ImageSelector `json:"selector,omitempty"` + // Unique identifier for archive rule + RuleId *string `json:"rule_id,omitempty"` // Number of images mapped to the tag that are newer - TagVersionsNewer int32 `json:"tag_versions_newer,omitempty"` + TagVersionsNewer *int32 `json:"tag_versions_newer,omitempty"` // Matches if the analysis is strictly older than this number of days - AnalysisAgeDays int32 `json:"analysis_age_days,omitempty"` + AnalysisAgeDays *int32 `json:"analysis_age_days,omitempty"` // The type of transition to make. If \"archive\", then archive an image from the working set and remove it from the working set. If \"delete\", then match against archived images and delete from the archive if match. Transition string `json:"transition"` // True if the rule applies to all accounts in the system. This is only available to admin users to update/modify, but all users with permission to list rules can see them - SystemGlobal bool `json:"system_global,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - LastUpdated time.Time `json:"last_updated,omitempty"` + SystemGlobal *bool `json:"system_global,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` + Exclude *AnalysisArchiveTransitionRuleExclude `json:"exclude,omitempty"` + // This is the maximum number of image analyses an account can have. Can only be set on system_global rules + MaxImagesPerAccount *int32 `json:"max_images_per_account,omitempty"` +} + +// NewAnalysisArchiveTransitionRule instantiates a new AnalysisArchiveTransitionRule 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 NewAnalysisArchiveTransitionRule(transition string) *AnalysisArchiveTransitionRule { + this := AnalysisArchiveTransitionRule{} + this.Transition = transition + return &this +} + +// NewAnalysisArchiveTransitionRuleWithDefaults instantiates a new AnalysisArchiveTransitionRule 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 NewAnalysisArchiveTransitionRuleWithDefaults() *AnalysisArchiveTransitionRule { + this := AnalysisArchiveTransitionRule{} + return &this +} + +// GetSelector returns the Selector field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetSelector() ImageSelector { + if o == nil || o.Selector == nil { + var ret ImageSelector + return ret + } + return *o.Selector +} + +// GetSelectorOk returns a tuple with the Selector field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetSelectorOk() (*ImageSelector, bool) { + if o == nil || o.Selector == nil { + return nil, false + } + return o.Selector, true +} + +// HasSelector returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasSelector() bool { + if o != nil && o.Selector != nil { + return true + } + + return false +} + +// SetSelector gets a reference to the given ImageSelector and assigns it to the Selector field. +func (o *AnalysisArchiveTransitionRule) SetSelector(v ImageSelector) { + o.Selector = &v +} + +// GetRuleId returns the RuleId field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetRuleId() string { + if o == nil || o.RuleId == nil { + var ret string + return ret + } + return *o.RuleId +} + +// GetRuleIdOk returns a tuple with the RuleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetRuleIdOk() (*string, bool) { + if o == nil || o.RuleId == nil { + return nil, false + } + return o.RuleId, true +} + +// HasRuleId returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasRuleId() bool { + if o != nil && o.RuleId != nil { + return true + } + + return false +} + +// SetRuleId gets a reference to the given string and assigns it to the RuleId field. +func (o *AnalysisArchiveTransitionRule) SetRuleId(v string) { + o.RuleId = &v +} + +// GetTagVersionsNewer returns the TagVersionsNewer field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetTagVersionsNewer() int32 { + if o == nil || o.TagVersionsNewer == nil { + var ret int32 + return ret + } + return *o.TagVersionsNewer +} + +// GetTagVersionsNewerOk returns a tuple with the TagVersionsNewer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetTagVersionsNewerOk() (*int32, bool) { + if o == nil || o.TagVersionsNewer == nil { + return nil, false + } + return o.TagVersionsNewer, true +} + +// HasTagVersionsNewer returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasTagVersionsNewer() bool { + if o != nil && o.TagVersionsNewer != nil { + return true + } + + return false +} + +// SetTagVersionsNewer gets a reference to the given int32 and assigns it to the TagVersionsNewer field. +func (o *AnalysisArchiveTransitionRule) SetTagVersionsNewer(v int32) { + o.TagVersionsNewer = &v +} + +// GetAnalysisAgeDays returns the AnalysisAgeDays field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetAnalysisAgeDays() int32 { + if o == nil || o.AnalysisAgeDays == nil { + var ret int32 + return ret + } + return *o.AnalysisAgeDays +} + +// GetAnalysisAgeDaysOk returns a tuple with the AnalysisAgeDays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetAnalysisAgeDaysOk() (*int32, bool) { + if o == nil || o.AnalysisAgeDays == nil { + return nil, false + } + return o.AnalysisAgeDays, true +} + +// HasAnalysisAgeDays returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasAnalysisAgeDays() bool { + if o != nil && o.AnalysisAgeDays != nil { + return true + } + + return false +} + +// SetAnalysisAgeDays gets a reference to the given int32 and assigns it to the AnalysisAgeDays field. +func (o *AnalysisArchiveTransitionRule) SetAnalysisAgeDays(v int32) { + o.AnalysisAgeDays = &v +} + +// GetTransition returns the Transition field value +func (o *AnalysisArchiveTransitionRule) GetTransition() string { + if o == nil { + var ret string + return ret + } + + return o.Transition +} + +// GetTransitionOk returns a tuple with the Transition field value +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetTransitionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Transition, true +} + +// SetTransition sets field value +func (o *AnalysisArchiveTransitionRule) SetTransition(v string) { + o.Transition = v +} + +// GetSystemGlobal returns the SystemGlobal field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetSystemGlobal() bool { + if o == nil || o.SystemGlobal == nil { + var ret bool + return ret + } + return *o.SystemGlobal +} + +// GetSystemGlobalOk returns a tuple with the SystemGlobal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetSystemGlobalOk() (*bool, bool) { + if o == nil || o.SystemGlobal == nil { + return nil, false + } + return o.SystemGlobal, true +} + +// HasSystemGlobal returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasSystemGlobal() bool { + if o != nil && o.SystemGlobal != nil { + return true + } + + return false } + +// SetSystemGlobal gets a reference to the given bool and assigns it to the SystemGlobal field. +func (o *AnalysisArchiveTransitionRule) SetSystemGlobal(v bool) { + o.SystemGlobal = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AnalysisArchiveTransitionRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AnalysisArchiveTransitionRule) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetExclude returns the Exclude field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetExclude() AnalysisArchiveTransitionRuleExclude { + if o == nil || o.Exclude == nil { + var ret AnalysisArchiveTransitionRuleExclude + return ret + } + return *o.Exclude +} + +// GetExcludeOk returns a tuple with the Exclude field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetExcludeOk() (*AnalysisArchiveTransitionRuleExclude, bool) { + if o == nil || o.Exclude == nil { + return nil, false + } + return o.Exclude, true +} + +// HasExclude returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasExclude() bool { + if o != nil && o.Exclude != nil { + return true + } + + return false +} + +// SetExclude gets a reference to the given AnalysisArchiveTransitionRuleExclude and assigns it to the Exclude field. +func (o *AnalysisArchiveTransitionRule) SetExclude(v AnalysisArchiveTransitionRuleExclude) { + o.Exclude = &v +} + +// GetMaxImagesPerAccount returns the MaxImagesPerAccount field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRule) GetMaxImagesPerAccount() int32 { + if o == nil || o.MaxImagesPerAccount == nil { + var ret int32 + return ret + } + return *o.MaxImagesPerAccount +} + +// GetMaxImagesPerAccountOk returns a tuple with the MaxImagesPerAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRule) GetMaxImagesPerAccountOk() (*int32, bool) { + if o == nil || o.MaxImagesPerAccount == nil { + return nil, false + } + return o.MaxImagesPerAccount, true +} + +// HasMaxImagesPerAccount returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRule) HasMaxImagesPerAccount() bool { + if o != nil && o.MaxImagesPerAccount != nil { + return true + } + + return false +} + +// SetMaxImagesPerAccount gets a reference to the given int32 and assigns it to the MaxImagesPerAccount field. +func (o *AnalysisArchiveTransitionRule) SetMaxImagesPerAccount(v int32) { + o.MaxImagesPerAccount = &v +} + +func (o AnalysisArchiveTransitionRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Selector != nil { + toSerialize["selector"] = o.Selector + } + if o.RuleId != nil { + toSerialize["rule_id"] = o.RuleId + } + if o.TagVersionsNewer != nil { + toSerialize["tag_versions_newer"] = o.TagVersionsNewer + } + if o.AnalysisAgeDays != nil { + toSerialize["analysis_age_days"] = o.AnalysisAgeDays + } + if true { + toSerialize["transition"] = o.Transition + } + if o.SystemGlobal != nil { + toSerialize["system_global"] = o.SystemGlobal + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.Exclude != nil { + toSerialize["exclude"] = o.Exclude + } + if o.MaxImagesPerAccount != nil { + toSerialize["max_images_per_account"] = o.MaxImagesPerAccount + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveTransitionRule struct { + value *AnalysisArchiveTransitionRule + isSet bool +} + +func (v NullableAnalysisArchiveTransitionRule) Get() *AnalysisArchiveTransitionRule { + return v.value +} + +func (v *NullableAnalysisArchiveTransitionRule) Set(val *AnalysisArchiveTransitionRule) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveTransitionRule) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveTransitionRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveTransitionRule(val *AnalysisArchiveTransitionRule) *NullableAnalysisArchiveTransitionRule { + return &NullableAnalysisArchiveTransitionRule{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveTransitionRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveTransitionRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_archive_transition_rule_exclude.go b/.gen/anchore/model_analysis_archive_transition_rule_exclude.go new file mode 100644 index 0000000000..bb1828372e --- /dev/null +++ b/.gen/anchore/model_analysis_archive_transition_rule_exclude.go @@ -0,0 +1,153 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisArchiveTransitionRuleExclude Which Images to exclude from auto-archiving logic +type AnalysisArchiveTransitionRuleExclude struct { + Selector *ImageSelector `json:"selector,omitempty"` + // How long the image selected will be excluded from the archive transition + ExpirationDays *int32 `json:"expiration_days,omitempty"` +} + +// NewAnalysisArchiveTransitionRuleExclude instantiates a new AnalysisArchiveTransitionRuleExclude 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 NewAnalysisArchiveTransitionRuleExclude() *AnalysisArchiveTransitionRuleExclude { + this := AnalysisArchiveTransitionRuleExclude{} + return &this +} + +// NewAnalysisArchiveTransitionRuleExcludeWithDefaults instantiates a new AnalysisArchiveTransitionRuleExclude 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 NewAnalysisArchiveTransitionRuleExcludeWithDefaults() *AnalysisArchiveTransitionRuleExclude { + this := AnalysisArchiveTransitionRuleExclude{} + return &this +} + +// GetSelector returns the Selector field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRuleExclude) GetSelector() ImageSelector { + if o == nil || o.Selector == nil { + var ret ImageSelector + return ret + } + return *o.Selector +} + +// GetSelectorOk returns a tuple with the Selector field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRuleExclude) GetSelectorOk() (*ImageSelector, bool) { + if o == nil || o.Selector == nil { + return nil, false + } + return o.Selector, true +} + +// HasSelector returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRuleExclude) HasSelector() bool { + if o != nil && o.Selector != nil { + return true + } + + return false +} + +// SetSelector gets a reference to the given ImageSelector and assigns it to the Selector field. +func (o *AnalysisArchiveTransitionRuleExclude) SetSelector(v ImageSelector) { + o.Selector = &v +} + +// GetExpirationDays returns the ExpirationDays field value if set, zero value otherwise. +func (o *AnalysisArchiveTransitionRuleExclude) GetExpirationDays() int32 { + if o == nil || o.ExpirationDays == nil { + var ret int32 + return ret + } + return *o.ExpirationDays +} + +// GetExpirationDaysOk returns a tuple with the ExpirationDays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisArchiveTransitionRuleExclude) GetExpirationDaysOk() (*int32, bool) { + if o == nil || o.ExpirationDays == nil { + return nil, false + } + return o.ExpirationDays, true +} + +// HasExpirationDays returns a boolean if a field has been set. +func (o *AnalysisArchiveTransitionRuleExclude) HasExpirationDays() bool { + if o != nil && o.ExpirationDays != nil { + return true + } + + return false +} + +// SetExpirationDays gets a reference to the given int32 and assigns it to the ExpirationDays field. +func (o *AnalysisArchiveTransitionRuleExclude) SetExpirationDays(v int32) { + o.ExpirationDays = &v +} + +func (o AnalysisArchiveTransitionRuleExclude) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Selector != nil { + toSerialize["selector"] = o.Selector + } + if o.ExpirationDays != nil { + toSerialize["expiration_days"] = o.ExpirationDays + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisArchiveTransitionRuleExclude struct { + value *AnalysisArchiveTransitionRuleExclude + isSet bool +} + +func (v NullableAnalysisArchiveTransitionRuleExclude) Get() *AnalysisArchiveTransitionRuleExclude { + return v.value +} + +func (v *NullableAnalysisArchiveTransitionRuleExclude) Set(val *AnalysisArchiveTransitionRuleExclude) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisArchiveTransitionRuleExclude) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisArchiveTransitionRuleExclude) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisArchiveTransitionRuleExclude(val *AnalysisArchiveTransitionRuleExclude) *NullableAnalysisArchiveTransitionRuleExclude { + return &NullableAnalysisArchiveTransitionRuleExclude{value: val, isSet: true} +} + +func (v NullableAnalysisArchiveTransitionRuleExclude) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisArchiveTransitionRuleExclude) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_eval.go b/.gen/anchore/model_analysis_update_eval.go new file mode 100644 index 0000000000..747e97ebe9 --- /dev/null +++ b/.gen/anchore/model_analysis_update_eval.go @@ -0,0 +1,188 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateEval Evaluation Results for an entity (current or last) +type AnalysisUpdateEval struct { + AnalysisStatus *string `json:"analysis_status,omitempty"` + Annotations map[string]interface{} `json:"annotations,omitempty"` + ImageDigest *string `json:"image_digest,omitempty"` +} + +// NewAnalysisUpdateEval instantiates a new AnalysisUpdateEval 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 NewAnalysisUpdateEval() *AnalysisUpdateEval { + this := AnalysisUpdateEval{} + return &this +} + +// NewAnalysisUpdateEvalWithDefaults instantiates a new AnalysisUpdateEval 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 NewAnalysisUpdateEvalWithDefaults() *AnalysisUpdateEval { + this := AnalysisUpdateEval{} + return &this +} + +// GetAnalysisStatus returns the AnalysisStatus field value if set, zero value otherwise. +func (o *AnalysisUpdateEval) GetAnalysisStatus() string { + if o == nil || o.AnalysisStatus == nil { + var ret string + return ret + } + return *o.AnalysisStatus +} + +// GetAnalysisStatusOk returns a tuple with the AnalysisStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateEval) GetAnalysisStatusOk() (*string, bool) { + if o == nil || o.AnalysisStatus == nil { + return nil, false + } + return o.AnalysisStatus, true +} + +// HasAnalysisStatus returns a boolean if a field has been set. +func (o *AnalysisUpdateEval) HasAnalysisStatus() bool { + if o != nil && o.AnalysisStatus != nil { + return true + } + + return false +} + +// SetAnalysisStatus gets a reference to the given string and assigns it to the AnalysisStatus field. +func (o *AnalysisUpdateEval) SetAnalysisStatus(v string) { + o.AnalysisStatus = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *AnalysisUpdateEval) GetAnnotations() map[string]interface{} { + if o == nil || o.Annotations == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// 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 *AnalysisUpdateEval) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *AnalysisUpdateEval) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *AnalysisUpdateEval) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *AnalysisUpdateEval) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateEval) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *AnalysisUpdateEval) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *AnalysisUpdateEval) SetImageDigest(v string) { + o.ImageDigest = &v +} + +func (o AnalysisUpdateEval) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AnalysisStatus != nil { + toSerialize["analysis_status"] = o.AnalysisStatus + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + if o.ImageDigest != nil { + toSerialize["image_digest"] = o.ImageDigest + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateEval struct { + value *AnalysisUpdateEval + isSet bool +} + +func (v NullableAnalysisUpdateEval) Get() *AnalysisUpdateEval { + return v.value +} + +func (v *NullableAnalysisUpdateEval) Set(val *AnalysisUpdateEval) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateEval) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateEval) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateEval(val *AnalysisUpdateEval) *NullableAnalysisUpdateEval { + return &NullableAnalysisUpdateEval{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateEval) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateEval) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_notification.go b/.gen/anchore/model_analysis_update_notification.go new file mode 100644 index 0000000000..dd09f4950c --- /dev/null +++ b/.gen/anchore/model_analysis_update_notification.go @@ -0,0 +1,454 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateNotification struct for AnalysisUpdateNotification +type AnalysisUpdateNotification struct { + QueueId *string `json:"queueId,omitempty"` + UserId *string `json:"userId,omitempty"` + DataId *string `json:"dataId,omitempty"` + CreatedAt *int32 `json:"created_at,omitempty"` + LastUpdated *int32 `json:"last_updated,omitempty"` + RecordStateKey *string `json:"record_state_key,omitempty"` + RecordStateVal NullableString `json:"record_state_val,omitempty"` + Tries *int32 `json:"tries,omitempty"` + MaxTries *int32 `json:"max_tries,omitempty"` + Data *AnalysisUpdateNotificationData `json:"data,omitempty"` +} + +// NewAnalysisUpdateNotification instantiates a new AnalysisUpdateNotification 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 NewAnalysisUpdateNotification() *AnalysisUpdateNotification { + this := AnalysisUpdateNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// NewAnalysisUpdateNotificationWithDefaults instantiates a new AnalysisUpdateNotification 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 NewAnalysisUpdateNotificationWithDefaults() *AnalysisUpdateNotification { + this := AnalysisUpdateNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// GetQueueId returns the QueueId field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetQueueId() string { + if o == nil || o.QueueId == nil { + var ret string + return ret + } + return *o.QueueId +} + +// GetQueueIdOk returns a tuple with the QueueId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetQueueIdOk() (*string, bool) { + if o == nil || o.QueueId == nil { + return nil, false + } + return o.QueueId, true +} + +// HasQueueId returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasQueueId() bool { + if o != nil && o.QueueId != nil { + return true + } + + return false +} + +// SetQueueId gets a reference to the given string and assigns it to the QueueId field. +func (o *AnalysisUpdateNotification) SetQueueId(v string) { + o.QueueId = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *AnalysisUpdateNotification) SetUserId(v string) { + o.UserId = &v +} + +// GetDataId returns the DataId field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetDataId() string { + if o == nil || o.DataId == nil { + var ret string + return ret + } + return *o.DataId +} + +// GetDataIdOk returns a tuple with the DataId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetDataIdOk() (*string, bool) { + if o == nil || o.DataId == nil { + return nil, false + } + return o.DataId, true +} + +// HasDataId returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasDataId() bool { + if o != nil && o.DataId != nil { + return true + } + + return false +} + +// SetDataId gets a reference to the given string and assigns it to the DataId field. +func (o *AnalysisUpdateNotification) SetDataId(v string) { + o.DataId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetCreatedAt() int32 { + if o == nil || o.CreatedAt == nil { + var ret int32 + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetCreatedAtOk() (*int32, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int32 and assigns it to the CreatedAt field. +func (o *AnalysisUpdateNotification) SetCreatedAt(v int32) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetLastUpdated() int32 { + if o == nil || o.LastUpdated == nil { + var ret int32 + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetLastUpdatedOk() (*int32, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given int32 and assigns it to the LastUpdated field. +func (o *AnalysisUpdateNotification) SetLastUpdated(v int32) { + o.LastUpdated = &v +} + +// GetRecordStateKey returns the RecordStateKey field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetRecordStateKey() string { + if o == nil || o.RecordStateKey == nil { + var ret string + return ret + } + return *o.RecordStateKey +} + +// GetRecordStateKeyOk returns a tuple with the RecordStateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetRecordStateKeyOk() (*string, bool) { + if o == nil || o.RecordStateKey == nil { + return nil, false + } + return o.RecordStateKey, true +} + +// HasRecordStateKey returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasRecordStateKey() bool { + if o != nil && o.RecordStateKey != nil { + return true + } + + return false +} + +// SetRecordStateKey gets a reference to the given string and assigns it to the RecordStateKey field. +func (o *AnalysisUpdateNotification) SetRecordStateKey(v string) { + o.RecordStateKey = &v +} + +// GetRecordStateVal returns the RecordStateVal field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AnalysisUpdateNotification) GetRecordStateVal() string { + if o == nil || o.RecordStateVal.Get() == nil { + var ret string + return ret + } + return *o.RecordStateVal.Get() +} + +// GetRecordStateValOk returns a tuple with the RecordStateVal field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AnalysisUpdateNotification) GetRecordStateValOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecordStateVal.Get(), o.RecordStateVal.IsSet() +} + +// HasRecordStateVal returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasRecordStateVal() bool { + if o != nil && o.RecordStateVal.IsSet() { + return true + } + + return false +} + +// SetRecordStateVal gets a reference to the given NullableString and assigns it to the RecordStateVal field. +func (o *AnalysisUpdateNotification) SetRecordStateVal(v string) { + o.RecordStateVal.Set(&v) +} +// SetRecordStateValNil sets the value for RecordStateVal to be an explicit nil +func (o *AnalysisUpdateNotification) SetRecordStateValNil() { + o.RecordStateVal.Set(nil) +} + +// UnsetRecordStateVal ensures that no value is present for RecordStateVal, not even an explicit nil +func (o *AnalysisUpdateNotification) UnsetRecordStateVal() { + o.RecordStateVal.Unset() +} + +// GetTries returns the Tries field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetTries() int32 { + if o == nil || o.Tries == nil { + var ret int32 + return ret + } + return *o.Tries +} + +// GetTriesOk returns a tuple with the Tries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetTriesOk() (*int32, bool) { + if o == nil || o.Tries == nil { + return nil, false + } + return o.Tries, true +} + +// HasTries returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasTries() bool { + if o != nil && o.Tries != nil { + return true + } + + return false +} + +// SetTries gets a reference to the given int32 and assigns it to the Tries field. +func (o *AnalysisUpdateNotification) SetTries(v int32) { + o.Tries = &v +} + +// GetMaxTries returns the MaxTries field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetMaxTries() int32 { + if o == nil || o.MaxTries == nil { + var ret int32 + return ret + } + return *o.MaxTries +} + +// GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetMaxTriesOk() (*int32, bool) { + if o == nil || o.MaxTries == nil { + return nil, false + } + return o.MaxTries, true +} + +// HasMaxTries returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasMaxTries() bool { + if o != nil && o.MaxTries != nil { + return true + } + + return false +} + +// SetMaxTries gets a reference to the given int32 and assigns it to the MaxTries field. +func (o *AnalysisUpdateNotification) SetMaxTries(v int32) { + o.MaxTries = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *AnalysisUpdateNotification) GetData() AnalysisUpdateNotificationData { + if o == nil || o.Data == nil { + var ret AnalysisUpdateNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotification) GetDataOk() (*AnalysisUpdateNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *AnalysisUpdateNotification) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given AnalysisUpdateNotificationData and assigns it to the Data field. +func (o *AnalysisUpdateNotification) SetData(v AnalysisUpdateNotificationData) { + o.Data = &v +} + +func (o AnalysisUpdateNotification) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.QueueId != nil { + toSerialize["queueId"] = o.QueueId + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.DataId != nil { + toSerialize["dataId"] = o.DataId + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.RecordStateKey != nil { + toSerialize["record_state_key"] = o.RecordStateKey + } + if o.RecordStateVal.IsSet() { + toSerialize["record_state_val"] = o.RecordStateVal.Get() + } + if o.Tries != nil { + toSerialize["tries"] = o.Tries + } + if o.MaxTries != nil { + toSerialize["max_tries"] = o.MaxTries + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateNotification struct { + value *AnalysisUpdateNotification + isSet bool +} + +func (v NullableAnalysisUpdateNotification) Get() *AnalysisUpdateNotification { + return v.value +} + +func (v *NullableAnalysisUpdateNotification) Set(val *AnalysisUpdateNotification) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateNotification) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateNotification(val *AnalysisUpdateNotification) *NullableAnalysisUpdateNotification { + return &NullableAnalysisUpdateNotification{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_notification_all_of.go b/.gen/anchore/model_analysis_update_notification_all_of.go new file mode 100644 index 0000000000..4de7896103 --- /dev/null +++ b/.gen/anchore/model_analysis_update_notification_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateNotificationAllOf The Notification Object definition for Tag Update Notifications +type AnalysisUpdateNotificationAllOf struct { + Data *AnalysisUpdateNotificationData `json:"data,omitempty"` +} + +// NewAnalysisUpdateNotificationAllOf instantiates a new AnalysisUpdateNotificationAllOf 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 NewAnalysisUpdateNotificationAllOf() *AnalysisUpdateNotificationAllOf { + this := AnalysisUpdateNotificationAllOf{} + return &this +} + +// NewAnalysisUpdateNotificationAllOfWithDefaults instantiates a new AnalysisUpdateNotificationAllOf 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 NewAnalysisUpdateNotificationAllOfWithDefaults() *AnalysisUpdateNotificationAllOf { + this := AnalysisUpdateNotificationAllOf{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationAllOf) GetData() AnalysisUpdateNotificationData { + if o == nil || o.Data == nil { + var ret AnalysisUpdateNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationAllOf) GetDataOk() (*AnalysisUpdateNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationAllOf) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given AnalysisUpdateNotificationData and assigns it to the Data field. +func (o *AnalysisUpdateNotificationAllOf) SetData(v AnalysisUpdateNotificationData) { + o.Data = &v +} + +func (o AnalysisUpdateNotificationAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateNotificationAllOf struct { + value *AnalysisUpdateNotificationAllOf + isSet bool +} + +func (v NullableAnalysisUpdateNotificationAllOf) Get() *AnalysisUpdateNotificationAllOf { + return v.value +} + +func (v *NullableAnalysisUpdateNotificationAllOf) Set(val *AnalysisUpdateNotificationAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateNotificationAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateNotificationAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateNotificationAllOf(val *AnalysisUpdateNotificationAllOf) *NullableAnalysisUpdateNotificationAllOf { + return &NullableAnalysisUpdateNotificationAllOf{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateNotificationAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateNotificationAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_notification_data.go b/.gen/anchore/model_analysis_update_notification_data.go new file mode 100644 index 0000000000..c7a0278294 --- /dev/null +++ b/.gen/anchore/model_analysis_update_notification_data.go @@ -0,0 +1,224 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateNotificationData struct for AnalysisUpdateNotificationData +type AnalysisUpdateNotificationData struct { + NotificationUser *string `json:"notification_user,omitempty"` + NotificationUserEmail *string `json:"notification_user_email,omitempty"` + NotificationType *string `json:"notification_type,omitempty"` + NotificationPayload *AnalysisUpdateNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewAnalysisUpdateNotificationData instantiates a new AnalysisUpdateNotificationData 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 NewAnalysisUpdateNotificationData() *AnalysisUpdateNotificationData { + this := AnalysisUpdateNotificationData{} + return &this +} + +// NewAnalysisUpdateNotificationDataWithDefaults instantiates a new AnalysisUpdateNotificationData 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 NewAnalysisUpdateNotificationDataWithDefaults() *AnalysisUpdateNotificationData { + this := AnalysisUpdateNotificationData{} + return &this +} + +// GetNotificationUser returns the NotificationUser field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationData) GetNotificationUser() string { + if o == nil || o.NotificationUser == nil { + var ret string + return ret + } + return *o.NotificationUser +} + +// GetNotificationUserOk returns a tuple with the NotificationUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationData) GetNotificationUserOk() (*string, bool) { + if o == nil || o.NotificationUser == nil { + return nil, false + } + return o.NotificationUser, true +} + +// HasNotificationUser returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationData) HasNotificationUser() bool { + if o != nil && o.NotificationUser != nil { + return true + } + + return false +} + +// SetNotificationUser gets a reference to the given string and assigns it to the NotificationUser field. +func (o *AnalysisUpdateNotificationData) SetNotificationUser(v string) { + o.NotificationUser = &v +} + +// GetNotificationUserEmail returns the NotificationUserEmail field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationData) GetNotificationUserEmail() string { + if o == nil || o.NotificationUserEmail == nil { + var ret string + return ret + } + return *o.NotificationUserEmail +} + +// GetNotificationUserEmailOk returns a tuple with the NotificationUserEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationData) GetNotificationUserEmailOk() (*string, bool) { + if o == nil || o.NotificationUserEmail == nil { + return nil, false + } + return o.NotificationUserEmail, true +} + +// HasNotificationUserEmail returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationData) HasNotificationUserEmail() bool { + if o != nil && o.NotificationUserEmail != nil { + return true + } + + return false +} + +// SetNotificationUserEmail gets a reference to the given string and assigns it to the NotificationUserEmail field. +func (o *AnalysisUpdateNotificationData) SetNotificationUserEmail(v string) { + o.NotificationUserEmail = &v +} + +// GetNotificationType returns the NotificationType field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationData) GetNotificationType() string { + if o == nil || o.NotificationType == nil { + var ret string + return ret + } + return *o.NotificationType +} + +// GetNotificationTypeOk returns a tuple with the NotificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationData) GetNotificationTypeOk() (*string, bool) { + if o == nil || o.NotificationType == nil { + return nil, false + } + return o.NotificationType, true +} + +// HasNotificationType returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationData) HasNotificationType() bool { + if o != nil && o.NotificationType != nil { + return true + } + + return false +} + +// SetNotificationType gets a reference to the given string and assigns it to the NotificationType field. +func (o *AnalysisUpdateNotificationData) SetNotificationType(v string) { + o.NotificationType = &v +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationData) GetNotificationPayload() AnalysisUpdateNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret AnalysisUpdateNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationData) GetNotificationPayloadOk() (*AnalysisUpdateNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationData) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given AnalysisUpdateNotificationPayload and assigns it to the NotificationPayload field. +func (o *AnalysisUpdateNotificationData) SetNotificationPayload(v AnalysisUpdateNotificationPayload) { + o.NotificationPayload = &v +} + +func (o AnalysisUpdateNotificationData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationUser != nil { + toSerialize["notification_user"] = o.NotificationUser + } + if o.NotificationUserEmail != nil { + toSerialize["notification_user_email"] = o.NotificationUserEmail + } + if o.NotificationType != nil { + toSerialize["notification_type"] = o.NotificationType + } + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateNotificationData struct { + value *AnalysisUpdateNotificationData + isSet bool +} + +func (v NullableAnalysisUpdateNotificationData) Get() *AnalysisUpdateNotificationData { + return v.value +} + +func (v *NullableAnalysisUpdateNotificationData) Set(val *AnalysisUpdateNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateNotificationData(val *AnalysisUpdateNotificationData) *NullableAnalysisUpdateNotificationData { + return &NullableAnalysisUpdateNotificationData{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_notification_data_all_of.go b/.gen/anchore/model_analysis_update_notification_data_all_of.go new file mode 100644 index 0000000000..1cf713817f --- /dev/null +++ b/.gen/anchore/model_analysis_update_notification_data_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateNotificationDataAllOf struct for AnalysisUpdateNotificationDataAllOf +type AnalysisUpdateNotificationDataAllOf struct { + NotificationPayload *AnalysisUpdateNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewAnalysisUpdateNotificationDataAllOf instantiates a new AnalysisUpdateNotificationDataAllOf 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 NewAnalysisUpdateNotificationDataAllOf() *AnalysisUpdateNotificationDataAllOf { + this := AnalysisUpdateNotificationDataAllOf{} + return &this +} + +// NewAnalysisUpdateNotificationDataAllOfWithDefaults instantiates a new AnalysisUpdateNotificationDataAllOf 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 NewAnalysisUpdateNotificationDataAllOfWithDefaults() *AnalysisUpdateNotificationDataAllOf { + this := AnalysisUpdateNotificationDataAllOf{} + return &this +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationDataAllOf) GetNotificationPayload() AnalysisUpdateNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret AnalysisUpdateNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationDataAllOf) GetNotificationPayloadOk() (*AnalysisUpdateNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationDataAllOf) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given AnalysisUpdateNotificationPayload and assigns it to the NotificationPayload field. +func (o *AnalysisUpdateNotificationDataAllOf) SetNotificationPayload(v AnalysisUpdateNotificationPayload) { + o.NotificationPayload = &v +} + +func (o AnalysisUpdateNotificationDataAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateNotificationDataAllOf struct { + value *AnalysisUpdateNotificationDataAllOf + isSet bool +} + +func (v NullableAnalysisUpdateNotificationDataAllOf) Get() *AnalysisUpdateNotificationDataAllOf { + return v.value +} + +func (v *NullableAnalysisUpdateNotificationDataAllOf) Set(val *AnalysisUpdateNotificationDataAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateNotificationDataAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateNotificationDataAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateNotificationDataAllOf(val *AnalysisUpdateNotificationDataAllOf) *NullableAnalysisUpdateNotificationDataAllOf { + return &NullableAnalysisUpdateNotificationDataAllOf{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateNotificationDataAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateNotificationDataAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_notification_payload.go b/.gen/anchore/model_analysis_update_notification_payload.go new file mode 100644 index 0000000000..888ac4d20b --- /dev/null +++ b/.gen/anchore/model_analysis_update_notification_payload.go @@ -0,0 +1,334 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateNotificationPayload struct for AnalysisUpdateNotificationPayload +type AnalysisUpdateNotificationPayload struct { + UserId *string `json:"userId,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` + NotificationId *string `json:"notificationId,omitempty"` + CurrEval *AnalysisUpdateEval `json:"curr_eval,omitempty"` + LastEval *AnalysisUpdateEval `json:"last_eval,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewAnalysisUpdateNotificationPayload instantiates a new AnalysisUpdateNotificationPayload 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 NewAnalysisUpdateNotificationPayload() *AnalysisUpdateNotificationPayload { + this := AnalysisUpdateNotificationPayload{} + return &this +} + +// NewAnalysisUpdateNotificationPayloadWithDefaults instantiates a new AnalysisUpdateNotificationPayload 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 NewAnalysisUpdateNotificationPayloadWithDefaults() *AnalysisUpdateNotificationPayload { + this := AnalysisUpdateNotificationPayload{} + return &this +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayload) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayload) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *AnalysisUpdateNotificationPayload) SetUserId(v string) { + o.UserId = &v +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayload) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayload) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *AnalysisUpdateNotificationPayload) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v +} + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayload) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayload) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *AnalysisUpdateNotificationPayload) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +// GetNotificationId returns the NotificationId field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayload) GetNotificationId() string { + if o == nil || o.NotificationId == nil { + var ret string + return ret + } + return *o.NotificationId +} + +// GetNotificationIdOk returns a tuple with the NotificationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayload) GetNotificationIdOk() (*string, bool) { + if o == nil || o.NotificationId == nil { + return nil, false + } + return o.NotificationId, true +} + +// HasNotificationId returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasNotificationId() bool { + if o != nil && o.NotificationId != nil { + return true + } + + return false +} + +// SetNotificationId gets a reference to the given string and assigns it to the NotificationId field. +func (o *AnalysisUpdateNotificationPayload) SetNotificationId(v string) { + o.NotificationId = &v +} + +// GetCurrEval returns the CurrEval field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayload) GetCurrEval() AnalysisUpdateEval { + if o == nil || o.CurrEval == nil { + var ret AnalysisUpdateEval + return ret + } + return *o.CurrEval +} + +// GetCurrEvalOk returns a tuple with the CurrEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayload) GetCurrEvalOk() (*AnalysisUpdateEval, bool) { + if o == nil || o.CurrEval == nil { + return nil, false + } + return o.CurrEval, true +} + +// HasCurrEval returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasCurrEval() bool { + if o != nil && o.CurrEval != nil { + return true + } + + return false +} + +// SetCurrEval gets a reference to the given AnalysisUpdateEval and assigns it to the CurrEval field. +func (o *AnalysisUpdateNotificationPayload) SetCurrEval(v AnalysisUpdateEval) { + o.CurrEval = &v +} + +// GetLastEval returns the LastEval field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayload) GetLastEval() AnalysisUpdateEval { + if o == nil || o.LastEval == nil { + var ret AnalysisUpdateEval + return ret + } + return *o.LastEval +} + +// GetLastEvalOk returns a tuple with the LastEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayload) GetLastEvalOk() (*AnalysisUpdateEval, bool) { + if o == nil || o.LastEval == nil { + return nil, false + } + return o.LastEval, true +} + +// HasLastEval returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasLastEval() bool { + if o != nil && o.LastEval != nil { + return true + } + + return false +} + +// SetLastEval gets a reference to the given AnalysisUpdateEval and assigns it to the LastEval field. +func (o *AnalysisUpdateNotificationPayload) SetLastEval(v AnalysisUpdateEval) { + o.LastEval = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AnalysisUpdateNotificationPayload) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AnalysisUpdateNotificationPayload) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayload) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *AnalysisUpdateNotificationPayload) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o AnalysisUpdateNotificationPayload) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + if o.NotificationId != nil { + toSerialize["notificationId"] = o.NotificationId + } + if o.CurrEval != nil { + toSerialize["curr_eval"] = o.CurrEval + } + if o.LastEval != nil { + toSerialize["last_eval"] = o.LastEval + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateNotificationPayload struct { + value *AnalysisUpdateNotificationPayload + isSet bool +} + +func (v NullableAnalysisUpdateNotificationPayload) Get() *AnalysisUpdateNotificationPayload { + return v.value +} + +func (v *NullableAnalysisUpdateNotificationPayload) Set(val *AnalysisUpdateNotificationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateNotificationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateNotificationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateNotificationPayload(val *AnalysisUpdateNotificationPayload) *NullableAnalysisUpdateNotificationPayload { + return &NullableAnalysisUpdateNotificationPayload{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateNotificationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateNotificationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_analysis_update_notification_payload_all_of.go b/.gen/anchore/model_analysis_update_notification_payload_all_of.go new file mode 100644 index 0000000000..fb47d7b07d --- /dev/null +++ b/.gen/anchore/model_analysis_update_notification_payload_all_of.go @@ -0,0 +1,190 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// AnalysisUpdateNotificationPayloadAllOf struct for AnalysisUpdateNotificationPayloadAllOf +type AnalysisUpdateNotificationPayloadAllOf struct { + CurrEval *AnalysisUpdateEval `json:"curr_eval,omitempty"` + LastEval *AnalysisUpdateEval `json:"last_eval,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewAnalysisUpdateNotificationPayloadAllOf instantiates a new AnalysisUpdateNotificationPayloadAllOf 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 NewAnalysisUpdateNotificationPayloadAllOf() *AnalysisUpdateNotificationPayloadAllOf { + this := AnalysisUpdateNotificationPayloadAllOf{} + return &this +} + +// NewAnalysisUpdateNotificationPayloadAllOfWithDefaults instantiates a new AnalysisUpdateNotificationPayloadAllOf 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 NewAnalysisUpdateNotificationPayloadAllOfWithDefaults() *AnalysisUpdateNotificationPayloadAllOf { + this := AnalysisUpdateNotificationPayloadAllOf{} + return &this +} + +// GetCurrEval returns the CurrEval field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayloadAllOf) GetCurrEval() AnalysisUpdateEval { + if o == nil || o.CurrEval == nil { + var ret AnalysisUpdateEval + return ret + } + return *o.CurrEval +} + +// GetCurrEvalOk returns a tuple with the CurrEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayloadAllOf) GetCurrEvalOk() (*AnalysisUpdateEval, bool) { + if o == nil || o.CurrEval == nil { + return nil, false + } + return o.CurrEval, true +} + +// HasCurrEval returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayloadAllOf) HasCurrEval() bool { + if o != nil && o.CurrEval != nil { + return true + } + + return false +} + +// SetCurrEval gets a reference to the given AnalysisUpdateEval and assigns it to the CurrEval field. +func (o *AnalysisUpdateNotificationPayloadAllOf) SetCurrEval(v AnalysisUpdateEval) { + o.CurrEval = &v +} + +// GetLastEval returns the LastEval field value if set, zero value otherwise. +func (o *AnalysisUpdateNotificationPayloadAllOf) GetLastEval() AnalysisUpdateEval { + if o == nil || o.LastEval == nil { + var ret AnalysisUpdateEval + return ret + } + return *o.LastEval +} + +// GetLastEvalOk returns a tuple with the LastEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnalysisUpdateNotificationPayloadAllOf) GetLastEvalOk() (*AnalysisUpdateEval, bool) { + if o == nil || o.LastEval == nil { + return nil, false + } + return o.LastEval, true +} + +// HasLastEval returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayloadAllOf) HasLastEval() bool { + if o != nil && o.LastEval != nil { + return true + } + + return false +} + +// SetLastEval gets a reference to the given AnalysisUpdateEval and assigns it to the LastEval field. +func (o *AnalysisUpdateNotificationPayloadAllOf) SetLastEval(v AnalysisUpdateEval) { + o.LastEval = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AnalysisUpdateNotificationPayloadAllOf) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AnalysisUpdateNotificationPayloadAllOf) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *AnalysisUpdateNotificationPayloadAllOf) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *AnalysisUpdateNotificationPayloadAllOf) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o AnalysisUpdateNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CurrEval != nil { + toSerialize["curr_eval"] = o.CurrEval + } + if o.LastEval != nil { + toSerialize["last_eval"] = o.LastEval + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullableAnalysisUpdateNotificationPayloadAllOf struct { + value *AnalysisUpdateNotificationPayloadAllOf + isSet bool +} + +func (v NullableAnalysisUpdateNotificationPayloadAllOf) Get() *AnalysisUpdateNotificationPayloadAllOf { + return v.value +} + +func (v *NullableAnalysisUpdateNotificationPayloadAllOf) Set(val *AnalysisUpdateNotificationPayloadAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableAnalysisUpdateNotificationPayloadAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableAnalysisUpdateNotificationPayloadAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnalysisUpdateNotificationPayloadAllOf(val *AnalysisUpdateNotificationPayloadAllOf) *NullableAnalysisUpdateNotificationPayloadAllOf { + return &NullableAnalysisUpdateNotificationPayloadAllOf{value: val, isSet: true} +} + +func (v NullableAnalysisUpdateNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnalysisUpdateNotificationPayloadAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_anchore_error_code.go b/.gen/anchore/model_anchore_error_code.go index 503e3757c1..900bdd59f0 100644 --- a/.gen/anchore/model_anchore_error_code.go +++ b/.gen/anchore/model_anchore_error_code.go @@ -1,19 +1,154 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AnchoreErrorCode A description of an anchore error code (name, description) type AnchoreErrorCode struct { // Error code name - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Description of the error code - Description string `json:"description,omitempty"` + Description *string `json:"description,omitempty"` +} + +// NewAnchoreErrorCode instantiates a new AnchoreErrorCode 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 NewAnchoreErrorCode() *AnchoreErrorCode { + this := AnchoreErrorCode{} + return &this +} + +// NewAnchoreErrorCodeWithDefaults instantiates a new AnchoreErrorCode 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 NewAnchoreErrorCodeWithDefaults() *AnchoreErrorCode { + this := AnchoreErrorCode{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AnchoreErrorCode) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreErrorCode) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AnchoreErrorCode) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AnchoreErrorCode) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AnchoreErrorCode) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreErrorCode) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AnchoreErrorCode) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AnchoreErrorCode) SetDescription(v string) { + o.Description = &v +} + +func (o AnchoreErrorCode) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + return json.Marshal(toSerialize) +} + +type NullableAnchoreErrorCode struct { + value *AnchoreErrorCode + isSet bool +} + +func (v NullableAnchoreErrorCode) Get() *AnchoreErrorCode { + return v.value } + +func (v *NullableAnchoreErrorCode) Set(val *AnchoreErrorCode) { + v.value = val + v.isSet = true +} + +func (v NullableAnchoreErrorCode) IsSet() bool { + return v.isSet +} + +func (v *NullableAnchoreErrorCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnchoreErrorCode(val *AnchoreErrorCode) *NullableAnchoreErrorCode { + return &NullableAnchoreErrorCode{value: val, isSet: true} +} + +func (v NullableAnchoreErrorCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnchoreErrorCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_anchore_image.go b/.gen/anchore/model_anchore_image.go index 733ba0080f..51aad85804 100644 --- a/.gen/anchore/model_anchore_image.go +++ b/.gen/anchore/model_anchore_image.go @@ -1,31 +1,409 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // AnchoreImage A unique image in the engine. May have multiple tags or references. Unique to an image content across registries or repositories. type AnchoreImage struct { // A metadata content record for a specific image, containing different content type entries ImageContent map[string]interface{} `json:"image_content,omitempty"` // Details specific to an image reference and type such as tag and image source ImageDetail []ImageDetail `json:"image_detail,omitempty"` - LastUpdated time.Time `json:"last_updated,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - ImageDigest string `json:"imageDigest,omitempty"` - UserId string `json:"userId,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + UserId *string `json:"userId,omitempty"` Annotations map[string]interface{} `json:"annotations,omitempty"` // State of the image - ImageStatus string `json:"image_status,omitempty"` + ImageStatus *string `json:"image_status,omitempty"` // A state value for the current status of the analysis progress of the image - AnalysisStatus string `json:"analysis_status,omitempty"` + AnalysisStatus *string `json:"analysis_status,omitempty"` +} + +// NewAnchoreImage instantiates a new AnchoreImage 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 NewAnchoreImage() *AnchoreImage { + this := AnchoreImage{} + return &this +} + +// NewAnchoreImageWithDefaults instantiates a new AnchoreImage 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 NewAnchoreImageWithDefaults() *AnchoreImage { + this := AnchoreImage{} + return &this +} + +// GetImageContent returns the ImageContent field value if set, zero value otherwise. +func (o *AnchoreImage) GetImageContent() map[string]interface{} { + if o == nil || o.ImageContent == nil { + var ret map[string]interface{} + return ret + } + return o.ImageContent +} + +// GetImageContentOk returns a tuple with the ImageContent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetImageContentOk() (map[string]interface{}, bool) { + if o == nil || o.ImageContent == nil { + return nil, false + } + return o.ImageContent, true +} + +// HasImageContent returns a boolean if a field has been set. +func (o *AnchoreImage) HasImageContent() bool { + if o != nil && o.ImageContent != nil { + return true + } + + return false +} + +// SetImageContent gets a reference to the given map[string]interface{} and assigns it to the ImageContent field. +func (o *AnchoreImage) SetImageContent(v map[string]interface{}) { + o.ImageContent = v +} + +// GetImageDetail returns the ImageDetail field value if set, zero value otherwise. +func (o *AnchoreImage) GetImageDetail() []ImageDetail { + if o == nil || o.ImageDetail == nil { + var ret []ImageDetail + return ret + } + return o.ImageDetail +} + +// GetImageDetailOk returns a tuple with the ImageDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetImageDetailOk() ([]ImageDetail, bool) { + if o == nil || o.ImageDetail == nil { + return nil, false + } + return o.ImageDetail, true +} + +// HasImageDetail returns a boolean if a field has been set. +func (o *AnchoreImage) HasImageDetail() bool { + if o != nil && o.ImageDetail != nil { + return true + } + + return false +} + +// SetImageDetail gets a reference to the given []ImageDetail and assigns it to the ImageDetail field. +func (o *AnchoreImage) SetImageDetail(v []ImageDetail) { + o.ImageDetail = v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AnchoreImage) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AnchoreImage) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AnchoreImage) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AnchoreImage) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AnchoreImage) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AnchoreImage) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *AnchoreImage) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *AnchoreImage) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *AnchoreImage) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *AnchoreImage) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId } + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *AnchoreImage) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *AnchoreImage) SetUserId(v string) { + o.UserId = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *AnchoreImage) GetAnnotations() map[string]interface{} { + if o == nil || o.Annotations == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// 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 *AnchoreImage) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *AnchoreImage) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *AnchoreImage) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +// GetImageStatus returns the ImageStatus field value if set, zero value otherwise. +func (o *AnchoreImage) GetImageStatus() string { + if o == nil || o.ImageStatus == nil { + var ret string + return ret + } + return *o.ImageStatus +} + +// GetImageStatusOk returns a tuple with the ImageStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetImageStatusOk() (*string, bool) { + if o == nil || o.ImageStatus == nil { + return nil, false + } + return o.ImageStatus, true +} + +// HasImageStatus returns a boolean if a field has been set. +func (o *AnchoreImage) HasImageStatus() bool { + if o != nil && o.ImageStatus != nil { + return true + } + + return false +} + +// SetImageStatus gets a reference to the given string and assigns it to the ImageStatus field. +func (o *AnchoreImage) SetImageStatus(v string) { + o.ImageStatus = &v +} + +// GetAnalysisStatus returns the AnalysisStatus field value if set, zero value otherwise. +func (o *AnchoreImage) GetAnalysisStatus() string { + if o == nil || o.AnalysisStatus == nil { + var ret string + return ret + } + return *o.AnalysisStatus +} + +// GetAnalysisStatusOk returns a tuple with the AnalysisStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImage) GetAnalysisStatusOk() (*string, bool) { + if o == nil || o.AnalysisStatus == nil { + return nil, false + } + return o.AnalysisStatus, true +} + +// HasAnalysisStatus returns a boolean if a field has been set. +func (o *AnchoreImage) HasAnalysisStatus() bool { + if o != nil && o.AnalysisStatus != nil { + return true + } + + return false +} + +// SetAnalysisStatus gets a reference to the given string and assigns it to the AnalysisStatus field. +func (o *AnchoreImage) SetAnalysisStatus(v string) { + o.AnalysisStatus = &v +} + +func (o AnchoreImage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageContent != nil { + toSerialize["image_content"] = o.ImageContent + } + if o.ImageDetail != nil { + toSerialize["image_detail"] = o.ImageDetail + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + if o.ImageStatus != nil { + toSerialize["image_status"] = o.ImageStatus + } + if o.AnalysisStatus != nil { + toSerialize["analysis_status"] = o.AnalysisStatus + } + return json.Marshal(toSerialize) +} + +type NullableAnchoreImage struct { + value *AnchoreImage + isSet bool +} + +func (v NullableAnchoreImage) Get() *AnchoreImage { + return v.value +} + +func (v *NullableAnchoreImage) Set(val *AnchoreImage) { + v.value = val + v.isSet = true +} + +func (v NullableAnchoreImage) IsSet() bool { + return v.isSet +} + +func (v *NullableAnchoreImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnchoreImage(val *AnchoreImage) *NullableAnchoreImage { + return &NullableAnchoreImage{value: val, isSet: true} +} + +func (v NullableAnchoreImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnchoreImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_anchore_image_tag_summary.go b/.gen/anchore/model_anchore_image_tag_summary.go index 53a926101f..5ef4378fcb 100644 --- a/.gen/anchore/model_anchore_image_tag_summary.go +++ b/.gen/anchore/model_anchore_image_tag_summary.go @@ -1,23 +1,404 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // AnchoreImageTagSummary A unique image in the engine. type AnchoreImageTagSummary struct { - ImageDigest string `json:"imageDigest,omitempty"` - ParentDigest string `json:"parentDigest,omitempty"` - ImageId string `json:"imageId,omitempty"` - AnalysisStatus string `json:"analysis_status,omitempty"` - Fulltag string `json:"fulltag,omitempty"` - CreatedAt int32 `json:"created_at,omitempty"` - AnalyzedAt int32 `json:"analyzed_at,omitempty"` - TagDetectedAt int32 `json:"tag_detected_at,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + ParentDigest *string `json:"parentDigest,omitempty"` + ImageId *string `json:"imageId,omitempty"` + AnalysisStatus *string `json:"analysis_status,omitempty"` + Fulltag *string `json:"fulltag,omitempty"` + CreatedAt *int32 `json:"created_at,omitempty"` + AnalyzedAt *int32 `json:"analyzed_at,omitempty"` + TagDetectedAt *int32 `json:"tag_detected_at,omitempty"` + ImageStatus *string `json:"image_status,omitempty"` +} + +// NewAnchoreImageTagSummary instantiates a new AnchoreImageTagSummary 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 NewAnchoreImageTagSummary() *AnchoreImageTagSummary { + this := AnchoreImageTagSummary{} + return &this +} + +// NewAnchoreImageTagSummaryWithDefaults instantiates a new AnchoreImageTagSummary 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 NewAnchoreImageTagSummaryWithDefaults() *AnchoreImageTagSummary { + this := AnchoreImageTagSummary{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *AnchoreImageTagSummary) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetParentDigest returns the ParentDigest field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetParentDigest() string { + if o == nil || o.ParentDigest == nil { + var ret string + return ret + } + return *o.ParentDigest +} + +// GetParentDigestOk returns a tuple with the ParentDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetParentDigestOk() (*string, bool) { + if o == nil || o.ParentDigest == nil { + return nil, false + } + return o.ParentDigest, true +} + +// HasParentDigest returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasParentDigest() bool { + if o != nil && o.ParentDigest != nil { + return true + } + + return false +} + +// SetParentDigest gets a reference to the given string and assigns it to the ParentDigest field. +func (o *AnchoreImageTagSummary) SetParentDigest(v string) { + o.ParentDigest = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetImageId() string { + if o == nil || o.ImageId == nil { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetImageIdOk() (*string, bool) { + if o == nil || o.ImageId == nil { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasImageId() bool { + if o != nil && o.ImageId != nil { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *AnchoreImageTagSummary) SetImageId(v string) { + o.ImageId = &v +} + +// GetAnalysisStatus returns the AnalysisStatus field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetAnalysisStatus() string { + if o == nil || o.AnalysisStatus == nil { + var ret string + return ret + } + return *o.AnalysisStatus +} + +// GetAnalysisStatusOk returns a tuple with the AnalysisStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetAnalysisStatusOk() (*string, bool) { + if o == nil || o.AnalysisStatus == nil { + return nil, false + } + return o.AnalysisStatus, true +} + +// HasAnalysisStatus returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasAnalysisStatus() bool { + if o != nil && o.AnalysisStatus != nil { + return true + } + + return false +} + +// SetAnalysisStatus gets a reference to the given string and assigns it to the AnalysisStatus field. +func (o *AnchoreImageTagSummary) SetAnalysisStatus(v string) { + o.AnalysisStatus = &v +} + +// GetFulltag returns the Fulltag field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetFulltag() string { + if o == nil || o.Fulltag == nil { + var ret string + return ret + } + return *o.Fulltag +} + +// GetFulltagOk returns a tuple with the Fulltag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetFulltagOk() (*string, bool) { + if o == nil || o.Fulltag == nil { + return nil, false + } + return o.Fulltag, true +} + +// HasFulltag returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasFulltag() bool { + if o != nil && o.Fulltag != nil { + return true + } + + return false +} + +// SetFulltag gets a reference to the given string and assigns it to the Fulltag field. +func (o *AnchoreImageTagSummary) SetFulltag(v string) { + o.Fulltag = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetCreatedAt() int32 { + if o == nil || o.CreatedAt == nil { + var ret int32 + return ret + } + return *o.CreatedAt } + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetCreatedAtOk() (*int32, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int32 and assigns it to the CreatedAt field. +func (o *AnchoreImageTagSummary) SetCreatedAt(v int32) { + o.CreatedAt = &v +} + +// GetAnalyzedAt returns the AnalyzedAt field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetAnalyzedAt() int32 { + if o == nil || o.AnalyzedAt == nil { + var ret int32 + return ret + } + return *o.AnalyzedAt +} + +// GetAnalyzedAtOk returns a tuple with the AnalyzedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetAnalyzedAtOk() (*int32, bool) { + if o == nil || o.AnalyzedAt == nil { + return nil, false + } + return o.AnalyzedAt, true +} + +// HasAnalyzedAt returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasAnalyzedAt() bool { + if o != nil && o.AnalyzedAt != nil { + return true + } + + return false +} + +// SetAnalyzedAt gets a reference to the given int32 and assigns it to the AnalyzedAt field. +func (o *AnchoreImageTagSummary) SetAnalyzedAt(v int32) { + o.AnalyzedAt = &v +} + +// GetTagDetectedAt returns the TagDetectedAt field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetTagDetectedAt() int32 { + if o == nil || o.TagDetectedAt == nil { + var ret int32 + return ret + } + return *o.TagDetectedAt +} + +// GetTagDetectedAtOk returns a tuple with the TagDetectedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetTagDetectedAtOk() (*int32, bool) { + if o == nil || o.TagDetectedAt == nil { + return nil, false + } + return o.TagDetectedAt, true +} + +// HasTagDetectedAt returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasTagDetectedAt() bool { + if o != nil && o.TagDetectedAt != nil { + return true + } + + return false +} + +// SetTagDetectedAt gets a reference to the given int32 and assigns it to the TagDetectedAt field. +func (o *AnchoreImageTagSummary) SetTagDetectedAt(v int32) { + o.TagDetectedAt = &v +} + +// GetImageStatus returns the ImageStatus field value if set, zero value otherwise. +func (o *AnchoreImageTagSummary) GetImageStatus() string { + if o == nil || o.ImageStatus == nil { + var ret string + return ret + } + return *o.ImageStatus +} + +// GetImageStatusOk returns a tuple with the ImageStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AnchoreImageTagSummary) GetImageStatusOk() (*string, bool) { + if o == nil || o.ImageStatus == nil { + return nil, false + } + return o.ImageStatus, true +} + +// HasImageStatus returns a boolean if a field has been set. +func (o *AnchoreImageTagSummary) HasImageStatus() bool { + if o != nil && o.ImageStatus != nil { + return true + } + + return false +} + +// SetImageStatus gets a reference to the given string and assigns it to the ImageStatus field. +func (o *AnchoreImageTagSummary) SetImageStatus(v string) { + o.ImageStatus = &v +} + +func (o AnchoreImageTagSummary) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ParentDigest != nil { + toSerialize["parentDigest"] = o.ParentDigest + } + if o.ImageId != nil { + toSerialize["imageId"] = o.ImageId + } + if o.AnalysisStatus != nil { + toSerialize["analysis_status"] = o.AnalysisStatus + } + if o.Fulltag != nil { + toSerialize["fulltag"] = o.Fulltag + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.AnalyzedAt != nil { + toSerialize["analyzed_at"] = o.AnalyzedAt + } + if o.TagDetectedAt != nil { + toSerialize["tag_detected_at"] = o.TagDetectedAt + } + if o.ImageStatus != nil { + toSerialize["image_status"] = o.ImageStatus + } + return json.Marshal(toSerialize) +} + +type NullableAnchoreImageTagSummary struct { + value *AnchoreImageTagSummary + isSet bool +} + +func (v NullableAnchoreImageTagSummary) Get() *AnchoreImageTagSummary { + return v.value +} + +func (v *NullableAnchoreImageTagSummary) Set(val *AnchoreImageTagSummary) { + v.value = val + v.isSet = true +} + +func (v NullableAnchoreImageTagSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableAnchoreImageTagSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnchoreImageTagSummary(val *AnchoreImageTagSummary) *NullableAnchoreImageTagSummary { + return &NullableAnchoreImageTagSummary{value: val, isSet: true} +} + +func (v NullableAnchoreImageTagSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnchoreImageTagSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_api_error_response.go b/.gen/anchore/model_api_error_response.go index c68fcb5c59..89f9d5617b 100644 --- a/.gen/anchore/model_api_error_response.go +++ b/.gen/anchore/model_api_error_response.go @@ -1,20 +1,225 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ApiErrorResponse Generic HTTP API error response type ApiErrorResponse struct { - Code int32 `json:"code,omitempty"` - ErrorType string `json:"error_type,omitempty"` - Message string `json:"message,omitempty"` + Code *int32 `json:"code,omitempty"` + ErrorType *string `json:"error_type,omitempty"` + Message *string `json:"message,omitempty"` // Details structure for additional information about the error if available. Content and structure will be error specific. Detail map[string]interface{} `json:"detail,omitempty"` } + +// NewApiErrorResponse instantiates a new ApiErrorResponse 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 NewApiErrorResponse() *ApiErrorResponse { + this := ApiErrorResponse{} + return &this +} + +// NewApiErrorResponseWithDefaults instantiates a new ApiErrorResponse 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 NewApiErrorResponseWithDefaults() *ApiErrorResponse { + this := ApiErrorResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ApiErrorResponse) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiErrorResponse) GetCodeOk() (*int32, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiErrorResponse) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiErrorResponse) SetCode(v int32) { + o.Code = &v +} + +// GetErrorType returns the ErrorType field value if set, zero value otherwise. +func (o *ApiErrorResponse) GetErrorType() string { + if o == nil || o.ErrorType == nil { + var ret string + return ret + } + return *o.ErrorType +} + +// GetErrorTypeOk returns a tuple with the ErrorType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiErrorResponse) GetErrorTypeOk() (*string, bool) { + if o == nil || o.ErrorType == nil { + return nil, false + } + return o.ErrorType, true +} + +// HasErrorType returns a boolean if a field has been set. +func (o *ApiErrorResponse) HasErrorType() bool { + if o != nil && o.ErrorType != nil { + return true + } + + return false +} + +// SetErrorType gets a reference to the given string and assigns it to the ErrorType field. +func (o *ApiErrorResponse) SetErrorType(v string) { + o.ErrorType = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApiErrorResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiErrorResponse) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiErrorResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiErrorResponse) SetMessage(v string) { + o.Message = &v +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *ApiErrorResponse) GetDetail() map[string]interface{} { + if o == nil || o.Detail == nil { + var ret map[string]interface{} + return ret + } + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiErrorResponse) GetDetailOk() (map[string]interface{}, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *ApiErrorResponse) HasDetail() bool { + if o != nil && o.Detail != nil { + return true + } + + return false +} + +// SetDetail gets a reference to the given map[string]interface{} and assigns it to the Detail field. +func (o *ApiErrorResponse) SetDetail(v map[string]interface{}) { + o.Detail = v +} + +func (o ApiErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.ErrorType != nil { + toSerialize["error_type"] = o.ErrorType + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + return json.Marshal(toSerialize) +} + +type NullableApiErrorResponse struct { + value *ApiErrorResponse + isSet bool +} + +func (v NullableApiErrorResponse) Get() *ApiErrorResponse { + return v.value +} + +func (v *NullableApiErrorResponse) Set(val *ApiErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiErrorResponse(val *ApiErrorResponse) *NullableApiErrorResponse { + return &NullableApiErrorResponse{value: val, isSet: true} +} + +func (v NullableApiErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_archive_summary.go b/.gen/anchore/model_archive_summary.go index b83b1c9c05..19be35dfce 100644 --- a/.gen/anchore/model_archive_summary.go +++ b/.gen/anchore/model_archive_summary.go @@ -1,17 +1,152 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ArchiveSummary A summarization of the available archives, a place to for long-term storage of audit, analysis, or other data to remove it from the system's working set but keep it available. type ArchiveSummary struct { - Images AnalysisArchiveSummary `json:"images,omitempty"` - Rules AnalysisArchiveRulesSummary `json:"rules,omitempty"` + Images *AnalysisArchiveSummary `json:"images,omitempty"` + Rules *AnalysisArchiveRulesSummary `json:"rules,omitempty"` +} + +// NewArchiveSummary instantiates a new ArchiveSummary 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 NewArchiveSummary() *ArchiveSummary { + this := ArchiveSummary{} + return &this +} + +// NewArchiveSummaryWithDefaults instantiates a new ArchiveSummary 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 NewArchiveSummaryWithDefaults() *ArchiveSummary { + this := ArchiveSummary{} + return &this +} + +// GetImages returns the Images field value if set, zero value otherwise. +func (o *ArchiveSummary) GetImages() AnalysisArchiveSummary { + if o == nil || o.Images == nil { + var ret AnalysisArchiveSummary + return ret + } + return *o.Images +} + +// GetImagesOk returns a tuple with the Images field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchiveSummary) GetImagesOk() (*AnalysisArchiveSummary, bool) { + if o == nil || o.Images == nil { + return nil, false + } + return o.Images, true +} + +// HasImages returns a boolean if a field has been set. +func (o *ArchiveSummary) HasImages() bool { + if o != nil && o.Images != nil { + return true + } + + return false +} + +// SetImages gets a reference to the given AnalysisArchiveSummary and assigns it to the Images field. +func (o *ArchiveSummary) SetImages(v AnalysisArchiveSummary) { + o.Images = &v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *ArchiveSummary) GetRules() AnalysisArchiveRulesSummary { + if o == nil || o.Rules == nil { + var ret AnalysisArchiveRulesSummary + return ret + } + return *o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchiveSummary) GetRulesOk() (*AnalysisArchiveRulesSummary, bool) { + if o == nil || o.Rules == nil { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *ArchiveSummary) HasRules() bool { + if o != nil && o.Rules != nil { + return true + } + + return false +} + +// SetRules gets a reference to the given AnalysisArchiveRulesSummary and assigns it to the Rules field. +func (o *ArchiveSummary) SetRules(v AnalysisArchiveRulesSummary) { + o.Rules = &v +} + +func (o ArchiveSummary) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Images != nil { + toSerialize["images"] = o.Images + } + if o.Rules != nil { + toSerialize["rules"] = o.Rules + } + return json.Marshal(toSerialize) +} + +type NullableArchiveSummary struct { + value *ArchiveSummary + isSet bool +} + +func (v NullableArchiveSummary) Get() *ArchiveSummary { + return v.value } + +func (v *NullableArchiveSummary) Set(val *ArchiveSummary) { + v.value = val + v.isSet = true +} + +func (v NullableArchiveSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableArchiveSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArchiveSummary(val *ArchiveSummary) *NullableArchiveSummary { + return &NullableArchiveSummary{value: val, isSet: true} +} + +func (v NullableArchiveSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArchiveSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_archived_analysis.go b/.gen/anchore/model_archived_analysis.go index 89cfb96065..8c5334b712 100644 --- a/.gen/anchore/model_archived_analysis.go +++ b/.gen/anchore/model_archived_analysis.go @@ -1,33 +1,411 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // ArchivedAnalysis struct for ArchivedAnalysis type ArchivedAnalysis struct { // The image digest (digest of the manifest describing the image, per docker spec) - ImageDigest string `json:"imageDigest,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` // The digest of a parent manifest (for manifest-list images) - ParentDigest string `json:"parentDigest,omitempty"` + ParentDigest *string `json:"parentDigest,omitempty"` // User provided annotations as key-value pairs Annotations map[string]interface{} `json:"annotations,omitempty"` // The archival status - Status string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` // List of tags associated with the image digest ImageDetail []TagEntry `json:"image_detail,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - LastUpdated time.Time `json:"last_updated,omitempty"` - AnalyzedAt time.Time `json:"analyzed_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` + AnalyzedAt *time.Time `json:"analyzed_at,omitempty"` // The size, in bytes, of the analysis archive file - ArchiveSizeBytes int32 `json:"archive_size_bytes,omitempty"` + ArchiveSizeBytes *int32 `json:"archive_size_bytes,omitempty"` +} + +// NewArchivedAnalysis instantiates a new ArchivedAnalysis 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 NewArchivedAnalysis() *ArchivedAnalysis { + this := ArchivedAnalysis{} + return &this +} + +// NewArchivedAnalysisWithDefaults instantiates a new ArchivedAnalysis 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 NewArchivedAnalysisWithDefaults() *ArchivedAnalysis { + this := ArchivedAnalysis{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ArchivedAnalysis) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetParentDigest returns the ParentDigest field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetParentDigest() string { + if o == nil || o.ParentDigest == nil { + var ret string + return ret + } + return *o.ParentDigest +} + +// GetParentDigestOk returns a tuple with the ParentDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetParentDigestOk() (*string, bool) { + if o == nil || o.ParentDigest == nil { + return nil, false + } + return o.ParentDigest, true +} + +// HasParentDigest returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasParentDigest() bool { + if o != nil && o.ParentDigest != nil { + return true + } + + return false +} + +// SetParentDigest gets a reference to the given string and assigns it to the ParentDigest field. +func (o *ArchivedAnalysis) SetParentDigest(v string) { + o.ParentDigest = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetAnnotations() map[string]interface{} { + if o == nil || o.Annotations == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// 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 *ArchivedAnalysis) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *ArchivedAnalysis) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *ArchivedAnalysis) SetStatus(v string) { + o.Status = &v +} + +// GetImageDetail returns the ImageDetail field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetImageDetail() []TagEntry { + if o == nil || o.ImageDetail == nil { + var ret []TagEntry + return ret + } + return o.ImageDetail +} + +// GetImageDetailOk returns a tuple with the ImageDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetImageDetailOk() ([]TagEntry, bool) { + if o == nil || o.ImageDetail == nil { + return nil, false + } + return o.ImageDetail, true +} + +// HasImageDetail returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasImageDetail() bool { + if o != nil && o.ImageDetail != nil { + return true + } + + return false +} + +// SetImageDetail gets a reference to the given []TagEntry and assigns it to the ImageDetail field. +func (o *ArchivedAnalysis) SetImageDetail(v []TagEntry) { + o.ImageDetail = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt } + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ArchivedAnalysis) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *ArchivedAnalysis) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetAnalyzedAt returns the AnalyzedAt field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetAnalyzedAt() time.Time { + if o == nil || o.AnalyzedAt == nil { + var ret time.Time + return ret + } + return *o.AnalyzedAt +} + +// GetAnalyzedAtOk returns a tuple with the AnalyzedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetAnalyzedAtOk() (*time.Time, bool) { + if o == nil || o.AnalyzedAt == nil { + return nil, false + } + return o.AnalyzedAt, true +} + +// HasAnalyzedAt returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasAnalyzedAt() bool { + if o != nil && o.AnalyzedAt != nil { + return true + } + + return false +} + +// SetAnalyzedAt gets a reference to the given time.Time and assigns it to the AnalyzedAt field. +func (o *ArchivedAnalysis) SetAnalyzedAt(v time.Time) { + o.AnalyzedAt = &v +} + +// GetArchiveSizeBytes returns the ArchiveSizeBytes field value if set, zero value otherwise. +func (o *ArchivedAnalysis) GetArchiveSizeBytes() int32 { + if o == nil || o.ArchiveSizeBytes == nil { + var ret int32 + return ret + } + return *o.ArchiveSizeBytes +} + +// GetArchiveSizeBytesOk returns a tuple with the ArchiveSizeBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArchivedAnalysis) GetArchiveSizeBytesOk() (*int32, bool) { + if o == nil || o.ArchiveSizeBytes == nil { + return nil, false + } + return o.ArchiveSizeBytes, true +} + +// HasArchiveSizeBytes returns a boolean if a field has been set. +func (o *ArchivedAnalysis) HasArchiveSizeBytes() bool { + if o != nil && o.ArchiveSizeBytes != nil { + return true + } + + return false +} + +// SetArchiveSizeBytes gets a reference to the given int32 and assigns it to the ArchiveSizeBytes field. +func (o *ArchivedAnalysis) SetArchiveSizeBytes(v int32) { + o.ArchiveSizeBytes = &v +} + +func (o ArchivedAnalysis) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ParentDigest != nil { + toSerialize["parentDigest"] = o.ParentDigest + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.ImageDetail != nil { + toSerialize["image_detail"] = o.ImageDetail + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.AnalyzedAt != nil { + toSerialize["analyzed_at"] = o.AnalyzedAt + } + if o.ArchiveSizeBytes != nil { + toSerialize["archive_size_bytes"] = o.ArchiveSizeBytes + } + return json.Marshal(toSerialize) +} + +type NullableArchivedAnalysis struct { + value *ArchivedAnalysis + isSet bool +} + +func (v NullableArchivedAnalysis) Get() *ArchivedAnalysis { + return v.value +} + +func (v *NullableArchivedAnalysis) Set(val *ArchivedAnalysis) { + v.value = val + v.isSet = true +} + +func (v NullableArchivedAnalysis) IsSet() bool { + return v.isSet +} + +func (v *NullableArchivedAnalysis) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArchivedAnalysis(val *ArchivedAnalysis) *NullableArchivedAnalysis { + return &NullableArchivedAnalysis{value: val, isSet: true} +} + +func (v NullableArchivedAnalysis) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArchivedAnalysis) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_base_notification_data.go b/.gen/anchore/model_base_notification_data.go new file mode 100644 index 0000000000..a9963d4164 --- /dev/null +++ b/.gen/anchore/model_base_notification_data.go @@ -0,0 +1,188 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// BaseNotificationData Every notification has a payload, which follows this basic structure +type BaseNotificationData struct { + NotificationUser *string `json:"notification_user,omitempty"` + NotificationUserEmail *string `json:"notification_user_email,omitempty"` + NotificationType *string `json:"notification_type,omitempty"` +} + +// NewBaseNotificationData instantiates a new BaseNotificationData 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 NewBaseNotificationData() *BaseNotificationData { + this := BaseNotificationData{} + return &this +} + +// NewBaseNotificationDataWithDefaults instantiates a new BaseNotificationData 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 NewBaseNotificationDataWithDefaults() *BaseNotificationData { + this := BaseNotificationData{} + return &this +} + +// GetNotificationUser returns the NotificationUser field value if set, zero value otherwise. +func (o *BaseNotificationData) GetNotificationUser() string { + if o == nil || o.NotificationUser == nil { + var ret string + return ret + } + return *o.NotificationUser +} + +// GetNotificationUserOk returns a tuple with the NotificationUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseNotificationData) GetNotificationUserOk() (*string, bool) { + if o == nil || o.NotificationUser == nil { + return nil, false + } + return o.NotificationUser, true +} + +// HasNotificationUser returns a boolean if a field has been set. +func (o *BaseNotificationData) HasNotificationUser() bool { + if o != nil && o.NotificationUser != nil { + return true + } + + return false +} + +// SetNotificationUser gets a reference to the given string and assigns it to the NotificationUser field. +func (o *BaseNotificationData) SetNotificationUser(v string) { + o.NotificationUser = &v +} + +// GetNotificationUserEmail returns the NotificationUserEmail field value if set, zero value otherwise. +func (o *BaseNotificationData) GetNotificationUserEmail() string { + if o == nil || o.NotificationUserEmail == nil { + var ret string + return ret + } + return *o.NotificationUserEmail +} + +// GetNotificationUserEmailOk returns a tuple with the NotificationUserEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseNotificationData) GetNotificationUserEmailOk() (*string, bool) { + if o == nil || o.NotificationUserEmail == nil { + return nil, false + } + return o.NotificationUserEmail, true +} + +// HasNotificationUserEmail returns a boolean if a field has been set. +func (o *BaseNotificationData) HasNotificationUserEmail() bool { + if o != nil && o.NotificationUserEmail != nil { + return true + } + + return false +} + +// SetNotificationUserEmail gets a reference to the given string and assigns it to the NotificationUserEmail field. +func (o *BaseNotificationData) SetNotificationUserEmail(v string) { + o.NotificationUserEmail = &v +} + +// GetNotificationType returns the NotificationType field value if set, zero value otherwise. +func (o *BaseNotificationData) GetNotificationType() string { + if o == nil || o.NotificationType == nil { + var ret string + return ret + } + return *o.NotificationType +} + +// GetNotificationTypeOk returns a tuple with the NotificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseNotificationData) GetNotificationTypeOk() (*string, bool) { + if o == nil || o.NotificationType == nil { + return nil, false + } + return o.NotificationType, true +} + +// HasNotificationType returns a boolean if a field has been set. +func (o *BaseNotificationData) HasNotificationType() bool { + if o != nil && o.NotificationType != nil { + return true + } + + return false +} + +// SetNotificationType gets a reference to the given string and assigns it to the NotificationType field. +func (o *BaseNotificationData) SetNotificationType(v string) { + o.NotificationType = &v +} + +func (o BaseNotificationData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationUser != nil { + toSerialize["notification_user"] = o.NotificationUser + } + if o.NotificationUserEmail != nil { + toSerialize["notification_user_email"] = o.NotificationUserEmail + } + if o.NotificationType != nil { + toSerialize["notification_type"] = o.NotificationType + } + return json.Marshal(toSerialize) +} + +type NullableBaseNotificationData struct { + value *BaseNotificationData + isSet bool +} + +func (v NullableBaseNotificationData) Get() *BaseNotificationData { + return v.value +} + +func (v *NullableBaseNotificationData) Set(val *BaseNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableBaseNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseNotificationData(val *BaseNotificationData) *NullableBaseNotificationData { + return &NullableBaseNotificationData{value: val, isSet: true} +} + +func (v NullableBaseNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_files_response.go b/.gen/anchore/model_content_files_response.go index b3e6d56637..26684fb1b7 100644 --- a/.gen/anchore/model_content_files_response.go +++ b/.gen/anchore/model_content_files_response.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ContentFilesResponse File content listings from images type ContentFilesResponse struct { - ImageDigest string `json:"imageDigest,omitempty"` - ContentType string `json:"content_type,omitempty"` - Content []ContentFilesResponseContent `json:"content,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Content []ContentFilesResponseContentInner `json:"content,omitempty"` +} + +// NewContentFilesResponse instantiates a new ContentFilesResponse 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 NewContentFilesResponse() *ContentFilesResponse { + this := ContentFilesResponse{} + return &this +} + +// NewContentFilesResponseWithDefaults instantiates a new ContentFilesResponse 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 NewContentFilesResponseWithDefaults() *ContentFilesResponse { + this := ContentFilesResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ContentFilesResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ContentFilesResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ContentFilesResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ContentFilesResponse) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponse) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ContentFilesResponse) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ContentFilesResponse) SetContentType(v string) { + o.ContentType = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *ContentFilesResponse) GetContent() []ContentFilesResponseContentInner { + if o == nil || o.Content == nil { + var ret []ContentFilesResponseContentInner + return ret + } + return o.Content } + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponse) GetContentOk() ([]ContentFilesResponseContentInner, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *ContentFilesResponse) HasContent() bool { + if o != nil && o.Content != nil { + return true + } + + return false +} + +// SetContent gets a reference to the given []ContentFilesResponseContentInner and assigns it to the Content field. +func (o *ContentFilesResponse) SetContent(v []ContentFilesResponseContentInner) { + o.Content = v +} + +func (o ContentFilesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ContentType != nil { + toSerialize["content_type"] = o.ContentType + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + return json.Marshal(toSerialize) +} + +type NullableContentFilesResponse struct { + value *ContentFilesResponse + isSet bool +} + +func (v NullableContentFilesResponse) Get() *ContentFilesResponse { + return v.value +} + +func (v *NullableContentFilesResponse) Set(val *ContentFilesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableContentFilesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableContentFilesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentFilesResponse(val *ContentFilesResponse) *NullableContentFilesResponse { + return &NullableContentFilesResponse{value: val, isSet: true} +} + +func (v NullableContentFilesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentFilesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_files_response_content.go b/.gen/anchore/model_content_files_response_content.go deleted file mode 100644 index 461e92398e..0000000000 --- a/.gen/anchore/model_content_files_response_content.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore -// ContentFilesResponseContent struct for ContentFilesResponseContent -type ContentFilesResponseContent struct { - Filename string `json:"filename,omitempty"` - Gid int32 `json:"gid,omitempty"` - Linkdest *string `json:"linkdest,omitempty"` - Mode string `json:"mode,omitempty"` - Sha256 *string `json:"sha256,omitempty"` - Size int32 `json:"size,omitempty"` - Type string `json:"type,omitempty"` - Uid int32 `json:"uid,omitempty"` -} diff --git a/.gen/anchore/model_content_files_response_content_inner.go b/.gen/anchore/model_content_files_response_content_inner.go new file mode 100644 index 0000000000..8c88cb3d44 --- /dev/null +++ b/.gen/anchore/model_content_files_response_content_inner.go @@ -0,0 +1,388 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ContentFilesResponseContentInner struct for ContentFilesResponseContentInner +type ContentFilesResponseContentInner struct { + Filename *string `json:"filename,omitempty"` + Gid *int32 `json:"gid,omitempty"` + Linkdest NullableString `json:"linkdest,omitempty"` + Mode *string `json:"mode,omitempty"` + Sha256 NullableString `json:"sha256,omitempty"` + Size *int32 `json:"size,omitempty"` + Type *string `json:"type,omitempty"` + Uid *int32 `json:"uid,omitempty"` +} + +// NewContentFilesResponseContentInner instantiates a new ContentFilesResponseContentInner 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 NewContentFilesResponseContentInner() *ContentFilesResponseContentInner { + this := ContentFilesResponseContentInner{} + return &this +} + +// NewContentFilesResponseContentInnerWithDefaults instantiates a new ContentFilesResponseContentInner 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 NewContentFilesResponseContentInnerWithDefaults() *ContentFilesResponseContentInner { + this := ContentFilesResponseContentInner{} + return &this +} + +// GetFilename returns the Filename field value if set, zero value otherwise. +func (o *ContentFilesResponseContentInner) GetFilename() string { + if o == nil || o.Filename == nil { + var ret string + return ret + } + return *o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponseContentInner) GetFilenameOk() (*string, bool) { + if o == nil || o.Filename == nil { + return nil, false + } + return o.Filename, true +} + +// HasFilename returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasFilename() bool { + if o != nil && o.Filename != nil { + return true + } + + return false +} + +// SetFilename gets a reference to the given string and assigns it to the Filename field. +func (o *ContentFilesResponseContentInner) SetFilename(v string) { + o.Filename = &v +} + +// GetGid returns the Gid field value if set, zero value otherwise. +func (o *ContentFilesResponseContentInner) GetGid() int32 { + if o == nil || o.Gid == nil { + var ret int32 + return ret + } + return *o.Gid +} + +// GetGidOk returns a tuple with the Gid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponseContentInner) GetGidOk() (*int32, bool) { + if o == nil || o.Gid == nil { + return nil, false + } + return o.Gid, true +} + +// HasGid returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasGid() bool { + if o != nil && o.Gid != nil { + return true + } + + return false +} + +// SetGid gets a reference to the given int32 and assigns it to the Gid field. +func (o *ContentFilesResponseContentInner) SetGid(v int32) { + o.Gid = &v +} + +// GetLinkdest returns the Linkdest field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContentFilesResponseContentInner) GetLinkdest() string { + if o == nil || o.Linkdest.Get() == nil { + var ret string + return ret + } + return *o.Linkdest.Get() +} + +// GetLinkdestOk returns a tuple with the Linkdest field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContentFilesResponseContentInner) GetLinkdestOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Linkdest.Get(), o.Linkdest.IsSet() +} + +// HasLinkdest returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasLinkdest() bool { + if o != nil && o.Linkdest.IsSet() { + return true + } + + return false +} + +// SetLinkdest gets a reference to the given NullableString and assigns it to the Linkdest field. +func (o *ContentFilesResponseContentInner) SetLinkdest(v string) { + o.Linkdest.Set(&v) +} +// SetLinkdestNil sets the value for Linkdest to be an explicit nil +func (o *ContentFilesResponseContentInner) SetLinkdestNil() { + o.Linkdest.Set(nil) +} + +// UnsetLinkdest ensures that no value is present for Linkdest, not even an explicit nil +func (o *ContentFilesResponseContentInner) UnsetLinkdest() { + o.Linkdest.Unset() +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ContentFilesResponseContentInner) GetMode() string { + if o == nil || o.Mode == nil { + var ret string + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponseContentInner) GetModeOk() (*string, bool) { + if o == nil || o.Mode == nil { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasMode() bool { + if o != nil && o.Mode != nil { + return true + } + + return false +} + +// SetMode gets a reference to the given string and assigns it to the Mode field. +func (o *ContentFilesResponseContentInner) SetMode(v string) { + o.Mode = &v +} + +// GetSha256 returns the Sha256 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContentFilesResponseContentInner) GetSha256() string { + if o == nil || o.Sha256.Get() == nil { + var ret string + return ret + } + return *o.Sha256.Get() +} + +// GetSha256Ok returns a tuple with the Sha256 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContentFilesResponseContentInner) GetSha256Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.Sha256.Get(), o.Sha256.IsSet() +} + +// HasSha256 returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasSha256() bool { + if o != nil && o.Sha256.IsSet() { + return true + } + + return false +} + +// SetSha256 gets a reference to the given NullableString and assigns it to the Sha256 field. +func (o *ContentFilesResponseContentInner) SetSha256(v string) { + o.Sha256.Set(&v) +} +// SetSha256Nil sets the value for Sha256 to be an explicit nil +func (o *ContentFilesResponseContentInner) SetSha256Nil() { + o.Sha256.Set(nil) +} + +// UnsetSha256 ensures that no value is present for Sha256, not even an explicit nil +func (o *ContentFilesResponseContentInner) UnsetSha256() { + o.Sha256.Unset() +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *ContentFilesResponseContentInner) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponseContentInner) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *ContentFilesResponseContentInner) SetSize(v int32) { + o.Size = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ContentFilesResponseContentInner) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponseContentInner) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ContentFilesResponseContentInner) SetType(v string) { + o.Type = &v +} + +// GetUid returns the Uid field value if set, zero value otherwise. +func (o *ContentFilesResponseContentInner) GetUid() int32 { + if o == nil || o.Uid == nil { + var ret int32 + return ret + } + return *o.Uid +} + +// GetUidOk returns a tuple with the Uid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentFilesResponseContentInner) GetUidOk() (*int32, bool) { + if o == nil || o.Uid == nil { + return nil, false + } + return o.Uid, true +} + +// HasUid returns a boolean if a field has been set. +func (o *ContentFilesResponseContentInner) HasUid() bool { + if o != nil && o.Uid != nil { + return true + } + + return false +} + +// SetUid gets a reference to the given int32 and assigns it to the Uid field. +func (o *ContentFilesResponseContentInner) SetUid(v int32) { + o.Uid = &v +} + +func (o ContentFilesResponseContentInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Filename != nil { + toSerialize["filename"] = o.Filename + } + if o.Gid != nil { + toSerialize["gid"] = o.Gid + } + if o.Linkdest.IsSet() { + toSerialize["linkdest"] = o.Linkdest.Get() + } + if o.Mode != nil { + toSerialize["mode"] = o.Mode + } + if o.Sha256.IsSet() { + toSerialize["sha256"] = o.Sha256.Get() + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Uid != nil { + toSerialize["uid"] = o.Uid + } + return json.Marshal(toSerialize) +} + +type NullableContentFilesResponseContentInner struct { + value *ContentFilesResponseContentInner + isSet bool +} + +func (v NullableContentFilesResponseContentInner) Get() *ContentFilesResponseContentInner { + return v.value +} + +func (v *NullableContentFilesResponseContentInner) Set(val *ContentFilesResponseContentInner) { + v.value = val + v.isSet = true +} + +func (v NullableContentFilesResponseContentInner) IsSet() bool { + return v.isSet +} + +func (v *NullableContentFilesResponseContentInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentFilesResponseContentInner(val *ContentFilesResponseContentInner) *NullableContentFilesResponseContentInner { + return &NullableContentFilesResponseContentInner{value: val, isSet: true} +} + +func (v NullableContentFilesResponseContentInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentFilesResponseContentInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_java_package_response.go b/.gen/anchore/model_content_java_package_response.go index 93bdcc8136..fa78b83272 100644 --- a/.gen/anchore/model_content_java_package_response.go +++ b/.gen/anchore/model_content_java_package_response.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore -// ContentJavaPackageResponse Java package content listings from images -type ContentJavaPackageResponse struct { - ImageDigest string `json:"imageDigest,omitempty"` - ContentType string `json:"content_type,omitempty"` - Content []ContentJavaPackageResponseContent `json:"content,omitempty"` + +import ( + "encoding/json" +) + +// ContentJAVAPackageResponse Java package content listings from images +type ContentJAVAPackageResponse struct { + ImageDigest *string `json:"imageDigest,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Content []ContentJAVAPackageResponseContentInner `json:"content,omitempty"` +} + +// NewContentJAVAPackageResponse instantiates a new ContentJAVAPackageResponse 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 NewContentJAVAPackageResponse() *ContentJAVAPackageResponse { + this := ContentJAVAPackageResponse{} + return &this +} + +// NewContentJAVAPackageResponseWithDefaults instantiates a new ContentJAVAPackageResponse 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 NewContentJAVAPackageResponseWithDefaults() *ContentJAVAPackageResponse { + this := ContentJAVAPackageResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ContentJAVAPackageResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponse) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponse) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponse) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ContentJAVAPackageResponse) SetContentType(v string) { + o.ContentType = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponse) GetContent() []ContentJAVAPackageResponseContentInner { + if o == nil || o.Content == nil { + var ret []ContentJAVAPackageResponseContentInner + return ret + } + return o.Content } + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponse) GetContentOk() ([]ContentJAVAPackageResponseContentInner, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponse) HasContent() bool { + if o != nil && o.Content != nil { + return true + } + + return false +} + +// SetContent gets a reference to the given []ContentJAVAPackageResponseContentInner and assigns it to the Content field. +func (o *ContentJAVAPackageResponse) SetContent(v []ContentJAVAPackageResponseContentInner) { + o.Content = v +} + +func (o ContentJAVAPackageResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ContentType != nil { + toSerialize["content_type"] = o.ContentType + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + return json.Marshal(toSerialize) +} + +type NullableContentJAVAPackageResponse struct { + value *ContentJAVAPackageResponse + isSet bool +} + +func (v NullableContentJAVAPackageResponse) Get() *ContentJAVAPackageResponse { + return v.value +} + +func (v *NullableContentJAVAPackageResponse) Set(val *ContentJAVAPackageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableContentJAVAPackageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableContentJAVAPackageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentJAVAPackageResponse(val *ContentJAVAPackageResponse) *NullableContentJAVAPackageResponse { + return &NullableContentJAVAPackageResponse{value: val, isSet: true} +} + +func (v NullableContentJAVAPackageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentJAVAPackageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_java_package_response_content.go b/.gen/anchore/model_content_java_package_response_content.go deleted file mode 100644 index 82675a84ac..0000000000 --- a/.gen/anchore/model_content_java_package_response_content.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore -// ContentJavaPackageResponseContent struct for ContentJavaPackageResponseContent -type ContentJavaPackageResponseContent struct { - Package string `json:"package,omitempty"` - ImplementationVersion string `json:"implementation-version,omitempty"` - SpecificationVersion string `json:"specification-version,omitempty"` - MavenVersion string `json:"maven-version,omitempty"` - Location string `json:"location,omitempty"` - Type string `json:"type,omitempty"` - Origin string `json:"origin,omitempty"` -} diff --git a/.gen/anchore/model_content_java_package_response_content_inner.go b/.gen/anchore/model_content_java_package_response_content_inner.go new file mode 100644 index 0000000000..28b2df21ad --- /dev/null +++ b/.gen/anchore/model_content_java_package_response_content_inner.go @@ -0,0 +1,369 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ContentJAVAPackageResponseContentInner struct for ContentJAVAPackageResponseContentInner +type ContentJAVAPackageResponseContentInner struct { + Package *string `json:"package,omitempty"` + ImplementationVersion *string `json:"implementation-version,omitempty"` + SpecificationVersion *string `json:"specification-version,omitempty"` + MavenVersion *string `json:"maven-version,omitempty"` + Location *string `json:"location,omitempty"` + Type *string `json:"type,omitempty"` + Origin *string `json:"origin,omitempty"` + // A list of Common Platform Enumerations that may uniquely identify the package + Cpes []string `json:"cpes,omitempty"` +} + +// NewContentJAVAPackageResponseContentInner instantiates a new ContentJAVAPackageResponseContentInner 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 NewContentJAVAPackageResponseContentInner() *ContentJAVAPackageResponseContentInner { + this := ContentJAVAPackageResponseContentInner{} + return &this +} + +// NewContentJAVAPackageResponseContentInnerWithDefaults instantiates a new ContentJAVAPackageResponseContentInner 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 NewContentJAVAPackageResponseContentInnerWithDefaults() *ContentJAVAPackageResponseContentInner { + this := ContentJAVAPackageResponseContentInner{} + return &this +} + +// GetPackage returns the Package field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetPackage() string { + if o == nil || o.Package == nil { + var ret string + return ret + } + return *o.Package +} + +// GetPackageOk returns a tuple with the Package field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetPackageOk() (*string, bool) { + if o == nil || o.Package == nil { + return nil, false + } + return o.Package, true +} + +// HasPackage returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasPackage() bool { + if o != nil && o.Package != nil { + return true + } + + return false +} + +// SetPackage gets a reference to the given string and assigns it to the Package field. +func (o *ContentJAVAPackageResponseContentInner) SetPackage(v string) { + o.Package = &v +} + +// GetImplementationVersion returns the ImplementationVersion field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetImplementationVersion() string { + if o == nil || o.ImplementationVersion == nil { + var ret string + return ret + } + return *o.ImplementationVersion +} + +// GetImplementationVersionOk returns a tuple with the ImplementationVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetImplementationVersionOk() (*string, bool) { + if o == nil || o.ImplementationVersion == nil { + return nil, false + } + return o.ImplementationVersion, true +} + +// HasImplementationVersion returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasImplementationVersion() bool { + if o != nil && o.ImplementationVersion != nil { + return true + } + + return false +} + +// SetImplementationVersion gets a reference to the given string and assigns it to the ImplementationVersion field. +func (o *ContentJAVAPackageResponseContentInner) SetImplementationVersion(v string) { + o.ImplementationVersion = &v +} + +// GetSpecificationVersion returns the SpecificationVersion field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetSpecificationVersion() string { + if o == nil || o.SpecificationVersion == nil { + var ret string + return ret + } + return *o.SpecificationVersion +} + +// GetSpecificationVersionOk returns a tuple with the SpecificationVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetSpecificationVersionOk() (*string, bool) { + if o == nil || o.SpecificationVersion == nil { + return nil, false + } + return o.SpecificationVersion, true +} + +// HasSpecificationVersion returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasSpecificationVersion() bool { + if o != nil && o.SpecificationVersion != nil { + return true + } + + return false +} + +// SetSpecificationVersion gets a reference to the given string and assigns it to the SpecificationVersion field. +func (o *ContentJAVAPackageResponseContentInner) SetSpecificationVersion(v string) { + o.SpecificationVersion = &v +} + +// GetMavenVersion returns the MavenVersion field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetMavenVersion() string { + if o == nil || o.MavenVersion == nil { + var ret string + return ret + } + return *o.MavenVersion +} + +// GetMavenVersionOk returns a tuple with the MavenVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetMavenVersionOk() (*string, bool) { + if o == nil || o.MavenVersion == nil { + return nil, false + } + return o.MavenVersion, true +} + +// HasMavenVersion returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasMavenVersion() bool { + if o != nil && o.MavenVersion != nil { + return true + } + + return false +} + +// SetMavenVersion gets a reference to the given string and assigns it to the MavenVersion field. +func (o *ContentJAVAPackageResponseContentInner) SetMavenVersion(v string) { + o.MavenVersion = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetLocation() string { + if o == nil || o.Location == nil { + var ret string + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetLocationOk() (*string, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasLocation() bool { + if o != nil && o.Location != nil { + return true + } + + return false +} + +// SetLocation gets a reference to the given string and assigns it to the Location field. +func (o *ContentJAVAPackageResponseContentInner) SetLocation(v string) { + o.Location = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ContentJAVAPackageResponseContentInner) SetType(v string) { + o.Type = &v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetOrigin() string { + if o == nil || o.Origin == nil { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetOriginOk() (*string, bool) { + if o == nil || o.Origin == nil { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasOrigin() bool { + if o != nil && o.Origin != nil { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *ContentJAVAPackageResponseContentInner) SetOrigin(v string) { + o.Origin = &v +} + +// GetCpes returns the Cpes field value if set, zero value otherwise. +func (o *ContentJAVAPackageResponseContentInner) GetCpes() []string { + if o == nil || o.Cpes == nil { + var ret []string + return ret + } + return o.Cpes +} + +// GetCpesOk returns a tuple with the Cpes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentJAVAPackageResponseContentInner) GetCpesOk() ([]string, bool) { + if o == nil || o.Cpes == nil { + return nil, false + } + return o.Cpes, true +} + +// HasCpes returns a boolean if a field has been set. +func (o *ContentJAVAPackageResponseContentInner) HasCpes() bool { + if o != nil && o.Cpes != nil { + return true + } + + return false +} + +// SetCpes gets a reference to the given []string and assigns it to the Cpes field. +func (o *ContentJAVAPackageResponseContentInner) SetCpes(v []string) { + o.Cpes = v +} + +func (o ContentJAVAPackageResponseContentInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Package != nil { + toSerialize["package"] = o.Package + } + if o.ImplementationVersion != nil { + toSerialize["implementation-version"] = o.ImplementationVersion + } + if o.SpecificationVersion != nil { + toSerialize["specification-version"] = o.SpecificationVersion + } + if o.MavenVersion != nil { + toSerialize["maven-version"] = o.MavenVersion + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Origin != nil { + toSerialize["origin"] = o.Origin + } + if o.Cpes != nil { + toSerialize["cpes"] = o.Cpes + } + return json.Marshal(toSerialize) +} + +type NullableContentJAVAPackageResponseContentInner struct { + value *ContentJAVAPackageResponseContentInner + isSet bool +} + +func (v NullableContentJAVAPackageResponseContentInner) Get() *ContentJAVAPackageResponseContentInner { + return v.value +} + +func (v *NullableContentJAVAPackageResponseContentInner) Set(val *ContentJAVAPackageResponseContentInner) { + v.value = val + v.isSet = true +} + +func (v NullableContentJAVAPackageResponseContentInner) IsSet() bool { + return v.isSet +} + +func (v *NullableContentJAVAPackageResponseContentInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentJAVAPackageResponseContentInner(val *ContentJAVAPackageResponseContentInner) *NullableContentJAVAPackageResponseContentInner { + return &NullableContentJAVAPackageResponseContentInner{value: val, isSet: true} +} + +func (v NullableContentJAVAPackageResponseContentInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentJAVAPackageResponseContentInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_malware_response.go b/.gen/anchore/model_content_malware_response.go new file mode 100644 index 0000000000..bd2ad24b1b --- /dev/null +++ b/.gen/anchore/model_content_malware_response.go @@ -0,0 +1,189 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ContentMalwareResponse Malware listing response +type ContentMalwareResponse struct { + ImageDigest *string `json:"imageDigest,omitempty"` + ContentType *string `json:"content_type,omitempty"` + // List of malware scan results, one per scanner configured to run + Content []MalwareScan `json:"content,omitempty"` +} + +// NewContentMalwareResponse instantiates a new ContentMalwareResponse 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 NewContentMalwareResponse() *ContentMalwareResponse { + this := ContentMalwareResponse{} + return &this +} + +// NewContentMalwareResponseWithDefaults instantiates a new ContentMalwareResponse 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 NewContentMalwareResponseWithDefaults() *ContentMalwareResponse { + this := ContentMalwareResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ContentMalwareResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentMalwareResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ContentMalwareResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ContentMalwareResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ContentMalwareResponse) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentMalwareResponse) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ContentMalwareResponse) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ContentMalwareResponse) SetContentType(v string) { + o.ContentType = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *ContentMalwareResponse) GetContent() []MalwareScan { + if o == nil || o.Content == nil { + var ret []MalwareScan + return ret + } + return o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentMalwareResponse) GetContentOk() ([]MalwareScan, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *ContentMalwareResponse) HasContent() bool { + if o != nil && o.Content != nil { + return true + } + + return false +} + +// SetContent gets a reference to the given []MalwareScan and assigns it to the Content field. +func (o *ContentMalwareResponse) SetContent(v []MalwareScan) { + o.Content = v +} + +func (o ContentMalwareResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ContentType != nil { + toSerialize["content_type"] = o.ContentType + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + return json.Marshal(toSerialize) +} + +type NullableContentMalwareResponse struct { + value *ContentMalwareResponse + isSet bool +} + +func (v NullableContentMalwareResponse) Get() *ContentMalwareResponse { + return v.value +} + +func (v *NullableContentMalwareResponse) Set(val *ContentMalwareResponse) { + v.value = val + v.isSet = true +} + +func (v NullableContentMalwareResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableContentMalwareResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentMalwareResponse(val *ContentMalwareResponse) *NullableContentMalwareResponse { + return &NullableContentMalwareResponse{value: val, isSet: true} +} + +func (v NullableContentMalwareResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentMalwareResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_package_response.go b/.gen/anchore/model_content_package_response.go index d717ac0794..6af82d8bec 100644 --- a/.gen/anchore/model_content_package_response.go +++ b/.gen/anchore/model_content_package_response.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ContentPackageResponse Package content listings from images type ContentPackageResponse struct { - ImageDigest string `json:"imageDigest,omitempty"` - ContentType string `json:"content_type,omitempty"` - Content []ContentPackageResponseContent `json:"content,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Content []ContentPackageResponseContentInner `json:"content,omitempty"` +} + +// NewContentPackageResponse instantiates a new ContentPackageResponse 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 NewContentPackageResponse() *ContentPackageResponse { + this := ContentPackageResponse{} + return &this +} + +// NewContentPackageResponseWithDefaults instantiates a new ContentPackageResponse 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 NewContentPackageResponseWithDefaults() *ContentPackageResponse { + this := ContentPackageResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ContentPackageResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ContentPackageResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ContentPackageResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ContentPackageResponse) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponse) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ContentPackageResponse) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ContentPackageResponse) SetContentType(v string) { + o.ContentType = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *ContentPackageResponse) GetContent() []ContentPackageResponseContentInner { + if o == nil || o.Content == nil { + var ret []ContentPackageResponseContentInner + return ret + } + return o.Content } + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponse) GetContentOk() ([]ContentPackageResponseContentInner, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *ContentPackageResponse) HasContent() bool { + if o != nil && o.Content != nil { + return true + } + + return false +} + +// SetContent gets a reference to the given []ContentPackageResponseContentInner and assigns it to the Content field. +func (o *ContentPackageResponse) SetContent(v []ContentPackageResponseContentInner) { + o.Content = v +} + +func (o ContentPackageResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ContentType != nil { + toSerialize["content_type"] = o.ContentType + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + return json.Marshal(toSerialize) +} + +type NullableContentPackageResponse struct { + value *ContentPackageResponse + isSet bool +} + +func (v NullableContentPackageResponse) Get() *ContentPackageResponse { + return v.value +} + +func (v *NullableContentPackageResponse) Set(val *ContentPackageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableContentPackageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableContentPackageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentPackageResponse(val *ContentPackageResponse) *NullableContentPackageResponse { + return &NullableContentPackageResponse{value: val, isSet: true} +} + +func (v NullableContentPackageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentPackageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_package_response_content.go b/.gen/anchore/model_content_package_response_content.go deleted file mode 100644 index 73583611fe..0000000000 --- a/.gen/anchore/model_content_package_response_content.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore -// ContentPackageResponseContent struct for ContentPackageResponseContent -type ContentPackageResponseContent struct { - Package string `json:"package,omitempty"` - Version string `json:"version,omitempty"` - Size string `json:"size,omitempty"` - Type string `json:"type,omitempty"` - Origin string `json:"origin,omitempty"` - License string `json:"license,omitempty"` - Location string `json:"location,omitempty"` -} diff --git a/.gen/anchore/model_content_package_response_content_inner.go b/.gen/anchore/model_content_package_response_content_inner.go new file mode 100644 index 0000000000..cb3eff02f8 --- /dev/null +++ b/.gen/anchore/model_content_package_response_content_inner.go @@ -0,0 +1,406 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ContentPackageResponseContentInner struct for ContentPackageResponseContentInner +type ContentPackageResponseContentInner struct { + Package *string `json:"package,omitempty"` + Version *string `json:"version,omitempty"` + Size *string `json:"size,omitempty"` + Type *string `json:"type,omitempty"` + Origin *string `json:"origin,omitempty"` + // Deprecated in favor of the 'licenses' field\" + License *string `json:"license,omitempty"` + Licenses []string `json:"licenses,omitempty"` + Location *string `json:"location,omitempty"` + // A list of Common Platform Enumerations that may uniquely identify the package + Cpes []string `json:"cpes,omitempty"` +} + +// NewContentPackageResponseContentInner instantiates a new ContentPackageResponseContentInner 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 NewContentPackageResponseContentInner() *ContentPackageResponseContentInner { + this := ContentPackageResponseContentInner{} + return &this +} + +// NewContentPackageResponseContentInnerWithDefaults instantiates a new ContentPackageResponseContentInner 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 NewContentPackageResponseContentInnerWithDefaults() *ContentPackageResponseContentInner { + this := ContentPackageResponseContentInner{} + return &this +} + +// GetPackage returns the Package field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetPackage() string { + if o == nil || o.Package == nil { + var ret string + return ret + } + return *o.Package +} + +// GetPackageOk returns a tuple with the Package field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetPackageOk() (*string, bool) { + if o == nil || o.Package == nil { + return nil, false + } + return o.Package, true +} + +// HasPackage returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasPackage() bool { + if o != nil && o.Package != nil { + return true + } + + return false +} + +// SetPackage gets a reference to the given string and assigns it to the Package field. +func (o *ContentPackageResponseContentInner) SetPackage(v string) { + o.Package = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *ContentPackageResponseContentInner) SetVersion(v string) { + o.Version = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetSize() string { + if o == nil || o.Size == nil { + var ret string + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetSizeOk() (*string, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given string and assigns it to the Size field. +func (o *ContentPackageResponseContentInner) SetSize(v string) { + o.Size = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ContentPackageResponseContentInner) SetType(v string) { + o.Type = &v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetOrigin() string { + if o == nil || o.Origin == nil { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetOriginOk() (*string, bool) { + if o == nil || o.Origin == nil { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasOrigin() bool { + if o != nil && o.Origin != nil { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *ContentPackageResponseContentInner) SetOrigin(v string) { + o.Origin = &v +} + +// GetLicense returns the License field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetLicense() string { + if o == nil || o.License == nil { + var ret string + return ret + } + return *o.License +} + +// GetLicenseOk returns a tuple with the License field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetLicenseOk() (*string, bool) { + if o == nil || o.License == nil { + return nil, false + } + return o.License, true +} + +// HasLicense returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasLicense() bool { + if o != nil && o.License != nil { + return true + } + + return false +} + +// SetLicense gets a reference to the given string and assigns it to the License field. +func (o *ContentPackageResponseContentInner) SetLicense(v string) { + o.License = &v +} + +// GetLicenses returns the Licenses field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetLicenses() []string { + if o == nil || o.Licenses == nil { + var ret []string + return ret + } + return o.Licenses +} + +// GetLicensesOk returns a tuple with the Licenses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetLicensesOk() ([]string, bool) { + if o == nil || o.Licenses == nil { + return nil, false + } + return o.Licenses, true +} + +// HasLicenses returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasLicenses() bool { + if o != nil && o.Licenses != nil { + return true + } + + return false +} + +// SetLicenses gets a reference to the given []string and assigns it to the Licenses field. +func (o *ContentPackageResponseContentInner) SetLicenses(v []string) { + o.Licenses = v +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetLocation() string { + if o == nil || o.Location == nil { + var ret string + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetLocationOk() (*string, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasLocation() bool { + if o != nil && o.Location != nil { + return true + } + + return false +} + +// SetLocation gets a reference to the given string and assigns it to the Location field. +func (o *ContentPackageResponseContentInner) SetLocation(v string) { + o.Location = &v +} + +// GetCpes returns the Cpes field value if set, zero value otherwise. +func (o *ContentPackageResponseContentInner) GetCpes() []string { + if o == nil || o.Cpes == nil { + var ret []string + return ret + } + return o.Cpes +} + +// GetCpesOk returns a tuple with the Cpes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentPackageResponseContentInner) GetCpesOk() ([]string, bool) { + if o == nil || o.Cpes == nil { + return nil, false + } + return o.Cpes, true +} + +// HasCpes returns a boolean if a field has been set. +func (o *ContentPackageResponseContentInner) HasCpes() bool { + if o != nil && o.Cpes != nil { + return true + } + + return false +} + +// SetCpes gets a reference to the given []string and assigns it to the Cpes field. +func (o *ContentPackageResponseContentInner) SetCpes(v []string) { + o.Cpes = v +} + +func (o ContentPackageResponseContentInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Package != nil { + toSerialize["package"] = o.Package + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Origin != nil { + toSerialize["origin"] = o.Origin + } + if o.License != nil { + toSerialize["license"] = o.License + } + if o.Licenses != nil { + toSerialize["licenses"] = o.Licenses + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.Cpes != nil { + toSerialize["cpes"] = o.Cpes + } + return json.Marshal(toSerialize) +} + +type NullableContentPackageResponseContentInner struct { + value *ContentPackageResponseContentInner + isSet bool +} + +func (v NullableContentPackageResponseContentInner) Get() *ContentPackageResponseContentInner { + return v.value +} + +func (v *NullableContentPackageResponseContentInner) Set(val *ContentPackageResponseContentInner) { + v.value = val + v.isSet = true +} + +func (v NullableContentPackageResponseContentInner) IsSet() bool { + return v.isSet +} + +func (v *NullableContentPackageResponseContentInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentPackageResponseContentInner(val *ContentPackageResponseContentInner) *NullableContentPackageResponseContentInner { + return &NullableContentPackageResponseContentInner{value: val, isSet: true} +} + +func (v NullableContentPackageResponseContentInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentPackageResponseContentInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_content_response.go b/.gen/anchore/model_content_response.go index 1daf0f34fd..f8030a1e9d 100644 --- a/.gen/anchore/model_content_response.go +++ b/.gen/anchore/model_content_response.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ContentResponse Generic wrapper for content listings from images type ContentResponse struct { - ImageDigest string `json:"imageDigest,omitempty"` - ContentType string `json:"content_type,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + ContentType *string `json:"content_type,omitempty"` Content []map[string]interface{} `json:"content,omitempty"` } + +// NewContentResponse instantiates a new ContentResponse 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 NewContentResponse() *ContentResponse { + this := ContentResponse{} + return &this +} + +// NewContentResponseWithDefaults instantiates a new ContentResponse 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 NewContentResponseWithDefaults() *ContentResponse { + this := ContentResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ContentResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ContentResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ContentResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ContentResponse) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentResponse) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ContentResponse) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ContentResponse) SetContentType(v string) { + o.ContentType = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *ContentResponse) GetContent() []map[string]interface{} { + if o == nil || o.Content == nil { + var ret []map[string]interface{} + return ret + } + return o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContentResponse) GetContentOk() ([]map[string]interface{}, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *ContentResponse) HasContent() bool { + if o != nil && o.Content != nil { + return true + } + + return false +} + +// SetContent gets a reference to the given []map[string]interface{} and assigns it to the Content field. +func (o *ContentResponse) SetContent(v []map[string]interface{}) { + o.Content = v +} + +func (o ContentResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.ContentType != nil { + toSerialize["content_type"] = o.ContentType + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + return json.Marshal(toSerialize) +} + +type NullableContentResponse struct { + value *ContentResponse + isSet bool +} + +func (v NullableContentResponse) Get() *ContentResponse { + return v.value +} + +func (v *NullableContentResponse) Set(val *ContentResponse) { + v.value = val + v.isSet = true +} + +func (v NullableContentResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableContentResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentResponse(val *ContentResponse) *NullableContentResponse { + return &NullableContentResponse{value: val, isSet: true} +} + +func (v NullableContentResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_cvssv2_scores.go b/.gen/anchore/model_cvssv2_scores.go index 61a64118a5..6f7bfcd3b8 100644 --- a/.gen/anchore/model_cvssv2_scores.go +++ b/.gen/anchore/model_cvssv2_scores.go @@ -1,18 +1,218 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore -// Cvssv2Scores struct for Cvssv2Scores -type Cvssv2Scores struct { - BaseScore *float32 `json:"base_score,omitempty"` - ExploitabilityScore *float32 `json:"exploitability_score,omitempty"` - ImpactScore *float32 `json:"impact_score,omitempty"` + +import ( + "encoding/json" +) + +// CVSSV2Scores struct for CVSSV2Scores +type CVSSV2Scores struct { + BaseScore NullableFloat32 `json:"base_score,omitempty"` + ExploitabilityScore NullableFloat32 `json:"exploitability_score,omitempty"` + ImpactScore NullableFloat32 `json:"impact_score,omitempty"` +} + +// NewCVSSV2Scores instantiates a new CVSSV2Scores 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 NewCVSSV2Scores() *CVSSV2Scores { + this := CVSSV2Scores{} + return &this +} + +// NewCVSSV2ScoresWithDefaults instantiates a new CVSSV2Scores 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 NewCVSSV2ScoresWithDefaults() *CVSSV2Scores { + this := CVSSV2Scores{} + return &this +} + +// GetBaseScore returns the BaseScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CVSSV2Scores) GetBaseScore() float32 { + if o == nil || o.BaseScore.Get() == nil { + var ret float32 + return ret + } + return *o.BaseScore.Get() +} + +// GetBaseScoreOk returns a tuple with the BaseScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CVSSV2Scores) GetBaseScoreOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.BaseScore.Get(), o.BaseScore.IsSet() +} + +// HasBaseScore returns a boolean if a field has been set. +func (o *CVSSV2Scores) HasBaseScore() bool { + if o != nil && o.BaseScore.IsSet() { + return true + } + + return false +} + +// SetBaseScore gets a reference to the given NullableFloat32 and assigns it to the BaseScore field. +func (o *CVSSV2Scores) SetBaseScore(v float32) { + o.BaseScore.Set(&v) +} +// SetBaseScoreNil sets the value for BaseScore to be an explicit nil +func (o *CVSSV2Scores) SetBaseScoreNil() { + o.BaseScore.Set(nil) +} + +// UnsetBaseScore ensures that no value is present for BaseScore, not even an explicit nil +func (o *CVSSV2Scores) UnsetBaseScore() { + o.BaseScore.Unset() +} + +// GetExploitabilityScore returns the ExploitabilityScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CVSSV2Scores) GetExploitabilityScore() float32 { + if o == nil || o.ExploitabilityScore.Get() == nil { + var ret float32 + return ret + } + return *o.ExploitabilityScore.Get() +} + +// GetExploitabilityScoreOk returns a tuple with the ExploitabilityScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CVSSV2Scores) GetExploitabilityScoreOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ExploitabilityScore.Get(), o.ExploitabilityScore.IsSet() +} + +// HasExploitabilityScore returns a boolean if a field has been set. +func (o *CVSSV2Scores) HasExploitabilityScore() bool { + if o != nil && o.ExploitabilityScore.IsSet() { + return true + } + + return false +} + +// SetExploitabilityScore gets a reference to the given NullableFloat32 and assigns it to the ExploitabilityScore field. +func (o *CVSSV2Scores) SetExploitabilityScore(v float32) { + o.ExploitabilityScore.Set(&v) +} +// SetExploitabilityScoreNil sets the value for ExploitabilityScore to be an explicit nil +func (o *CVSSV2Scores) SetExploitabilityScoreNil() { + o.ExploitabilityScore.Set(nil) +} + +// UnsetExploitabilityScore ensures that no value is present for ExploitabilityScore, not even an explicit nil +func (o *CVSSV2Scores) UnsetExploitabilityScore() { + o.ExploitabilityScore.Unset() } + +// GetImpactScore returns the ImpactScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CVSSV2Scores) GetImpactScore() float32 { + if o == nil || o.ImpactScore.Get() == nil { + var ret float32 + return ret + } + return *o.ImpactScore.Get() +} + +// GetImpactScoreOk returns a tuple with the ImpactScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CVSSV2Scores) GetImpactScoreOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ImpactScore.Get(), o.ImpactScore.IsSet() +} + +// HasImpactScore returns a boolean if a field has been set. +func (o *CVSSV2Scores) HasImpactScore() bool { + if o != nil && o.ImpactScore.IsSet() { + return true + } + + return false +} + +// SetImpactScore gets a reference to the given NullableFloat32 and assigns it to the ImpactScore field. +func (o *CVSSV2Scores) SetImpactScore(v float32) { + o.ImpactScore.Set(&v) +} +// SetImpactScoreNil sets the value for ImpactScore to be an explicit nil +func (o *CVSSV2Scores) SetImpactScoreNil() { + o.ImpactScore.Set(nil) +} + +// UnsetImpactScore ensures that no value is present for ImpactScore, not even an explicit nil +func (o *CVSSV2Scores) UnsetImpactScore() { + o.ImpactScore.Unset() +} + +func (o CVSSV2Scores) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BaseScore.IsSet() { + toSerialize["base_score"] = o.BaseScore.Get() + } + if o.ExploitabilityScore.IsSet() { + toSerialize["exploitability_score"] = o.ExploitabilityScore.Get() + } + if o.ImpactScore.IsSet() { + toSerialize["impact_score"] = o.ImpactScore.Get() + } + return json.Marshal(toSerialize) +} + +type NullableCVSSV2Scores struct { + value *CVSSV2Scores + isSet bool +} + +func (v NullableCVSSV2Scores) Get() *CVSSV2Scores { + return v.value +} + +func (v *NullableCVSSV2Scores) Set(val *CVSSV2Scores) { + v.value = val + v.isSet = true +} + +func (v NullableCVSSV2Scores) IsSet() bool { + return v.isSet +} + +func (v *NullableCVSSV2Scores) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCVSSV2Scores(val *CVSSV2Scores) *NullableCVSSV2Scores { + return &NullableCVSSV2Scores{value: val, isSet: true} +} + +func (v NullableCVSSV2Scores) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCVSSV2Scores) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_cvssv3_scores.go b/.gen/anchore/model_cvssv3_scores.go index 4343279242..d46aa96a90 100644 --- a/.gen/anchore/model_cvssv3_scores.go +++ b/.gen/anchore/model_cvssv3_scores.go @@ -1,18 +1,218 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore -// Cvssv3Scores struct for Cvssv3Scores -type Cvssv3Scores struct { - BaseScore *float32 `json:"base_score,omitempty"` - ExploitabilityScore *float32 `json:"exploitability_score,omitempty"` - ImpactScore *float32 `json:"impact_score,omitempty"` + +import ( + "encoding/json" +) + +// CVSSV3Scores struct for CVSSV3Scores +type CVSSV3Scores struct { + BaseScore NullableFloat32 `json:"base_score,omitempty"` + ExploitabilityScore NullableFloat32 `json:"exploitability_score,omitempty"` + ImpactScore NullableFloat32 `json:"impact_score,omitempty"` +} + +// NewCVSSV3Scores instantiates a new CVSSV3Scores 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 NewCVSSV3Scores() *CVSSV3Scores { + this := CVSSV3Scores{} + return &this +} + +// NewCVSSV3ScoresWithDefaults instantiates a new CVSSV3Scores 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 NewCVSSV3ScoresWithDefaults() *CVSSV3Scores { + this := CVSSV3Scores{} + return &this +} + +// GetBaseScore returns the BaseScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CVSSV3Scores) GetBaseScore() float32 { + if o == nil || o.BaseScore.Get() == nil { + var ret float32 + return ret + } + return *o.BaseScore.Get() +} + +// GetBaseScoreOk returns a tuple with the BaseScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CVSSV3Scores) GetBaseScoreOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.BaseScore.Get(), o.BaseScore.IsSet() +} + +// HasBaseScore returns a boolean if a field has been set. +func (o *CVSSV3Scores) HasBaseScore() bool { + if o != nil && o.BaseScore.IsSet() { + return true + } + + return false +} + +// SetBaseScore gets a reference to the given NullableFloat32 and assigns it to the BaseScore field. +func (o *CVSSV3Scores) SetBaseScore(v float32) { + o.BaseScore.Set(&v) +} +// SetBaseScoreNil sets the value for BaseScore to be an explicit nil +func (o *CVSSV3Scores) SetBaseScoreNil() { + o.BaseScore.Set(nil) +} + +// UnsetBaseScore ensures that no value is present for BaseScore, not even an explicit nil +func (o *CVSSV3Scores) UnsetBaseScore() { + o.BaseScore.Unset() +} + +// GetExploitabilityScore returns the ExploitabilityScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CVSSV3Scores) GetExploitabilityScore() float32 { + if o == nil || o.ExploitabilityScore.Get() == nil { + var ret float32 + return ret + } + return *o.ExploitabilityScore.Get() +} + +// GetExploitabilityScoreOk returns a tuple with the ExploitabilityScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CVSSV3Scores) GetExploitabilityScoreOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ExploitabilityScore.Get(), o.ExploitabilityScore.IsSet() +} + +// HasExploitabilityScore returns a boolean if a field has been set. +func (o *CVSSV3Scores) HasExploitabilityScore() bool { + if o != nil && o.ExploitabilityScore.IsSet() { + return true + } + + return false +} + +// SetExploitabilityScore gets a reference to the given NullableFloat32 and assigns it to the ExploitabilityScore field. +func (o *CVSSV3Scores) SetExploitabilityScore(v float32) { + o.ExploitabilityScore.Set(&v) +} +// SetExploitabilityScoreNil sets the value for ExploitabilityScore to be an explicit nil +func (o *CVSSV3Scores) SetExploitabilityScoreNil() { + o.ExploitabilityScore.Set(nil) +} + +// UnsetExploitabilityScore ensures that no value is present for ExploitabilityScore, not even an explicit nil +func (o *CVSSV3Scores) UnsetExploitabilityScore() { + o.ExploitabilityScore.Unset() } + +// GetImpactScore returns the ImpactScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CVSSV3Scores) GetImpactScore() float32 { + if o == nil || o.ImpactScore.Get() == nil { + var ret float32 + return ret + } + return *o.ImpactScore.Get() +} + +// GetImpactScoreOk returns a tuple with the ImpactScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CVSSV3Scores) GetImpactScoreOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ImpactScore.Get(), o.ImpactScore.IsSet() +} + +// HasImpactScore returns a boolean if a field has been set. +func (o *CVSSV3Scores) HasImpactScore() bool { + if o != nil && o.ImpactScore.IsSet() { + return true + } + + return false +} + +// SetImpactScore gets a reference to the given NullableFloat32 and assigns it to the ImpactScore field. +func (o *CVSSV3Scores) SetImpactScore(v float32) { + o.ImpactScore.Set(&v) +} +// SetImpactScoreNil sets the value for ImpactScore to be an explicit nil +func (o *CVSSV3Scores) SetImpactScoreNil() { + o.ImpactScore.Set(nil) +} + +// UnsetImpactScore ensures that no value is present for ImpactScore, not even an explicit nil +func (o *CVSSV3Scores) UnsetImpactScore() { + o.ImpactScore.Unset() +} + +func (o CVSSV3Scores) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BaseScore.IsSet() { + toSerialize["base_score"] = o.BaseScore.Get() + } + if o.ExploitabilityScore.IsSet() { + toSerialize["exploitability_score"] = o.ExploitabilityScore.Get() + } + if o.ImpactScore.IsSet() { + toSerialize["impact_score"] = o.ImpactScore.Get() + } + return json.Marshal(toSerialize) +} + +type NullableCVSSV3Scores struct { + value *CVSSV3Scores + isSet bool +} + +func (v NullableCVSSV3Scores) Get() *CVSSV3Scores { + return v.value +} + +func (v *NullableCVSSV3Scores) Set(val *CVSSV3Scores) { + v.value = val + v.isSet = true +} + +func (v NullableCVSSV3Scores) IsSet() bool { + return v.isSet +} + +func (v *NullableCVSSV3Scores) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCVSSV3Scores(val *CVSSV3Scores) *NullableCVSSV3Scores { + return &NullableCVSSV3Scores{value: val, isSet: true} +} + +func (v NullableCVSSV3Scores) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCVSSV3Scores) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_delete_image_response.go b/.gen/anchore/model_delete_image_response.go new file mode 100644 index 0000000000..57b61daf45 --- /dev/null +++ b/.gen/anchore/model_delete_image_response.go @@ -0,0 +1,175 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// DeleteImageResponse Image deletion response containing status and details +type DeleteImageResponse struct { + Digest string `json:"digest"` + // Current status of the image deletion + Status string `json:"status"` + Detail *string `json:"detail,omitempty"` +} + +// NewDeleteImageResponse instantiates a new DeleteImageResponse 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 NewDeleteImageResponse(digest string, status string) *DeleteImageResponse { + this := DeleteImageResponse{} + this.Digest = digest + this.Status = status + return &this +} + +// NewDeleteImageResponseWithDefaults instantiates a new DeleteImageResponse 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 NewDeleteImageResponseWithDefaults() *DeleteImageResponse { + this := DeleteImageResponse{} + return &this +} + +// GetDigest returns the Digest field value +func (o *DeleteImageResponse) GetDigest() string { + if o == nil { + var ret string + return ret + } + + return o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value +// and a boolean to check if the value has been set. +func (o *DeleteImageResponse) GetDigestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Digest, true +} + +// SetDigest sets field value +func (o *DeleteImageResponse) SetDigest(v string) { + o.Digest = v +} + +// GetStatus returns the Status field value +func (o *DeleteImageResponse) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *DeleteImageResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *DeleteImageResponse) SetStatus(v string) { + o.Status = v +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *DeleteImageResponse) GetDetail() string { + if o == nil || o.Detail == nil { + var ret string + return ret + } + return *o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteImageResponse) GetDetailOk() (*string, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *DeleteImageResponse) HasDetail() bool { + if o != nil && o.Detail != nil { + return true + } + + return false +} + +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *DeleteImageResponse) SetDetail(v string) { + o.Detail = &v +} + +func (o DeleteImageResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["digest"] = o.Digest + } + if true { + toSerialize["status"] = o.Status + } + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + return json.Marshal(toSerialize) +} + +type NullableDeleteImageResponse struct { + value *DeleteImageResponse + isSet bool +} + +func (v NullableDeleteImageResponse) Get() *DeleteImageResponse { + return v.value +} + +func (v *NullableDeleteImageResponse) Set(val *DeleteImageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteImageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteImageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteImageResponse(val *DeleteImageResponse) *NullableDeleteImageResponse { + return &NullableDeleteImageResponse{value: val, isSet: true} +} + +func (v NullableDeleteImageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteImageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_category.go b/.gen/anchore/model_event_category.go new file mode 100644 index 0000000000..b66ec5a083 --- /dev/null +++ b/.gen/anchore/model_event_category.go @@ -0,0 +1,188 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// EventCategory A collection of event subcategories +type EventCategory struct { + Category *string `json:"category,omitempty"` + Description *string `json:"description,omitempty"` + Subcategories []EventSubcategory `json:"subcategories,omitempty"` +} + +// NewEventCategory instantiates a new EventCategory 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 NewEventCategory() *EventCategory { + this := EventCategory{} + return &this +} + +// NewEventCategoryWithDefaults instantiates a new EventCategory 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 NewEventCategoryWithDefaults() *EventCategory { + this := EventCategory{} + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *EventCategory) GetCategory() string { + if o == nil || o.Category == nil { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventCategory) GetCategoryOk() (*string, bool) { + if o == nil || o.Category == nil { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *EventCategory) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *EventCategory) SetCategory(v string) { + o.Category = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *EventCategory) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventCategory) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *EventCategory) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *EventCategory) SetDescription(v string) { + o.Description = &v +} + +// GetSubcategories returns the Subcategories field value if set, zero value otherwise. +func (o *EventCategory) GetSubcategories() []EventSubcategory { + if o == nil || o.Subcategories == nil { + var ret []EventSubcategory + return ret + } + return o.Subcategories +} + +// GetSubcategoriesOk returns a tuple with the Subcategories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventCategory) GetSubcategoriesOk() ([]EventSubcategory, bool) { + if o == nil || o.Subcategories == nil { + return nil, false + } + return o.Subcategories, true +} + +// HasSubcategories returns a boolean if a field has been set. +func (o *EventCategory) HasSubcategories() bool { + if o != nil && o.Subcategories != nil { + return true + } + + return false +} + +// SetSubcategories gets a reference to the given []EventSubcategory and assigns it to the Subcategories field. +func (o *EventCategory) SetSubcategories(v []EventSubcategory) { + o.Subcategories = v +} + +func (o EventCategory) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Category != nil { + toSerialize["category"] = o.Category + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Subcategories != nil { + toSerialize["subcategories"] = o.Subcategories + } + return json.Marshal(toSerialize) +} + +type NullableEventCategory struct { + value *EventCategory + isSet bool +} + +func (v NullableEventCategory) Get() *EventCategory { + return v.value +} + +func (v *NullableEventCategory) Set(val *EventCategory) { + v.value = val + v.isSet = true +} + +func (v NullableEventCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableEventCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventCategory(val *EventCategory) *NullableEventCategory { + return &NullableEventCategory{value: val, isSet: true} +} + +func (v NullableEventCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_description.go b/.gen/anchore/model_event_description.go new file mode 100644 index 0000000000..ea3bc61e31 --- /dev/null +++ b/.gen/anchore/model_event_description.go @@ -0,0 +1,228 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// EventDescription A description of an event type +type EventDescription struct { + // The event type. The last component of the fully-qualified event_type (category.subcategory.event) + Name *string `json:"name,omitempty"` + // The fully qualified event type as would be seen in the event payload + Type *string `json:"type,omitempty"` + // The message associated with the event type + Message *string `json:"message,omitempty"` + // The type of resource this event is generated from + ResourceType *string `json:"resource_type,omitempty"` +} + +// NewEventDescription instantiates a new EventDescription 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 NewEventDescription() *EventDescription { + this := EventDescription{} + return &this +} + +// NewEventDescriptionWithDefaults instantiates a new EventDescription 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 NewEventDescriptionWithDefaults() *EventDescription { + this := EventDescription{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *EventDescription) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventDescription) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *EventDescription) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *EventDescription) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *EventDescription) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventDescription) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *EventDescription) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *EventDescription) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *EventDescription) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventDescription) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *EventDescription) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *EventDescription) SetMessage(v string) { + o.Message = &v +} + +// GetResourceType returns the ResourceType field value if set, zero value otherwise. +func (o *EventDescription) GetResourceType() string { + if o == nil || o.ResourceType == nil { + var ret string + return ret + } + return *o.ResourceType +} + +// GetResourceTypeOk returns a tuple with the ResourceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventDescription) GetResourceTypeOk() (*string, bool) { + if o == nil || o.ResourceType == nil { + return nil, false + } + return o.ResourceType, true +} + +// HasResourceType returns a boolean if a field has been set. +func (o *EventDescription) HasResourceType() bool { + if o != nil && o.ResourceType != nil { + return true + } + + return false +} + +// SetResourceType gets a reference to the given string and assigns it to the ResourceType field. +func (o *EventDescription) SetResourceType(v string) { + o.ResourceType = &v +} + +func (o EventDescription) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.ResourceType != nil { + toSerialize["resource_type"] = o.ResourceType + } + return json.Marshal(toSerialize) +} + +type NullableEventDescription struct { + value *EventDescription + isSet bool +} + +func (v NullableEventDescription) Get() *EventDescription { + return v.value +} + +func (v *NullableEventDescription) Set(val *EventDescription) { + v.value = val + v.isSet = true +} + +func (v NullableEventDescription) IsSet() bool { + return v.isSet +} + +func (v *NullableEventDescription) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventDescription(val *EventDescription) *NullableEventDescription { + return &NullableEventDescription{value: val, isSet: true} +} + +func (v NullableEventDescription) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventDescription) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_response.go b/.gen/anchore/model_event_response.go index ea97e7c460..faf0f92236 100644 --- a/.gen/anchore/model_event_response.go +++ b/.gen/anchore/model_event_response.go @@ -1,21 +1,189 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // EventResponse A record of occurance of an asynchronous event triggered either by system or by user activity type EventResponse struct { - GeneratedUuid string `json:"generated_uuid,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - Event EventResponseEvent `json:"event,omitempty"` + GeneratedUuid *string `json:"generated_uuid,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Event *EventResponseEvent `json:"event,omitempty"` +} + +// NewEventResponse instantiates a new EventResponse 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 NewEventResponse() *EventResponse { + this := EventResponse{} + return &this +} + +// NewEventResponseWithDefaults instantiates a new EventResponse 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 NewEventResponseWithDefaults() *EventResponse { + this := EventResponse{} + return &this +} + +// GetGeneratedUuid returns the GeneratedUuid field value if set, zero value otherwise. +func (o *EventResponse) GetGeneratedUuid() string { + if o == nil || o.GeneratedUuid == nil { + var ret string + return ret + } + return *o.GeneratedUuid +} + +// GetGeneratedUuidOk returns a tuple with the GeneratedUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponse) GetGeneratedUuidOk() (*string, bool) { + if o == nil || o.GeneratedUuid == nil { + return nil, false + } + return o.GeneratedUuid, true +} + +// HasGeneratedUuid returns a boolean if a field has been set. +func (o *EventResponse) HasGeneratedUuid() bool { + if o != nil && o.GeneratedUuid != nil { + return true + } + + return false +} + +// SetGeneratedUuid gets a reference to the given string and assigns it to the GeneratedUuid field. +func (o *EventResponse) SetGeneratedUuid(v string) { + o.GeneratedUuid = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *EventResponse) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *EventResponse) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *EventResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEvent returns the Event field value if set, zero value otherwise. +func (o *EventResponse) GetEvent() EventResponseEvent { + if o == nil || o.Event == nil { + var ret EventResponseEvent + return ret + } + return *o.Event } + +// GetEventOk returns a tuple with the Event field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponse) GetEventOk() (*EventResponseEvent, bool) { + if o == nil || o.Event == nil { + return nil, false + } + return o.Event, true +} + +// HasEvent returns a boolean if a field has been set. +func (o *EventResponse) HasEvent() bool { + if o != nil && o.Event != nil { + return true + } + + return false +} + +// SetEvent gets a reference to the given EventResponseEvent and assigns it to the Event field. +func (o *EventResponse) SetEvent(v EventResponseEvent) { + o.Event = &v +} + +func (o EventResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.GeneratedUuid != nil { + toSerialize["generated_uuid"] = o.GeneratedUuid + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.Event != nil { + toSerialize["event"] = o.Event + } + return json.Marshal(toSerialize) +} + +type NullableEventResponse struct { + value *EventResponse + isSet bool +} + +func (v NullableEventResponse) Get() *EventResponse { + return v.value +} + +func (v *NullableEventResponse) Set(val *EventResponse) { + v.value = val + v.isSet = true +} + +func (v NullableEventResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableEventResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventResponse(val *EventResponse) *NullableEventResponse { + return &NullableEventResponse{value: val, isSet: true} +} + +func (v NullableEventResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_response_event.go b/.gen/anchore/model_event_response_event.go index 9e24e939dc..4663790bce 100644 --- a/.gen/anchore/model_event_response_event.go +++ b/.gen/anchore/model_event_response_event.go @@ -1,25 +1,369 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // EventResponseEvent struct for EventResponseEvent type EventResponseEvent struct { - Source EventResponseEventSource `json:"source,omitempty"` - Resource EventResponseEventResource `json:"resource,omitempty"` - Type string `json:"type,omitempty"` - Level string `json:"level,omitempty"` - Message string `json:"message,omitempty"` + Source *EventResponseEventSource `json:"source,omitempty"` + Resource *EventResponseEventResource `json:"resource,omitempty"` + Type *string `json:"type,omitempty"` + Category *string `json:"category,omitempty"` + Level *string `json:"level,omitempty"` + Message *string `json:"message,omitempty"` Details map[string]interface{} `json:"details,omitempty"` - Timestamp time.Time `json:"timestamp,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewEventResponseEvent instantiates a new EventResponseEvent 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 NewEventResponseEvent() *EventResponseEvent { + this := EventResponseEvent{} + return &this +} + +// NewEventResponseEventWithDefaults instantiates a new EventResponseEvent 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 NewEventResponseEventWithDefaults() *EventResponseEvent { + this := EventResponseEvent{} + return &this +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *EventResponseEvent) GetSource() EventResponseEventSource { + if o == nil || o.Source == nil { + var ret EventResponseEventSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetSourceOk() (*EventResponseEventSource, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *EventResponseEvent) HasSource() bool { + if o != nil && o.Source != nil { + return true + } + + return false +} + +// SetSource gets a reference to the given EventResponseEventSource and assigns it to the Source field. +func (o *EventResponseEvent) SetSource(v EventResponseEventSource) { + o.Source = &v +} + +// GetResource returns the Resource field value if set, zero value otherwise. +func (o *EventResponseEvent) GetResource() EventResponseEventResource { + if o == nil || o.Resource == nil { + var ret EventResponseEventResource + return ret + } + return *o.Resource +} + +// GetResourceOk returns a tuple with the Resource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetResourceOk() (*EventResponseEventResource, bool) { + if o == nil || o.Resource == nil { + return nil, false + } + return o.Resource, true +} + +// HasResource returns a boolean if a field has been set. +func (o *EventResponseEvent) HasResource() bool { + if o != nil && o.Resource != nil { + return true + } + + return false +} + +// SetResource gets a reference to the given EventResponseEventResource and assigns it to the Resource field. +func (o *EventResponseEvent) SetResource(v EventResponseEventResource) { + o.Resource = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *EventResponseEvent) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *EventResponseEvent) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *EventResponseEvent) SetType(v string) { + o.Type = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *EventResponseEvent) GetCategory() string { + if o == nil || o.Category == nil { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetCategoryOk() (*string, bool) { + if o == nil || o.Category == nil { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *EventResponseEvent) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *EventResponseEvent) SetCategory(v string) { + o.Category = &v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *EventResponseEvent) GetLevel() string { + if o == nil || o.Level == nil { + var ret string + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetLevelOk() (*string, bool) { + if o == nil || o.Level == nil { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *EventResponseEvent) HasLevel() bool { + if o != nil && o.Level != nil { + return true + } + + return false +} + +// SetLevel gets a reference to the given string and assigns it to the Level field. +func (o *EventResponseEvent) SetLevel(v string) { + o.Level = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *EventResponseEvent) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *EventResponseEvent) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *EventResponseEvent) SetMessage(v string) { + o.Message = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *EventResponseEvent) GetDetails() map[string]interface{} { + if o == nil || o.Details == nil { + var ret map[string]interface{} + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetDetailsOk() (map[string]interface{}, bool) { + if o == nil || o.Details == nil { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *EventResponseEvent) HasDetails() bool { + if o != nil && o.Details != nil { + return true + } + + return false +} + +// SetDetails gets a reference to the given map[string]interface{} and assigns it to the Details field. +func (o *EventResponseEvent) SetDetails(v map[string]interface{}) { + o.Details = v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *EventResponseEvent) GetTimestamp() time.Time { + if o == nil || o.Timestamp == nil { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEvent) GetTimestampOk() (*time.Time, bool) { + if o == nil || o.Timestamp == nil { + return nil, false + } + return o.Timestamp, true } + +// HasTimestamp returns a boolean if a field has been set. +func (o *EventResponseEvent) HasTimestamp() bool { + if o != nil && o.Timestamp != nil { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *EventResponseEvent) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o EventResponseEvent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Source != nil { + toSerialize["source"] = o.Source + } + if o.Resource != nil { + toSerialize["resource"] = o.Resource + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Category != nil { + toSerialize["category"] = o.Category + } + if o.Level != nil { + toSerialize["level"] = o.Level + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Details != nil { + toSerialize["details"] = o.Details + } + if o.Timestamp != nil { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableEventResponseEvent struct { + value *EventResponseEvent + isSet bool +} + +func (v NullableEventResponseEvent) Get() *EventResponseEvent { + return v.value +} + +func (v *NullableEventResponseEvent) Set(val *EventResponseEvent) { + v.value = val + v.isSet = true +} + +func (v NullableEventResponseEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableEventResponseEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventResponseEvent(val *EventResponseEvent) *NullableEventResponseEvent { + return &NullableEventResponseEvent{value: val, isSet: true} +} + +func (v NullableEventResponseEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventResponseEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_response_event_resource.go b/.gen/anchore/model_event_response_event_resource.go index e355b3aaff..cf139e449e 100644 --- a/.gen/anchore/model_event_response_event_resource.go +++ b/.gen/anchore/model_event_response_event_resource.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // EventResponseEventResource struct for EventResponseEventResource type EventResponseEventResource struct { - UserId string `json:"user_id,omitempty"` - Id string `json:"id,omitempty"` - Type string `json:"type,omitempty"` + UserId *string `json:"user_id,omitempty"` + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` +} + +// NewEventResponseEventResource instantiates a new EventResponseEventResource 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 NewEventResponseEventResource() *EventResponseEventResource { + this := EventResponseEventResource{} + return &this +} + +// NewEventResponseEventResourceWithDefaults instantiates a new EventResponseEventResource 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 NewEventResponseEventResourceWithDefaults() *EventResponseEventResource { + this := EventResponseEventResource{} + return &this +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *EventResponseEventResource) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventResource) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *EventResponseEventResource) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *EventResponseEventResource) SetUserId(v string) { + o.UserId = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *EventResponseEventResource) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventResource) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *EventResponseEventResource) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *EventResponseEventResource) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *EventResponseEventResource) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type } + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventResource) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *EventResponseEventResource) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *EventResponseEventResource) SetType(v string) { + o.Type = &v +} + +func (o EventResponseEventResource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UserId != nil { + toSerialize["user_id"] = o.UserId + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableEventResponseEventResource struct { + value *EventResponseEventResource + isSet bool +} + +func (v NullableEventResponseEventResource) Get() *EventResponseEventResource { + return v.value +} + +func (v *NullableEventResponseEventResource) Set(val *EventResponseEventResource) { + v.value = val + v.isSet = true +} + +func (v NullableEventResponseEventResource) IsSet() bool { + return v.isSet +} + +func (v *NullableEventResponseEventResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventResponseEventResource(val *EventResponseEventResource) *NullableEventResponseEventResource { + return &NullableEventResponseEventResource{value: val, isSet: true} +} + +func (v NullableEventResponseEventResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventResponseEventResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_response_event_source.go b/.gen/anchore/model_event_response_event_source.go index 27cff42828..aafaae32a7 100644 --- a/.gen/anchore/model_event_response_event_source.go +++ b/.gen/anchore/model_event_response_event_source.go @@ -1,19 +1,224 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // EventResponseEventSource struct for EventResponseEventSource type EventResponseEventSource struct { - Servicename string `json:"servicename,omitempty"` - Hostid string `json:"hostid,omitempty"` - BaseUrl string `json:"base_url,omitempty"` - RequestId string `json:"request_id,omitempty"` + Servicename *string `json:"servicename,omitempty"` + Hostid *string `json:"hostid,omitempty"` + BaseUrl *string `json:"base_url,omitempty"` + RequestId *string `json:"request_id,omitempty"` +} + +// NewEventResponseEventSource instantiates a new EventResponseEventSource 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 NewEventResponseEventSource() *EventResponseEventSource { + this := EventResponseEventSource{} + return &this +} + +// NewEventResponseEventSourceWithDefaults instantiates a new EventResponseEventSource 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 NewEventResponseEventSourceWithDefaults() *EventResponseEventSource { + this := EventResponseEventSource{} + return &this +} + +// GetServicename returns the Servicename field value if set, zero value otherwise. +func (o *EventResponseEventSource) GetServicename() string { + if o == nil || o.Servicename == nil { + var ret string + return ret + } + return *o.Servicename +} + +// GetServicenameOk returns a tuple with the Servicename field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventSource) GetServicenameOk() (*string, bool) { + if o == nil || o.Servicename == nil { + return nil, false + } + return o.Servicename, true +} + +// HasServicename returns a boolean if a field has been set. +func (o *EventResponseEventSource) HasServicename() bool { + if o != nil && o.Servicename != nil { + return true + } + + return false +} + +// SetServicename gets a reference to the given string and assigns it to the Servicename field. +func (o *EventResponseEventSource) SetServicename(v string) { + o.Servicename = &v +} + +// GetHostid returns the Hostid field value if set, zero value otherwise. +func (o *EventResponseEventSource) GetHostid() string { + if o == nil || o.Hostid == nil { + var ret string + return ret + } + return *o.Hostid +} + +// GetHostidOk returns a tuple with the Hostid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventSource) GetHostidOk() (*string, bool) { + if o == nil || o.Hostid == nil { + return nil, false + } + return o.Hostid, true +} + +// HasHostid returns a boolean if a field has been set. +func (o *EventResponseEventSource) HasHostid() bool { + if o != nil && o.Hostid != nil { + return true + } + + return false +} + +// SetHostid gets a reference to the given string and assigns it to the Hostid field. +func (o *EventResponseEventSource) SetHostid(v string) { + o.Hostid = &v +} + +// GetBaseUrl returns the BaseUrl field value if set, zero value otherwise. +func (o *EventResponseEventSource) GetBaseUrl() string { + if o == nil || o.BaseUrl == nil { + var ret string + return ret + } + return *o.BaseUrl +} + +// GetBaseUrlOk returns a tuple with the BaseUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventSource) GetBaseUrlOk() (*string, bool) { + if o == nil || o.BaseUrl == nil { + return nil, false + } + return o.BaseUrl, true +} + +// HasBaseUrl returns a boolean if a field has been set. +func (o *EventResponseEventSource) HasBaseUrl() bool { + if o != nil && o.BaseUrl != nil { + return true + } + + return false +} + +// SetBaseUrl gets a reference to the given string and assigns it to the BaseUrl field. +func (o *EventResponseEventSource) SetBaseUrl(v string) { + o.BaseUrl = &v +} + +// GetRequestId returns the RequestId field value if set, zero value otherwise. +func (o *EventResponseEventSource) GetRequestId() string { + if o == nil || o.RequestId == nil { + var ret string + return ret + } + return *o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventResponseEventSource) GetRequestIdOk() (*string, bool) { + if o == nil || o.RequestId == nil { + return nil, false + } + return o.RequestId, true +} + +// HasRequestId returns a boolean if a field has been set. +func (o *EventResponseEventSource) HasRequestId() bool { + if o != nil && o.RequestId != nil { + return true + } + + return false +} + +// SetRequestId gets a reference to the given string and assigns it to the RequestId field. +func (o *EventResponseEventSource) SetRequestId(v string) { + o.RequestId = &v +} + +func (o EventResponseEventSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Servicename != nil { + toSerialize["servicename"] = o.Servicename + } + if o.Hostid != nil { + toSerialize["hostid"] = o.Hostid + } + if o.BaseUrl != nil { + toSerialize["base_url"] = o.BaseUrl + } + if o.RequestId != nil { + toSerialize["request_id"] = o.RequestId + } + return json.Marshal(toSerialize) +} + +type NullableEventResponseEventSource struct { + value *EventResponseEventSource + isSet bool } + +func (v NullableEventResponseEventSource) Get() *EventResponseEventSource { + return v.value +} + +func (v *NullableEventResponseEventSource) Set(val *EventResponseEventSource) { + v.value = val + v.isSet = true +} + +func (v NullableEventResponseEventSource) IsSet() bool { + return v.isSet +} + +func (v *NullableEventResponseEventSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventResponseEventSource(val *EventResponseEventSource) *NullableEventResponseEventSource { + return &NullableEventResponseEventSource{value: val, isSet: true} +} + +func (v NullableEventResponseEventSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventResponseEventSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_event_subcategory.go b/.gen/anchore/model_event_subcategory.go new file mode 100644 index 0000000000..2fc3cc9a8b --- /dev/null +++ b/.gen/anchore/model_event_subcategory.go @@ -0,0 +1,188 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// EventSubcategory A collection of events related to each other +type EventSubcategory struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Events []EventDescription `json:"events,omitempty"` +} + +// NewEventSubcategory instantiates a new EventSubcategory 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 NewEventSubcategory() *EventSubcategory { + this := EventSubcategory{} + return &this +} + +// NewEventSubcategoryWithDefaults instantiates a new EventSubcategory 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 NewEventSubcategoryWithDefaults() *EventSubcategory { + this := EventSubcategory{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *EventSubcategory) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventSubcategory) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *EventSubcategory) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *EventSubcategory) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *EventSubcategory) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventSubcategory) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *EventSubcategory) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *EventSubcategory) SetDescription(v string) { + o.Description = &v +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *EventSubcategory) GetEvents() []EventDescription { + if o == nil || o.Events == nil { + var ret []EventDescription + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventSubcategory) GetEventsOk() ([]EventDescription, bool) { + if o == nil || o.Events == nil { + return nil, false + } + return o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *EventSubcategory) HasEvents() bool { + if o != nil && o.Events != nil { + return true + } + + return false +} + +// SetEvents gets a reference to the given []EventDescription and assigns it to the Events field. +func (o *EventSubcategory) SetEvents(v []EventDescription) { + o.Events = v +} + +func (o EventSubcategory) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Events != nil { + toSerialize["events"] = o.Events + } + return json.Marshal(toSerialize) +} + +type NullableEventSubcategory struct { + value *EventSubcategory + isSet bool +} + +func (v NullableEventSubcategory) Get() *EventSubcategory { + return v.value +} + +func (v *NullableEventSubcategory) Set(val *EventSubcategory) { + v.value = val + v.isSet = true +} + +func (v NullableEventSubcategory) IsSet() bool { + return v.isSet +} + +func (v *NullableEventSubcategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventSubcategory(val *EventSubcategory) *NullableEventSubcategory { + return &NullableEventSubcategory{value: val, isSet: true} +} + +func (v NullableEventSubcategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventSubcategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_events_list.go b/.gen/anchore/model_events_list.go index fb2f3cca90..2c75fd260c 100644 --- a/.gen/anchore/model_events_list.go +++ b/.gen/anchore/model_events_list.go @@ -1,23 +1,228 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // EventsList Response envelope for paginated listing of events type EventsList struct { // List of events Results []EventResponse `json:"results,omitempty"` // Boolean flag, True indicates there are more events and False otherwise - NextPage bool `json:"next_page,omitempty"` + NextPage *bool `json:"next_page,omitempty"` // Number of events in this page - ItemCount int32 `json:"item_count,omitempty"` + ItemCount *int32 `json:"item_count,omitempty"` // Page number of this result set - Page int32 `json:"page,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewEventsList instantiates a new EventsList 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 NewEventsList() *EventsList { + this := EventsList{} + return &this +} + +// NewEventsListWithDefaults instantiates a new EventsList 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 NewEventsListWithDefaults() *EventsList { + this := EventsList{} + return &this +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *EventsList) GetResults() []EventResponse { + if o == nil || o.Results == nil { + var ret []EventResponse + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventsList) GetResultsOk() ([]EventResponse, bool) { + if o == nil || o.Results == nil { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *EventsList) HasResults() bool { + if o != nil && o.Results != nil { + return true + } + + return false +} + +// SetResults gets a reference to the given []EventResponse and assigns it to the Results field. +func (o *EventsList) SetResults(v []EventResponse) { + o.Results = v +} + +// GetNextPage returns the NextPage field value if set, zero value otherwise. +func (o *EventsList) GetNextPage() bool { + if o == nil || o.NextPage == nil { + var ret bool + return ret + } + return *o.NextPage +} + +// GetNextPageOk returns a tuple with the NextPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventsList) GetNextPageOk() (*bool, bool) { + if o == nil || o.NextPage == nil { + return nil, false + } + return o.NextPage, true +} + +// HasNextPage returns a boolean if a field has been set. +func (o *EventsList) HasNextPage() bool { + if o != nil && o.NextPage != nil { + return true + } + + return false +} + +// SetNextPage gets a reference to the given bool and assigns it to the NextPage field. +func (o *EventsList) SetNextPage(v bool) { + o.NextPage = &v +} + +// GetItemCount returns the ItemCount field value if set, zero value otherwise. +func (o *EventsList) GetItemCount() int32 { + if o == nil || o.ItemCount == nil { + var ret int32 + return ret + } + return *o.ItemCount +} + +// GetItemCountOk returns a tuple with the ItemCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventsList) GetItemCountOk() (*int32, bool) { + if o == nil || o.ItemCount == nil { + return nil, false + } + return o.ItemCount, true +} + +// HasItemCount returns a boolean if a field has been set. +func (o *EventsList) HasItemCount() bool { + if o != nil && o.ItemCount != nil { + return true + } + + return false +} + +// SetItemCount gets a reference to the given int32 and assigns it to the ItemCount field. +func (o *EventsList) SetItemCount(v int32) { + o.ItemCount = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *EventsList) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventsList) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *EventsList) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *EventsList) SetPage(v int32) { + o.Page = &v +} + +func (o EventsList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Results != nil { + toSerialize["results"] = o.Results + } + if o.NextPage != nil { + toSerialize["next_page"] = o.NextPage + } + if o.ItemCount != nil { + toSerialize["item_count"] = o.ItemCount + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableEventsList struct { + value *EventsList + isSet bool } + +func (v NullableEventsList) Get() *EventsList { + return v.value +} + +func (v *NullableEventsList) Set(val *EventsList) { + v.value = val + v.isSet = true +} + +func (v NullableEventsList) IsSet() bool { + return v.isSet +} + +func (v *NullableEventsList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventsList(val *EventsList) *NullableEventsList { + return &NullableEventsList{value: val, isSet: true} +} + +func (v NullableEventsList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventsList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_feed_group_metadata.go b/.gen/anchore/model_feed_group_metadata.go index 8b8544ff82..b25a6a1aa3 100644 --- a/.gen/anchore/model_feed_group_metadata.go +++ b/.gen/anchore/model_feed_group_metadata.go @@ -1,22 +1,225 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // FeedGroupMetadata struct for FeedGroupMetadata type FeedGroupMetadata struct { - Name string `json:"name,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - LastSync time.Time `json:"last_sync,omitempty"` - RecordCount int32 `json:"record_count,omitempty"` + Name *string `json:"name,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastSync *time.Time `json:"last_sync,omitempty"` + RecordCount *int32 `json:"record_count,omitempty"` +} + +// NewFeedGroupMetadata instantiates a new FeedGroupMetadata 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 NewFeedGroupMetadata() *FeedGroupMetadata { + this := FeedGroupMetadata{} + return &this +} + +// NewFeedGroupMetadataWithDefaults instantiates a new FeedGroupMetadata 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 NewFeedGroupMetadataWithDefaults() *FeedGroupMetadata { + this := FeedGroupMetadata{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *FeedGroupMetadata) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedGroupMetadata) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *FeedGroupMetadata) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *FeedGroupMetadata) SetName(v string) { + o.Name = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *FeedGroupMetadata) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedGroupMetadata) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *FeedGroupMetadata) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *FeedGroupMetadata) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastSync returns the LastSync field value if set, zero value otherwise. +func (o *FeedGroupMetadata) GetLastSync() time.Time { + if o == nil || o.LastSync == nil { + var ret time.Time + return ret + } + return *o.LastSync +} + +// GetLastSyncOk returns a tuple with the LastSync field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedGroupMetadata) GetLastSyncOk() (*time.Time, bool) { + if o == nil || o.LastSync == nil { + return nil, false + } + return o.LastSync, true +} + +// HasLastSync returns a boolean if a field has been set. +func (o *FeedGroupMetadata) HasLastSync() bool { + if o != nil && o.LastSync != nil { + return true + } + + return false +} + +// SetLastSync gets a reference to the given time.Time and assigns it to the LastSync field. +func (o *FeedGroupMetadata) SetLastSync(v time.Time) { + o.LastSync = &v +} + +// GetRecordCount returns the RecordCount field value if set, zero value otherwise. +func (o *FeedGroupMetadata) GetRecordCount() int32 { + if o == nil || o.RecordCount == nil { + var ret int32 + return ret + } + return *o.RecordCount +} + +// GetRecordCountOk returns a tuple with the RecordCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedGroupMetadata) GetRecordCountOk() (*int32, bool) { + if o == nil || o.RecordCount == nil { + return nil, false + } + return o.RecordCount, true +} + +// HasRecordCount returns a boolean if a field has been set. +func (o *FeedGroupMetadata) HasRecordCount() bool { + if o != nil && o.RecordCount != nil { + return true + } + + return false +} + +// SetRecordCount gets a reference to the given int32 and assigns it to the RecordCount field. +func (o *FeedGroupMetadata) SetRecordCount(v int32) { + o.RecordCount = &v +} + +func (o FeedGroupMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastSync != nil { + toSerialize["last_sync"] = o.LastSync + } + if o.RecordCount != nil { + toSerialize["record_count"] = o.RecordCount + } + return json.Marshal(toSerialize) +} + +type NullableFeedGroupMetadata struct { + value *FeedGroupMetadata + isSet bool } + +func (v NullableFeedGroupMetadata) Get() *FeedGroupMetadata { + return v.value +} + +func (v *NullableFeedGroupMetadata) Set(val *FeedGroupMetadata) { + v.value = val + v.isSet = true +} + +func (v NullableFeedGroupMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableFeedGroupMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeedGroupMetadata(val *FeedGroupMetadata) *NullableFeedGroupMetadata { + return &NullableFeedGroupMetadata{value: val, isSet: true} +} + +func (v NullableFeedGroupMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeedGroupMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_feed_metadata.go b/.gen/anchore/model_feed_metadata.go index 491b167b66..cc4e737154 100644 --- a/.gen/anchore/model_feed_metadata.go +++ b/.gen/anchore/model_feed_metadata.go @@ -1,26 +1,264 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // FeedMetadata Metadata on a single feed based on what the engine finds from querying the endpoints type FeedMetadata struct { // name of the feed - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Date the metadata record was created in engine (first seen on source) - CreatedAt time.Time `json:"created_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` // Date the metadata was last updated - UpdatedAt time.Time `json:"updated_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` Groups []FeedGroupMetadata `json:"groups,omitempty"` - LastFullSync time.Time `json:"last_full_sync,omitempty"` + LastFullSync *time.Time `json:"last_full_sync,omitempty"` +} + +// NewFeedMetadata instantiates a new FeedMetadata 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 NewFeedMetadata() *FeedMetadata { + this := FeedMetadata{} + return &this +} + +// NewFeedMetadataWithDefaults instantiates a new FeedMetadata 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 NewFeedMetadataWithDefaults() *FeedMetadata { + this := FeedMetadata{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *FeedMetadata) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedMetadata) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *FeedMetadata) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *FeedMetadata) SetName(v string) { + o.Name = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *FeedMetadata) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedMetadata) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *FeedMetadata) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *FeedMetadata) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *FeedMetadata) GetUpdatedAt() time.Time { + if o == nil || o.UpdatedAt == nil { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedMetadata) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || o.UpdatedAt == nil { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *FeedMetadata) HasUpdatedAt() bool { + if o != nil && o.UpdatedAt != nil { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *FeedMetadata) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *FeedMetadata) GetGroups() []FeedGroupMetadata { + if o == nil || o.Groups == nil { + var ret []FeedGroupMetadata + return ret + } + return o.Groups } + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedMetadata) GetGroupsOk() ([]FeedGroupMetadata, bool) { + if o == nil || o.Groups == nil { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *FeedMetadata) HasGroups() bool { + if o != nil && o.Groups != nil { + return true + } + + return false +} + +// SetGroups gets a reference to the given []FeedGroupMetadata and assigns it to the Groups field. +func (o *FeedMetadata) SetGroups(v []FeedGroupMetadata) { + o.Groups = v +} + +// GetLastFullSync returns the LastFullSync field value if set, zero value otherwise. +func (o *FeedMetadata) GetLastFullSync() time.Time { + if o == nil || o.LastFullSync == nil { + var ret time.Time + return ret + } + return *o.LastFullSync +} + +// GetLastFullSyncOk returns a tuple with the LastFullSync field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedMetadata) GetLastFullSyncOk() (*time.Time, bool) { + if o == nil || o.LastFullSync == nil { + return nil, false + } + return o.LastFullSync, true +} + +// HasLastFullSync returns a boolean if a field has been set. +func (o *FeedMetadata) HasLastFullSync() bool { + if o != nil && o.LastFullSync != nil { + return true + } + + return false +} + +// SetLastFullSync gets a reference to the given time.Time and assigns it to the LastFullSync field. +func (o *FeedMetadata) SetLastFullSync(v time.Time) { + o.LastFullSync = &v +} + +func (o FeedMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.UpdatedAt != nil { + toSerialize["updated_at"] = o.UpdatedAt + } + if o.Groups != nil { + toSerialize["groups"] = o.Groups + } + if o.LastFullSync != nil { + toSerialize["last_full_sync"] = o.LastFullSync + } + return json.Marshal(toSerialize) +} + +type NullableFeedMetadata struct { + value *FeedMetadata + isSet bool +} + +func (v NullableFeedMetadata) Get() *FeedMetadata { + return v.value +} + +func (v *NullableFeedMetadata) Set(val *FeedMetadata) { + v.value = val + v.isSet = true +} + +func (v NullableFeedMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableFeedMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeedMetadata(val *FeedMetadata) *NullableFeedMetadata { + return &NullableFeedMetadata{value: val, isSet: true} +} + +func (v NullableFeedMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeedMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_feed_sync_result.go b/.gen/anchore/model_feed_sync_result.go index 9a0cc28507..7b03b82eb2 100644 --- a/.gen/anchore/model_feed_sync_result.go +++ b/.gen/anchore/model_feed_sync_result.go @@ -1,23 +1,228 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // FeedSyncResult The result of a sync of a single feed type FeedSyncResult struct { // The name of the feed synced - Feed string `json:"feed,omitempty"` + Feed *string `json:"feed,omitempty"` // The result of the sync operations, either co - Status string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` // The duratin, in seconds, of the sync of the feed, the sum of all the group syncs - TotalTimeSeconds float32 `json:"total_time_seconds,omitempty"` + TotalTimeSeconds *float32 `json:"total_time_seconds,omitempty"` // Array of group sync results Groups []GroupSyncResult `json:"groups,omitempty"` } + +// NewFeedSyncResult instantiates a new FeedSyncResult 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 NewFeedSyncResult() *FeedSyncResult { + this := FeedSyncResult{} + return &this +} + +// NewFeedSyncResultWithDefaults instantiates a new FeedSyncResult 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 NewFeedSyncResultWithDefaults() *FeedSyncResult { + this := FeedSyncResult{} + return &this +} + +// GetFeed returns the Feed field value if set, zero value otherwise. +func (o *FeedSyncResult) GetFeed() string { + if o == nil || o.Feed == nil { + var ret string + return ret + } + return *o.Feed +} + +// GetFeedOk returns a tuple with the Feed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedSyncResult) GetFeedOk() (*string, bool) { + if o == nil || o.Feed == nil { + return nil, false + } + return o.Feed, true +} + +// HasFeed returns a boolean if a field has been set. +func (o *FeedSyncResult) HasFeed() bool { + if o != nil && o.Feed != nil { + return true + } + + return false +} + +// SetFeed gets a reference to the given string and assigns it to the Feed field. +func (o *FeedSyncResult) SetFeed(v string) { + o.Feed = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *FeedSyncResult) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedSyncResult) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *FeedSyncResult) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *FeedSyncResult) SetStatus(v string) { + o.Status = &v +} + +// GetTotalTimeSeconds returns the TotalTimeSeconds field value if set, zero value otherwise. +func (o *FeedSyncResult) GetTotalTimeSeconds() float32 { + if o == nil || o.TotalTimeSeconds == nil { + var ret float32 + return ret + } + return *o.TotalTimeSeconds +} + +// GetTotalTimeSecondsOk returns a tuple with the TotalTimeSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedSyncResult) GetTotalTimeSecondsOk() (*float32, bool) { + if o == nil || o.TotalTimeSeconds == nil { + return nil, false + } + return o.TotalTimeSeconds, true +} + +// HasTotalTimeSeconds returns a boolean if a field has been set. +func (o *FeedSyncResult) HasTotalTimeSeconds() bool { + if o != nil && o.TotalTimeSeconds != nil { + return true + } + + return false +} + +// SetTotalTimeSeconds gets a reference to the given float32 and assigns it to the TotalTimeSeconds field. +func (o *FeedSyncResult) SetTotalTimeSeconds(v float32) { + o.TotalTimeSeconds = &v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *FeedSyncResult) GetGroups() []GroupSyncResult { + if o == nil || o.Groups == nil { + var ret []GroupSyncResult + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeedSyncResult) GetGroupsOk() ([]GroupSyncResult, bool) { + if o == nil || o.Groups == nil { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *FeedSyncResult) HasGroups() bool { + if o != nil && o.Groups != nil { + return true + } + + return false +} + +// SetGroups gets a reference to the given []GroupSyncResult and assigns it to the Groups field. +func (o *FeedSyncResult) SetGroups(v []GroupSyncResult) { + o.Groups = v +} + +func (o FeedSyncResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Feed != nil { + toSerialize["feed"] = o.Feed + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.TotalTimeSeconds != nil { + toSerialize["total_time_seconds"] = o.TotalTimeSeconds + } + if o.Groups != nil { + toSerialize["groups"] = o.Groups + } + return json.Marshal(toSerialize) +} + +type NullableFeedSyncResult struct { + value *FeedSyncResult + isSet bool +} + +func (v NullableFeedSyncResult) Get() *FeedSyncResult { + return v.value +} + +func (v *NullableFeedSyncResult) Set(val *FeedSyncResult) { + v.value = val + v.isSet = true +} + +func (v NullableFeedSyncResult) IsSet() bool { + return v.isSet +} + +func (v *NullableFeedSyncResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeedSyncResult(val *FeedSyncResult) *NullableFeedSyncResult { + return &NullableFeedSyncResult{value: val, isSet: true} +} + +func (v NullableFeedSyncResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeedSyncResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_file_content_search_result.go b/.gen/anchore/model_file_content_search_result.go new file mode 100644 index 0000000000..abf8b72215 --- /dev/null +++ b/.gen/anchore/model_file_content_search_result.go @@ -0,0 +1,152 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// FileContentSearchResult The retrieved file entry including content (b64 encoded) +type FileContentSearchResult struct { + Path *string `json:"path,omitempty"` + Matches []RegexContentMatch `json:"matches,omitempty"` +} + +// NewFileContentSearchResult instantiates a new FileContentSearchResult 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 NewFileContentSearchResult() *FileContentSearchResult { + this := FileContentSearchResult{} + return &this +} + +// NewFileContentSearchResultWithDefaults instantiates a new FileContentSearchResult 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 NewFileContentSearchResultWithDefaults() *FileContentSearchResult { + this := FileContentSearchResult{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *FileContentSearchResult) GetPath() string { + if o == nil || o.Path == nil { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileContentSearchResult) GetPathOk() (*string, bool) { + if o == nil || o.Path == nil { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *FileContentSearchResult) HasPath() bool { + if o != nil && o.Path != nil { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *FileContentSearchResult) SetPath(v string) { + o.Path = &v +} + +// GetMatches returns the Matches field value if set, zero value otherwise. +func (o *FileContentSearchResult) GetMatches() []RegexContentMatch { + if o == nil || o.Matches == nil { + var ret []RegexContentMatch + return ret + } + return o.Matches +} + +// GetMatchesOk returns a tuple with the Matches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileContentSearchResult) GetMatchesOk() ([]RegexContentMatch, bool) { + if o == nil || o.Matches == nil { + return nil, false + } + return o.Matches, true +} + +// HasMatches returns a boolean if a field has been set. +func (o *FileContentSearchResult) HasMatches() bool { + if o != nil && o.Matches != nil { + return true + } + + return false +} + +// SetMatches gets a reference to the given []RegexContentMatch and assigns it to the Matches field. +func (o *FileContentSearchResult) SetMatches(v []RegexContentMatch) { + o.Matches = v +} + +func (o FileContentSearchResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Path != nil { + toSerialize["path"] = o.Path + } + if o.Matches != nil { + toSerialize["matches"] = o.Matches + } + return json.Marshal(toSerialize) +} + +type NullableFileContentSearchResult struct { + value *FileContentSearchResult + isSet bool +} + +func (v NullableFileContentSearchResult) Get() *FileContentSearchResult { + return v.value +} + +func (v *NullableFileContentSearchResult) Set(val *FileContentSearchResult) { + v.value = val + v.isSet = true +} + +func (v NullableFileContentSearchResult) IsSet() bool { + return v.isSet +} + +func (v *NullableFileContentSearchResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFileContentSearchResult(val *FileContentSearchResult) *NullableFileContentSearchResult { + return &NullableFileContentSearchResult{value: val, isSet: true} +} + +func (v NullableFileContentSearchResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFileContentSearchResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_gate_spec.go b/.gen/anchore/model_gate_spec.go index 5a5dd4b1fb..0c53a0ae9b 100644 --- a/.gen/anchore/model_gate_spec.go +++ b/.gen/anchore/model_gate_spec.go @@ -1,25 +1,275 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // GateSpec A description of the set of gates available in this engine and the triggers and parameters supported type GateSpec struct { // Gate name, as it would appear in a policy document - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Description of the gate - Description string `json:"description,omitempty"` + Description *string `json:"description,omitempty"` // State of the gate and transitively all triggers it contains if not 'active' - State string `json:"state,omitempty"` + State *string `json:"state,omitempty"` // The name of another trigger that supercedes this on functionally if this is deprecated - SupercededBy *string `json:"superceded_by,omitempty"` + SupercededBy NullableString `json:"superceded_by,omitempty"` // List of the triggers that can fire for this Gate Triggers []TriggerSpec `json:"triggers,omitempty"` } + +// NewGateSpec instantiates a new GateSpec 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 NewGateSpec() *GateSpec { + this := GateSpec{} + return &this +} + +// NewGateSpecWithDefaults instantiates a new GateSpec 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 NewGateSpecWithDefaults() *GateSpec { + this := GateSpec{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GateSpec) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GateSpec) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GateSpec) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GateSpec) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GateSpec) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GateSpec) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GateSpec) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GateSpec) SetDescription(v string) { + o.Description = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *GateSpec) GetState() string { + if o == nil || o.State == nil { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GateSpec) GetStateOk() (*string, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *GateSpec) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *GateSpec) SetState(v string) { + o.State = &v +} + +// GetSupercededBy returns the SupercededBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GateSpec) GetSupercededBy() string { + if o == nil || o.SupercededBy.Get() == nil { + var ret string + return ret + } + return *o.SupercededBy.Get() +} + +// GetSupercededByOk returns a tuple with the SupercededBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GateSpec) GetSupercededByOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SupercededBy.Get(), o.SupercededBy.IsSet() +} + +// HasSupercededBy returns a boolean if a field has been set. +func (o *GateSpec) HasSupercededBy() bool { + if o != nil && o.SupercededBy.IsSet() { + return true + } + + return false +} + +// SetSupercededBy gets a reference to the given NullableString and assigns it to the SupercededBy field. +func (o *GateSpec) SetSupercededBy(v string) { + o.SupercededBy.Set(&v) +} +// SetSupercededByNil sets the value for SupercededBy to be an explicit nil +func (o *GateSpec) SetSupercededByNil() { + o.SupercededBy.Set(nil) +} + +// UnsetSupercededBy ensures that no value is present for SupercededBy, not even an explicit nil +func (o *GateSpec) UnsetSupercededBy() { + o.SupercededBy.Unset() +} + +// GetTriggers returns the Triggers field value if set, zero value otherwise. +func (o *GateSpec) GetTriggers() []TriggerSpec { + if o == nil || o.Triggers == nil { + var ret []TriggerSpec + return ret + } + return o.Triggers +} + +// GetTriggersOk returns a tuple with the Triggers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GateSpec) GetTriggersOk() ([]TriggerSpec, bool) { + if o == nil || o.Triggers == nil { + return nil, false + } + return o.Triggers, true +} + +// HasTriggers returns a boolean if a field has been set. +func (o *GateSpec) HasTriggers() bool { + if o != nil && o.Triggers != nil { + return true + } + + return false +} + +// SetTriggers gets a reference to the given []TriggerSpec and assigns it to the Triggers field. +func (o *GateSpec) SetTriggers(v []TriggerSpec) { + o.Triggers = v +} + +func (o GateSpec) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.State != nil { + toSerialize["state"] = o.State + } + if o.SupercededBy.IsSet() { + toSerialize["superceded_by"] = o.SupercededBy.Get() + } + if o.Triggers != nil { + toSerialize["triggers"] = o.Triggers + } + return json.Marshal(toSerialize) +} + +type NullableGateSpec struct { + value *GateSpec + isSet bool +} + +func (v NullableGateSpec) Get() *GateSpec { + return v.value +} + +func (v *NullableGateSpec) Set(val *GateSpec) { + v.value = val + v.isSet = true +} + +func (v NullableGateSpec) IsSet() bool { + return v.isSet +} + +func (v *NullableGateSpec) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGateSpec(val *GateSpec) *NullableGateSpec { + return &NullableGateSpec{value: val, isSet: true} +} + +func (v NullableGateSpec) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGateSpec) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_generic_notification_payload.go b/.gen/anchore/model_generic_notification_payload.go new file mode 100644 index 0000000000..a234b5b401 --- /dev/null +++ b/.gen/anchore/model_generic_notification_payload.go @@ -0,0 +1,224 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// GenericNotificationPayload Parent class for Notification Payloads +type GenericNotificationPayload struct { + UserId *string `json:"userId,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` + NotificationId *string `json:"notificationId,omitempty"` +} + +// NewGenericNotificationPayload instantiates a new GenericNotificationPayload 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 NewGenericNotificationPayload() *GenericNotificationPayload { + this := GenericNotificationPayload{} + return &this +} + +// NewGenericNotificationPayloadWithDefaults instantiates a new GenericNotificationPayload 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 NewGenericNotificationPayloadWithDefaults() *GenericNotificationPayload { + this := GenericNotificationPayload{} + return &this +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *GenericNotificationPayload) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericNotificationPayload) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *GenericNotificationPayload) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *GenericNotificationPayload) SetUserId(v string) { + o.UserId = &v +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *GenericNotificationPayload) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericNotificationPayload) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *GenericNotificationPayload) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *GenericNotificationPayload) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v +} + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *GenericNotificationPayload) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericNotificationPayload) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *GenericNotificationPayload) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *GenericNotificationPayload) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +// GetNotificationId returns the NotificationId field value if set, zero value otherwise. +func (o *GenericNotificationPayload) GetNotificationId() string { + if o == nil || o.NotificationId == nil { + var ret string + return ret + } + return *o.NotificationId +} + +// GetNotificationIdOk returns a tuple with the NotificationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericNotificationPayload) GetNotificationIdOk() (*string, bool) { + if o == nil || o.NotificationId == nil { + return nil, false + } + return o.NotificationId, true +} + +// HasNotificationId returns a boolean if a field has been set. +func (o *GenericNotificationPayload) HasNotificationId() bool { + if o != nil && o.NotificationId != nil { + return true + } + + return false +} + +// SetNotificationId gets a reference to the given string and assigns it to the NotificationId field. +func (o *GenericNotificationPayload) SetNotificationId(v string) { + o.NotificationId = &v +} + +func (o GenericNotificationPayload) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + if o.NotificationId != nil { + toSerialize["notificationId"] = o.NotificationId + } + return json.Marshal(toSerialize) +} + +type NullableGenericNotificationPayload struct { + value *GenericNotificationPayload + isSet bool +} + +func (v NullableGenericNotificationPayload) Get() *GenericNotificationPayload { + return v.value +} + +func (v *NullableGenericNotificationPayload) Set(val *GenericNotificationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableGenericNotificationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericNotificationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericNotificationPayload(val *GenericNotificationPayload) *NullableGenericNotificationPayload { + return &NullableGenericNotificationPayload{value: val, isSet: true} +} + +func (v NullableGenericNotificationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericNotificationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_group_sync_result.go b/.gen/anchore/model_group_sync_result.go index 55d8050e27..c01d87bd50 100644 --- a/.gen/anchore/model_group_sync_result.go +++ b/.gen/anchore/model_group_sync_result.go @@ -1,24 +1,264 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // GroupSyncResult struct for GroupSyncResult type GroupSyncResult struct { // The name of the group - Group string `json:"group,omitempty"` - Status string `json:"status,omitempty"` + Group *string `json:"group,omitempty"` + Status *string `json:"status,omitempty"` // The number of images updated by the this group sync, across all accounts. This is typically only non-zero for vulnerability feeds which update images' vulnerability results during the sync. - UpdatedImageCount int32 `json:"updated_image_count,omitempty"` + UpdatedImageCount *int32 `json:"updated_image_count,omitempty"` // The number of feed data records synced down as either updates or new records - UpdatedRecordCount int32 `json:"updated_record_count,omitempty"` + UpdatedRecordCount *int32 `json:"updated_record_count,omitempty"` // The duration of the group sync in seconds - TotalTimeSeconds float32 `json:"total_time_seconds,omitempty"` + TotalTimeSeconds *float32 `json:"total_time_seconds,omitempty"` +} + +// NewGroupSyncResult instantiates a new GroupSyncResult 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 NewGroupSyncResult() *GroupSyncResult { + this := GroupSyncResult{} + return &this +} + +// NewGroupSyncResultWithDefaults instantiates a new GroupSyncResult 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 NewGroupSyncResultWithDefaults() *GroupSyncResult { + this := GroupSyncResult{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *GroupSyncResult) GetGroup() string { + if o == nil || o.Group == nil { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupSyncResult) GetGroupOk() (*string, bool) { + if o == nil || o.Group == nil { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *GroupSyncResult) HasGroup() bool { + if o != nil && o.Group != nil { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *GroupSyncResult) SetGroup(v string) { + o.Group = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GroupSyncResult) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupSyncResult) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GroupSyncResult) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *GroupSyncResult) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedImageCount returns the UpdatedImageCount field value if set, zero value otherwise. +func (o *GroupSyncResult) GetUpdatedImageCount() int32 { + if o == nil || o.UpdatedImageCount == nil { + var ret int32 + return ret + } + return *o.UpdatedImageCount +} + +// GetUpdatedImageCountOk returns a tuple with the UpdatedImageCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupSyncResult) GetUpdatedImageCountOk() (*int32, bool) { + if o == nil || o.UpdatedImageCount == nil { + return nil, false + } + return o.UpdatedImageCount, true +} + +// HasUpdatedImageCount returns a boolean if a field has been set. +func (o *GroupSyncResult) HasUpdatedImageCount() bool { + if o != nil && o.UpdatedImageCount != nil { + return true + } + + return false +} + +// SetUpdatedImageCount gets a reference to the given int32 and assigns it to the UpdatedImageCount field. +func (o *GroupSyncResult) SetUpdatedImageCount(v int32) { + o.UpdatedImageCount = &v +} + +// GetUpdatedRecordCount returns the UpdatedRecordCount field value if set, zero value otherwise. +func (o *GroupSyncResult) GetUpdatedRecordCount() int32 { + if o == nil || o.UpdatedRecordCount == nil { + var ret int32 + return ret + } + return *o.UpdatedRecordCount } + +// GetUpdatedRecordCountOk returns a tuple with the UpdatedRecordCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupSyncResult) GetUpdatedRecordCountOk() (*int32, bool) { + if o == nil || o.UpdatedRecordCount == nil { + return nil, false + } + return o.UpdatedRecordCount, true +} + +// HasUpdatedRecordCount returns a boolean if a field has been set. +func (o *GroupSyncResult) HasUpdatedRecordCount() bool { + if o != nil && o.UpdatedRecordCount != nil { + return true + } + + return false +} + +// SetUpdatedRecordCount gets a reference to the given int32 and assigns it to the UpdatedRecordCount field. +func (o *GroupSyncResult) SetUpdatedRecordCount(v int32) { + o.UpdatedRecordCount = &v +} + +// GetTotalTimeSeconds returns the TotalTimeSeconds field value if set, zero value otherwise. +func (o *GroupSyncResult) GetTotalTimeSeconds() float32 { + if o == nil || o.TotalTimeSeconds == nil { + var ret float32 + return ret + } + return *o.TotalTimeSeconds +} + +// GetTotalTimeSecondsOk returns a tuple with the TotalTimeSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupSyncResult) GetTotalTimeSecondsOk() (*float32, bool) { + if o == nil || o.TotalTimeSeconds == nil { + return nil, false + } + return o.TotalTimeSeconds, true +} + +// HasTotalTimeSeconds returns a boolean if a field has been set. +func (o *GroupSyncResult) HasTotalTimeSeconds() bool { + if o != nil && o.TotalTimeSeconds != nil { + return true + } + + return false +} + +// SetTotalTimeSeconds gets a reference to the given float32 and assigns it to the TotalTimeSeconds field. +func (o *GroupSyncResult) SetTotalTimeSeconds(v float32) { + o.TotalTimeSeconds = &v +} + +func (o GroupSyncResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Group != nil { + toSerialize["group"] = o.Group + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.UpdatedImageCount != nil { + toSerialize["updated_image_count"] = o.UpdatedImageCount + } + if o.UpdatedRecordCount != nil { + toSerialize["updated_record_count"] = o.UpdatedRecordCount + } + if o.TotalTimeSeconds != nil { + toSerialize["total_time_seconds"] = o.TotalTimeSeconds + } + return json.Marshal(toSerialize) +} + +type NullableGroupSyncResult struct { + value *GroupSyncResult + isSet bool +} + +func (v NullableGroupSyncResult) Get() *GroupSyncResult { + return v.value +} + +func (v *NullableGroupSyncResult) Set(val *GroupSyncResult) { + v.value = val + v.isSet = true +} + +func (v NullableGroupSyncResult) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupSyncResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupSyncResult(val *GroupSyncResult) *NullableGroupSyncResult { + return &NullableGroupSyncResult{value: val, isSet: true} +} + +func (v NullableGroupSyncResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupSyncResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_analysis_request.go b/.gen/anchore/model_image_analysis_request.go index 4ff75ab3d1..f142866dcd 100644 --- a/.gen/anchore/model_image_analysis_request.go +++ b/.gen/anchore/model_image_analysis_request.go @@ -1,31 +1,339 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // ImageAnalysisRequest A request to add an image to be watched and analyzed by the engine. Optionally include the dockerfile content. Either source, digest or tag must be present. type ImageAnalysisRequest struct { // Base64 encoded content of the dockerfile for the image, if available. Deprecated in favor of the 'source' field. - Dockerfile string `json:"dockerfile,omitempty"` + Dockerfile *string `json:"dockerfile,omitempty"` // A digest string for an image, maybe a pull string or just a digest. e.g. nginx@sha256:123 or sha256:abc123. If a pull string, it must have same regisry/repo as the tag field. Deprecated in favor of the 'source' field - Digest string `json:"digest,omitempty"` + Digest *string `json:"digest,omitempty"` // Full pullable tag reference for image. e.g. docker.io/nginx:latest. Deprecated in favor of the 'source' field - Tag string `json:"tag,omitempty"` + Tag *string `json:"tag,omitempty"` // Optional override of the image creation time, only honored when both tag and digest are also supplied e.g. 2018-10-17T18:14:00Z. Deprecated in favor of the 'source' field - CreatedAt time.Time `json:"created_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` // Optional. The type of image this is adding, defaults to \"docker\". This can be ommitted until multiple image types are supported. - ImageType string `json:"image_type,omitempty"` + ImageType *string `json:"image_type,omitempty"` // Annotations to be associated with the added image in key/value form Annotations map[string]interface{} `json:"annotations,omitempty"` - Source ImageSource `json:"source,omitempty"` + Source *ImageSource `json:"source,omitempty"` +} + +// NewImageAnalysisRequest instantiates a new ImageAnalysisRequest 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 NewImageAnalysisRequest() *ImageAnalysisRequest { + this := ImageAnalysisRequest{} + return &this +} + +// NewImageAnalysisRequestWithDefaults instantiates a new ImageAnalysisRequest 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 NewImageAnalysisRequestWithDefaults() *ImageAnalysisRequest { + this := ImageAnalysisRequest{} + return &this +} + +// GetDockerfile returns the Dockerfile field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetDockerfile() string { + if o == nil || o.Dockerfile == nil { + var ret string + return ret + } + return *o.Dockerfile +} + +// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAnalysisRequest) GetDockerfileOk() (*string, bool) { + if o == nil || o.Dockerfile == nil { + return nil, false + } + return o.Dockerfile, true +} + +// HasDockerfile returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasDockerfile() bool { + if o != nil && o.Dockerfile != nil { + return true + } + + return false +} + +// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field. +func (o *ImageAnalysisRequest) SetDockerfile(v string) { + o.Dockerfile = &v +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAnalysisRequest) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *ImageAnalysisRequest) SetDigest(v string) { + o.Digest = &v +} + +// GetTag returns the Tag field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetTag() string { + if o == nil || o.Tag == nil { + var ret string + return ret + } + return *o.Tag +} + +// GetTagOk returns a tuple with the Tag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAnalysisRequest) GetTagOk() (*string, bool) { + if o == nil || o.Tag == nil { + return nil, false + } + return o.Tag, true +} + +// HasTag returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasTag() bool { + if o != nil && o.Tag != nil { + return true + } + + return false +} + +// SetTag gets a reference to the given string and assigns it to the Tag field. +func (o *ImageAnalysisRequest) SetTag(v string) { + o.Tag = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAnalysisRequest) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageAnalysisRequest) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetImageType returns the ImageType field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetImageType() string { + if o == nil || o.ImageType == nil { + var ret string + return ret + } + return *o.ImageType } + +// GetImageTypeOk returns a tuple with the ImageType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAnalysisRequest) GetImageTypeOk() (*string, bool) { + if o == nil || o.ImageType == nil { + return nil, false + } + return o.ImageType, true +} + +// HasImageType returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasImageType() bool { + if o != nil && o.ImageType != nil { + return true + } + + return false +} + +// SetImageType gets a reference to the given string and assigns it to the ImageType field. +func (o *ImageAnalysisRequest) SetImageType(v string) { + o.ImageType = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetAnnotations() map[string]interface{} { + if o == nil || o.Annotations == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// 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 *ImageAnalysisRequest) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *ImageAnalysisRequest) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *ImageAnalysisRequest) GetSource() ImageSource { + if o == nil || o.Source == nil { + var ret ImageSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAnalysisRequest) GetSourceOk() (*ImageSource, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *ImageAnalysisRequest) HasSource() bool { + if o != nil && o.Source != nil { + return true + } + + return false +} + +// SetSource gets a reference to the given ImageSource and assigns it to the Source field. +func (o *ImageAnalysisRequest) SetSource(v ImageSource) { + o.Source = &v +} + +func (o ImageAnalysisRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Dockerfile != nil { + toSerialize["dockerfile"] = o.Dockerfile + } + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + if o.Tag != nil { + toSerialize["tag"] = o.Tag + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.ImageType != nil { + toSerialize["image_type"] = o.ImageType + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + if o.Source != nil { + toSerialize["source"] = o.Source + } + return json.Marshal(toSerialize) +} + +type NullableImageAnalysisRequest struct { + value *ImageAnalysisRequest + isSet bool +} + +func (v NullableImageAnalysisRequest) Get() *ImageAnalysisRequest { + return v.value +} + +func (v *NullableImageAnalysisRequest) Set(val *ImageAnalysisRequest) { + v.value = val + v.isSet = true +} + +func (v NullableImageAnalysisRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableImageAnalysisRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageAnalysisRequest(val *ImageAnalysisRequest) *NullableImageAnalysisRequest { + return &NullableImageAnalysisRequest{value: val, isSet: true} +} + +func (v NullableImageAnalysisRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageAnalysisRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_detail.go b/.gen/anchore/model_image_detail.go index 3e135af341..eaa28cd6c3 100644 --- a/.gen/anchore/model_image_detail.go +++ b/.gen/anchore/model_image_detail.go @@ -1,31 +1,454 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // ImageDetail A metadata detail record for a specific image. Multiple detail records may map a single catalog image. type ImageDetail struct { - CreatedAt time.Time `json:"created_at,omitempty"` - LastUpdated time.Time `json:"last_updated,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` // Full docker-pullable tag string referencing the image - Fulltag string `json:"fulltag,omitempty"` + Fulltag *string `json:"fulltag,omitempty"` // Full docker-pullable digest string including the registry url and repository necessary get the image - Fulldigest string `json:"fulldigest,omitempty"` - UserId string `json:"userId,omitempty"` - ImageId string `json:"imageId,omitempty"` - Registry string `json:"registry,omitempty"` - Repo string `json:"repo,omitempty"` - Dockerfile *string `json:"dockerfile,omitempty"` + Fulldigest *string `json:"fulldigest,omitempty"` + UserId *string `json:"userId,omitempty"` + ImageId *string `json:"imageId,omitempty"` + Registry *string `json:"registry,omitempty"` + Repo *string `json:"repo,omitempty"` + Dockerfile NullableString `json:"dockerfile,omitempty"` // The parent Anchore Image record to which this detail maps - ImageDigest string `json:"imageDigest,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` +} + +// NewImageDetail instantiates a new ImageDetail 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 NewImageDetail() *ImageDetail { + this := ImageDetail{} + return &this +} + +// NewImageDetailWithDefaults instantiates a new ImageDetail 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 NewImageDetailWithDefaults() *ImageDetail { + this := ImageDetail{} + return &this } + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageDetail) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageDetail) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageDetail) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *ImageDetail) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *ImageDetail) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *ImageDetail) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetFulltag returns the Fulltag field value if set, zero value otherwise. +func (o *ImageDetail) GetFulltag() string { + if o == nil || o.Fulltag == nil { + var ret string + return ret + } + return *o.Fulltag +} + +// GetFulltagOk returns a tuple with the Fulltag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetFulltagOk() (*string, bool) { + if o == nil || o.Fulltag == nil { + return nil, false + } + return o.Fulltag, true +} + +// HasFulltag returns a boolean if a field has been set. +func (o *ImageDetail) HasFulltag() bool { + if o != nil && o.Fulltag != nil { + return true + } + + return false +} + +// SetFulltag gets a reference to the given string and assigns it to the Fulltag field. +func (o *ImageDetail) SetFulltag(v string) { + o.Fulltag = &v +} + +// GetFulldigest returns the Fulldigest field value if set, zero value otherwise. +func (o *ImageDetail) GetFulldigest() string { + if o == nil || o.Fulldigest == nil { + var ret string + return ret + } + return *o.Fulldigest +} + +// GetFulldigestOk returns a tuple with the Fulldigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetFulldigestOk() (*string, bool) { + if o == nil || o.Fulldigest == nil { + return nil, false + } + return o.Fulldigest, true +} + +// HasFulldigest returns a boolean if a field has been set. +func (o *ImageDetail) HasFulldigest() bool { + if o != nil && o.Fulldigest != nil { + return true + } + + return false +} + +// SetFulldigest gets a reference to the given string and assigns it to the Fulldigest field. +func (o *ImageDetail) SetFulldigest(v string) { + o.Fulldigest = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *ImageDetail) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *ImageDetail) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *ImageDetail) SetUserId(v string) { + o.UserId = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *ImageDetail) GetImageId() string { + if o == nil || o.ImageId == nil { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetImageIdOk() (*string, bool) { + if o == nil || o.ImageId == nil { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *ImageDetail) HasImageId() bool { + if o != nil && o.ImageId != nil { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *ImageDetail) SetImageId(v string) { + o.ImageId = &v +} + +// GetRegistry returns the Registry field value if set, zero value otherwise. +func (o *ImageDetail) GetRegistry() string { + if o == nil || o.Registry == nil { + var ret string + return ret + } + return *o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetRegistryOk() (*string, bool) { + if o == nil || o.Registry == nil { + return nil, false + } + return o.Registry, true +} + +// HasRegistry returns a boolean if a field has been set. +func (o *ImageDetail) HasRegistry() bool { + if o != nil && o.Registry != nil { + return true + } + + return false +} + +// SetRegistry gets a reference to the given string and assigns it to the Registry field. +func (o *ImageDetail) SetRegistry(v string) { + o.Registry = &v +} + +// GetRepo returns the Repo field value if set, zero value otherwise. +func (o *ImageDetail) GetRepo() string { + if o == nil || o.Repo == nil { + var ret string + return ret + } + return *o.Repo +} + +// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetRepoOk() (*string, bool) { + if o == nil || o.Repo == nil { + return nil, false + } + return o.Repo, true +} + +// HasRepo returns a boolean if a field has been set. +func (o *ImageDetail) HasRepo() bool { + if o != nil && o.Repo != nil { + return true + } + + return false +} + +// SetRepo gets a reference to the given string and assigns it to the Repo field. +func (o *ImageDetail) SetRepo(v string) { + o.Repo = &v +} + +// GetDockerfile returns the Dockerfile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageDetail) GetDockerfile() string { + if o == nil || o.Dockerfile.Get() == nil { + var ret string + return ret + } + return *o.Dockerfile.Get() +} + +// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageDetail) GetDockerfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Dockerfile.Get(), o.Dockerfile.IsSet() +} + +// HasDockerfile returns a boolean if a field has been set. +func (o *ImageDetail) HasDockerfile() bool { + if o != nil && o.Dockerfile.IsSet() { + return true + } + + return false +} + +// SetDockerfile gets a reference to the given NullableString and assigns it to the Dockerfile field. +func (o *ImageDetail) SetDockerfile(v string) { + o.Dockerfile.Set(&v) +} +// SetDockerfileNil sets the value for Dockerfile to be an explicit nil +func (o *ImageDetail) SetDockerfileNil() { + o.Dockerfile.Set(nil) +} + +// UnsetDockerfile ensures that no value is present for Dockerfile, not even an explicit nil +func (o *ImageDetail) UnsetDockerfile() { + o.Dockerfile.Unset() +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *ImageDetail) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageDetail) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *ImageDetail) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *ImageDetail) SetImageDigest(v string) { + o.ImageDigest = &v +} + +func (o ImageDetail) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.Fulltag != nil { + toSerialize["fulltag"] = o.Fulltag + } + if o.Fulldigest != nil { + toSerialize["fulldigest"] = o.Fulldigest + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.ImageId != nil { + toSerialize["imageId"] = o.ImageId + } + if o.Registry != nil { + toSerialize["registry"] = o.Registry + } + if o.Repo != nil { + toSerialize["repo"] = o.Repo + } + if o.Dockerfile.IsSet() { + toSerialize["dockerfile"] = o.Dockerfile.Get() + } + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + return json.Marshal(toSerialize) +} + +type NullableImageDetail struct { + value *ImageDetail + isSet bool +} + +func (v NullableImageDetail) Get() *ImageDetail { + return v.value +} + +func (v *NullableImageDetail) Set(val *ImageDetail) { + v.value = val + v.isSet = true +} + +func (v NullableImageDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableImageDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageDetail(val *ImageDetail) *NullableImageDetail { + return &NullableImageDetail{value: val, isSet: true} +} + +func (v NullableImageDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_filter.go b/.gen/anchore/model_image_filter.go index 6fb2dab192..dfd5dfcf76 100644 --- a/.gen/anchore/model_image_filter.go +++ b/.gen/anchore/model_image_filter.go @@ -1,17 +1,152 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageFilter Filter for an image list by id, tag, or digest, but not both type ImageFilter struct { - Tag string `json:"tag,omitempty"` - Digest string `json:"digest,omitempty"` + Tag *string `json:"tag,omitempty"` + Digest *string `json:"digest,omitempty"` +} + +// NewImageFilter instantiates a new ImageFilter 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 NewImageFilter() *ImageFilter { + this := ImageFilter{} + return &this +} + +// NewImageFilterWithDefaults instantiates a new ImageFilter 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 NewImageFilterWithDefaults() *ImageFilter { + this := ImageFilter{} + return &this +} + +// GetTag returns the Tag field value if set, zero value otherwise. +func (o *ImageFilter) GetTag() string { + if o == nil || o.Tag == nil { + var ret string + return ret + } + return *o.Tag +} + +// GetTagOk returns a tuple with the Tag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageFilter) GetTagOk() (*string, bool) { + if o == nil || o.Tag == nil { + return nil, false + } + return o.Tag, true +} + +// HasTag returns a boolean if a field has been set. +func (o *ImageFilter) HasTag() bool { + if o != nil && o.Tag != nil { + return true + } + + return false +} + +// SetTag gets a reference to the given string and assigns it to the Tag field. +func (o *ImageFilter) SetTag(v string) { + o.Tag = &v +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *ImageFilter) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageFilter) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *ImageFilter) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *ImageFilter) SetDigest(v string) { + o.Digest = &v +} + +func (o ImageFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Tag != nil { + toSerialize["tag"] = o.Tag + } + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + return json.Marshal(toSerialize) +} + +type NullableImageFilter struct { + value *ImageFilter + isSet bool +} + +func (v NullableImageFilter) Get() *ImageFilter { + return v.value } + +func (v *NullableImageFilter) Set(val *ImageFilter) { + v.value = val + v.isSet = true +} + +func (v NullableImageFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableImageFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageFilter(val *ImageFilter) *NullableImageFilter { + return &NullableImageFilter{value: val, isSet: true} +} + +func (v NullableImageFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_import_content_response.go b/.gen/anchore/model_image_import_content_response.go new file mode 100644 index 0000000000..fae365cc6f --- /dev/null +++ b/.gen/anchore/model_image_import_content_response.go @@ -0,0 +1,153 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" + "time" +) + +// ImageImportContentResponse struct for ImageImportContentResponse +type ImageImportContentResponse struct { + Digest *string `json:"digest,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` +} + +// NewImageImportContentResponse instantiates a new ImageImportContentResponse 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 NewImageImportContentResponse() *ImageImportContentResponse { + this := ImageImportContentResponse{} + return &this +} + +// NewImageImportContentResponseWithDefaults instantiates a new ImageImportContentResponse 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 NewImageImportContentResponseWithDefaults() *ImageImportContentResponse { + this := ImageImportContentResponse{} + return &this +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *ImageImportContentResponse) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportContentResponse) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *ImageImportContentResponse) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *ImageImportContentResponse) SetDigest(v string) { + o.Digest = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageImportContentResponse) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportContentResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageImportContentResponse) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageImportContentResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +func (o ImageImportContentResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + return json.Marshal(toSerialize) +} + +type NullableImageImportContentResponse struct { + value *ImageImportContentResponse + isSet bool +} + +func (v NullableImageImportContentResponse) Get() *ImageImportContentResponse { + return v.value +} + +func (v *NullableImageImportContentResponse) Set(val *ImageImportContentResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageImportContentResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageImportContentResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageImportContentResponse(val *ImageImportContentResponse) *NullableImageImportContentResponse { + return &NullableImageImportContentResponse{value: val, isSet: true} +} + +func (v NullableImageImportContentResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageImportContentResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_import_manifest.go b/.gen/anchore/model_image_import_manifest.go new file mode 100644 index 0000000000..d76d6c8e16 --- /dev/null +++ b/.gen/anchore/model_image_import_manifest.go @@ -0,0 +1,298 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImageImportManifest struct for ImageImportManifest +type ImageImportManifest struct { + Contents *ImportContentDigests `json:"contents,omitempty"` + Tags []string `json:"tags,omitempty"` + Digest *string `json:"digest,omitempty"` + // The digest of the images's manifest-list parent if it was accessed from a multi-arch tag where the tag pointed to a manifest-list. This allows preservation of that relationship in the data + ParentDigest *string `json:"parent_digest,omitempty"` + // An \"imageId\" as used by Docker if available + LocalImageId *string `json:"local_image_id,omitempty"` + OperationUuid *string `json:"operation_uuid,omitempty"` +} + +// NewImageImportManifest instantiates a new ImageImportManifest 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 NewImageImportManifest() *ImageImportManifest { + this := ImageImportManifest{} + return &this +} + +// NewImageImportManifestWithDefaults instantiates a new ImageImportManifest 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 NewImageImportManifestWithDefaults() *ImageImportManifest { + this := ImageImportManifest{} + return &this +} + +// GetContents returns the Contents field value if set, zero value otherwise. +func (o *ImageImportManifest) GetContents() ImportContentDigests { + if o == nil || o.Contents == nil { + var ret ImportContentDigests + return ret + } + return *o.Contents +} + +// GetContentsOk returns a tuple with the Contents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportManifest) GetContentsOk() (*ImportContentDigests, bool) { + if o == nil || o.Contents == nil { + return nil, false + } + return o.Contents, true +} + +// HasContents returns a boolean if a field has been set. +func (o *ImageImportManifest) HasContents() bool { + if o != nil && o.Contents != nil { + return true + } + + return false +} + +// SetContents gets a reference to the given ImportContentDigests and assigns it to the Contents field. +func (o *ImageImportManifest) SetContents(v ImportContentDigests) { + o.Contents = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ImageImportManifest) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportManifest) GetTagsOk() ([]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ImageImportManifest) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ImageImportManifest) SetTags(v []string) { + o.Tags = v +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *ImageImportManifest) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportManifest) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *ImageImportManifest) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *ImageImportManifest) SetDigest(v string) { + o.Digest = &v +} + +// GetParentDigest returns the ParentDigest field value if set, zero value otherwise. +func (o *ImageImportManifest) GetParentDigest() string { + if o == nil || o.ParentDigest == nil { + var ret string + return ret + } + return *o.ParentDigest +} + +// GetParentDigestOk returns a tuple with the ParentDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportManifest) GetParentDigestOk() (*string, bool) { + if o == nil || o.ParentDigest == nil { + return nil, false + } + return o.ParentDigest, true +} + +// HasParentDigest returns a boolean if a field has been set. +func (o *ImageImportManifest) HasParentDigest() bool { + if o != nil && o.ParentDigest != nil { + return true + } + + return false +} + +// SetParentDigest gets a reference to the given string and assigns it to the ParentDigest field. +func (o *ImageImportManifest) SetParentDigest(v string) { + o.ParentDigest = &v +} + +// GetLocalImageId returns the LocalImageId field value if set, zero value otherwise. +func (o *ImageImportManifest) GetLocalImageId() string { + if o == nil || o.LocalImageId == nil { + var ret string + return ret + } + return *o.LocalImageId +} + +// GetLocalImageIdOk returns a tuple with the LocalImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportManifest) GetLocalImageIdOk() (*string, bool) { + if o == nil || o.LocalImageId == nil { + return nil, false + } + return o.LocalImageId, true +} + +// HasLocalImageId returns a boolean if a field has been set. +func (o *ImageImportManifest) HasLocalImageId() bool { + if o != nil && o.LocalImageId != nil { + return true + } + + return false +} + +// SetLocalImageId gets a reference to the given string and assigns it to the LocalImageId field. +func (o *ImageImportManifest) SetLocalImageId(v string) { + o.LocalImageId = &v +} + +// GetOperationUuid returns the OperationUuid field value if set, zero value otherwise. +func (o *ImageImportManifest) GetOperationUuid() string { + if o == nil || o.OperationUuid == nil { + var ret string + return ret + } + return *o.OperationUuid +} + +// GetOperationUuidOk returns a tuple with the OperationUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportManifest) GetOperationUuidOk() (*string, bool) { + if o == nil || o.OperationUuid == nil { + return nil, false + } + return o.OperationUuid, true +} + +// HasOperationUuid returns a boolean if a field has been set. +func (o *ImageImportManifest) HasOperationUuid() bool { + if o != nil && o.OperationUuid != nil { + return true + } + + return false +} + +// SetOperationUuid gets a reference to the given string and assigns it to the OperationUuid field. +func (o *ImageImportManifest) SetOperationUuid(v string) { + o.OperationUuid = &v +} + +func (o ImageImportManifest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Contents != nil { + toSerialize["contents"] = o.Contents + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + if o.ParentDigest != nil { + toSerialize["parent_digest"] = o.ParentDigest + } + if o.LocalImageId != nil { + toSerialize["local_image_id"] = o.LocalImageId + } + if o.OperationUuid != nil { + toSerialize["operation_uuid"] = o.OperationUuid + } + return json.Marshal(toSerialize) +} + +type NullableImageImportManifest struct { + value *ImageImportManifest + isSet bool +} + +func (v NullableImageImportManifest) Get() *ImageImportManifest { + return v.value +} + +func (v *NullableImageImportManifest) Set(val *ImageImportManifest) { + v.value = val + v.isSet = true +} + +func (v NullableImageImportManifest) IsSet() bool { + return v.isSet +} + +func (v *NullableImageImportManifest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageImportManifest(val *ImageImportManifest) *NullableImageImportManifest { + return &NullableImageImportManifest{value: val, isSet: true} +} + +func (v NullableImageImportManifest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageImportManifest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_import_operation.go b/.gen/anchore/model_image_import_operation.go new file mode 100644 index 0000000000..1a4fa27acc --- /dev/null +++ b/.gen/anchore/model_image_import_operation.go @@ -0,0 +1,225 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" + "time" +) + +// ImageImportOperation An import record, creating a unique identifier for referencing the operation as well as its state +type ImageImportOperation struct { + Uuid *string `json:"uuid,omitempty"` + Status *string `json:"status,omitempty"` + ExpiresAt *time.Time `json:"expires_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` +} + +// NewImageImportOperation instantiates a new ImageImportOperation 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 NewImageImportOperation() *ImageImportOperation { + this := ImageImportOperation{} + return &this +} + +// NewImageImportOperationWithDefaults instantiates a new ImageImportOperation 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 NewImageImportOperationWithDefaults() *ImageImportOperation { + this := ImageImportOperation{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *ImageImportOperation) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportOperation) GetUuidOk() (*string, bool) { + if o == nil || o.Uuid == nil { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *ImageImportOperation) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *ImageImportOperation) SetUuid(v string) { + o.Uuid = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ImageImportOperation) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportOperation) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ImageImportOperation) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *ImageImportOperation) SetStatus(v string) { + o.Status = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *ImageImportOperation) GetExpiresAt() time.Time { + if o == nil || o.ExpiresAt == nil { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportOperation) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || o.ExpiresAt == nil { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *ImageImportOperation) HasExpiresAt() bool { + if o != nil && o.ExpiresAt != nil { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *ImageImportOperation) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageImportOperation) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageImportOperation) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageImportOperation) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageImportOperation) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +func (o ImageImportOperation) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.ExpiresAt != nil { + toSerialize["expires_at"] = o.ExpiresAt + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + return json.Marshal(toSerialize) +} + +type NullableImageImportOperation struct { + value *ImageImportOperation + isSet bool +} + +func (v NullableImageImportOperation) Get() *ImageImportOperation { + return v.value +} + +func (v *NullableImageImportOperation) Set(val *ImageImportOperation) { + v.value = val + v.isSet = true +} + +func (v NullableImageImportOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableImageImportOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageImportOperation(val *ImageImportOperation) *NullableImageImportOperation { + return &NullableImageImportOperation{value: val, isSet: true} +} + +func (v NullableImageImportOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageImportOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_package_manifest.go b/.gen/anchore/model_image_package_manifest.go new file mode 100644 index 0000000000..6c0d9d12da --- /dev/null +++ b/.gen/anchore/model_image_package_manifest.go @@ -0,0 +1,275 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImagePackageManifest struct for ImagePackageManifest +type ImagePackageManifest struct { + Artifacts []ImportPackage `json:"artifacts"` + Source ImportSource `json:"source"` + Distro ImportDistribution `json:"distro"` + Descriptor *ImportDescriptor `json:"descriptor,omitempty"` + Schema *ImportSchema `json:"schema,omitempty"` + ArtifactRelationships []ImportPackageRelationship `json:"artifactRelationships,omitempty"` +} + +// NewImagePackageManifest instantiates a new ImagePackageManifest 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 NewImagePackageManifest(artifacts []ImportPackage, source ImportSource, distro ImportDistribution) *ImagePackageManifest { + this := ImagePackageManifest{} + this.Artifacts = artifacts + this.Source = source + this.Distro = distro + return &this +} + +// NewImagePackageManifestWithDefaults instantiates a new ImagePackageManifest 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 NewImagePackageManifestWithDefaults() *ImagePackageManifest { + this := ImagePackageManifest{} + return &this +} + +// GetArtifacts returns the Artifacts field value +func (o *ImagePackageManifest) GetArtifacts() []ImportPackage { + if o == nil { + var ret []ImportPackage + return ret + } + + return o.Artifacts +} + +// GetArtifactsOk returns a tuple with the Artifacts field value +// and a boolean to check if the value has been set. +func (o *ImagePackageManifest) GetArtifactsOk() ([]ImportPackage, bool) { + if o == nil { + return nil, false + } + return o.Artifacts, true +} + +// SetArtifacts sets field value +func (o *ImagePackageManifest) SetArtifacts(v []ImportPackage) { + o.Artifacts = v +} + +// GetSource returns the Source field value +func (o *ImagePackageManifest) GetSource() ImportSource { + if o == nil { + var ret ImportSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *ImagePackageManifest) GetSourceOk() (*ImportSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *ImagePackageManifest) SetSource(v ImportSource) { + o.Source = v +} + +// GetDistro returns the Distro field value +func (o *ImagePackageManifest) GetDistro() ImportDistribution { + if o == nil { + var ret ImportDistribution + return ret + } + + return o.Distro +} + +// GetDistroOk returns a tuple with the Distro field value +// and a boolean to check if the value has been set. +func (o *ImagePackageManifest) GetDistroOk() (*ImportDistribution, bool) { + if o == nil { + return nil, false + } + return &o.Distro, true +} + +// SetDistro sets field value +func (o *ImagePackageManifest) SetDistro(v ImportDistribution) { + o.Distro = v +} + +// GetDescriptor returns the Descriptor field value if set, zero value otherwise. +func (o *ImagePackageManifest) GetDescriptor() ImportDescriptor { + if o == nil || o.Descriptor == nil { + var ret ImportDescriptor + return ret + } + return *o.Descriptor +} + +// GetDescriptorOk returns a tuple with the Descriptor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagePackageManifest) GetDescriptorOk() (*ImportDescriptor, bool) { + if o == nil || o.Descriptor == nil { + return nil, false + } + return o.Descriptor, true +} + +// HasDescriptor returns a boolean if a field has been set. +func (o *ImagePackageManifest) HasDescriptor() bool { + if o != nil && o.Descriptor != nil { + return true + } + + return false +} + +// SetDescriptor gets a reference to the given ImportDescriptor and assigns it to the Descriptor field. +func (o *ImagePackageManifest) SetDescriptor(v ImportDescriptor) { + o.Descriptor = &v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *ImagePackageManifest) GetSchema() ImportSchema { + if o == nil || o.Schema == nil { + var ret ImportSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagePackageManifest) GetSchemaOk() (*ImportSchema, bool) { + if o == nil || o.Schema == nil { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *ImagePackageManifest) HasSchema() bool { + if o != nil && o.Schema != nil { + return true + } + + return false +} + +// SetSchema gets a reference to the given ImportSchema and assigns it to the Schema field. +func (o *ImagePackageManifest) SetSchema(v ImportSchema) { + o.Schema = &v +} + +// GetArtifactRelationships returns the ArtifactRelationships field value if set, zero value otherwise. +func (o *ImagePackageManifest) GetArtifactRelationships() []ImportPackageRelationship { + if o == nil || o.ArtifactRelationships == nil { + var ret []ImportPackageRelationship + return ret + } + return o.ArtifactRelationships +} + +// GetArtifactRelationshipsOk returns a tuple with the ArtifactRelationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImagePackageManifest) GetArtifactRelationshipsOk() ([]ImportPackageRelationship, bool) { + if o == nil || o.ArtifactRelationships == nil { + return nil, false + } + return o.ArtifactRelationships, true +} + +// HasArtifactRelationships returns a boolean if a field has been set. +func (o *ImagePackageManifest) HasArtifactRelationships() bool { + if o != nil && o.ArtifactRelationships != nil { + return true + } + + return false +} + +// SetArtifactRelationships gets a reference to the given []ImportPackageRelationship and assigns it to the ArtifactRelationships field. +func (o *ImagePackageManifest) SetArtifactRelationships(v []ImportPackageRelationship) { + o.ArtifactRelationships = v +} + +func (o ImagePackageManifest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["artifacts"] = o.Artifacts + } + if true { + toSerialize["source"] = o.Source + } + if true { + toSerialize["distro"] = o.Distro + } + if o.Descriptor != nil { + toSerialize["descriptor"] = o.Descriptor + } + if o.Schema != nil { + toSerialize["schema"] = o.Schema + } + if o.ArtifactRelationships != nil { + toSerialize["artifactRelationships"] = o.ArtifactRelationships + } + return json.Marshal(toSerialize) +} + +type NullableImagePackageManifest struct { + value *ImagePackageManifest + isSet bool +} + +func (v NullableImagePackageManifest) Get() *ImagePackageManifest { + return v.value +} + +func (v *NullableImagePackageManifest) Set(val *ImagePackageManifest) { + v.value = val + v.isSet = true +} + +func (v NullableImagePackageManifest) IsSet() bool { + return v.isSet +} + +func (v *NullableImagePackageManifest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImagePackageManifest(val *ImagePackageManifest) *NullableImagePackageManifest { + return &NullableImagePackageManifest{value: val, isSet: true} +} + +func (v NullableImagePackageManifest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImagePackageManifest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_ref.go b/.gen/anchore/model_image_ref.go index a1133a5a4c..c82462d998 100644 --- a/.gen/anchore/model_image_ref.go +++ b/.gen/anchore/model_image_ref.go @@ -1,17 +1,138 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageRef A reference to an image type ImageRef struct { Type string `json:"type"` Value string `json:"value"` } + +// NewImageRef instantiates a new ImageRef 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 NewImageRef(type_ string, value string) *ImageRef { + this := ImageRef{} + this.Type = type_ + this.Value = value + return &this +} + +// NewImageRefWithDefaults instantiates a new ImageRef 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 NewImageRefWithDefaults() *ImageRef { + this := ImageRef{} + return &this +} + +// GetType returns the Type field value +func (o *ImageRef) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ImageRef) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ImageRef) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *ImageRef) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ImageRef) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *ImageRef) SetValue(v string) { + o.Value = v +} + +func (o ImageRef) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["type"] = o.Type + } + if true { + toSerialize["value"] = o.Value + } + return json.Marshal(toSerialize) +} + +type NullableImageRef struct { + value *ImageRef + isSet bool +} + +func (v NullableImageRef) Get() *ImageRef { + return v.value +} + +func (v *NullableImageRef) Set(val *ImageRef) { + v.value = val + v.isSet = true +} + +func (v NullableImageRef) IsSet() bool { + return v.isSet +} + +func (v *NullableImageRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageRef(val *ImageRef) *NullableImageRef { + return &NullableImageRef{value: val, isSet: true} +} + +func (v NullableImageRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_reference.go b/.gen/anchore/model_image_reference.go index 3a5230c2a5..818cc04fa3 100644 --- a/.gen/anchore/model_image_reference.go +++ b/.gen/anchore/model_image_reference.go @@ -1,22 +1,227 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageReference A summary of an image identity, including digest, id (if available), and any tags known to have ever been mapped to the digest type ImageReference struct { // The image digest - Digest string `json:"digest,omitempty"` + Digest *string `json:"digest,omitempty"` // The image id if available - Id string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` // Timestamp, in rfc3339 format, indicating when the image state became 'analyzed' in Anchore Engine. - AnalyzedAt string `json:"analyzed_at,omitempty"` + AnalyzedAt *string `json:"analyzed_at,omitempty"` TagHistory []TagEntry `json:"tag_history,omitempty"` } + +// NewImageReference instantiates a new ImageReference 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 NewImageReference() *ImageReference { + this := ImageReference{} + return &this +} + +// NewImageReferenceWithDefaults instantiates a new ImageReference 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 NewImageReferenceWithDefaults() *ImageReference { + this := ImageReference{} + return &this +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *ImageReference) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageReference) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *ImageReference) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *ImageReference) SetDigest(v string) { + o.Digest = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ImageReference) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageReference) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ImageReference) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ImageReference) SetId(v string) { + o.Id = &v +} + +// GetAnalyzedAt returns the AnalyzedAt field value if set, zero value otherwise. +func (o *ImageReference) GetAnalyzedAt() string { + if o == nil || o.AnalyzedAt == nil { + var ret string + return ret + } + return *o.AnalyzedAt +} + +// GetAnalyzedAtOk returns a tuple with the AnalyzedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageReference) GetAnalyzedAtOk() (*string, bool) { + if o == nil || o.AnalyzedAt == nil { + return nil, false + } + return o.AnalyzedAt, true +} + +// HasAnalyzedAt returns a boolean if a field has been set. +func (o *ImageReference) HasAnalyzedAt() bool { + if o != nil && o.AnalyzedAt != nil { + return true + } + + return false +} + +// SetAnalyzedAt gets a reference to the given string and assigns it to the AnalyzedAt field. +func (o *ImageReference) SetAnalyzedAt(v string) { + o.AnalyzedAt = &v +} + +// GetTagHistory returns the TagHistory field value if set, zero value otherwise. +func (o *ImageReference) GetTagHistory() []TagEntry { + if o == nil || o.TagHistory == nil { + var ret []TagEntry + return ret + } + return o.TagHistory +} + +// GetTagHistoryOk returns a tuple with the TagHistory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageReference) GetTagHistoryOk() ([]TagEntry, bool) { + if o == nil || o.TagHistory == nil { + return nil, false + } + return o.TagHistory, true +} + +// HasTagHistory returns a boolean if a field has been set. +func (o *ImageReference) HasTagHistory() bool { + if o != nil && o.TagHistory != nil { + return true + } + + return false +} + +// SetTagHistory gets a reference to the given []TagEntry and assigns it to the TagHistory field. +func (o *ImageReference) SetTagHistory(v []TagEntry) { + o.TagHistory = v +} + +func (o ImageReference) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.AnalyzedAt != nil { + toSerialize["analyzed_at"] = o.AnalyzedAt + } + if o.TagHistory != nil { + toSerialize["tag_history"] = o.TagHistory + } + return json.Marshal(toSerialize) +} + +type NullableImageReference struct { + value *ImageReference + isSet bool +} + +func (v NullableImageReference) Get() *ImageReference { + return v.value +} + +func (v *NullableImageReference) Set(val *ImageReference) { + v.value = val + v.isSet = true +} + +func (v NullableImageReference) IsSet() bool { + return v.isSet +} + +func (v *NullableImageReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageReference(val *ImageReference) *NullableImageReference { + return &NullableImageReference{value: val, isSet: true} +} + +func (v NullableImageReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_selection_rule.go b/.gen/anchore/model_image_selection_rule.go index bc850ac7ac..98b3251ee9 100644 --- a/.gen/anchore/model_image_selection_rule.go +++ b/.gen/anchore/model_image_selection_rule.go @@ -1,20 +1,232 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageSelectionRule struct for ImageSelectionRule type ImageSelectionRule struct { - Id string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Name string `json:"name"` Registry string `json:"registry"` Repository string `json:"repository"` Image ImageRef `json:"image"` } + +// NewImageSelectionRule instantiates a new ImageSelectionRule 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 NewImageSelectionRule(name string, registry string, repository string, image ImageRef) *ImageSelectionRule { + this := ImageSelectionRule{} + this.Name = name + this.Registry = registry + this.Repository = repository + this.Image = image + return &this +} + +// NewImageSelectionRuleWithDefaults instantiates a new ImageSelectionRule 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 NewImageSelectionRuleWithDefaults() *ImageSelectionRule { + this := ImageSelectionRule{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ImageSelectionRule) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageSelectionRule) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ImageSelectionRule) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ImageSelectionRule) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *ImageSelectionRule) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ImageSelectionRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ImageSelectionRule) SetName(v string) { + o.Name = v +} + +// GetRegistry returns the Registry field value +func (o *ImageSelectionRule) GetRegistry() string { + if o == nil { + var ret string + return ret + } + + return o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value +// and a boolean to check if the value has been set. +func (o *ImageSelectionRule) GetRegistryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Registry, true +} + +// SetRegistry sets field value +func (o *ImageSelectionRule) SetRegistry(v string) { + o.Registry = v +} + +// GetRepository returns the Repository field value +func (o *ImageSelectionRule) GetRepository() string { + if o == nil { + var ret string + return ret + } + + return o.Repository +} + +// GetRepositoryOk returns a tuple with the Repository field value +// and a boolean to check if the value has been set. +func (o *ImageSelectionRule) GetRepositoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Repository, true +} + +// SetRepository sets field value +func (o *ImageSelectionRule) SetRepository(v string) { + o.Repository = v +} + +// GetImage returns the Image field value +func (o *ImageSelectionRule) GetImage() ImageRef { + if o == nil { + var ret ImageRef + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *ImageSelectionRule) GetImageOk() (*ImageRef, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *ImageSelectionRule) SetImage(v ImageRef) { + o.Image = v +} + +func (o ImageSelectionRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["registry"] = o.Registry + } + if true { + toSerialize["repository"] = o.Repository + } + if true { + toSerialize["image"] = o.Image + } + return json.Marshal(toSerialize) +} + +type NullableImageSelectionRule struct { + value *ImageSelectionRule + isSet bool +} + +func (v NullableImageSelectionRule) Get() *ImageSelectionRule { + return v.value +} + +func (v *NullableImageSelectionRule) Set(val *ImageSelectionRule) { + v.value = val + v.isSet = true +} + +func (v NullableImageSelectionRule) IsSet() bool { + return v.isSet +} + +func (v *NullableImageSelectionRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageSelectionRule(val *ImageSelectionRule) *NullableImageSelectionRule { + return &NullableImageSelectionRule{value: val, isSet: true} +} + +func (v NullableImageSelectionRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageSelectionRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_selector.go b/.gen/anchore/model_image_selector.go index 758680cebc..b027a6fb1c 100644 --- a/.gen/anchore/model_image_selector.go +++ b/.gen/anchore/model_image_selector.go @@ -1,21 +1,191 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageSelector A set of selection criteria to match an image by a tagged pullstring based on its components, with regex support in each field type ImageSelector struct { // The registry section of a pull string. e.g. with \"docker.io/anchore/anchore-engine:latest\", this is \"docker.io\" - Registry string `json:"registry,omitempty"` + Registry *string `json:"registry,omitempty"` // The repository section of a pull string. e.g. with \"docker.io/anchore/anchore-engine:latest\", this is \"anchore/anchore-engine\" - Repository string `json:"repository,omitempty"` + Repository *string `json:"repository,omitempty"` // The tag-only section of a pull string. e.g. with \"docker.io/anchore/anchore-engine:latest\", this is \"latest\" - Tag string `json:"tag,omitempty"` + Tag *string `json:"tag,omitempty"` +} + +// NewImageSelector instantiates a new ImageSelector 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 NewImageSelector() *ImageSelector { + this := ImageSelector{} + return &this +} + +// NewImageSelectorWithDefaults instantiates a new ImageSelector 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 NewImageSelectorWithDefaults() *ImageSelector { + this := ImageSelector{} + return &this +} + +// GetRegistry returns the Registry field value if set, zero value otherwise. +func (o *ImageSelector) GetRegistry() string { + if o == nil || o.Registry == nil { + var ret string + return ret + } + return *o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageSelector) GetRegistryOk() (*string, bool) { + if o == nil || o.Registry == nil { + return nil, false + } + return o.Registry, true +} + +// HasRegistry returns a boolean if a field has been set. +func (o *ImageSelector) HasRegistry() bool { + if o != nil && o.Registry != nil { + return true + } + + return false +} + +// SetRegistry gets a reference to the given string and assigns it to the Registry field. +func (o *ImageSelector) SetRegistry(v string) { + o.Registry = &v +} + +// GetRepository returns the Repository field value if set, zero value otherwise. +func (o *ImageSelector) GetRepository() string { + if o == nil || o.Repository == nil { + var ret string + return ret + } + return *o.Repository +} + +// GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageSelector) GetRepositoryOk() (*string, bool) { + if o == nil || o.Repository == nil { + return nil, false + } + return o.Repository, true +} + +// HasRepository returns a boolean if a field has been set. +func (o *ImageSelector) HasRepository() bool { + if o != nil && o.Repository != nil { + return true + } + + return false +} + +// SetRepository gets a reference to the given string and assigns it to the Repository field. +func (o *ImageSelector) SetRepository(v string) { + o.Repository = &v +} + +// GetTag returns the Tag field value if set, zero value otherwise. +func (o *ImageSelector) GetTag() string { + if o == nil || o.Tag == nil { + var ret string + return ret + } + return *o.Tag } + +// GetTagOk returns a tuple with the Tag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageSelector) GetTagOk() (*string, bool) { + if o == nil || o.Tag == nil { + return nil, false + } + return o.Tag, true +} + +// HasTag returns a boolean if a field has been set. +func (o *ImageSelector) HasTag() bool { + if o != nil && o.Tag != nil { + return true + } + + return false +} + +// SetTag gets a reference to the given string and assigns it to the Tag field. +func (o *ImageSelector) SetTag(v string) { + o.Tag = &v +} + +func (o ImageSelector) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Registry != nil { + toSerialize["registry"] = o.Registry + } + if o.Repository != nil { + toSerialize["repository"] = o.Repository + } + if o.Tag != nil { + toSerialize["tag"] = o.Tag + } + return json.Marshal(toSerialize) +} + +type NullableImageSelector struct { + value *ImageSelector + isSet bool +} + +func (v NullableImageSelector) Get() *ImageSelector { + return v.value +} + +func (v *NullableImageSelector) Set(val *ImageSelector) { + v.value = val + v.isSet = true +} + +func (v NullableImageSelector) IsSet() bool { + return v.isSet +} + +func (v *NullableImageSelector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageSelector(val *ImageSelector) *NullableImageSelector { + return &NullableImageSelector{value: val, isSet: true} +} + +func (v NullableImageSelector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageSelector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_source.go b/.gen/anchore/model_image_source.go index 95494086e1..06c950de51 100644 --- a/.gen/anchore/model_image_source.go +++ b/.gen/anchore/model_image_source.go @@ -1,18 +1,264 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageSource A set of analysis source types. Only one may be set in any given request. type ImageSource struct { - Tag RegistryTagSource `json:"tag,omitempty"` - Digest RegistryDigestSource `json:"digest,omitempty"` - Archive AnalysisArchiveSource `json:"archive,omitempty"` + Tag NullableRegistryTagSource `json:"tag,omitempty"` + Digest NullableRegistryDigestSource `json:"digest,omitempty"` + Archive NullableAnalysisArchiveSource `json:"archive,omitempty"` + Import NullableImageImportManifest `json:"import,omitempty"` +} + +// NewImageSource instantiates a new ImageSource 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 NewImageSource() *ImageSource { + this := ImageSource{} + return &this +} + +// NewImageSourceWithDefaults instantiates a new ImageSource 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 NewImageSourceWithDefaults() *ImageSource { + this := ImageSource{} + return &this +} + +// GetTag returns the Tag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageSource) GetTag() RegistryTagSource { + if o == nil || o.Tag.Get() == nil { + var ret RegistryTagSource + return ret + } + return *o.Tag.Get() +} + +// GetTagOk returns a tuple with the Tag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageSource) GetTagOk() (*RegistryTagSource, bool) { + if o == nil { + return nil, false + } + return o.Tag.Get(), o.Tag.IsSet() +} + +// HasTag returns a boolean if a field has been set. +func (o *ImageSource) HasTag() bool { + if o != nil && o.Tag.IsSet() { + return true + } + + return false +} + +// SetTag gets a reference to the given NullableRegistryTagSource and assigns it to the Tag field. +func (o *ImageSource) SetTag(v RegistryTagSource) { + o.Tag.Set(&v) +} +// SetTagNil sets the value for Tag to be an explicit nil +func (o *ImageSource) SetTagNil() { + o.Tag.Set(nil) +} + +// UnsetTag ensures that no value is present for Tag, not even an explicit nil +func (o *ImageSource) UnsetTag() { + o.Tag.Unset() +} + +// GetDigest returns the Digest field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageSource) GetDigest() RegistryDigestSource { + if o == nil || o.Digest.Get() == nil { + var ret RegistryDigestSource + return ret + } + return *o.Digest.Get() +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageSource) GetDigestOk() (*RegistryDigestSource, bool) { + if o == nil { + return nil, false + } + return o.Digest.Get(), o.Digest.IsSet() +} + +// HasDigest returns a boolean if a field has been set. +func (o *ImageSource) HasDigest() bool { + if o != nil && o.Digest.IsSet() { + return true + } + + return false +} + +// SetDigest gets a reference to the given NullableRegistryDigestSource and assigns it to the Digest field. +func (o *ImageSource) SetDigest(v RegistryDigestSource) { + o.Digest.Set(&v) +} +// SetDigestNil sets the value for Digest to be an explicit nil +func (o *ImageSource) SetDigestNil() { + o.Digest.Set(nil) +} + +// UnsetDigest ensures that no value is present for Digest, not even an explicit nil +func (o *ImageSource) UnsetDigest() { + o.Digest.Unset() +} + +// GetArchive returns the Archive field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageSource) GetArchive() AnalysisArchiveSource { + if o == nil || o.Archive.Get() == nil { + var ret AnalysisArchiveSource + return ret + } + return *o.Archive.Get() +} + +// GetArchiveOk returns a tuple with the Archive field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageSource) GetArchiveOk() (*AnalysisArchiveSource, bool) { + if o == nil { + return nil, false + } + return o.Archive.Get(), o.Archive.IsSet() +} + +// HasArchive returns a boolean if a field has been set. +func (o *ImageSource) HasArchive() bool { + if o != nil && o.Archive.IsSet() { + return true + } + + return false +} + +// SetArchive gets a reference to the given NullableAnalysisArchiveSource and assigns it to the Archive field. +func (o *ImageSource) SetArchive(v AnalysisArchiveSource) { + o.Archive.Set(&v) +} +// SetArchiveNil sets the value for Archive to be an explicit nil +func (o *ImageSource) SetArchiveNil() { + o.Archive.Set(nil) +} + +// UnsetArchive ensures that no value is present for Archive, not even an explicit nil +func (o *ImageSource) UnsetArchive() { + o.Archive.Unset() +} + +// GetImport returns the Import field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageSource) GetImport() ImageImportManifest { + if o == nil || o.Import.Get() == nil { + var ret ImageImportManifest + return ret + } + return *o.Import.Get() +} + +// GetImportOk returns a tuple with the Import field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageSource) GetImportOk() (*ImageImportManifest, bool) { + if o == nil { + return nil, false + } + return o.Import.Get(), o.Import.IsSet() +} + +// HasImport returns a boolean if a field has been set. +func (o *ImageSource) HasImport() bool { + if o != nil && o.Import.IsSet() { + return true + } + + return false +} + +// SetImport gets a reference to the given NullableImageImportManifest and assigns it to the Import field. +func (o *ImageSource) SetImport(v ImageImportManifest) { + o.Import.Set(&v) +} +// SetImportNil sets the value for Import to be an explicit nil +func (o *ImageSource) SetImportNil() { + o.Import.Set(nil) +} + +// UnsetImport ensures that no value is present for Import, not even an explicit nil +func (o *ImageSource) UnsetImport() { + o.Import.Unset() +} + +func (o ImageSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Tag.IsSet() { + toSerialize["tag"] = o.Tag.Get() + } + if o.Digest.IsSet() { + toSerialize["digest"] = o.Digest.Get() + } + if o.Archive.IsSet() { + toSerialize["archive"] = o.Archive.Get() + } + if o.Import.IsSet() { + toSerialize["import"] = o.Import.Get() + } + return json.Marshal(toSerialize) +} + +type NullableImageSource struct { + value *ImageSource + isSet bool +} + +func (v NullableImageSource) Get() *ImageSource { + return v.value } + +func (v *NullableImageSource) Set(val *ImageSource) { + v.value = val + v.isSet = true +} + +func (v NullableImageSource) IsSet() bool { + return v.isSet +} + +func (v *NullableImageSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageSource(val *ImageSource) *NullableImageSource { + return &NullableImageSource{value: val, isSet: true} +} + +func (v NullableImageSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_image_with_packages.go b/.gen/anchore/model_image_with_packages.go index 55550efcd5..f66059df23 100644 --- a/.gen/anchore/model_image_with_packages.go +++ b/.gen/anchore/model_image_with_packages.go @@ -1,17 +1,152 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ImageWithPackages An image record that contains packages type ImageWithPackages struct { - Image ImageReference `json:"image,omitempty"` + Image *ImageReference `json:"image,omitempty"` Packages []PackageReference `json:"packages,omitempty"` } + +// NewImageWithPackages instantiates a new ImageWithPackages 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 NewImageWithPackages() *ImageWithPackages { + this := ImageWithPackages{} + return &this +} + +// NewImageWithPackagesWithDefaults instantiates a new ImageWithPackages 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 NewImageWithPackagesWithDefaults() *ImageWithPackages { + this := ImageWithPackages{} + return &this +} + +// GetImage returns the Image field value if set, zero value otherwise. +func (o *ImageWithPackages) GetImage() ImageReference { + if o == nil || o.Image == nil { + var ret ImageReference + return ret + } + return *o.Image +} + +// GetImageOk returns a tuple with the Image field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageWithPackages) GetImageOk() (*ImageReference, bool) { + if o == nil || o.Image == nil { + return nil, false + } + return o.Image, true +} + +// HasImage returns a boolean if a field has been set. +func (o *ImageWithPackages) HasImage() bool { + if o != nil && o.Image != nil { + return true + } + + return false +} + +// SetImage gets a reference to the given ImageReference and assigns it to the Image field. +func (o *ImageWithPackages) SetImage(v ImageReference) { + o.Image = &v +} + +// GetPackages returns the Packages field value if set, zero value otherwise. +func (o *ImageWithPackages) GetPackages() []PackageReference { + if o == nil || o.Packages == nil { + var ret []PackageReference + return ret + } + return o.Packages +} + +// GetPackagesOk returns a tuple with the Packages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageWithPackages) GetPackagesOk() ([]PackageReference, bool) { + if o == nil || o.Packages == nil { + return nil, false + } + return o.Packages, true +} + +// HasPackages returns a boolean if a field has been set. +func (o *ImageWithPackages) HasPackages() bool { + if o != nil && o.Packages != nil { + return true + } + + return false +} + +// SetPackages gets a reference to the given []PackageReference and assigns it to the Packages field. +func (o *ImageWithPackages) SetPackages(v []PackageReference) { + o.Packages = v +} + +func (o ImageWithPackages) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Image != nil { + toSerialize["image"] = o.Image + } + if o.Packages != nil { + toSerialize["packages"] = o.Packages + } + return json.Marshal(toSerialize) +} + +type NullableImageWithPackages struct { + value *ImageWithPackages + isSet bool +} + +func (v NullableImageWithPackages) Get() *ImageWithPackages { + return v.value +} + +func (v *NullableImageWithPackages) Set(val *ImageWithPackages) { + v.value = val + v.isSet = true +} + +func (v NullableImageWithPackages) IsSet() bool { + return v.isSet +} + +func (v *NullableImageWithPackages) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageWithPackages(val *ImageWithPackages) *NullableImageWithPackages { + return &NullableImageWithPackages{value: val, isSet: true} +} + +func (v NullableImageWithPackages) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageWithPackages) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_content_digests.go b/.gen/anchore/model_import_content_digests.go new file mode 100644 index 0000000000..812a7deb8f --- /dev/null +++ b/.gen/anchore/model_import_content_digests.go @@ -0,0 +1,244 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportContentDigests Digest of content to use in the final import +type ImportContentDigests struct { + // Digest to use for the packages content + Packages string `json:"packages"` + // Digest for reference content for image config + ImageConfig string `json:"image_config"` + // Digest to reference content for the image manifest + Manifest string `json:"manifest"` + // Digest for reference content for parent manifest + ParentManifest *string `json:"parent_manifest,omitempty"` + // Digest for reference content for dockerfile + Dockerfile *string `json:"dockerfile,omitempty"` +} + +// NewImportContentDigests instantiates a new ImportContentDigests 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 NewImportContentDigests(packages string, imageConfig string, manifest string) *ImportContentDigests { + this := ImportContentDigests{} + this.Packages = packages + this.ImageConfig = imageConfig + this.Manifest = manifest + return &this +} + +// NewImportContentDigestsWithDefaults instantiates a new ImportContentDigests 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 NewImportContentDigestsWithDefaults() *ImportContentDigests { + this := ImportContentDigests{} + return &this +} + +// GetPackages returns the Packages field value +func (o *ImportContentDigests) GetPackages() string { + if o == nil { + var ret string + return ret + } + + return o.Packages +} + +// GetPackagesOk returns a tuple with the Packages field value +// and a boolean to check if the value has been set. +func (o *ImportContentDigests) GetPackagesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Packages, true +} + +// SetPackages sets field value +func (o *ImportContentDigests) SetPackages(v string) { + o.Packages = v +} + +// GetImageConfig returns the ImageConfig field value +func (o *ImportContentDigests) GetImageConfig() string { + if o == nil { + var ret string + return ret + } + + return o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value +// and a boolean to check if the value has been set. +func (o *ImportContentDigests) GetImageConfigOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageConfig, true +} + +// SetImageConfig sets field value +func (o *ImportContentDigests) SetImageConfig(v string) { + o.ImageConfig = v +} + +// GetManifest returns the Manifest field value +func (o *ImportContentDigests) GetManifest() string { + if o == nil { + var ret string + return ret + } + + return o.Manifest +} + +// GetManifestOk returns a tuple with the Manifest field value +// and a boolean to check if the value has been set. +func (o *ImportContentDigests) GetManifestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Manifest, true +} + +// SetManifest sets field value +func (o *ImportContentDigests) SetManifest(v string) { + o.Manifest = v +} + +// GetParentManifest returns the ParentManifest field value if set, zero value otherwise. +func (o *ImportContentDigests) GetParentManifest() string { + if o == nil || o.ParentManifest == nil { + var ret string + return ret + } + return *o.ParentManifest +} + +// GetParentManifestOk returns a tuple with the ParentManifest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportContentDigests) GetParentManifestOk() (*string, bool) { + if o == nil || o.ParentManifest == nil { + return nil, false + } + return o.ParentManifest, true +} + +// HasParentManifest returns a boolean if a field has been set. +func (o *ImportContentDigests) HasParentManifest() bool { + if o != nil && o.ParentManifest != nil { + return true + } + + return false +} + +// SetParentManifest gets a reference to the given string and assigns it to the ParentManifest field. +func (o *ImportContentDigests) SetParentManifest(v string) { + o.ParentManifest = &v +} + +// GetDockerfile returns the Dockerfile field value if set, zero value otherwise. +func (o *ImportContentDigests) GetDockerfile() string { + if o == nil || o.Dockerfile == nil { + var ret string + return ret + } + return *o.Dockerfile +} + +// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportContentDigests) GetDockerfileOk() (*string, bool) { + if o == nil || o.Dockerfile == nil { + return nil, false + } + return o.Dockerfile, true +} + +// HasDockerfile returns a boolean if a field has been set. +func (o *ImportContentDigests) HasDockerfile() bool { + if o != nil && o.Dockerfile != nil { + return true + } + + return false +} + +// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field. +func (o *ImportContentDigests) SetDockerfile(v string) { + o.Dockerfile = &v +} + +func (o ImportContentDigests) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["packages"] = o.Packages + } + if true { + toSerialize["image_config"] = o.ImageConfig + } + if true { + toSerialize["manifest"] = o.Manifest + } + if o.ParentManifest != nil { + toSerialize["parent_manifest"] = o.ParentManifest + } + if o.Dockerfile != nil { + toSerialize["dockerfile"] = o.Dockerfile + } + return json.Marshal(toSerialize) +} + +type NullableImportContentDigests struct { + value *ImportContentDigests + isSet bool +} + +func (v NullableImportContentDigests) Get() *ImportContentDigests { + return v.value +} + +func (v *NullableImportContentDigests) Set(val *ImportContentDigests) { + v.value = val + v.isSet = true +} + +func (v NullableImportContentDigests) IsSet() bool { + return v.isSet +} + +func (v *NullableImportContentDigests) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportContentDigests(val *ImportContentDigests) *NullableImportContentDigests { + return &NullableImportContentDigests{value: val, isSet: true} +} + +func (v NullableImportContentDigests) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportContentDigests) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_descriptor.go b/.gen/anchore/model_import_descriptor.go new file mode 100644 index 0000000000..21e08d5300 --- /dev/null +++ b/.gen/anchore/model_import_descriptor.go @@ -0,0 +1,138 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportDescriptor struct for ImportDescriptor +type ImportDescriptor struct { + Name string `json:"name"` + Version string `json:"version"` +} + +// NewImportDescriptor instantiates a new ImportDescriptor 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 NewImportDescriptor(name string, version string) *ImportDescriptor { + this := ImportDescriptor{} + this.Name = name + this.Version = version + return &this +} + +// NewImportDescriptorWithDefaults instantiates a new ImportDescriptor 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 NewImportDescriptorWithDefaults() *ImportDescriptor { + this := ImportDescriptor{} + return &this +} + +// GetName returns the Name field value +func (o *ImportDescriptor) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ImportDescriptor) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ImportDescriptor) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value +func (o *ImportDescriptor) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ImportDescriptor) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ImportDescriptor) SetVersion(v string) { + o.Version = v +} + +func (o ImportDescriptor) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableImportDescriptor struct { + value *ImportDescriptor + isSet bool +} + +func (v NullableImportDescriptor) Get() *ImportDescriptor { + return v.value +} + +func (v *NullableImportDescriptor) Set(val *ImportDescriptor) { + v.value = val + v.isSet = true +} + +func (v NullableImportDescriptor) IsSet() bool { + return v.isSet +} + +func (v *NullableImportDescriptor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportDescriptor(val *ImportDescriptor) *NullableImportDescriptor { + return &NullableImportDescriptor{value: val, isSet: true} +} + +func (v NullableImportDescriptor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportDescriptor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_distribution.go b/.gen/anchore/model_import_distribution.go new file mode 100644 index 0000000000..52c4c0e502 --- /dev/null +++ b/.gen/anchore/model_import_distribution.go @@ -0,0 +1,167 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportDistribution struct for ImportDistribution +type ImportDistribution struct { + Name string `json:"name"` + Version string `json:"version"` + IdLike string `json:"idLike"` +} + +// NewImportDistribution instantiates a new ImportDistribution 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 NewImportDistribution(name string, version string, idLike string) *ImportDistribution { + this := ImportDistribution{} + this.Name = name + this.Version = version + this.IdLike = idLike + return &this +} + +// NewImportDistributionWithDefaults instantiates a new ImportDistribution 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 NewImportDistributionWithDefaults() *ImportDistribution { + this := ImportDistribution{} + return &this +} + +// GetName returns the Name field value +func (o *ImportDistribution) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ImportDistribution) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ImportDistribution) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value +func (o *ImportDistribution) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ImportDistribution) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ImportDistribution) SetVersion(v string) { + o.Version = v +} + +// GetIdLike returns the IdLike field value +func (o *ImportDistribution) GetIdLike() string { + if o == nil { + var ret string + return ret + } + + return o.IdLike +} + +// GetIdLikeOk returns a tuple with the IdLike field value +// and a boolean to check if the value has been set. +func (o *ImportDistribution) GetIdLikeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IdLike, true +} + +// SetIdLike sets field value +func (o *ImportDistribution) SetIdLike(v string) { + o.IdLike = v +} + +func (o ImportDistribution) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["version"] = o.Version + } + if true { + toSerialize["idLike"] = o.IdLike + } + return json.Marshal(toSerialize) +} + +type NullableImportDistribution struct { + value *ImportDistribution + isSet bool +} + +func (v NullableImportDistribution) Get() *ImportDistribution { + return v.value +} + +func (v *NullableImportDistribution) Set(val *ImportDistribution) { + v.value = val + v.isSet = true +} + +func (v NullableImportDistribution) IsSet() bool { + return v.isSet +} + +func (v *NullableImportDistribution) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportDistribution(val *ImportDistribution) *NullableImportDistribution { + return &NullableImportDistribution{value: val, isSet: true} +} + +func (v NullableImportDistribution) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportDistribution) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_package.go b/.gen/anchore/model_import_package.go new file mode 100644 index 0000000000..48ef44a7fa --- /dev/null +++ b/.gen/anchore/model_import_package.go @@ -0,0 +1,456 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportPackage struct for ImportPackage +type ImportPackage struct { + Id *string `json:"id,omitempty"` + Name string `json:"name"` + Version string `json:"version"` + Type string `json:"type"` + FoundBy *string `json:"foundBy,omitempty"` + Locations []ImportPackageLocation `json:"locations"` + Licenses []string `json:"licenses"` + Language string `json:"language"` + Cpes []string `json:"cpes"` + Purl *string `json:"purl,omitempty"` + MetadataType string `json:"metadataType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewImportPackage instantiates a new ImportPackage 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 NewImportPackage(name string, version string, type_ string, locations []ImportPackageLocation, licenses []string, language string, cpes []string, metadataType string) *ImportPackage { + this := ImportPackage{} + this.Name = name + this.Version = version + this.Type = type_ + this.Locations = locations + this.Licenses = licenses + this.Language = language + this.Cpes = cpes + this.MetadataType = metadataType + return &this +} + +// NewImportPackageWithDefaults instantiates a new ImportPackage 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 NewImportPackageWithDefaults() *ImportPackage { + this := ImportPackage{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ImportPackage) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ImportPackage) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ImportPackage) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *ImportPackage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ImportPackage) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value +func (o *ImportPackage) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ImportPackage) SetVersion(v string) { + o.Version = v +} + +// GetType returns the Type field value +func (o *ImportPackage) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ImportPackage) SetType(v string) { + o.Type = v +} + +// GetFoundBy returns the FoundBy field value if set, zero value otherwise. +func (o *ImportPackage) GetFoundBy() string { + if o == nil || o.FoundBy == nil { + var ret string + return ret + } + return *o.FoundBy +} + +// GetFoundByOk returns a tuple with the FoundBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetFoundByOk() (*string, bool) { + if o == nil || o.FoundBy == nil { + return nil, false + } + return o.FoundBy, true +} + +// HasFoundBy returns a boolean if a field has been set. +func (o *ImportPackage) HasFoundBy() bool { + if o != nil && o.FoundBy != nil { + return true + } + + return false +} + +// SetFoundBy gets a reference to the given string and assigns it to the FoundBy field. +func (o *ImportPackage) SetFoundBy(v string) { + o.FoundBy = &v +} + +// GetLocations returns the Locations field value +func (o *ImportPackage) GetLocations() []ImportPackageLocation { + if o == nil { + var ret []ImportPackageLocation + return ret + } + + return o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetLocationsOk() ([]ImportPackageLocation, bool) { + if o == nil { + return nil, false + } + return o.Locations, true +} + +// SetLocations sets field value +func (o *ImportPackage) SetLocations(v []ImportPackageLocation) { + o.Locations = v +} + +// GetLicenses returns the Licenses field value +func (o *ImportPackage) GetLicenses() []string { + if o == nil { + var ret []string + return ret + } + + return o.Licenses +} + +// GetLicensesOk returns a tuple with the Licenses field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetLicensesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Licenses, true +} + +// SetLicenses sets field value +func (o *ImportPackage) SetLicenses(v []string) { + o.Licenses = v +} + +// GetLanguage returns the Language field value +func (o *ImportPackage) GetLanguage() string { + if o == nil { + var ret string + return ret + } + + return o.Language +} + +// GetLanguageOk returns a tuple with the Language field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetLanguageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Language, true +} + +// SetLanguage sets field value +func (o *ImportPackage) SetLanguage(v string) { + o.Language = v +} + +// GetCpes returns the Cpes field value +func (o *ImportPackage) GetCpes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Cpes +} + +// GetCpesOk returns a tuple with the Cpes field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetCpesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Cpes, true +} + +// SetCpes sets field value +func (o *ImportPackage) SetCpes(v []string) { + o.Cpes = v +} + +// GetPurl returns the Purl field value if set, zero value otherwise. +func (o *ImportPackage) GetPurl() string { + if o == nil || o.Purl == nil { + var ret string + return ret + } + return *o.Purl +} + +// GetPurlOk returns a tuple with the Purl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetPurlOk() (*string, bool) { + if o == nil || o.Purl == nil { + return nil, false + } + return o.Purl, true +} + +// HasPurl returns a boolean if a field has been set. +func (o *ImportPackage) HasPurl() bool { + if o != nil && o.Purl != nil { + return true + } + + return false +} + +// SetPurl gets a reference to the given string and assigns it to the Purl field. +func (o *ImportPackage) SetPurl(v string) { + o.Purl = &v +} + +// GetMetadataType returns the MetadataType field value +func (o *ImportPackage) GetMetadataType() string { + if o == nil { + var ret string + return ret + } + + return o.MetadataType +} + +// GetMetadataTypeOk returns a tuple with the MetadataType field value +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetMetadataTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetadataType, true +} + +// SetMetadataType sets field value +func (o *ImportPackage) SetMetadataType(v string) { + o.MetadataType = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ImportPackage) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackage) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ImportPackage) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ImportPackage) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o ImportPackage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["version"] = o.Version + } + if true { + toSerialize["type"] = o.Type + } + if o.FoundBy != nil { + toSerialize["foundBy"] = o.FoundBy + } + if true { + toSerialize["locations"] = o.Locations + } + if true { + toSerialize["licenses"] = o.Licenses + } + if true { + toSerialize["language"] = o.Language + } + if true { + toSerialize["cpes"] = o.Cpes + } + if o.Purl != nil { + toSerialize["purl"] = o.Purl + } + if true { + toSerialize["metadataType"] = o.MetadataType + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return json.Marshal(toSerialize) +} + +type NullableImportPackage struct { + value *ImportPackage + isSet bool +} + +func (v NullableImportPackage) Get() *ImportPackage { + return v.value +} + +func (v *NullableImportPackage) Set(val *ImportPackage) { + v.value = val + v.isSet = true +} + +func (v NullableImportPackage) IsSet() bool { + return v.isSet +} + +func (v *NullableImportPackage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportPackage(val *ImportPackage) *NullableImportPackage { + return &NullableImportPackage{value: val, isSet: true} +} + +func (v NullableImportPackage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportPackage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_package_location.go b/.gen/anchore/model_import_package_location.go new file mode 100644 index 0000000000..2d3a52f6e5 --- /dev/null +++ b/.gen/anchore/model_import_package_location.go @@ -0,0 +1,145 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportPackageLocation struct for ImportPackageLocation +type ImportPackageLocation struct { + Path string `json:"path"` + LayerID *string `json:"layerID,omitempty"` +} + +// NewImportPackageLocation instantiates a new ImportPackageLocation 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 NewImportPackageLocation(path string) *ImportPackageLocation { + this := ImportPackageLocation{} + this.Path = path + return &this +} + +// NewImportPackageLocationWithDefaults instantiates a new ImportPackageLocation 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 NewImportPackageLocationWithDefaults() *ImportPackageLocation { + this := ImportPackageLocation{} + return &this +} + +// GetPath returns the Path field value +func (o *ImportPackageLocation) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *ImportPackageLocation) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *ImportPackageLocation) SetPath(v string) { + o.Path = v +} + +// GetLayerID returns the LayerID field value if set, zero value otherwise. +func (o *ImportPackageLocation) GetLayerID() string { + if o == nil || o.LayerID == nil { + var ret string + return ret + } + return *o.LayerID +} + +// GetLayerIDOk returns a tuple with the LayerID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackageLocation) GetLayerIDOk() (*string, bool) { + if o == nil || o.LayerID == nil { + return nil, false + } + return o.LayerID, true +} + +// HasLayerID returns a boolean if a field has been set. +func (o *ImportPackageLocation) HasLayerID() bool { + if o != nil && o.LayerID != nil { + return true + } + + return false +} + +// SetLayerID gets a reference to the given string and assigns it to the LayerID field. +func (o *ImportPackageLocation) SetLayerID(v string) { + o.LayerID = &v +} + +func (o ImportPackageLocation) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["path"] = o.Path + } + if o.LayerID != nil { + toSerialize["layerID"] = o.LayerID + } + return json.Marshal(toSerialize) +} + +type NullableImportPackageLocation struct { + value *ImportPackageLocation + isSet bool +} + +func (v NullableImportPackageLocation) Get() *ImportPackageLocation { + return v.value +} + +func (v *NullableImportPackageLocation) Set(val *ImportPackageLocation) { + v.value = val + v.isSet = true +} + +func (v NullableImportPackageLocation) IsSet() bool { + return v.isSet +} + +func (v *NullableImportPackageLocation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportPackageLocation(val *ImportPackageLocation) *NullableImportPackageLocation { + return &NullableImportPackageLocation{value: val, isSet: true} +} + +func (v NullableImportPackageLocation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportPackageLocation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_package_relationship.go b/.gen/anchore/model_import_package_relationship.go new file mode 100644 index 0000000000..f1e570ac8b --- /dev/null +++ b/.gen/anchore/model_import_package_relationship.go @@ -0,0 +1,203 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportPackageRelationship struct for ImportPackageRelationship +type ImportPackageRelationship struct { + Parent string `json:"parent"` + Child string `json:"child"` + Type string `json:"type"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewImportPackageRelationship instantiates a new ImportPackageRelationship 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 NewImportPackageRelationship(parent string, child string, type_ string) *ImportPackageRelationship { + this := ImportPackageRelationship{} + this.Parent = parent + this.Child = child + this.Type = type_ + return &this +} + +// NewImportPackageRelationshipWithDefaults instantiates a new ImportPackageRelationship 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 NewImportPackageRelationshipWithDefaults() *ImportPackageRelationship { + this := ImportPackageRelationship{} + return &this +} + +// GetParent returns the Parent field value +func (o *ImportPackageRelationship) GetParent() string { + if o == nil { + var ret string + return ret + } + + return o.Parent +} + +// GetParentOk returns a tuple with the Parent field value +// and a boolean to check if the value has been set. +func (o *ImportPackageRelationship) GetParentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Parent, true +} + +// SetParent sets field value +func (o *ImportPackageRelationship) SetParent(v string) { + o.Parent = v +} + +// GetChild returns the Child field value +func (o *ImportPackageRelationship) GetChild() string { + if o == nil { + var ret string + return ret + } + + return o.Child +} + +// GetChildOk returns a tuple with the Child field value +// and a boolean to check if the value has been set. +func (o *ImportPackageRelationship) GetChildOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Child, true +} + +// SetChild sets field value +func (o *ImportPackageRelationship) SetChild(v string) { + o.Child = v +} + +// GetType returns the Type field value +func (o *ImportPackageRelationship) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ImportPackageRelationship) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ImportPackageRelationship) SetType(v string) { + o.Type = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ImportPackageRelationship) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackageRelationship) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ImportPackageRelationship) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ImportPackageRelationship) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o ImportPackageRelationship) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["parent"] = o.Parent + } + if true { + toSerialize["child"] = o.Child + } + if true { + toSerialize["type"] = o.Type + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return json.Marshal(toSerialize) +} + +type NullableImportPackageRelationship struct { + value *ImportPackageRelationship + isSet bool +} + +func (v NullableImportPackageRelationship) Get() *ImportPackageRelationship { + return v.value +} + +func (v *NullableImportPackageRelationship) Set(val *ImportPackageRelationship) { + v.value = val + v.isSet = true +} + +func (v NullableImportPackageRelationship) IsSet() bool { + return v.isSet +} + +func (v *NullableImportPackageRelationship) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportPackageRelationship(val *ImportPackageRelationship) *NullableImportPackageRelationship { + return &NullableImportPackageRelationship{value: val, isSet: true} +} + +func (v NullableImportPackageRelationship) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportPackageRelationship) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_schema.go b/.gen/anchore/model_import_schema.go new file mode 100644 index 0000000000..e668a79b62 --- /dev/null +++ b/.gen/anchore/model_import_schema.go @@ -0,0 +1,138 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportSchema struct for ImportSchema +type ImportSchema struct { + Version string `json:"version"` + Url string `json:"url"` +} + +// NewImportSchema instantiates a new ImportSchema 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 NewImportSchema(version string, url string) *ImportSchema { + this := ImportSchema{} + this.Version = version + this.Url = url + return &this +} + +// NewImportSchemaWithDefaults instantiates a new ImportSchema 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 NewImportSchemaWithDefaults() *ImportSchema { + this := ImportSchema{} + return &this +} + +// GetVersion returns the Version field value +func (o *ImportSchema) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ImportSchema) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ImportSchema) SetVersion(v string) { + o.Version = v +} + +// GetUrl returns the Url field value +func (o *ImportSchema) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ImportSchema) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ImportSchema) SetUrl(v string) { + o.Url = v +} + +func (o ImportSchema) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["version"] = o.Version + } + if true { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableImportSchema struct { + value *ImportSchema + isSet bool +} + +func (v NullableImportSchema) Get() *ImportSchema { + return v.value +} + +func (v *NullableImportSchema) Set(val *ImportSchema) { + v.value = val + v.isSet = true +} + +func (v NullableImportSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableImportSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportSchema(val *ImportSchema) *NullableImportSchema { + return &NullableImportSchema{value: val, isSet: true} +} + +func (v NullableImportSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_import_source.go b/.gen/anchore/model_import_source.go new file mode 100644 index 0000000000..5788c85eee --- /dev/null +++ b/.gen/anchore/model_import_source.go @@ -0,0 +1,138 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// ImportSource struct for ImportSource +type ImportSource struct { + Type string `json:"type"` + Target map[string]interface{} `json:"target"` +} + +// NewImportSource instantiates a new ImportSource 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 NewImportSource(type_ string, target map[string]interface{}) *ImportSource { + this := ImportSource{} + this.Type = type_ + this.Target = target + return &this +} + +// NewImportSourceWithDefaults instantiates a new ImportSource 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 NewImportSourceWithDefaults() *ImportSource { + this := ImportSource{} + return &this +} + +// GetType returns the Type field value +func (o *ImportSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ImportSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ImportSource) SetType(v string) { + o.Type = v +} + +// GetTarget returns the Target field value +func (o *ImportSource) GetTarget() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *ImportSource) GetTargetOk() (map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Target, true +} + +// SetTarget sets field value +func (o *ImportSource) SetTarget(v map[string]interface{}) { + o.Target = v +} + +func (o ImportSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["type"] = o.Type + } + if true { + toSerialize["target"] = o.Target + } + return json.Marshal(toSerialize) +} + +type NullableImportSource struct { + value *ImportSource + isSet bool +} + +func (v NullableImportSource) Get() *ImportSource { + return v.value +} + +func (v *NullableImportSource) Set(val *ImportSource) { + v.value = val + v.isSet = true +} + +func (v NullableImportSource) IsSet() bool { + return v.isSet +} + +func (v *NullableImportSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportSource(val *ImportSource) *NullableImportSource { + return &NullableImportSource{value: val, isSet: true} +} + +func (v NullableImportSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_local_analysis_source.go b/.gen/anchore/model_local_analysis_source.go new file mode 100644 index 0000000000..f94243e498 --- /dev/null +++ b/.gen/anchore/model_local_analysis_source.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// LocalAnalysisSource struct for LocalAnalysisSource +type LocalAnalysisSource struct { + Digest *string `json:"digest,omitempty"` +} + +// NewLocalAnalysisSource instantiates a new LocalAnalysisSource 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 NewLocalAnalysisSource() *LocalAnalysisSource { + this := LocalAnalysisSource{} + return &this +} + +// NewLocalAnalysisSourceWithDefaults instantiates a new LocalAnalysisSource 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 NewLocalAnalysisSourceWithDefaults() *LocalAnalysisSource { + this := LocalAnalysisSource{} + return &this +} + +// GetDigest returns the Digest field value if set, zero value otherwise. +func (o *LocalAnalysisSource) GetDigest() string { + if o == nil || o.Digest == nil { + var ret string + return ret + } + return *o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocalAnalysisSource) GetDigestOk() (*string, bool) { + if o == nil || o.Digest == nil { + return nil, false + } + return o.Digest, true +} + +// HasDigest returns a boolean if a field has been set. +func (o *LocalAnalysisSource) HasDigest() bool { + if o != nil && o.Digest != nil { + return true + } + + return false +} + +// SetDigest gets a reference to the given string and assigns it to the Digest field. +func (o *LocalAnalysisSource) SetDigest(v string) { + o.Digest = &v +} + +func (o LocalAnalysisSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Digest != nil { + toSerialize["digest"] = o.Digest + } + return json.Marshal(toSerialize) +} + +type NullableLocalAnalysisSource struct { + value *LocalAnalysisSource + isSet bool +} + +func (v NullableLocalAnalysisSource) Get() *LocalAnalysisSource { + return v.value +} + +func (v *NullableLocalAnalysisSource) Set(val *LocalAnalysisSource) { + v.value = val + v.isSet = true +} + +func (v NullableLocalAnalysisSource) IsSet() bool { + return v.isSet +} + +func (v *NullableLocalAnalysisSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocalAnalysisSource(val *LocalAnalysisSource) *NullableLocalAnalysisSource { + return &NullableLocalAnalysisSource{value: val, isSet: true} +} + +func (v NullableLocalAnalysisSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocalAnalysisSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_malware_scan.go b/.gen/anchore/model_malware_scan.go new file mode 100644 index 0000000000..dc0b7a1625 --- /dev/null +++ b/.gen/anchore/model_malware_scan.go @@ -0,0 +1,227 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// MalwareScan A single scan from a scanner +type MalwareScan struct { + // Indicates if the scanner is enabled + Enabled *bool `json:"enabled,omitempty"` + // The name of the scanner that produced the finding + Scanner *string `json:"scanner,omitempty"` + // Open schema for scanner-specific metadata related to the scan result + Metadata map[string]interface{} `json:"metadata,omitempty"` + Findings []MalwareScanFindingsInner `json:"findings,omitempty"` +} + +// NewMalwareScan instantiates a new MalwareScan 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 NewMalwareScan() *MalwareScan { + this := MalwareScan{} + return &this +} + +// NewMalwareScanWithDefaults instantiates a new MalwareScan 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 NewMalwareScanWithDefaults() *MalwareScan { + this := MalwareScan{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *MalwareScan) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MalwareScan) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *MalwareScan) HasEnabled() bool { + if o != nil && o.Enabled != nil { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *MalwareScan) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetScanner returns the Scanner field value if set, zero value otherwise. +func (o *MalwareScan) GetScanner() string { + if o == nil || o.Scanner == nil { + var ret string + return ret + } + return *o.Scanner +} + +// GetScannerOk returns a tuple with the Scanner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MalwareScan) GetScannerOk() (*string, bool) { + if o == nil || o.Scanner == nil { + return nil, false + } + return o.Scanner, true +} + +// HasScanner returns a boolean if a field has been set. +func (o *MalwareScan) HasScanner() bool { + if o != nil && o.Scanner != nil { + return true + } + + return false +} + +// SetScanner gets a reference to the given string and assigns it to the Scanner field. +func (o *MalwareScan) SetScanner(v string) { + o.Scanner = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *MalwareScan) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MalwareScan) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *MalwareScan) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *MalwareScan) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetFindings returns the Findings field value if set, zero value otherwise. +func (o *MalwareScan) GetFindings() []MalwareScanFindingsInner { + if o == nil || o.Findings == nil { + var ret []MalwareScanFindingsInner + return ret + } + return o.Findings +} + +// GetFindingsOk returns a tuple with the Findings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MalwareScan) GetFindingsOk() ([]MalwareScanFindingsInner, bool) { + if o == nil || o.Findings == nil { + return nil, false + } + return o.Findings, true +} + +// HasFindings returns a boolean if a field has been set. +func (o *MalwareScan) HasFindings() bool { + if o != nil && o.Findings != nil { + return true + } + + return false +} + +// SetFindings gets a reference to the given []MalwareScanFindingsInner and assigns it to the Findings field. +func (o *MalwareScan) SetFindings(v []MalwareScanFindingsInner) { + o.Findings = v +} + +func (o MalwareScan) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + if o.Scanner != nil { + toSerialize["scanner"] = o.Scanner + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Findings != nil { + toSerialize["findings"] = o.Findings + } + return json.Marshal(toSerialize) +} + +type NullableMalwareScan struct { + value *MalwareScan + isSet bool +} + +func (v NullableMalwareScan) Get() *MalwareScan { + return v.value +} + +func (v *NullableMalwareScan) Set(val *MalwareScan) { + v.value = val + v.isSet = true +} + +func (v NullableMalwareScan) IsSet() bool { + return v.isSet +} + +func (v *NullableMalwareScan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMalwareScan(val *MalwareScan) *NullableMalwareScan { + return &NullableMalwareScan{value: val, isSet: true} +} + +func (v NullableMalwareScan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMalwareScan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_malware_scan_findings_inner.go b/.gen/anchore/model_malware_scan_findings_inner.go new file mode 100644 index 0000000000..8b0180ade2 --- /dev/null +++ b/.gen/anchore/model_malware_scan_findings_inner.go @@ -0,0 +1,154 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// MalwareScanFindingsInner struct for MalwareScanFindingsInner +type MalwareScanFindingsInner struct { + // A path for a file in the image's rootfs + Path *string `json:"path,omitempty"` + // The malware signature found at the path + Signature *string `json:"signature,omitempty"` +} + +// NewMalwareScanFindingsInner instantiates a new MalwareScanFindingsInner 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 NewMalwareScanFindingsInner() *MalwareScanFindingsInner { + this := MalwareScanFindingsInner{} + return &this +} + +// NewMalwareScanFindingsInnerWithDefaults instantiates a new MalwareScanFindingsInner 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 NewMalwareScanFindingsInnerWithDefaults() *MalwareScanFindingsInner { + this := MalwareScanFindingsInner{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *MalwareScanFindingsInner) GetPath() string { + if o == nil || o.Path == nil { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MalwareScanFindingsInner) GetPathOk() (*string, bool) { + if o == nil || o.Path == nil { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *MalwareScanFindingsInner) HasPath() bool { + if o != nil && o.Path != nil { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *MalwareScanFindingsInner) SetPath(v string) { + o.Path = &v +} + +// GetSignature returns the Signature field value if set, zero value otherwise. +func (o *MalwareScanFindingsInner) GetSignature() string { + if o == nil || o.Signature == nil { + var ret string + return ret + } + return *o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MalwareScanFindingsInner) GetSignatureOk() (*string, bool) { + if o == nil || o.Signature == nil { + return nil, false + } + return o.Signature, true +} + +// HasSignature returns a boolean if a field has been set. +func (o *MalwareScanFindingsInner) HasSignature() bool { + if o != nil && o.Signature != nil { + return true + } + + return false +} + +// SetSignature gets a reference to the given string and assigns it to the Signature field. +func (o *MalwareScanFindingsInner) SetSignature(v string) { + o.Signature = &v +} + +func (o MalwareScanFindingsInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Path != nil { + toSerialize["path"] = o.Path + } + if o.Signature != nil { + toSerialize["signature"] = o.Signature + } + return json.Marshal(toSerialize) +} + +type NullableMalwareScanFindingsInner struct { + value *MalwareScanFindingsInner + isSet bool +} + +func (v NullableMalwareScanFindingsInner) Get() *MalwareScanFindingsInner { + return v.value +} + +func (v *NullableMalwareScanFindingsInner) Set(val *MalwareScanFindingsInner) { + v.value = val + v.isSet = true +} + +func (v NullableMalwareScanFindingsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableMalwareScanFindingsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMalwareScanFindingsInner(val *MalwareScanFindingsInner) *NullableMalwareScanFindingsInner { + return &NullableMalwareScanFindingsInner{value: val, isSet: true} +} + +func (v NullableMalwareScanFindingsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMalwareScanFindingsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_mapping_rule.go b/.gen/anchore/model_mapping_rule.go index ca160cc9b5..73abf3294f 100644 --- a/.gen/anchore/model_mapping_rule.go +++ b/.gen/anchore/model_mapping_rule.go @@ -1,25 +1,342 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // MappingRule struct for MappingRule type MappingRule struct { - Id string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Name string `json:"name"` WhitelistIds []string `json:"whitelist_ids"` // Optional single policy to evalute, if set will override any value in policy_ids, for backwards compatibility. Generally, policy_ids should be used even with a array of length 1. - PolicyId string `json:"policy_id,omitempty"` + PolicyId *string `json:"policy_id,omitempty"` // List of policyIds to evaluate in order, to completion PolicyIds []string `json:"policy_ids,omitempty"` Registry string `json:"registry"` Repository string `json:"repository"` Image ImageRef `json:"image"` } + +// NewMappingRule instantiates a new MappingRule 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 NewMappingRule(name string, registry string, repository string, image ImageRef) *MappingRule { + this := MappingRule{} + this.Name = name + this.Registry = registry + this.Repository = repository + this.Image = image + return &this +} + +// NewMappingRuleWithDefaults instantiates a new MappingRule 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 NewMappingRuleWithDefaults() *MappingRule { + this := MappingRule{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MappingRule) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MappingRule) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MappingRule) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MappingRule) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *MappingRule) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MappingRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MappingRule) SetName(v string) { + o.Name = v +} + +// GetWhitelistIds returns the WhitelistIds field value if set, zero value otherwise. +func (o *MappingRule) GetWhitelistIds() []string { + if o == nil || o.WhitelistIds == nil { + var ret []string + return ret + } + return o.WhitelistIds +} + +// GetWhitelistIdsOk returns a tuple with the WhitelistIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MappingRule) GetWhitelistIdsOk() ([]string, bool) { + if o == nil || o.WhitelistIds == nil { + return nil, false + } + return o.WhitelistIds, true +} + +// HasWhitelistIds returns a boolean if a field has been set. +func (o *MappingRule) HasWhitelistIds() bool { + if o != nil && o.WhitelistIds != nil { + return true + } + + return false +} + +// SetWhitelistIds gets a reference to the given []string and assigns it to the WhitelistIds field. +func (o *MappingRule) SetWhitelistIds(v []string) { + o.WhitelistIds = v +} + +// GetPolicyId returns the PolicyId field value if set, zero value otherwise. +func (o *MappingRule) GetPolicyId() string { + if o == nil || o.PolicyId == nil { + var ret string + return ret + } + return *o.PolicyId +} + +// GetPolicyIdOk returns a tuple with the PolicyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MappingRule) GetPolicyIdOk() (*string, bool) { + if o == nil || o.PolicyId == nil { + return nil, false + } + return o.PolicyId, true +} + +// HasPolicyId returns a boolean if a field has been set. +func (o *MappingRule) HasPolicyId() bool { + if o != nil && o.PolicyId != nil { + return true + } + + return false +} + +// SetPolicyId gets a reference to the given string and assigns it to the PolicyId field. +func (o *MappingRule) SetPolicyId(v string) { + o.PolicyId = &v +} + +// GetPolicyIds returns the PolicyIds field value if set, zero value otherwise. +func (o *MappingRule) GetPolicyIds() []string { + if o == nil || o.PolicyIds == nil { + var ret []string + return ret + } + return o.PolicyIds +} + +// GetPolicyIdsOk returns a tuple with the PolicyIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MappingRule) GetPolicyIdsOk() ([]string, bool) { + if o == nil || o.PolicyIds == nil { + return nil, false + } + return o.PolicyIds, true +} + +// HasPolicyIds returns a boolean if a field has been set. +func (o *MappingRule) HasPolicyIds() bool { + if o != nil && o.PolicyIds != nil { + return true + } + + return false +} + +// SetPolicyIds gets a reference to the given []string and assigns it to the PolicyIds field. +func (o *MappingRule) SetPolicyIds(v []string) { + o.PolicyIds = v +} + +// GetRegistry returns the Registry field value +func (o *MappingRule) GetRegistry() string { + if o == nil { + var ret string + return ret + } + + return o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value +// and a boolean to check if the value has been set. +func (o *MappingRule) GetRegistryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Registry, true +} + +// SetRegistry sets field value +func (o *MappingRule) SetRegistry(v string) { + o.Registry = v +} + +// GetRepository returns the Repository field value +func (o *MappingRule) GetRepository() string { + if o == nil { + var ret string + return ret + } + + return o.Repository +} + +// GetRepositoryOk returns a tuple with the Repository field value +// and a boolean to check if the value has been set. +func (o *MappingRule) GetRepositoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Repository, true +} + +// SetRepository sets field value +func (o *MappingRule) SetRepository(v string) { + o.Repository = v +} + +// GetImage returns the Image field value +func (o *MappingRule) GetImage() ImageRef { + if o == nil { + var ret ImageRef + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *MappingRule) GetImageOk() (*ImageRef, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *MappingRule) SetImage(v ImageRef) { + o.Image = v +} + +func (o MappingRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["name"] = o.Name + } + if o.WhitelistIds != nil { + toSerialize["whitelist_ids"] = o.WhitelistIds + } + if o.PolicyId != nil { + toSerialize["policy_id"] = o.PolicyId + } + if o.PolicyIds != nil { + toSerialize["policy_ids"] = o.PolicyIds + } + if true { + toSerialize["registry"] = o.Registry + } + if true { + toSerialize["repository"] = o.Repository + } + if true { + toSerialize["image"] = o.Image + } + return json.Marshal(toSerialize) +} + +type NullableMappingRule struct { + value *MappingRule + isSet bool +} + +func (v NullableMappingRule) Get() *MappingRule { + return v.value +} + +func (v *NullableMappingRule) Set(val *MappingRule) { + v.value = val + v.isSet = true +} + +func (v NullableMappingRule) IsSet() bool { + return v.isSet +} + +func (v *NullableMappingRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMappingRule(val *MappingRule) *NullableMappingRule { + return &NullableMappingRule{value: val, isSet: true} +} + +func (v NullableMappingRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMappingRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_metadata_response.go b/.gen/anchore/model_metadata_response.go index 90f9eaaa06..c5ba987785 100644 --- a/.gen/anchore/model_metadata_response.go +++ b/.gen/anchore/model_metadata_response.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // MetadataResponse Generic wrapper for metadata listings from images type MetadataResponse struct { - ImageDigest string `json:"imageDigest,omitempty"` - MetadataType string `json:"metadata_type,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + MetadataType *string `json:"metadata_type,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` } + +// NewMetadataResponse instantiates a new MetadataResponse 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 NewMetadataResponse() *MetadataResponse { + this := MetadataResponse{} + return &this +} + +// NewMetadataResponseWithDefaults instantiates a new MetadataResponse 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 NewMetadataResponseWithDefaults() *MetadataResponse { + this := MetadataResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *MetadataResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *MetadataResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *MetadataResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetMetadataType returns the MetadataType field value if set, zero value otherwise. +func (o *MetadataResponse) GetMetadataType() string { + if o == nil || o.MetadataType == nil { + var ret string + return ret + } + return *o.MetadataType +} + +// GetMetadataTypeOk returns a tuple with the MetadataType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataResponse) GetMetadataTypeOk() (*string, bool) { + if o == nil || o.MetadataType == nil { + return nil, false + } + return o.MetadataType, true +} + +// HasMetadataType returns a boolean if a field has been set. +func (o *MetadataResponse) HasMetadataType() bool { + if o != nil && o.MetadataType != nil { + return true + } + + return false +} + +// SetMetadataType gets a reference to the given string and assigns it to the MetadataType field. +func (o *MetadataResponse) SetMetadataType(v string) { + o.MetadataType = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *MetadataResponse) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataResponse) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *MetadataResponse) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *MetadataResponse) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o MetadataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.MetadataType != nil { + toSerialize["metadata_type"] = o.MetadataType + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return json.Marshal(toSerialize) +} + +type NullableMetadataResponse struct { + value *MetadataResponse + isSet bool +} + +func (v NullableMetadataResponse) Get() *MetadataResponse { + return v.value +} + +func (v *NullableMetadataResponse) Set(val *MetadataResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMetadataResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadataResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadataResponse(val *MetadataResponse) *NullableMetadataResponse { + return &NullableMetadataResponse{value: val, isSet: true} +} + +func (v NullableMetadataResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadataResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_notification_base.go b/.gen/anchore/model_notification_base.go new file mode 100644 index 0000000000..a401ede3f0 --- /dev/null +++ b/.gen/anchore/model_notification_base.go @@ -0,0 +1,418 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// NotificationBase base object for Notifications (every notification has this basic structure) +type NotificationBase struct { + QueueId *string `json:"queueId,omitempty"` + UserId *string `json:"userId,omitempty"` + DataId *string `json:"dataId,omitempty"` + CreatedAt *int32 `json:"created_at,omitempty"` + LastUpdated *int32 `json:"last_updated,omitempty"` + RecordStateKey *string `json:"record_state_key,omitempty"` + RecordStateVal NullableString `json:"record_state_val,omitempty"` + Tries *int32 `json:"tries,omitempty"` + MaxTries *int32 `json:"max_tries,omitempty"` +} + +// NewNotificationBase instantiates a new NotificationBase 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 NewNotificationBase() *NotificationBase { + this := NotificationBase{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// NewNotificationBaseWithDefaults instantiates a new NotificationBase 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 NewNotificationBaseWithDefaults() *NotificationBase { + this := NotificationBase{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// GetQueueId returns the QueueId field value if set, zero value otherwise. +func (o *NotificationBase) GetQueueId() string { + if o == nil || o.QueueId == nil { + var ret string + return ret + } + return *o.QueueId +} + +// GetQueueIdOk returns a tuple with the QueueId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetQueueIdOk() (*string, bool) { + if o == nil || o.QueueId == nil { + return nil, false + } + return o.QueueId, true +} + +// HasQueueId returns a boolean if a field has been set. +func (o *NotificationBase) HasQueueId() bool { + if o != nil && o.QueueId != nil { + return true + } + + return false +} + +// SetQueueId gets a reference to the given string and assigns it to the QueueId field. +func (o *NotificationBase) SetQueueId(v string) { + o.QueueId = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *NotificationBase) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *NotificationBase) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *NotificationBase) SetUserId(v string) { + o.UserId = &v +} + +// GetDataId returns the DataId field value if set, zero value otherwise. +func (o *NotificationBase) GetDataId() string { + if o == nil || o.DataId == nil { + var ret string + return ret + } + return *o.DataId +} + +// GetDataIdOk returns a tuple with the DataId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetDataIdOk() (*string, bool) { + if o == nil || o.DataId == nil { + return nil, false + } + return o.DataId, true +} + +// HasDataId returns a boolean if a field has been set. +func (o *NotificationBase) HasDataId() bool { + if o != nil && o.DataId != nil { + return true + } + + return false +} + +// SetDataId gets a reference to the given string and assigns it to the DataId field. +func (o *NotificationBase) SetDataId(v string) { + o.DataId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NotificationBase) GetCreatedAt() int32 { + if o == nil || o.CreatedAt == nil { + var ret int32 + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetCreatedAtOk() (*int32, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NotificationBase) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int32 and assigns it to the CreatedAt field. +func (o *NotificationBase) SetCreatedAt(v int32) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *NotificationBase) GetLastUpdated() int32 { + if o == nil || o.LastUpdated == nil { + var ret int32 + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetLastUpdatedOk() (*int32, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *NotificationBase) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given int32 and assigns it to the LastUpdated field. +func (o *NotificationBase) SetLastUpdated(v int32) { + o.LastUpdated = &v +} + +// GetRecordStateKey returns the RecordStateKey field value if set, zero value otherwise. +func (o *NotificationBase) GetRecordStateKey() string { + if o == nil || o.RecordStateKey == nil { + var ret string + return ret + } + return *o.RecordStateKey +} + +// GetRecordStateKeyOk returns a tuple with the RecordStateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetRecordStateKeyOk() (*string, bool) { + if o == nil || o.RecordStateKey == nil { + return nil, false + } + return o.RecordStateKey, true +} + +// HasRecordStateKey returns a boolean if a field has been set. +func (o *NotificationBase) HasRecordStateKey() bool { + if o != nil && o.RecordStateKey != nil { + return true + } + + return false +} + +// SetRecordStateKey gets a reference to the given string and assigns it to the RecordStateKey field. +func (o *NotificationBase) SetRecordStateKey(v string) { + o.RecordStateKey = &v +} + +// GetRecordStateVal returns the RecordStateVal field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationBase) GetRecordStateVal() string { + if o == nil || o.RecordStateVal.Get() == nil { + var ret string + return ret + } + return *o.RecordStateVal.Get() +} + +// GetRecordStateValOk returns a tuple with the RecordStateVal field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationBase) GetRecordStateValOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecordStateVal.Get(), o.RecordStateVal.IsSet() +} + +// HasRecordStateVal returns a boolean if a field has been set. +func (o *NotificationBase) HasRecordStateVal() bool { + if o != nil && o.RecordStateVal.IsSet() { + return true + } + + return false +} + +// SetRecordStateVal gets a reference to the given NullableString and assigns it to the RecordStateVal field. +func (o *NotificationBase) SetRecordStateVal(v string) { + o.RecordStateVal.Set(&v) +} +// SetRecordStateValNil sets the value for RecordStateVal to be an explicit nil +func (o *NotificationBase) SetRecordStateValNil() { + o.RecordStateVal.Set(nil) +} + +// UnsetRecordStateVal ensures that no value is present for RecordStateVal, not even an explicit nil +func (o *NotificationBase) UnsetRecordStateVal() { + o.RecordStateVal.Unset() +} + +// GetTries returns the Tries field value if set, zero value otherwise. +func (o *NotificationBase) GetTries() int32 { + if o == nil || o.Tries == nil { + var ret int32 + return ret + } + return *o.Tries +} + +// GetTriesOk returns a tuple with the Tries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetTriesOk() (*int32, bool) { + if o == nil || o.Tries == nil { + return nil, false + } + return o.Tries, true +} + +// HasTries returns a boolean if a field has been set. +func (o *NotificationBase) HasTries() bool { + if o != nil && o.Tries != nil { + return true + } + + return false +} + +// SetTries gets a reference to the given int32 and assigns it to the Tries field. +func (o *NotificationBase) SetTries(v int32) { + o.Tries = &v +} + +// GetMaxTries returns the MaxTries field value if set, zero value otherwise. +func (o *NotificationBase) GetMaxTries() int32 { + if o == nil || o.MaxTries == nil { + var ret int32 + return ret + } + return *o.MaxTries +} + +// GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationBase) GetMaxTriesOk() (*int32, bool) { + if o == nil || o.MaxTries == nil { + return nil, false + } + return o.MaxTries, true +} + +// HasMaxTries returns a boolean if a field has been set. +func (o *NotificationBase) HasMaxTries() bool { + if o != nil && o.MaxTries != nil { + return true + } + + return false +} + +// SetMaxTries gets a reference to the given int32 and assigns it to the MaxTries field. +func (o *NotificationBase) SetMaxTries(v int32) { + o.MaxTries = &v +} + +func (o NotificationBase) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.QueueId != nil { + toSerialize["queueId"] = o.QueueId + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.DataId != nil { + toSerialize["dataId"] = o.DataId + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.RecordStateKey != nil { + toSerialize["record_state_key"] = o.RecordStateKey + } + if o.RecordStateVal.IsSet() { + toSerialize["record_state_val"] = o.RecordStateVal.Get() + } + if o.Tries != nil { + toSerialize["tries"] = o.Tries + } + if o.MaxTries != nil { + toSerialize["max_tries"] = o.MaxTries + } + return json.Marshal(toSerialize) +} + +type NullableNotificationBase struct { + value *NotificationBase + isSet bool +} + +func (v NullableNotificationBase) Get() *NotificationBase { + return v.value +} + +func (v *NullableNotificationBase) Set(val *NotificationBase) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationBase) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationBase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationBase(val *NotificationBase) *NullableNotificationBase { + return &NullableNotificationBase{value: val, isSet: true} +} + +func (v NullableNotificationBase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationBase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_nvd_data_object.go b/.gen/anchore/model_nvd_data_object.go index 0d86abdb38..fcd31dc5f8 100644 --- a/.gen/anchore/model_nvd_data_object.go +++ b/.gen/anchore/model_nvd_data_object.go @@ -1,19 +1,189 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // NvdDataObject struct for NvdDataObject type NvdDataObject struct { // NVD Vulnerability ID - Id string `json:"id,omitempty"` - CvssV2 Cvssv2Scores `json:"cvss_v2,omitempty"` - CvssV3 Cvssv3Scores `json:"cvss_v3,omitempty"` + Id *string `json:"id,omitempty"` + CvssV2 *CVSSV2Scores `json:"cvss_v2,omitempty"` + CvssV3 *CVSSV3Scores `json:"cvss_v3,omitempty"` +} + +// NewNvdDataObject instantiates a new NvdDataObject 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 NewNvdDataObject() *NvdDataObject { + this := NvdDataObject{} + return &this +} + +// NewNvdDataObjectWithDefaults instantiates a new NvdDataObject 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 NewNvdDataObjectWithDefaults() *NvdDataObject { + this := NvdDataObject{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NvdDataObject) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NvdDataObject) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NvdDataObject) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NvdDataObject) SetId(v string) { + o.Id = &v +} + +// GetCvssV2 returns the CvssV2 field value if set, zero value otherwise. +func (o *NvdDataObject) GetCvssV2() CVSSV2Scores { + if o == nil || o.CvssV2 == nil { + var ret CVSSV2Scores + return ret + } + return *o.CvssV2 +} + +// GetCvssV2Ok returns a tuple with the CvssV2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NvdDataObject) GetCvssV2Ok() (*CVSSV2Scores, bool) { + if o == nil || o.CvssV2 == nil { + return nil, false + } + return o.CvssV2, true +} + +// HasCvssV2 returns a boolean if a field has been set. +func (o *NvdDataObject) HasCvssV2() bool { + if o != nil && o.CvssV2 != nil { + return true + } + + return false +} + +// SetCvssV2 gets a reference to the given CVSSV2Scores and assigns it to the CvssV2 field. +func (o *NvdDataObject) SetCvssV2(v CVSSV2Scores) { + o.CvssV2 = &v +} + +// GetCvssV3 returns the CvssV3 field value if set, zero value otherwise. +func (o *NvdDataObject) GetCvssV3() CVSSV3Scores { + if o == nil || o.CvssV3 == nil { + var ret CVSSV3Scores + return ret + } + return *o.CvssV3 } + +// GetCvssV3Ok returns a tuple with the CvssV3 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NvdDataObject) GetCvssV3Ok() (*CVSSV3Scores, bool) { + if o == nil || o.CvssV3 == nil { + return nil, false + } + return o.CvssV3, true +} + +// HasCvssV3 returns a boolean if a field has been set. +func (o *NvdDataObject) HasCvssV3() bool { + if o != nil && o.CvssV3 != nil { + return true + } + + return false +} + +// SetCvssV3 gets a reference to the given CVSSV3Scores and assigns it to the CvssV3 field. +func (o *NvdDataObject) SetCvssV3(v CVSSV3Scores) { + o.CvssV3 = &v +} + +func (o NvdDataObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CvssV2 != nil { + toSerialize["cvss_v2"] = o.CvssV2 + } + if o.CvssV3 != nil { + toSerialize["cvss_v3"] = o.CvssV3 + } + return json.Marshal(toSerialize) +} + +type NullableNvdDataObject struct { + value *NvdDataObject + isSet bool +} + +func (v NullableNvdDataObject) Get() *NvdDataObject { + return v.value +} + +func (v *NullableNvdDataObject) Set(val *NvdDataObject) { + v.value = val + v.isSet = true +} + +func (v NullableNvdDataObject) IsSet() bool { + return v.isSet +} + +func (v *NullableNvdDataObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNvdDataObject(val *NvdDataObject) *NullableNvdDataObject { + return &NullableNvdDataObject{value: val, isSet: true} +} + +func (v NullableNvdDataObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNvdDataObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_package_reference.go b/.gen/anchore/model_package_reference.go index 527b583044..a315944558 100644 --- a/.gen/anchore/model_package_reference.go +++ b/.gen/anchore/model_package_reference.go @@ -1,21 +1,238 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PackageReference A record of a software item which is vulnerable or carries a fix for a vulnerability type PackageReference struct { // Package name - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // A version for the package. If null, then references all versions - Version *string `json:"version,omitempty"` + Version NullableString `json:"version,omitempty"` // Package type (e.g. package, rpm, deb, apk, jar, npm, gem, ...) - Type string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` + // Whether a vendor will or will not fix a vulnerabitlity + WillNotFix *bool `json:"will_not_fix,omitempty"` +} + +// NewPackageReference instantiates a new PackageReference 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 NewPackageReference() *PackageReference { + this := PackageReference{} + return &this +} + +// NewPackageReferenceWithDefaults instantiates a new PackageReference 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 NewPackageReferenceWithDefaults() *PackageReference { + this := PackageReference{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PackageReference) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PackageReference) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PackageReference) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PackageReference) SetName(v string) { + o.Name = &v } + +// GetVersion returns the Version field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PackageReference) GetVersion() string { + if o == nil || o.Version.Get() == nil { + var ret string + return ret + } + return *o.Version.Get() +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PackageReference) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Version.Get(), o.Version.IsSet() +} + +// HasVersion returns a boolean if a field has been set. +func (o *PackageReference) HasVersion() bool { + if o != nil && o.Version.IsSet() { + return true + } + + return false +} + +// SetVersion gets a reference to the given NullableString and assigns it to the Version field. +func (o *PackageReference) SetVersion(v string) { + o.Version.Set(&v) +} +// SetVersionNil sets the value for Version to be an explicit nil +func (o *PackageReference) SetVersionNil() { + o.Version.Set(nil) +} + +// UnsetVersion ensures that no value is present for Version, not even an explicit nil +func (o *PackageReference) UnsetVersion() { + o.Version.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PackageReference) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PackageReference) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PackageReference) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PackageReference) SetType(v string) { + o.Type = &v +} + +// GetWillNotFix returns the WillNotFix field value if set, zero value otherwise. +func (o *PackageReference) GetWillNotFix() bool { + if o == nil || o.WillNotFix == nil { + var ret bool + return ret + } + return *o.WillNotFix +} + +// GetWillNotFixOk returns a tuple with the WillNotFix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PackageReference) GetWillNotFixOk() (*bool, bool) { + if o == nil || o.WillNotFix == nil { + return nil, false + } + return o.WillNotFix, true +} + +// HasWillNotFix returns a boolean if a field has been set. +func (o *PackageReference) HasWillNotFix() bool { + if o != nil && o.WillNotFix != nil { + return true + } + + return false +} + +// SetWillNotFix gets a reference to the given bool and assigns it to the WillNotFix field. +func (o *PackageReference) SetWillNotFix(v bool) { + o.WillNotFix = &v +} + +func (o PackageReference) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Version.IsSet() { + toSerialize["version"] = o.Version.Get() + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.WillNotFix != nil { + toSerialize["will_not_fix"] = o.WillNotFix + } + return json.Marshal(toSerialize) +} + +type NullablePackageReference struct { + value *PackageReference + isSet bool +} + +func (v NullablePackageReference) Get() *PackageReference { + return v.value +} + +func (v *NullablePackageReference) Set(val *PackageReference) { + v.value = val + v.isSet = true +} + +func (v NullablePackageReference) IsSet() bool { + return v.isSet +} + +func (v *NullablePackageReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePackageReference(val *PackageReference) *NullablePackageReference { + return &NullablePackageReference{value: val, isSet: true} +} + +func (v NullablePackageReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePackageReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_paginated_image_list.go b/.gen/anchore/model_paginated_image_list.go index b6869957bb..b3c435ae4e 100644 --- a/.gen/anchore/model_paginated_image_list.go +++ b/.gen/anchore/model_paginated_image_list.go @@ -1,22 +1,227 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginatedImageList Pagination wrapped list of images that match some filter type PaginatedImageList struct { // The page number returned (should match the requested page query string param) - Page string `json:"page,omitempty"` + Page *string `json:"page,omitempty"` // True if additional pages exist (page + 1) or False if this is the last page - NextPage string `json:"next_page,omitempty"` + NextPage *string `json:"next_page,omitempty"` // The number of items sent in this response - ReturnedCount int32 `json:"returned_count,omitempty"` + ReturnedCount *int32 `json:"returned_count,omitempty"` Images []ImageWithPackages `json:"images,omitempty"` } + +// NewPaginatedImageList instantiates a new PaginatedImageList 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 NewPaginatedImageList() *PaginatedImageList { + this := PaginatedImageList{} + return &this +} + +// NewPaginatedImageListWithDefaults instantiates a new PaginatedImageList 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 NewPaginatedImageListWithDefaults() *PaginatedImageList { + this := PaginatedImageList{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *PaginatedImageList) GetPage() string { + if o == nil || o.Page == nil { + var ret string + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageList) GetPageOk() (*string, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *PaginatedImageList) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given string and assigns it to the Page field. +func (o *PaginatedImageList) SetPage(v string) { + o.Page = &v +} + +// GetNextPage returns the NextPage field value if set, zero value otherwise. +func (o *PaginatedImageList) GetNextPage() string { + if o == nil || o.NextPage == nil { + var ret string + return ret + } + return *o.NextPage +} + +// GetNextPageOk returns a tuple with the NextPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageList) GetNextPageOk() (*string, bool) { + if o == nil || o.NextPage == nil { + return nil, false + } + return o.NextPage, true +} + +// HasNextPage returns a boolean if a field has been set. +func (o *PaginatedImageList) HasNextPage() bool { + if o != nil && o.NextPage != nil { + return true + } + + return false +} + +// SetNextPage gets a reference to the given string and assigns it to the NextPage field. +func (o *PaginatedImageList) SetNextPage(v string) { + o.NextPage = &v +} + +// GetReturnedCount returns the ReturnedCount field value if set, zero value otherwise. +func (o *PaginatedImageList) GetReturnedCount() int32 { + if o == nil || o.ReturnedCount == nil { + var ret int32 + return ret + } + return *o.ReturnedCount +} + +// GetReturnedCountOk returns a tuple with the ReturnedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageList) GetReturnedCountOk() (*int32, bool) { + if o == nil || o.ReturnedCount == nil { + return nil, false + } + return o.ReturnedCount, true +} + +// HasReturnedCount returns a boolean if a field has been set. +func (o *PaginatedImageList) HasReturnedCount() bool { + if o != nil && o.ReturnedCount != nil { + return true + } + + return false +} + +// SetReturnedCount gets a reference to the given int32 and assigns it to the ReturnedCount field. +func (o *PaginatedImageList) SetReturnedCount(v int32) { + o.ReturnedCount = &v +} + +// GetImages returns the Images field value if set, zero value otherwise. +func (o *PaginatedImageList) GetImages() []ImageWithPackages { + if o == nil || o.Images == nil { + var ret []ImageWithPackages + return ret + } + return o.Images +} + +// GetImagesOk returns a tuple with the Images field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageList) GetImagesOk() ([]ImageWithPackages, bool) { + if o == nil || o.Images == nil { + return nil, false + } + return o.Images, true +} + +// HasImages returns a boolean if a field has been set. +func (o *PaginatedImageList) HasImages() bool { + if o != nil && o.Images != nil { + return true + } + + return false +} + +// SetImages gets a reference to the given []ImageWithPackages and assigns it to the Images field. +func (o *PaginatedImageList) SetImages(v []ImageWithPackages) { + o.Images = v +} + +func (o PaginatedImageList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.NextPage != nil { + toSerialize["next_page"] = o.NextPage + } + if o.ReturnedCount != nil { + toSerialize["returned_count"] = o.ReturnedCount + } + if o.Images != nil { + toSerialize["images"] = o.Images + } + return json.Marshal(toSerialize) +} + +type NullablePaginatedImageList struct { + value *PaginatedImageList + isSet bool +} + +func (v NullablePaginatedImageList) Get() *PaginatedImageList { + return v.value +} + +func (v *NullablePaginatedImageList) Set(val *PaginatedImageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedImageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedImageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedImageList(val *PaginatedImageList) *NullablePaginatedImageList { + return &NullablePaginatedImageList{value: val, isSet: true} +} + +func (v NullablePaginatedImageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedImageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_paginated_image_list_all_of.go b/.gen/anchore/model_paginated_image_list_all_of.go index 8492bd0ba6..879e7cc881 100644 --- a/.gen/anchore/model_paginated_image_list_all_of.go +++ b/.gen/anchore/model_paginated_image_list_all_of.go @@ -1,16 +1,116 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginatedImageListAllOf struct for PaginatedImageListAllOf type PaginatedImageListAllOf struct { Images []ImageWithPackages `json:"images,omitempty"` } + +// NewPaginatedImageListAllOf instantiates a new PaginatedImageListAllOf 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 NewPaginatedImageListAllOf() *PaginatedImageListAllOf { + this := PaginatedImageListAllOf{} + return &this +} + +// NewPaginatedImageListAllOfWithDefaults instantiates a new PaginatedImageListAllOf 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 NewPaginatedImageListAllOfWithDefaults() *PaginatedImageListAllOf { + this := PaginatedImageListAllOf{} + return &this +} + +// GetImages returns the Images field value if set, zero value otherwise. +func (o *PaginatedImageListAllOf) GetImages() []ImageWithPackages { + if o == nil || o.Images == nil { + var ret []ImageWithPackages + return ret + } + return o.Images +} + +// GetImagesOk returns a tuple with the Images field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageListAllOf) GetImagesOk() ([]ImageWithPackages, bool) { + if o == nil || o.Images == nil { + return nil, false + } + return o.Images, true +} + +// HasImages returns a boolean if a field has been set. +func (o *PaginatedImageListAllOf) HasImages() bool { + if o != nil && o.Images != nil { + return true + } + + return false +} + +// SetImages gets a reference to the given []ImageWithPackages and assigns it to the Images field. +func (o *PaginatedImageListAllOf) SetImages(v []ImageWithPackages) { + o.Images = v +} + +func (o PaginatedImageListAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Images != nil { + toSerialize["images"] = o.Images + } + return json.Marshal(toSerialize) +} + +type NullablePaginatedImageListAllOf struct { + value *PaginatedImageListAllOf + isSet bool +} + +func (v NullablePaginatedImageListAllOf) Get() *PaginatedImageListAllOf { + return v.value +} + +func (v *NullablePaginatedImageListAllOf) Set(val *PaginatedImageListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedImageListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedImageListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedImageListAllOf(val *PaginatedImageListAllOf) *NullablePaginatedImageListAllOf { + return &NullablePaginatedImageListAllOf{value: val, isSet: true} +} + +func (v NullablePaginatedImageListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedImageListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_paginated_vulnerability_list.go b/.gen/anchore/model_paginated_vulnerability_list.go index 60b7b4b74f..00800f2b5f 100644 --- a/.gen/anchore/model_paginated_vulnerability_list.go +++ b/.gen/anchore/model_paginated_vulnerability_list.go @@ -1,23 +1,228 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginatedVulnerabilityList A paginated listing of vulnerability records sorted by ID in descending order type PaginatedVulnerabilityList struct { // The page number returned (should match the requested page query string param) - Page string `json:"page,omitempty"` + Page *string `json:"page,omitempty"` // True if additional pages exist (page + 1) or False if this is the last page - NextPage string `json:"next_page,omitempty"` + NextPage *string `json:"next_page,omitempty"` // The number of items sent in this response - ReturnedCount int32 `json:"returned_count,omitempty"` + ReturnedCount *int32 `json:"returned_count,omitempty"` // The listing of matching vulnerabilities for the query subject to pagination Vulnerabilities []StandaloneVulnerability `json:"vulnerabilities,omitempty"` } + +// NewPaginatedVulnerabilityList instantiates a new PaginatedVulnerabilityList 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 NewPaginatedVulnerabilityList() *PaginatedVulnerabilityList { + this := PaginatedVulnerabilityList{} + return &this +} + +// NewPaginatedVulnerabilityListWithDefaults instantiates a new PaginatedVulnerabilityList 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 NewPaginatedVulnerabilityListWithDefaults() *PaginatedVulnerabilityList { + this := PaginatedVulnerabilityList{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *PaginatedVulnerabilityList) GetPage() string { + if o == nil || o.Page == nil { + var ret string + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerabilityList) GetPageOk() (*string, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *PaginatedVulnerabilityList) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given string and assigns it to the Page field. +func (o *PaginatedVulnerabilityList) SetPage(v string) { + o.Page = &v +} + +// GetNextPage returns the NextPage field value if set, zero value otherwise. +func (o *PaginatedVulnerabilityList) GetNextPage() string { + if o == nil || o.NextPage == nil { + var ret string + return ret + } + return *o.NextPage +} + +// GetNextPageOk returns a tuple with the NextPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerabilityList) GetNextPageOk() (*string, bool) { + if o == nil || o.NextPage == nil { + return nil, false + } + return o.NextPage, true +} + +// HasNextPage returns a boolean if a field has been set. +func (o *PaginatedVulnerabilityList) HasNextPage() bool { + if o != nil && o.NextPage != nil { + return true + } + + return false +} + +// SetNextPage gets a reference to the given string and assigns it to the NextPage field. +func (o *PaginatedVulnerabilityList) SetNextPage(v string) { + o.NextPage = &v +} + +// GetReturnedCount returns the ReturnedCount field value if set, zero value otherwise. +func (o *PaginatedVulnerabilityList) GetReturnedCount() int32 { + if o == nil || o.ReturnedCount == nil { + var ret int32 + return ret + } + return *o.ReturnedCount +} + +// GetReturnedCountOk returns a tuple with the ReturnedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerabilityList) GetReturnedCountOk() (*int32, bool) { + if o == nil || o.ReturnedCount == nil { + return nil, false + } + return o.ReturnedCount, true +} + +// HasReturnedCount returns a boolean if a field has been set. +func (o *PaginatedVulnerabilityList) HasReturnedCount() bool { + if o != nil && o.ReturnedCount != nil { + return true + } + + return false +} + +// SetReturnedCount gets a reference to the given int32 and assigns it to the ReturnedCount field. +func (o *PaginatedVulnerabilityList) SetReturnedCount(v int32) { + o.ReturnedCount = &v +} + +// GetVulnerabilities returns the Vulnerabilities field value if set, zero value otherwise. +func (o *PaginatedVulnerabilityList) GetVulnerabilities() []StandaloneVulnerability { + if o == nil || o.Vulnerabilities == nil { + var ret []StandaloneVulnerability + return ret + } + return o.Vulnerabilities +} + +// GetVulnerabilitiesOk returns a tuple with the Vulnerabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerabilityList) GetVulnerabilitiesOk() ([]StandaloneVulnerability, bool) { + if o == nil || o.Vulnerabilities == nil { + return nil, false + } + return o.Vulnerabilities, true +} + +// HasVulnerabilities returns a boolean if a field has been set. +func (o *PaginatedVulnerabilityList) HasVulnerabilities() bool { + if o != nil && o.Vulnerabilities != nil { + return true + } + + return false +} + +// SetVulnerabilities gets a reference to the given []StandaloneVulnerability and assigns it to the Vulnerabilities field. +func (o *PaginatedVulnerabilityList) SetVulnerabilities(v []StandaloneVulnerability) { + o.Vulnerabilities = v +} + +func (o PaginatedVulnerabilityList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.NextPage != nil { + toSerialize["next_page"] = o.NextPage + } + if o.ReturnedCount != nil { + toSerialize["returned_count"] = o.ReturnedCount + } + if o.Vulnerabilities != nil { + toSerialize["vulnerabilities"] = o.Vulnerabilities + } + return json.Marshal(toSerialize) +} + +type NullablePaginatedVulnerabilityList struct { + value *PaginatedVulnerabilityList + isSet bool +} + +func (v NullablePaginatedVulnerabilityList) Get() *PaginatedVulnerabilityList { + return v.value +} + +func (v *NullablePaginatedVulnerabilityList) Set(val *PaginatedVulnerabilityList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVulnerabilityList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVulnerabilityList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVulnerabilityList(val *PaginatedVulnerabilityList) *NullablePaginatedVulnerabilityList { + return &NullablePaginatedVulnerabilityList{value: val, isSet: true} +} + +func (v NullablePaginatedVulnerabilityList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVulnerabilityList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_paginated_vulnerability_list_all_of.go b/.gen/anchore/model_paginated_vulnerability_list_all_of.go index 4b902087ba..3c4bbf337e 100644 --- a/.gen/anchore/model_paginated_vulnerability_list_all_of.go +++ b/.gen/anchore/model_paginated_vulnerability_list_all_of.go @@ -1,17 +1,117 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginatedVulnerabilityListAllOf struct for PaginatedVulnerabilityListAllOf type PaginatedVulnerabilityListAllOf struct { // The listing of matching vulnerabilities for the query subject to pagination Vulnerabilities []StandaloneVulnerability `json:"vulnerabilities,omitempty"` } + +// NewPaginatedVulnerabilityListAllOf instantiates a new PaginatedVulnerabilityListAllOf 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 NewPaginatedVulnerabilityListAllOf() *PaginatedVulnerabilityListAllOf { + this := PaginatedVulnerabilityListAllOf{} + return &this +} + +// NewPaginatedVulnerabilityListAllOfWithDefaults instantiates a new PaginatedVulnerabilityListAllOf 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 NewPaginatedVulnerabilityListAllOfWithDefaults() *PaginatedVulnerabilityListAllOf { + this := PaginatedVulnerabilityListAllOf{} + return &this +} + +// GetVulnerabilities returns the Vulnerabilities field value if set, zero value otherwise. +func (o *PaginatedVulnerabilityListAllOf) GetVulnerabilities() []StandaloneVulnerability { + if o == nil || o.Vulnerabilities == nil { + var ret []StandaloneVulnerability + return ret + } + return o.Vulnerabilities +} + +// GetVulnerabilitiesOk returns a tuple with the Vulnerabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerabilityListAllOf) GetVulnerabilitiesOk() ([]StandaloneVulnerability, bool) { + if o == nil || o.Vulnerabilities == nil { + return nil, false + } + return o.Vulnerabilities, true +} + +// HasVulnerabilities returns a boolean if a field has been set. +func (o *PaginatedVulnerabilityListAllOf) HasVulnerabilities() bool { + if o != nil && o.Vulnerabilities != nil { + return true + } + + return false +} + +// SetVulnerabilities gets a reference to the given []StandaloneVulnerability and assigns it to the Vulnerabilities field. +func (o *PaginatedVulnerabilityListAllOf) SetVulnerabilities(v []StandaloneVulnerability) { + o.Vulnerabilities = v +} + +func (o PaginatedVulnerabilityListAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Vulnerabilities != nil { + toSerialize["vulnerabilities"] = o.Vulnerabilities + } + return json.Marshal(toSerialize) +} + +type NullablePaginatedVulnerabilityListAllOf struct { + value *PaginatedVulnerabilityListAllOf + isSet bool +} + +func (v NullablePaginatedVulnerabilityListAllOf) Get() *PaginatedVulnerabilityListAllOf { + return v.value +} + +func (v *NullablePaginatedVulnerabilityListAllOf) Set(val *PaginatedVulnerabilityListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVulnerabilityListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVulnerabilityListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVulnerabilityListAllOf(val *PaginatedVulnerabilityListAllOf) *NullablePaginatedVulnerabilityListAllOf { + return &NullablePaginatedVulnerabilityListAllOf{value: val, isSet: true} +} + +func (v NullablePaginatedVulnerabilityListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVulnerabilityListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_paginated_vulnerable_image_list.go b/.gen/anchore/model_paginated_vulnerable_image_list.go index 8a7d800dec..2e8c9102a8 100644 --- a/.gen/anchore/model_paginated_vulnerable_image_list.go +++ b/.gen/anchore/model_paginated_vulnerable_image_list.go @@ -1,22 +1,227 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginatedVulnerableImageList Pagination wrapped list of images with vulnerabilties that match some filter type PaginatedVulnerableImageList struct { // The page number returned (should match the requested page query string param) - Page string `json:"page,omitempty"` + Page *string `json:"page,omitempty"` // True if additional pages exist (page + 1) or False if this is the last page - NextPage string `json:"next_page,omitempty"` + NextPage *string `json:"next_page,omitempty"` // The number of items sent in this response - ReturnedCount int32 `json:"returned_count,omitempty"` + ReturnedCount *int32 `json:"returned_count,omitempty"` Images []VulnerableImage `json:"images,omitempty"` } + +// NewPaginatedVulnerableImageList instantiates a new PaginatedVulnerableImageList 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 NewPaginatedVulnerableImageList() *PaginatedVulnerableImageList { + this := PaginatedVulnerableImageList{} + return &this +} + +// NewPaginatedVulnerableImageListWithDefaults instantiates a new PaginatedVulnerableImageList 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 NewPaginatedVulnerableImageListWithDefaults() *PaginatedVulnerableImageList { + this := PaginatedVulnerableImageList{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *PaginatedVulnerableImageList) GetPage() string { + if o == nil || o.Page == nil { + var ret string + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerableImageList) GetPageOk() (*string, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *PaginatedVulnerableImageList) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given string and assigns it to the Page field. +func (o *PaginatedVulnerableImageList) SetPage(v string) { + o.Page = &v +} + +// GetNextPage returns the NextPage field value if set, zero value otherwise. +func (o *PaginatedVulnerableImageList) GetNextPage() string { + if o == nil || o.NextPage == nil { + var ret string + return ret + } + return *o.NextPage +} + +// GetNextPageOk returns a tuple with the NextPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerableImageList) GetNextPageOk() (*string, bool) { + if o == nil || o.NextPage == nil { + return nil, false + } + return o.NextPage, true +} + +// HasNextPage returns a boolean if a field has been set. +func (o *PaginatedVulnerableImageList) HasNextPage() bool { + if o != nil && o.NextPage != nil { + return true + } + + return false +} + +// SetNextPage gets a reference to the given string and assigns it to the NextPage field. +func (o *PaginatedVulnerableImageList) SetNextPage(v string) { + o.NextPage = &v +} + +// GetReturnedCount returns the ReturnedCount field value if set, zero value otherwise. +func (o *PaginatedVulnerableImageList) GetReturnedCount() int32 { + if o == nil || o.ReturnedCount == nil { + var ret int32 + return ret + } + return *o.ReturnedCount +} + +// GetReturnedCountOk returns a tuple with the ReturnedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerableImageList) GetReturnedCountOk() (*int32, bool) { + if o == nil || o.ReturnedCount == nil { + return nil, false + } + return o.ReturnedCount, true +} + +// HasReturnedCount returns a boolean if a field has been set. +func (o *PaginatedVulnerableImageList) HasReturnedCount() bool { + if o != nil && o.ReturnedCount != nil { + return true + } + + return false +} + +// SetReturnedCount gets a reference to the given int32 and assigns it to the ReturnedCount field. +func (o *PaginatedVulnerableImageList) SetReturnedCount(v int32) { + o.ReturnedCount = &v +} + +// GetImages returns the Images field value if set, zero value otherwise. +func (o *PaginatedVulnerableImageList) GetImages() []VulnerableImage { + if o == nil || o.Images == nil { + var ret []VulnerableImage + return ret + } + return o.Images +} + +// GetImagesOk returns a tuple with the Images field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerableImageList) GetImagesOk() ([]VulnerableImage, bool) { + if o == nil || o.Images == nil { + return nil, false + } + return o.Images, true +} + +// HasImages returns a boolean if a field has been set. +func (o *PaginatedVulnerableImageList) HasImages() bool { + if o != nil && o.Images != nil { + return true + } + + return false +} + +// SetImages gets a reference to the given []VulnerableImage and assigns it to the Images field. +func (o *PaginatedVulnerableImageList) SetImages(v []VulnerableImage) { + o.Images = v +} + +func (o PaginatedVulnerableImageList) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.NextPage != nil { + toSerialize["next_page"] = o.NextPage + } + if o.ReturnedCount != nil { + toSerialize["returned_count"] = o.ReturnedCount + } + if o.Images != nil { + toSerialize["images"] = o.Images + } + return json.Marshal(toSerialize) +} + +type NullablePaginatedVulnerableImageList struct { + value *PaginatedVulnerableImageList + isSet bool +} + +func (v NullablePaginatedVulnerableImageList) Get() *PaginatedVulnerableImageList { + return v.value +} + +func (v *NullablePaginatedVulnerableImageList) Set(val *PaginatedVulnerableImageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVulnerableImageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVulnerableImageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVulnerableImageList(val *PaginatedVulnerableImageList) *NullablePaginatedVulnerableImageList { + return &NullablePaginatedVulnerableImageList{value: val, isSet: true} +} + +func (v NullablePaginatedVulnerableImageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVulnerableImageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_paginated_vulnerable_image_list_all_of.go b/.gen/anchore/model_paginated_vulnerable_image_list_all_of.go index 69b93e496b..1bf32d49e5 100644 --- a/.gen/anchore/model_paginated_vulnerable_image_list_all_of.go +++ b/.gen/anchore/model_paginated_vulnerable_image_list_all_of.go @@ -1,16 +1,116 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginatedVulnerableImageListAllOf struct for PaginatedVulnerableImageListAllOf type PaginatedVulnerableImageListAllOf struct { Images []VulnerableImage `json:"images,omitempty"` } + +// NewPaginatedVulnerableImageListAllOf instantiates a new PaginatedVulnerableImageListAllOf 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 NewPaginatedVulnerableImageListAllOf() *PaginatedVulnerableImageListAllOf { + this := PaginatedVulnerableImageListAllOf{} + return &this +} + +// NewPaginatedVulnerableImageListAllOfWithDefaults instantiates a new PaginatedVulnerableImageListAllOf 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 NewPaginatedVulnerableImageListAllOfWithDefaults() *PaginatedVulnerableImageListAllOf { + this := PaginatedVulnerableImageListAllOf{} + return &this +} + +// GetImages returns the Images field value if set, zero value otherwise. +func (o *PaginatedVulnerableImageListAllOf) GetImages() []VulnerableImage { + if o == nil || o.Images == nil { + var ret []VulnerableImage + return ret + } + return o.Images +} + +// GetImagesOk returns a tuple with the Images field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVulnerableImageListAllOf) GetImagesOk() ([]VulnerableImage, bool) { + if o == nil || o.Images == nil { + return nil, false + } + return o.Images, true +} + +// HasImages returns a boolean if a field has been set. +func (o *PaginatedVulnerableImageListAllOf) HasImages() bool { + if o != nil && o.Images != nil { + return true + } + + return false +} + +// SetImages gets a reference to the given []VulnerableImage and assigns it to the Images field. +func (o *PaginatedVulnerableImageListAllOf) SetImages(v []VulnerableImage) { + o.Images = v +} + +func (o PaginatedVulnerableImageListAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Images != nil { + toSerialize["images"] = o.Images + } + return json.Marshal(toSerialize) +} + +type NullablePaginatedVulnerableImageListAllOf struct { + value *PaginatedVulnerableImageListAllOf + isSet bool +} + +func (v NullablePaginatedVulnerableImageListAllOf) Get() *PaginatedVulnerableImageListAllOf { + return v.value +} + +func (v *NullablePaginatedVulnerableImageListAllOf) Set(val *PaginatedVulnerableImageListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVulnerableImageListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVulnerableImageListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVulnerableImageListAllOf(val *PaginatedVulnerableImageListAllOf) *NullablePaginatedVulnerableImageListAllOf { + return &NullablePaginatedVulnerableImageListAllOf{value: val, isSet: true} +} + +func (v NullablePaginatedVulnerableImageListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVulnerableImageListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_pagination_properties.go b/.gen/anchore/model_pagination_properties.go index 6ea9b508ed..692b079898 100644 --- a/.gen/anchore/model_pagination_properties.go +++ b/.gen/anchore/model_pagination_properties.go @@ -1,21 +1,191 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PaginationProperties Properties for common pagination handling to be included in any wrapping object that needs pagination elements type PaginationProperties struct { // The page number returned (should match the requested page query string param) - Page string `json:"page,omitempty"` + Page *string `json:"page,omitempty"` // True if additional pages exist (page + 1) or False if this is the last page - NextPage string `json:"next_page,omitempty"` + NextPage *string `json:"next_page,omitempty"` // The number of items sent in this response - ReturnedCount int32 `json:"returned_count,omitempty"` + ReturnedCount *int32 `json:"returned_count,omitempty"` +} + +// NewPaginationProperties instantiates a new PaginationProperties 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 NewPaginationProperties() *PaginationProperties { + this := PaginationProperties{} + return &this +} + +// NewPaginationPropertiesWithDefaults instantiates a new PaginationProperties 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 NewPaginationPropertiesWithDefaults() *PaginationProperties { + this := PaginationProperties{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *PaginationProperties) GetPage() string { + if o == nil || o.Page == nil { + var ret string + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginationProperties) GetPageOk() (*string, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *PaginationProperties) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given string and assigns it to the Page field. +func (o *PaginationProperties) SetPage(v string) { + o.Page = &v +} + +// GetNextPage returns the NextPage field value if set, zero value otherwise. +func (o *PaginationProperties) GetNextPage() string { + if o == nil || o.NextPage == nil { + var ret string + return ret + } + return *o.NextPage +} + +// GetNextPageOk returns a tuple with the NextPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginationProperties) GetNextPageOk() (*string, bool) { + if o == nil || o.NextPage == nil { + return nil, false + } + return o.NextPage, true +} + +// HasNextPage returns a boolean if a field has been set. +func (o *PaginationProperties) HasNextPage() bool { + if o != nil && o.NextPage != nil { + return true + } + + return false +} + +// SetNextPage gets a reference to the given string and assigns it to the NextPage field. +func (o *PaginationProperties) SetNextPage(v string) { + o.NextPage = &v +} + +// GetReturnedCount returns the ReturnedCount field value if set, zero value otherwise. +func (o *PaginationProperties) GetReturnedCount() int32 { + if o == nil || o.ReturnedCount == nil { + var ret int32 + return ret + } + return *o.ReturnedCount } + +// GetReturnedCountOk returns a tuple with the ReturnedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginationProperties) GetReturnedCountOk() (*int32, bool) { + if o == nil || o.ReturnedCount == nil { + return nil, false + } + return o.ReturnedCount, true +} + +// HasReturnedCount returns a boolean if a field has been set. +func (o *PaginationProperties) HasReturnedCount() bool { + if o != nil && o.ReturnedCount != nil { + return true + } + + return false +} + +// SetReturnedCount gets a reference to the given int32 and assigns it to the ReturnedCount field. +func (o *PaginationProperties) SetReturnedCount(v int32) { + o.ReturnedCount = &v +} + +func (o PaginationProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.NextPage != nil { + toSerialize["next_page"] = o.NextPage + } + if o.ReturnedCount != nil { + toSerialize["returned_count"] = o.ReturnedCount + } + return json.Marshal(toSerialize) +} + +type NullablePaginationProperties struct { + value *PaginationProperties + isSet bool +} + +func (v NullablePaginationProperties) Get() *PaginationProperties { + return v.value +} + +func (v *NullablePaginationProperties) Set(val *PaginationProperties) { + v.value = val + v.isSet = true +} + +func (v NullablePaginationProperties) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginationProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginationProperties(val *PaginationProperties) *NullablePaginationProperties { + return &NullablePaginationProperties{value: val, isSet: true} +} + +func (v NullablePaginationProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginationProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy.go b/.gen/anchore/model_policy.go index 9e69eb918c..42bdabc472 100644 --- a/.gen/anchore/model_policy.go +++ b/.gen/anchore/model_policy.go @@ -1,20 +1,246 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // Policy struct for Policy type Policy struct { Id string `json:"id"` - Name string `json:"name,omitempty"` - Comment string `json:"comment,omitempty"` + Name *string `json:"name,omitempty"` + Comment *string `json:"comment,omitempty"` Version string `json:"version"` Rules []PolicyRule `json:"rules,omitempty"` } + +// NewPolicy instantiates a new Policy 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 NewPolicy(id string, version string) *Policy { + this := Policy{} + this.Id = id + this.Version = version + return &this +} + +// NewPolicyWithDefaults instantiates a new Policy 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 NewPolicyWithDefaults() *Policy { + this := Policy{} + return &this +} + +// GetId returns the Id field value +func (o *Policy) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Policy) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Policy) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Policy) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Policy) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Policy) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Policy) SetName(v string) { + o.Name = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *Policy) GetComment() string { + if o == nil || o.Comment == nil { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Policy) GetCommentOk() (*string, bool) { + if o == nil || o.Comment == nil { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *Policy) HasComment() bool { + if o != nil && o.Comment != nil { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *Policy) SetComment(v string) { + o.Comment = &v +} + +// GetVersion returns the Version field value +func (o *Policy) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Policy) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Policy) SetVersion(v string) { + o.Version = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *Policy) GetRules() []PolicyRule { + if o == nil || o.Rules == nil { + var ret []PolicyRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Policy) GetRulesOk() ([]PolicyRule, bool) { + if o == nil || o.Rules == nil { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *Policy) HasRules() bool { + if o != nil && o.Rules != nil { + return true + } + + return false +} + +// SetRules gets a reference to the given []PolicyRule and assigns it to the Rules field. +func (o *Policy) SetRules(v []PolicyRule) { + o.Rules = v +} + +func (o Policy) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Comment != nil { + toSerialize["comment"] = o.Comment + } + if true { + toSerialize["version"] = o.Version + } + if o.Rules != nil { + toSerialize["rules"] = o.Rules + } + return json.Marshal(toSerialize) +} + +type NullablePolicy struct { + value *Policy + isSet bool +} + +func (v NullablePolicy) Get() *Policy { + return v.value +} + +func (v *NullablePolicy) Set(val *Policy) { + v.value = val + v.isSet = true +} + +func (v NullablePolicy) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicy(val *Policy) *NullablePolicy { + return &NullablePolicy{value: val, isSet: true} +} + +func (v NullablePolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_bundle.go b/.gen/anchore/model_policy_bundle.go index 48393c5749..2bb31cf8e1 100644 --- a/.gen/anchore/model_policy_bundle.go +++ b/.gen/anchore/model_policy_bundle.go @@ -1,23 +1,28 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PolicyBundle A bundle containing a set of policies, whitelists, and rules for mapping them to specific images type PolicyBundle struct { // Id of the bundle Id string `json:"id"` // Human readable name for the bundle - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Description of the bundle, human readable - Comment string `json:"comment,omitempty"` + Comment *string `json:"comment,omitempty"` // Version id for this bundle format Version string `json:"version"` // Whitelists which define which policy matches to disregard explicitly in the final policy decision @@ -31,3 +36,350 @@ type PolicyBundle struct { // List of mapping rules that define which images should always result in a STOP/FAIL policy result regardless of policy content or presence in whitelisted_images BlacklistedImages []ImageSelectionRule `json:"blacklisted_images,omitempty"` } + +// NewPolicyBundle instantiates a new PolicyBundle 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 NewPolicyBundle(id string, version string, policies []Policy, mappings []MappingRule) *PolicyBundle { + this := PolicyBundle{} + this.Id = id + this.Version = version + this.Policies = policies + this.Mappings = mappings + return &this +} + +// NewPolicyBundleWithDefaults instantiates a new PolicyBundle 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 NewPolicyBundleWithDefaults() *PolicyBundle { + this := PolicyBundle{} + return &this +} + +// GetId returns the Id field value +func (o *PolicyBundle) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PolicyBundle) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PolicyBundle) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PolicyBundle) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PolicyBundle) SetName(v string) { + o.Name = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *PolicyBundle) GetComment() string { + if o == nil || o.Comment == nil { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetCommentOk() (*string, bool) { + if o == nil || o.Comment == nil { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *PolicyBundle) HasComment() bool { + if o != nil && o.Comment != nil { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *PolicyBundle) SetComment(v string) { + o.Comment = &v +} + +// GetVersion returns the Version field value +func (o *PolicyBundle) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *PolicyBundle) SetVersion(v string) { + o.Version = v +} + +// GetWhitelists returns the Whitelists field value if set, zero value otherwise. +func (o *PolicyBundle) GetWhitelists() []Whitelist { + if o == nil || o.Whitelists == nil { + var ret []Whitelist + return ret + } + return o.Whitelists +} + +// GetWhitelistsOk returns a tuple with the Whitelists field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetWhitelistsOk() ([]Whitelist, bool) { + if o == nil || o.Whitelists == nil { + return nil, false + } + return o.Whitelists, true +} + +// HasWhitelists returns a boolean if a field has been set. +func (o *PolicyBundle) HasWhitelists() bool { + if o != nil && o.Whitelists != nil { + return true + } + + return false +} + +// SetWhitelists gets a reference to the given []Whitelist and assigns it to the Whitelists field. +func (o *PolicyBundle) SetWhitelists(v []Whitelist) { + o.Whitelists = v +} + +// GetPolicies returns the Policies field value +func (o *PolicyBundle) GetPolicies() []Policy { + if o == nil { + var ret []Policy + return ret + } + + return o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetPoliciesOk() ([]Policy, bool) { + if o == nil { + return nil, false + } + return o.Policies, true +} + +// SetPolicies sets field value +func (o *PolicyBundle) SetPolicies(v []Policy) { + o.Policies = v +} + +// GetMappings returns the Mappings field value +func (o *PolicyBundle) GetMappings() []MappingRule { + if o == nil { + var ret []MappingRule + return ret + } + + return o.Mappings +} + +// GetMappingsOk returns a tuple with the Mappings field value +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetMappingsOk() ([]MappingRule, bool) { + if o == nil { + return nil, false + } + return o.Mappings, true +} + +// SetMappings sets field value +func (o *PolicyBundle) SetMappings(v []MappingRule) { + o.Mappings = v +} + +// GetWhitelistedImages returns the WhitelistedImages field value if set, zero value otherwise. +func (o *PolicyBundle) GetWhitelistedImages() []ImageSelectionRule { + if o == nil || o.WhitelistedImages == nil { + var ret []ImageSelectionRule + return ret + } + return o.WhitelistedImages +} + +// GetWhitelistedImagesOk returns a tuple with the WhitelistedImages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetWhitelistedImagesOk() ([]ImageSelectionRule, bool) { + if o == nil || o.WhitelistedImages == nil { + return nil, false + } + return o.WhitelistedImages, true +} + +// HasWhitelistedImages returns a boolean if a field has been set. +func (o *PolicyBundle) HasWhitelistedImages() bool { + if o != nil && o.WhitelistedImages != nil { + return true + } + + return false +} + +// SetWhitelistedImages gets a reference to the given []ImageSelectionRule and assigns it to the WhitelistedImages field. +func (o *PolicyBundle) SetWhitelistedImages(v []ImageSelectionRule) { + o.WhitelistedImages = v +} + +// GetBlacklistedImages returns the BlacklistedImages field value if set, zero value otherwise. +func (o *PolicyBundle) GetBlacklistedImages() []ImageSelectionRule { + if o == nil || o.BlacklistedImages == nil { + var ret []ImageSelectionRule + return ret + } + return o.BlacklistedImages +} + +// GetBlacklistedImagesOk returns a tuple with the BlacklistedImages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundle) GetBlacklistedImagesOk() ([]ImageSelectionRule, bool) { + if o == nil || o.BlacklistedImages == nil { + return nil, false + } + return o.BlacklistedImages, true +} + +// HasBlacklistedImages returns a boolean if a field has been set. +func (o *PolicyBundle) HasBlacklistedImages() bool { + if o != nil && o.BlacklistedImages != nil { + return true + } + + return false +} + +// SetBlacklistedImages gets a reference to the given []ImageSelectionRule and assigns it to the BlacklistedImages field. +func (o *PolicyBundle) SetBlacklistedImages(v []ImageSelectionRule) { + o.BlacklistedImages = v +} + +func (o PolicyBundle) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Comment != nil { + toSerialize["comment"] = o.Comment + } + if true { + toSerialize["version"] = o.Version + } + if o.Whitelists != nil { + toSerialize["whitelists"] = o.Whitelists + } + if true { + toSerialize["policies"] = o.Policies + } + if true { + toSerialize["mappings"] = o.Mappings + } + if o.WhitelistedImages != nil { + toSerialize["whitelisted_images"] = o.WhitelistedImages + } + if o.BlacklistedImages != nil { + toSerialize["blacklisted_images"] = o.BlacklistedImages + } + return json.Marshal(toSerialize) +} + +type NullablePolicyBundle struct { + value *PolicyBundle + isSet bool +} + +func (v NullablePolicyBundle) Get() *PolicyBundle { + return v.value +} + +func (v *NullablePolicyBundle) Set(val *PolicyBundle) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyBundle) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyBundle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyBundle(val *PolicyBundle) *NullablePolicyBundle { + return &NullablePolicyBundle{value: val, isSet: true} +} + +func (v NullablePolicyBundle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyBundle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_bundle_record.go b/.gen/anchore/model_policy_bundle_record.go index b3736defef..e70233d30a 100644 --- a/.gen/anchore/model_policy_bundle_record.go +++ b/.gen/anchore/model_policy_bundle_record.go @@ -1,29 +1,337 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // PolicyBundleRecord A policy bundle plus some metadata type PolicyBundleRecord struct { - CreatedAt time.Time `json:"created_at,omitempty"` - LastUpdated time.Time `json:"last_updated,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` // The bundle's identifier - PolicyId string `json:"policyId,omitempty"` + PolicyId *string `json:"policyId,omitempty"` // True if the bundle is currently defined to be used automatically - Active bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` // UserId of the user that owns the bundle - UserId string `json:"userId,omitempty"` + UserId *string `json:"userId,omitempty"` // Source location of where the policy bundle originated - PolicySource string `json:"policy_source,omitempty"` - Policybundle PolicyBundle `json:"policybundle,omitempty"` + PolicySource *string `json:"policy_source,omitempty"` + Policybundle *PolicyBundle `json:"policybundle,omitempty"` +} + +// NewPolicyBundleRecord instantiates a new PolicyBundleRecord 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 NewPolicyBundleRecord() *PolicyBundleRecord { + this := PolicyBundleRecord{} + return &this +} + +// NewPolicyBundleRecordWithDefaults instantiates a new PolicyBundleRecord 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 NewPolicyBundleRecordWithDefaults() *PolicyBundleRecord { + this := PolicyBundleRecord{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *PolicyBundleRecord) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *PolicyBundleRecord) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetPolicyId returns the PolicyId field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetPolicyId() string { + if o == nil || o.PolicyId == nil { + var ret string + return ret + } + return *o.PolicyId +} + +// GetPolicyIdOk returns a tuple with the PolicyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetPolicyIdOk() (*string, bool) { + if o == nil || o.PolicyId == nil { + return nil, false + } + return o.PolicyId, true +} + +// HasPolicyId returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasPolicyId() bool { + if o != nil && o.PolicyId != nil { + return true + } + + return false +} + +// SetPolicyId gets a reference to the given string and assigns it to the PolicyId field. +func (o *PolicyBundleRecord) SetPolicyId(v string) { + o.PolicyId = &v +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetActive() bool { + if o == nil || o.Active == nil { + var ret bool + return ret + } + return *o.Active +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetActiveOk() (*bool, bool) { + if o == nil || o.Active == nil { + return nil, false + } + return o.Active, true +} + +// HasActive returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasActive() bool { + if o != nil && o.Active != nil { + return true + } + + return false +} + +// SetActive gets a reference to the given bool and assigns it to the Active field. +func (o *PolicyBundleRecord) SetActive(v bool) { + o.Active = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId } + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *PolicyBundleRecord) SetUserId(v string) { + o.UserId = &v +} + +// GetPolicySource returns the PolicySource field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetPolicySource() string { + if o == nil || o.PolicySource == nil { + var ret string + return ret + } + return *o.PolicySource +} + +// GetPolicySourceOk returns a tuple with the PolicySource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetPolicySourceOk() (*string, bool) { + if o == nil || o.PolicySource == nil { + return nil, false + } + return o.PolicySource, true +} + +// HasPolicySource returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasPolicySource() bool { + if o != nil && o.PolicySource != nil { + return true + } + + return false +} + +// SetPolicySource gets a reference to the given string and assigns it to the PolicySource field. +func (o *PolicyBundleRecord) SetPolicySource(v string) { + o.PolicySource = &v +} + +// GetPolicybundle returns the Policybundle field value if set, zero value otherwise. +func (o *PolicyBundleRecord) GetPolicybundle() PolicyBundle { + if o == nil || o.Policybundle == nil { + var ret PolicyBundle + return ret + } + return *o.Policybundle +} + +// GetPolicybundleOk returns a tuple with the Policybundle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBundleRecord) GetPolicybundleOk() (*PolicyBundle, bool) { + if o == nil || o.Policybundle == nil { + return nil, false + } + return o.Policybundle, true +} + +// HasPolicybundle returns a boolean if a field has been set. +func (o *PolicyBundleRecord) HasPolicybundle() bool { + if o != nil && o.Policybundle != nil { + return true + } + + return false +} + +// SetPolicybundle gets a reference to the given PolicyBundle and assigns it to the Policybundle field. +func (o *PolicyBundleRecord) SetPolicybundle(v PolicyBundle) { + o.Policybundle = &v +} + +func (o PolicyBundleRecord) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.PolicyId != nil { + toSerialize["policyId"] = o.PolicyId + } + if o.Active != nil { + toSerialize["active"] = o.Active + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.PolicySource != nil { + toSerialize["policy_source"] = o.PolicySource + } + if o.Policybundle != nil { + toSerialize["policybundle"] = o.Policybundle + } + return json.Marshal(toSerialize) +} + +type NullablePolicyBundleRecord struct { + value *PolicyBundleRecord + isSet bool +} + +func (v NullablePolicyBundleRecord) Get() *PolicyBundleRecord { + return v.value +} + +func (v *NullablePolicyBundleRecord) Set(val *PolicyBundleRecord) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyBundleRecord) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyBundleRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyBundleRecord(val *PolicyBundleRecord) *NullablePolicyBundleRecord { + return &NullablePolicyBundleRecord{value: val, isSet: true} +} + +func (v NullablePolicyBundleRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyBundleRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_eval_notification.go b/.gen/anchore/model_policy_eval_notification.go new file mode 100644 index 0000000000..91bc208224 --- /dev/null +++ b/.gen/anchore/model_policy_eval_notification.go @@ -0,0 +1,454 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyEvalNotification struct for PolicyEvalNotification +type PolicyEvalNotification struct { + QueueId *string `json:"queueId,omitempty"` + UserId *string `json:"userId,omitempty"` + DataId *string `json:"dataId,omitempty"` + CreatedAt *int32 `json:"created_at,omitempty"` + LastUpdated *int32 `json:"last_updated,omitempty"` + RecordStateKey *string `json:"record_state_key,omitempty"` + RecordStateVal NullableString `json:"record_state_val,omitempty"` + Tries *int32 `json:"tries,omitempty"` + MaxTries *int32 `json:"max_tries,omitempty"` + Data *PolicyEvalNotificationData `json:"data,omitempty"` +} + +// NewPolicyEvalNotification instantiates a new PolicyEvalNotification 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 NewPolicyEvalNotification() *PolicyEvalNotification { + this := PolicyEvalNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// NewPolicyEvalNotificationWithDefaults instantiates a new PolicyEvalNotification 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 NewPolicyEvalNotificationWithDefaults() *PolicyEvalNotification { + this := PolicyEvalNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// GetQueueId returns the QueueId field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetQueueId() string { + if o == nil || o.QueueId == nil { + var ret string + return ret + } + return *o.QueueId +} + +// GetQueueIdOk returns a tuple with the QueueId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetQueueIdOk() (*string, bool) { + if o == nil || o.QueueId == nil { + return nil, false + } + return o.QueueId, true +} + +// HasQueueId returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasQueueId() bool { + if o != nil && o.QueueId != nil { + return true + } + + return false +} + +// SetQueueId gets a reference to the given string and assigns it to the QueueId field. +func (o *PolicyEvalNotification) SetQueueId(v string) { + o.QueueId = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *PolicyEvalNotification) SetUserId(v string) { + o.UserId = &v +} + +// GetDataId returns the DataId field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetDataId() string { + if o == nil || o.DataId == nil { + var ret string + return ret + } + return *o.DataId +} + +// GetDataIdOk returns a tuple with the DataId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetDataIdOk() (*string, bool) { + if o == nil || o.DataId == nil { + return nil, false + } + return o.DataId, true +} + +// HasDataId returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasDataId() bool { + if o != nil && o.DataId != nil { + return true + } + + return false +} + +// SetDataId gets a reference to the given string and assigns it to the DataId field. +func (o *PolicyEvalNotification) SetDataId(v string) { + o.DataId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetCreatedAt() int32 { + if o == nil || o.CreatedAt == nil { + var ret int32 + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetCreatedAtOk() (*int32, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int32 and assigns it to the CreatedAt field. +func (o *PolicyEvalNotification) SetCreatedAt(v int32) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetLastUpdated() int32 { + if o == nil || o.LastUpdated == nil { + var ret int32 + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetLastUpdatedOk() (*int32, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given int32 and assigns it to the LastUpdated field. +func (o *PolicyEvalNotification) SetLastUpdated(v int32) { + o.LastUpdated = &v +} + +// GetRecordStateKey returns the RecordStateKey field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetRecordStateKey() string { + if o == nil || o.RecordStateKey == nil { + var ret string + return ret + } + return *o.RecordStateKey +} + +// GetRecordStateKeyOk returns a tuple with the RecordStateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetRecordStateKeyOk() (*string, bool) { + if o == nil || o.RecordStateKey == nil { + return nil, false + } + return o.RecordStateKey, true +} + +// HasRecordStateKey returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasRecordStateKey() bool { + if o != nil && o.RecordStateKey != nil { + return true + } + + return false +} + +// SetRecordStateKey gets a reference to the given string and assigns it to the RecordStateKey field. +func (o *PolicyEvalNotification) SetRecordStateKey(v string) { + o.RecordStateKey = &v +} + +// GetRecordStateVal returns the RecordStateVal field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyEvalNotification) GetRecordStateVal() string { + if o == nil || o.RecordStateVal.Get() == nil { + var ret string + return ret + } + return *o.RecordStateVal.Get() +} + +// GetRecordStateValOk returns a tuple with the RecordStateVal field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyEvalNotification) GetRecordStateValOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecordStateVal.Get(), o.RecordStateVal.IsSet() +} + +// HasRecordStateVal returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasRecordStateVal() bool { + if o != nil && o.RecordStateVal.IsSet() { + return true + } + + return false +} + +// SetRecordStateVal gets a reference to the given NullableString and assigns it to the RecordStateVal field. +func (o *PolicyEvalNotification) SetRecordStateVal(v string) { + o.RecordStateVal.Set(&v) +} +// SetRecordStateValNil sets the value for RecordStateVal to be an explicit nil +func (o *PolicyEvalNotification) SetRecordStateValNil() { + o.RecordStateVal.Set(nil) +} + +// UnsetRecordStateVal ensures that no value is present for RecordStateVal, not even an explicit nil +func (o *PolicyEvalNotification) UnsetRecordStateVal() { + o.RecordStateVal.Unset() +} + +// GetTries returns the Tries field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetTries() int32 { + if o == nil || o.Tries == nil { + var ret int32 + return ret + } + return *o.Tries +} + +// GetTriesOk returns a tuple with the Tries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetTriesOk() (*int32, bool) { + if o == nil || o.Tries == nil { + return nil, false + } + return o.Tries, true +} + +// HasTries returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasTries() bool { + if o != nil && o.Tries != nil { + return true + } + + return false +} + +// SetTries gets a reference to the given int32 and assigns it to the Tries field. +func (o *PolicyEvalNotification) SetTries(v int32) { + o.Tries = &v +} + +// GetMaxTries returns the MaxTries field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetMaxTries() int32 { + if o == nil || o.MaxTries == nil { + var ret int32 + return ret + } + return *o.MaxTries +} + +// GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetMaxTriesOk() (*int32, bool) { + if o == nil || o.MaxTries == nil { + return nil, false + } + return o.MaxTries, true +} + +// HasMaxTries returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasMaxTries() bool { + if o != nil && o.MaxTries != nil { + return true + } + + return false +} + +// SetMaxTries gets a reference to the given int32 and assigns it to the MaxTries field. +func (o *PolicyEvalNotification) SetMaxTries(v int32) { + o.MaxTries = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *PolicyEvalNotification) GetData() PolicyEvalNotificationData { + if o == nil || o.Data == nil { + var ret PolicyEvalNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotification) GetDataOk() (*PolicyEvalNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *PolicyEvalNotification) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given PolicyEvalNotificationData and assigns it to the Data field. +func (o *PolicyEvalNotification) SetData(v PolicyEvalNotificationData) { + o.Data = &v +} + +func (o PolicyEvalNotification) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.QueueId != nil { + toSerialize["queueId"] = o.QueueId + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.DataId != nil { + toSerialize["dataId"] = o.DataId + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.RecordStateKey != nil { + toSerialize["record_state_key"] = o.RecordStateKey + } + if o.RecordStateVal.IsSet() { + toSerialize["record_state_val"] = o.RecordStateVal.Get() + } + if o.Tries != nil { + toSerialize["tries"] = o.Tries + } + if o.MaxTries != nil { + toSerialize["max_tries"] = o.MaxTries + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullablePolicyEvalNotification struct { + value *PolicyEvalNotification + isSet bool +} + +func (v NullablePolicyEvalNotification) Get() *PolicyEvalNotification { + return v.value +} + +func (v *NullablePolicyEvalNotification) Set(val *PolicyEvalNotification) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEvalNotification) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEvalNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEvalNotification(val *PolicyEvalNotification) *NullablePolicyEvalNotification { + return &NullablePolicyEvalNotification{value: val, isSet: true} +} + +func (v NullablePolicyEvalNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEvalNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_eval_notification_all_of.go b/.gen/anchore/model_policy_eval_notification_all_of.go new file mode 100644 index 0000000000..74c6733d2d --- /dev/null +++ b/.gen/anchore/model_policy_eval_notification_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyEvalNotificationAllOf The Notification Object definition for Policy Eval Notifications +type PolicyEvalNotificationAllOf struct { + Data *PolicyEvalNotificationData `json:"data,omitempty"` +} + +// NewPolicyEvalNotificationAllOf instantiates a new PolicyEvalNotificationAllOf 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 NewPolicyEvalNotificationAllOf() *PolicyEvalNotificationAllOf { + this := PolicyEvalNotificationAllOf{} + return &this +} + +// NewPolicyEvalNotificationAllOfWithDefaults instantiates a new PolicyEvalNotificationAllOf 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 NewPolicyEvalNotificationAllOfWithDefaults() *PolicyEvalNotificationAllOf { + this := PolicyEvalNotificationAllOf{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *PolicyEvalNotificationAllOf) GetData() PolicyEvalNotificationData { + if o == nil || o.Data == nil { + var ret PolicyEvalNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationAllOf) GetDataOk() (*PolicyEvalNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *PolicyEvalNotificationAllOf) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given PolicyEvalNotificationData and assigns it to the Data field. +func (o *PolicyEvalNotificationAllOf) SetData(v PolicyEvalNotificationData) { + o.Data = &v +} + +func (o PolicyEvalNotificationAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullablePolicyEvalNotificationAllOf struct { + value *PolicyEvalNotificationAllOf + isSet bool +} + +func (v NullablePolicyEvalNotificationAllOf) Get() *PolicyEvalNotificationAllOf { + return v.value +} + +func (v *NullablePolicyEvalNotificationAllOf) Set(val *PolicyEvalNotificationAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEvalNotificationAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEvalNotificationAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEvalNotificationAllOf(val *PolicyEvalNotificationAllOf) *NullablePolicyEvalNotificationAllOf { + return &NullablePolicyEvalNotificationAllOf{value: val, isSet: true} +} + +func (v NullablePolicyEvalNotificationAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEvalNotificationAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_eval_notification_data.go b/.gen/anchore/model_policy_eval_notification_data.go new file mode 100644 index 0000000000..b6eae2139f --- /dev/null +++ b/.gen/anchore/model_policy_eval_notification_data.go @@ -0,0 +1,224 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyEvalNotificationData struct for PolicyEvalNotificationData +type PolicyEvalNotificationData struct { + NotificationUser *string `json:"notification_user,omitempty"` + NotificationUserEmail *string `json:"notification_user_email,omitempty"` + NotificationType *string `json:"notification_type,omitempty"` + NotificationPayload *PolicyEvalNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewPolicyEvalNotificationData instantiates a new PolicyEvalNotificationData 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 NewPolicyEvalNotificationData() *PolicyEvalNotificationData { + this := PolicyEvalNotificationData{} + return &this +} + +// NewPolicyEvalNotificationDataWithDefaults instantiates a new PolicyEvalNotificationData 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 NewPolicyEvalNotificationDataWithDefaults() *PolicyEvalNotificationData { + this := PolicyEvalNotificationData{} + return &this +} + +// GetNotificationUser returns the NotificationUser field value if set, zero value otherwise. +func (o *PolicyEvalNotificationData) GetNotificationUser() string { + if o == nil || o.NotificationUser == nil { + var ret string + return ret + } + return *o.NotificationUser +} + +// GetNotificationUserOk returns a tuple with the NotificationUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationData) GetNotificationUserOk() (*string, bool) { + if o == nil || o.NotificationUser == nil { + return nil, false + } + return o.NotificationUser, true +} + +// HasNotificationUser returns a boolean if a field has been set. +func (o *PolicyEvalNotificationData) HasNotificationUser() bool { + if o != nil && o.NotificationUser != nil { + return true + } + + return false +} + +// SetNotificationUser gets a reference to the given string and assigns it to the NotificationUser field. +func (o *PolicyEvalNotificationData) SetNotificationUser(v string) { + o.NotificationUser = &v +} + +// GetNotificationUserEmail returns the NotificationUserEmail field value if set, zero value otherwise. +func (o *PolicyEvalNotificationData) GetNotificationUserEmail() string { + if o == nil || o.NotificationUserEmail == nil { + var ret string + return ret + } + return *o.NotificationUserEmail +} + +// GetNotificationUserEmailOk returns a tuple with the NotificationUserEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationData) GetNotificationUserEmailOk() (*string, bool) { + if o == nil || o.NotificationUserEmail == nil { + return nil, false + } + return o.NotificationUserEmail, true +} + +// HasNotificationUserEmail returns a boolean if a field has been set. +func (o *PolicyEvalNotificationData) HasNotificationUserEmail() bool { + if o != nil && o.NotificationUserEmail != nil { + return true + } + + return false +} + +// SetNotificationUserEmail gets a reference to the given string and assigns it to the NotificationUserEmail field. +func (o *PolicyEvalNotificationData) SetNotificationUserEmail(v string) { + o.NotificationUserEmail = &v +} + +// GetNotificationType returns the NotificationType field value if set, zero value otherwise. +func (o *PolicyEvalNotificationData) GetNotificationType() string { + if o == nil || o.NotificationType == nil { + var ret string + return ret + } + return *o.NotificationType +} + +// GetNotificationTypeOk returns a tuple with the NotificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationData) GetNotificationTypeOk() (*string, bool) { + if o == nil || o.NotificationType == nil { + return nil, false + } + return o.NotificationType, true +} + +// HasNotificationType returns a boolean if a field has been set. +func (o *PolicyEvalNotificationData) HasNotificationType() bool { + if o != nil && o.NotificationType != nil { + return true + } + + return false +} + +// SetNotificationType gets a reference to the given string and assigns it to the NotificationType field. +func (o *PolicyEvalNotificationData) SetNotificationType(v string) { + o.NotificationType = &v +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *PolicyEvalNotificationData) GetNotificationPayload() PolicyEvalNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret PolicyEvalNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationData) GetNotificationPayloadOk() (*PolicyEvalNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *PolicyEvalNotificationData) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given PolicyEvalNotificationPayload and assigns it to the NotificationPayload field. +func (o *PolicyEvalNotificationData) SetNotificationPayload(v PolicyEvalNotificationPayload) { + o.NotificationPayload = &v +} + +func (o PolicyEvalNotificationData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationUser != nil { + toSerialize["notification_user"] = o.NotificationUser + } + if o.NotificationUserEmail != nil { + toSerialize["notification_user_email"] = o.NotificationUserEmail + } + if o.NotificationType != nil { + toSerialize["notification_type"] = o.NotificationType + } + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullablePolicyEvalNotificationData struct { + value *PolicyEvalNotificationData + isSet bool +} + +func (v NullablePolicyEvalNotificationData) Get() *PolicyEvalNotificationData { + return v.value +} + +func (v *NullablePolicyEvalNotificationData) Set(val *PolicyEvalNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEvalNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEvalNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEvalNotificationData(val *PolicyEvalNotificationData) *NullablePolicyEvalNotificationData { + return &NullablePolicyEvalNotificationData{value: val, isSet: true} +} + +func (v NullablePolicyEvalNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEvalNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_eval_notification_data_all_of.go b/.gen/anchore/model_policy_eval_notification_data_all_of.go new file mode 100644 index 0000000000..72de62b532 --- /dev/null +++ b/.gen/anchore/model_policy_eval_notification_data_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyEvalNotificationDataAllOf struct for PolicyEvalNotificationDataAllOf +type PolicyEvalNotificationDataAllOf struct { + NotificationPayload *PolicyEvalNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewPolicyEvalNotificationDataAllOf instantiates a new PolicyEvalNotificationDataAllOf 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 NewPolicyEvalNotificationDataAllOf() *PolicyEvalNotificationDataAllOf { + this := PolicyEvalNotificationDataAllOf{} + return &this +} + +// NewPolicyEvalNotificationDataAllOfWithDefaults instantiates a new PolicyEvalNotificationDataAllOf 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 NewPolicyEvalNotificationDataAllOfWithDefaults() *PolicyEvalNotificationDataAllOf { + this := PolicyEvalNotificationDataAllOf{} + return &this +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *PolicyEvalNotificationDataAllOf) GetNotificationPayload() PolicyEvalNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret PolicyEvalNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationDataAllOf) GetNotificationPayloadOk() (*PolicyEvalNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *PolicyEvalNotificationDataAllOf) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given PolicyEvalNotificationPayload and assigns it to the NotificationPayload field. +func (o *PolicyEvalNotificationDataAllOf) SetNotificationPayload(v PolicyEvalNotificationPayload) { + o.NotificationPayload = &v +} + +func (o PolicyEvalNotificationDataAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullablePolicyEvalNotificationDataAllOf struct { + value *PolicyEvalNotificationDataAllOf + isSet bool +} + +func (v NullablePolicyEvalNotificationDataAllOf) Get() *PolicyEvalNotificationDataAllOf { + return v.value +} + +func (v *NullablePolicyEvalNotificationDataAllOf) Set(val *PolicyEvalNotificationDataAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEvalNotificationDataAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEvalNotificationDataAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEvalNotificationDataAllOf(val *PolicyEvalNotificationDataAllOf) *NullablePolicyEvalNotificationDataAllOf { + return &NullablePolicyEvalNotificationDataAllOf{value: val, isSet: true} +} + +func (v NullablePolicyEvalNotificationDataAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEvalNotificationDataAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_eval_notification_payload.go b/.gen/anchore/model_policy_eval_notification_payload.go new file mode 100644 index 0000000000..29bbb9c997 --- /dev/null +++ b/.gen/anchore/model_policy_eval_notification_payload.go @@ -0,0 +1,336 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyEvalNotificationPayload struct for PolicyEvalNotificationPayload +type PolicyEvalNotificationPayload struct { + UserId *string `json:"userId,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` + NotificationId *string `json:"notificationId,omitempty"` + // The Current Policy Evaluation result + CurrEval map[string]interface{} `json:"curr_eval,omitempty"` + // The Previous Policy Evaluation result + LastEval map[string]interface{} `json:"last_eval,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewPolicyEvalNotificationPayload instantiates a new PolicyEvalNotificationPayload 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 NewPolicyEvalNotificationPayload() *PolicyEvalNotificationPayload { + this := PolicyEvalNotificationPayload{} + return &this +} + +// NewPolicyEvalNotificationPayloadWithDefaults instantiates a new PolicyEvalNotificationPayload 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 NewPolicyEvalNotificationPayloadWithDefaults() *PolicyEvalNotificationPayload { + this := PolicyEvalNotificationPayload{} + return &this +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayload) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayload) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *PolicyEvalNotificationPayload) SetUserId(v string) { + o.UserId = &v +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayload) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayload) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *PolicyEvalNotificationPayload) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v +} + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayload) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayload) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *PolicyEvalNotificationPayload) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +// GetNotificationId returns the NotificationId field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayload) GetNotificationId() string { + if o == nil || o.NotificationId == nil { + var ret string + return ret + } + return *o.NotificationId +} + +// GetNotificationIdOk returns a tuple with the NotificationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayload) GetNotificationIdOk() (*string, bool) { + if o == nil || o.NotificationId == nil { + return nil, false + } + return o.NotificationId, true +} + +// HasNotificationId returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasNotificationId() bool { + if o != nil && o.NotificationId != nil { + return true + } + + return false +} + +// SetNotificationId gets a reference to the given string and assigns it to the NotificationId field. +func (o *PolicyEvalNotificationPayload) SetNotificationId(v string) { + o.NotificationId = &v +} + +// GetCurrEval returns the CurrEval field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayload) GetCurrEval() map[string]interface{} { + if o == nil || o.CurrEval == nil { + var ret map[string]interface{} + return ret + } + return o.CurrEval +} + +// GetCurrEvalOk returns a tuple with the CurrEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayload) GetCurrEvalOk() (map[string]interface{}, bool) { + if o == nil || o.CurrEval == nil { + return nil, false + } + return o.CurrEval, true +} + +// HasCurrEval returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasCurrEval() bool { + if o != nil && o.CurrEval != nil { + return true + } + + return false +} + +// SetCurrEval gets a reference to the given map[string]interface{} and assigns it to the CurrEval field. +func (o *PolicyEvalNotificationPayload) SetCurrEval(v map[string]interface{}) { + o.CurrEval = v +} + +// GetLastEval returns the LastEval field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayload) GetLastEval() map[string]interface{} { + if o == nil || o.LastEval == nil { + var ret map[string]interface{} + return ret + } + return o.LastEval +} + +// GetLastEvalOk returns a tuple with the LastEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayload) GetLastEvalOk() (map[string]interface{}, bool) { + if o == nil || o.LastEval == nil { + return nil, false + } + return o.LastEval, true +} + +// HasLastEval returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasLastEval() bool { + if o != nil && o.LastEval != nil { + return true + } + + return false +} + +// SetLastEval gets a reference to the given map[string]interface{} and assigns it to the LastEval field. +func (o *PolicyEvalNotificationPayload) SetLastEval(v map[string]interface{}) { + o.LastEval = v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyEvalNotificationPayload) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyEvalNotificationPayload) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayload) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *PolicyEvalNotificationPayload) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o PolicyEvalNotificationPayload) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + if o.NotificationId != nil { + toSerialize["notificationId"] = o.NotificationId + } + if o.CurrEval != nil { + toSerialize["curr_eval"] = o.CurrEval + } + if o.LastEval != nil { + toSerialize["last_eval"] = o.LastEval + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullablePolicyEvalNotificationPayload struct { + value *PolicyEvalNotificationPayload + isSet bool +} + +func (v NullablePolicyEvalNotificationPayload) Get() *PolicyEvalNotificationPayload { + return v.value +} + +func (v *NullablePolicyEvalNotificationPayload) Set(val *PolicyEvalNotificationPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEvalNotificationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEvalNotificationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEvalNotificationPayload(val *PolicyEvalNotificationPayload) *NullablePolicyEvalNotificationPayload { + return &NullablePolicyEvalNotificationPayload{value: val, isSet: true} +} + +func (v NullablePolicyEvalNotificationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEvalNotificationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_eval_notification_payload_all_of.go b/.gen/anchore/model_policy_eval_notification_payload_all_of.go new file mode 100644 index 0000000000..42267164cf --- /dev/null +++ b/.gen/anchore/model_policy_eval_notification_payload_all_of.go @@ -0,0 +1,192 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyEvalNotificationPayloadAllOf struct for PolicyEvalNotificationPayloadAllOf +type PolicyEvalNotificationPayloadAllOf struct { + // The Current Policy Evaluation result + CurrEval map[string]interface{} `json:"curr_eval,omitempty"` + // The Previous Policy Evaluation result + LastEval map[string]interface{} `json:"last_eval,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewPolicyEvalNotificationPayloadAllOf instantiates a new PolicyEvalNotificationPayloadAllOf 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 NewPolicyEvalNotificationPayloadAllOf() *PolicyEvalNotificationPayloadAllOf { + this := PolicyEvalNotificationPayloadAllOf{} + return &this +} + +// NewPolicyEvalNotificationPayloadAllOfWithDefaults instantiates a new PolicyEvalNotificationPayloadAllOf 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 NewPolicyEvalNotificationPayloadAllOfWithDefaults() *PolicyEvalNotificationPayloadAllOf { + this := PolicyEvalNotificationPayloadAllOf{} + return &this +} + +// GetCurrEval returns the CurrEval field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayloadAllOf) GetCurrEval() map[string]interface{} { + if o == nil || o.CurrEval == nil { + var ret map[string]interface{} + return ret + } + return o.CurrEval +} + +// GetCurrEvalOk returns a tuple with the CurrEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayloadAllOf) GetCurrEvalOk() (map[string]interface{}, bool) { + if o == nil || o.CurrEval == nil { + return nil, false + } + return o.CurrEval, true +} + +// HasCurrEval returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayloadAllOf) HasCurrEval() bool { + if o != nil && o.CurrEval != nil { + return true + } + + return false +} + +// SetCurrEval gets a reference to the given map[string]interface{} and assigns it to the CurrEval field. +func (o *PolicyEvalNotificationPayloadAllOf) SetCurrEval(v map[string]interface{}) { + o.CurrEval = v +} + +// GetLastEval returns the LastEval field value if set, zero value otherwise. +func (o *PolicyEvalNotificationPayloadAllOf) GetLastEval() map[string]interface{} { + if o == nil || o.LastEval == nil { + var ret map[string]interface{} + return ret + } + return o.LastEval +} + +// GetLastEvalOk returns a tuple with the LastEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyEvalNotificationPayloadAllOf) GetLastEvalOk() (map[string]interface{}, bool) { + if o == nil || o.LastEval == nil { + return nil, false + } + return o.LastEval, true +} + +// HasLastEval returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayloadAllOf) HasLastEval() bool { + if o != nil && o.LastEval != nil { + return true + } + + return false +} + +// SetLastEval gets a reference to the given map[string]interface{} and assigns it to the LastEval field. +func (o *PolicyEvalNotificationPayloadAllOf) SetLastEval(v map[string]interface{}) { + o.LastEval = v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyEvalNotificationPayloadAllOf) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyEvalNotificationPayloadAllOf) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *PolicyEvalNotificationPayloadAllOf) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *PolicyEvalNotificationPayloadAllOf) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o PolicyEvalNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CurrEval != nil { + toSerialize["curr_eval"] = o.CurrEval + } + if o.LastEval != nil { + toSerialize["last_eval"] = o.LastEval + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullablePolicyEvalNotificationPayloadAllOf struct { + value *PolicyEvalNotificationPayloadAllOf + isSet bool +} + +func (v NullablePolicyEvalNotificationPayloadAllOf) Get() *PolicyEvalNotificationPayloadAllOf { + return v.value +} + +func (v *NullablePolicyEvalNotificationPayloadAllOf) Set(val *PolicyEvalNotificationPayloadAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEvalNotificationPayloadAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEvalNotificationPayloadAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEvalNotificationPayloadAllOf(val *PolicyEvalNotificationPayloadAllOf) *NullablePolicyEvalNotificationPayloadAllOf { + return &NullablePolicyEvalNotificationPayloadAllOf{value: val, isSet: true} +} + +func (v NullablePolicyEvalNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEvalNotificationPayloadAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_rule.go b/.gen/anchore/model_policy_rule.go index 03c33bdb95..241966ccf6 100644 --- a/.gen/anchore/model_policy_rule.go +++ b/.gen/anchore/model_policy_rule.go @@ -1,20 +1,239 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // PolicyRule A rule that defines and decision value if the match is found true for a given image. type PolicyRule struct { - Id string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Gate string `json:"gate"` Trigger string `json:"trigger"` Action string `json:"action"` - Params []PolicyRuleParams `json:"params"` + Params []PolicyRuleParamsInner `json:"params"` +} + +// NewPolicyRule instantiates a new PolicyRule 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 NewPolicyRule(gate string, trigger string, action string) *PolicyRule { + this := PolicyRule{} + this.Gate = gate + this.Trigger = trigger + this.Action = action + return &this +} + +// NewPolicyRuleWithDefaults instantiates a new PolicyRule 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 NewPolicyRuleWithDefaults() *PolicyRule { + this := PolicyRule{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PolicyRule) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyRule) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PolicyRule) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PolicyRule) SetId(v string) { + o.Id = &v +} + +// GetGate returns the Gate field value +func (o *PolicyRule) GetGate() string { + if o == nil { + var ret string + return ret + } + + return o.Gate +} + +// GetGateOk returns a tuple with the Gate field value +// and a boolean to check if the value has been set. +func (o *PolicyRule) GetGateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Gate, true +} + +// SetGate sets field value +func (o *PolicyRule) SetGate(v string) { + o.Gate = v +} + +// GetTrigger returns the Trigger field value +func (o *PolicyRule) GetTrigger() string { + if o == nil { + var ret string + return ret + } + + return o.Trigger +} + +// GetTriggerOk returns a tuple with the Trigger field value +// and a boolean to check if the value has been set. +func (o *PolicyRule) GetTriggerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Trigger, true +} + +// SetTrigger sets field value +func (o *PolicyRule) SetTrigger(v string) { + o.Trigger = v +} + +// GetAction returns the Action field value +func (o *PolicyRule) GetAction() string { + if o == nil { + var ret string + return ret + } + + return o.Action } + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *PolicyRule) GetActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *PolicyRule) SetAction(v string) { + o.Action = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *PolicyRule) GetParams() []PolicyRuleParamsInner { + if o == nil || o.Params == nil { + var ret []PolicyRuleParamsInner + return ret + } + return o.Params +} + +// 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 *PolicyRule) GetParamsOk() ([]PolicyRuleParamsInner, bool) { + if o == nil || o.Params == nil { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *PolicyRule) HasParams() bool { + if o != nil && o.Params != nil { + return true + } + + return false +} + +// SetParams gets a reference to the given []PolicyRuleParamsInner and assigns it to the Params field. +func (o *PolicyRule) SetParams(v []PolicyRuleParamsInner) { + o.Params = v +} + +func (o PolicyRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["gate"] = o.Gate + } + if true { + toSerialize["trigger"] = o.Trigger + } + if true { + toSerialize["action"] = o.Action + } + if o.Params != nil { + toSerialize["params"] = o.Params + } + return json.Marshal(toSerialize) +} + +type NullablePolicyRule struct { + value *PolicyRule + isSet bool +} + +func (v NullablePolicyRule) Get() *PolicyRule { + return v.value +} + +func (v *NullablePolicyRule) Set(val *PolicyRule) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyRule) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyRule(val *PolicyRule) *NullablePolicyRule { + return &NullablePolicyRule{value: val, isSet: true} +} + +func (v NullablePolicyRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_policy_rule_params.go b/.gen/anchore/model_policy_rule_params.go deleted file mode 100644 index 235647d447..0000000000 --- a/.gen/anchore/model_policy_rule_params.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package anchore -// PolicyRuleParams struct for PolicyRuleParams -type PolicyRuleParams struct { - Name string `json:"name"` - Value string `json:"value"` -} diff --git a/.gen/anchore/model_policy_rule_params_inner.go b/.gen/anchore/model_policy_rule_params_inner.go new file mode 100644 index 0000000000..82f40ae64a --- /dev/null +++ b/.gen/anchore/model_policy_rule_params_inner.go @@ -0,0 +1,138 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// PolicyRuleParamsInner struct for PolicyRuleParamsInner +type PolicyRuleParamsInner struct { + Name string `json:"name"` + Value string `json:"value"` +} + +// NewPolicyRuleParamsInner instantiates a new PolicyRuleParamsInner 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 NewPolicyRuleParamsInner(name string, value string) *PolicyRuleParamsInner { + this := PolicyRuleParamsInner{} + this.Name = name + this.Value = value + return &this +} + +// NewPolicyRuleParamsInnerWithDefaults instantiates a new PolicyRuleParamsInner 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 NewPolicyRuleParamsInnerWithDefaults() *PolicyRuleParamsInner { + this := PolicyRuleParamsInner{} + return &this +} + +// GetName returns the Name field value +func (o *PolicyRuleParamsInner) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PolicyRuleParamsInner) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PolicyRuleParamsInner) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value +func (o *PolicyRuleParamsInner) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *PolicyRuleParamsInner) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *PolicyRuleParamsInner) SetValue(v string) { + o.Value = v +} + +func (o PolicyRuleParamsInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["value"] = o.Value + } + return json.Marshal(toSerialize) +} + +type NullablePolicyRuleParamsInner struct { + value *PolicyRuleParamsInner + isSet bool +} + +func (v NullablePolicyRuleParamsInner) Get() *PolicyRuleParamsInner { + return v.value +} + +func (v *NullablePolicyRuleParamsInner) Set(val *PolicyRuleParamsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyRuleParamsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyRuleParamsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyRuleParamsInner(val *PolicyRuleParamsInner) *NullablePolicyRuleParamsInner { + return &NullablePolicyRuleParamsInner{value: val, isSet: true} +} + +func (v NullablePolicyRuleParamsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyRuleParamsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_regex_content_match.go b/.gen/anchore/model_regex_content_match.go new file mode 100644 index 0000000000..6650c2ccb6 --- /dev/null +++ b/.gen/anchore/model_regex_content_match.go @@ -0,0 +1,191 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// RegexContentMatch Match of a named regex on a file +type RegexContentMatch struct { + // The name associated with the regular expression + Name *string `json:"name,omitempty"` + // The regular expression used for the match + Regex *string `json:"regex,omitempty"` + // A list of line numbers in the file that matched the regex + Lines []int32 `json:"lines,omitempty"` +} + +// NewRegexContentMatch instantiates a new RegexContentMatch 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 NewRegexContentMatch() *RegexContentMatch { + this := RegexContentMatch{} + return &this +} + +// NewRegexContentMatchWithDefaults instantiates a new RegexContentMatch 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 NewRegexContentMatchWithDefaults() *RegexContentMatch { + this := RegexContentMatch{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RegexContentMatch) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegexContentMatch) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RegexContentMatch) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RegexContentMatch) SetName(v string) { + o.Name = &v +} + +// GetRegex returns the Regex field value if set, zero value otherwise. +func (o *RegexContentMatch) GetRegex() string { + if o == nil || o.Regex == nil { + var ret string + return ret + } + return *o.Regex +} + +// 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 *RegexContentMatch) GetRegexOk() (*string, bool) { + if o == nil || o.Regex == nil { + return nil, false + } + return o.Regex, true +} + +// HasRegex returns a boolean if a field has been set. +func (o *RegexContentMatch) HasRegex() bool { + if o != nil && o.Regex != nil { + return true + } + + return false +} + +// SetRegex gets a reference to the given string and assigns it to the Regex field. +func (o *RegexContentMatch) SetRegex(v string) { + o.Regex = &v +} + +// GetLines returns the Lines field value if set, zero value otherwise. +func (o *RegexContentMatch) GetLines() []int32 { + if o == nil || o.Lines == nil { + var ret []int32 + return ret + } + return o.Lines +} + +// GetLinesOk returns a tuple with the Lines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegexContentMatch) GetLinesOk() ([]int32, bool) { + if o == nil || o.Lines == nil { + return nil, false + } + return o.Lines, true +} + +// HasLines returns a boolean if a field has been set. +func (o *RegexContentMatch) HasLines() bool { + if o != nil && o.Lines != nil { + return true + } + + return false +} + +// SetLines gets a reference to the given []int32 and assigns it to the Lines field. +func (o *RegexContentMatch) SetLines(v []int32) { + o.Lines = v +} + +func (o RegexContentMatch) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Regex != nil { + toSerialize["regex"] = o.Regex + } + if o.Lines != nil { + toSerialize["lines"] = o.Lines + } + return json.Marshal(toSerialize) +} + +type NullableRegexContentMatch struct { + value *RegexContentMatch + isSet bool +} + +func (v NullableRegexContentMatch) Get() *RegexContentMatch { + return v.value +} + +func (v *NullableRegexContentMatch) Set(val *RegexContentMatch) { + v.value = val + v.isSet = true +} + +func (v NullableRegexContentMatch) IsSet() bool { + return v.isSet +} + +func (v *NullableRegexContentMatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegexContentMatch(val *RegexContentMatch) *NullableRegexContentMatch { + return &NullableRegexContentMatch{value: val, isSet: true} +} + +func (v NullableRegexContentMatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegexContentMatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_registry_configuration.go b/.gen/anchore/model_registry_configuration.go index 89b7fa9b71..64ff0fffa0 100644 --- a/.gen/anchore/model_registry_configuration.go +++ b/.gen/anchore/model_registry_configuration.go @@ -1,32 +1,375 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // RegistryConfiguration A registry entry describing the endpoint and credentials for a registry to pull images from type RegistryConfiguration struct { - CreatedAt time.Time `json:"created_at,omitempty"` - LastUpated time.Time `json:"last_upated,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + LastUpated *time.Time `json:"last_upated,omitempty"` // Username portion of credential to use for this registry - RegistryUser string `json:"registry_user,omitempty"` + RegistryUser *string `json:"registry_user,omitempty"` // Type of registry - RegistryType string `json:"registry_type,omitempty"` + RegistryType *string `json:"registry_type,omitempty"` // Engine user that owns this registry entry - UserId string `json:"userId,omitempty"` + UserId *string `json:"userId,omitempty"` // hostname:port string for accessing the registry, as would be used in a docker pull operation - Registry string `json:"registry,omitempty"` + Registry *string `json:"registry,omitempty"` // human readable name associated with registry record - RegistryName string `json:"registry_name,omitempty"` + RegistryName *string `json:"registry_name,omitempty"` // Use TLS/SSL verification for the registry URL - RegistryVerify bool `json:"registry_verify,omitempty"` + RegistryVerify *bool `json:"registry_verify,omitempty"` +} + +// NewRegistryConfiguration instantiates a new RegistryConfiguration 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 NewRegistryConfiguration() *RegistryConfiguration { + this := RegistryConfiguration{} + return &this +} + +// NewRegistryConfigurationWithDefaults instantiates a new RegistryConfiguration 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 NewRegistryConfigurationWithDefaults() *RegistryConfiguration { + this := RegistryConfiguration{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *RegistryConfiguration) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpated returns the LastUpated field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetLastUpated() time.Time { + if o == nil || o.LastUpated == nil { + var ret time.Time + return ret + } + return *o.LastUpated +} + +// GetLastUpatedOk returns a tuple with the LastUpated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetLastUpatedOk() (*time.Time, bool) { + if o == nil || o.LastUpated == nil { + return nil, false + } + return o.LastUpated, true +} + +// HasLastUpated returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasLastUpated() bool { + if o != nil && o.LastUpated != nil { + return true + } + + return false +} + +// SetLastUpated gets a reference to the given time.Time and assigns it to the LastUpated field. +func (o *RegistryConfiguration) SetLastUpated(v time.Time) { + o.LastUpated = &v +} + +// GetRegistryUser returns the RegistryUser field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetRegistryUser() string { + if o == nil || o.RegistryUser == nil { + var ret string + return ret + } + return *o.RegistryUser +} + +// GetRegistryUserOk returns a tuple with the RegistryUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetRegistryUserOk() (*string, bool) { + if o == nil || o.RegistryUser == nil { + return nil, false + } + return o.RegistryUser, true +} + +// HasRegistryUser returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasRegistryUser() bool { + if o != nil && o.RegistryUser != nil { + return true + } + + return false +} + +// SetRegistryUser gets a reference to the given string and assigns it to the RegistryUser field. +func (o *RegistryConfiguration) SetRegistryUser(v string) { + o.RegistryUser = &v +} + +// GetRegistryType returns the RegistryType field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetRegistryType() string { + if o == nil || o.RegistryType == nil { + var ret string + return ret + } + return *o.RegistryType +} + +// GetRegistryTypeOk returns a tuple with the RegistryType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetRegistryTypeOk() (*string, bool) { + if o == nil || o.RegistryType == nil { + return nil, false + } + return o.RegistryType, true +} + +// HasRegistryType returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasRegistryType() bool { + if o != nil && o.RegistryType != nil { + return true + } + + return false +} + +// SetRegistryType gets a reference to the given string and assigns it to the RegistryType field. +func (o *RegistryConfiguration) SetRegistryType(v string) { + o.RegistryType = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *RegistryConfiguration) SetUserId(v string) { + o.UserId = &v +} + +// GetRegistry returns the Registry field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetRegistry() string { + if o == nil || o.Registry == nil { + var ret string + return ret + } + return *o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetRegistryOk() (*string, bool) { + if o == nil || o.Registry == nil { + return nil, false + } + return o.Registry, true +} + +// HasRegistry returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasRegistry() bool { + if o != nil && o.Registry != nil { + return true + } + + return false +} + +// SetRegistry gets a reference to the given string and assigns it to the Registry field. +func (o *RegistryConfiguration) SetRegistry(v string) { + o.Registry = &v +} + +// GetRegistryName returns the RegistryName field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetRegistryName() string { + if o == nil || o.RegistryName == nil { + var ret string + return ret + } + return *o.RegistryName +} + +// GetRegistryNameOk returns a tuple with the RegistryName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetRegistryNameOk() (*string, bool) { + if o == nil || o.RegistryName == nil { + return nil, false + } + return o.RegistryName, true +} + +// HasRegistryName returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasRegistryName() bool { + if o != nil && o.RegistryName != nil { + return true + } + + return false +} + +// SetRegistryName gets a reference to the given string and assigns it to the RegistryName field. +func (o *RegistryConfiguration) SetRegistryName(v string) { + o.RegistryName = &v +} + +// GetRegistryVerify returns the RegistryVerify field value if set, zero value otherwise. +func (o *RegistryConfiguration) GetRegistryVerify() bool { + if o == nil || o.RegistryVerify == nil { + var ret bool + return ret + } + return *o.RegistryVerify +} + +// GetRegistryVerifyOk returns a tuple with the RegistryVerify field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfiguration) GetRegistryVerifyOk() (*bool, bool) { + if o == nil || o.RegistryVerify == nil { + return nil, false + } + return o.RegistryVerify, true } + +// HasRegistryVerify returns a boolean if a field has been set. +func (o *RegistryConfiguration) HasRegistryVerify() bool { + if o != nil && o.RegistryVerify != nil { + return true + } + + return false +} + +// SetRegistryVerify gets a reference to the given bool and assigns it to the RegistryVerify field. +func (o *RegistryConfiguration) SetRegistryVerify(v bool) { + o.RegistryVerify = &v +} + +func (o RegistryConfiguration) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpated != nil { + toSerialize["last_upated"] = o.LastUpated + } + if o.RegistryUser != nil { + toSerialize["registry_user"] = o.RegistryUser + } + if o.RegistryType != nil { + toSerialize["registry_type"] = o.RegistryType + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.Registry != nil { + toSerialize["registry"] = o.Registry + } + if o.RegistryName != nil { + toSerialize["registry_name"] = o.RegistryName + } + if o.RegistryVerify != nil { + toSerialize["registry_verify"] = o.RegistryVerify + } + return json.Marshal(toSerialize) +} + +type NullableRegistryConfiguration struct { + value *RegistryConfiguration + isSet bool +} + +func (v NullableRegistryConfiguration) Get() *RegistryConfiguration { + return v.value +} + +func (v *NullableRegistryConfiguration) Set(val *RegistryConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableRegistryConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableRegistryConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegistryConfiguration(val *RegistryConfiguration) *NullableRegistryConfiguration { + return &NullableRegistryConfiguration{value: val, isSet: true} +} + +func (v NullableRegistryConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegistryConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_registry_configuration_request.go b/.gen/anchore/model_registry_configuration_request.go index c1e9d45a71..a5b46d4021 100644 --- a/.gen/anchore/model_registry_configuration_request.go +++ b/.gen/anchore/model_registry_configuration_request.go @@ -1,27 +1,302 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // RegistryConfigurationRequest A registry record describing the endpoint and credentials for a registry type RegistryConfigurationRequest struct { // Username portion of credential to use for this registry - RegistryUser string `json:"registry_user,omitempty"` + RegistryUser *string `json:"registry_user,omitempty"` // Password portion of credential to use for this registry - RegistryPass string `json:"registry_pass,omitempty"` + RegistryPass *string `json:"registry_pass,omitempty"` // Type of registry - RegistryType string `json:"registry_type,omitempty"` + RegistryType *string `json:"registry_type,omitempty"` // hostname:port string for accessing the registry, as would be used in a docker pull operation. May include some or all of a repository and wildcards (e.g. docker.io/library/_* or gcr.io/myproject/myrepository) - Registry string `json:"registry,omitempty"` + Registry *string `json:"registry,omitempty"` // human readable name associated with registry record - RegistryName string `json:"registry_name,omitempty"` + RegistryName *string `json:"registry_name,omitempty"` // Use TLS/SSL verification for the registry URL - RegistryVerify bool `json:"registry_verify,omitempty"` + RegistryVerify *bool `json:"registry_verify,omitempty"` +} + +// NewRegistryConfigurationRequest instantiates a new RegistryConfigurationRequest 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 NewRegistryConfigurationRequest() *RegistryConfigurationRequest { + this := RegistryConfigurationRequest{} + return &this +} + +// NewRegistryConfigurationRequestWithDefaults instantiates a new RegistryConfigurationRequest 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 NewRegistryConfigurationRequestWithDefaults() *RegistryConfigurationRequest { + this := RegistryConfigurationRequest{} + return &this +} + +// GetRegistryUser returns the RegistryUser field value if set, zero value otherwise. +func (o *RegistryConfigurationRequest) GetRegistryUser() string { + if o == nil || o.RegistryUser == nil { + var ret string + return ret + } + return *o.RegistryUser +} + +// GetRegistryUserOk returns a tuple with the RegistryUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfigurationRequest) GetRegistryUserOk() (*string, bool) { + if o == nil || o.RegistryUser == nil { + return nil, false + } + return o.RegistryUser, true +} + +// HasRegistryUser returns a boolean if a field has been set. +func (o *RegistryConfigurationRequest) HasRegistryUser() bool { + if o != nil && o.RegistryUser != nil { + return true + } + + return false +} + +// SetRegistryUser gets a reference to the given string and assigns it to the RegistryUser field. +func (o *RegistryConfigurationRequest) SetRegistryUser(v string) { + o.RegistryUser = &v +} + +// GetRegistryPass returns the RegistryPass field value if set, zero value otherwise. +func (o *RegistryConfigurationRequest) GetRegistryPass() string { + if o == nil || o.RegistryPass == nil { + var ret string + return ret + } + return *o.RegistryPass +} + +// GetRegistryPassOk returns a tuple with the RegistryPass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfigurationRequest) GetRegistryPassOk() (*string, bool) { + if o == nil || o.RegistryPass == nil { + return nil, false + } + return o.RegistryPass, true +} + +// HasRegistryPass returns a boolean if a field has been set. +func (o *RegistryConfigurationRequest) HasRegistryPass() bool { + if o != nil && o.RegistryPass != nil { + return true + } + + return false +} + +// SetRegistryPass gets a reference to the given string and assigns it to the RegistryPass field. +func (o *RegistryConfigurationRequest) SetRegistryPass(v string) { + o.RegistryPass = &v +} + +// GetRegistryType returns the RegistryType field value if set, zero value otherwise. +func (o *RegistryConfigurationRequest) GetRegistryType() string { + if o == nil || o.RegistryType == nil { + var ret string + return ret + } + return *o.RegistryType +} + +// GetRegistryTypeOk returns a tuple with the RegistryType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfigurationRequest) GetRegistryTypeOk() (*string, bool) { + if o == nil || o.RegistryType == nil { + return nil, false + } + return o.RegistryType, true +} + +// HasRegistryType returns a boolean if a field has been set. +func (o *RegistryConfigurationRequest) HasRegistryType() bool { + if o != nil && o.RegistryType != nil { + return true + } + + return false +} + +// SetRegistryType gets a reference to the given string and assigns it to the RegistryType field. +func (o *RegistryConfigurationRequest) SetRegistryType(v string) { + o.RegistryType = &v +} + +// GetRegistry returns the Registry field value if set, zero value otherwise. +func (o *RegistryConfigurationRequest) GetRegistry() string { + if o == nil || o.Registry == nil { + var ret string + return ret + } + return *o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfigurationRequest) GetRegistryOk() (*string, bool) { + if o == nil || o.Registry == nil { + return nil, false + } + return o.Registry, true +} + +// HasRegistry returns a boolean if a field has been set. +func (o *RegistryConfigurationRequest) HasRegistry() bool { + if o != nil && o.Registry != nil { + return true + } + + return false +} + +// SetRegistry gets a reference to the given string and assigns it to the Registry field. +func (o *RegistryConfigurationRequest) SetRegistry(v string) { + o.Registry = &v +} + +// GetRegistryName returns the RegistryName field value if set, zero value otherwise. +func (o *RegistryConfigurationRequest) GetRegistryName() string { + if o == nil || o.RegistryName == nil { + var ret string + return ret + } + return *o.RegistryName +} + +// GetRegistryNameOk returns a tuple with the RegistryName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfigurationRequest) GetRegistryNameOk() (*string, bool) { + if o == nil || o.RegistryName == nil { + return nil, false + } + return o.RegistryName, true +} + +// HasRegistryName returns a boolean if a field has been set. +func (o *RegistryConfigurationRequest) HasRegistryName() bool { + if o != nil && o.RegistryName != nil { + return true + } + + return false +} + +// SetRegistryName gets a reference to the given string and assigns it to the RegistryName field. +func (o *RegistryConfigurationRequest) SetRegistryName(v string) { + o.RegistryName = &v +} + +// GetRegistryVerify returns the RegistryVerify field value if set, zero value otherwise. +func (o *RegistryConfigurationRequest) GetRegistryVerify() bool { + if o == nil || o.RegistryVerify == nil { + var ret bool + return ret + } + return *o.RegistryVerify +} + +// GetRegistryVerifyOk returns a tuple with the RegistryVerify field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConfigurationRequest) GetRegistryVerifyOk() (*bool, bool) { + if o == nil || o.RegistryVerify == nil { + return nil, false + } + return o.RegistryVerify, true +} + +// HasRegistryVerify returns a boolean if a field has been set. +func (o *RegistryConfigurationRequest) HasRegistryVerify() bool { + if o != nil && o.RegistryVerify != nil { + return true + } + + return false +} + +// SetRegistryVerify gets a reference to the given bool and assigns it to the RegistryVerify field. +func (o *RegistryConfigurationRequest) SetRegistryVerify(v bool) { + o.RegistryVerify = &v } + +func (o RegistryConfigurationRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.RegistryUser != nil { + toSerialize["registry_user"] = o.RegistryUser + } + if o.RegistryPass != nil { + toSerialize["registry_pass"] = o.RegistryPass + } + if o.RegistryType != nil { + toSerialize["registry_type"] = o.RegistryType + } + if o.Registry != nil { + toSerialize["registry"] = o.Registry + } + if o.RegistryName != nil { + toSerialize["registry_name"] = o.RegistryName + } + if o.RegistryVerify != nil { + toSerialize["registry_verify"] = o.RegistryVerify + } + return json.Marshal(toSerialize) +} + +type NullableRegistryConfigurationRequest struct { + value *RegistryConfigurationRequest + isSet bool +} + +func (v NullableRegistryConfigurationRequest) Get() *RegistryConfigurationRequest { + return v.value +} + +func (v *NullableRegistryConfigurationRequest) Set(val *RegistryConfigurationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRegistryConfigurationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRegistryConfigurationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegistryConfigurationRequest(val *RegistryConfigurationRequest) *NullableRegistryConfigurationRequest { + return &NullableRegistryConfigurationRequest{value: val, isSet: true} +} + +func (v NullableRegistryConfigurationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegistryConfigurationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_registry_digest_source.go b/.gen/anchore/model_registry_digest_source.go index fded33b74a..515290111f 100644 --- a/.gen/anchore/model_registry_digest_source.go +++ b/.gen/anchore/model_registry_digest_source.go @@ -1,26 +1,215 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // RegistryDigestSource An image reference using a digest in a registry, includes some extra tag and timestamp info in addition to the pull string to allow proper tag history reconstruction. type RegistryDigestSource struct { // A digest-based pullstring (e.g. docker.io/nginx@sha256:123abc) Pullstring string `json:"pullstring"` - // A docker pull string (e.g. docker.io/nginx:latest, or docker.io/nginx@sha256:abd) to retrieve the image + // A valid docker tag reference (e.g. docker.io/nginx:latest) that will be associated with the image but not used to pull the image. Tag string `json:"tag"` // Optional override of the image creation time to support proper tag history construction in cases of out-of-order analysis compared to registry history for the tag - CreationTimestampOverride time.Time `json:"creation_timestamp_override"` + CreationTimestampOverride *time.Time `json:"creation_timestamp_override,omitempty"` // Base64 encoded content of the dockerfile used to build the image, if available. - Dockerfile string `json:"dockerfile,omitempty"` + Dockerfile *string `json:"dockerfile,omitempty"` +} + +// NewRegistryDigestSource instantiates a new RegistryDigestSource 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 NewRegistryDigestSource(pullstring string, tag string) *RegistryDigestSource { + this := RegistryDigestSource{} + this.Pullstring = pullstring + this.Tag = tag + return &this +} + +// NewRegistryDigestSourceWithDefaults instantiates a new RegistryDigestSource 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 NewRegistryDigestSourceWithDefaults() *RegistryDigestSource { + this := RegistryDigestSource{} + return &this +} + +// GetPullstring returns the Pullstring field value +func (o *RegistryDigestSource) GetPullstring() string { + if o == nil { + var ret string + return ret + } + + return o.Pullstring +} + +// GetPullstringOk returns a tuple with the Pullstring field value +// and a boolean to check if the value has been set. +func (o *RegistryDigestSource) GetPullstringOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pullstring, true +} + +// SetPullstring sets field value +func (o *RegistryDigestSource) SetPullstring(v string) { + o.Pullstring = v +} + +// GetTag returns the Tag field value +func (o *RegistryDigestSource) GetTag() string { + if o == nil { + var ret string + return ret + } + + return o.Tag +} + +// GetTagOk returns a tuple with the Tag field value +// and a boolean to check if the value has been set. +func (o *RegistryDigestSource) GetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Tag, true +} + +// SetTag sets field value +func (o *RegistryDigestSource) SetTag(v string) { + o.Tag = v +} + +// GetCreationTimestampOverride returns the CreationTimestampOverride field value if set, zero value otherwise. +func (o *RegistryDigestSource) GetCreationTimestampOverride() time.Time { + if o == nil || o.CreationTimestampOverride == nil { + var ret time.Time + return ret + } + return *o.CreationTimestampOverride +} + +// GetCreationTimestampOverrideOk returns a tuple with the CreationTimestampOverride field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryDigestSource) GetCreationTimestampOverrideOk() (*time.Time, bool) { + if o == nil || o.CreationTimestampOverride == nil { + return nil, false + } + return o.CreationTimestampOverride, true +} + +// HasCreationTimestampOverride returns a boolean if a field has been set. +func (o *RegistryDigestSource) HasCreationTimestampOverride() bool { + if o != nil && o.CreationTimestampOverride != nil { + return true + } + + return false +} + +// SetCreationTimestampOverride gets a reference to the given time.Time and assigns it to the CreationTimestampOverride field. +func (o *RegistryDigestSource) SetCreationTimestampOverride(v time.Time) { + o.CreationTimestampOverride = &v +} + +// GetDockerfile returns the Dockerfile field value if set, zero value otherwise. +func (o *RegistryDigestSource) GetDockerfile() string { + if o == nil || o.Dockerfile == nil { + var ret string + return ret + } + return *o.Dockerfile +} + +// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryDigestSource) GetDockerfileOk() (*string, bool) { + if o == nil || o.Dockerfile == nil { + return nil, false + } + return o.Dockerfile, true +} + +// HasDockerfile returns a boolean if a field has been set. +func (o *RegistryDigestSource) HasDockerfile() bool { + if o != nil && o.Dockerfile != nil { + return true + } + + return false +} + +// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field. +func (o *RegistryDigestSource) SetDockerfile(v string) { + o.Dockerfile = &v +} + +func (o RegistryDigestSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["pullstring"] = o.Pullstring + } + if true { + toSerialize["tag"] = o.Tag + } + if o.CreationTimestampOverride != nil { + toSerialize["creation_timestamp_override"] = o.CreationTimestampOverride + } + if o.Dockerfile != nil { + toSerialize["dockerfile"] = o.Dockerfile + } + return json.Marshal(toSerialize) +} + +type NullableRegistryDigestSource struct { + value *RegistryDigestSource + isSet bool +} + +func (v NullableRegistryDigestSource) Get() *RegistryDigestSource { + return v.value +} + +func (v *NullableRegistryDigestSource) Set(val *RegistryDigestSource) { + v.value = val + v.isSet = true +} + +func (v NullableRegistryDigestSource) IsSet() bool { + return v.isSet +} + +func (v *NullableRegistryDigestSource) Unset() { + v.value = nil + v.isSet = false } + +func NewNullableRegistryDigestSource(val *RegistryDigestSource) *NullableRegistryDigestSource { + return &NullableRegistryDigestSource{value: val, isSet: true} +} + +func (v NullableRegistryDigestSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegistryDigestSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_registry_tag_source.go b/.gen/anchore/model_registry_tag_source.go index 27557898f2..2f788c393e 100644 --- a/.gen/anchore/model_registry_tag_source.go +++ b/.gen/anchore/model_registry_tag_source.go @@ -1,19 +1,147 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // RegistryTagSource An image reference using a tag in a registry, this is the most common source type. type RegistryTagSource struct { // A docker pull string (e.g. docker.io/nginx:latest, or docker.io/nginx@sha256:abd) to retrieve the image Pullstring string `json:"pullstring"` // Base64 encoded content of the dockerfile used to build the image, if available. - Dockerfile string `json:"dockerfile,omitempty"` + Dockerfile *string `json:"dockerfile,omitempty"` +} + +// NewRegistryTagSource instantiates a new RegistryTagSource 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 NewRegistryTagSource(pullstring string) *RegistryTagSource { + this := RegistryTagSource{} + this.Pullstring = pullstring + return &this +} + +// NewRegistryTagSourceWithDefaults instantiates a new RegistryTagSource 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 NewRegistryTagSourceWithDefaults() *RegistryTagSource { + this := RegistryTagSource{} + return &this +} + +// GetPullstring returns the Pullstring field value +func (o *RegistryTagSource) GetPullstring() string { + if o == nil { + var ret string + return ret + } + + return o.Pullstring +} + +// GetPullstringOk returns a tuple with the Pullstring field value +// and a boolean to check if the value has been set. +func (o *RegistryTagSource) GetPullstringOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pullstring, true +} + +// SetPullstring sets field value +func (o *RegistryTagSource) SetPullstring(v string) { + o.Pullstring = v +} + +// GetDockerfile returns the Dockerfile field value if set, zero value otherwise. +func (o *RegistryTagSource) GetDockerfile() string { + if o == nil || o.Dockerfile == nil { + var ret string + return ret + } + return *o.Dockerfile +} + +// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryTagSource) GetDockerfileOk() (*string, bool) { + if o == nil || o.Dockerfile == nil { + return nil, false + } + return o.Dockerfile, true +} + +// HasDockerfile returns a boolean if a field has been set. +func (o *RegistryTagSource) HasDockerfile() bool { + if o != nil && o.Dockerfile != nil { + return true + } + + return false } + +// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field. +func (o *RegistryTagSource) SetDockerfile(v string) { + o.Dockerfile = &v +} + +func (o RegistryTagSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["pullstring"] = o.Pullstring + } + if o.Dockerfile != nil { + toSerialize["dockerfile"] = o.Dockerfile + } + return json.Marshal(toSerialize) +} + +type NullableRegistryTagSource struct { + value *RegistryTagSource + isSet bool +} + +func (v NullableRegistryTagSource) Get() *RegistryTagSource { + return v.value +} + +func (v *NullableRegistryTagSource) Set(val *RegistryTagSource) { + v.value = val + v.isSet = true +} + +func (v NullableRegistryTagSource) IsSet() bool { + return v.isSet +} + +func (v *NullableRegistryTagSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegistryTagSource(val *RegistryTagSource) *NullableRegistryTagSource { + return &NullableRegistryTagSource{value: val, isSet: true} +} + +func (v NullableRegistryTagSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegistryTagSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_retrieved_file.go b/.gen/anchore/model_retrieved_file.go new file mode 100644 index 0000000000..1cce813f43 --- /dev/null +++ b/.gen/anchore/model_retrieved_file.go @@ -0,0 +1,152 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// RetrievedFile The retrieved file entry including content (b64 encoded) +type RetrievedFile struct { + Path *string `json:"path,omitempty"` + B64Content *string `json:"b64_content,omitempty"` +} + +// NewRetrievedFile instantiates a new RetrievedFile 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 NewRetrievedFile() *RetrievedFile { + this := RetrievedFile{} + return &this +} + +// NewRetrievedFileWithDefaults instantiates a new RetrievedFile 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 NewRetrievedFileWithDefaults() *RetrievedFile { + this := RetrievedFile{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *RetrievedFile) GetPath() string { + if o == nil || o.Path == nil { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrievedFile) GetPathOk() (*string, bool) { + if o == nil || o.Path == nil { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *RetrievedFile) HasPath() bool { + if o != nil && o.Path != nil { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *RetrievedFile) SetPath(v string) { + o.Path = &v +} + +// GetB64Content returns the B64Content field value if set, zero value otherwise. +func (o *RetrievedFile) GetB64Content() string { + if o == nil || o.B64Content == nil { + var ret string + return ret + } + return *o.B64Content +} + +// GetB64ContentOk returns a tuple with the B64Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetrievedFile) GetB64ContentOk() (*string, bool) { + if o == nil || o.B64Content == nil { + return nil, false + } + return o.B64Content, true +} + +// HasB64Content returns a boolean if a field has been set. +func (o *RetrievedFile) HasB64Content() bool { + if o != nil && o.B64Content != nil { + return true + } + + return false +} + +// SetB64Content gets a reference to the given string and assigns it to the B64Content field. +func (o *RetrievedFile) SetB64Content(v string) { + o.B64Content = &v +} + +func (o RetrievedFile) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Path != nil { + toSerialize["path"] = o.Path + } + if o.B64Content != nil { + toSerialize["b64_content"] = o.B64Content + } + return json.Marshal(toSerialize) +} + +type NullableRetrievedFile struct { + value *RetrievedFile + isSet bool +} + +func (v NullableRetrievedFile) Get() *RetrievedFile { + return v.value +} + +func (v *NullableRetrievedFile) Set(val *RetrievedFile) { + v.value = val + v.isSet = true +} + +func (v NullableRetrievedFile) IsSet() bool { + return v.isSet +} + +func (v *NullableRetrievedFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetrievedFile(val *RetrievedFile) *NullableRetrievedFile { + return &NullableRetrievedFile{value: val, isSet: true} +} + +func (v NullableRetrievedFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetrievedFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_secret_search_result.go b/.gen/anchore/model_secret_search_result.go new file mode 100644 index 0000000000..972b57de7a --- /dev/null +++ b/.gen/anchore/model_secret_search_result.go @@ -0,0 +1,152 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// SecretSearchResult The retrieved file entry including content (b64 encoded) +type SecretSearchResult struct { + Path *string `json:"path,omitempty"` + Matches []RegexContentMatch `json:"matches,omitempty"` +} + +// NewSecretSearchResult instantiates a new SecretSearchResult 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 NewSecretSearchResult() *SecretSearchResult { + this := SecretSearchResult{} + return &this +} + +// NewSecretSearchResultWithDefaults instantiates a new SecretSearchResult 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 NewSecretSearchResultWithDefaults() *SecretSearchResult { + this := SecretSearchResult{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *SecretSearchResult) GetPath() string { + if o == nil || o.Path == nil { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecretSearchResult) GetPathOk() (*string, bool) { + if o == nil || o.Path == nil { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *SecretSearchResult) HasPath() bool { + if o != nil && o.Path != nil { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *SecretSearchResult) SetPath(v string) { + o.Path = &v +} + +// GetMatches returns the Matches field value if set, zero value otherwise. +func (o *SecretSearchResult) GetMatches() []RegexContentMatch { + if o == nil || o.Matches == nil { + var ret []RegexContentMatch + return ret + } + return o.Matches +} + +// GetMatchesOk returns a tuple with the Matches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecretSearchResult) GetMatchesOk() ([]RegexContentMatch, bool) { + if o == nil || o.Matches == nil { + return nil, false + } + return o.Matches, true +} + +// HasMatches returns a boolean if a field has been set. +func (o *SecretSearchResult) HasMatches() bool { + if o != nil && o.Matches != nil { + return true + } + + return false +} + +// SetMatches gets a reference to the given []RegexContentMatch and assigns it to the Matches field. +func (o *SecretSearchResult) SetMatches(v []RegexContentMatch) { + o.Matches = v +} + +func (o SecretSearchResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Path != nil { + toSerialize["path"] = o.Path + } + if o.Matches != nil { + toSerialize["matches"] = o.Matches + } + return json.Marshal(toSerialize) +} + +type NullableSecretSearchResult struct { + value *SecretSearchResult + isSet bool +} + +func (v NullableSecretSearchResult) Get() *SecretSearchResult { + return v.value +} + +func (v *NullableSecretSearchResult) Set(val *SecretSearchResult) { + v.value = val + v.isSet = true +} + +func (v NullableSecretSearchResult) IsSet() bool { + return v.isSet +} + +func (v *NullableSecretSearchResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecretSearchResult(val *SecretSearchResult) *NullableSecretSearchResult { + return &NullableSecretSearchResult{value: val, isSet: true} +} + +func (v NullableSecretSearchResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecretSearchResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_service.go b/.gen/anchore/model_service.go index 529f9429ea..1ca6899000 100644 --- a/.gen/anchore/model_service.go +++ b/.gen/anchore/model_service.go @@ -1,27 +1,337 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // Service A service status record type Service struct { // The unique id of the host on which the service is executing - Hostid string `json:"hostid,omitempty"` + Hostid *string `json:"hostid,omitempty"` // Registered service name - Servicename string `json:"servicename,omitempty"` + Servicename *string `json:"servicename,omitempty"` // The url to reach the service, including port as needed - BaseUrl string `json:"base_url,omitempty"` + BaseUrl *string `json:"base_url,omitempty"` // A state indicating the condition of the service. Normal operation is 'registered' - StatusMessage string `json:"status_message,omitempty"` - ServiceDetail StatusResponse `json:"service_detail,omitempty"` - Status bool `json:"status,omitempty"` + StatusMessage *string `json:"status_message,omitempty"` + ServiceDetail *StatusResponse `json:"service_detail,omitempty"` + Status *bool `json:"status,omitempty"` // The version of the service as reported by the service implementation on registration - Version string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewService instantiates a new Service 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 NewService() *Service { + this := Service{} + return &this +} + +// NewServiceWithDefaults instantiates a new Service 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 NewServiceWithDefaults() *Service { + this := Service{} + return &this +} + +// GetHostid returns the Hostid field value if set, zero value otherwise. +func (o *Service) GetHostid() string { + if o == nil || o.Hostid == nil { + var ret string + return ret + } + return *o.Hostid +} + +// GetHostidOk returns a tuple with the Hostid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetHostidOk() (*string, bool) { + if o == nil || o.Hostid == nil { + return nil, false + } + return o.Hostid, true +} + +// HasHostid returns a boolean if a field has been set. +func (o *Service) HasHostid() bool { + if o != nil && o.Hostid != nil { + return true + } + + return false +} + +// SetHostid gets a reference to the given string and assigns it to the Hostid field. +func (o *Service) SetHostid(v string) { + o.Hostid = &v +} + +// GetServicename returns the Servicename field value if set, zero value otherwise. +func (o *Service) GetServicename() string { + if o == nil || o.Servicename == nil { + var ret string + return ret + } + return *o.Servicename +} + +// GetServicenameOk returns a tuple with the Servicename field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetServicenameOk() (*string, bool) { + if o == nil || o.Servicename == nil { + return nil, false + } + return o.Servicename, true +} + +// HasServicename returns a boolean if a field has been set. +func (o *Service) HasServicename() bool { + if o != nil && o.Servicename != nil { + return true + } + + return false +} + +// SetServicename gets a reference to the given string and assigns it to the Servicename field. +func (o *Service) SetServicename(v string) { + o.Servicename = &v +} + +// GetBaseUrl returns the BaseUrl field value if set, zero value otherwise. +func (o *Service) GetBaseUrl() string { + if o == nil || o.BaseUrl == nil { + var ret string + return ret + } + return *o.BaseUrl +} + +// GetBaseUrlOk returns a tuple with the BaseUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetBaseUrlOk() (*string, bool) { + if o == nil || o.BaseUrl == nil { + return nil, false + } + return o.BaseUrl, true +} + +// HasBaseUrl returns a boolean if a field has been set. +func (o *Service) HasBaseUrl() bool { + if o != nil && o.BaseUrl != nil { + return true + } + + return false +} + +// SetBaseUrl gets a reference to the given string and assigns it to the BaseUrl field. +func (o *Service) SetBaseUrl(v string) { + o.BaseUrl = &v +} + +// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise. +func (o *Service) GetStatusMessage() string { + if o == nil || o.StatusMessage == nil { + var ret string + return ret + } + return *o.StatusMessage +} + +// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetStatusMessageOk() (*string, bool) { + if o == nil || o.StatusMessage == nil { + return nil, false + } + return o.StatusMessage, true +} + +// HasStatusMessage returns a boolean if a field has been set. +func (o *Service) HasStatusMessage() bool { + if o != nil && o.StatusMessage != nil { + return true + } + + return false +} + +// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. +func (o *Service) SetStatusMessage(v string) { + o.StatusMessage = &v +} + +// GetServiceDetail returns the ServiceDetail field value if set, zero value otherwise. +func (o *Service) GetServiceDetail() StatusResponse { + if o == nil || o.ServiceDetail == nil { + var ret StatusResponse + return ret + } + return *o.ServiceDetail } + +// GetServiceDetailOk returns a tuple with the ServiceDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetServiceDetailOk() (*StatusResponse, bool) { + if o == nil || o.ServiceDetail == nil { + return nil, false + } + return o.ServiceDetail, true +} + +// HasServiceDetail returns a boolean if a field has been set. +func (o *Service) HasServiceDetail() bool { + if o != nil && o.ServiceDetail != nil { + return true + } + + return false +} + +// SetServiceDetail gets a reference to the given StatusResponse and assigns it to the ServiceDetail field. +func (o *Service) SetServiceDetail(v StatusResponse) { + o.ServiceDetail = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Service) GetStatus() bool { + if o == nil || o.Status == nil { + var ret bool + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetStatusOk() (*bool, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Service) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given bool and assigns it to the Status field. +func (o *Service) SetStatus(v bool) { + o.Status = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Service) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Service) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Service) SetVersion(v string) { + o.Version = &v +} + +func (o Service) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Hostid != nil { + toSerialize["hostid"] = o.Hostid + } + if o.Servicename != nil { + toSerialize["servicename"] = o.Servicename + } + if o.BaseUrl != nil { + toSerialize["base_url"] = o.BaseUrl + } + if o.StatusMessage != nil { + toSerialize["status_message"] = o.StatusMessage + } + if o.ServiceDetail != nil { + toSerialize["service_detail"] = o.ServiceDetail + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableService struct { + value *Service + isSet bool +} + +func (v NullableService) Get() *Service { + return v.value +} + +func (v *NullableService) Set(val *Service) { + v.value = val + v.isSet = true +} + +func (v NullableService) IsSet() bool { + return v.isSet +} + +func (v *NullableService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableService(val *Service) *NullableService { + return &NullableService{value: val, isSet: true} +} + +func (v NullableService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_service_version.go b/.gen/anchore/model_service_version.go index 29db3d520c..828ce05b6c 100644 --- a/.gen/anchore/model_service_version.go +++ b/.gen/anchore/model_service_version.go @@ -1,18 +1,188 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ServiceVersion Version information for a service type ServiceVersion struct { - Service ServiceVersionService `json:"service,omitempty"` - Api ServiceVersionApi `json:"api,omitempty"` - Db ServiceVersionDb `json:"db,omitempty"` + Service *ServiceVersionService `json:"service,omitempty"` + Api *ServiceVersionApi `json:"api,omitempty"` + Db *ServiceVersionDb `json:"db,omitempty"` +} + +// NewServiceVersion instantiates a new ServiceVersion 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 NewServiceVersion() *ServiceVersion { + this := ServiceVersion{} + return &this +} + +// NewServiceVersionWithDefaults instantiates a new ServiceVersion 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 NewServiceVersionWithDefaults() *ServiceVersion { + this := ServiceVersion{} + return &this +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *ServiceVersion) GetService() ServiceVersionService { + if o == nil || o.Service == nil { + var ret ServiceVersionService + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersion) GetServiceOk() (*ServiceVersionService, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *ServiceVersion) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given ServiceVersionService and assigns it to the Service field. +func (o *ServiceVersion) SetService(v ServiceVersionService) { + o.Service = &v +} + +// GetApi returns the Api field value if set, zero value otherwise. +func (o *ServiceVersion) GetApi() ServiceVersionApi { + if o == nil || o.Api == nil { + var ret ServiceVersionApi + return ret + } + return *o.Api +} + +// GetApiOk returns a tuple with the Api field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersion) GetApiOk() (*ServiceVersionApi, bool) { + if o == nil || o.Api == nil { + return nil, false + } + return o.Api, true +} + +// HasApi returns a boolean if a field has been set. +func (o *ServiceVersion) HasApi() bool { + if o != nil && o.Api != nil { + return true + } + + return false +} + +// SetApi gets a reference to the given ServiceVersionApi and assigns it to the Api field. +func (o *ServiceVersion) SetApi(v ServiceVersionApi) { + o.Api = &v +} + +// GetDb returns the Db field value if set, zero value otherwise. +func (o *ServiceVersion) GetDb() ServiceVersionDb { + if o == nil || o.Db == nil { + var ret ServiceVersionDb + return ret + } + return *o.Db } + +// GetDbOk returns a tuple with the Db field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersion) GetDbOk() (*ServiceVersionDb, bool) { + if o == nil || o.Db == nil { + return nil, false + } + return o.Db, true +} + +// HasDb returns a boolean if a field has been set. +func (o *ServiceVersion) HasDb() bool { + if o != nil && o.Db != nil { + return true + } + + return false +} + +// SetDb gets a reference to the given ServiceVersionDb and assigns it to the Db field. +func (o *ServiceVersion) SetDb(v ServiceVersionDb) { + o.Db = &v +} + +func (o ServiceVersion) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.Api != nil { + toSerialize["api"] = o.Api + } + if o.Db != nil { + toSerialize["db"] = o.Db + } + return json.Marshal(toSerialize) +} + +type NullableServiceVersion struct { + value *ServiceVersion + isSet bool +} + +func (v NullableServiceVersion) Get() *ServiceVersion { + return v.value +} + +func (v *NullableServiceVersion) Set(val *ServiceVersion) { + v.value = val + v.isSet = true +} + +func (v NullableServiceVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceVersion(val *ServiceVersion) *NullableServiceVersion { + return &NullableServiceVersion{value: val, isSet: true} +} + +func (v NullableServiceVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_service_version_api.go b/.gen/anchore/model_service_version_api.go index 234212731b..9b1fdc6b12 100644 --- a/.gen/anchore/model_service_version_api.go +++ b/.gen/anchore/model_service_version_api.go @@ -1,17 +1,117 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ServiceVersionApi Api Version string type ServiceVersionApi struct { // Semantic version of the api - Version string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewServiceVersionApi instantiates a new ServiceVersionApi 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 NewServiceVersionApi() *ServiceVersionApi { + this := ServiceVersionApi{} + return &this +} + +// NewServiceVersionApiWithDefaults instantiates a new ServiceVersionApi 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 NewServiceVersionApiWithDefaults() *ServiceVersionApi { + this := ServiceVersionApi{} + return &this +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ServiceVersionApi) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersionApi) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ServiceVersionApi) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *ServiceVersionApi) SetVersion(v string) { + o.Version = &v +} + +func (o ServiceVersionApi) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Version != nil { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) } + +type NullableServiceVersionApi struct { + value *ServiceVersionApi + isSet bool +} + +func (v NullableServiceVersionApi) Get() *ServiceVersionApi { + return v.value +} + +func (v *NullableServiceVersionApi) Set(val *ServiceVersionApi) { + v.value = val + v.isSet = true +} + +func (v NullableServiceVersionApi) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceVersionApi) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceVersionApi(val *ServiceVersionApi) *NullableServiceVersionApi { + return &NullableServiceVersionApi{value: val, isSet: true} +} + +func (v NullableServiceVersionApi) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceVersionApi) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_service_version_db.go b/.gen/anchore/model_service_version_db.go index 56438d7d41..cba584b387 100644 --- a/.gen/anchore/model_service_version_db.go +++ b/.gen/anchore/model_service_version_db.go @@ -1,17 +1,117 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ServiceVersionDb struct for ServiceVersionDb type ServiceVersionDb struct { // Semantic version of the db schema - SchemaVersion string `json:"schema_version,omitempty"` + SchemaVersion *string `json:"schema_version,omitempty"` +} + +// NewServiceVersionDb instantiates a new ServiceVersionDb 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 NewServiceVersionDb() *ServiceVersionDb { + this := ServiceVersionDb{} + return &this +} + +// NewServiceVersionDbWithDefaults instantiates a new ServiceVersionDb 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 NewServiceVersionDbWithDefaults() *ServiceVersionDb { + this := ServiceVersionDb{} + return &this +} + +// GetSchemaVersion returns the SchemaVersion field value if set, zero value otherwise. +func (o *ServiceVersionDb) GetSchemaVersion() string { + if o == nil || o.SchemaVersion == nil { + var ret string + return ret + } + return *o.SchemaVersion +} + +// GetSchemaVersionOk returns a tuple with the SchemaVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersionDb) GetSchemaVersionOk() (*string, bool) { + if o == nil || o.SchemaVersion == nil { + return nil, false + } + return o.SchemaVersion, true +} + +// HasSchemaVersion returns a boolean if a field has been set. +func (o *ServiceVersionDb) HasSchemaVersion() bool { + if o != nil && o.SchemaVersion != nil { + return true + } + + return false +} + +// SetSchemaVersion gets a reference to the given string and assigns it to the SchemaVersion field. +func (o *ServiceVersionDb) SetSchemaVersion(v string) { + o.SchemaVersion = &v +} + +func (o ServiceVersionDb) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SchemaVersion != nil { + toSerialize["schema_version"] = o.SchemaVersion + } + return json.Marshal(toSerialize) } + +type NullableServiceVersionDb struct { + value *ServiceVersionDb + isSet bool +} + +func (v NullableServiceVersionDb) Get() *ServiceVersionDb { + return v.value +} + +func (v *NullableServiceVersionDb) Set(val *ServiceVersionDb) { + v.value = val + v.isSet = true +} + +func (v NullableServiceVersionDb) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceVersionDb) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceVersionDb(val *ServiceVersionDb) *NullableServiceVersionDb { + return &NullableServiceVersionDb{value: val, isSet: true} +} + +func (v NullableServiceVersionDb) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceVersionDb) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_service_version_service.go b/.gen/anchore/model_service_version_service.go index 1529d5ac8c..c5a8662c56 100644 --- a/.gen/anchore/model_service_version_service.go +++ b/.gen/anchore/model_service_version_service.go @@ -1,17 +1,117 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // ServiceVersionService struct for ServiceVersionService type ServiceVersionService struct { // Semantic Version string of the service implementation - Version string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewServiceVersionService instantiates a new ServiceVersionService 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 NewServiceVersionService() *ServiceVersionService { + this := ServiceVersionService{} + return &this +} + +// NewServiceVersionServiceWithDefaults instantiates a new ServiceVersionService 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 NewServiceVersionServiceWithDefaults() *ServiceVersionService { + this := ServiceVersionService{} + return &this +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ServiceVersionService) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersionService) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ServiceVersionService) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *ServiceVersionService) SetVersion(v string) { + o.Version = &v +} + +func (o ServiceVersionService) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Version != nil { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) } + +type NullableServiceVersionService struct { + value *ServiceVersionService + isSet bool +} + +func (v NullableServiceVersionService) Get() *ServiceVersionService { + return v.value +} + +func (v *NullableServiceVersionService) Set(val *ServiceVersionService) { + v.value = val + v.isSet = true +} + +func (v NullableServiceVersionService) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceVersionService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceVersionService(val *ServiceVersionService) *NullableServiceVersionService { + return &NullableServiceVersionService{value: val, isSet: true} +} + +func (v NullableServiceVersionService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceVersionService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_standalone_vulnerability.go b/.gen/anchore/model_standalone_vulnerability.go index 948dcf7adc..fb87865acc 100644 --- a/.gen/anchore/model_standalone_vulnerability.go +++ b/.gen/anchore/model_standalone_vulnerability.go @@ -1,29 +1,413 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore -// StandaloneVulnerability A single vulnerability record in a single namespace, the unique key is the combinatino of the id and namespace + +import ( + "encoding/json" +) + +// StandaloneVulnerability A single vulnerability record in a single namespace, the unique key is the combination of the id and namespace type StandaloneVulnerability struct { // Vulnerability identifier. May be CVE-X, RHSA-X, etc. Not necessarily unique across namespaces - Id string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` // The namespace for the vulnerability record to avoid conflicts for the same id in different distros or sources (e.g. deb vs ubuntu for same CVE) - Namespace string `json:"namespace,omitempty"` + Namespace *string `json:"namespace,omitempty"` // The array of packages (typically packages) that are vulnerable-to or provide fixes-for this vulnerability AffectedPackages []PackageReference `json:"affected_packages,omitempty"` // Severity label specific to the namepsace - Severity string `json:"severity,omitempty"` + Severity *string `json:"severity,omitempty"` // URL for the upstream CVE record in the reporting source (e.g. ubuntu security tracker) - Link string `json:"link,omitempty"` + Link *string `json:"link,omitempty"` // List of Nvd Data objects NvdData []NvdDataObject `json:"nvd_data,omitempty"` // List of Vendor Data objects VendorData []VendorDataObject `json:"vendor_data,omitempty"` + // Description of the vulnerability if available + Description *string `json:"description,omitempty"` + // List of references including + References []VulnerabilityReference `json:"references,omitempty"` +} + +// NewStandaloneVulnerability instantiates a new StandaloneVulnerability 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 NewStandaloneVulnerability() *StandaloneVulnerability { + this := StandaloneVulnerability{} + return &this +} + +// NewStandaloneVulnerabilityWithDefaults instantiates a new StandaloneVulnerability 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 NewStandaloneVulnerabilityWithDefaults() *StandaloneVulnerability { + this := StandaloneVulnerability{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *StandaloneVulnerability) SetId(v string) { + o.Id = &v +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetNamespace() string { + if o == nil || o.Namespace == nil { + var ret string + return ret + } + return *o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetNamespaceOk() (*string, bool) { + if o == nil || o.Namespace == nil { + return nil, false + } + return o.Namespace, true +} + +// HasNamespace returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasNamespace() bool { + if o != nil && o.Namespace != nil { + return true + } + + return false +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *StandaloneVulnerability) SetNamespace(v string) { + o.Namespace = &v +} + +// GetAffectedPackages returns the AffectedPackages field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetAffectedPackages() []PackageReference { + if o == nil || o.AffectedPackages == nil { + var ret []PackageReference + return ret + } + return o.AffectedPackages +} + +// GetAffectedPackagesOk returns a tuple with the AffectedPackages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetAffectedPackagesOk() ([]PackageReference, bool) { + if o == nil || o.AffectedPackages == nil { + return nil, false + } + return o.AffectedPackages, true +} + +// HasAffectedPackages returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasAffectedPackages() bool { + if o != nil && o.AffectedPackages != nil { + return true + } + + return false +} + +// SetAffectedPackages gets a reference to the given []PackageReference and assigns it to the AffectedPackages field. +func (o *StandaloneVulnerability) SetAffectedPackages(v []PackageReference) { + o.AffectedPackages = v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetSeverity() string { + if o == nil || o.Severity == nil { + var ret string + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetSeverityOk() (*string, bool) { + if o == nil || o.Severity == nil { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasSeverity() bool { + if o != nil && o.Severity != nil { + return true + } + + return false +} + +// SetSeverity gets a reference to the given string and assigns it to the Severity field. +func (o *StandaloneVulnerability) SetSeverity(v string) { + o.Severity = &v +} + +// GetLink returns the Link field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetLink() string { + if o == nil || o.Link == nil { + var ret string + return ret + } + return *o.Link +} + +// GetLinkOk returns a tuple with the Link field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetLinkOk() (*string, bool) { + if o == nil || o.Link == nil { + return nil, false + } + return o.Link, true +} + +// HasLink returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasLink() bool { + if o != nil && o.Link != nil { + return true + } + + return false +} + +// SetLink gets a reference to the given string and assigns it to the Link field. +func (o *StandaloneVulnerability) SetLink(v string) { + o.Link = &v +} + +// GetNvdData returns the NvdData field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetNvdData() []NvdDataObject { + if o == nil || o.NvdData == nil { + var ret []NvdDataObject + return ret + } + return o.NvdData } + +// GetNvdDataOk returns a tuple with the NvdData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetNvdDataOk() ([]NvdDataObject, bool) { + if o == nil || o.NvdData == nil { + return nil, false + } + return o.NvdData, true +} + +// HasNvdData returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasNvdData() bool { + if o != nil && o.NvdData != nil { + return true + } + + return false +} + +// SetNvdData gets a reference to the given []NvdDataObject and assigns it to the NvdData field. +func (o *StandaloneVulnerability) SetNvdData(v []NvdDataObject) { + o.NvdData = v +} + +// GetVendorData returns the VendorData field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetVendorData() []VendorDataObject { + if o == nil || o.VendorData == nil { + var ret []VendorDataObject + return ret + } + return o.VendorData +} + +// GetVendorDataOk returns a tuple with the VendorData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetVendorDataOk() ([]VendorDataObject, bool) { + if o == nil || o.VendorData == nil { + return nil, false + } + return o.VendorData, true +} + +// HasVendorData returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasVendorData() bool { + if o != nil && o.VendorData != nil { + return true + } + + return false +} + +// SetVendorData gets a reference to the given []VendorDataObject and assigns it to the VendorData field. +func (o *StandaloneVulnerability) SetVendorData(v []VendorDataObject) { + o.VendorData = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *StandaloneVulnerability) SetDescription(v string) { + o.Description = &v +} + +// GetReferences returns the References field value if set, zero value otherwise. +func (o *StandaloneVulnerability) GetReferences() []VulnerabilityReference { + if o == nil || o.References == nil { + var ret []VulnerabilityReference + return ret + } + return o.References +} + +// GetReferencesOk returns a tuple with the References field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandaloneVulnerability) GetReferencesOk() ([]VulnerabilityReference, bool) { + if o == nil || o.References == nil { + return nil, false + } + return o.References, true +} + +// HasReferences returns a boolean if a field has been set. +func (o *StandaloneVulnerability) HasReferences() bool { + if o != nil && o.References != nil { + return true + } + + return false +} + +// SetReferences gets a reference to the given []VulnerabilityReference and assigns it to the References field. +func (o *StandaloneVulnerability) SetReferences(v []VulnerabilityReference) { + o.References = v +} + +func (o StandaloneVulnerability) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Namespace != nil { + toSerialize["namespace"] = o.Namespace + } + if o.AffectedPackages != nil { + toSerialize["affected_packages"] = o.AffectedPackages + } + if o.Severity != nil { + toSerialize["severity"] = o.Severity + } + if o.Link != nil { + toSerialize["link"] = o.Link + } + if o.NvdData != nil { + toSerialize["nvd_data"] = o.NvdData + } + if o.VendorData != nil { + toSerialize["vendor_data"] = o.VendorData + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.References != nil { + toSerialize["references"] = o.References + } + return json.Marshal(toSerialize) +} + +type NullableStandaloneVulnerability struct { + value *StandaloneVulnerability + isSet bool +} + +func (v NullableStandaloneVulnerability) Get() *StandaloneVulnerability { + return v.value +} + +func (v *NullableStandaloneVulnerability) Set(val *StandaloneVulnerability) { + v.value = val + v.isSet = true +} + +func (v NullableStandaloneVulnerability) IsSet() bool { + return v.isSet +} + +func (v *NullableStandaloneVulnerability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStandaloneVulnerability(val *StandaloneVulnerability) *NullableStandaloneVulnerability { + return &NullableStandaloneVulnerability{value: val, isSet: true} +} + +func (v NullableStandaloneVulnerability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStandaloneVulnerability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_status_response.go b/.gen/anchore/model_status_response.go index fd5c6a4aeb..ccfb774ea8 100644 --- a/.gen/anchore/model_status_response.go +++ b/.gen/anchore/model_status_response.go @@ -1,22 +1,332 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // StatusResponse System status response type StatusResponse struct { - Available bool `json:"available,omitempty"` - Busy bool `json:"busy,omitempty"` - Up bool `json:"up,omitempty"` - Message string `json:"message,omitempty"` - Version string `json:"version,omitempty"` - DbVersion string `json:"db_version,omitempty"` + Available *bool `json:"available,omitempty"` + Busy *bool `json:"busy,omitempty"` + Up *bool `json:"up,omitempty"` + Message *string `json:"message,omitempty"` + Version *string `json:"version,omitempty"` + DbVersion *string `json:"db_version,omitempty"` Detail map[string]interface{} `json:"detail,omitempty"` } + +// NewStatusResponse instantiates a new StatusResponse 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 NewStatusResponse() *StatusResponse { + this := StatusResponse{} + return &this +} + +// NewStatusResponseWithDefaults instantiates a new StatusResponse 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 NewStatusResponseWithDefaults() *StatusResponse { + this := StatusResponse{} + return &this +} + +// GetAvailable returns the Available field value if set, zero value otherwise. +func (o *StatusResponse) GetAvailable() bool { + if o == nil || o.Available == nil { + var ret bool + return ret + } + return *o.Available +} + +// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetAvailableOk() (*bool, bool) { + if o == nil || o.Available == nil { + return nil, false + } + return o.Available, true +} + +// HasAvailable returns a boolean if a field has been set. +func (o *StatusResponse) HasAvailable() bool { + if o != nil && o.Available != nil { + return true + } + + return false +} + +// SetAvailable gets a reference to the given bool and assigns it to the Available field. +func (o *StatusResponse) SetAvailable(v bool) { + o.Available = &v +} + +// GetBusy returns the Busy field value if set, zero value otherwise. +func (o *StatusResponse) GetBusy() bool { + if o == nil || o.Busy == nil { + var ret bool + return ret + } + return *o.Busy +} + +// GetBusyOk returns a tuple with the Busy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetBusyOk() (*bool, bool) { + if o == nil || o.Busy == nil { + return nil, false + } + return o.Busy, true +} + +// HasBusy returns a boolean if a field has been set. +func (o *StatusResponse) HasBusy() bool { + if o != nil && o.Busy != nil { + return true + } + + return false +} + +// SetBusy gets a reference to the given bool and assigns it to the Busy field. +func (o *StatusResponse) SetBusy(v bool) { + o.Busy = &v +} + +// GetUp returns the Up field value if set, zero value otherwise. +func (o *StatusResponse) GetUp() bool { + if o == nil || o.Up == nil { + var ret bool + return ret + } + return *o.Up +} + +// GetUpOk returns a tuple with the Up field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetUpOk() (*bool, bool) { + if o == nil || o.Up == nil { + return nil, false + } + return o.Up, true +} + +// HasUp returns a boolean if a field has been set. +func (o *StatusResponse) HasUp() bool { + if o != nil && o.Up != nil { + return true + } + + return false +} + +// SetUp gets a reference to the given bool and assigns it to the Up field. +func (o *StatusResponse) SetUp(v bool) { + o.Up = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *StatusResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *StatusResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *StatusResponse) SetMessage(v string) { + o.Message = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *StatusResponse) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *StatusResponse) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *StatusResponse) SetVersion(v string) { + o.Version = &v +} + +// GetDbVersion returns the DbVersion field value if set, zero value otherwise. +func (o *StatusResponse) GetDbVersion() string { + if o == nil || o.DbVersion == nil { + var ret string + return ret + } + return *o.DbVersion +} + +// GetDbVersionOk returns a tuple with the DbVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetDbVersionOk() (*string, bool) { + if o == nil || o.DbVersion == nil { + return nil, false + } + return o.DbVersion, true +} + +// HasDbVersion returns a boolean if a field has been set. +func (o *StatusResponse) HasDbVersion() bool { + if o != nil && o.DbVersion != nil { + return true + } + + return false +} + +// SetDbVersion gets a reference to the given string and assigns it to the DbVersion field. +func (o *StatusResponse) SetDbVersion(v string) { + o.DbVersion = &v +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *StatusResponse) GetDetail() map[string]interface{} { + if o == nil || o.Detail == nil { + var ret map[string]interface{} + return ret + } + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponse) GetDetailOk() (map[string]interface{}, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *StatusResponse) HasDetail() bool { + if o != nil && o.Detail != nil { + return true + } + + return false +} + +// SetDetail gets a reference to the given map[string]interface{} and assigns it to the Detail field. +func (o *StatusResponse) SetDetail(v map[string]interface{}) { + o.Detail = v +} + +func (o StatusResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Available != nil { + toSerialize["available"] = o.Available + } + if o.Busy != nil { + toSerialize["busy"] = o.Busy + } + if o.Up != nil { + toSerialize["up"] = o.Up + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + if o.DbVersion != nil { + toSerialize["db_version"] = o.DbVersion + } + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + return json.Marshal(toSerialize) +} + +type NullableStatusResponse struct { + value *StatusResponse + isSet bool +} + +func (v NullableStatusResponse) Get() *StatusResponse { + return v.value +} + +func (v *NullableStatusResponse) Set(val *StatusResponse) { + v.value = val + v.isSet = true +} + +func (v NullableStatusResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusResponse(val *StatusResponse) *NullableStatusResponse { + return &NullableStatusResponse{value: val, isSet: true} +} + +func (v NullableStatusResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_subscription.go b/.gen/anchore/model_subscription.go index d1865cc0e4..367b2ab30a 100644 --- a/.gen/anchore/model_subscription.go +++ b/.gen/anchore/model_subscription.go @@ -1,27 +1,312 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // Subscription Subscription entry type Subscription struct { // The key value that the subscription references. E.g. a tag value or a repo name. - SubscriptionKey string `json:"subscription_key,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` // The type of the subscription - SubscriptionType string `json:"subscription_type,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` // The value of the subscription target - SubscriptionValue *string `json:"subscription_value,omitempty"` + SubscriptionValue NullableString `json:"subscription_value,omitempty"` // The userId of the subscribed user - UserId string `json:"userId,omitempty"` + UserId *string `json:"userId,omitempty"` // Is the subscription currently active - Active bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` // the unique id for this subscription record - SubscriptionId string `json:"subscription_id,omitempty"` + SubscriptionId *string `json:"subscription_id,omitempty"` +} + +// NewSubscription instantiates a new Subscription 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 NewSubscription() *Subscription { + this := Subscription{} + return &this +} + +// NewSubscriptionWithDefaults instantiates a new Subscription 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 NewSubscriptionWithDefaults() *Subscription { + this := Subscription{} + return &this +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *Subscription) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Subscription) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *Subscription) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *Subscription) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v } + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *Subscription) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Subscription) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *Subscription) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *Subscription) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +// GetSubscriptionValue returns the SubscriptionValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Subscription) GetSubscriptionValue() string { + if o == nil || o.SubscriptionValue.Get() == nil { + var ret string + return ret + } + return *o.SubscriptionValue.Get() +} + +// GetSubscriptionValueOk returns a tuple with the SubscriptionValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Subscription) GetSubscriptionValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SubscriptionValue.Get(), o.SubscriptionValue.IsSet() +} + +// HasSubscriptionValue returns a boolean if a field has been set. +func (o *Subscription) HasSubscriptionValue() bool { + if o != nil && o.SubscriptionValue.IsSet() { + return true + } + + return false +} + +// SetSubscriptionValue gets a reference to the given NullableString and assigns it to the SubscriptionValue field. +func (o *Subscription) SetSubscriptionValue(v string) { + o.SubscriptionValue.Set(&v) +} +// SetSubscriptionValueNil sets the value for SubscriptionValue to be an explicit nil +func (o *Subscription) SetSubscriptionValueNil() { + o.SubscriptionValue.Set(nil) +} + +// UnsetSubscriptionValue ensures that no value is present for SubscriptionValue, not even an explicit nil +func (o *Subscription) UnsetSubscriptionValue() { + o.SubscriptionValue.Unset() +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *Subscription) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Subscription) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *Subscription) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *Subscription) SetUserId(v string) { + o.UserId = &v +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *Subscription) GetActive() bool { + if o == nil || o.Active == nil { + var ret bool + return ret + } + return *o.Active +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Subscription) GetActiveOk() (*bool, bool) { + if o == nil || o.Active == nil { + return nil, false + } + return o.Active, true +} + +// HasActive returns a boolean if a field has been set. +func (o *Subscription) HasActive() bool { + if o != nil && o.Active != nil { + return true + } + + return false +} + +// SetActive gets a reference to the given bool and assigns it to the Active field. +func (o *Subscription) SetActive(v bool) { + o.Active = &v +} + +// GetSubscriptionId returns the SubscriptionId field value if set, zero value otherwise. +func (o *Subscription) GetSubscriptionId() string { + if o == nil || o.SubscriptionId == nil { + var ret string + return ret + } + return *o.SubscriptionId +} + +// GetSubscriptionIdOk returns a tuple with the SubscriptionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Subscription) GetSubscriptionIdOk() (*string, bool) { + if o == nil || o.SubscriptionId == nil { + return nil, false + } + return o.SubscriptionId, true +} + +// HasSubscriptionId returns a boolean if a field has been set. +func (o *Subscription) HasSubscriptionId() bool { + if o != nil && o.SubscriptionId != nil { + return true + } + + return false +} + +// SetSubscriptionId gets a reference to the given string and assigns it to the SubscriptionId field. +func (o *Subscription) SetSubscriptionId(v string) { + o.SubscriptionId = &v +} + +func (o Subscription) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + if o.SubscriptionValue.IsSet() { + toSerialize["subscription_value"] = o.SubscriptionValue.Get() + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.Active != nil { + toSerialize["active"] = o.Active + } + if o.SubscriptionId != nil { + toSerialize["subscription_id"] = o.SubscriptionId + } + return json.Marshal(toSerialize) +} + +type NullableSubscription struct { + value *Subscription + isSet bool +} + +func (v NullableSubscription) Get() *Subscription { + return v.value +} + +func (v *NullableSubscription) Set(val *Subscription) { + v.value = val + v.isSet = true +} + +func (v NullableSubscription) IsSet() bool { + return v.isSet +} + +func (v *NullableSubscription) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubscription(val *Subscription) *NullableSubscription { + return &NullableSubscription{value: val, isSet: true} +} + +func (v NullableSubscription) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubscription) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_subscription_request.go b/.gen/anchore/model_subscription_request.go index 22dbde8fbf..ee7689c5ae 100644 --- a/.gen/anchore/model_subscription_request.go +++ b/.gen/anchore/model_subscription_request.go @@ -1,18 +1,198 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // SubscriptionRequest A subscription entry to add to the system type SubscriptionRequest struct { - SubscriptionKey string `json:"subscription_key,omitempty"` - SubscriptionValue *string `json:"subscription_value,omitempty"` - SubscriptionType string `json:"subscription_type,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` + SubscriptionValue NullableString `json:"subscription_value,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` +} + +// NewSubscriptionRequest instantiates a new SubscriptionRequest 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 NewSubscriptionRequest() *SubscriptionRequest { + this := SubscriptionRequest{} + return &this +} + +// NewSubscriptionRequestWithDefaults instantiates a new SubscriptionRequest 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 NewSubscriptionRequestWithDefaults() *SubscriptionRequest { + this := SubscriptionRequest{} + return &this +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *SubscriptionRequest) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionRequest) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *SubscriptionRequest) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *SubscriptionRequest) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v +} + +// GetSubscriptionValue returns the SubscriptionValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SubscriptionRequest) GetSubscriptionValue() string { + if o == nil || o.SubscriptionValue.Get() == nil { + var ret string + return ret + } + return *o.SubscriptionValue.Get() +} + +// GetSubscriptionValueOk returns a tuple with the SubscriptionValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SubscriptionRequest) GetSubscriptionValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SubscriptionValue.Get(), o.SubscriptionValue.IsSet() +} + +// HasSubscriptionValue returns a boolean if a field has been set. +func (o *SubscriptionRequest) HasSubscriptionValue() bool { + if o != nil && o.SubscriptionValue.IsSet() { + return true + } + + return false +} + +// SetSubscriptionValue gets a reference to the given NullableString and assigns it to the SubscriptionValue field. +func (o *SubscriptionRequest) SetSubscriptionValue(v string) { + o.SubscriptionValue.Set(&v) +} +// SetSubscriptionValueNil sets the value for SubscriptionValue to be an explicit nil +func (o *SubscriptionRequest) SetSubscriptionValueNil() { + o.SubscriptionValue.Set(nil) +} + +// UnsetSubscriptionValue ensures that no value is present for SubscriptionValue, not even an explicit nil +func (o *SubscriptionRequest) UnsetSubscriptionValue() { + o.SubscriptionValue.Unset() } + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *SubscriptionRequest) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionRequest) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *SubscriptionRequest) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *SubscriptionRequest) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +func (o SubscriptionRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionValue.IsSet() { + toSerialize["subscription_value"] = o.SubscriptionValue.Get() + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + return json.Marshal(toSerialize) +} + +type NullableSubscriptionRequest struct { + value *SubscriptionRequest + isSet bool +} + +func (v NullableSubscriptionRequest) Get() *SubscriptionRequest { + return v.value +} + +func (v *NullableSubscriptionRequest) Set(val *SubscriptionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSubscriptionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSubscriptionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubscriptionRequest(val *SubscriptionRequest) *NullableSubscriptionRequest { + return &NullableSubscriptionRequest{value: val, isSet: true} +} + +func (v NullableSubscriptionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubscriptionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_subscription_update.go b/.gen/anchore/model_subscription_update.go index 3f7f7cd270..9cd1e8ea34 100644 --- a/.gen/anchore/model_subscription_update.go +++ b/.gen/anchore/model_subscription_update.go @@ -1,19 +1,164 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // SubscriptionUpdate A modification to a subscription entry to change its status or value type SubscriptionUpdate struct { // The new subscription value, e.g. the new tag to be subscribed to - SubscriptionValue *string `json:"subscription_value,omitempty"` + SubscriptionValue NullableString `json:"subscription_value,omitempty"` // Toggle the subscription processing on or off - Active bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` } + +// NewSubscriptionUpdate instantiates a new SubscriptionUpdate 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 NewSubscriptionUpdate() *SubscriptionUpdate { + this := SubscriptionUpdate{} + return &this +} + +// NewSubscriptionUpdateWithDefaults instantiates a new SubscriptionUpdate 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 NewSubscriptionUpdateWithDefaults() *SubscriptionUpdate { + this := SubscriptionUpdate{} + return &this +} + +// GetSubscriptionValue returns the SubscriptionValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SubscriptionUpdate) GetSubscriptionValue() string { + if o == nil || o.SubscriptionValue.Get() == nil { + var ret string + return ret + } + return *o.SubscriptionValue.Get() +} + +// GetSubscriptionValueOk returns a tuple with the SubscriptionValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SubscriptionUpdate) GetSubscriptionValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SubscriptionValue.Get(), o.SubscriptionValue.IsSet() +} + +// HasSubscriptionValue returns a boolean if a field has been set. +func (o *SubscriptionUpdate) HasSubscriptionValue() bool { + if o != nil && o.SubscriptionValue.IsSet() { + return true + } + + return false +} + +// SetSubscriptionValue gets a reference to the given NullableString and assigns it to the SubscriptionValue field. +func (o *SubscriptionUpdate) SetSubscriptionValue(v string) { + o.SubscriptionValue.Set(&v) +} +// SetSubscriptionValueNil sets the value for SubscriptionValue to be an explicit nil +func (o *SubscriptionUpdate) SetSubscriptionValueNil() { + o.SubscriptionValue.Set(nil) +} + +// UnsetSubscriptionValue ensures that no value is present for SubscriptionValue, not even an explicit nil +func (o *SubscriptionUpdate) UnsetSubscriptionValue() { + o.SubscriptionValue.Unset() +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *SubscriptionUpdate) GetActive() bool { + if o == nil || o.Active == nil { + var ret bool + return ret + } + return *o.Active +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionUpdate) GetActiveOk() (*bool, bool) { + if o == nil || o.Active == nil { + return nil, false + } + return o.Active, true +} + +// HasActive returns a boolean if a field has been set. +func (o *SubscriptionUpdate) HasActive() bool { + if o != nil && o.Active != nil { + return true + } + + return false +} + +// SetActive gets a reference to the given bool and assigns it to the Active field. +func (o *SubscriptionUpdate) SetActive(v bool) { + o.Active = &v +} + +func (o SubscriptionUpdate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SubscriptionValue.IsSet() { + toSerialize["subscription_value"] = o.SubscriptionValue.Get() + } + if o.Active != nil { + toSerialize["active"] = o.Active + } + return json.Marshal(toSerialize) +} + +type NullableSubscriptionUpdate struct { + value *SubscriptionUpdate + isSet bool +} + +func (v NullableSubscriptionUpdate) Get() *SubscriptionUpdate { + return v.value +} + +func (v *NullableSubscriptionUpdate) Set(val *SubscriptionUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableSubscriptionUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableSubscriptionUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubscriptionUpdate(val *SubscriptionUpdate) *NullableSubscriptionUpdate { + return &NullableSubscriptionUpdate{value: val, isSet: true} +} + +func (v NullableSubscriptionUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubscriptionUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_system_status_response.go b/.gen/anchore/model_system_status_response.go index 329fe0900c..926e168713 100644 --- a/.gen/anchore/model_system_status_response.go +++ b/.gen/anchore/model_system_status_response.go @@ -1,17 +1,117 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // SystemStatusResponse System status response type SystemStatusResponse struct { // A list of service objects ServiceStates []Service `json:"service_states,omitempty"` } + +// NewSystemStatusResponse instantiates a new SystemStatusResponse 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 NewSystemStatusResponse() *SystemStatusResponse { + this := SystemStatusResponse{} + return &this +} + +// NewSystemStatusResponseWithDefaults instantiates a new SystemStatusResponse 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 NewSystemStatusResponseWithDefaults() *SystemStatusResponse { + this := SystemStatusResponse{} + return &this +} + +// GetServiceStates returns the ServiceStates field value if set, zero value otherwise. +func (o *SystemStatusResponse) GetServiceStates() []Service { + if o == nil || o.ServiceStates == nil { + var ret []Service + return ret + } + return o.ServiceStates +} + +// GetServiceStatesOk returns a tuple with the ServiceStates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SystemStatusResponse) GetServiceStatesOk() ([]Service, bool) { + if o == nil || o.ServiceStates == nil { + return nil, false + } + return o.ServiceStates, true +} + +// HasServiceStates returns a boolean if a field has been set. +func (o *SystemStatusResponse) HasServiceStates() bool { + if o != nil && o.ServiceStates != nil { + return true + } + + return false +} + +// SetServiceStates gets a reference to the given []Service and assigns it to the ServiceStates field. +func (o *SystemStatusResponse) SetServiceStates(v []Service) { + o.ServiceStates = v +} + +func (o SystemStatusResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ServiceStates != nil { + toSerialize["service_states"] = o.ServiceStates + } + return json.Marshal(toSerialize) +} + +type NullableSystemStatusResponse struct { + value *SystemStatusResponse + isSet bool +} + +func (v NullableSystemStatusResponse) Get() *SystemStatusResponse { + return v.value +} + +func (v *NullableSystemStatusResponse) Set(val *SystemStatusResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSystemStatusResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSystemStatusResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSystemStatusResponse(val *SystemStatusResponse) *NullableSystemStatusResponse { + return &NullableSystemStatusResponse{value: val, isSet: true} +} + +func (v NullableSystemStatusResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSystemStatusResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_entry.go b/.gen/anchore/model_tag_entry.go index 45a4f41589..8e0c9cf64c 100644 --- a/.gen/anchore/model_tag_entry.go +++ b/.gen/anchore/model_tag_entry.go @@ -1,28 +1,266 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // TagEntry A docker-pullable tag value as well as deconstructed components type TagEntry struct { // The pullable string for the tag. E.g. \"docker.io/library/node:latest\" - Pullstring string `json:"pullstring,omitempty"` + Pullstring *string `json:"pullstring,omitempty"` // The registry hostname:port section of the pull string - Registry string `json:"registry,omitempty"` + Registry *string `json:"registry,omitempty"` // The repository section of the pull string - Repository string `json:"repository,omitempty"` + Repository *string `json:"repository,omitempty"` // The tag-only section of the pull string - Tag string `json:"tag,omitempty"` + Tag *string `json:"tag,omitempty"` // The timestamp at which the Anchore Engine detected this tag was mapped to the image digest. Does not necessarily indicate when the tag was actually pushed to the registry. - DetectedAt time.Time `json:"detected_at,omitempty"` + DetectedAt *time.Time `json:"detected_at,omitempty"` +} + +// NewTagEntry instantiates a new TagEntry 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 NewTagEntry() *TagEntry { + this := TagEntry{} + return &this +} + +// NewTagEntryWithDefaults instantiates a new TagEntry 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 NewTagEntryWithDefaults() *TagEntry { + this := TagEntry{} + return &this +} + +// GetPullstring returns the Pullstring field value if set, zero value otherwise. +func (o *TagEntry) GetPullstring() string { + if o == nil || o.Pullstring == nil { + var ret string + return ret + } + return *o.Pullstring +} + +// GetPullstringOk returns a tuple with the Pullstring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagEntry) GetPullstringOk() (*string, bool) { + if o == nil || o.Pullstring == nil { + return nil, false + } + return o.Pullstring, true +} + +// HasPullstring returns a boolean if a field has been set. +func (o *TagEntry) HasPullstring() bool { + if o != nil && o.Pullstring != nil { + return true + } + + return false +} + +// SetPullstring gets a reference to the given string and assigns it to the Pullstring field. +func (o *TagEntry) SetPullstring(v string) { + o.Pullstring = &v +} + +// GetRegistry returns the Registry field value if set, zero value otherwise. +func (o *TagEntry) GetRegistry() string { + if o == nil || o.Registry == nil { + var ret string + return ret + } + return *o.Registry +} + +// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagEntry) GetRegistryOk() (*string, bool) { + if o == nil || o.Registry == nil { + return nil, false + } + return o.Registry, true +} + +// HasRegistry returns a boolean if a field has been set. +func (o *TagEntry) HasRegistry() bool { + if o != nil && o.Registry != nil { + return true + } + + return false +} + +// SetRegistry gets a reference to the given string and assigns it to the Registry field. +func (o *TagEntry) SetRegistry(v string) { + o.Registry = &v +} + +// GetRepository returns the Repository field value if set, zero value otherwise. +func (o *TagEntry) GetRepository() string { + if o == nil || o.Repository == nil { + var ret string + return ret + } + return *o.Repository +} + +// GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagEntry) GetRepositoryOk() (*string, bool) { + if o == nil || o.Repository == nil { + return nil, false + } + return o.Repository, true +} + +// HasRepository returns a boolean if a field has been set. +func (o *TagEntry) HasRepository() bool { + if o != nil && o.Repository != nil { + return true + } + + return false +} + +// SetRepository gets a reference to the given string and assigns it to the Repository field. +func (o *TagEntry) SetRepository(v string) { + o.Repository = &v +} + +// GetTag returns the Tag field value if set, zero value otherwise. +func (o *TagEntry) GetTag() string { + if o == nil || o.Tag == nil { + var ret string + return ret + } + return *o.Tag } + +// GetTagOk returns a tuple with the Tag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagEntry) GetTagOk() (*string, bool) { + if o == nil || o.Tag == nil { + return nil, false + } + return o.Tag, true +} + +// HasTag returns a boolean if a field has been set. +func (o *TagEntry) HasTag() bool { + if o != nil && o.Tag != nil { + return true + } + + return false +} + +// SetTag gets a reference to the given string and assigns it to the Tag field. +func (o *TagEntry) SetTag(v string) { + o.Tag = &v +} + +// GetDetectedAt returns the DetectedAt field value if set, zero value otherwise. +func (o *TagEntry) GetDetectedAt() time.Time { + if o == nil || o.DetectedAt == nil { + var ret time.Time + return ret + } + return *o.DetectedAt +} + +// GetDetectedAtOk returns a tuple with the DetectedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagEntry) GetDetectedAtOk() (*time.Time, bool) { + if o == nil || o.DetectedAt == nil { + return nil, false + } + return o.DetectedAt, true +} + +// HasDetectedAt returns a boolean if a field has been set. +func (o *TagEntry) HasDetectedAt() bool { + if o != nil && o.DetectedAt != nil { + return true + } + + return false +} + +// SetDetectedAt gets a reference to the given time.Time and assigns it to the DetectedAt field. +func (o *TagEntry) SetDetectedAt(v time.Time) { + o.DetectedAt = &v +} + +func (o TagEntry) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Pullstring != nil { + toSerialize["pullstring"] = o.Pullstring + } + if o.Registry != nil { + toSerialize["registry"] = o.Registry + } + if o.Repository != nil { + toSerialize["repository"] = o.Repository + } + if o.Tag != nil { + toSerialize["tag"] = o.Tag + } + if o.DetectedAt != nil { + toSerialize["detected_at"] = o.DetectedAt + } + return json.Marshal(toSerialize) +} + +type NullableTagEntry struct { + value *TagEntry + isSet bool +} + +func (v NullableTagEntry) Get() *TagEntry { + return v.value +} + +func (v *NullableTagEntry) Set(val *TagEntry) { + v.value = val + v.isSet = true +} + +func (v NullableTagEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableTagEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagEntry(val *TagEntry) *NullableTagEntry { + return &NullableTagEntry{value: val, isSet: true} +} + +func (v NullableTagEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_update_notification.go b/.gen/anchore/model_tag_update_notification.go new file mode 100644 index 0000000000..2d1441ec5c --- /dev/null +++ b/.gen/anchore/model_tag_update_notification.go @@ -0,0 +1,454 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// TagUpdateNotification struct for TagUpdateNotification +type TagUpdateNotification struct { + QueueId *string `json:"queueId,omitempty"` + UserId *string `json:"userId,omitempty"` + DataId *string `json:"dataId,omitempty"` + CreatedAt *int32 `json:"created_at,omitempty"` + LastUpdated *int32 `json:"last_updated,omitempty"` + RecordStateKey *string `json:"record_state_key,omitempty"` + RecordStateVal NullableString `json:"record_state_val,omitempty"` + Tries *int32 `json:"tries,omitempty"` + MaxTries *int32 `json:"max_tries,omitempty"` + Data *TagUpdateNotificationData `json:"data,omitempty"` +} + +// NewTagUpdateNotification instantiates a new TagUpdateNotification 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 NewTagUpdateNotification() *TagUpdateNotification { + this := TagUpdateNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// NewTagUpdateNotificationWithDefaults instantiates a new TagUpdateNotification 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 NewTagUpdateNotificationWithDefaults() *TagUpdateNotification { + this := TagUpdateNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// GetQueueId returns the QueueId field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetQueueId() string { + if o == nil || o.QueueId == nil { + var ret string + return ret + } + return *o.QueueId +} + +// GetQueueIdOk returns a tuple with the QueueId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetQueueIdOk() (*string, bool) { + if o == nil || o.QueueId == nil { + return nil, false + } + return o.QueueId, true +} + +// HasQueueId returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasQueueId() bool { + if o != nil && o.QueueId != nil { + return true + } + + return false +} + +// SetQueueId gets a reference to the given string and assigns it to the QueueId field. +func (o *TagUpdateNotification) SetQueueId(v string) { + o.QueueId = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *TagUpdateNotification) SetUserId(v string) { + o.UserId = &v +} + +// GetDataId returns the DataId field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetDataId() string { + if o == nil || o.DataId == nil { + var ret string + return ret + } + return *o.DataId +} + +// GetDataIdOk returns a tuple with the DataId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetDataIdOk() (*string, bool) { + if o == nil || o.DataId == nil { + return nil, false + } + return o.DataId, true +} + +// HasDataId returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasDataId() bool { + if o != nil && o.DataId != nil { + return true + } + + return false +} + +// SetDataId gets a reference to the given string and assigns it to the DataId field. +func (o *TagUpdateNotification) SetDataId(v string) { + o.DataId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetCreatedAt() int32 { + if o == nil || o.CreatedAt == nil { + var ret int32 + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetCreatedAtOk() (*int32, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int32 and assigns it to the CreatedAt field. +func (o *TagUpdateNotification) SetCreatedAt(v int32) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetLastUpdated() int32 { + if o == nil || o.LastUpdated == nil { + var ret int32 + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetLastUpdatedOk() (*int32, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given int32 and assigns it to the LastUpdated field. +func (o *TagUpdateNotification) SetLastUpdated(v int32) { + o.LastUpdated = &v +} + +// GetRecordStateKey returns the RecordStateKey field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetRecordStateKey() string { + if o == nil || o.RecordStateKey == nil { + var ret string + return ret + } + return *o.RecordStateKey +} + +// GetRecordStateKeyOk returns a tuple with the RecordStateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetRecordStateKeyOk() (*string, bool) { + if o == nil || o.RecordStateKey == nil { + return nil, false + } + return o.RecordStateKey, true +} + +// HasRecordStateKey returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasRecordStateKey() bool { + if o != nil && o.RecordStateKey != nil { + return true + } + + return false +} + +// SetRecordStateKey gets a reference to the given string and assigns it to the RecordStateKey field. +func (o *TagUpdateNotification) SetRecordStateKey(v string) { + o.RecordStateKey = &v +} + +// GetRecordStateVal returns the RecordStateVal field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TagUpdateNotification) GetRecordStateVal() string { + if o == nil || o.RecordStateVal.Get() == nil { + var ret string + return ret + } + return *o.RecordStateVal.Get() +} + +// GetRecordStateValOk returns a tuple with the RecordStateVal field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TagUpdateNotification) GetRecordStateValOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecordStateVal.Get(), o.RecordStateVal.IsSet() +} + +// HasRecordStateVal returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasRecordStateVal() bool { + if o != nil && o.RecordStateVal.IsSet() { + return true + } + + return false +} + +// SetRecordStateVal gets a reference to the given NullableString and assigns it to the RecordStateVal field. +func (o *TagUpdateNotification) SetRecordStateVal(v string) { + o.RecordStateVal.Set(&v) +} +// SetRecordStateValNil sets the value for RecordStateVal to be an explicit nil +func (o *TagUpdateNotification) SetRecordStateValNil() { + o.RecordStateVal.Set(nil) +} + +// UnsetRecordStateVal ensures that no value is present for RecordStateVal, not even an explicit nil +func (o *TagUpdateNotification) UnsetRecordStateVal() { + o.RecordStateVal.Unset() +} + +// GetTries returns the Tries field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetTries() int32 { + if o == nil || o.Tries == nil { + var ret int32 + return ret + } + return *o.Tries +} + +// GetTriesOk returns a tuple with the Tries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetTriesOk() (*int32, bool) { + if o == nil || o.Tries == nil { + return nil, false + } + return o.Tries, true +} + +// HasTries returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasTries() bool { + if o != nil && o.Tries != nil { + return true + } + + return false +} + +// SetTries gets a reference to the given int32 and assigns it to the Tries field. +func (o *TagUpdateNotification) SetTries(v int32) { + o.Tries = &v +} + +// GetMaxTries returns the MaxTries field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetMaxTries() int32 { + if o == nil || o.MaxTries == nil { + var ret int32 + return ret + } + return *o.MaxTries +} + +// GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetMaxTriesOk() (*int32, bool) { + if o == nil || o.MaxTries == nil { + return nil, false + } + return o.MaxTries, true +} + +// HasMaxTries returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasMaxTries() bool { + if o != nil && o.MaxTries != nil { + return true + } + + return false +} + +// SetMaxTries gets a reference to the given int32 and assigns it to the MaxTries field. +func (o *TagUpdateNotification) SetMaxTries(v int32) { + o.MaxTries = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *TagUpdateNotification) GetData() TagUpdateNotificationData { + if o == nil || o.Data == nil { + var ret TagUpdateNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotification) GetDataOk() (*TagUpdateNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *TagUpdateNotification) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given TagUpdateNotificationData and assigns it to the Data field. +func (o *TagUpdateNotification) SetData(v TagUpdateNotificationData) { + o.Data = &v +} + +func (o TagUpdateNotification) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.QueueId != nil { + toSerialize["queueId"] = o.QueueId + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.DataId != nil { + toSerialize["dataId"] = o.DataId + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.RecordStateKey != nil { + toSerialize["record_state_key"] = o.RecordStateKey + } + if o.RecordStateVal.IsSet() { + toSerialize["record_state_val"] = o.RecordStateVal.Get() + } + if o.Tries != nil { + toSerialize["tries"] = o.Tries + } + if o.MaxTries != nil { + toSerialize["max_tries"] = o.MaxTries + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableTagUpdateNotification struct { + value *TagUpdateNotification + isSet bool +} + +func (v NullableTagUpdateNotification) Get() *TagUpdateNotification { + return v.value +} + +func (v *NullableTagUpdateNotification) Set(val *TagUpdateNotification) { + v.value = val + v.isSet = true +} + +func (v NullableTagUpdateNotification) IsSet() bool { + return v.isSet +} + +func (v *NullableTagUpdateNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagUpdateNotification(val *TagUpdateNotification) *NullableTagUpdateNotification { + return &NullableTagUpdateNotification{value: val, isSet: true} +} + +func (v NullableTagUpdateNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagUpdateNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_update_notification_all_of.go b/.gen/anchore/model_tag_update_notification_all_of.go new file mode 100644 index 0000000000..3ef8b1fdaa --- /dev/null +++ b/.gen/anchore/model_tag_update_notification_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// TagUpdateNotificationAllOf The Notification Object definition for Tag Update Notifications +type TagUpdateNotificationAllOf struct { + Data *TagUpdateNotificationData `json:"data,omitempty"` +} + +// NewTagUpdateNotificationAllOf instantiates a new TagUpdateNotificationAllOf 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 NewTagUpdateNotificationAllOf() *TagUpdateNotificationAllOf { + this := TagUpdateNotificationAllOf{} + return &this +} + +// NewTagUpdateNotificationAllOfWithDefaults instantiates a new TagUpdateNotificationAllOf 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 NewTagUpdateNotificationAllOfWithDefaults() *TagUpdateNotificationAllOf { + this := TagUpdateNotificationAllOf{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *TagUpdateNotificationAllOf) GetData() TagUpdateNotificationData { + if o == nil || o.Data == nil { + var ret TagUpdateNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationAllOf) GetDataOk() (*TagUpdateNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *TagUpdateNotificationAllOf) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given TagUpdateNotificationData and assigns it to the Data field. +func (o *TagUpdateNotificationAllOf) SetData(v TagUpdateNotificationData) { + o.Data = &v +} + +func (o TagUpdateNotificationAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableTagUpdateNotificationAllOf struct { + value *TagUpdateNotificationAllOf + isSet bool +} + +func (v NullableTagUpdateNotificationAllOf) Get() *TagUpdateNotificationAllOf { + return v.value +} + +func (v *NullableTagUpdateNotificationAllOf) Set(val *TagUpdateNotificationAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableTagUpdateNotificationAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableTagUpdateNotificationAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagUpdateNotificationAllOf(val *TagUpdateNotificationAllOf) *NullableTagUpdateNotificationAllOf { + return &NullableTagUpdateNotificationAllOf{value: val, isSet: true} +} + +func (v NullableTagUpdateNotificationAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagUpdateNotificationAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_update_notification_data.go b/.gen/anchore/model_tag_update_notification_data.go new file mode 100644 index 0000000000..ecb5343cb7 --- /dev/null +++ b/.gen/anchore/model_tag_update_notification_data.go @@ -0,0 +1,224 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// TagUpdateNotificationData struct for TagUpdateNotificationData +type TagUpdateNotificationData struct { + NotificationUser *string `json:"notification_user,omitempty"` + NotificationUserEmail *string `json:"notification_user_email,omitempty"` + NotificationType *string `json:"notification_type,omitempty"` + NotificationPayload *TagUpdateNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewTagUpdateNotificationData instantiates a new TagUpdateNotificationData 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 NewTagUpdateNotificationData() *TagUpdateNotificationData { + this := TagUpdateNotificationData{} + return &this +} + +// NewTagUpdateNotificationDataWithDefaults instantiates a new TagUpdateNotificationData 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 NewTagUpdateNotificationDataWithDefaults() *TagUpdateNotificationData { + this := TagUpdateNotificationData{} + return &this +} + +// GetNotificationUser returns the NotificationUser field value if set, zero value otherwise. +func (o *TagUpdateNotificationData) GetNotificationUser() string { + if o == nil || o.NotificationUser == nil { + var ret string + return ret + } + return *o.NotificationUser +} + +// GetNotificationUserOk returns a tuple with the NotificationUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationData) GetNotificationUserOk() (*string, bool) { + if o == nil || o.NotificationUser == nil { + return nil, false + } + return o.NotificationUser, true +} + +// HasNotificationUser returns a boolean if a field has been set. +func (o *TagUpdateNotificationData) HasNotificationUser() bool { + if o != nil && o.NotificationUser != nil { + return true + } + + return false +} + +// SetNotificationUser gets a reference to the given string and assigns it to the NotificationUser field. +func (o *TagUpdateNotificationData) SetNotificationUser(v string) { + o.NotificationUser = &v +} + +// GetNotificationUserEmail returns the NotificationUserEmail field value if set, zero value otherwise. +func (o *TagUpdateNotificationData) GetNotificationUserEmail() string { + if o == nil || o.NotificationUserEmail == nil { + var ret string + return ret + } + return *o.NotificationUserEmail +} + +// GetNotificationUserEmailOk returns a tuple with the NotificationUserEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationData) GetNotificationUserEmailOk() (*string, bool) { + if o == nil || o.NotificationUserEmail == nil { + return nil, false + } + return o.NotificationUserEmail, true +} + +// HasNotificationUserEmail returns a boolean if a field has been set. +func (o *TagUpdateNotificationData) HasNotificationUserEmail() bool { + if o != nil && o.NotificationUserEmail != nil { + return true + } + + return false +} + +// SetNotificationUserEmail gets a reference to the given string and assigns it to the NotificationUserEmail field. +func (o *TagUpdateNotificationData) SetNotificationUserEmail(v string) { + o.NotificationUserEmail = &v +} + +// GetNotificationType returns the NotificationType field value if set, zero value otherwise. +func (o *TagUpdateNotificationData) GetNotificationType() string { + if o == nil || o.NotificationType == nil { + var ret string + return ret + } + return *o.NotificationType +} + +// GetNotificationTypeOk returns a tuple with the NotificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationData) GetNotificationTypeOk() (*string, bool) { + if o == nil || o.NotificationType == nil { + return nil, false + } + return o.NotificationType, true +} + +// HasNotificationType returns a boolean if a field has been set. +func (o *TagUpdateNotificationData) HasNotificationType() bool { + if o != nil && o.NotificationType != nil { + return true + } + + return false +} + +// SetNotificationType gets a reference to the given string and assigns it to the NotificationType field. +func (o *TagUpdateNotificationData) SetNotificationType(v string) { + o.NotificationType = &v +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *TagUpdateNotificationData) GetNotificationPayload() TagUpdateNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret TagUpdateNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationData) GetNotificationPayloadOk() (*TagUpdateNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *TagUpdateNotificationData) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given TagUpdateNotificationPayload and assigns it to the NotificationPayload field. +func (o *TagUpdateNotificationData) SetNotificationPayload(v TagUpdateNotificationPayload) { + o.NotificationPayload = &v +} + +func (o TagUpdateNotificationData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationUser != nil { + toSerialize["notification_user"] = o.NotificationUser + } + if o.NotificationUserEmail != nil { + toSerialize["notification_user_email"] = o.NotificationUserEmail + } + if o.NotificationType != nil { + toSerialize["notification_type"] = o.NotificationType + } + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullableTagUpdateNotificationData struct { + value *TagUpdateNotificationData + isSet bool +} + +func (v NullableTagUpdateNotificationData) Get() *TagUpdateNotificationData { + return v.value +} + +func (v *NullableTagUpdateNotificationData) Set(val *TagUpdateNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableTagUpdateNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableTagUpdateNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagUpdateNotificationData(val *TagUpdateNotificationData) *NullableTagUpdateNotificationData { + return &NullableTagUpdateNotificationData{value: val, isSet: true} +} + +func (v NullableTagUpdateNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagUpdateNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_update_notification_data_all_of.go b/.gen/anchore/model_tag_update_notification_data_all_of.go new file mode 100644 index 0000000000..463c863542 --- /dev/null +++ b/.gen/anchore/model_tag_update_notification_data_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// TagUpdateNotificationDataAllOf struct for TagUpdateNotificationDataAllOf +type TagUpdateNotificationDataAllOf struct { + NotificationPayload *TagUpdateNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewTagUpdateNotificationDataAllOf instantiates a new TagUpdateNotificationDataAllOf 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 NewTagUpdateNotificationDataAllOf() *TagUpdateNotificationDataAllOf { + this := TagUpdateNotificationDataAllOf{} + return &this +} + +// NewTagUpdateNotificationDataAllOfWithDefaults instantiates a new TagUpdateNotificationDataAllOf 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 NewTagUpdateNotificationDataAllOfWithDefaults() *TagUpdateNotificationDataAllOf { + this := TagUpdateNotificationDataAllOf{} + return &this +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *TagUpdateNotificationDataAllOf) GetNotificationPayload() TagUpdateNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret TagUpdateNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationDataAllOf) GetNotificationPayloadOk() (*TagUpdateNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *TagUpdateNotificationDataAllOf) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given TagUpdateNotificationPayload and assigns it to the NotificationPayload field. +func (o *TagUpdateNotificationDataAllOf) SetNotificationPayload(v TagUpdateNotificationPayload) { + o.NotificationPayload = &v +} + +func (o TagUpdateNotificationDataAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullableTagUpdateNotificationDataAllOf struct { + value *TagUpdateNotificationDataAllOf + isSet bool +} + +func (v NullableTagUpdateNotificationDataAllOf) Get() *TagUpdateNotificationDataAllOf { + return v.value +} + +func (v *NullableTagUpdateNotificationDataAllOf) Set(val *TagUpdateNotificationDataAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableTagUpdateNotificationDataAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableTagUpdateNotificationDataAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagUpdateNotificationDataAllOf(val *TagUpdateNotificationDataAllOf) *NullableTagUpdateNotificationDataAllOf { + return &NullableTagUpdateNotificationDataAllOf{value: val, isSet: true} +} + +func (v NullableTagUpdateNotificationDataAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagUpdateNotificationDataAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_update_notification_payload.go b/.gen/anchore/model_tag_update_notification_payload.go new file mode 100644 index 0000000000..f0058b8bca --- /dev/null +++ b/.gen/anchore/model_tag_update_notification_payload.go @@ -0,0 +1,336 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// TagUpdateNotificationPayload struct for TagUpdateNotificationPayload +type TagUpdateNotificationPayload struct { + UserId *string `json:"userId,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` + NotificationId *string `json:"notificationId,omitempty"` + // A list containing the current image digest + CurrEval []map[string]interface{} `json:"curr_eval,omitempty"` + // A list containing the previous image digests + LastEval []map[string]interface{} `json:"last_eval,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewTagUpdateNotificationPayload instantiates a new TagUpdateNotificationPayload 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 NewTagUpdateNotificationPayload() *TagUpdateNotificationPayload { + this := TagUpdateNotificationPayload{} + return &this +} + +// NewTagUpdateNotificationPayloadWithDefaults instantiates a new TagUpdateNotificationPayload 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 NewTagUpdateNotificationPayloadWithDefaults() *TagUpdateNotificationPayload { + this := TagUpdateNotificationPayload{} + return &this +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayload) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayload) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *TagUpdateNotificationPayload) SetUserId(v string) { + o.UserId = &v +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayload) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayload) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *TagUpdateNotificationPayload) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v +} + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayload) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayload) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *TagUpdateNotificationPayload) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +// GetNotificationId returns the NotificationId field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayload) GetNotificationId() string { + if o == nil || o.NotificationId == nil { + var ret string + return ret + } + return *o.NotificationId +} + +// GetNotificationIdOk returns a tuple with the NotificationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayload) GetNotificationIdOk() (*string, bool) { + if o == nil || o.NotificationId == nil { + return nil, false + } + return o.NotificationId, true +} + +// HasNotificationId returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasNotificationId() bool { + if o != nil && o.NotificationId != nil { + return true + } + + return false +} + +// SetNotificationId gets a reference to the given string and assigns it to the NotificationId field. +func (o *TagUpdateNotificationPayload) SetNotificationId(v string) { + o.NotificationId = &v +} + +// GetCurrEval returns the CurrEval field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayload) GetCurrEval() []map[string]interface{} { + if o == nil || o.CurrEval == nil { + var ret []map[string]interface{} + return ret + } + return o.CurrEval +} + +// GetCurrEvalOk returns a tuple with the CurrEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayload) GetCurrEvalOk() ([]map[string]interface{}, bool) { + if o == nil || o.CurrEval == nil { + return nil, false + } + return o.CurrEval, true +} + +// HasCurrEval returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasCurrEval() bool { + if o != nil && o.CurrEval != nil { + return true + } + + return false +} + +// SetCurrEval gets a reference to the given []map[string]interface{} and assigns it to the CurrEval field. +func (o *TagUpdateNotificationPayload) SetCurrEval(v []map[string]interface{}) { + o.CurrEval = v +} + +// GetLastEval returns the LastEval field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayload) GetLastEval() []map[string]interface{} { + if o == nil || o.LastEval == nil { + var ret []map[string]interface{} + return ret + } + return o.LastEval +} + +// GetLastEvalOk returns a tuple with the LastEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayload) GetLastEvalOk() ([]map[string]interface{}, bool) { + if o == nil || o.LastEval == nil { + return nil, false + } + return o.LastEval, true +} + +// HasLastEval returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasLastEval() bool { + if o != nil && o.LastEval != nil { + return true + } + + return false +} + +// SetLastEval gets a reference to the given []map[string]interface{} and assigns it to the LastEval field. +func (o *TagUpdateNotificationPayload) SetLastEval(v []map[string]interface{}) { + o.LastEval = v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TagUpdateNotificationPayload) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TagUpdateNotificationPayload) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayload) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *TagUpdateNotificationPayload) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o TagUpdateNotificationPayload) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + if o.NotificationId != nil { + toSerialize["notificationId"] = o.NotificationId + } + if o.CurrEval != nil { + toSerialize["curr_eval"] = o.CurrEval + } + if o.LastEval != nil { + toSerialize["last_eval"] = o.LastEval + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullableTagUpdateNotificationPayload struct { + value *TagUpdateNotificationPayload + isSet bool +} + +func (v NullableTagUpdateNotificationPayload) Get() *TagUpdateNotificationPayload { + return v.value +} + +func (v *NullableTagUpdateNotificationPayload) Set(val *TagUpdateNotificationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableTagUpdateNotificationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableTagUpdateNotificationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagUpdateNotificationPayload(val *TagUpdateNotificationPayload) *NullableTagUpdateNotificationPayload { + return &NullableTagUpdateNotificationPayload{value: val, isSet: true} +} + +func (v NullableTagUpdateNotificationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagUpdateNotificationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_tag_update_notification_payload_all_of.go b/.gen/anchore/model_tag_update_notification_payload_all_of.go new file mode 100644 index 0000000000..6dc38f4120 --- /dev/null +++ b/.gen/anchore/model_tag_update_notification_payload_all_of.go @@ -0,0 +1,192 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// TagUpdateNotificationPayloadAllOf struct for TagUpdateNotificationPayloadAllOf +type TagUpdateNotificationPayloadAllOf struct { + // A list containing the current image digest + CurrEval []map[string]interface{} `json:"curr_eval,omitempty"` + // A list containing the previous image digests + LastEval []map[string]interface{} `json:"last_eval,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewTagUpdateNotificationPayloadAllOf instantiates a new TagUpdateNotificationPayloadAllOf 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 NewTagUpdateNotificationPayloadAllOf() *TagUpdateNotificationPayloadAllOf { + this := TagUpdateNotificationPayloadAllOf{} + return &this +} + +// NewTagUpdateNotificationPayloadAllOfWithDefaults instantiates a new TagUpdateNotificationPayloadAllOf 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 NewTagUpdateNotificationPayloadAllOfWithDefaults() *TagUpdateNotificationPayloadAllOf { + this := TagUpdateNotificationPayloadAllOf{} + return &this +} + +// GetCurrEval returns the CurrEval field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayloadAllOf) GetCurrEval() []map[string]interface{} { + if o == nil || o.CurrEval == nil { + var ret []map[string]interface{} + return ret + } + return o.CurrEval +} + +// GetCurrEvalOk returns a tuple with the CurrEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayloadAllOf) GetCurrEvalOk() ([]map[string]interface{}, bool) { + if o == nil || o.CurrEval == nil { + return nil, false + } + return o.CurrEval, true +} + +// HasCurrEval returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayloadAllOf) HasCurrEval() bool { + if o != nil && o.CurrEval != nil { + return true + } + + return false +} + +// SetCurrEval gets a reference to the given []map[string]interface{} and assigns it to the CurrEval field. +func (o *TagUpdateNotificationPayloadAllOf) SetCurrEval(v []map[string]interface{}) { + o.CurrEval = v +} + +// GetLastEval returns the LastEval field value if set, zero value otherwise. +func (o *TagUpdateNotificationPayloadAllOf) GetLastEval() []map[string]interface{} { + if o == nil || o.LastEval == nil { + var ret []map[string]interface{} + return ret + } + return o.LastEval +} + +// GetLastEvalOk returns a tuple with the LastEval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagUpdateNotificationPayloadAllOf) GetLastEvalOk() ([]map[string]interface{}, bool) { + if o == nil || o.LastEval == nil { + return nil, false + } + return o.LastEval, true +} + +// HasLastEval returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayloadAllOf) HasLastEval() bool { + if o != nil && o.LastEval != nil { + return true + } + + return false +} + +// SetLastEval gets a reference to the given []map[string]interface{} and assigns it to the LastEval field. +func (o *TagUpdateNotificationPayloadAllOf) SetLastEval(v []map[string]interface{}) { + o.LastEval = v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TagUpdateNotificationPayloadAllOf) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TagUpdateNotificationPayloadAllOf) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *TagUpdateNotificationPayloadAllOf) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *TagUpdateNotificationPayloadAllOf) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o TagUpdateNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CurrEval != nil { + toSerialize["curr_eval"] = o.CurrEval + } + if o.LastEval != nil { + toSerialize["last_eval"] = o.LastEval + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullableTagUpdateNotificationPayloadAllOf struct { + value *TagUpdateNotificationPayloadAllOf + isSet bool +} + +func (v NullableTagUpdateNotificationPayloadAllOf) Get() *TagUpdateNotificationPayloadAllOf { + return v.value +} + +func (v *NullableTagUpdateNotificationPayloadAllOf) Set(val *TagUpdateNotificationPayloadAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableTagUpdateNotificationPayloadAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableTagUpdateNotificationPayloadAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagUpdateNotificationPayloadAllOf(val *TagUpdateNotificationPayloadAllOf) *NullableTagUpdateNotificationPayloadAllOf { + return &NullableTagUpdateNotificationPayloadAllOf{value: val, isSet: true} +} + +func (v NullableTagUpdateNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagUpdateNotificationPayloadAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_token_response.go b/.gen/anchore/model_token_response.go index ec878fdd83..41076f9914 100644 --- a/.gen/anchore/model_token_response.go +++ b/.gen/anchore/model_token_response.go @@ -1,17 +1,110 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // TokenResponse struct for TokenResponse type TokenResponse struct { // The token content Token string `json:"token"` } + +// NewTokenResponse instantiates a new TokenResponse 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 NewTokenResponse(token string) *TokenResponse { + this := TokenResponse{} + this.Token = token + return &this +} + +// NewTokenResponseWithDefaults instantiates a new TokenResponse 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 NewTokenResponseWithDefaults() *TokenResponse { + this := TokenResponse{} + return &this +} + +// GetToken returns the Token field value +func (o *TokenResponse) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *TokenResponse) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *TokenResponse) SetToken(v string) { + o.Token = v +} + +func (o TokenResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["token"] = o.Token + } + return json.Marshal(toSerialize) +} + +type NullableTokenResponse struct { + value *TokenResponse + isSet bool +} + +func (v NullableTokenResponse) Get() *TokenResponse { + return v.value +} + +func (v *NullableTokenResponse) Set(val *TokenResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTokenResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenResponse(val *TokenResponse) *NullableTokenResponse { + return &NullableTokenResponse{value: val, isSet: true} +} + +func (v NullableTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_trigger_param_spec.go b/.gen/anchore/model_trigger_param_spec.go index 8f32b10c3b..93452f3bda 100644 --- a/.gen/anchore/model_trigger_param_spec.go +++ b/.gen/anchore/model_trigger_param_spec.go @@ -1,28 +1,358 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // TriggerParamSpec struct for TriggerParamSpec type TriggerParamSpec struct { // Parameter name as it appears in policy document - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` // An example value for the parameter (encoded as a string if the parameter is an object or list type) - Example *string `json:"example,omitempty"` + Example NullableString `json:"example,omitempty"` // State of the trigger parameter - State string `json:"state,omitempty"` + State *string `json:"state,omitempty"` // The name of another trigger that supercedes this on functionally if this is deprecated - SupercededBy *string `json:"superceded_by,omitempty"` + SupercededBy NullableString `json:"superceded_by,omitempty"` // Is this a required parameter or optional - Required bool `json:"required,omitempty"` + Required *bool `json:"required,omitempty"` // If present, a definition for validation of input. Typically a jsonschema object that can be used to validate an input against. Validator map[string]interface{} `json:"validator,omitempty"` } + +// NewTriggerParamSpec instantiates a new TriggerParamSpec 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 NewTriggerParamSpec() *TriggerParamSpec { + this := TriggerParamSpec{} + return &this +} + +// NewTriggerParamSpecWithDefaults instantiates a new TriggerParamSpec 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 NewTriggerParamSpecWithDefaults() *TriggerParamSpec { + this := TriggerParamSpec{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TriggerParamSpec) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerParamSpec) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *TriggerParamSpec) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TriggerParamSpec) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerParamSpec) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TriggerParamSpec) SetDescription(v string) { + o.Description = &v +} + +// GetExample returns the Example field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TriggerParamSpec) GetExample() string { + if o == nil || o.Example.Get() == nil { + var ret string + return ret + } + return *o.Example.Get() +} + +// GetExampleOk returns a tuple with the Example field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TriggerParamSpec) GetExampleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Example.Get(), o.Example.IsSet() +} + +// HasExample returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasExample() bool { + if o != nil && o.Example.IsSet() { + return true + } + + return false +} + +// SetExample gets a reference to the given NullableString and assigns it to the Example field. +func (o *TriggerParamSpec) SetExample(v string) { + o.Example.Set(&v) +} +// SetExampleNil sets the value for Example to be an explicit nil +func (o *TriggerParamSpec) SetExampleNil() { + o.Example.Set(nil) +} + +// UnsetExample ensures that no value is present for Example, not even an explicit nil +func (o *TriggerParamSpec) UnsetExample() { + o.Example.Unset() +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *TriggerParamSpec) GetState() string { + if o == nil || o.State == nil { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerParamSpec) GetStateOk() (*string, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *TriggerParamSpec) SetState(v string) { + o.State = &v +} + +// GetSupercededBy returns the SupercededBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TriggerParamSpec) GetSupercededBy() string { + if o == nil || o.SupercededBy.Get() == nil { + var ret string + return ret + } + return *o.SupercededBy.Get() +} + +// GetSupercededByOk returns a tuple with the SupercededBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TriggerParamSpec) GetSupercededByOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SupercededBy.Get(), o.SupercededBy.IsSet() +} + +// HasSupercededBy returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasSupercededBy() bool { + if o != nil && o.SupercededBy.IsSet() { + return true + } + + return false +} + +// SetSupercededBy gets a reference to the given NullableString and assigns it to the SupercededBy field. +func (o *TriggerParamSpec) SetSupercededBy(v string) { + o.SupercededBy.Set(&v) +} +// SetSupercededByNil sets the value for SupercededBy to be an explicit nil +func (o *TriggerParamSpec) SetSupercededByNil() { + o.SupercededBy.Set(nil) +} + +// UnsetSupercededBy ensures that no value is present for SupercededBy, not even an explicit nil +func (o *TriggerParamSpec) UnsetSupercededBy() { + o.SupercededBy.Unset() +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *TriggerParamSpec) GetRequired() bool { + if o == nil || o.Required == nil { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerParamSpec) GetRequiredOk() (*bool, bool) { + if o == nil || o.Required == nil { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasRequired() bool { + if o != nil && o.Required != nil { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *TriggerParamSpec) SetRequired(v bool) { + o.Required = &v +} + +// GetValidator returns the Validator field value if set, zero value otherwise. +func (o *TriggerParamSpec) GetValidator() map[string]interface{} { + if o == nil || o.Validator == nil { + var ret map[string]interface{} + return ret + } + return o.Validator +} + +// GetValidatorOk returns a tuple with the Validator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerParamSpec) GetValidatorOk() (map[string]interface{}, bool) { + if o == nil || o.Validator == nil { + return nil, false + } + return o.Validator, true +} + +// HasValidator returns a boolean if a field has been set. +func (o *TriggerParamSpec) HasValidator() bool { + if o != nil && o.Validator != nil { + return true + } + + return false +} + +// SetValidator gets a reference to the given map[string]interface{} and assigns it to the Validator field. +func (o *TriggerParamSpec) SetValidator(v map[string]interface{}) { + o.Validator = v +} + +func (o TriggerParamSpec) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Example.IsSet() { + toSerialize["example"] = o.Example.Get() + } + if o.State != nil { + toSerialize["state"] = o.State + } + if o.SupercededBy.IsSet() { + toSerialize["superceded_by"] = o.SupercededBy.Get() + } + if o.Required != nil { + toSerialize["required"] = o.Required + } + if o.Validator != nil { + toSerialize["validator"] = o.Validator + } + return json.Marshal(toSerialize) +} + +type NullableTriggerParamSpec struct { + value *TriggerParamSpec + isSet bool +} + +func (v NullableTriggerParamSpec) Get() *TriggerParamSpec { + return v.value +} + +func (v *NullableTriggerParamSpec) Set(val *TriggerParamSpec) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerParamSpec) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerParamSpec) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerParamSpec(val *TriggerParamSpec) *NullableTriggerParamSpec { + return &NullableTriggerParamSpec{value: val, isSet: true} +} + +func (v NullableTriggerParamSpec) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerParamSpec) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_trigger_spec.go b/.gen/anchore/model_trigger_spec.go index 81fc21f0c9..93589b4eda 100644 --- a/.gen/anchore/model_trigger_spec.go +++ b/.gen/anchore/model_trigger_spec.go @@ -1,25 +1,275 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // TriggerSpec Definition of a trigger and its parameters type TriggerSpec struct { // Name of the trigger as it would appear in a policy document - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Trigger description for what it tests and when it will fire during evaluation - Description string `json:"description,omitempty"` + Description *string `json:"description,omitempty"` // State of the trigger - State string `json:"state,omitempty"` + State *string `json:"state,omitempty"` // The name of another trigger that supercedes this on functionally if this is deprecated - SupercededBy *string `json:"superceded_by,omitempty"` + SupercededBy NullableString `json:"superceded_by,omitempty"` // The list of parameters that are valid for this trigger Parameters []TriggerParamSpec `json:"parameters,omitempty"` } + +// NewTriggerSpec instantiates a new TriggerSpec 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 NewTriggerSpec() *TriggerSpec { + this := TriggerSpec{} + return &this +} + +// NewTriggerSpecWithDefaults instantiates a new TriggerSpec 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 NewTriggerSpecWithDefaults() *TriggerSpec { + this := TriggerSpec{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TriggerSpec) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerSpec) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *TriggerSpec) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *TriggerSpec) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TriggerSpec) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerSpec) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TriggerSpec) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TriggerSpec) SetDescription(v string) { + o.Description = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *TriggerSpec) GetState() string { + if o == nil || o.State == nil { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerSpec) GetStateOk() (*string, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *TriggerSpec) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *TriggerSpec) SetState(v string) { + o.State = &v +} + +// GetSupercededBy returns the SupercededBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TriggerSpec) GetSupercededBy() string { + if o == nil || o.SupercededBy.Get() == nil { + var ret string + return ret + } + return *o.SupercededBy.Get() +} + +// GetSupercededByOk returns a tuple with the SupercededBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TriggerSpec) GetSupercededByOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SupercededBy.Get(), o.SupercededBy.IsSet() +} + +// HasSupercededBy returns a boolean if a field has been set. +func (o *TriggerSpec) HasSupercededBy() bool { + if o != nil && o.SupercededBy.IsSet() { + return true + } + + return false +} + +// SetSupercededBy gets a reference to the given NullableString and assigns it to the SupercededBy field. +func (o *TriggerSpec) SetSupercededBy(v string) { + o.SupercededBy.Set(&v) +} +// SetSupercededByNil sets the value for SupercededBy to be an explicit nil +func (o *TriggerSpec) SetSupercededByNil() { + o.SupercededBy.Set(nil) +} + +// UnsetSupercededBy ensures that no value is present for SupercededBy, not even an explicit nil +func (o *TriggerSpec) UnsetSupercededBy() { + o.SupercededBy.Unset() +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *TriggerSpec) GetParameters() []TriggerParamSpec { + if o == nil || o.Parameters == nil { + var ret []TriggerParamSpec + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TriggerSpec) GetParametersOk() ([]TriggerParamSpec, bool) { + if o == nil || o.Parameters == nil { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *TriggerSpec) HasParameters() bool { + if o != nil && o.Parameters != nil { + return true + } + + return false +} + +// SetParameters gets a reference to the given []TriggerParamSpec and assigns it to the Parameters field. +func (o *TriggerSpec) SetParameters(v []TriggerParamSpec) { + o.Parameters = v +} + +func (o TriggerSpec) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.State != nil { + toSerialize["state"] = o.State + } + if o.SupercededBy.IsSet() { + toSerialize["superceded_by"] = o.SupercededBy.Get() + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + return json.Marshal(toSerialize) +} + +type NullableTriggerSpec struct { + value *TriggerSpec + isSet bool +} + +func (v NullableTriggerSpec) Get() *TriggerSpec { + return v.value +} + +func (v *NullableTriggerSpec) Set(val *TriggerSpec) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerSpec) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerSpec) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerSpec(val *TriggerSpec) *NullableTriggerSpec { + return &NullableTriggerSpec{value: val, isSet: true} +} + +func (v NullableTriggerSpec) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerSpec) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_user.go b/.gen/anchore/model_user.go index 697808d7b3..fb8918a47f 100644 --- a/.gen/anchore/model_user.go +++ b/.gen/anchore/model_user.go @@ -1,28 +1,259 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + import ( + "encoding/json" "time" ) + // User A username for authenticating with one or more types of credentials. User type defines the expected credentials allowed for the user. Native users have passwords, External users have no credential internally. Internal users are service/system users for inter-service communication. type User struct { // The username to authenticate with Username string `json:"username"` // The user's type - Type string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` // If the user is external, this is the source that the user was initialized from. All other user types have this set to null - Source string `json:"source,omitempty"` + Source *string `json:"source,omitempty"` // The timestampt the user record was created - CreatedAt time.Time `json:"created_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` // The timestamp of the last update to this record - LastUpdated time.Time `json:"last_updated,omitempty"` + LastUpdated *time.Time `json:"last_updated,omitempty"` +} + +// NewUser instantiates a new User 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 NewUser(username string) *User { + this := User{} + this.Username = username + return &this +} + +// NewUserWithDefaults instantiates a new User 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 NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetUsername returns the Username field value +func (o *User) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *User) SetUsername(v string) { + o.Username = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *User) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *User) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *User) SetType(v string) { + o.Type = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *User) GetSource() string { + if o == nil || o.Source == nil { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetSourceOk() (*string, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true } + +// HasSource returns a boolean if a field has been set. +func (o *User) HasSource() bool { + if o != nil && o.Source != nil { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *User) SetSource(v string) { + o.Source = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *User) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *User) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *User) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *User) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated == nil { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *User) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *User) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["username"] = o.Username + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Source != nil { + toSerialize["source"] = o.Source + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + return json.Marshal(toSerialize) +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_user_creation_request.go b/.gen/anchore/model_user_creation_request.go index 7051613b75..e683172f7d 100644 --- a/.gen/anchore/model_user_creation_request.go +++ b/.gen/anchore/model_user_creation_request.go @@ -1,15 +1,20 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // UserCreationRequest A payload for creating a new user, includes the username and password in a single request type UserCreationRequest struct { // The username to create @@ -17,3 +22,119 @@ type UserCreationRequest struct { // The initial password for the user, must be at least 6 characters, up to 128 Password string `json:"password"` } + +// NewUserCreationRequest instantiates a new UserCreationRequest 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 NewUserCreationRequest(username string, password string) *UserCreationRequest { + this := UserCreationRequest{} + this.Username = username + this.Password = password + return &this +} + +// NewUserCreationRequestWithDefaults instantiates a new UserCreationRequest 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 NewUserCreationRequestWithDefaults() *UserCreationRequest { + this := UserCreationRequest{} + return &this +} + +// GetUsername returns the Username field value +func (o *UserCreationRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserCreationRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserCreationRequest) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *UserCreationRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *UserCreationRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *UserCreationRequest) SetPassword(v string) { + o.Password = v +} + +func (o UserCreationRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["username"] = o.Username + } + if true { + toSerialize["password"] = o.Password + } + return json.Marshal(toSerialize) +} + +type NullableUserCreationRequest struct { + value *UserCreationRequest + isSet bool +} + +func (v NullableUserCreationRequest) Get() *UserCreationRequest { + return v.value +} + +func (v *NullableUserCreationRequest) Set(val *UserCreationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserCreationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCreationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCreationRequest(val *UserCreationRequest) *NullableUserCreationRequest { + return &NullableUserCreationRequest{value: val, isSet: true} +} + +func (v NullableUserCreationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCreationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vendor_data_object.go b/.gen/anchore/model_vendor_data_object.go index 5334244c67..880d36bccf 100644 --- a/.gen/anchore/model_vendor_data_object.go +++ b/.gen/anchore/model_vendor_data_object.go @@ -1,19 +1,189 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // VendorDataObject struct for VendorDataObject type VendorDataObject struct { // Vendor Vulnerability ID - Id string `json:"id,omitempty"` - CvssV2 Cvssv2Scores `json:"cvss_v2,omitempty"` - CvssV3 Cvssv3Scores `json:"cvss_v3,omitempty"` + Id *string `json:"id,omitempty"` + CvssV2 *CVSSV2Scores `json:"cvss_v2,omitempty"` + CvssV3 *CVSSV3Scores `json:"cvss_v3,omitempty"` +} + +// NewVendorDataObject instantiates a new VendorDataObject 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 NewVendorDataObject() *VendorDataObject { + this := VendorDataObject{} + return &this +} + +// NewVendorDataObjectWithDefaults instantiates a new VendorDataObject 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 NewVendorDataObjectWithDefaults() *VendorDataObject { + this := VendorDataObject{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VendorDataObject) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VendorDataObject) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VendorDataObject) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VendorDataObject) SetId(v string) { + o.Id = &v +} + +// GetCvssV2 returns the CvssV2 field value if set, zero value otherwise. +func (o *VendorDataObject) GetCvssV2() CVSSV2Scores { + if o == nil || o.CvssV2 == nil { + var ret CVSSV2Scores + return ret + } + return *o.CvssV2 +} + +// GetCvssV2Ok returns a tuple with the CvssV2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VendorDataObject) GetCvssV2Ok() (*CVSSV2Scores, bool) { + if o == nil || o.CvssV2 == nil { + return nil, false + } + return o.CvssV2, true +} + +// HasCvssV2 returns a boolean if a field has been set. +func (o *VendorDataObject) HasCvssV2() bool { + if o != nil && o.CvssV2 != nil { + return true + } + + return false +} + +// SetCvssV2 gets a reference to the given CVSSV2Scores and assigns it to the CvssV2 field. +func (o *VendorDataObject) SetCvssV2(v CVSSV2Scores) { + o.CvssV2 = &v +} + +// GetCvssV3 returns the CvssV3 field value if set, zero value otherwise. +func (o *VendorDataObject) GetCvssV3() CVSSV3Scores { + if o == nil || o.CvssV3 == nil { + var ret CVSSV3Scores + return ret + } + return *o.CvssV3 } + +// GetCvssV3Ok returns a tuple with the CvssV3 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VendorDataObject) GetCvssV3Ok() (*CVSSV3Scores, bool) { + if o == nil || o.CvssV3 == nil { + return nil, false + } + return o.CvssV3, true +} + +// HasCvssV3 returns a boolean if a field has been set. +func (o *VendorDataObject) HasCvssV3() bool { + if o != nil && o.CvssV3 != nil { + return true + } + + return false +} + +// SetCvssV3 gets a reference to the given CVSSV3Scores and assigns it to the CvssV3 field. +func (o *VendorDataObject) SetCvssV3(v CVSSV3Scores) { + o.CvssV3 = &v +} + +func (o VendorDataObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CvssV2 != nil { + toSerialize["cvss_v2"] = o.CvssV2 + } + if o.CvssV3 != nil { + toSerialize["cvss_v3"] = o.CvssV3 + } + return json.Marshal(toSerialize) +} + +type NullableVendorDataObject struct { + value *VendorDataObject + isSet bool +} + +func (v NullableVendorDataObject) Get() *VendorDataObject { + return v.value +} + +func (v *NullableVendorDataObject) Set(val *VendorDataObject) { + v.value = val + v.isSet = true +} + +func (v NullableVendorDataObject) IsSet() bool { + return v.isSet +} + +func (v *NullableVendorDataObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVendorDataObject(val *VendorDataObject) *NullableVendorDataObject { + return &NullableVendorDataObject{value: val, isSet: true} +} + +func (v NullableVendorDataObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVendorDataObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_diff_result.go b/.gen/anchore/model_vuln_diff_result.go new file mode 100644 index 0000000000..4bb4641ede --- /dev/null +++ b/.gen/anchore/model_vuln_diff_result.go @@ -0,0 +1,188 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnDiffResult The results of the comparing two vulnerability records during an update +type VulnDiffResult struct { + Added []map[string]interface{} `json:"added,omitempty"` + Updated []map[string]interface{} `json:"updated,omitempty"` + Removed []map[string]interface{} `json:"removed,omitempty"` +} + +// NewVulnDiffResult instantiates a new VulnDiffResult 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 NewVulnDiffResult() *VulnDiffResult { + this := VulnDiffResult{} + return &this +} + +// NewVulnDiffResultWithDefaults instantiates a new VulnDiffResult 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 NewVulnDiffResultWithDefaults() *VulnDiffResult { + this := VulnDiffResult{} + return &this +} + +// GetAdded returns the Added field value if set, zero value otherwise. +func (o *VulnDiffResult) GetAdded() []map[string]interface{} { + if o == nil || o.Added == nil { + var ret []map[string]interface{} + return ret + } + return o.Added +} + +// GetAddedOk returns a tuple with the Added field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnDiffResult) GetAddedOk() ([]map[string]interface{}, bool) { + if o == nil || o.Added == nil { + return nil, false + } + return o.Added, true +} + +// HasAdded returns a boolean if a field has been set. +func (o *VulnDiffResult) HasAdded() bool { + if o != nil && o.Added != nil { + return true + } + + return false +} + +// SetAdded gets a reference to the given []map[string]interface{} and assigns it to the Added field. +func (o *VulnDiffResult) SetAdded(v []map[string]interface{}) { + o.Added = v +} + +// GetUpdated returns the Updated field value if set, zero value otherwise. +func (o *VulnDiffResult) GetUpdated() []map[string]interface{} { + if o == nil || o.Updated == nil { + var ret []map[string]interface{} + return ret + } + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnDiffResult) GetUpdatedOk() ([]map[string]interface{}, bool) { + if o == nil || o.Updated == nil { + return nil, false + } + return o.Updated, true +} + +// HasUpdated returns a boolean if a field has been set. +func (o *VulnDiffResult) HasUpdated() bool { + if o != nil && o.Updated != nil { + return true + } + + return false +} + +// SetUpdated gets a reference to the given []map[string]interface{} and assigns it to the Updated field. +func (o *VulnDiffResult) SetUpdated(v []map[string]interface{}) { + o.Updated = v +} + +// GetRemoved returns the Removed field value if set, zero value otherwise. +func (o *VulnDiffResult) GetRemoved() []map[string]interface{} { + if o == nil || o.Removed == nil { + var ret []map[string]interface{} + return ret + } + return o.Removed +} + +// GetRemovedOk returns a tuple with the Removed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnDiffResult) GetRemovedOk() ([]map[string]interface{}, bool) { + if o == nil || o.Removed == nil { + return nil, false + } + return o.Removed, true +} + +// HasRemoved returns a boolean if a field has been set. +func (o *VulnDiffResult) HasRemoved() bool { + if o != nil && o.Removed != nil { + return true + } + + return false +} + +// SetRemoved gets a reference to the given []map[string]interface{} and assigns it to the Removed field. +func (o *VulnDiffResult) SetRemoved(v []map[string]interface{}) { + o.Removed = v +} + +func (o VulnDiffResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Added != nil { + toSerialize["added"] = o.Added + } + if o.Updated != nil { + toSerialize["updated"] = o.Updated + } + if o.Removed != nil { + toSerialize["removed"] = o.Removed + } + return json.Marshal(toSerialize) +} + +type NullableVulnDiffResult struct { + value *VulnDiffResult + isSet bool +} + +func (v NullableVulnDiffResult) Get() *VulnDiffResult { + return v.value +} + +func (v *NullableVulnDiffResult) Set(val *VulnDiffResult) { + v.value = val + v.isSet = true +} + +func (v NullableVulnDiffResult) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnDiffResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnDiffResult(val *VulnDiffResult) *NullableVulnDiffResult { + return &NullableVulnDiffResult{value: val, isSet: true} +} + +func (v NullableVulnDiffResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnDiffResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_update_notification.go b/.gen/anchore/model_vuln_update_notification.go new file mode 100644 index 0000000000..177e2372dd --- /dev/null +++ b/.gen/anchore/model_vuln_update_notification.go @@ -0,0 +1,454 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnUpdateNotification struct for VulnUpdateNotification +type VulnUpdateNotification struct { + QueueId *string `json:"queueId,omitempty"` + UserId *string `json:"userId,omitempty"` + DataId *string `json:"dataId,omitempty"` + CreatedAt *int32 `json:"created_at,omitempty"` + LastUpdated *int32 `json:"last_updated,omitempty"` + RecordStateKey *string `json:"record_state_key,omitempty"` + RecordStateVal NullableString `json:"record_state_val,omitempty"` + Tries *int32 `json:"tries,omitempty"` + MaxTries *int32 `json:"max_tries,omitempty"` + Data *VulnUpdateNotificationData `json:"data,omitempty"` +} + +// NewVulnUpdateNotification instantiates a new VulnUpdateNotification 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 NewVulnUpdateNotification() *VulnUpdateNotification { + this := VulnUpdateNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// NewVulnUpdateNotificationWithDefaults instantiates a new VulnUpdateNotification 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 NewVulnUpdateNotificationWithDefaults() *VulnUpdateNotification { + this := VulnUpdateNotification{} + var recordStateKey string = "active" + this.RecordStateKey = &recordStateKey + return &this +} + +// GetQueueId returns the QueueId field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetQueueId() string { + if o == nil || o.QueueId == nil { + var ret string + return ret + } + return *o.QueueId +} + +// GetQueueIdOk returns a tuple with the QueueId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetQueueIdOk() (*string, bool) { + if o == nil || o.QueueId == nil { + return nil, false + } + return o.QueueId, true +} + +// HasQueueId returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasQueueId() bool { + if o != nil && o.QueueId != nil { + return true + } + + return false +} + +// SetQueueId gets a reference to the given string and assigns it to the QueueId field. +func (o *VulnUpdateNotification) SetQueueId(v string) { + o.QueueId = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *VulnUpdateNotification) SetUserId(v string) { + o.UserId = &v +} + +// GetDataId returns the DataId field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetDataId() string { + if o == nil || o.DataId == nil { + var ret string + return ret + } + return *o.DataId +} + +// GetDataIdOk returns a tuple with the DataId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetDataIdOk() (*string, bool) { + if o == nil || o.DataId == nil { + return nil, false + } + return o.DataId, true +} + +// HasDataId returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasDataId() bool { + if o != nil && o.DataId != nil { + return true + } + + return false +} + +// SetDataId gets a reference to the given string and assigns it to the DataId field. +func (o *VulnUpdateNotification) SetDataId(v string) { + o.DataId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetCreatedAt() int32 { + if o == nil || o.CreatedAt == nil { + var ret int32 + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetCreatedAtOk() (*int32, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int32 and assigns it to the CreatedAt field. +func (o *VulnUpdateNotification) SetCreatedAt(v int32) { + o.CreatedAt = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetLastUpdated() int32 { + if o == nil || o.LastUpdated == nil { + var ret int32 + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetLastUpdatedOk() (*int32, bool) { + if o == nil || o.LastUpdated == nil { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasLastUpdated() bool { + if o != nil && o.LastUpdated != nil { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given int32 and assigns it to the LastUpdated field. +func (o *VulnUpdateNotification) SetLastUpdated(v int32) { + o.LastUpdated = &v +} + +// GetRecordStateKey returns the RecordStateKey field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetRecordStateKey() string { + if o == nil || o.RecordStateKey == nil { + var ret string + return ret + } + return *o.RecordStateKey +} + +// GetRecordStateKeyOk returns a tuple with the RecordStateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetRecordStateKeyOk() (*string, bool) { + if o == nil || o.RecordStateKey == nil { + return nil, false + } + return o.RecordStateKey, true +} + +// HasRecordStateKey returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasRecordStateKey() bool { + if o != nil && o.RecordStateKey != nil { + return true + } + + return false +} + +// SetRecordStateKey gets a reference to the given string and assigns it to the RecordStateKey field. +func (o *VulnUpdateNotification) SetRecordStateKey(v string) { + o.RecordStateKey = &v +} + +// GetRecordStateVal returns the RecordStateVal field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VulnUpdateNotification) GetRecordStateVal() string { + if o == nil || o.RecordStateVal.Get() == nil { + var ret string + return ret + } + return *o.RecordStateVal.Get() +} + +// GetRecordStateValOk returns a tuple with the RecordStateVal field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VulnUpdateNotification) GetRecordStateValOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecordStateVal.Get(), o.RecordStateVal.IsSet() +} + +// HasRecordStateVal returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasRecordStateVal() bool { + if o != nil && o.RecordStateVal.IsSet() { + return true + } + + return false +} + +// SetRecordStateVal gets a reference to the given NullableString and assigns it to the RecordStateVal field. +func (o *VulnUpdateNotification) SetRecordStateVal(v string) { + o.RecordStateVal.Set(&v) +} +// SetRecordStateValNil sets the value for RecordStateVal to be an explicit nil +func (o *VulnUpdateNotification) SetRecordStateValNil() { + o.RecordStateVal.Set(nil) +} + +// UnsetRecordStateVal ensures that no value is present for RecordStateVal, not even an explicit nil +func (o *VulnUpdateNotification) UnsetRecordStateVal() { + o.RecordStateVal.Unset() +} + +// GetTries returns the Tries field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetTries() int32 { + if o == nil || o.Tries == nil { + var ret int32 + return ret + } + return *o.Tries +} + +// GetTriesOk returns a tuple with the Tries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetTriesOk() (*int32, bool) { + if o == nil || o.Tries == nil { + return nil, false + } + return o.Tries, true +} + +// HasTries returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasTries() bool { + if o != nil && o.Tries != nil { + return true + } + + return false +} + +// SetTries gets a reference to the given int32 and assigns it to the Tries field. +func (o *VulnUpdateNotification) SetTries(v int32) { + o.Tries = &v +} + +// GetMaxTries returns the MaxTries field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetMaxTries() int32 { + if o == nil || o.MaxTries == nil { + var ret int32 + return ret + } + return *o.MaxTries +} + +// GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetMaxTriesOk() (*int32, bool) { + if o == nil || o.MaxTries == nil { + return nil, false + } + return o.MaxTries, true +} + +// HasMaxTries returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasMaxTries() bool { + if o != nil && o.MaxTries != nil { + return true + } + + return false +} + +// SetMaxTries gets a reference to the given int32 and assigns it to the MaxTries field. +func (o *VulnUpdateNotification) SetMaxTries(v int32) { + o.MaxTries = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *VulnUpdateNotification) GetData() VulnUpdateNotificationData { + if o == nil || o.Data == nil { + var ret VulnUpdateNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotification) GetDataOk() (*VulnUpdateNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *VulnUpdateNotification) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given VulnUpdateNotificationData and assigns it to the Data field. +func (o *VulnUpdateNotification) SetData(v VulnUpdateNotificationData) { + o.Data = &v +} + +func (o VulnUpdateNotification) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.QueueId != nil { + toSerialize["queueId"] = o.QueueId + } + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.DataId != nil { + toSerialize["dataId"] = o.DataId + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.LastUpdated != nil { + toSerialize["last_updated"] = o.LastUpdated + } + if o.RecordStateKey != nil { + toSerialize["record_state_key"] = o.RecordStateKey + } + if o.RecordStateVal.IsSet() { + toSerialize["record_state_val"] = o.RecordStateVal.Get() + } + if o.Tries != nil { + toSerialize["tries"] = o.Tries + } + if o.MaxTries != nil { + toSerialize["max_tries"] = o.MaxTries + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableVulnUpdateNotification struct { + value *VulnUpdateNotification + isSet bool +} + +func (v NullableVulnUpdateNotification) Get() *VulnUpdateNotification { + return v.value +} + +func (v *NullableVulnUpdateNotification) Set(val *VulnUpdateNotification) { + v.value = val + v.isSet = true +} + +func (v NullableVulnUpdateNotification) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnUpdateNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnUpdateNotification(val *VulnUpdateNotification) *NullableVulnUpdateNotification { + return &NullableVulnUpdateNotification{value: val, isSet: true} +} + +func (v NullableVulnUpdateNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnUpdateNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_update_notification_all_of.go b/.gen/anchore/model_vuln_update_notification_all_of.go new file mode 100644 index 0000000000..5660576f03 --- /dev/null +++ b/.gen/anchore/model_vuln_update_notification_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnUpdateNotificationAllOf The Notification Object definition for Tag Update Notifications +type VulnUpdateNotificationAllOf struct { + Data *VulnUpdateNotificationData `json:"data,omitempty"` +} + +// NewVulnUpdateNotificationAllOf instantiates a new VulnUpdateNotificationAllOf 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 NewVulnUpdateNotificationAllOf() *VulnUpdateNotificationAllOf { + this := VulnUpdateNotificationAllOf{} + return &this +} + +// NewVulnUpdateNotificationAllOfWithDefaults instantiates a new VulnUpdateNotificationAllOf 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 NewVulnUpdateNotificationAllOfWithDefaults() *VulnUpdateNotificationAllOf { + this := VulnUpdateNotificationAllOf{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *VulnUpdateNotificationAllOf) GetData() VulnUpdateNotificationData { + if o == nil || o.Data == nil { + var ret VulnUpdateNotificationData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationAllOf) GetDataOk() (*VulnUpdateNotificationData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *VulnUpdateNotificationAllOf) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given VulnUpdateNotificationData and assigns it to the Data field. +func (o *VulnUpdateNotificationAllOf) SetData(v VulnUpdateNotificationData) { + o.Data = &v +} + +func (o VulnUpdateNotificationAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableVulnUpdateNotificationAllOf struct { + value *VulnUpdateNotificationAllOf + isSet bool +} + +func (v NullableVulnUpdateNotificationAllOf) Get() *VulnUpdateNotificationAllOf { + return v.value +} + +func (v *NullableVulnUpdateNotificationAllOf) Set(val *VulnUpdateNotificationAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableVulnUpdateNotificationAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnUpdateNotificationAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnUpdateNotificationAllOf(val *VulnUpdateNotificationAllOf) *NullableVulnUpdateNotificationAllOf { + return &NullableVulnUpdateNotificationAllOf{value: val, isSet: true} +} + +func (v NullableVulnUpdateNotificationAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnUpdateNotificationAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_update_notification_data.go b/.gen/anchore/model_vuln_update_notification_data.go new file mode 100644 index 0000000000..01551cd0d6 --- /dev/null +++ b/.gen/anchore/model_vuln_update_notification_data.go @@ -0,0 +1,224 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnUpdateNotificationData struct for VulnUpdateNotificationData +type VulnUpdateNotificationData struct { + NotificationUser *string `json:"notification_user,omitempty"` + NotificationUserEmail *string `json:"notification_user_email,omitempty"` + NotificationType *string `json:"notification_type,omitempty"` + NotificationPayload *VulnUpdateNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewVulnUpdateNotificationData instantiates a new VulnUpdateNotificationData 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 NewVulnUpdateNotificationData() *VulnUpdateNotificationData { + this := VulnUpdateNotificationData{} + return &this +} + +// NewVulnUpdateNotificationDataWithDefaults instantiates a new VulnUpdateNotificationData 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 NewVulnUpdateNotificationDataWithDefaults() *VulnUpdateNotificationData { + this := VulnUpdateNotificationData{} + return &this +} + +// GetNotificationUser returns the NotificationUser field value if set, zero value otherwise. +func (o *VulnUpdateNotificationData) GetNotificationUser() string { + if o == nil || o.NotificationUser == nil { + var ret string + return ret + } + return *o.NotificationUser +} + +// GetNotificationUserOk returns a tuple with the NotificationUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationData) GetNotificationUserOk() (*string, bool) { + if o == nil || o.NotificationUser == nil { + return nil, false + } + return o.NotificationUser, true +} + +// HasNotificationUser returns a boolean if a field has been set. +func (o *VulnUpdateNotificationData) HasNotificationUser() bool { + if o != nil && o.NotificationUser != nil { + return true + } + + return false +} + +// SetNotificationUser gets a reference to the given string and assigns it to the NotificationUser field. +func (o *VulnUpdateNotificationData) SetNotificationUser(v string) { + o.NotificationUser = &v +} + +// GetNotificationUserEmail returns the NotificationUserEmail field value if set, zero value otherwise. +func (o *VulnUpdateNotificationData) GetNotificationUserEmail() string { + if o == nil || o.NotificationUserEmail == nil { + var ret string + return ret + } + return *o.NotificationUserEmail +} + +// GetNotificationUserEmailOk returns a tuple with the NotificationUserEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationData) GetNotificationUserEmailOk() (*string, bool) { + if o == nil || o.NotificationUserEmail == nil { + return nil, false + } + return o.NotificationUserEmail, true +} + +// HasNotificationUserEmail returns a boolean if a field has been set. +func (o *VulnUpdateNotificationData) HasNotificationUserEmail() bool { + if o != nil && o.NotificationUserEmail != nil { + return true + } + + return false +} + +// SetNotificationUserEmail gets a reference to the given string and assigns it to the NotificationUserEmail field. +func (o *VulnUpdateNotificationData) SetNotificationUserEmail(v string) { + o.NotificationUserEmail = &v +} + +// GetNotificationType returns the NotificationType field value if set, zero value otherwise. +func (o *VulnUpdateNotificationData) GetNotificationType() string { + if o == nil || o.NotificationType == nil { + var ret string + return ret + } + return *o.NotificationType +} + +// GetNotificationTypeOk returns a tuple with the NotificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationData) GetNotificationTypeOk() (*string, bool) { + if o == nil || o.NotificationType == nil { + return nil, false + } + return o.NotificationType, true +} + +// HasNotificationType returns a boolean if a field has been set. +func (o *VulnUpdateNotificationData) HasNotificationType() bool { + if o != nil && o.NotificationType != nil { + return true + } + + return false +} + +// SetNotificationType gets a reference to the given string and assigns it to the NotificationType field. +func (o *VulnUpdateNotificationData) SetNotificationType(v string) { + o.NotificationType = &v +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *VulnUpdateNotificationData) GetNotificationPayload() VulnUpdateNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret VulnUpdateNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationData) GetNotificationPayloadOk() (*VulnUpdateNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *VulnUpdateNotificationData) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given VulnUpdateNotificationPayload and assigns it to the NotificationPayload field. +func (o *VulnUpdateNotificationData) SetNotificationPayload(v VulnUpdateNotificationPayload) { + o.NotificationPayload = &v +} + +func (o VulnUpdateNotificationData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationUser != nil { + toSerialize["notification_user"] = o.NotificationUser + } + if o.NotificationUserEmail != nil { + toSerialize["notification_user_email"] = o.NotificationUserEmail + } + if o.NotificationType != nil { + toSerialize["notification_type"] = o.NotificationType + } + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullableVulnUpdateNotificationData struct { + value *VulnUpdateNotificationData + isSet bool +} + +func (v NullableVulnUpdateNotificationData) Get() *VulnUpdateNotificationData { + return v.value +} + +func (v *NullableVulnUpdateNotificationData) Set(val *VulnUpdateNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableVulnUpdateNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnUpdateNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnUpdateNotificationData(val *VulnUpdateNotificationData) *NullableVulnUpdateNotificationData { + return &NullableVulnUpdateNotificationData{value: val, isSet: true} +} + +func (v NullableVulnUpdateNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnUpdateNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_update_notification_data_all_of.go b/.gen/anchore/model_vuln_update_notification_data_all_of.go new file mode 100644 index 0000000000..61c0dad5d8 --- /dev/null +++ b/.gen/anchore/model_vuln_update_notification_data_all_of.go @@ -0,0 +1,116 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnUpdateNotificationDataAllOf struct for VulnUpdateNotificationDataAllOf +type VulnUpdateNotificationDataAllOf struct { + NotificationPayload *VulnUpdateNotificationPayload `json:"notification_payload,omitempty"` +} + +// NewVulnUpdateNotificationDataAllOf instantiates a new VulnUpdateNotificationDataAllOf 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 NewVulnUpdateNotificationDataAllOf() *VulnUpdateNotificationDataAllOf { + this := VulnUpdateNotificationDataAllOf{} + return &this +} + +// NewVulnUpdateNotificationDataAllOfWithDefaults instantiates a new VulnUpdateNotificationDataAllOf 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 NewVulnUpdateNotificationDataAllOfWithDefaults() *VulnUpdateNotificationDataAllOf { + this := VulnUpdateNotificationDataAllOf{} + return &this +} + +// GetNotificationPayload returns the NotificationPayload field value if set, zero value otherwise. +func (o *VulnUpdateNotificationDataAllOf) GetNotificationPayload() VulnUpdateNotificationPayload { + if o == nil || o.NotificationPayload == nil { + var ret VulnUpdateNotificationPayload + return ret + } + return *o.NotificationPayload +} + +// GetNotificationPayloadOk returns a tuple with the NotificationPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationDataAllOf) GetNotificationPayloadOk() (*VulnUpdateNotificationPayload, bool) { + if o == nil || o.NotificationPayload == nil { + return nil, false + } + return o.NotificationPayload, true +} + +// HasNotificationPayload returns a boolean if a field has been set. +func (o *VulnUpdateNotificationDataAllOf) HasNotificationPayload() bool { + if o != nil && o.NotificationPayload != nil { + return true + } + + return false +} + +// SetNotificationPayload gets a reference to the given VulnUpdateNotificationPayload and assigns it to the NotificationPayload field. +func (o *VulnUpdateNotificationDataAllOf) SetNotificationPayload(v VulnUpdateNotificationPayload) { + o.NotificationPayload = &v +} + +func (o VulnUpdateNotificationDataAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NotificationPayload != nil { + toSerialize["notification_payload"] = o.NotificationPayload + } + return json.Marshal(toSerialize) +} + +type NullableVulnUpdateNotificationDataAllOf struct { + value *VulnUpdateNotificationDataAllOf + isSet bool +} + +func (v NullableVulnUpdateNotificationDataAllOf) Get() *VulnUpdateNotificationDataAllOf { + return v.value +} + +func (v *NullableVulnUpdateNotificationDataAllOf) Set(val *VulnUpdateNotificationDataAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableVulnUpdateNotificationDataAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnUpdateNotificationDataAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnUpdateNotificationDataAllOf(val *VulnUpdateNotificationDataAllOf) *NullableVulnUpdateNotificationDataAllOf { + return &NullableVulnUpdateNotificationDataAllOf{value: val, isSet: true} +} + +func (v NullableVulnUpdateNotificationDataAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnUpdateNotificationDataAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_update_notification_payload.go b/.gen/anchore/model_vuln_update_notification_payload.go new file mode 100644 index 0000000000..e18aa4b4b1 --- /dev/null +++ b/.gen/anchore/model_vuln_update_notification_payload.go @@ -0,0 +1,334 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnUpdateNotificationPayload struct for VulnUpdateNotificationPayload +type VulnUpdateNotificationPayload struct { + UserId *string `json:"userId,omitempty"` + SubscriptionKey *string `json:"subscription_key,omitempty"` + SubscriptionType *string `json:"subscription_type,omitempty"` + NotificationId *string `json:"notificationId,omitempty"` + DiffVulnerabilityResult *VulnDiffResult `json:"diff_vulnerability_result,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewVulnUpdateNotificationPayload instantiates a new VulnUpdateNotificationPayload 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 NewVulnUpdateNotificationPayload() *VulnUpdateNotificationPayload { + this := VulnUpdateNotificationPayload{} + return &this +} + +// NewVulnUpdateNotificationPayloadWithDefaults instantiates a new VulnUpdateNotificationPayload 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 NewVulnUpdateNotificationPayloadWithDefaults() *VulnUpdateNotificationPayload { + this := VulnUpdateNotificationPayload{} + return &this +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayload) GetUserId() string { + if o == nil || o.UserId == nil { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayload) GetUserIdOk() (*string, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasUserId() bool { + if o != nil && o.UserId != nil { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *VulnUpdateNotificationPayload) SetUserId(v string) { + o.UserId = &v +} + +// GetSubscriptionKey returns the SubscriptionKey field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayload) GetSubscriptionKey() string { + if o == nil || o.SubscriptionKey == nil { + var ret string + return ret + } + return *o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayload) GetSubscriptionKeyOk() (*string, bool) { + if o == nil || o.SubscriptionKey == nil { + return nil, false + } + return o.SubscriptionKey, true +} + +// HasSubscriptionKey returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasSubscriptionKey() bool { + if o != nil && o.SubscriptionKey != nil { + return true + } + + return false +} + +// SetSubscriptionKey gets a reference to the given string and assigns it to the SubscriptionKey field. +func (o *VulnUpdateNotificationPayload) SetSubscriptionKey(v string) { + o.SubscriptionKey = &v +} + +// GetSubscriptionType returns the SubscriptionType field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayload) GetSubscriptionType() string { + if o == nil || o.SubscriptionType == nil { + var ret string + return ret + } + return *o.SubscriptionType +} + +// GetSubscriptionTypeOk returns a tuple with the SubscriptionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayload) GetSubscriptionTypeOk() (*string, bool) { + if o == nil || o.SubscriptionType == nil { + return nil, false + } + return o.SubscriptionType, true +} + +// HasSubscriptionType returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasSubscriptionType() bool { + if o != nil && o.SubscriptionType != nil { + return true + } + + return false +} + +// SetSubscriptionType gets a reference to the given string and assigns it to the SubscriptionType field. +func (o *VulnUpdateNotificationPayload) SetSubscriptionType(v string) { + o.SubscriptionType = &v +} + +// GetNotificationId returns the NotificationId field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayload) GetNotificationId() string { + if o == nil || o.NotificationId == nil { + var ret string + return ret + } + return *o.NotificationId +} + +// GetNotificationIdOk returns a tuple with the NotificationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayload) GetNotificationIdOk() (*string, bool) { + if o == nil || o.NotificationId == nil { + return nil, false + } + return o.NotificationId, true +} + +// HasNotificationId returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasNotificationId() bool { + if o != nil && o.NotificationId != nil { + return true + } + + return false +} + +// SetNotificationId gets a reference to the given string and assigns it to the NotificationId field. +func (o *VulnUpdateNotificationPayload) SetNotificationId(v string) { + o.NotificationId = &v +} + +// GetDiffVulnerabilityResult returns the DiffVulnerabilityResult field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayload) GetDiffVulnerabilityResult() VulnDiffResult { + if o == nil || o.DiffVulnerabilityResult == nil { + var ret VulnDiffResult + return ret + } + return *o.DiffVulnerabilityResult +} + +// GetDiffVulnerabilityResultOk returns a tuple with the DiffVulnerabilityResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayload) GetDiffVulnerabilityResultOk() (*VulnDiffResult, bool) { + if o == nil || o.DiffVulnerabilityResult == nil { + return nil, false + } + return o.DiffVulnerabilityResult, true +} + +// HasDiffVulnerabilityResult returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasDiffVulnerabilityResult() bool { + if o != nil && o.DiffVulnerabilityResult != nil { + return true + } + + return false +} + +// SetDiffVulnerabilityResult gets a reference to the given VulnDiffResult and assigns it to the DiffVulnerabilityResult field. +func (o *VulnUpdateNotificationPayload) SetDiffVulnerabilityResult(v VulnDiffResult) { + o.DiffVulnerabilityResult = &v +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayload) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayload) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *VulnUpdateNotificationPayload) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VulnUpdateNotificationPayload) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VulnUpdateNotificationPayload) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayload) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *VulnUpdateNotificationPayload) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o VulnUpdateNotificationPayload) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UserId != nil { + toSerialize["userId"] = o.UserId + } + if o.SubscriptionKey != nil { + toSerialize["subscription_key"] = o.SubscriptionKey + } + if o.SubscriptionType != nil { + toSerialize["subscription_type"] = o.SubscriptionType + } + if o.NotificationId != nil { + toSerialize["notificationId"] = o.NotificationId + } + if o.DiffVulnerabilityResult != nil { + toSerialize["diff_vulnerability_result"] = o.DiffVulnerabilityResult + } + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullableVulnUpdateNotificationPayload struct { + value *VulnUpdateNotificationPayload + isSet bool +} + +func (v NullableVulnUpdateNotificationPayload) Get() *VulnUpdateNotificationPayload { + return v.value +} + +func (v *NullableVulnUpdateNotificationPayload) Set(val *VulnUpdateNotificationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableVulnUpdateNotificationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnUpdateNotificationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnUpdateNotificationPayload(val *VulnUpdateNotificationPayload) *NullableVulnUpdateNotificationPayload { + return &NullableVulnUpdateNotificationPayload{value: val, isSet: true} +} + +func (v NullableVulnUpdateNotificationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnUpdateNotificationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vuln_update_notification_payload_all_of.go b/.gen/anchore/model_vuln_update_notification_payload_all_of.go new file mode 100644 index 0000000000..7dc515a694 --- /dev/null +++ b/.gen/anchore/model_vuln_update_notification_payload_all_of.go @@ -0,0 +1,190 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnUpdateNotificationPayloadAllOf struct for VulnUpdateNotificationPayloadAllOf +type VulnUpdateNotificationPayloadAllOf struct { + DiffVulnerabilityResult *VulnDiffResult `json:"diff_vulnerability_result,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + // List of Corresponding Image Annotations + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// NewVulnUpdateNotificationPayloadAllOf instantiates a new VulnUpdateNotificationPayloadAllOf 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 NewVulnUpdateNotificationPayloadAllOf() *VulnUpdateNotificationPayloadAllOf { + this := VulnUpdateNotificationPayloadAllOf{} + return &this +} + +// NewVulnUpdateNotificationPayloadAllOfWithDefaults instantiates a new VulnUpdateNotificationPayloadAllOf 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 NewVulnUpdateNotificationPayloadAllOfWithDefaults() *VulnUpdateNotificationPayloadAllOf { + this := VulnUpdateNotificationPayloadAllOf{} + return &this +} + +// GetDiffVulnerabilityResult returns the DiffVulnerabilityResult field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayloadAllOf) GetDiffVulnerabilityResult() VulnDiffResult { + if o == nil || o.DiffVulnerabilityResult == nil { + var ret VulnDiffResult + return ret + } + return *o.DiffVulnerabilityResult +} + +// GetDiffVulnerabilityResultOk returns a tuple with the DiffVulnerabilityResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayloadAllOf) GetDiffVulnerabilityResultOk() (*VulnDiffResult, bool) { + if o == nil || o.DiffVulnerabilityResult == nil { + return nil, false + } + return o.DiffVulnerabilityResult, true +} + +// HasDiffVulnerabilityResult returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayloadAllOf) HasDiffVulnerabilityResult() bool { + if o != nil && o.DiffVulnerabilityResult != nil { + return true + } + + return false +} + +// SetDiffVulnerabilityResult gets a reference to the given VulnDiffResult and assigns it to the DiffVulnerabilityResult field. +func (o *VulnUpdateNotificationPayloadAllOf) SetDiffVulnerabilityResult(v VulnDiffResult) { + o.DiffVulnerabilityResult = &v +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *VulnUpdateNotificationPayloadAllOf) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnUpdateNotificationPayloadAllOf) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayloadAllOf) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *VulnUpdateNotificationPayloadAllOf) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VulnUpdateNotificationPayloadAllOf) GetAnnotations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VulnUpdateNotificationPayloadAllOf) GetAnnotationsOk() (map[string]interface{}, bool) { + if o == nil || o.Annotations == nil { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *VulnUpdateNotificationPayloadAllOf) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *VulnUpdateNotificationPayloadAllOf) SetAnnotations(v map[string]interface{}) { + o.Annotations = v +} + +func (o VulnUpdateNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DiffVulnerabilityResult != nil { + toSerialize["diff_vulnerability_result"] = o.DiffVulnerabilityResult + } + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + return json.Marshal(toSerialize) +} + +type NullableVulnUpdateNotificationPayloadAllOf struct { + value *VulnUpdateNotificationPayloadAllOf + isSet bool +} + +func (v NullableVulnUpdateNotificationPayloadAllOf) Get() *VulnUpdateNotificationPayloadAllOf { + return v.value +} + +func (v *NullableVulnUpdateNotificationPayloadAllOf) Set(val *VulnUpdateNotificationPayloadAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableVulnUpdateNotificationPayloadAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnUpdateNotificationPayloadAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnUpdateNotificationPayloadAllOf(val *VulnUpdateNotificationPayloadAllOf) *NullableVulnUpdateNotificationPayloadAllOf { + return &NullableVulnUpdateNotificationPayloadAllOf{value: val, isSet: true} +} + +func (v NullableVulnUpdateNotificationPayloadAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnUpdateNotificationPayloadAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vulnerability.go b/.gen/anchore/model_vulnerability.go index 2ab519af96..a2fb30cbb8 100644 --- a/.gen/anchore/model_vulnerability.go +++ b/.gen/anchore/model_vulnerability.go @@ -1,43 +1,635 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // Vulnerability struct for Vulnerability type Vulnerability struct { // The vulnerability identifier, such as CVE-2017-100, or RHSA-2017123 - Vuln string `json:"vuln,omitempty"` + Vuln *string `json:"vuln,omitempty"` // The package containing a fix, if available - Fix string `json:"fix,omitempty"` + Fix *string `json:"fix,omitempty"` // The severity of the vulnerability - Severity string `json:"severity,omitempty"` + Severity *string `json:"severity,omitempty"` // The package name and version that are vulnerable in the image - Package string `json:"package,omitempty"` + Package *string `json:"package,omitempty"` // The url for more information about the vulnerability - Url string `json:"url,omitempty"` + Url *string `json:"url,omitempty"` // The name of the feed where vulnerability match was made - Feed string `json:"feed,omitempty"` + Feed *string `json:"feed,omitempty"` // The name of the feed group where vulnerability match was made - FeedGroup string `json:"feed_group,omitempty"` + FeedGroup *string `json:"feed_group,omitempty"` // The name of the vulnerable package artifact - PackageName string `json:"package_name,omitempty"` + PackageName *string `json:"package_name,omitempty"` // The version of the vulnerable package artifact - PackageVersion string `json:"package_version,omitempty"` + PackageVersion *string `json:"package_version,omitempty"` // The type of vulnerable package - PackageType string `json:"package_type,omitempty"` + PackageType *string `json:"package_type,omitempty"` // The CPE string (if applicable) describing the package to vulnerability match - PackageCpe string `json:"package_cpe,omitempty"` + PackageCpe *string `json:"package_cpe,omitempty"` // The location (if applicable) of the vulnerable package in the container filesystem - PackagePath string `json:"package_path,omitempty"` + PackagePath *string `json:"package_path,omitempty"` + // Whether a vendor will fix or not fix the vulnerability + WillNotFix *bool `json:"will_not_fix,omitempty"` // List of Nvd Data objects NvdData []NvdDataObject `json:"nvd_data,omitempty"` // List of Vendor Data objects VendorData []VendorDataObject `json:"vendor_data,omitempty"` } + +// NewVulnerability instantiates a new Vulnerability 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 NewVulnerability() *Vulnerability { + this := Vulnerability{} + return &this +} + +// NewVulnerabilityWithDefaults instantiates a new Vulnerability 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 NewVulnerabilityWithDefaults() *Vulnerability { + this := Vulnerability{} + return &this +} + +// GetVuln returns the Vuln field value if set, zero value otherwise. +func (o *Vulnerability) GetVuln() string { + if o == nil || o.Vuln == nil { + var ret string + return ret + } + return *o.Vuln +} + +// GetVulnOk returns a tuple with the Vuln field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetVulnOk() (*string, bool) { + if o == nil || o.Vuln == nil { + return nil, false + } + return o.Vuln, true +} + +// HasVuln returns a boolean if a field has been set. +func (o *Vulnerability) HasVuln() bool { + if o != nil && o.Vuln != nil { + return true + } + + return false +} + +// SetVuln gets a reference to the given string and assigns it to the Vuln field. +func (o *Vulnerability) SetVuln(v string) { + o.Vuln = &v +} + +// GetFix returns the Fix field value if set, zero value otherwise. +func (o *Vulnerability) GetFix() string { + if o == nil || o.Fix == nil { + var ret string + return ret + } + return *o.Fix +} + +// GetFixOk returns a tuple with the Fix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetFixOk() (*string, bool) { + if o == nil || o.Fix == nil { + return nil, false + } + return o.Fix, true +} + +// HasFix returns a boolean if a field has been set. +func (o *Vulnerability) HasFix() bool { + if o != nil && o.Fix != nil { + return true + } + + return false +} + +// SetFix gets a reference to the given string and assigns it to the Fix field. +func (o *Vulnerability) SetFix(v string) { + o.Fix = &v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *Vulnerability) GetSeverity() string { + if o == nil || o.Severity == nil { + var ret string + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetSeverityOk() (*string, bool) { + if o == nil || o.Severity == nil { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *Vulnerability) HasSeverity() bool { + if o != nil && o.Severity != nil { + return true + } + + return false +} + +// SetSeverity gets a reference to the given string and assigns it to the Severity field. +func (o *Vulnerability) SetSeverity(v string) { + o.Severity = &v +} + +// GetPackage returns the Package field value if set, zero value otherwise. +func (o *Vulnerability) GetPackage() string { + if o == nil || o.Package == nil { + var ret string + return ret + } + return *o.Package +} + +// GetPackageOk returns a tuple with the Package field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetPackageOk() (*string, bool) { + if o == nil || o.Package == nil { + return nil, false + } + return o.Package, true +} + +// HasPackage returns a boolean if a field has been set. +func (o *Vulnerability) HasPackage() bool { + if o != nil && o.Package != nil { + return true + } + + return false +} + +// SetPackage gets a reference to the given string and assigns it to the Package field. +func (o *Vulnerability) SetPackage(v string) { + o.Package = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *Vulnerability) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *Vulnerability) HasUrl() bool { + if o != nil && o.Url != nil { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *Vulnerability) SetUrl(v string) { + o.Url = &v +} + +// GetFeed returns the Feed field value if set, zero value otherwise. +func (o *Vulnerability) GetFeed() string { + if o == nil || o.Feed == nil { + var ret string + return ret + } + return *o.Feed +} + +// GetFeedOk returns a tuple with the Feed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetFeedOk() (*string, bool) { + if o == nil || o.Feed == nil { + return nil, false + } + return o.Feed, true +} + +// HasFeed returns a boolean if a field has been set. +func (o *Vulnerability) HasFeed() bool { + if o != nil && o.Feed != nil { + return true + } + + return false +} + +// SetFeed gets a reference to the given string and assigns it to the Feed field. +func (o *Vulnerability) SetFeed(v string) { + o.Feed = &v +} + +// GetFeedGroup returns the FeedGroup field value if set, zero value otherwise. +func (o *Vulnerability) GetFeedGroup() string { + if o == nil || o.FeedGroup == nil { + var ret string + return ret + } + return *o.FeedGroup +} + +// GetFeedGroupOk returns a tuple with the FeedGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetFeedGroupOk() (*string, bool) { + if o == nil || o.FeedGroup == nil { + return nil, false + } + return o.FeedGroup, true +} + +// HasFeedGroup returns a boolean if a field has been set. +func (o *Vulnerability) HasFeedGroup() bool { + if o != nil && o.FeedGroup != nil { + return true + } + + return false +} + +// SetFeedGroup gets a reference to the given string and assigns it to the FeedGroup field. +func (o *Vulnerability) SetFeedGroup(v string) { + o.FeedGroup = &v +} + +// GetPackageName returns the PackageName field value if set, zero value otherwise. +func (o *Vulnerability) GetPackageName() string { + if o == nil || o.PackageName == nil { + var ret string + return ret + } + return *o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetPackageNameOk() (*string, bool) { + if o == nil || o.PackageName == nil { + return nil, false + } + return o.PackageName, true +} + +// HasPackageName returns a boolean if a field has been set. +func (o *Vulnerability) HasPackageName() bool { + if o != nil && o.PackageName != nil { + return true + } + + return false +} + +// SetPackageName gets a reference to the given string and assigns it to the PackageName field. +func (o *Vulnerability) SetPackageName(v string) { + o.PackageName = &v +} + +// GetPackageVersion returns the PackageVersion field value if set, zero value otherwise. +func (o *Vulnerability) GetPackageVersion() string { + if o == nil || o.PackageVersion == nil { + var ret string + return ret + } + return *o.PackageVersion +} + +// GetPackageVersionOk returns a tuple with the PackageVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetPackageVersionOk() (*string, bool) { + if o == nil || o.PackageVersion == nil { + return nil, false + } + return o.PackageVersion, true +} + +// HasPackageVersion returns a boolean if a field has been set. +func (o *Vulnerability) HasPackageVersion() bool { + if o != nil && o.PackageVersion != nil { + return true + } + + return false +} + +// SetPackageVersion gets a reference to the given string and assigns it to the PackageVersion field. +func (o *Vulnerability) SetPackageVersion(v string) { + o.PackageVersion = &v +} + +// GetPackageType returns the PackageType field value if set, zero value otherwise. +func (o *Vulnerability) GetPackageType() string { + if o == nil || o.PackageType == nil { + var ret string + return ret + } + return *o.PackageType +} + +// GetPackageTypeOk returns a tuple with the PackageType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetPackageTypeOk() (*string, bool) { + if o == nil || o.PackageType == nil { + return nil, false + } + return o.PackageType, true +} + +// HasPackageType returns a boolean if a field has been set. +func (o *Vulnerability) HasPackageType() bool { + if o != nil && o.PackageType != nil { + return true + } + + return false +} + +// SetPackageType gets a reference to the given string and assigns it to the PackageType field. +func (o *Vulnerability) SetPackageType(v string) { + o.PackageType = &v +} + +// GetPackageCpe returns the PackageCpe field value if set, zero value otherwise. +func (o *Vulnerability) GetPackageCpe() string { + if o == nil || o.PackageCpe == nil { + var ret string + return ret + } + return *o.PackageCpe +} + +// GetPackageCpeOk returns a tuple with the PackageCpe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetPackageCpeOk() (*string, bool) { + if o == nil || o.PackageCpe == nil { + return nil, false + } + return o.PackageCpe, true +} + +// HasPackageCpe returns a boolean if a field has been set. +func (o *Vulnerability) HasPackageCpe() bool { + if o != nil && o.PackageCpe != nil { + return true + } + + return false +} + +// SetPackageCpe gets a reference to the given string and assigns it to the PackageCpe field. +func (o *Vulnerability) SetPackageCpe(v string) { + o.PackageCpe = &v +} + +// GetPackagePath returns the PackagePath field value if set, zero value otherwise. +func (o *Vulnerability) GetPackagePath() string { + if o == nil || o.PackagePath == nil { + var ret string + return ret + } + return *o.PackagePath +} + +// GetPackagePathOk returns a tuple with the PackagePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetPackagePathOk() (*string, bool) { + if o == nil || o.PackagePath == nil { + return nil, false + } + return o.PackagePath, true +} + +// HasPackagePath returns a boolean if a field has been set. +func (o *Vulnerability) HasPackagePath() bool { + if o != nil && o.PackagePath != nil { + return true + } + + return false +} + +// SetPackagePath gets a reference to the given string and assigns it to the PackagePath field. +func (o *Vulnerability) SetPackagePath(v string) { + o.PackagePath = &v +} + +// GetWillNotFix returns the WillNotFix field value if set, zero value otherwise. +func (o *Vulnerability) GetWillNotFix() bool { + if o == nil || o.WillNotFix == nil { + var ret bool + return ret + } + return *o.WillNotFix +} + +// GetWillNotFixOk returns a tuple with the WillNotFix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetWillNotFixOk() (*bool, bool) { + if o == nil || o.WillNotFix == nil { + return nil, false + } + return o.WillNotFix, true +} + +// HasWillNotFix returns a boolean if a field has been set. +func (o *Vulnerability) HasWillNotFix() bool { + if o != nil && o.WillNotFix != nil { + return true + } + + return false +} + +// SetWillNotFix gets a reference to the given bool and assigns it to the WillNotFix field. +func (o *Vulnerability) SetWillNotFix(v bool) { + o.WillNotFix = &v +} + +// GetNvdData returns the NvdData field value if set, zero value otherwise. +func (o *Vulnerability) GetNvdData() []NvdDataObject { + if o == nil || o.NvdData == nil { + var ret []NvdDataObject + return ret + } + return o.NvdData +} + +// GetNvdDataOk returns a tuple with the NvdData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetNvdDataOk() ([]NvdDataObject, bool) { + if o == nil || o.NvdData == nil { + return nil, false + } + return o.NvdData, true +} + +// HasNvdData returns a boolean if a field has been set. +func (o *Vulnerability) HasNvdData() bool { + if o != nil && o.NvdData != nil { + return true + } + + return false +} + +// SetNvdData gets a reference to the given []NvdDataObject and assigns it to the NvdData field. +func (o *Vulnerability) SetNvdData(v []NvdDataObject) { + o.NvdData = v +} + +// GetVendorData returns the VendorData field value if set, zero value otherwise. +func (o *Vulnerability) GetVendorData() []VendorDataObject { + if o == nil || o.VendorData == nil { + var ret []VendorDataObject + return ret + } + return o.VendorData +} + +// GetVendorDataOk returns a tuple with the VendorData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vulnerability) GetVendorDataOk() ([]VendorDataObject, bool) { + if o == nil || o.VendorData == nil { + return nil, false + } + return o.VendorData, true +} + +// HasVendorData returns a boolean if a field has been set. +func (o *Vulnerability) HasVendorData() bool { + if o != nil && o.VendorData != nil { + return true + } + + return false +} + +// SetVendorData gets a reference to the given []VendorDataObject and assigns it to the VendorData field. +func (o *Vulnerability) SetVendorData(v []VendorDataObject) { + o.VendorData = v +} + +func (o Vulnerability) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Vuln != nil { + toSerialize["vuln"] = o.Vuln + } + if o.Fix != nil { + toSerialize["fix"] = o.Fix + } + if o.Severity != nil { + toSerialize["severity"] = o.Severity + } + if o.Package != nil { + toSerialize["package"] = o.Package + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + if o.Feed != nil { + toSerialize["feed"] = o.Feed + } + if o.FeedGroup != nil { + toSerialize["feed_group"] = o.FeedGroup + } + if o.PackageName != nil { + toSerialize["package_name"] = o.PackageName + } + if o.PackageVersion != nil { + toSerialize["package_version"] = o.PackageVersion + } + if o.PackageType != nil { + toSerialize["package_type"] = o.PackageType + } + if o.PackageCpe != nil { + toSerialize["package_cpe"] = o.PackageCpe + } + if o.PackagePath != nil { + toSerialize["package_path"] = o.PackagePath + } + if o.WillNotFix != nil { + toSerialize["will_not_fix"] = o.WillNotFix + } + if o.NvdData != nil { + toSerialize["nvd_data"] = o.NvdData + } + if o.VendorData != nil { + toSerialize["vendor_data"] = o.VendorData + } + return json.Marshal(toSerialize) +} + +type NullableVulnerability struct { + value *Vulnerability + isSet bool +} + +func (v NullableVulnerability) Get() *Vulnerability { + return v.value +} + +func (v *NullableVulnerability) Set(val *Vulnerability) { + v.value = val + v.isSet = true +} + +func (v NullableVulnerability) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnerability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnerability(val *Vulnerability) *NullableVulnerability { + return &NullableVulnerability{value: val, isSet: true} +} + +func (v NullableVulnerability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnerability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vulnerability_reference.go b/.gen/anchore/model_vulnerability_reference.go new file mode 100644 index 0000000000..10faff0c70 --- /dev/null +++ b/.gen/anchore/model_vulnerability_reference.go @@ -0,0 +1,190 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" +) + +// VulnerabilityReference An external link/reference +type VulnerabilityReference struct { + // The reference source + Source *string `json:"source,omitempty"` + Tags []string `json:"tags,omitempty"` + // The reference url + Url *string `json:"url,omitempty"` +} + +// NewVulnerabilityReference instantiates a new VulnerabilityReference 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 NewVulnerabilityReference() *VulnerabilityReference { + this := VulnerabilityReference{} + return &this +} + +// NewVulnerabilityReferenceWithDefaults instantiates a new VulnerabilityReference 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 NewVulnerabilityReferenceWithDefaults() *VulnerabilityReference { + this := VulnerabilityReference{} + return &this +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *VulnerabilityReference) GetSource() string { + if o == nil || o.Source == nil { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerabilityReference) GetSourceOk() (*string, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *VulnerabilityReference) HasSource() bool { + if o != nil && o.Source != nil { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *VulnerabilityReference) SetSource(v string) { + o.Source = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VulnerabilityReference) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerabilityReference) GetTagsOk() ([]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VulnerabilityReference) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VulnerabilityReference) SetTags(v []string) { + o.Tags = v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *VulnerabilityReference) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerabilityReference) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *VulnerabilityReference) HasUrl() bool { + if o != nil && o.Url != nil { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *VulnerabilityReference) SetUrl(v string) { + o.Url = &v +} + +func (o VulnerabilityReference) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Source != nil { + toSerialize["source"] = o.Source + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableVulnerabilityReference struct { + value *VulnerabilityReference + isSet bool +} + +func (v NullableVulnerabilityReference) Get() *VulnerabilityReference { + return v.value +} + +func (v *NullableVulnerabilityReference) Set(val *VulnerabilityReference) { + v.value = val + v.isSet = true +} + +func (v NullableVulnerabilityReference) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnerabilityReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnerabilityReference(val *VulnerabilityReference) *NullableVulnerabilityReference { + return &NullableVulnerabilityReference{value: val, isSet: true} +} + +func (v NullableVulnerabilityReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnerabilityReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vulnerability_response.go b/.gen/anchore/model_vulnerability_response.go index eae7af97ea..5fcd73ac50 100644 --- a/.gen/anchore/model_vulnerability_response.go +++ b/.gen/anchore/model_vulnerability_response.go @@ -1,19 +1,189 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // VulnerabilityResponse envelope containing list of vulnerabilities type VulnerabilityResponse struct { - ImageDigest string `json:"imageDigest,omitempty"` - VulnerabilityType string `json:"vulnerability_type,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + VulnerabilityType *string `json:"vulnerability_type,omitempty"` // List of Vulnerability objects Vulnerabilities []Vulnerability `json:"vulnerabilities,omitempty"` } + +// NewVulnerabilityResponse instantiates a new VulnerabilityResponse 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 NewVulnerabilityResponse() *VulnerabilityResponse { + this := VulnerabilityResponse{} + return &this +} + +// NewVulnerabilityResponseWithDefaults instantiates a new VulnerabilityResponse 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 NewVulnerabilityResponseWithDefaults() *VulnerabilityResponse { + this := VulnerabilityResponse{} + return &this +} + +// GetImageDigest returns the ImageDigest field value if set, zero value otherwise. +func (o *VulnerabilityResponse) GetImageDigest() string { + if o == nil || o.ImageDigest == nil { + var ret string + return ret + } + return *o.ImageDigest +} + +// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerabilityResponse) GetImageDigestOk() (*string, bool) { + if o == nil || o.ImageDigest == nil { + return nil, false + } + return o.ImageDigest, true +} + +// HasImageDigest returns a boolean if a field has been set. +func (o *VulnerabilityResponse) HasImageDigest() bool { + if o != nil && o.ImageDigest != nil { + return true + } + + return false +} + +// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field. +func (o *VulnerabilityResponse) SetImageDigest(v string) { + o.ImageDigest = &v +} + +// GetVulnerabilityType returns the VulnerabilityType field value if set, zero value otherwise. +func (o *VulnerabilityResponse) GetVulnerabilityType() string { + if o == nil || o.VulnerabilityType == nil { + var ret string + return ret + } + return *o.VulnerabilityType +} + +// GetVulnerabilityTypeOk returns a tuple with the VulnerabilityType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerabilityResponse) GetVulnerabilityTypeOk() (*string, bool) { + if o == nil || o.VulnerabilityType == nil { + return nil, false + } + return o.VulnerabilityType, true +} + +// HasVulnerabilityType returns a boolean if a field has been set. +func (o *VulnerabilityResponse) HasVulnerabilityType() bool { + if o != nil && o.VulnerabilityType != nil { + return true + } + + return false +} + +// SetVulnerabilityType gets a reference to the given string and assigns it to the VulnerabilityType field. +func (o *VulnerabilityResponse) SetVulnerabilityType(v string) { + o.VulnerabilityType = &v +} + +// GetVulnerabilities returns the Vulnerabilities field value if set, zero value otherwise. +func (o *VulnerabilityResponse) GetVulnerabilities() []Vulnerability { + if o == nil || o.Vulnerabilities == nil { + var ret []Vulnerability + return ret + } + return o.Vulnerabilities +} + +// GetVulnerabilitiesOk returns a tuple with the Vulnerabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerabilityResponse) GetVulnerabilitiesOk() ([]Vulnerability, bool) { + if o == nil || o.Vulnerabilities == nil { + return nil, false + } + return o.Vulnerabilities, true +} + +// HasVulnerabilities returns a boolean if a field has been set. +func (o *VulnerabilityResponse) HasVulnerabilities() bool { + if o != nil && o.Vulnerabilities != nil { + return true + } + + return false +} + +// SetVulnerabilities gets a reference to the given []Vulnerability and assigns it to the Vulnerabilities field. +func (o *VulnerabilityResponse) SetVulnerabilities(v []Vulnerability) { + o.Vulnerabilities = v +} + +func (o VulnerabilityResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImageDigest != nil { + toSerialize["imageDigest"] = o.ImageDigest + } + if o.VulnerabilityType != nil { + toSerialize["vulnerability_type"] = o.VulnerabilityType + } + if o.Vulnerabilities != nil { + toSerialize["vulnerabilities"] = o.Vulnerabilities + } + return json.Marshal(toSerialize) +} + +type NullableVulnerabilityResponse struct { + value *VulnerabilityResponse + isSet bool +} + +func (v NullableVulnerabilityResponse) Get() *VulnerabilityResponse { + return v.value +} + +func (v *NullableVulnerabilityResponse) Set(val *VulnerabilityResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVulnerabilityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnerabilityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnerabilityResponse(val *VulnerabilityResponse) *NullableVulnerabilityResponse { + return &NullableVulnerabilityResponse{value: val, isSet: true} +} + +func (v NullableVulnerabilityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnerabilityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vulnerable_image.go b/.gen/anchore/model_vulnerable_image.go index 0dbb51f83f..076b48c313 100644 --- a/.gen/anchore/model_vulnerable_image.go +++ b/.gen/anchore/model_vulnerable_image.go @@ -1,17 +1,152 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // VulnerableImage A record of an image vulnerable to some known vulnerability. Includes vulnerable package information type VulnerableImage struct { - Image ImageReference `json:"image,omitempty"` + Image *ImageReference `json:"image,omitempty"` AffectedPackages []VulnerablePackageReference `json:"affected_packages,omitempty"` } + +// NewVulnerableImage instantiates a new VulnerableImage 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 NewVulnerableImage() *VulnerableImage { + this := VulnerableImage{} + return &this +} + +// NewVulnerableImageWithDefaults instantiates a new VulnerableImage 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 NewVulnerableImageWithDefaults() *VulnerableImage { + this := VulnerableImage{} + return &this +} + +// GetImage returns the Image field value if set, zero value otherwise. +func (o *VulnerableImage) GetImage() ImageReference { + if o == nil || o.Image == nil { + var ret ImageReference + return ret + } + return *o.Image +} + +// GetImageOk returns a tuple with the Image field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerableImage) GetImageOk() (*ImageReference, bool) { + if o == nil || o.Image == nil { + return nil, false + } + return o.Image, true +} + +// HasImage returns a boolean if a field has been set. +func (o *VulnerableImage) HasImage() bool { + if o != nil && o.Image != nil { + return true + } + + return false +} + +// SetImage gets a reference to the given ImageReference and assigns it to the Image field. +func (o *VulnerableImage) SetImage(v ImageReference) { + o.Image = &v +} + +// GetAffectedPackages returns the AffectedPackages field value if set, zero value otherwise. +func (o *VulnerableImage) GetAffectedPackages() []VulnerablePackageReference { + if o == nil || o.AffectedPackages == nil { + var ret []VulnerablePackageReference + return ret + } + return o.AffectedPackages +} + +// GetAffectedPackagesOk returns a tuple with the AffectedPackages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerableImage) GetAffectedPackagesOk() ([]VulnerablePackageReference, bool) { + if o == nil || o.AffectedPackages == nil { + return nil, false + } + return o.AffectedPackages, true +} + +// HasAffectedPackages returns a boolean if a field has been set. +func (o *VulnerableImage) HasAffectedPackages() bool { + if o != nil && o.AffectedPackages != nil { + return true + } + + return false +} + +// SetAffectedPackages gets a reference to the given []VulnerablePackageReference and assigns it to the AffectedPackages field. +func (o *VulnerableImage) SetAffectedPackages(v []VulnerablePackageReference) { + o.AffectedPackages = v +} + +func (o VulnerableImage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Image != nil { + toSerialize["image"] = o.Image + } + if o.AffectedPackages != nil { + toSerialize["affected_packages"] = o.AffectedPackages + } + return json.Marshal(toSerialize) +} + +type NullableVulnerableImage struct { + value *VulnerableImage + isSet bool +} + +func (v NullableVulnerableImage) Get() *VulnerableImage { + return v.value +} + +func (v *NullableVulnerableImage) Set(val *VulnerableImage) { + v.value = val + v.isSet = true +} + +func (v NullableVulnerableImage) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnerableImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnerableImage(val *VulnerableImage) *NullableVulnerableImage { + return &NullableVulnerableImage{value: val, isSet: true} +} + +func (v NullableVulnerableImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnerableImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_vulnerable_package_reference.go b/.gen/anchore/model_vulnerable_package_reference.go index fa4f365757..aec752cd7b 100644 --- a/.gen/anchore/model_vulnerable_package_reference.go +++ b/.gen/anchore/model_vulnerable_package_reference.go @@ -1,25 +1,275 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // VulnerablePackageReference A record of a software item which is vulnerable or carries a fix for a vulnerability type VulnerablePackageReference struct { // Package name - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // A version for the package. If null, then references all versions - Version *string `json:"version,omitempty"` + Version NullableString `json:"version,omitempty"` // Package type (e.g. package, rpm, deb, apk, jar, npm, gem, ...) - Type string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` // Severity of vulnerability affecting package - Severity string `json:"severity,omitempty"` + Severity *string `json:"severity,omitempty"` // Vulnerability namespace of affected package - Namespace string `json:"namespace,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// NewVulnerablePackageReference instantiates a new VulnerablePackageReference 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 NewVulnerablePackageReference() *VulnerablePackageReference { + this := VulnerablePackageReference{} + return &this +} + +// NewVulnerablePackageReferenceWithDefaults instantiates a new VulnerablePackageReference 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 NewVulnerablePackageReferenceWithDefaults() *VulnerablePackageReference { + this := VulnerablePackageReference{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VulnerablePackageReference) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerablePackageReference) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VulnerablePackageReference) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VulnerablePackageReference) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VulnerablePackageReference) GetVersion() string { + if o == nil || o.Version.Get() == nil { + var ret string + return ret + } + return *o.Version.Get() +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VulnerablePackageReference) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Version.Get(), o.Version.IsSet() +} + +// HasVersion returns a boolean if a field has been set. +func (o *VulnerablePackageReference) HasVersion() bool { + if o != nil && o.Version.IsSet() { + return true + } + + return false +} + +// SetVersion gets a reference to the given NullableString and assigns it to the Version field. +func (o *VulnerablePackageReference) SetVersion(v string) { + o.Version.Set(&v) +} +// SetVersionNil sets the value for Version to be an explicit nil +func (o *VulnerablePackageReference) SetVersionNil() { + o.Version.Set(nil) +} + +// UnsetVersion ensures that no value is present for Version, not even an explicit nil +func (o *VulnerablePackageReference) UnsetVersion() { + o.Version.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VulnerablePackageReference) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerablePackageReference) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VulnerablePackageReference) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *VulnerablePackageReference) SetType(v string) { + o.Type = &v } + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *VulnerablePackageReference) GetSeverity() string { + if o == nil || o.Severity == nil { + var ret string + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerablePackageReference) GetSeverityOk() (*string, bool) { + if o == nil || o.Severity == nil { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *VulnerablePackageReference) HasSeverity() bool { + if o != nil && o.Severity != nil { + return true + } + + return false +} + +// SetSeverity gets a reference to the given string and assigns it to the Severity field. +func (o *VulnerablePackageReference) SetSeverity(v string) { + o.Severity = &v +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *VulnerablePackageReference) GetNamespace() string { + if o == nil || o.Namespace == nil { + var ret string + return ret + } + return *o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VulnerablePackageReference) GetNamespaceOk() (*string, bool) { + if o == nil || o.Namespace == nil { + return nil, false + } + return o.Namespace, true +} + +// HasNamespace returns a boolean if a field has been set. +func (o *VulnerablePackageReference) HasNamespace() bool { + if o != nil && o.Namespace != nil { + return true + } + + return false +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *VulnerablePackageReference) SetNamespace(v string) { + o.Namespace = &v +} + +func (o VulnerablePackageReference) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Version.IsSet() { + toSerialize["version"] = o.Version.Get() + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Severity != nil { + toSerialize["severity"] = o.Severity + } + if o.Namespace != nil { + toSerialize["namespace"] = o.Namespace + } + return json.Marshal(toSerialize) +} + +type NullableVulnerablePackageReference struct { + value *VulnerablePackageReference + isSet bool +} + +func (v NullableVulnerablePackageReference) Get() *VulnerablePackageReference { + return v.value +} + +func (v *NullableVulnerablePackageReference) Set(val *VulnerablePackageReference) { + v.value = val + v.isSet = true +} + +func (v NullableVulnerablePackageReference) IsSet() bool { + return v.isSet +} + +func (v *NullableVulnerablePackageReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVulnerablePackageReference(val *VulnerablePackageReference) *NullableVulnerablePackageReference { + return &NullableVulnerablePackageReference{value: val, isSet: true} +} + +func (v NullableVulnerablePackageReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVulnerablePackageReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_whitelist.go b/.gen/anchore/model_whitelist.go index d28a829a68..f0425b5ab8 100644 --- a/.gen/anchore/model_whitelist.go +++ b/.gen/anchore/model_whitelist.go @@ -1,20 +1,246 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" +) + // Whitelist A collection of whitelist items to match a policy evaluation against. type Whitelist struct { Id string `json:"id"` - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Version string `json:"version"` - Comment string `json:"comment,omitempty"` + Comment *string `json:"comment,omitempty"` Items []WhitelistItem `json:"items,omitempty"` } + +// NewWhitelist instantiates a new Whitelist 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 NewWhitelist(id string, version string) *Whitelist { + this := Whitelist{} + this.Id = id + this.Version = version + return &this +} + +// NewWhitelistWithDefaults instantiates a new Whitelist 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 NewWhitelistWithDefaults() *Whitelist { + this := Whitelist{} + return &this +} + +// GetId returns the Id field value +func (o *Whitelist) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Whitelist) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Whitelist) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Whitelist) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Whitelist) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Whitelist) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Whitelist) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value +func (o *Whitelist) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Whitelist) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Whitelist) SetVersion(v string) { + o.Version = v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *Whitelist) GetComment() string { + if o == nil || o.Comment == nil { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Whitelist) GetCommentOk() (*string, bool) { + if o == nil || o.Comment == nil { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *Whitelist) HasComment() bool { + if o != nil && o.Comment != nil { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *Whitelist) SetComment(v string) { + o.Comment = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *Whitelist) GetItems() []WhitelistItem { + if o == nil || o.Items == nil { + var ret []WhitelistItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Whitelist) GetItemsOk() ([]WhitelistItem, bool) { + if o == nil || o.Items == nil { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *Whitelist) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// SetItems gets a reference to the given []WhitelistItem and assigns it to the Items field. +func (o *Whitelist) SetItems(v []WhitelistItem) { + o.Items = v +} + +func (o Whitelist) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if true { + toSerialize["version"] = o.Version + } + if o.Comment != nil { + toSerialize["comment"] = o.Comment + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + return json.Marshal(toSerialize) +} + +type NullableWhitelist struct { + value *Whitelist + isSet bool +} + +func (v NullableWhitelist) Get() *Whitelist { + return v.value +} + +func (v *NullableWhitelist) Set(val *Whitelist) { + v.value = val + v.isSet = true +} + +func (v NullableWhitelist) IsSet() bool { + return v.isSet +} + +func (v *NullableWhitelist) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWhitelist(val *Whitelist) *NullableWhitelist { + return &NullableWhitelist{value: val, isSet: true} +} + +func (v NullableWhitelist) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWhitelist) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/model_whitelist_item.go b/.gen/anchore/model_whitelist_item.go index a26fb8f2e2..2ddff1eb50 100644 --- a/.gen/anchore/model_whitelist_item.go +++ b/.gen/anchore/model_whitelist_item.go @@ -1,18 +1,211 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package anchore + +import ( + "encoding/json" + "time" +) + // WhitelistItem Identifies a specific gate and trigger match from a policy against an image and indicates it should be ignored in final policy decisions type WhitelistItem struct { - Id string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Gate string `json:"gate"` TriggerId string `json:"trigger_id"` + ExpiresOn *time.Time `json:"expires_on,omitempty"` +} + +// NewWhitelistItem instantiates a new WhitelistItem 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 NewWhitelistItem(gate string, triggerId string) *WhitelistItem { + this := WhitelistItem{} + this.Gate = gate + this.TriggerId = triggerId + return &this +} + +// NewWhitelistItemWithDefaults instantiates a new WhitelistItem 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 NewWhitelistItemWithDefaults() *WhitelistItem { + this := WhitelistItem{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *WhitelistItem) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WhitelistItem) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *WhitelistItem) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *WhitelistItem) SetId(v string) { + o.Id = &v +} + +// GetGate returns the Gate field value +func (o *WhitelistItem) GetGate() string { + if o == nil { + var ret string + return ret + } + + return o.Gate +} + +// GetGateOk returns a tuple with the Gate field value +// and a boolean to check if the value has been set. +func (o *WhitelistItem) GetGateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Gate, true +} + +// SetGate sets field value +func (o *WhitelistItem) SetGate(v string) { + o.Gate = v +} + +// GetTriggerId returns the TriggerId field value +func (o *WhitelistItem) GetTriggerId() string { + if o == nil { + var ret string + return ret + } + + return o.TriggerId +} + +// GetTriggerIdOk returns a tuple with the TriggerId field value +// and a boolean to check if the value has been set. +func (o *WhitelistItem) GetTriggerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TriggerId, true +} + +// SetTriggerId sets field value +func (o *WhitelistItem) SetTriggerId(v string) { + o.TriggerId = v +} + +// GetExpiresOn returns the ExpiresOn field value if set, zero value otherwise. +func (o *WhitelistItem) GetExpiresOn() time.Time { + if o == nil || o.ExpiresOn == nil { + var ret time.Time + return ret + } + return *o.ExpiresOn +} + +// GetExpiresOnOk returns a tuple with the ExpiresOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WhitelistItem) GetExpiresOnOk() (*time.Time, bool) { + if o == nil || o.ExpiresOn == nil { + return nil, false + } + return o.ExpiresOn, true +} + +// HasExpiresOn returns a boolean if a field has been set. +func (o *WhitelistItem) HasExpiresOn() bool { + if o != nil && o.ExpiresOn != nil { + return true + } + + return false +} + +// SetExpiresOn gets a reference to the given time.Time and assigns it to the ExpiresOn field. +func (o *WhitelistItem) SetExpiresOn(v time.Time) { + o.ExpiresOn = &v +} + +func (o WhitelistItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["gate"] = o.Gate + } + if true { + toSerialize["trigger_id"] = o.TriggerId + } + if o.ExpiresOn != nil { + toSerialize["expires_on"] = o.ExpiresOn + } + return json.Marshal(toSerialize) +} + +type NullableWhitelistItem struct { + value *WhitelistItem + isSet bool +} + +func (v NullableWhitelistItem) Get() *WhitelistItem { + return v.value +} + +func (v *NullableWhitelistItem) Set(val *WhitelistItem) { + v.value = val + v.isSet = true +} + +func (v NullableWhitelistItem) IsSet() bool { + return v.isSet +} + +func (v *NullableWhitelistItem) Unset() { + v.value = nil + v.isSet = false } + +func NewNullableWhitelistItem(val *WhitelistItem) *NullableWhitelistItem { + return &NullableWhitelistItem{value: val, isSet: true} +} + +func (v NullableWhitelistItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWhitelistItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/anchore/response.go b/.gen/anchore/response.go index adc92619ae..ae5abda7b4 100644 --- a/.gen/anchore/response.go +++ b/.gen/anchore/response.go @@ -1,11 +1,11 @@ /* - * Anchore Engine API Server - * - * This is the Anchore Engine API. Provides the primary external API for users of the service. - * - * API version: 0.1.12 - * Contact: nurmi@anchore.com - */ +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -33,7 +33,7 @@ type APIResponse struct { Payload []byte `json:"-"` } -// NewAPIResponse returns a new APIResonse object. +// NewAPIResponse returns a new APIResponse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} diff --git a/.gen/anchore/utils.go b/.gen/anchore/utils.go new file mode 100644 index 0000000000..d88f80488b --- /dev/null +++ b/.gen/anchore/utils.go @@ -0,0 +1,329 @@ +/* +Anchore Engine API Server + +This is the Anchore Engine API. Provides the primary external API for users of the service. + +API version: 0.1.20 +Contact: nurmi@anchore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package anchore + +import ( + "encoding/json" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/.gen/cloudinfo/.openapi-generator/FILES b/.gen/cloudinfo/.openapi-generator/FILES new file mode 100644 index 0000000000..e38adace29 --- /dev/null +++ b/.gen/cloudinfo/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_continents.go +api_images.go +api_products.go +api_provider.go +api_providers.go +api_region.go +api_regions.go +api_service.go +api_services.go +api_versions.go +client.go +configuration.go +docs/AttributeResponse.md +docs/Continent.md +docs/ContinentsApi.md +docs/GetRegionResp.md +docs/Image.md +docs/ImagesApi.md +docs/LocationVersion.md +docs/ProductDetails.md +docs/ProductDetailsResponse.md +docs/ProductsApi.md +docs/Provider.md +docs/ProviderApi.md +docs/ProviderResponse.md +docs/ProvidersApi.md +docs/ProvidersResponse.md +docs/Region.md +docs/RegionApi.md +docs/RegionsApi.md +docs/Service.md +docs/ServiceApi.md +docs/ServiceResponse.md +docs/ServicesApi.md +docs/ServicesResponse.md +docs/VersionsApi.md +docs/ZonePrice.md +git_push.sh +go.mod +go.sum +model_attribute_response.go +model_continent.go +model_get_region_resp.go +model_image.go +model_location_version.go +model_product_details.go +model_product_details_response.go +model_provider.go +model_provider_response.go +model_providers_response.go +model_region.go +model_service.go +model_service_response.go +model_services_response.go +model_zone_price.go +response.go +utils.go diff --git a/.gen/cloudinfo/.openapi-generator/VERSION b/.gen/cloudinfo/.openapi-generator/VERSION index ecedc98d1d..4ac4fded49 100644 --- a/.gen/cloudinfo/.openapi-generator/VERSION +++ b/.gen/cloudinfo/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1 \ No newline at end of file +6.2.0 \ No newline at end of file diff --git a/.gen/cloudinfo/BUILD.plz b/.gen/cloudinfo/BUILD.plz index 1992e846a6..93792609e0 100644 --- a/.gen/cloudinfo/BUILD.plz +++ b/.gen/cloudinfo/BUILD.plz @@ -3,7 +3,6 @@ go_library( srcs = glob(["*.go"], exclude = ["*_test.go"]), visibility = ["PUBLIC"], deps = [ - "//third_party/go:github.com__antihax__optional", "//third_party/go:golang.org__x__oauth2", ], ) diff --git a/.gen/cloudinfo/README.md b/.gen/cloudinfo/README.md index 9d35d4bea7..e0edb20143 100644 --- a/.gen/cloudinfo/README.md +++ b/.gen/cloudinfo/README.md @@ -18,18 +18,64 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import "./cloudinfo" +import cloudinfo "github.com/GIT_USER_ID/GIT_REPO_ID" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cloudinfo.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cloudinfo.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cloudinfo.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cloudinfo.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) ``` ## Documentation for API Endpoints -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -70,6 +116,21 @@ Class | Method | HTTP request | Description Endpoints do not require authorization. +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` ## Author diff --git a/.gen/cloudinfo/api_continents.go b/.gen/cloudinfo/api_continents.go index 43a88ee458..cbb0c644a6 100644 --- a/.gen/cloudinfo/api_continents.go +++ b/.gen/cloudinfo/api_continents.go @@ -1,53 +1,73 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ContinentsApiService ContinentsApi service type ContinentsApiService service +type ApiGetContinentsRequest struct { + ctx context.Context + ApiService *ContinentsApiService +} + +func (r ApiGetContinentsRequest) Execute() ([]string, *http.Response, error) { + return r.ApiService.GetContinentsExecute(r) +} + /* GetContinents Method for GetContinents + Returns the supported continents - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return []string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetContinentsRequest */ -func (a *ContinentsApiService) GetContinents(ctx _context.Context) ([]string, *_nethttp.Response, error) { +func (a *ContinentsApiService) GetContinents(ctx context.Context) ApiGetContinentsRequest { + return ApiGetContinentsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []string +func (a *ContinentsApiService) GetContinentsExecute(r ApiGetContinentsRequest) ([]string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/continents" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ContinentsApiService.GetContinents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/continents" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -66,24 +86,25 @@ func (a *ContinentsApiService) GetContinents(ctx _context.Context) ([]string, *_ if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -92,7 +113,7 @@ func (a *ContinentsApiService) GetContinents(ctx _context.Context) ([]string, *_ err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -102,33 +123,58 @@ func (a *ContinentsApiService) GetContinents(ctx _context.Context) ([]string, *_ return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetContinentsDataRequest struct { + ctx context.Context + ApiService *ContinentsApiService + provider string + service string +} + +func (r ApiGetContinentsDataRequest) Execute() ([]Continent, *http.Response, error) { + return r.ApiService.GetContinentsDataExecute(r) +} + /* GetContinentsData Method for GetContinentsData + Provides the list of available continents and regions of a cloud provider - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service -@return []Continent + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @return ApiGetContinentsDataRequest */ -func (a *ContinentsApiService) GetContinentsData(ctx _context.Context, provider string, service string) ([]Continent, *_nethttp.Response, error) { +func (a *ContinentsApiService) GetContinentsData(ctx context.Context, provider string, service string) ApiGetContinentsDataRequest { + return ApiGetContinentsDataRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + } +} + +// Execute executes the request +// @return []Continent +func (a *ContinentsApiService) GetContinentsDataExecute(r ApiGetContinentsDataRequest) ([]Continent, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Continent ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}/continents" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ContinentsApiService.GetContinentsData") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}/continents" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -147,24 +193,25 @@ func (a *ContinentsApiService) GetContinentsData(ctx _context.Context, provider if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -173,7 +220,7 @@ func (a *ContinentsApiService) GetContinentsData(ctx _context.Context, provider err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_images.go b/.gen/cloudinfo/api_images.go index 6ad0ec27b8..bd99541e60 100644 --- a/.gen/cloudinfo/api_images.go +++ b/.gen/cloudinfo/api_images.go @@ -1,97 +1,137 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" - "github.com/antihax/optional" ) -// Linger please -var ( - _ _context.Context -) // ImagesApiService ImagesApi service type ImagesApiService service -// GetImagesOpts Optional parameters for the method 'GetImages' -type GetImagesOpts struct { - Gpu optional.String - Cr optional.String - Version optional.String - Os optional.String - PkeVersion optional.String - LatestOnly optional.String +type ApiGetImagesRequest struct { + ctx context.Context + ApiService *ImagesApiService + provider string + service string + region string + gpu *string + cr *string + version *string + os *string + pkeVersion *string + latestOnly *string +} + +func (r ApiGetImagesRequest) Gpu(gpu string) ApiGetImagesRequest { + r.gpu = &gpu + return r +} + +func (r ApiGetImagesRequest) Cr(cr string) ApiGetImagesRequest { + r.cr = &cr + return r +} + +func (r ApiGetImagesRequest) Version(version string) ApiGetImagesRequest { + r.version = &version + return r +} + +func (r ApiGetImagesRequest) Os(os string) ApiGetImagesRequest { + r.os = &os + return r +} + +func (r ApiGetImagesRequest) PkeVersion(pkeVersion string) ApiGetImagesRequest { + r.pkeVersion = &pkeVersion + return r +} + +func (r ApiGetImagesRequest) LatestOnly(latestOnly string) ApiGetImagesRequest { + r.latestOnly = &latestOnly + return r +} + +func (r ApiGetImagesRequest) Execute() ([]Image, *http.Response, error) { + return r.ApiService.GetImagesExecute(r) } /* GetImages Provides a list of available images on a given provider in a specific region for a service. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service - * @param region - * @param optional nil or *GetImagesOpts - Optional Parameters: - * @param "Gpu" (optional.String) - - * @param "Cr" (optional.String) - - * @param "Version" (optional.String) - - * @param "Os" (optional.String) - - * @param "PkeVersion" (optional.String) - - * @param "LatestOnly" (optional.String) - -@return []Image + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @param region + @return ApiGetImagesRequest */ -func (a *ImagesApiService) GetImages(ctx _context.Context, provider string, service string, region string, localVarOptionals *GetImagesOpts) ([]Image, *_nethttp.Response, error) { +func (a *ImagesApiService) GetImages(ctx context.Context, provider string, service string, region string) ApiGetImagesRequest { + return ApiGetImagesRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + region: region, + } +} + +// Execute executes the request +// @return []Image +func (a *ImagesApiService) GetImagesExecute(r ApiGetImagesRequest) ([]Image, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Image ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}/regions/{region}/images" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) - - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.GetImages") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", _neturl.QueryEscape(parameterToString(region, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}/regions/{region}/images" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterToString(r.region, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if localVarOptionals != nil && localVarOptionals.Gpu.IsSet() { - localVarQueryParams.Add("gpu", parameterToString(localVarOptionals.Gpu.Value(), "")) + if r.gpu != nil { + localVarQueryParams.Add("gpu", parameterToString(*r.gpu, "")) } - if localVarOptionals != nil && localVarOptionals.Cr.IsSet() { - localVarQueryParams.Add("cr", parameterToString(localVarOptionals.Cr.Value(), "")) + if r.cr != nil { + localVarQueryParams.Add("cr", parameterToString(*r.cr, "")) } - if localVarOptionals != nil && localVarOptionals.Version.IsSet() { - localVarQueryParams.Add("version", parameterToString(localVarOptionals.Version.Value(), "")) + if r.version != nil { + localVarQueryParams.Add("version", parameterToString(*r.version, "")) } - if localVarOptionals != nil && localVarOptionals.Os.IsSet() { - localVarQueryParams.Add("os", parameterToString(localVarOptionals.Os.Value(), "")) + if r.os != nil { + localVarQueryParams.Add("os", parameterToString(*r.os, "")) } - if localVarOptionals != nil && localVarOptionals.PkeVersion.IsSet() { - localVarQueryParams.Add("pkeVersion", parameterToString(localVarOptionals.PkeVersion.Value(), "")) + if r.pkeVersion != nil { + localVarQueryParams.Add("pkeVersion", parameterToString(*r.pkeVersion, "")) } - if localVarOptionals != nil && localVarOptionals.LatestOnly.IsSet() { - localVarQueryParams.Add("latestOnly", parameterToString(localVarOptionals.LatestOnly.Value(), "")) + if r.latestOnly != nil { + localVarQueryParams.Add("latestOnly", parameterToString(*r.latestOnly, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -110,24 +150,25 @@ func (a *ImagesApiService) GetImages(ctx _context.Context, provider string, serv if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -136,7 +177,7 @@ func (a *ImagesApiService) GetImages(ctx _context.Context, provider string, serv err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_products.go b/.gen/cloudinfo/api_products.go index d7a2124b2f..b888293741 100644 --- a/.gen/cloudinfo/api_products.go +++ b/.gen/cloudinfo/api_products.go @@ -1,61 +1,83 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ProductsApiService ProductsApi service type ProductsApiService service +type ApiGetProductsRequest struct { + ctx context.Context + ApiService *ProductsApiService + provider string + service string + region string +} + +func (r ApiGetProductsRequest) Execute() (*ProductDetailsResponse, *http.Response, error) { + return r.ApiService.GetProductsExecute(r) +} + /* GetProducts Provides a list of available machine types on a given provider in a specific region. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service - * @param region -@return ProductDetailsResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @param region + @return ApiGetProductsRequest */ -func (a *ProductsApiService) GetProducts(ctx _context.Context, provider string, service string, region string) (ProductDetailsResponse, *_nethttp.Response, error) { +func (a *ProductsApiService) GetProducts(ctx context.Context, provider string, service string, region string) ApiGetProductsRequest { + return ApiGetProductsRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + region: region, + } +} + +// Execute executes the request +// @return ProductDetailsResponse +func (a *ProductsApiService) GetProductsExecute(r ApiGetProductsRequest) (*ProductDetailsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ProductDetailsResponse + formFiles []formFile + localVarReturnValue *ProductDetailsResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}/regions/{region}/products" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) - - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProductsApiService.GetProducts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", _neturl.QueryEscape(parameterToString(region, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}/regions/{region}/products" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterToString(r.region, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -74,24 +96,25 @@ func (a *ProductsApiService) GetProducts(ctx _context.Context, provider string, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -100,7 +123,7 @@ func (a *ProductsApiService) GetProducts(ctx _context.Context, provider string, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_provider.go b/.gen/cloudinfo/api_provider.go index cbb1b14751..0ffaff5316 100644 --- a/.gen/cloudinfo/api_provider.go +++ b/.gen/cloudinfo/api_provider.go @@ -1,56 +1,77 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ProviderApiService ProviderApi service type ProviderApiService service +type ApiGetProviderRequest struct { + ctx context.Context + ApiService *ProviderApiService + provider string +} + +func (r ApiGetProviderRequest) Execute() (*ProviderResponse, *http.Response, error) { + return r.ApiService.GetProviderExecute(r) +} + /* GetProvider Method for GetProvider + Returns the requested provider - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider -@return ProviderResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @return ApiGetProviderRequest */ -func (a *ProviderApiService) GetProvider(ctx _context.Context, provider string) (ProviderResponse, *_nethttp.Response, error) { +func (a *ProviderApiService) GetProvider(ctx context.Context, provider string) ApiGetProviderRequest { + return ApiGetProviderRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + } +} + +// Execute executes the request +// @return ProviderResponse +func (a *ProviderApiService) GetProviderExecute(r ApiGetProviderRequest) (*ProviderResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ProviderResponse + formFiles []formFile + localVarReturnValue *ProviderResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.GetProvider") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/{provider}" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -69,24 +90,25 @@ func (a *ProviderApiService) GetProvider(ctx _context.Context, provider string) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -95,7 +117,7 @@ func (a *ProviderApiService) GetProvider(ctx _context.Context, provider string) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_providers.go b/.gen/cloudinfo/api_providers.go index 5d637336fa..97694c4cef 100644 --- a/.gen/cloudinfo/api_providers.go +++ b/.gen/cloudinfo/api_providers.go @@ -1,52 +1,72 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) // ProvidersApiService ProvidersApi service type ProvidersApiService service +type ApiGetProvidersRequest struct { + ctx context.Context + ApiService *ProvidersApiService +} + +func (r ApiGetProvidersRequest) Execute() (*ProvidersResponse, *http.Response, error) { + return r.ApiService.GetProvidersExecute(r) +} + /* GetProviders Method for GetProviders + Returns the supported providers - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return ProvidersResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetProvidersRequest */ -func (a *ProvidersApiService) GetProviders(ctx _context.Context) (ProvidersResponse, *_nethttp.Response, error) { +func (a *ProvidersApiService) GetProviders(ctx context.Context) ApiGetProvidersRequest { + return ApiGetProvidersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ProvidersResponse +func (a *ProvidersApiService) GetProvidersExecute(r ApiGetProvidersRequest) (*ProvidersResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ProvidersResponse + formFiles []formFile + localVarReturnValue *ProvidersResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersApiService.GetProviders") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers" + localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -65,24 +85,25 @@ func (a *ProvidersApiService) GetProviders(ctx _context.Context) (ProvidersRespo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -91,7 +112,7 @@ func (a *ProvidersApiService) GetProviders(ctx _context.Context) (ProvidersRespo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_region.go b/.gen/cloudinfo/api_region.go index 810c1b461a..e7915a6015 100644 --- a/.gen/cloudinfo/api_region.go +++ b/.gen/cloudinfo/api_region.go @@ -1,62 +1,85 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // RegionApiService RegionApi service type RegionApiService service +type ApiGetRegionRequest struct { + ctx context.Context + ApiService *RegionApiService + provider string + service string + region string +} + +func (r ApiGetRegionRequest) Execute() (*GetRegionResp, *http.Response, error) { + return r.ApiService.GetRegionExecute(r) +} + /* GetRegion Method for GetRegion + Provides the detailed info of a specific region of a cloud provider - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service - * @param region -@return GetRegionResp + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @param region + @return ApiGetRegionRequest */ -func (a *RegionApiService) GetRegion(ctx _context.Context, provider string, service string, region string) (GetRegionResp, *_nethttp.Response, error) { +func (a *RegionApiService) GetRegion(ctx context.Context, provider string, service string, region string) ApiGetRegionRequest { + return ApiGetRegionRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + region: region, + } +} + +// Execute executes the request +// @return GetRegionResp +func (a *RegionApiService) GetRegionExecute(r ApiGetRegionRequest) (*GetRegionResp, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue GetRegionResp + formFiles []formFile + localVarReturnValue *GetRegionResp ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}/regions/{region}" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) - - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegionApiService.GetRegion") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", _neturl.QueryEscape(parameterToString(region, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterToString(r.region, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -75,24 +98,25 @@ func (a *RegionApiService) GetRegion(ctx _context.Context, provider string, serv if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -101,7 +125,7 @@ func (a *RegionApiService) GetRegion(ctx _context.Context, provider string, serv err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_regions.go b/.gen/cloudinfo/api_regions.go index 391a642493..238ec63bbb 100644 --- a/.gen/cloudinfo/api_regions.go +++ b/.gen/cloudinfo/api_regions.go @@ -1,59 +1,81 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // RegionsApiService RegionsApi service type RegionsApiService service +type ApiGetRegionsRequest struct { + ctx context.Context + ApiService *RegionsApiService + provider string + service string +} + +func (r ApiGetRegionsRequest) Execute() ([]Region, *http.Response, error) { + return r.ApiService.GetRegionsExecute(r) +} + /* GetRegions Method for GetRegions + Provides the list of available regions of a cloud provider - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service -@return []Region + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @return ApiGetRegionsRequest */ -func (a *RegionsApiService) GetRegions(ctx _context.Context, provider string, service string) ([]Region, *_nethttp.Response, error) { +func (a *RegionsApiService) GetRegions(ctx context.Context, provider string, service string) ApiGetRegionsRequest { + return ApiGetRegionsRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + } +} + +// Execute executes the request +// @return []Region +func (a *RegionsApiService) GetRegionsExecute(r ApiGetRegionsRequest) ([]Region, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Region ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}/regions" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RegionsApiService.GetRegions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}/regions" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -72,24 +94,25 @@ func (a *RegionsApiService) GetRegions(ctx _context.Context, provider string, se if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -98,7 +121,7 @@ func (a *RegionsApiService) GetRegions(ctx _context.Context, provider string, se err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_service.go b/.gen/cloudinfo/api_service.go index ce6844d9ec..16e780a37e 100644 --- a/.gen/cloudinfo/api_service.go +++ b/.gen/cloudinfo/api_service.go @@ -1,59 +1,81 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ServiceApiService ServiceApi service type ServiceApiService service +type ApiGetServiceRequest struct { + ctx context.Context + ApiService *ServiceApiService + provider string + service string +} + +func (r ApiGetServiceRequest) Execute() (*ServiceResponse, *http.Response, error) { + return r.ApiService.GetServiceExecute(r) +} + /* GetService Method for GetService + Provides service details for the given service on the provider in the given region - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service -@return ServiceResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @return ApiGetServiceRequest */ -func (a *ServiceApiService) GetService(ctx _context.Context, provider string, service string) (ServiceResponse, *_nethttp.Response, error) { +func (a *ServiceApiService) GetService(ctx context.Context, provider string, service string) ApiGetServiceRequest { + return ApiGetServiceRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + } +} + +// Execute executes the request +// @return ServiceResponse +func (a *ServiceApiService) GetServiceExecute(r ApiGetServiceRequest) (*ServiceResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ServiceResponse + formFiles []formFile + localVarReturnValue *ServiceResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.GetService") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -72,24 +94,25 @@ func (a *ServiceApiService) GetService(ctx _context.Context, provider string, se if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -98,7 +121,7 @@ func (a *ServiceApiService) GetService(ctx _context.Context, provider string, se err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_services.go b/.gen/cloudinfo/api_services.go index 36dc389e2b..d6eeafa3b5 100644 --- a/.gen/cloudinfo/api_services.go +++ b/.gen/cloudinfo/api_services.go @@ -1,56 +1,77 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // ServicesApiService ServicesApi service type ServicesApiService service +type ApiGetServicesRequest struct { + ctx context.Context + ApiService *ServicesApiService + provider string +} + +func (r ApiGetServicesRequest) Execute() (*ServicesResponse, *http.Response, error) { + return r.ApiService.GetServicesExecute(r) +} + /* GetServices Method for GetServices + Provides a list with the available services for the provider - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider -@return ServicesResponse + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @return ApiGetServicesRequest */ -func (a *ServicesApiService) GetServices(ctx _context.Context, provider string) (ServicesResponse, *_nethttp.Response, error) { +func (a *ServicesApiService) GetServices(ctx context.Context, provider string) ApiGetServicesRequest { + return ApiGetServicesRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + } +} + +// Execute executes the request +// @return ServicesResponse +func (a *ServicesApiService) GetServicesExecute(r ApiGetServicesRequest) (*ServicesResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ServicesResponse + formFiles []formFile + localVarReturnValue *ServicesResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesApiService.GetServices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/{provider}/services" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -69,24 +90,25 @@ func (a *ServicesApiService) GetServices(ctx _context.Context, provider string) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -95,7 +117,7 @@ func (a *ServicesApiService) GetServices(ctx _context.Context, provider string) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/api_versions.go b/.gen/cloudinfo/api_versions.go index 074668df5d..4e8fbd0860 100644 --- a/.gen/cloudinfo/api_versions.go +++ b/.gen/cloudinfo/api_versions.go @@ -1,61 +1,83 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) // VersionsApiService VersionsApi service type VersionsApiService service +type ApiGetVersionsRequest struct { + ctx context.Context + ApiService *VersionsApiService + provider string + service string + region string +} + +func (r ApiGetVersionsRequest) Execute() ([]LocationVersion, *http.Response, error) { + return r.ApiService.GetVersionsExecute(r) +} + /* GetVersions Provides a list of available versions on a given provider in a specific region for a service. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param provider - * @param service - * @param region -@return []LocationVersion + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param provider + @param service + @param region + @return ApiGetVersionsRequest */ -func (a *VersionsApiService) GetVersions(ctx _context.Context, provider string, service string, region string) ([]LocationVersion, *_nethttp.Response, error) { +func (a *VersionsApiService) GetVersions(ctx context.Context, provider string, service string, region string) ApiGetVersionsRequest { + return ApiGetVersionsRequest{ + ApiService: a, + ctx: ctx, + provider: provider, + service: service, + region: region, + } +} + +// Execute executes the request +// @return []LocationVersion +func (a *VersionsApiService) GetVersionsExecute(r ApiGetVersionsRequest) ([]LocationVersion, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []LocationVersion ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider}/services/{service}/regions/{region}/versions" - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", _neturl.QueryEscape(parameterToString(provider, "")) , -1) - - localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.QueryEscape(parameterToString(service, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VersionsApiService.GetVersions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", _neturl.QueryEscape(parameterToString(region, "")) , -1) + localVarPath := localBasePath + "/providers/{provider}/services/{service}/regions/{region}/versions" + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterToString(r.provider, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", url.PathEscape(parameterToString(r.service, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterToString(r.region, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -74,24 +96,25 @@ func (a *VersionsApiService) GetVersions(ctx _context.Context, provider string, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -100,7 +123,7 @@ func (a *VersionsApiService) GetVersions(ctx _context.Context, provider string, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/.gen/cloudinfo/client.go b/.gen/cloudinfo/client.go index 2951456cdd..d926326cf6 100644 --- a/.gen/cloudinfo/client.go +++ b/.gen/cloudinfo/client.go @@ -1,11 +1,11 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -129,10 +129,10 @@ func selectHeaderAccept(accepts []string) string { return strings.Join(accepts, ",") } -// contains is a case insenstive match, finding needle in a haystack +// contains is a case insensitive match, finding needle in a haystack func contains(haystack []string, needle string) bool { for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { + if strings.EqualFold(a, needle) { return true } } @@ -186,13 +186,12 @@ func parameterToJson(obj interface{}) (string, error) { return string(jsonBuf), err } - // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } @@ -209,21 +208,21 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } log.Printf("\n%s\n", string(dump)) } - return resp, err } -// ChangeBasePath changes base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -232,9 +231,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -253,7 +250,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -272,16 +269,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } @@ -344,7 +342,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } @@ -384,7 +382,6 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - return localVarRequest, nil } @@ -402,6 +399,9 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = (*f).Write(b) + if err != nil { + return + } _, err = (*f).Seek(0, io.SeekStart) return } @@ -412,7 +412,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if err = json.Unmarshal(b, v); err != nil { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil @@ -422,11 +430,14 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() if err != nil { return err } - defer file.Close() part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { @@ -442,6 +453,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { @@ -450,6 +468,8 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e if reader, ok := body.(io.Reader); ok { _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(**os.File); ok { + _, err = bodyBuf.ReadFrom(*fp) } else if b, ok := body.([]byte); ok { _, err = bodyBuf.Write(b) } else if s, ok := body.(string); ok { diff --git a/.gen/cloudinfo/configuration.go b/.gen/cloudinfo/configuration.go index 33abc2b03e..f26a99b16f 100644 --- a/.gen/cloudinfo/configuration.go +++ b/.gen/cloudinfo/configuration.go @@ -1,17 +1,18 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo import ( + "context" "fmt" "net/http" "strings" @@ -37,9 +38,23 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -54,7 +69,6 @@ type APIKey struct { Prefix string } - // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -64,36 +78,40 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - Url string + URL string Description string Variables map[string]ServerVariable } +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + // Configuration stores the configuration of the API client type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers []ServerConfiguration - HTTPClient *http.Client + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client } // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://localhost/api/v1", - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: []ServerConfiguration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ { - Url: "/api/v1", + URL: "/api/v1", Description: "No description provided", }, }, + OperationServers: map[string]ServerConfigurations{ + }, } return cfg } @@ -103,13 +121,13 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } -// ServerUrl returns URL based on server settings -func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { - if index < 0 || len(c.Servers) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) } - server := c.Servers[index] - url := server.Url + server := sc[index] + url := server.URL // go through variables and replace placeholders for name, variable := range server.Variables { @@ -130,3 +148,84 @@ func (c *Configuration) ServerUrl(index int, variables map[string]string) (strin } return url, nil } + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/.gen/cloudinfo/model_attribute_response.go b/.gen/cloudinfo/model_attribute_response.go index 53c78b4ce2..8809fb394b 100644 --- a/.gen/cloudinfo/model_attribute_response.go +++ b/.gen/cloudinfo/model_attribute_response.go @@ -1,17 +1,152 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // AttributeResponse AttributeResponse holds attribute values type AttributeResponse struct { - AttributeName string `json:"attributeName,omitempty"` + AttributeName *string `json:"attributeName,omitempty"` AttributeValues []float64 `json:"attributeValues,omitempty"` } + +// NewAttributeResponse instantiates a new AttributeResponse 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 NewAttributeResponse() *AttributeResponse { + this := AttributeResponse{} + return &this +} + +// NewAttributeResponseWithDefaults instantiates a new AttributeResponse 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 NewAttributeResponseWithDefaults() *AttributeResponse { + this := AttributeResponse{} + return &this +} + +// GetAttributeName returns the AttributeName field value if set, zero value otherwise. +func (o *AttributeResponse) GetAttributeName() string { + if o == nil || o.AttributeName == nil { + var ret string + return ret + } + return *o.AttributeName +} + +// GetAttributeNameOk returns a tuple with the AttributeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AttributeResponse) GetAttributeNameOk() (*string, bool) { + if o == nil || o.AttributeName == nil { + return nil, false + } + return o.AttributeName, true +} + +// HasAttributeName returns a boolean if a field has been set. +func (o *AttributeResponse) HasAttributeName() bool { + if o != nil && o.AttributeName != nil { + return true + } + + return false +} + +// SetAttributeName gets a reference to the given string and assigns it to the AttributeName field. +func (o *AttributeResponse) SetAttributeName(v string) { + o.AttributeName = &v +} + +// GetAttributeValues returns the AttributeValues field value if set, zero value otherwise. +func (o *AttributeResponse) GetAttributeValues() []float64 { + if o == nil || o.AttributeValues == nil { + var ret []float64 + return ret + } + return o.AttributeValues +} + +// GetAttributeValuesOk returns a tuple with the AttributeValues field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AttributeResponse) GetAttributeValuesOk() ([]float64, bool) { + if o == nil || o.AttributeValues == nil { + return nil, false + } + return o.AttributeValues, true +} + +// HasAttributeValues returns a boolean if a field has been set. +func (o *AttributeResponse) HasAttributeValues() bool { + if o != nil && o.AttributeValues != nil { + return true + } + + return false +} + +// SetAttributeValues gets a reference to the given []float64 and assigns it to the AttributeValues field. +func (o *AttributeResponse) SetAttributeValues(v []float64) { + o.AttributeValues = v +} + +func (o AttributeResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AttributeName != nil { + toSerialize["attributeName"] = o.AttributeName + } + if o.AttributeValues != nil { + toSerialize["attributeValues"] = o.AttributeValues + } + return json.Marshal(toSerialize) +} + +type NullableAttributeResponse struct { + value *AttributeResponse + isSet bool +} + +func (v NullableAttributeResponse) Get() *AttributeResponse { + return v.value +} + +func (v *NullableAttributeResponse) Set(val *AttributeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAttributeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAttributeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAttributeResponse(val *AttributeResponse) *NullableAttributeResponse { + return &NullableAttributeResponse{value: val, isSet: true} +} + +func (v NullableAttributeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAttributeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_continent.go b/.gen/cloudinfo/model_continent.go index 2083621efd..7890a13c0c 100644 --- a/.gen/cloudinfo/model_continent.go +++ b/.gen/cloudinfo/model_continent.go @@ -1,17 +1,152 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // Continent Continent holds continent and regions of a cloud provider type Continent struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Regions []Region `json:"regions,omitempty"` } + +// NewContinent instantiates a new Continent 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 NewContinent() *Continent { + this := Continent{} + return &this +} + +// NewContinentWithDefaults instantiates a new Continent 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 NewContinentWithDefaults() *Continent { + this := Continent{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Continent) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Continent) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Continent) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Continent) SetName(v string) { + o.Name = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *Continent) GetRegions() []Region { + if o == nil || o.Regions == nil { + var ret []Region + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Continent) GetRegionsOk() ([]Region, bool) { + if o == nil || o.Regions == nil { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *Continent) HasRegions() bool { + if o != nil && o.Regions != nil { + return true + } + + return false +} + +// SetRegions gets a reference to the given []Region and assigns it to the Regions field. +func (o *Continent) SetRegions(v []Region) { + o.Regions = v +} + +func (o Continent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Regions != nil { + toSerialize["regions"] = o.Regions + } + return json.Marshal(toSerialize) +} + +type NullableContinent struct { + value *Continent + isSet bool +} + +func (v NullableContinent) Get() *Continent { + return v.value +} + +func (v *NullableContinent) Set(val *Continent) { + v.value = val + v.isSet = true +} + +func (v NullableContinent) IsSet() bool { + return v.isSet +} + +func (v *NullableContinent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContinent(val *Continent) *NullableContinent { + return &NullableContinent{value: val, isSet: true} +} + +func (v NullableContinent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContinent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_get_region_resp.go b/.gen/cloudinfo/model_get_region_resp.go index 80e0704993..91cfd20f45 100644 --- a/.gen/cloudinfo/model_get_region_resp.go +++ b/.gen/cloudinfo/model_get_region_resp.go @@ -1,18 +1,188 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // GetRegionResp GetRegionResp holds the detailed description of a specific region of a cloud provider type GetRegionResp struct { - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` Zones []string `json:"zones,omitempty"` } + +// NewGetRegionResp instantiates a new GetRegionResp 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 NewGetRegionResp() *GetRegionResp { + this := GetRegionResp{} + return &this +} + +// NewGetRegionRespWithDefaults instantiates a new GetRegionResp 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 NewGetRegionRespWithDefaults() *GetRegionResp { + this := GetRegionResp{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetRegionResp) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRegionResp) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *GetRegionResp) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GetRegionResp) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetRegionResp) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRegionResp) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GetRegionResp) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetRegionResp) SetName(v string) { + o.Name = &v +} + +// GetZones returns the Zones field value if set, zero value otherwise. +func (o *GetRegionResp) GetZones() []string { + if o == nil || o.Zones == nil { + var ret []string + return ret + } + return o.Zones +} + +// GetZonesOk returns a tuple with the Zones field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRegionResp) GetZonesOk() ([]string, bool) { + if o == nil || o.Zones == nil { + return nil, false + } + return o.Zones, true +} + +// HasZones returns a boolean if a field has been set. +func (o *GetRegionResp) HasZones() bool { + if o != nil && o.Zones != nil { + return true + } + + return false +} + +// SetZones gets a reference to the given []string and assigns it to the Zones field. +func (o *GetRegionResp) SetZones(v []string) { + o.Zones = v +} + +func (o GetRegionResp) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Zones != nil { + toSerialize["zones"] = o.Zones + } + return json.Marshal(toSerialize) +} + +type NullableGetRegionResp struct { + value *GetRegionResp + isSet bool +} + +func (v NullableGetRegionResp) Get() *GetRegionResp { + return v.value +} + +func (v *NullableGetRegionResp) Set(val *GetRegionResp) { + v.value = val + v.isSet = true +} + +func (v NullableGetRegionResp) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRegionResp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRegionResp(val *GetRegionResp) *NullableGetRegionResp { + return &NullableGetRegionResp{value: val, isSet: true} +} + +func (v NullableGetRegionResp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRegionResp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_image.go b/.gen/cloudinfo/model_image.go index b2ad648781..3626590ecd 100644 --- a/.gen/cloudinfo/model_image.go +++ b/.gen/cloudinfo/model_image.go @@ -1,23 +1,261 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + import ( + "encoding/json" "time" ) + // Image Image represents an image type Image struct { - CreationDate time.Time `json:"creationDate,omitempty"` - Gpu bool `json:"gpu,omitempty"` - Name string `json:"name,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - Version string `json:"version,omitempty"` + CreationDate *time.Time `json:"creationDate,omitempty"` + Gpu *bool `json:"gpu,omitempty"` + Name *string `json:"name,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Version *string `json:"version,omitempty"` +} + +// NewImage instantiates a new Image 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 NewImage() *Image { + this := Image{} + return &this +} + +// NewImageWithDefaults instantiates a new Image 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 NewImageWithDefaults() *Image { + this := Image{} + return &this +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Image) GetCreationDate() time.Time { + if o == nil || o.CreationDate == nil { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetCreationDateOk() (*time.Time, bool) { + if o == nil || o.CreationDate == nil { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Image) HasCreationDate() bool { + if o != nil && o.CreationDate != nil { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Image) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetGpu returns the Gpu field value if set, zero value otherwise. +func (o *Image) GetGpu() bool { + if o == nil || o.Gpu == nil { + var ret bool + return ret + } + return *o.Gpu +} + +// GetGpuOk returns a tuple with the Gpu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetGpuOk() (*bool, bool) { + if o == nil || o.Gpu == nil { + return nil, false + } + return o.Gpu, true +} + +// HasGpu returns a boolean if a field has been set. +func (o *Image) HasGpu() bool { + if o != nil && o.Gpu != nil { + return true + } + + return false +} + +// SetGpu gets a reference to the given bool and assigns it to the Gpu field. +func (o *Image) SetGpu(v bool) { + o.Gpu = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Image) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Image) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Image) SetName(v string) { + o.Name = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Image) GetTags() map[string]string { + if o == nil || o.Tags == nil { + var ret map[string]string + return ret + } + return *o.Tags } + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetTagsOk() (*map[string]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Image) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *Image) SetTags(v map[string]string) { + o.Tags = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Image) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Image) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Image) SetVersion(v string) { + o.Version = &v +} + +func (o Image) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreationDate != nil { + toSerialize["creationDate"] = o.CreationDate + } + if o.Gpu != nil { + toSerialize["gpu"] = o.Gpu + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableImage struct { + value *Image + isSet bool +} + +func (v NullableImage) Get() *Image { + return v.value +} + +func (v *NullableImage) Set(val *Image) { + v.value = val + v.isSet = true +} + +func (v NullableImage) IsSet() bool { + return v.isSet +} + +func (v *NullableImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImage(val *Image) *NullableImage { + return &NullableImage{value: val, isSet: true} +} + +func (v NullableImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_location_version.go b/.gen/cloudinfo/model_location_version.go index ef5c428ded..c39561181b 100644 --- a/.gen/cloudinfo/model_location_version.go +++ b/.gen/cloudinfo/model_location_version.go @@ -1,18 +1,188 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // LocationVersion LocationVersion struct for displaying version information per location type LocationVersion struct { - Default string `json:"default,omitempty"` - Location string `json:"location,omitempty"` + Default *string `json:"default,omitempty"` + Location *string `json:"location,omitempty"` Versions []string `json:"versions,omitempty"` } + +// NewLocationVersion instantiates a new LocationVersion 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 NewLocationVersion() *LocationVersion { + this := LocationVersion{} + return &this +} + +// NewLocationVersionWithDefaults instantiates a new LocationVersion 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 NewLocationVersionWithDefaults() *LocationVersion { + this := LocationVersion{} + return &this +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *LocationVersion) GetDefault() string { + if o == nil || o.Default == nil { + var ret string + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationVersion) GetDefaultOk() (*string, bool) { + if o == nil || o.Default == nil { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *LocationVersion) HasDefault() bool { + if o != nil && o.Default != nil { + return true + } + + return false +} + +// SetDefault gets a reference to the given string and assigns it to the Default field. +func (o *LocationVersion) SetDefault(v string) { + o.Default = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *LocationVersion) GetLocation() string { + if o == nil || o.Location == nil { + var ret string + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationVersion) GetLocationOk() (*string, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *LocationVersion) HasLocation() bool { + if o != nil && o.Location != nil { + return true + } + + return false +} + +// SetLocation gets a reference to the given string and assigns it to the Location field. +func (o *LocationVersion) SetLocation(v string) { + o.Location = &v +} + +// GetVersions returns the Versions field value if set, zero value otherwise. +func (o *LocationVersion) GetVersions() []string { + if o == nil || o.Versions == nil { + var ret []string + return ret + } + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationVersion) GetVersionsOk() ([]string, bool) { + if o == nil || o.Versions == nil { + return nil, false + } + return o.Versions, true +} + +// HasVersions returns a boolean if a field has been set. +func (o *LocationVersion) HasVersions() bool { + if o != nil && o.Versions != nil { + return true + } + + return false +} + +// SetVersions gets a reference to the given []string and assigns it to the Versions field. +func (o *LocationVersion) SetVersions(v []string) { + o.Versions = v +} + +func (o LocationVersion) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Default != nil { + toSerialize["default"] = o.Default + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.Versions != nil { + toSerialize["versions"] = o.Versions + } + return json.Marshal(toSerialize) +} + +type NullableLocationVersion struct { + value *LocationVersion + isSet bool +} + +func (v NullableLocationVersion) Get() *LocationVersion { + return v.value +} + +func (v *NullableLocationVersion) Set(val *LocationVersion) { + v.value = val + v.isSet = true +} + +func (v NullableLocationVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableLocationVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocationVersion(val *LocationVersion) *NullableLocationVersion { + return &NullableLocationVersion{value: val, isSet: true} +} + +func (v NullableLocationVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocationVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_product_details.go b/.gen/cloudinfo/model_product_details.go index 100ee5ee90..dfc4e91eb4 100644 --- a/.gen/cloudinfo/model_product_details.go +++ b/.gen/cloudinfo/model_product_details.go @@ -1,30 +1,550 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ProductDetails ProductDetails extended view of the virtual machine details type ProductDetails struct { - Attributes map[string]string `json:"attributes,omitempty"` + Attributes *map[string]string `json:"attributes,omitempty"` // Burst this is derived for now - Burst bool `json:"burst,omitempty"` - Category string `json:"category,omitempty"` - CpusPerVm float64 `json:"cpusPerVm,omitempty"` + Burst *bool `json:"burst,omitempty"` + Category *string `json:"category,omitempty"` + CpusPerVm *float64 `json:"cpusPerVm,omitempty"` // CurrentGen signals whether the instance type generation is the current one. Only applies for amazon - CurrentGen bool `json:"currentGen,omitempty"` - GpusPerVm float64 `json:"gpusPerVm,omitempty"` - MemPerVm float64 `json:"memPerVm,omitempty"` - NtwPerf string `json:"ntwPerf,omitempty"` - NtwPerfCategory string `json:"ntwPerfCategory,omitempty"` - OnDemandPrice float64 `json:"onDemandPrice,omitempty"` + CurrentGen *bool `json:"currentGen,omitempty"` + GpusPerVm *float64 `json:"gpusPerVm,omitempty"` + MemPerVm *float64 `json:"memPerVm,omitempty"` + NtwPerf *string `json:"ntwPerf,omitempty"` + NtwPerfCategory *string `json:"ntwPerfCategory,omitempty"` + OnDemandPrice *float64 `json:"onDemandPrice,omitempty"` SpotPrice []ZonePrice `json:"spotPrice,omitempty"` - Type string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` Zones []string `json:"zones,omitempty"` } + +// NewProductDetails instantiates a new ProductDetails 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 NewProductDetails() *ProductDetails { + this := ProductDetails{} + return &this +} + +// NewProductDetailsWithDefaults instantiates a new ProductDetails 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 NewProductDetailsWithDefaults() *ProductDetails { + this := ProductDetails{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *ProductDetails) GetAttributes() map[string]string { + if o == nil || o.Attributes == nil { + var ret map[string]string + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetAttributesOk() (*map[string]string, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *ProductDetails) HasAttributes() bool { + if o != nil && o.Attributes != nil { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]string and assigns it to the Attributes field. +func (o *ProductDetails) SetAttributes(v map[string]string) { + o.Attributes = &v +} + +// GetBurst returns the Burst field value if set, zero value otherwise. +func (o *ProductDetails) GetBurst() bool { + if o == nil || o.Burst == nil { + var ret bool + return ret + } + return *o.Burst +} + +// GetBurstOk returns a tuple with the Burst field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetBurstOk() (*bool, bool) { + if o == nil || o.Burst == nil { + return nil, false + } + return o.Burst, true +} + +// HasBurst returns a boolean if a field has been set. +func (o *ProductDetails) HasBurst() bool { + if o != nil && o.Burst != nil { + return true + } + + return false +} + +// SetBurst gets a reference to the given bool and assigns it to the Burst field. +func (o *ProductDetails) SetBurst(v bool) { + o.Burst = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *ProductDetails) GetCategory() string { + if o == nil || o.Category == nil { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetCategoryOk() (*string, bool) { + if o == nil || o.Category == nil { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *ProductDetails) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *ProductDetails) SetCategory(v string) { + o.Category = &v +} + +// GetCpusPerVm returns the CpusPerVm field value if set, zero value otherwise. +func (o *ProductDetails) GetCpusPerVm() float64 { + if o == nil || o.CpusPerVm == nil { + var ret float64 + return ret + } + return *o.CpusPerVm +} + +// GetCpusPerVmOk returns a tuple with the CpusPerVm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetCpusPerVmOk() (*float64, bool) { + if o == nil || o.CpusPerVm == nil { + return nil, false + } + return o.CpusPerVm, true +} + +// HasCpusPerVm returns a boolean if a field has been set. +func (o *ProductDetails) HasCpusPerVm() bool { + if o != nil && o.CpusPerVm != nil { + return true + } + + return false +} + +// SetCpusPerVm gets a reference to the given float64 and assigns it to the CpusPerVm field. +func (o *ProductDetails) SetCpusPerVm(v float64) { + o.CpusPerVm = &v +} + +// GetCurrentGen returns the CurrentGen field value if set, zero value otherwise. +func (o *ProductDetails) GetCurrentGen() bool { + if o == nil || o.CurrentGen == nil { + var ret bool + return ret + } + return *o.CurrentGen +} + +// GetCurrentGenOk returns a tuple with the CurrentGen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetCurrentGenOk() (*bool, bool) { + if o == nil || o.CurrentGen == nil { + return nil, false + } + return o.CurrentGen, true +} + +// HasCurrentGen returns a boolean if a field has been set. +func (o *ProductDetails) HasCurrentGen() bool { + if o != nil && o.CurrentGen != nil { + return true + } + + return false +} + +// SetCurrentGen gets a reference to the given bool and assigns it to the CurrentGen field. +func (o *ProductDetails) SetCurrentGen(v bool) { + o.CurrentGen = &v +} + +// GetGpusPerVm returns the GpusPerVm field value if set, zero value otherwise. +func (o *ProductDetails) GetGpusPerVm() float64 { + if o == nil || o.GpusPerVm == nil { + var ret float64 + return ret + } + return *o.GpusPerVm +} + +// GetGpusPerVmOk returns a tuple with the GpusPerVm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetGpusPerVmOk() (*float64, bool) { + if o == nil || o.GpusPerVm == nil { + return nil, false + } + return o.GpusPerVm, true +} + +// HasGpusPerVm returns a boolean if a field has been set. +func (o *ProductDetails) HasGpusPerVm() bool { + if o != nil && o.GpusPerVm != nil { + return true + } + + return false +} + +// SetGpusPerVm gets a reference to the given float64 and assigns it to the GpusPerVm field. +func (o *ProductDetails) SetGpusPerVm(v float64) { + o.GpusPerVm = &v +} + +// GetMemPerVm returns the MemPerVm field value if set, zero value otherwise. +func (o *ProductDetails) GetMemPerVm() float64 { + if o == nil || o.MemPerVm == nil { + var ret float64 + return ret + } + return *o.MemPerVm +} + +// GetMemPerVmOk returns a tuple with the MemPerVm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetMemPerVmOk() (*float64, bool) { + if o == nil || o.MemPerVm == nil { + return nil, false + } + return o.MemPerVm, true +} + +// HasMemPerVm returns a boolean if a field has been set. +func (o *ProductDetails) HasMemPerVm() bool { + if o != nil && o.MemPerVm != nil { + return true + } + + return false +} + +// SetMemPerVm gets a reference to the given float64 and assigns it to the MemPerVm field. +func (o *ProductDetails) SetMemPerVm(v float64) { + o.MemPerVm = &v +} + +// GetNtwPerf returns the NtwPerf field value if set, zero value otherwise. +func (o *ProductDetails) GetNtwPerf() string { + if o == nil || o.NtwPerf == nil { + var ret string + return ret + } + return *o.NtwPerf +} + +// GetNtwPerfOk returns a tuple with the NtwPerf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetNtwPerfOk() (*string, bool) { + if o == nil || o.NtwPerf == nil { + return nil, false + } + return o.NtwPerf, true +} + +// HasNtwPerf returns a boolean if a field has been set. +func (o *ProductDetails) HasNtwPerf() bool { + if o != nil && o.NtwPerf != nil { + return true + } + + return false +} + +// SetNtwPerf gets a reference to the given string and assigns it to the NtwPerf field. +func (o *ProductDetails) SetNtwPerf(v string) { + o.NtwPerf = &v +} + +// GetNtwPerfCategory returns the NtwPerfCategory field value if set, zero value otherwise. +func (o *ProductDetails) GetNtwPerfCategory() string { + if o == nil || o.NtwPerfCategory == nil { + var ret string + return ret + } + return *o.NtwPerfCategory +} + +// GetNtwPerfCategoryOk returns a tuple with the NtwPerfCategory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetNtwPerfCategoryOk() (*string, bool) { + if o == nil || o.NtwPerfCategory == nil { + return nil, false + } + return o.NtwPerfCategory, true +} + +// HasNtwPerfCategory returns a boolean if a field has been set. +func (o *ProductDetails) HasNtwPerfCategory() bool { + if o != nil && o.NtwPerfCategory != nil { + return true + } + + return false +} + +// SetNtwPerfCategory gets a reference to the given string and assigns it to the NtwPerfCategory field. +func (o *ProductDetails) SetNtwPerfCategory(v string) { + o.NtwPerfCategory = &v +} + +// GetOnDemandPrice returns the OnDemandPrice field value if set, zero value otherwise. +func (o *ProductDetails) GetOnDemandPrice() float64 { + if o == nil || o.OnDemandPrice == nil { + var ret float64 + return ret + } + return *o.OnDemandPrice +} + +// GetOnDemandPriceOk returns a tuple with the OnDemandPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetOnDemandPriceOk() (*float64, bool) { + if o == nil || o.OnDemandPrice == nil { + return nil, false + } + return o.OnDemandPrice, true +} + +// HasOnDemandPrice returns a boolean if a field has been set. +func (o *ProductDetails) HasOnDemandPrice() bool { + if o != nil && o.OnDemandPrice != nil { + return true + } + + return false +} + +// SetOnDemandPrice gets a reference to the given float64 and assigns it to the OnDemandPrice field. +func (o *ProductDetails) SetOnDemandPrice(v float64) { + o.OnDemandPrice = &v +} + +// GetSpotPrice returns the SpotPrice field value if set, zero value otherwise. +func (o *ProductDetails) GetSpotPrice() []ZonePrice { + if o == nil || o.SpotPrice == nil { + var ret []ZonePrice + return ret + } + return o.SpotPrice +} + +// GetSpotPriceOk returns a tuple with the SpotPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetSpotPriceOk() ([]ZonePrice, bool) { + if o == nil || o.SpotPrice == nil { + return nil, false + } + return o.SpotPrice, true +} + +// HasSpotPrice returns a boolean if a field has been set. +func (o *ProductDetails) HasSpotPrice() bool { + if o != nil && o.SpotPrice != nil { + return true + } + + return false +} + +// SetSpotPrice gets a reference to the given []ZonePrice and assigns it to the SpotPrice field. +func (o *ProductDetails) SetSpotPrice(v []ZonePrice) { + o.SpotPrice = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ProductDetails) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ProductDetails) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ProductDetails) SetType(v string) { + o.Type = &v +} + +// GetZones returns the Zones field value if set, zero value otherwise. +func (o *ProductDetails) GetZones() []string { + if o == nil || o.Zones == nil { + var ret []string + return ret + } + return o.Zones +} + +// GetZonesOk returns a tuple with the Zones field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetails) GetZonesOk() ([]string, bool) { + if o == nil || o.Zones == nil { + return nil, false + } + return o.Zones, true +} + +// HasZones returns a boolean if a field has been set. +func (o *ProductDetails) HasZones() bool { + if o != nil && o.Zones != nil { + return true + } + + return false +} + +// SetZones gets a reference to the given []string and assigns it to the Zones field. +func (o *ProductDetails) SetZones(v []string) { + o.Zones = v +} + +func (o ProductDetails) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Burst != nil { + toSerialize["burst"] = o.Burst + } + if o.Category != nil { + toSerialize["category"] = o.Category + } + if o.CpusPerVm != nil { + toSerialize["cpusPerVm"] = o.CpusPerVm + } + if o.CurrentGen != nil { + toSerialize["currentGen"] = o.CurrentGen + } + if o.GpusPerVm != nil { + toSerialize["gpusPerVm"] = o.GpusPerVm + } + if o.MemPerVm != nil { + toSerialize["memPerVm"] = o.MemPerVm + } + if o.NtwPerf != nil { + toSerialize["ntwPerf"] = o.NtwPerf + } + if o.NtwPerfCategory != nil { + toSerialize["ntwPerfCategory"] = o.NtwPerfCategory + } + if o.OnDemandPrice != nil { + toSerialize["onDemandPrice"] = o.OnDemandPrice + } + if o.SpotPrice != nil { + toSerialize["spotPrice"] = o.SpotPrice + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Zones != nil { + toSerialize["zones"] = o.Zones + } + return json.Marshal(toSerialize) +} + +type NullableProductDetails struct { + value *ProductDetails + isSet bool +} + +func (v NullableProductDetails) Get() *ProductDetails { + return v.value +} + +func (v *NullableProductDetails) Set(val *ProductDetails) { + v.value = val + v.isSet = true +} + +func (v NullableProductDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableProductDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProductDetails(val *ProductDetails) *NullableProductDetails { + return &NullableProductDetails{value: val, isSet: true} +} + +func (v NullableProductDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProductDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_product_details_response.go b/.gen/cloudinfo/model_product_details_response.go index 4bb7d0b64c..769a2cbdb9 100644 --- a/.gen/cloudinfo/model_product_details_response.go +++ b/.gen/cloudinfo/model_product_details_response.go @@ -1,19 +1,154 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ProductDetailsResponse ProductDetailsResponse Api object to be mapped to product info response type ProductDetailsResponse struct { // Products represents a slice of products for a given provider (VMs with attributes and process) Products []ProductDetails `json:"products,omitempty"` // ScrapingTime represents scraping time for a given provider in milliseconds - ScrapingTime string `json:"scrapingTime,omitempty"` + ScrapingTime *string `json:"scrapingTime,omitempty"` +} + +// NewProductDetailsResponse instantiates a new ProductDetailsResponse 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 NewProductDetailsResponse() *ProductDetailsResponse { + this := ProductDetailsResponse{} + return &this +} + +// NewProductDetailsResponseWithDefaults instantiates a new ProductDetailsResponse 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 NewProductDetailsResponseWithDefaults() *ProductDetailsResponse { + this := ProductDetailsResponse{} + return &this +} + +// GetProducts returns the Products field value if set, zero value otherwise. +func (o *ProductDetailsResponse) GetProducts() []ProductDetails { + if o == nil || o.Products == nil { + var ret []ProductDetails + return ret + } + return o.Products +} + +// GetProductsOk returns a tuple with the Products field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetailsResponse) GetProductsOk() ([]ProductDetails, bool) { + if o == nil || o.Products == nil { + return nil, false + } + return o.Products, true +} + +// HasProducts returns a boolean if a field has been set. +func (o *ProductDetailsResponse) HasProducts() bool { + if o != nil && o.Products != nil { + return true + } + + return false +} + +// SetProducts gets a reference to the given []ProductDetails and assigns it to the Products field. +func (o *ProductDetailsResponse) SetProducts(v []ProductDetails) { + o.Products = v +} + +// GetScrapingTime returns the ScrapingTime field value if set, zero value otherwise. +func (o *ProductDetailsResponse) GetScrapingTime() string { + if o == nil || o.ScrapingTime == nil { + var ret string + return ret + } + return *o.ScrapingTime +} + +// GetScrapingTimeOk returns a tuple with the ScrapingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProductDetailsResponse) GetScrapingTimeOk() (*string, bool) { + if o == nil || o.ScrapingTime == nil { + return nil, false + } + return o.ScrapingTime, true +} + +// HasScrapingTime returns a boolean if a field has been set. +func (o *ProductDetailsResponse) HasScrapingTime() bool { + if o != nil && o.ScrapingTime != nil { + return true + } + + return false +} + +// SetScrapingTime gets a reference to the given string and assigns it to the ScrapingTime field. +func (o *ProductDetailsResponse) SetScrapingTime(v string) { + o.ScrapingTime = &v +} + +func (o ProductDetailsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Products != nil { + toSerialize["products"] = o.Products + } + if o.ScrapingTime != nil { + toSerialize["scrapingTime"] = o.ScrapingTime + } + return json.Marshal(toSerialize) +} + +type NullableProductDetailsResponse struct { + value *ProductDetailsResponse + isSet bool +} + +func (v NullableProductDetailsResponse) Get() *ProductDetailsResponse { + return v.value } + +func (v *NullableProductDetailsResponse) Set(val *ProductDetailsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProductDetailsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProductDetailsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProductDetailsResponse(val *ProductDetailsResponse) *NullableProductDetailsResponse { + return &NullableProductDetailsResponse{value: val, isSet: true} +} + +func (v NullableProductDetailsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProductDetailsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_provider.go b/.gen/cloudinfo/model_provider.go index 648e2874e5..0587712786 100644 --- a/.gen/cloudinfo/model_provider.go +++ b/.gen/cloudinfo/model_provider.go @@ -1,17 +1,152 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // Provider Provider represents a cloud provider type Provider struct { - Provider string `json:"provider,omitempty"` + Provider *string `json:"provider,omitempty"` Services []Service `json:"services,omitempty"` } + +// NewProvider instantiates a new Provider 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 NewProvider() *Provider { + this := Provider{} + return &this +} + +// NewProviderWithDefaults instantiates a new Provider 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 NewProviderWithDefaults() *Provider { + this := Provider{} + return &this +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *Provider) GetProvider() string { + if o == nil || o.Provider == nil { + var ret string + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetProviderOk() (*string, bool) { + if o == nil || o.Provider == nil { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *Provider) HasProvider() bool { + if o != nil && o.Provider != nil { + return true + } + + return false +} + +// SetProvider gets a reference to the given string and assigns it to the Provider field. +func (o *Provider) SetProvider(v string) { + o.Provider = &v +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *Provider) GetServices() []Service { + if o == nil || o.Services == nil { + var ret []Service + return ret + } + return o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetServicesOk() ([]Service, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *Provider) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given []Service and assigns it to the Services field. +func (o *Provider) SetServices(v []Service) { + o.Services = v +} + +func (o Provider) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Provider != nil { + toSerialize["provider"] = o.Provider + } + if o.Services != nil { + toSerialize["services"] = o.Services + } + return json.Marshal(toSerialize) +} + +type NullableProvider struct { + value *Provider + isSet bool +} + +func (v NullableProvider) Get() *Provider { + return v.value +} + +func (v *NullableProvider) Set(val *Provider) { + v.value = val + v.isSet = true +} + +func (v NullableProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProvider(val *Provider) *NullableProvider { + return &NullableProvider{value: val, isSet: true} +} + +func (v NullableProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_provider_response.go b/.gen/cloudinfo/model_provider_response.go index 25d74f058c..ebcfb3ba7a 100644 --- a/.gen/cloudinfo/model_provider_response.go +++ b/.gen/cloudinfo/model_provider_response.go @@ -1,16 +1,116 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ProviderResponse ProviderResponse is the response used for the requested provider type ProviderResponse struct { - Provider Provider `json:"provider,omitempty"` + Provider *Provider `json:"provider,omitempty"` +} + +// NewProviderResponse instantiates a new ProviderResponse 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 NewProviderResponse() *ProviderResponse { + this := ProviderResponse{} + return &this +} + +// NewProviderResponseWithDefaults instantiates a new ProviderResponse 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 NewProviderResponseWithDefaults() *ProviderResponse { + this := ProviderResponse{} + return &this +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *ProviderResponse) GetProvider() Provider { + if o == nil || o.Provider == nil { + var ret Provider + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderResponse) GetProviderOk() (*Provider, bool) { + if o == nil || o.Provider == nil { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *ProviderResponse) HasProvider() bool { + if o != nil && o.Provider != nil { + return true + } + + return false +} + +// SetProvider gets a reference to the given Provider and assigns it to the Provider field. +func (o *ProviderResponse) SetProvider(v Provider) { + o.Provider = &v +} + +func (o ProviderResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Provider != nil { + toSerialize["provider"] = o.Provider + } + return json.Marshal(toSerialize) } + +type NullableProviderResponse struct { + value *ProviderResponse + isSet bool +} + +func (v NullableProviderResponse) Get() *ProviderResponse { + return v.value +} + +func (v *NullableProviderResponse) Set(val *ProviderResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProviderResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderResponse(val *ProviderResponse) *NullableProviderResponse { + return &NullableProviderResponse{value: val, isSet: true} +} + +func (v NullableProviderResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_providers_response.go b/.gen/cloudinfo/model_providers_response.go index b0b326f954..ce989b661e 100644 --- a/.gen/cloudinfo/model_providers_response.go +++ b/.gen/cloudinfo/model_providers_response.go @@ -1,16 +1,116 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ProvidersResponse ProvidersResponse is the response used for the supported providers type ProvidersResponse struct { Providers []Provider `json:"providers,omitempty"` } + +// NewProvidersResponse instantiates a new ProvidersResponse 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 NewProvidersResponse() *ProvidersResponse { + this := ProvidersResponse{} + return &this +} + +// NewProvidersResponseWithDefaults instantiates a new ProvidersResponse 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 NewProvidersResponseWithDefaults() *ProvidersResponse { + this := ProvidersResponse{} + return &this +} + +// GetProviders returns the Providers field value if set, zero value otherwise. +func (o *ProvidersResponse) GetProviders() []Provider { + if o == nil || o.Providers == nil { + var ret []Provider + return ret + } + return o.Providers +} + +// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProvidersResponse) GetProvidersOk() ([]Provider, bool) { + if o == nil || o.Providers == nil { + return nil, false + } + return o.Providers, true +} + +// HasProviders returns a boolean if a field has been set. +func (o *ProvidersResponse) HasProviders() bool { + if o != nil && o.Providers != nil { + return true + } + + return false +} + +// SetProviders gets a reference to the given []Provider and assigns it to the Providers field. +func (o *ProvidersResponse) SetProviders(v []Provider) { + o.Providers = v +} + +func (o ProvidersResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Providers != nil { + toSerialize["providers"] = o.Providers + } + return json.Marshal(toSerialize) +} + +type NullableProvidersResponse struct { + value *ProvidersResponse + isSet bool +} + +func (v NullableProvidersResponse) Get() *ProvidersResponse { + return v.value +} + +func (v *NullableProvidersResponse) Set(val *ProvidersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProvidersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProvidersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProvidersResponse(val *ProvidersResponse) *NullableProvidersResponse { + return &NullableProvidersResponse{value: val, isSet: true} +} + +func (v NullableProvidersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProvidersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_region.go b/.gen/cloudinfo/model_region.go index 9c66768535..8d4be692a5 100644 --- a/.gen/cloudinfo/model_region.go +++ b/.gen/cloudinfo/model_region.go @@ -1,17 +1,152 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // Region Region hold the id and name of a cloud provider region type Region struct { - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewRegion instantiates a new Region 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 NewRegion() *Region { + this := Region{} + return &this +} + +// NewRegionWithDefaults instantiates a new Region 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 NewRegionWithDefaults() *Region { + this := Region{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Region) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Region) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Region) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Region) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Region) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Region) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Region) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Region) SetName(v string) { + o.Name = &v +} + +func (o Region) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableRegion struct { + value *Region + isSet bool +} + +func (v NullableRegion) Get() *Region { + return v.value } + +func (v *NullableRegion) Set(val *Region) { + v.value = val + v.isSet = true +} + +func (v NullableRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegion(val *Region) *NullableRegion { + return &NullableRegion{value: val, isSet: true} +} + +func (v NullableRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_service.go b/.gen/cloudinfo/model_service.go index 2754b3d021..18b6612098 100644 --- a/.gen/cloudinfo/model_service.go +++ b/.gen/cloudinfo/model_service.go @@ -1,17 +1,152 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // Service it's intended to implement the ServiceDescriber interface type Service struct { - IsStatic bool `json:"isStatic,omitempty"` - Service string `json:"service,omitempty"` + IsStatic *bool `json:"isStatic,omitempty"` + Service *string `json:"service,omitempty"` +} + +// NewService instantiates a new Service 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 NewService() *Service { + this := Service{} + return &this +} + +// NewServiceWithDefaults instantiates a new Service 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 NewServiceWithDefaults() *Service { + this := Service{} + return &this +} + +// GetIsStatic returns the IsStatic field value if set, zero value otherwise. +func (o *Service) GetIsStatic() bool { + if o == nil || o.IsStatic == nil { + var ret bool + return ret + } + return *o.IsStatic +} + +// GetIsStaticOk returns a tuple with the IsStatic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetIsStaticOk() (*bool, bool) { + if o == nil || o.IsStatic == nil { + return nil, false + } + return o.IsStatic, true +} + +// HasIsStatic returns a boolean if a field has been set. +func (o *Service) HasIsStatic() bool { + if o != nil && o.IsStatic != nil { + return true + } + + return false +} + +// SetIsStatic gets a reference to the given bool and assigns it to the IsStatic field. +func (o *Service) SetIsStatic(v bool) { + o.IsStatic = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *Service) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *Service) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *Service) SetService(v string) { + o.Service = &v +} + +func (o Service) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.IsStatic != nil { + toSerialize["isStatic"] = o.IsStatic + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + return json.Marshal(toSerialize) +} + +type NullableService struct { + value *Service + isSet bool +} + +func (v NullableService) Get() *Service { + return v.value } + +func (v *NullableService) Set(val *Service) { + v.value = val + v.isSet = true +} + +func (v NullableService) IsSet() bool { + return v.isSet +} + +func (v *NullableService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableService(val *Service) *NullableService { + return &NullableService{value: val, isSet: true} +} + +func (v NullableService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_service_response.go b/.gen/cloudinfo/model_service_response.go index f83a74733c..788cc3722c 100644 --- a/.gen/cloudinfo/model_service_response.go +++ b/.gen/cloudinfo/model_service_response.go @@ -1,16 +1,116 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ServiceResponse ServiceResponse holds the list of available services type ServiceResponse struct { - Service Service `json:"service,omitempty"` + Service *Service `json:"service,omitempty"` +} + +// NewServiceResponse instantiates a new ServiceResponse 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 NewServiceResponse() *ServiceResponse { + this := ServiceResponse{} + return &this +} + +// NewServiceResponseWithDefaults instantiates a new ServiceResponse 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 NewServiceResponseWithDefaults() *ServiceResponse { + this := ServiceResponse{} + return &this +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *ServiceResponse) GetService() Service { + if o == nil || o.Service == nil { + var ret Service + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceResponse) GetServiceOk() (*Service, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *ServiceResponse) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given Service and assigns it to the Service field. +func (o *ServiceResponse) SetService(v Service) { + o.Service = &v +} + +func (o ServiceResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Service != nil { + toSerialize["service"] = o.Service + } + return json.Marshal(toSerialize) } + +type NullableServiceResponse struct { + value *ServiceResponse + isSet bool +} + +func (v NullableServiceResponse) Get() *ServiceResponse { + return v.value +} + +func (v *NullableServiceResponse) Set(val *ServiceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServiceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceResponse(val *ServiceResponse) *NullableServiceResponse { + return &NullableServiceResponse{value: val, isSet: true} +} + +func (v NullableServiceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_services_response.go b/.gen/cloudinfo/model_services_response.go index ec6bbc2cdf..ffcd9b55c2 100644 --- a/.gen/cloudinfo/model_services_response.go +++ b/.gen/cloudinfo/model_services_response.go @@ -1,16 +1,116 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ServicesResponse ServicesResponse holds the list of available services type ServicesResponse struct { Services []Service `json:"services,omitempty"` } + +// NewServicesResponse instantiates a new ServicesResponse 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 NewServicesResponse() *ServicesResponse { + this := ServicesResponse{} + return &this +} + +// NewServicesResponseWithDefaults instantiates a new ServicesResponse 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 NewServicesResponseWithDefaults() *ServicesResponse { + this := ServicesResponse{} + return &this +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *ServicesResponse) GetServices() []Service { + if o == nil || o.Services == nil { + var ret []Service + return ret + } + return o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServicesResponse) GetServicesOk() ([]Service, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *ServicesResponse) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given []Service and assigns it to the Services field. +func (o *ServicesResponse) SetServices(v []Service) { + o.Services = v +} + +func (o ServicesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Services != nil { + toSerialize["services"] = o.Services + } + return json.Marshal(toSerialize) +} + +type NullableServicesResponse struct { + value *ServicesResponse + isSet bool +} + +func (v NullableServicesResponse) Get() *ServicesResponse { + return v.value +} + +func (v *NullableServicesResponse) Set(val *ServicesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServicesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServicesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServicesResponse(val *ServicesResponse) *NullableServicesResponse { + return &NullableServicesResponse{value: val, isSet: true} +} + +func (v NullableServicesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServicesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/model_zone_price.go b/.gen/cloudinfo/model_zone_price.go index b49371e618..886e6bf158 100644 --- a/.gen/cloudinfo/model_zone_price.go +++ b/.gen/cloudinfo/model_zone_price.go @@ -1,17 +1,152 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cloudinfo + +import ( + "encoding/json" +) + // ZonePrice ZonePrice struct for displaying price information per zone type ZonePrice struct { - Price float64 `json:"price,omitempty"` - Zone string `json:"zone,omitempty"` + Price *float64 `json:"price,omitempty"` + Zone *string `json:"zone,omitempty"` +} + +// NewZonePrice instantiates a new ZonePrice 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 NewZonePrice() *ZonePrice { + this := ZonePrice{} + return &this +} + +// NewZonePriceWithDefaults instantiates a new ZonePrice 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 NewZonePriceWithDefaults() *ZonePrice { + this := ZonePrice{} + return &this +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *ZonePrice) GetPrice() float64 { + if o == nil || o.Price == nil { + var ret float64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ZonePrice) GetPriceOk() (*float64, bool) { + if o == nil || o.Price == nil { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *ZonePrice) HasPrice() bool { + if o != nil && o.Price != nil { + return true + } + + return false +} + +// SetPrice gets a reference to the given float64 and assigns it to the Price field. +func (o *ZonePrice) SetPrice(v float64) { + o.Price = &v +} + +// GetZone returns the Zone field value if set, zero value otherwise. +func (o *ZonePrice) GetZone() string { + if o == nil || o.Zone == nil { + var ret string + return ret + } + return *o.Zone +} + +// GetZoneOk returns a tuple with the Zone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ZonePrice) GetZoneOk() (*string, bool) { + if o == nil || o.Zone == nil { + return nil, false + } + return o.Zone, true +} + +// HasZone returns a boolean if a field has been set. +func (o *ZonePrice) HasZone() bool { + if o != nil && o.Zone != nil { + return true + } + + return false +} + +// SetZone gets a reference to the given string and assigns it to the Zone field. +func (o *ZonePrice) SetZone(v string) { + o.Zone = &v +} + +func (o ZonePrice) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Price != nil { + toSerialize["price"] = o.Price + } + if o.Zone != nil { + toSerialize["zone"] = o.Zone + } + return json.Marshal(toSerialize) +} + +type NullableZonePrice struct { + value *ZonePrice + isSet bool +} + +func (v NullableZonePrice) Get() *ZonePrice { + return v.value } + +func (v *NullableZonePrice) Set(val *ZonePrice) { + v.value = val + v.isSet = true +} + +func (v NullableZonePrice) IsSet() bool { + return v.isSet +} + +func (v *NullableZonePrice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableZonePrice(val *ZonePrice) *NullableZonePrice { + return &NullableZonePrice{value: val, isSet: true} +} + +func (v NullableZonePrice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableZonePrice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/.gen/cloudinfo/response.go b/.gen/cloudinfo/response.go index 0ae736b8ea..02a14ed8b1 100644 --- a/.gen/cloudinfo/response.go +++ b/.gen/cloudinfo/response.go @@ -1,11 +1,11 @@ /* - * Product Info. - * - * The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. - * - * API version: 0.9.5 - * Contact: info@banzaicloud.com - */ +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -33,7 +33,7 @@ type APIResponse struct { Payload []byte `json:"-"` } -// NewAPIResponse returns a new APIResonse object. +// NewAPIResponse returns a new APIResponse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} diff --git a/.gen/cloudinfo/utils.go b/.gen/cloudinfo/utils.go new file mode 100644 index 0000000000..08b23dee5d --- /dev/null +++ b/.gen/cloudinfo/utils.go @@ -0,0 +1,329 @@ +/* +Product Info. + +The product info application uses the cloud provider APIs to asynchronously fetch and parse instance type attributes and prices, while storing the results in an in memory cache and making it available as structured data through a REST API. + +API version: 0.9.5 +Contact: info@banzaicloud.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cloudinfo + +import ( + "encoding/json" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/.gen/pipeline/.openapi-generator/FILES b/.gen/pipeline/.openapi-generator/FILES new file mode 100644 index 0000000000..bb3e6aef3c --- /dev/null +++ b/.gen/pipeline/.openapi-generator/FILES @@ -0,0 +1,297 @@ +.openapi-generator-ignore +Dockerfile +README.md +api/openapi.yaml +go.mod +go/api.go +go/api_ark.go +go/api_ark_backups.go +go/api_ark_backups_service.go +go/api_ark_buckets.go +go/api_ark_buckets_service.go +go/api_ark_restores.go +go/api_ark_restores_service.go +go/api_ark_schedules.go +go/api_ark_schedules_service.go +go/api_ark_service.go +go/api_auth.go +go/api_auth_service.go +go/api_clustergroup_deployments.go +go/api_clustergroup_deployments_service.go +go/api_clustergroup_features.go +go/api_clustergroup_features_service.go +go/api_clustergroups.go +go/api_clustergroups_service.go +go/api_clusters.go +go/api_clusters_service.go +go/api_common.go +go/api_common_service.go +go/api_deployments.go +go/api_deployments_service.go +go/api_google.go +go/api_google_service.go +go/api_helm.go +go/api_helm_service.go +go/api_images.go +go/api_images_service.go +go/api_info.go +go/api_info_service.go +go/api_integrated_services.go +go/api_integrated_services_service.go +go/api_network.go +go/api_network_service.go +go/api_organizations.go +go/api_organizations_service.go +go/api_pipeline.go +go/api_pipeline_service.go +go/api_processes.go +go/api_processes_service.go +go/api_scanlog.go +go/api_scanlog_service.go +go/api_secrets.go +go/api_secrets_service.go +go/api_storage.go +go/api_storage_service.go +go/api_users.go +go/api_users_service.go +go/api_whitelist.go +go/api_whitelist_service.go +go/error.go +go/helpers.go +go/impl.go +go/logger.go +go/model_activate_integrated_service_request.go +go/model_amazon_auto_scaling_group.go +go/model_amazon_auto_scaling_group_size.go +go/model_amazon_provider_config.go +go/model_api_cluster_group.go +go/model_api_create_request.go +go/model_api_create_response.go +go/model_api_feature_response.go +go/model_api_member.go +go/model_api_update_request.go +go/model_api_update_response.go +go/model_azure_blob_storage_props.go +go/model_backup_bucket_response.go +go/model_backup_options.go +go/model_backup_response.go +go/model_backup_service_response.go +go/model_base_post_hook.go +go/model_base_update_node_pool_options.go +go/model_base_update_node_pool_request.go +go/model_bucket_info.go +go/model_bucket_info_secret.go +go/model_cluster_config.go +go/model_cluster_image.go +go/model_common_error.go +go/model_create_aks_properties.go +go/model_create_aks_properties_aks.go +go/model_create_amazon_object_store_bucket_properties.go +go/model_create_azure_object_store_bucket_properties.go +go/model_create_backup_bucket_request.go +go/model_create_backup_request.go +go/model_create_backup_response.go +go/model_create_cluster_request.go +go/model_create_cluster_request_base.go +go/model_create_cluster_request_v2.go +go/model_create_cluster_response_201.go +go/model_create_cluster_response_202.go +go/model_create_eks_properties.go +go/model_create_eks_properties_eks.go +go/model_create_gke_properties.go +go/model_create_gke_properties_gke.go +go/model_create_gke_properties_gke_master.go +go/model_create_google_object_store_bucket_properties.go +go/model_create_node_pool_request.go +go/model_create_object_store_bucket_properties.go +go/model_create_object_store_bucket_request.go +go/model_create_object_store_bucket_response.go +go/model_create_pke_cluster_kubernetes.go +go/model_create_pke_cluster_kubernetes_cri.go +go/model_create_pke_cluster_kubernetes_network.go +go/model_create_pke_cluster_kubernetes_oidc.go +go/model_create_pke_cluster_request_base.go +go/model_create_pke_cluster_request_base_all_of.go +go/model_create_pke_properties.go +go/model_create_pke_properties_cri.go +go/model_create_pke_properties_kubernetes.go +go/model_create_pke_properties_kubernetes_rbac.go +go/model_create_pke_properties_network.go +go/model_create_pkeon_azure_cluster_request.go +go/model_create_pkeon_azure_cluster_request_all_of.go +go/model_create_pkeon_vsphere_cluster_request.go +go/model_create_pkeon_vsphere_cluster_request_all_of.go +go/model_create_resource_group.go +go/model_create_restore_request.go +go/model_create_restore_response.go +go/model_create_schedule_request.go +go/model_create_schedule_response.go +go/model_create_secret_request.go +go/model_create_secret_response.go +go/model_create_update_deployment_request.go +go/model_create_update_deployment_response.go +go/model_delete_backup_bucket_response.go +go/model_delete_backup_response.go +go/model_delete_deployment_response.go +go/model_delete_restore_response.go +go/model_delete_schedule_response.go +go/model_deployed_backup_bucket_response.go +go/model_deployment_cluster_group_deployment.go +go/model_deployment_create_update_deployment_response.go +go/model_deployment_deployment_info.go +go/model_deployment_list_deployment_response.go +go/model_deployment_target_cluster_status.go +go/model_disable_ark_response.go +go/model_eks_auth_config.go +go/model_eks_auth_config_roles.go +go/model_eks_auth_config_users.go +go/model_eks_encryption_config.go +go/model_eks_encryption_config_provider.go +go/model_eks_iam.go +go/model_eks_node_pool.go +go/model_eks_node_pool_all_of.go +go/model_eks_node_pool_volume_encryption.go +go/model_eks_subnet.go +go/model_eks_update_cluster_request.go +go/model_eks_update_node_pool_request.go +go/model_eks_update_node_pool_request_all_of.go +go/model_eks_vpc.go +go/model_enable_ark_request.go +go/model_enable_ark_response.go +go/model_endpoint_item.go +go/model_error.go +go/model_generic_node_pool.go +go/model_get_cluster_bootstrap_response.go +go/model_get_cluster_status_response.go +go/model_get_deployment_resources_response_inner.go +go/model_get_deployment_response.go +go/model_get_leader_election_response.go +go/model_get_pke_commands_response.go +go/model_google_project.go +go/model_google_projects.go +go/model_helm_chart_details_response.go +go/model_helm_chart_details_response_versions_inner.go +go/model_helm_charts_list_response_inner.go +go/model_helm_charts_list_response_inner_charts_inner_inner.go +go/model_helm_charts_list_response_inner_charts_inner_inner_maintainers_inner.go +go/model_helm_repo_list_item.go +go/model_helm_repos_add_request.go +go/model_helm_repos_delete_response.go +go/model_helm_repos_modify_request.go +go/model_helm_repos_update_response.go +go/model_install_secret_request.go +go/model_install_secret_request_spec_item.go +go/model_install_secret_response.go +go/model_install_secrets_request.go +go/model_install_secrets_request_query.go +go/model_integrated_service_details.go +go/model_labels.go +go/model_list_deployments_response_item.go +go/model_list_endpoints_response.go +go/model_list_nodes_response.go +go/model_list_nodes_response_metadata.go +go/model_namespace_item.go +go/model_namespace_list_response.go +go/model_node_item.go +go/model_node_item_metadata.go +go/model_node_item_spec.go +go/model_node_item_status.go +go/model_node_item_status_addresses_inner.go +go/model_node_item_status_allocatable.go +go/model_node_item_status_capacity.go +go/model_node_item_status_conditions_inner.go +go/model_node_item_status_daemon_endpoints.go +go/model_node_item_status_daemon_endpoints_kubelet_endpoint.go +go/model_node_item_status_images_inner.go +go/model_node_item_status_node_info.go +go/model_node_pool.go +go/model_node_pool_auto_scaling.go +go/model_node_pool_status.go +go/model_node_pool_status_amazon.go +go/model_node_pool_status_azure.go +go/model_node_pool_status_google.go +go/model_node_pool_status_information.go +go/model_node_pool_status_v_sphere.go +go/model_node_pool_summary.go +go/model_node_pools.go +go/model_node_pools_azure.go +go/model_node_pools_google.go +go/model_node_pools_pke.go +go/model_nodepool_labels.go +go/model_oidc_config.go +go/model_organization_list_item_response.go +go/model_pke_aws_update_node_pool_request.go +go/model_pke_aws_update_node_pool_request_all_of.go +go/model_pke_cluster_http_proxy.go +go/model_pke_cluster_http_proxy_options.go +go/model_pke_cluster_readiness_response.go +go/model_pke_cluster_readiness_response_master.go +go/model_pke_hosts.go +go/model_pkeon_azure_cluster_network.go +go/model_pkeon_azure_node_pool.go +go/model_pkeon_azure_node_pool_subnet.go +go/model_pkeon_vsphere_node_pool.go +go/model_pod_condition.go +go/model_pod_item.go +go/model_pod_item_labels.go +go/model_post_hooks.go +go/model_post_leader_election_request.go +go/model_post_leader_election_response.go +go/model_post_ready_pke_node_request.go +go/model_process.go +go/model_process_event.go +go/model_process_status.go +go/model_release_white_list_item.go +go/model_report_pke_node_status_request.go +go/model_report_pke_node_status_response.go +go/model_requested_resources.go +go/model_resource.go +go/model_resource_group_created.go +go/model_resource_summary.go +go/model_restore_response.go +go/model_restore_result_errors.go +go/model_restore_result_warnings.go +go/model_restore_results_response.go +go/model_route_table_info.go +go/model_scan_log_item.go +go/model_scan_log_item_image.go +go/model_schedule_response.go +go/model_secret_item.go +go/model_secret_key_value_amazon.go +go/model_secret_key_value_azure.go +go/model_secret_key_value_generic.go +go/model_secret_key_value_google.go +go/model_secret_key_value_kubernetes.go +go/model_secret_key_value_tls.go +go/model_secret_type_response.go +go/model_secret_type_response_fields_inner.go +go/model_subnet_info.go +go/model_token_create_request.go +go/model_token_create_response.go +go/model_token_list_response_item.go +go/model_update_azure_properties.go +go/model_update_azure_properties_azure.go +go/model_update_cluster_request.go +go/model_update_cluster_request_deprecated.go +go/model_update_cluster_request_v2.go +go/model_update_eks_properties.go +go/model_update_eks_properties_eks.go +go/model_update_google_properties.go +go/model_update_google_properties_master.go +go/model_update_integrated_service_request.go +go/model_update_node_pool_drain_options.go +go/model_update_node_pool_request.go +go/model_update_node_pool_response.go +go/model_update_node_pools_azure.go +go/model_update_node_pools_google.go +go/model_update_node_pools_pke.go +go/model_update_pke_properties.go +go/model_update_pke_properties_pke.go +go/model_update_pkeon_azure_cluster_request.go +go/model_update_pkeon_vsphere_cluster_request.go +go/model_url_item.go +go/model_user.go +go/model_version_response.go +go/model_vpc_network_info.go +go/routers.go +main.go diff --git a/.gen/pipeline/.openapi-generator/VERSION b/.gen/pipeline/.openapi-generator/VERSION index ecedc98d1d..4ac4fded49 100644 --- a/.gen/pipeline/.openapi-generator/VERSION +++ b/.gen/pipeline/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1 \ No newline at end of file +6.2.0 \ No newline at end of file diff --git a/.gen/pipeline/api/openapi.yaml b/.gen/pipeline/api/openapi.yaml index 5e36851a0f..9d17c358ca 100644 --- a/.gen/pipeline/api/openapi.yaml +++ b/.gen/pipeline/api/openapi.yaml @@ -36,13 +36,13 @@ tags: name: projects - description: ARK service related functions name: ark -- description: 'ARK: buckets related functions' +- description: "ARK: buckets related functions" name: ark-buckets -- description: 'ARK: backups related functions' +- description: "ARK: backups related functions" name: ark-backups -- description: 'ARK: schedules related functions' +- description: "ARK: schedules related functions" name: ark-schedules -- description: 'ARK: restores related functions' +- description: "ARK: restores related functions" name: ark-restores paths: /api/version: @@ -3024,6 +3024,7 @@ paths: application/json: schema: $ref: '#/components/schemas/HelmChartsListResponse' + description: "" default: content: application/json: @@ -3170,6 +3171,7 @@ paths: application/json: schema: $ref: '#/components/schemas/HelmChartDetailsResponse' + description: "" default: content: application/json: @@ -3292,6 +3294,7 @@ paths: application/json: schema: $ref: '#/components/schemas/HelmClusterChartsListResponse' + description: "" default: content: application/json: @@ -14226,7 +14229,7 @@ paths: tags: - clustergroups post: - description: create a group of clusters, joining clusters together with a name + description: "create a group of clusters, joining clusters together with a name" parameters: - description: Organization identifier explode: false @@ -14355,8 +14358,8 @@ paths: - clustergroups /api/v1/orgs/{orgid}/clustergroups/{clusterGroupId}: delete: - description: delete a cluster group, disable all enabled features, delete related - deployments + description: "delete a cluster group, disable all enabled features, delete related\ + \ deployments" parameters: - description: Organization identifier explode: false @@ -14485,8 +14488,8 @@ paths: tags: - clustergroups get: - description: retrieve info about a cluster group, members, status of member - clusters, features + description: "retrieve info about a cluster group, members, status of member\ + \ clusters, features" parameters: - description: Organization identifier explode: false @@ -14883,8 +14886,8 @@ paths: tags: - clustergroup deployments post: - description: creates a new cluster group deployment, installs or upgrades deployment - on each member cluster accordingly + description: "creates a new cluster group deployment, installs or upgrades deployment\ + \ on each member cluster accordingly" parameters: - description: Organization identifier explode: false @@ -15035,8 +15038,8 @@ paths: - clustergroup deployments /api/v1/orgs/{orgid}/clustergroups/{clusterGroupId}/deployments/{deploymentName}: delete: - description: deletes a cluster group deployment, also deleting deployments from - member clusters + description: "deletes a cluster group deployment, also deleting deployments\ + \ from member clusters" parameters: - description: Organization identifier explode: false @@ -15333,8 +15336,8 @@ paths: tags: - clustergroup deployments put: - description: updates a cluster group deployment, installs or upgrades deployment - on each member cluster accordingly + description: "updates a cluster group deployment, installs or upgrades deployment\ + \ on each member cluster accordingly" parameters: - description: Organization identifier explode: false @@ -18383,17 +18386,17 @@ components: description: Generic error object. properties: type: - description: A URI reference [RFC3986] that identifies the problem type. + description: "A URI reference [RFC3986] that identifies the problem type." example: about:blank format: uri type: string title: - description: A short, human-readable summary of the problem type. + description: "A short, human-readable summary of the problem type." example: Not found type: string status: - description: The HTTP status code ([RFC7231], Section 6) generated by the - origin server for this occurrence of the problem. + description: "The HTTP status code ([RFC7231], Section 6) generated by the\ + \ origin server for this occurrence of the problem." example: 404 type: integer detail: @@ -18409,20 +18412,20 @@ components: type: string code: deprecated: true - description: 'HTTP status code. Deprecated: use status instead.' + description: "HTTP status code. Deprecated: use status instead." type: integer message: deprecated: true - description: 'Error message. Deprecated: use detail instead.' + description: "Error message. Deprecated: use detail instead." type: string error: deprecated: true - description: 'Error message. Deprecated: use title instead.' + description: "Error message. Deprecated: use title instead." type: string type: object CommonError: deprecated: true - description: 'Generic error object. Deprecated: use Error schema instead.' + description: "Generic error object. Deprecated: use Error schema instead." properties: code: description: HTTP status code @@ -18478,7 +18481,7 @@ components: type: string type: array sameSize: - description: If true, recommended instance types will have a similar size + description: "If true, recommended instance types will have a similar size" example: true type: boolean onDemandPct: @@ -18729,8 +18732,9 @@ components: template: description: Name of VM template available on vSphere to clone as the base of nodes. Overrides default value from the main cluster secret. - example: '[{"simple":{"value":"centos-7-pke-201910021808","summary":"Name - of template to use when it''s unambiguous."}},{"absolute":{"value":"/Datacenter/vm/centos-7-pke-201910021808"}}]' + example: "[{\"simple\":{\"value\":\"centos-7-pke-201910021808\",\"summary\"\ + :\"Name of template to use when it's unambiguous.\"}},{\"absolute\":{\"\ + value\":\"/Datacenter/vm/centos-7-pke-201910021808\"}}]" type: string adminUsername: description: Name of admin user to deploy the generated SSH public key for. @@ -18946,7 +18950,7 @@ components: type: string statusMessage: description: Details and reasoning about the status value. - example: 'Creating node pool failed: the specified volume size is invalid.' + example: "Creating node pool failed: the specified volume size is invalid." type: string type: object BaseUpdateNodePoolRequest: @@ -19035,7 +19039,7 @@ components: type: integer labels: additionalProperties: - example: '{"example.io/label1":"value1"}' + example: "{\"example.io/label1\":\"value1\"}" type: string type: object volumeEncryption: @@ -19103,7 +19107,7 @@ components: type: string labels: additionalProperties: - example: '{"example.io/label1":"value1"}' + example: "{\"example.io/label1\":\"value1\"}" type: string type: object required: @@ -19180,7 +19184,7 @@ components: type: array labels: additionalProperties: - example: '{"example.io/label1":"value1"}' + example: "{\"example.io/label1\":\"value1\"}" type: string description: user provided custom node labels to be placed onto the nodes of the node pool @@ -19400,7 +19404,7 @@ components: type: string labels: additionalProperties: - example: '{"example.io/label1":"value1"}' + example: "{\"example.io/label1\":\"value1\"}" type: string type: object vnetSubnetID: @@ -19493,7 +19497,7 @@ components: type: array labels: additionalProperties: - example: '{"example.io/label1":"value1"}' + example: "{\"example.io/label1\":\"value1\"}" type: string description: user provided custom node labels to be placed onto the nodes of the node pool @@ -19542,6 +19546,7 @@ components: items: $ref: '#/components/schemas/URLItem' type: array + example: null type: object URLItem: example: @@ -19567,17 +19572,18 @@ components: name: gke-gkecluster-feri-706-pool1-496eccb3-l25k creationTimestamp: 2018-04-16T19:47:07Z annotations: - key: '{"node.alpha.kubernetes.io/ttl":"0"}' + key: "{\"node.alpha.kubernetes.io/ttl\":\"0\"}" selfLink: /api/v1/nodes/gke-gkecluster-feri-706-pool1-496eccb3-l25k labels: - key: '{"beta.kubernetes.io/arch":"amd64"}' + key: "{\"beta.kubernetes.io/arch\":\"amd64\"}" spec: providerID: gce://banzaitest/us-central1-a/gke-gkecluster-706-pool1-496eccb3-l25k externalID: "5935724476937880453" podCIDR: 10.48.0.0/24 status: daemonEndpoints: - kubeletEndpoint: '{}' + kubeletEndpoint: + Port: 10250 allocatable: memory: 5784712Ki cpu: 1930m @@ -19630,17 +19636,18 @@ components: name: gke-gkecluster-feri-706-pool1-496eccb3-l25k creationTimestamp: 2018-04-16T19:47:07Z annotations: - key: '{"node.alpha.kubernetes.io/ttl":"0"}' + key: "{\"node.alpha.kubernetes.io/ttl\":\"0\"}" selfLink: /api/v1/nodes/gke-gkecluster-feri-706-pool1-496eccb3-l25k labels: - key: '{"beta.kubernetes.io/arch":"amd64"}' + key: "{\"beta.kubernetes.io/arch\":\"amd64\"}" spec: providerID: gce://banzaitest/us-central1-a/gke-gkecluster-706-pool1-496eccb3-l25k externalID: "5935724476937880453" podCIDR: 10.48.0.0/24 status: daemonEndpoints: - kubeletEndpoint: '{}' + kubeletEndpoint: + Port: 10250 allocatable: memory: 5784712Ki cpu: 1930m @@ -19703,17 +19710,18 @@ components: name: gke-gkecluster-feri-706-pool1-496eccb3-l25k creationTimestamp: 2018-04-16T19:47:07Z annotations: - key: '{"node.alpha.kubernetes.io/ttl":"0"}' + key: "{\"node.alpha.kubernetes.io/ttl\":\"0\"}" selfLink: /api/v1/nodes/gke-gkecluster-feri-706-pool1-496eccb3-l25k labels: - key: '{"beta.kubernetes.io/arch":"amd64"}' + key: "{\"beta.kubernetes.io/arch\":\"amd64\"}" spec: providerID: gce://banzaitest/us-central1-a/gke-gkecluster-706-pool1-496eccb3-l25k externalID: "5935724476937880453" podCIDR: 10.48.0.0/24 status: daemonEndpoints: - kubeletEndpoint: '{}' + kubeletEndpoint: + Port: 10250 allocatable: memory: 5784712Ki cpu: 1930m @@ -19819,7 +19827,8 @@ components: CreateUpdateDeploymentRequest: example: wait: false - package: package + package: !!binary |- + VTNkaFoyZGxjaUJ5YjJOcmN3PT0= dryRun: false releaseName: singed-bee odPcts: @@ -19837,13 +19846,15 @@ components: example: banzaicloud-stable/pipeline type: string version: - description: Version of the deployment. If not specified, the latest version - is used. + description: "Version of the deployment. If not specified, the latest version\ + \ is used." example: 0.1.0 type: string package: description: The chart content packaged by `helm package`. If specified chart version is ignored. + example: !!binary |- + VTNkaFoyZGxjaUJ5YjJOcmN3PT0= format: byte type: string namespace: @@ -19856,9 +19867,9 @@ components: example: false type: boolean wait: - description: if set, will wait until all Pods, PVCs, Services, and minimum - number of Pods of a Deployment are in a ready state before marking the - release as successful + description: "if set, will wait until all Pods, PVCs, Services, and minimum\ + \ number of Pods of a Deployment are in a ready state before marking the\ + \ release as successful" example: false type: boolean timeout: @@ -19868,8 +19879,8 @@ components: format: int64 type: integer odPcts: - description: 'Map of resources in the template where replicas should have - a minimum on-demand percentage. Format: ' + description: "Map of resources in the template where replicas should have\ + \ a minimum on-demand percentage. Format: " example: deployment.my-deployment: 40 type: object @@ -19916,14 +19927,7 @@ components: type: object GetDeploymentResourcesResponse: items: - properties: - name: - example: bumptious-dragon-zeppelin - type: string - kind: - example: Deployment - type: string - type: object + $ref: '#/components/schemas/GetDeploymentResourcesResponse_inner' type: array GetDeploymentResponse: example: @@ -19986,10 +19990,10 @@ components: HelmRepoListItem: example: cache: statestore//helm/repository/cache/stable-index.yaml - caFile: caFile + caFile: "" passwordSecretRef: passwordSecretRef - keyFile: keyFile - certFile: certFile + keyFile: "" + certFile: "" name: stable tlsSecretRef: tlsSecretRef url: https://charts.helm.sh/stable @@ -20004,10 +20008,13 @@ components: example: https://charts.helm.sh/stable type: string certFile: + example: "" type: string keyFile: + example: "" type: string caFile: + example: "" type: string passwordSecretRef: type: string @@ -20090,81 +20097,7 @@ components: type: object HelmChartsListResponse: items: - properties: - name: - example: stable - type: string - charts: - items: - items: - properties: - name: - example: nginx-ingress - type: string - home: - example: https://github.com/kubernetes/ingress-nginx - type: string - sources: - example: - - https://github.com/kubernetes/ingress-nginx - items: - type: string - type: array - version: - example: 0.13.1 - type: string - description: - example: An nginx Ingress controller that uses ConfigMap to store - the nginx configuration. - type: string - keywords: - example: - - ingress, nginx - items: - type: string - type: array - maintainers: - items: - properties: - name: - example: jackzampolin - type: string - email: - example: jack.zampolin@gmail.com - type: string - type: object - type: array - engine: - example: gotpl - type: string - icon: - example: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png - type: string - appVersion: - example: 0.12.0 - type: string - apiVersion: - example: v1 - type: string - deprecated: - example: false - type: boolean - urls: - example: - - https://charts.helm.sh/stable/nginx-ingress-0.13.1.tgz - items: - type: string - type: array - created: - example: 2018-04-11T18:11:24.761440762Z - type: string - digest: - example: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa - type: string - type: object - type: array - type: array - type: object + $ref: '#/components/schemas/HelmChartsListResponse_inner' type: array HelmChartDetailsResponse: example: @@ -20181,7 +20114,7 @@ components: sources: - https://github.com/kubernetes/ingress-nginx keywords: - - ingress, nginx + - "ingress, nginx" created: 2018-04-11T18:11:24.761440762Z deprecated: false icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png @@ -20207,7 +20140,7 @@ components: sources: - https://github.com/kubernetes/ingress-nginx keywords: - - ingress, nginx + - "ingress, nginx" created: 2018-04-11T18:11:24.761440762Z deprecated: false icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png @@ -20232,7 +20165,7 @@ components: type: string versions: items: - $ref: '#/components/schemas/HelmChartDetailsResponse_versions' + $ref: '#/components/schemas/HelmChartDetailsResponse_versions_inner' type: array HelmClusterChartsListResponse: items: @@ -20647,7 +20580,7 @@ components: createdAt: 2018-03-09T13:24:49+01:00 image: githubImageUrl.com/imageId/3 name: myName - organizations: '{}' + organizations: "{}" id: 1 login: username email: my@email.com @@ -20676,6 +20609,7 @@ components: type: string organizations: type: object + example: null type: object SecretTypeResponse: example: @@ -20691,7 +20625,7 @@ components: properties: fields: items: - $ref: '#/components/schemas/SecretTypeResponse_fields' + $ref: '#/components/schemas/SecretTypeResponse_fields_inner' type: array type: object ListUserResponse: @@ -20833,7 +20767,7 @@ components: type: string labels: additionalProperties: - example: '{"example.io/label1":"value1"}' + example: "{\"example.io/label1\":\"value1\"}" type: string type: object resourceSummary: @@ -21247,6 +21181,7 @@ components: type: string lastProbeTime: type: string + example: null lastTransitionTime: example: 2018-08-01T07:04:37Z type: string @@ -21616,8 +21551,8 @@ components: example: pre-flight type: string final: - description: if this is the final status report, that describes the conclusion - of the whole process + description: "if this is the final status report, that describes the conclusion\ + \ of the whole process" type: boolean status: $ref: '#/components/schemas/ProcessStatus' @@ -21718,7 +21653,7 @@ components: RestoreResultNamespaces: additionalProperties: items: - example: '[]' + example: "[]" type: string type: array type: object @@ -21726,11 +21661,11 @@ components: additionalProperties: items: description: warnings during restoration process - example: '{"default":["not restored: services \"kubernetes\" already exists - and is different from backed up version.","not restored: services \"pipeline-traefik-metrics-prometheus\" - already exists and is different from backed up version.","not restored: - services \"pipeline-traefik\" already exists and is different from backed - up version."]}' + example: "{\"default\":[\"not restored: services \\\"kubernetes\\\" already\ + \ exists and is different from backed up version.\",\"not restored: services\ + \ \\\"pipeline-traefik-metrics-prometheus\\\" already exists and is different\ + \ from backed up version.\",\"not restored: services \\\"pipeline-traefik\\\ + \" already exists and is different from backed up version.\"]}" type: string type: array type: object @@ -21740,8 +21675,8 @@ components: ark: [] namespaces: key: - - '[]' - - '[]' + - "[]" + - "[]" properties: ark: example: [] @@ -21756,7 +21691,7 @@ components: namespaces: additionalProperties: items: - example: '[]' + example: "[]" type: string type: array type: object @@ -21767,16 +21702,16 @@ components: ark: [] namespaces: key: - - '{"default":["not restored: services \"kubernetes\" already exists and - is different from backed up version.","not restored: services \"pipeline-traefik-metrics-prometheus\" - already exists and is different from backed up version.","not restored: - services \"pipeline-traefik\" already exists and is different from backed - up version."]}' - - '{"default":["not restored: services \"kubernetes\" already exists and - is different from backed up version.","not restored: services \"pipeline-traefik-metrics-prometheus\" - already exists and is different from backed up version.","not restored: - services \"pipeline-traefik\" already exists and is different from backed - up version."]}' + - "{\"default\":[\"not restored: services \\\"kubernetes\\\" already exists\ + \ and is different from backed up version.\",\"not restored: services\ + \ \\\"pipeline-traefik-metrics-prometheus\\\" already exists and is different\ + \ from backed up version.\",\"not restored: services \\\"pipeline-traefik\\\ + \" already exists and is different from backed up version.\"]}" + - "{\"default\":[\"not restored: services \\\"kubernetes\\\" already exists\ + \ and is different from backed up version.\",\"not restored: services\ + \ \\\"pipeline-traefik-metrics-prometheus\\\" already exists and is different\ + \ from backed up version.\",\"not restored: services \\\"pipeline-traefik\\\ + \" already exists and is different from backed up version.\"]}" properties: ark: example: [] @@ -21792,11 +21727,12 @@ components: additionalProperties: items: description: warnings during restoration process - example: '{"default":["not restored: services \"kubernetes\" already - exists and is different from backed up version.","not restored: services - \"pipeline-traefik-metrics-prometheus\" already exists and is different - from backed up version.","not restored: services \"pipeline-traefik\" - already exists and is different from backed up version."]}' + example: "{\"default\":[\"not restored: services \\\"kubernetes\\\"\ + \ already exists and is different from backed up version.\",\"not\ + \ restored: services \\\"pipeline-traefik-metrics-prometheus\\\" already\ + \ exists and is different from backed up version.\",\"not restored:\ + \ services \\\"pipeline-traefik\\\" already exists and is different\ + \ from backed up version.\"]}" type: string type: array type: object @@ -21808,23 +21744,25 @@ components: ark: [] namespaces: key: - - '{"default":["not restored: services \"kubernetes\" already exists and - is different from backed up version.","not restored: services \"pipeline-traefik-metrics-prometheus\" - already exists and is different from backed up version.","not restored: - services \"pipeline-traefik\" already exists and is different from backed - up version."]}' - - '{"default":["not restored: services \"kubernetes\" already exists and - is different from backed up version.","not restored: services \"pipeline-traefik-metrics-prometheus\" - already exists and is different from backed up version.","not restored: - services \"pipeline-traefik\" already exists and is different from backed - up version."]}' + - "{\"default\":[\"not restored: services \\\"kubernetes\\\" already exists\ + \ and is different from backed up version.\",\"not restored: services\ + \ \\\"pipeline-traefik-metrics-prometheus\\\" already exists and is\ + \ different from backed up version.\",\"not restored: services \\\"\ + pipeline-traefik\\\" already exists and is different from backed up\ + \ version.\"]}" + - "{\"default\":[\"not restored: services \\\"kubernetes\\\" already exists\ + \ and is different from backed up version.\",\"not restored: services\ + \ \\\"pipeline-traefik-metrics-prometheus\\\" already exists and is\ + \ different from backed up version.\",\"not restored: services \\\"\ + pipeline-traefik\\\" already exists and is different from backed up\ + \ version.\"]}" errors: cluster: [] ark: [] namespaces: key: - - '[]' - - '[]' + - "[]" + - "[]" properties: errors: $ref: '#/components/schemas/RestoreResultErrors' @@ -22169,7 +22107,7 @@ components: example: 61b9707ca463cad79188bb0ddfa1345e41fc01b651feddf06eea58a25c56d717 type: string prefix: - description: Optional, if not provided will be set to the name of the cluster + description: "Optional, if not provided will be set to the name of the cluster" example: my-backup-prefix type: string location: @@ -22316,9 +22254,9 @@ components: example: false type: boolean serviceAccountRoleARN: - description: relevant only in case of Amazon clusters. This a third option - to give permissions for volume snapshots to Velero, besides the default - NodeInstance role or cluster secret deployment. + description: "relevant only in case of Amazon clusters. This a third option\ + \ to give permissions for volume snapshots to Velero, besides the default\ + \ NodeInstance role or cluster secret deployment." example: arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME type: string useProviderSecret: @@ -22498,8 +22436,8 @@ components: reconcileState: reconcileState name: name enabled: true - properties: '{}' - status: '{}' + properties: "{}" + status: "{}" properties: clusterGroup: $ref: '#/components/schemas/api.ClusterGroup' @@ -22623,10 +22561,10 @@ components: chartName: chartName chartVersion: chartVersion releaseName: releaseName - values: '{}' + values: "{}" namespace: namespace description: description - valueOverrides: '{}' + valueOverrides: "{}" targetClusters: - cloud: cloud stale: true @@ -22744,7 +22682,7 @@ components: type: object ActivateIntegratedServiceRequest: example: - spec: '{}' + spec: "{}" properties: spec: type: object @@ -22753,8 +22691,8 @@ components: type: object IntegratedServiceDetails: example: - output: '{}' - spec: '{}' + output: "{}" + spec: "{}" status: inactive properties: output: @@ -22773,7 +22711,7 @@ components: type: object UpdateIntegratedServiceRequest: example: - spec: '{}' + spec: "{}" properties: spec: type: object @@ -22837,13 +22775,16 @@ components: log: log id: 6 type: type + status: null timestamp: 2000-01-23T04:56:07.000+00:00 - processId: processId log: log id: 6 type: type + status: null timestamp: 2000-01-23T04:56:07.000+00:00 resourceType: resourceType + status: null finishedAt: 2000-01-23T04:56:07.000+00:00 properties: id: @@ -22880,6 +22821,7 @@ components: log: log id: 6 type: type + status: null timestamp: 2000-01-23T04:56:07.000+00:00 properties: id: @@ -22909,12 +22851,14 @@ components: enabled: example: true type: boolean + type: object CreatePKEClusterKubernetes_cri: properties: runtime: type: string runtimeConfig: type: object + type: object CreatePKEClusterRequestBase_allOf: properties: kubernetes: @@ -22923,6 +22867,8 @@ components: $ref: '#/components/schemas/PKEClusterHTTPProxy' required: - kubernetes + type: object + example: null CreatePKEOnAzureClusterRequest_allOf: properties: location: @@ -22938,9 +22884,9 @@ components: network: $ref: '#/components/schemas/PKEOnAzureClusterNetwork' accessPoints: - description: List of access points (i.e. load balancers, floating IPs) to - be created for the cluster. Access points are implemented using cloud - provider specific resources. + description: "List of access points (i.e. load balancers, floating IPs)\ + \ to be created for the cluster. Access points are implemented using cloud\ + \ provider specific resources." items: enum: - private @@ -22948,8 +22894,8 @@ components: type: string type: array apiServerAccessPoints: - description: List of access point references for the API server; currently, - public and private are the only valid values + description: "List of access point references for the API server; currently,\ + \ public and private are the only valid values" items: enum: - private @@ -22962,6 +22908,8 @@ components: type: array required: - resourceGroup + type: object + example: null PKEOnAzureNodePool_subnet: properties: name: @@ -22972,6 +22920,7 @@ components: does not need to be specified. example: 10.0.0.0/24 type: string + type: object CreatePKEOnVsphereClusterRequest_allOf: properties: storageSecretId: @@ -22987,10 +22936,11 @@ components: folder: description: Folder to create nodes in. Overrides default value from the main cluster secret. - example: '[{"simple":{"value":"my-folder","summary":"The name of the folder - anywhere in the hierarchy when it''s unambiguous."}},{"absolute":{"value":"/Datacenter/vm/my-folder","summary":"Absolute - path to the folder. Most vSphere installations use paths prefixed with - /Datacenter/vm/."}}]' + example: "[{\"simple\":{\"value\":\"my-folder\",\"summary\":\"The name of\ + \ the folder anywhere in the hierarchy when it's unambiguous.\"}},{\"\ + absolute\":{\"value\":\"/Datacenter/vm/my-folder\",\"summary\":\"Absolute\ + \ path to the folder. Most vSphere installations use paths prefixed with\ + \ /Datacenter/vm/.\"}}]" type: string datastore: description: Name of datastore or datastore cluster to place VM disks on. @@ -23013,6 +22963,8 @@ components: type: string required: - resourceGroup + type: object + example: null EksNodePool_allOf: properties: autoscaling: @@ -23061,6 +23013,8 @@ components: type: boolean required: - instanceType + type: object + example: null EksUpdateNodePoolRequest_allOf: properties: autoscaling: @@ -23111,6 +23065,8 @@ components: type: boolean options: $ref: '#/components/schemas/BaseUpdateNodePoolOptions' + type: object + example: null PkeAwsUpdateNodePoolRequest_allOf: properties: autoscaling: @@ -23134,6 +23090,8 @@ components: type: string options: $ref: '#/components/schemas/BaseUpdateNodePoolOptions' + type: object + example: null CreateEKSProperties_eks: properties: authConfig: @@ -23202,13 +23160,14 @@ components: type: array tags: additionalProperties: - example: '{"customTagKey":"customTagValue"}' + example: "{\"customTagKey\":\"customTagValue\"}" type: string description: User defined tags to be added to created AWS resources. Empty keys and values are not permitted. type: object required: - nodePools + type: object CreateAKSProperties_aks: properties: resourceGroup: @@ -23228,11 +23187,13 @@ components: - kubernetesVersion - nodePools - resourceGroup + type: object CreateGKEProperties_gke_master: properties: version: example: "1.10" type: string + type: object CreateGKEProperties_gke: properties: projectId: @@ -23258,6 +23219,7 @@ components: type: object required: - nodePools + type: object CreatePKEProperties_network: properties: apiServerAddress: @@ -23277,6 +23239,7 @@ components: - podCIDR - provider - serviceCIDR + type: object CreatePKEProperties_kubernetes_rbac: properties: enabled: @@ -23284,6 +23247,7 @@ components: type: boolean required: - enabled + type: object CreatePKEProperties_kubernetes: properties: version: @@ -23294,6 +23258,7 @@ components: required: - rbac - version + type: object CreatePKEProperties_cri: properties: runtime: @@ -23301,6 +23266,7 @@ components: type: string required: - runtime + type: object AmazonAutoScalingGroup_size: properties: min: @@ -23312,6 +23278,7 @@ components: required: - max - min + type: object UpdateEksProperties_eks: properties: nodePools: @@ -23320,16 +23287,19 @@ components: type: object required: - nodePools + type: object UpdateAzureProperties_azure: properties: nodePools: additionalProperties: $ref: '#/components/schemas/UpdateNodePoolsAzure' type: object + type: object UpdateGoogleProperties_master: properties: version: type: string + type: object UpdatePKEProperties_pke: properties: nodePools: @@ -23338,6 +23308,7 @@ components: type: object required: - nodePools + type: object ListNodesResponse_metadata: example: resourceVersion: "30123" @@ -23349,6 +23320,7 @@ components: resourceVersion: example: "30123" type: string + type: object NodeItem_metadata: example: uid: f214d7fb-41ae-11e8-a4ea-42010a8001da @@ -23356,10 +23328,10 @@ components: name: gke-gkecluster-feri-706-pool1-496eccb3-l25k creationTimestamp: 2018-04-16T19:47:07Z annotations: - key: '{"node.alpha.kubernetes.io/ttl":"0"}' + key: "{\"node.alpha.kubernetes.io/ttl\":\"0\"}" selfLink: /api/v1/nodes/gke-gkecluster-feri-706-pool1-496eccb3-l25k labels: - key: '{"beta.kubernetes.io/arch":"amd64"}' + key: "{\"beta.kubernetes.io/arch\":\"amd64\"}" properties: name: example: gke-gkecluster-feri-706-pool1-496eccb3-l25k @@ -23378,14 +23350,15 @@ components: type: string labels: additionalProperties: - example: '{"beta.kubernetes.io/arch":"amd64"}' + example: "{\"beta.kubernetes.io/arch\":\"amd64\"}" type: string type: object annotations: additionalProperties: - example: '{"node.alpha.kubernetes.io/ttl":"0"}' + example: "{\"node.alpha.kubernetes.io/ttl\":\"0\"}" type: string type: object + type: object NodeItem_spec: example: providerID: gce://banzaitest/us-central1-a/gke-gkecluster-706-pool1-496eccb3-l25k @@ -23401,6 +23374,7 @@ components: providerID: example: gce://banzaitest/us-central1-a/gke-gkecluster-706-pool1-496eccb3-l25k type: string + type: object NodeItem_status_capacity: example: memory: 7664776Ki @@ -23416,6 +23390,7 @@ components: pods: example: "110" type: string + type: object NodeItem_status_allocatable: example: memory: 5784712Ki @@ -23431,7 +23406,8 @@ components: pods: example: "110" type: string - NodeItem_status_conditions: + type: object + NodeItem_status_conditions_inner: example: reason: KernelHasNoDeadlock lastHeartbeatTime: 2018-04-17T09:02:45Z @@ -23458,7 +23434,8 @@ components: message: example: kernel has no deadlock type: string - NodeItem_status_addresses: + type: object + NodeItem_status_addresses_inner: example: address: 10.128.0.2 type: InternalIP @@ -23469,15 +23446,22 @@ components: address: example: 10.128.0.2 type: string + type: object + NodeItem_status_daemonEndpoints_kubeletEndpoint: + example: + Port: 10250 + properties: + Port: + example: 10250 + type: integer NodeItem_status_daemonEndpoints: example: - kubeletEndpoint: '{}' + kubeletEndpoint: + Port: 10250 properties: kubeletEndpoint: - properties: - Port: - example: 10250 - type: integer + $ref: '#/components/schemas/NodeItem_status_daemonEndpoints_kubeletEndpoint' + type: object NodeItem_status_nodeInfo: example: machineID: 10d8adda771410ca912a387cf7e5cb06 @@ -23521,7 +23505,8 @@ components: architecture: example: amd64 type: string - NodeItem_status_images: + type: object + NodeItem_status_images_inner: example: name: - asia.gcr.io/google_containers/node-problem-detector@sha256:f95cab985c26b2f46e9bd43283e0bfa88860c14e0fb0649266babe8b65e @@ -23539,10 +23524,12 @@ components: example: 286572743 format: int64 type: integer + type: object NodeItem_status: example: daemonEndpoints: - kubeletEndpoint: '{}' + kubeletEndpoint: + Port: 10250 allocatable: memory: 5784712Ki cpu: 1930m @@ -23596,11 +23583,11 @@ components: $ref: '#/components/schemas/NodeItem_status_allocatable' conditions: items: - $ref: '#/components/schemas/NodeItem_status_conditions' + $ref: '#/components/schemas/NodeItem_status_conditions_inner' type: array addresses: items: - $ref: '#/components/schemas/NodeItem_status_addresses' + $ref: '#/components/schemas/NodeItem_status_addresses_inner' type: array daemonEndpoints: $ref: '#/components/schemas/NodeItem_status_daemonEndpoints' @@ -23608,9 +23595,22 @@ components: $ref: '#/components/schemas/NodeItem_status_nodeInfo' images: items: - $ref: '#/components/schemas/NodeItem_status_images' + $ref: '#/components/schemas/NodeItem_status_images_inner' type: array - HelmChartDetailsResponse_chart_maintainers: + type: object + GetDeploymentResourcesResponse_inner: + example: + kind: Deployment + name: bumptious-dragon-zeppelin + properties: + name: + example: bumptious-dragon-zeppelin + type: string + kind: + example: Deployment + type: string + type: object + HelmChartsListResponse_inner_charts_inner_inner_maintainers_inner: example: name: jackzampolin email: jack.zampolin@gmail.com @@ -23621,7 +23621,8 @@ components: email: example: jack.zampolin@gmail.com type: string - HelmChartDetailsResponse_chart: + type: object + HelmChartsListResponse_inner_charts_inner_inner: example: maintainers: - name: jackzampolin @@ -23632,7 +23633,7 @@ components: sources: - https://github.com/kubernetes/ingress-nginx keywords: - - ingress, nginx + - "ingress, nginx" created: 2018-04-11T18:11:24.761440762Z deprecated: false icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png @@ -23668,13 +23669,13 @@ components: type: string keywords: example: - - ingress, nginx + - "ingress, nginx" items: type: string type: array maintainers: items: - $ref: '#/components/schemas/HelmChartDetailsResponse_chart_maintainers' + $ref: '#/components/schemas/HelmChartsListResponse_inner_charts_inner_inner_maintainers_inner' type: array engine: example: gotpl @@ -23703,7 +23704,115 @@ components: digest: example: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa type: string - HelmChartDetailsResponse_versions: + type: object + HelmChartsListResponse_inner: + example: + charts: + - - maintainers: + - name: jackzampolin + email: jack.zampolin@gmail.com + - name: jackzampolin + email: jack.zampolin@gmail.com + appVersion: 0.12.0 + sources: + - https://github.com/kubernetes/ingress-nginx + keywords: + - "ingress, nginx" + created: 2018-04-11T18:11:24.761440762Z + deprecated: false + icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png + description: An nginx Ingress controller that uses ConfigMap to store + the nginx configuration. + version: 0.13.1 + home: https://github.com/kubernetes/ingress-nginx + urls: + - https://charts.helm.sh/stable/nginx-ingress-0.13.1.tgz + apiVersion: v1 + engine: gotpl + name: nginx-ingress + digest: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa + - maintainers: + - name: jackzampolin + email: jack.zampolin@gmail.com + - name: jackzampolin + email: jack.zampolin@gmail.com + appVersion: 0.12.0 + sources: + - https://github.com/kubernetes/ingress-nginx + keywords: + - "ingress, nginx" + created: 2018-04-11T18:11:24.761440762Z + deprecated: false + icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png + description: An nginx Ingress controller that uses ConfigMap to store + the nginx configuration. + version: 0.13.1 + home: https://github.com/kubernetes/ingress-nginx + urls: + - https://charts.helm.sh/stable/nginx-ingress-0.13.1.tgz + apiVersion: v1 + engine: gotpl + name: nginx-ingress + digest: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa + - - maintainers: + - name: jackzampolin + email: jack.zampolin@gmail.com + - name: jackzampolin + email: jack.zampolin@gmail.com + appVersion: 0.12.0 + sources: + - https://github.com/kubernetes/ingress-nginx + keywords: + - "ingress, nginx" + created: 2018-04-11T18:11:24.761440762Z + deprecated: false + icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png + description: An nginx Ingress controller that uses ConfigMap to store + the nginx configuration. + version: 0.13.1 + home: https://github.com/kubernetes/ingress-nginx + urls: + - https://charts.helm.sh/stable/nginx-ingress-0.13.1.tgz + apiVersion: v1 + engine: gotpl + name: nginx-ingress + digest: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa + - maintainers: + - name: jackzampolin + email: jack.zampolin@gmail.com + - name: jackzampolin + email: jack.zampolin@gmail.com + appVersion: 0.12.0 + sources: + - https://github.com/kubernetes/ingress-nginx + keywords: + - "ingress, nginx" + created: 2018-04-11T18:11:24.761440762Z + deprecated: false + icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png + description: An nginx Ingress controller that uses ConfigMap to store + the nginx configuration. + version: 0.13.1 + home: https://github.com/kubernetes/ingress-nginx + urls: + - https://charts.helm.sh/stable/nginx-ingress-0.13.1.tgz + apiVersion: v1 + engine: gotpl + name: nginx-ingress + digest: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa + name: stable + properties: + name: + example: stable + type: string + charts: + items: + items: + $ref: '#/components/schemas/HelmChartsListResponse_inner_charts_inner_inner' + type: array + type: array + type: object + HelmChartDetailsResponse_versions_inner: example: values: IyMgbmdpbngtbGVnbyBzcGlucyB1cCBhIHNjYWxhYmxlIGluZ3Jlc3MgcHJvdmlkZXIgdGhhdCBjYW4gYWxzbyBwcm92aXNpb24gU1NMIGNlcnRzCiMjIFNlZSBodHRwczovL2dpdGh1Yi5jb20vamV0c3RhY2sva3ViZS1sZWdvL3RyZWUvbWFzdGVyL2V4YW1wbGVzL25naW54IGZvciBtb3JlIGluZm9ybWF0aW9uIG9uIGltcGxlbWVudGF0aW9uCgojIyBOZ2lueCBjb25maWd1cmF0aW9uCiMjIHJlZjogaHR0cHM6Ly9naXRodWIuY29tL2t1YmVybmV0ZXMvY29udHJpYi90cmVlL21hc3Rlci9pbmdyZXNzL2NvbnRyb2xsZXJzL25naW54I2F1dG9tYXRlZC1jZXJ0aWZpY2F0ZS1tYW5hZ2VtZW50LXdpdGgta3ViZS1sZWdvCiMjCm5naW54OgogIHJlcGxpY2FDb3VudDogMQogIGltYWdlOgogICAgcmVwb3NpdG9yeTogazhzLmdjci5pby9uZ2lueC1pbmdyZXNzLWNvbnRyb2xsZXIKICAgIHRhZzogIjAuOC4zIgogICAgcHVsbFBvbGljeTogSWZOb3RQcmVzZW50CiAgc2VydmljZToKICAgIHR5cGU6IExvYWRCYWxhbmNlcgogIG1vbml0b3Jpbmc6IGZhbHNlCiAgcmVzb3VyY2VzOgogICAgbGltaXRzOgogICAgICBjcHU6IDEKICAgICAgbWVtb3J5OiAyR2kKICAgIHJlcXVlc3RzOgogICAgICBjcHU6IDEKICAgICAgbWVtb3J5OiAxMjhNaQogIGNvbmZpZ21hcDoKICAgIHByb3h5X2Nvbm5lY3RfdGltZW91dDogIjMwIgogICAgcHJveHlfcmVhZF90aW1lb3V0OiAiNjAwIgogICAgcHJveHlfc2VuZF9pbWVvdXQ6ICI2MDAiCiAgICBoc3RzX2luY2x1ZGVfc3ViZG9tYWluczogImZhbHNlIgogICAgYm9keV9zaXplOiAiNjRtIgogICAgc2VydmVyX25hbWVfaGFzaF9idWNrZXRfc2l6ZTogIjI1NiIKICAgICMgVE9ETzogZmlndXJlIG91dCBob3cgdG8gZXhwb3NlIGB7bmdpbnhfYWRkcn06ODA4MC9uZ2lueF9zdGF0dXNgLCBvbiBleGlzdGluZyBzZXJ2aWNlIG9yIGNyZWF0ZSBuZXcgb25lPwogICAgZW5hYmxlX3Z0c19zdGF0dXM6ICJmYWxzZSIKCiMjIERlZmF1bHQgQmFja2VuZCBjb25maWd1cmF0aW9uCiMjIFRvIHJ1biBhIGRpZmZlcmVudCA0MDQgcGFnZSBmb3IgdGhlIG1hbmFnZWQgZG9tYWlucyBwbGVhc2Ugc2VlIHRoZSBkb2N1bWVudGF0aW9uIGJlbG93CiMjIHJlZjogaHR0cHM6Ly9naXRodWIuY29tL2t1YmVybmV0ZXMvY29udHJpYi90cmVlL21hc3Rlci80MDQtc2VydmVyCiMjCmRlZmF1bHQ6CiAgcmVwbGljYUNvdW50OiAxCiAgaW1hZ2U6CiAgICByZXBvc2l0b3J5OiBrOHMuZ2NyLmlvL2RlZmF1bHRiYWNrZW5kCiAgICB0YWc6ICIxLjAiCiAgICBwdWxsUG9saWN5OiBJZk5vdFByZXNlbnQKICByZXNvdXJjZXM6CiAgICBsaW1pdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDJHaQogICAgcmVxdWVzdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDEyOE1pCgojIyBrdWJlLWxlZ28gY29uZmlndXJhdGlvbgojIyByZWY6IGh0dHBzOi8vZ2l0aHViLmNvbS9qZXRzdGFjay9rdWJlLWxlZ28KIyMKbGVnbzoKICBlbmFibGVkOiBmYWxzZQogIHJlcGxpY2FDb3VudDogMQogIGltYWdlOgogICAgcmVwb3NpdG9yeTogamV0c3RhY2sva3ViZS1sZWdvCiAgICB0YWc6ICIwLjEuMyIKICAgIHB1bGxQb2xpY3k6IElmTm90UHJlc2VudAogIGNvbmZpZ21hcDoKICAgIGVtYWlsOiAibXlAZW1haWwudGxkIgogICAgIyBQcm9kdWN0aW9uIExldCdzIEVuY3J5cHQgc2VydmVyCiAgICAjIHVybDogImh0dHBzOi8vYWNtZS12MDEuYXBpLmxldHNlbmNyeXB0Lm9yZy9kaXJlY3RvcnkiCiAgICAjIFRlc3QgTGV0J3MgRW5jcnlwdCBzZXJ2ZXIKICAgIHVybDogImh0dHBzOi8vYWNtZS1zdGFnaW5nLmFwaS5sZXRzZW5jcnlwdC5vcmcvZGlyZWN0b3J5ICIKICByZXNvdXJjZXM6CiAgICBsaW1pdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDJHaQogICAgcmVxdWVzdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDEyOE1pCg== readme: IyBuZ2lueC1sZWdvCgoqKlRoaXMgY2hhcnQgaGFzIGJlZW4gZGVwcmVjYXRlZCBhcyBvZiB2ZXJzaW9uIDAuMi4xIGFuZCB3aWxsIG5vdCBiZSB1cGRhdGVkLiBQbGVhc2UgdXNlIHRoZSBuZ2lueC1pbmdyZXNzIGFuZCAob3B0aW9uYWwpIGt1YmUtbGVnbyBjaGFydHMgaW5zdGVhZC4qKgoKW25naW54LWxlZ29dKGh0dHBzOi8vZ2l0aHViLmNvbS9qZXRzdGFjay9rdWJlLWxlZ28vdHJlZS9tYXN0ZXIvZXhhbXBsZXMvbmdpbngpIGlzIGEgY2hhcnQgZm9yIGFuIFtgbmdpbnhgIGluZ3Jlc3NdKGh0dHBzOi8vZ2l0aHViLmNvbS9rdWJlcm5ldGVzL2NvbnRyaWIvdHJlZS9tYXN0ZXIvaW5ncmVzcy9jb250cm9sbGVycy9uZ2lueCkgd2l0aCBvcHRpb25hbCBzdXBwb3J0IGZvciBhdXRvbWF0aWNhbGx5IGdlbmVyYXRpbmcgYFNTTGAgY2VydCBmb3IgdGhlIG1hbmFnZWQgcm91dGVzLgoKVG8gdXNlIHRoaXMgaW5ncmVzcyBjb250b2xsZXIgYWRkIHRoZSBmb2xsb3dpbmcgYW5ub3RhdGlvbnMgdG8gdGhlIGBpbmdyZXNzYCByZXNvdXJjZXMgeW91IHdvdWxkIGxpa2UgdG8gcm91dGUgdGhyb3VnaCBpdDoKCmBgYHlhbWwKYXBpVmVyc2lvbjogZXh0ZW5zaW9ucy92MWJldGExCmtpbmQ6IEluZ3Jlc3MKbWV0YWRhdGE6CiAgbmFtZXNwYWNlOiBmb28KICBhbm5vdGF0aW9uczoKICAgICMgQWRkIHRvIHJvdXRlIHRocm91Z2ggdGhlIG5naW54IHNlcnZpY2UKICAgIGt1YmVybmV0ZXMuaW8vaW5ncmVzcy5jbGFzczogbmdpbngKICAgICMgQWRkIHRvIGdlbmVyYXRlIGNlcnRpZmljYXRlcyBmb3IgdGhpcyBpbmdyZXNzCiAgICBrdWJlcm5ldGVzLmlvL3Rscy1hY21lOiAidHJ1ZSIKc3BlYzoKICB0bHM6CiAgICAjIFdpdGggdGhpcyBjb25maWd1cmF0aW9uIGt1YmUtbGVnbyB3aWxsIGdlbmVyYXRlIGEgc2VjcmV0IGluIG5hbWVzcGFjZSBmb28gY2FsbGVkIGBleGFtcGxlLXRsc2AKICAgICMgZm9yIHRoZSBVUkwgYHd3dy5leGFtcGxlLmNvbWAKICAgIC0gaG9zdHM6CiAgICAgIC0gInd3dy5leGFtcGxlLmNvbSIKICAgICAgc2VjcmV0TmFtZTogZXhhbXBsZS10bHMKYGBgCgojIyBUTDtEUjsKCmBgYGJhc2gKJCBoZWxtIGluc3RhbGwgc3RhYmxlL2t1YmUtbGVnbwpgYGAKCiMjIEludHJvZHVjdGlvbgoKVGhpcyBjaGFydCBib290c3RyYXBzIGFuIG5naW54LWxlZ28gZGVwbG95bWVudCBvbiBhIFtLdWJlcm5ldGVzXShodHRwOi8va3ViZXJuZXRlcy5pbykgY2x1c3RlciB1c2luZyB0aGUgW0hlbG1dKGh0dHBzOi8vaGVsbS5zaCkgcGFja2FnZSBtYW5hZ2VyLgoKIyMgUHJlcmVxdWlzaXRlcwoKLSBLdWJlcm5ldGVzIDEuNCsgd2l0aCBCZXRhIEFQSXMgZW5hYmxlZAoKIyMgSW5zdGFsbGluZyB0aGUgQ2hhcnQKClRvIGluc3RhbGwgdGhlIGNoYXJ0IHdpdGggdGhlIHJlbGVhc2UgbmFtZSBgbXktcmVsZWFzZWA6CgpgYGBiYXNoCiQgaGVsbSBpbnN0YWxsIC0tbmFtZSBteS1yZWxlYXNlIHN0YWJsZS9uZ2lueC1sZWdvCmBgYAoKVGhlIGNvbW1hbmQgZGVwbG95cyBuZ2lueC1sZWdvIG9uIHRoZSBLdWJlcm5ldGVzIGNsdXN0ZXIgaW4gdGhlIGRlZmF1bHQgY29uZmlndXJhdGlvbi4gVGhlIFtjb25maWd1cmF0aW9uXSgjY29uZmlndXJhdGlvbikgc2VjdGlvbiBsaXN0cyB0aGUgcGFyYW1ldGVycyB0aGF0IGNhbiBiZSBjb25maWd1cmVkIGR1cmluZyBpbnN0YWxsYXRpb24uCgo+ICoqVGlwKio6IExpc3QgYWxsIHJlbGVhc2VzIHVzaW5nIGBoZWxtIGxpc3RgCgojIyBVbmluc3RhbGxpbmcgdGhlIENoYXJ0CgpUbyB1bmluc3RhbGwvZGVsZXRlIHRoZSBgbXktcmVsZWFzZWAgZGVwbG95bWVudDoKCmBgYGJhc2gKJCBoZWxtIGRlbGV0ZSBteS1yZWxlYXNlCmBgYAoKVGhlIGNvbW1hbmQgcmVtb3ZlcyBhbGwgdGhlIEt1YmVybmV0ZXMgY29tcG9uZW50cyBhc3NvY2lhdGVkIHdpdGggdGhlIGNoYXJ0IGFuZCBkZWxldGVzIHRoZSByZWxlYXNlLgoKIyMgQ29uZmlndXJhdGlvbgoKU2VlIGB2YWx1ZXMueWFtbGAgZm9yIGNvbmZpZ3VyYXRpb24gbm90ZXMuIFNwZWNpZnkgZWFjaCBwYXJhbWV0ZXIgdXNpbmcgdGhlIGAtLXNldCBrZXk9dmFsdWVbLGtleT12YWx1ZV1gIGFyZ3VtZW50IHRvIGBoZWxtIGluc3RhbGxgLiBGb3IgZXhhbXBsZSwKCmBgYGJhc2gKJCBoZWxtIGluc3RhbGwgLS1uYW1lIG15LXJlbGVhc2UgXAogIC0tc2V0IGxlZ28uZW5hYmxlZD1mYWxzZSBcCiAgICBzdGFibGUvbmdpbngtbGVnbwpgYGAKCkluc3RhbGxzIHRoZSBjaGFydCB3aXRob3V0IGt1YmUtbGVnbyBhbmQgdGhlIGFiaWxpdHkgdG8gZ2VuZXJhdGUgY2VydHMuCgpBbHRlcm5hdGl2ZWx5LCBhIFlBTUwgZmlsZSB0aGF0IHNwZWNpZmllcyB0aGUgdmFsdWVzIGZvciB0aGUgcGFyYW1ldGVycyBjYW4gYmUgcHJvdmlkZWQgd2hpbGUgaW5zdGFsbGluZyB0aGUgY2hhcnQuIEZvciBleGFtcGxlLAoKYGBgYmFzaAokIGhlbG0gaW5zdGFsbCAtLW5hbWUgbXktcmVsZWFzZSAtZiB2YWx1ZXMueWFtbCBzdGFibGUvbmdpbngtbGVnbwpgYGAKCj4gKipUaXAqKjogWW91IGNhbiB1c2UgdGhlIGRlZmF1bHQgW3ZhbHVlcy55YW1sXSh2YWx1ZXMueWFtbCkK @@ -23717,7 +23826,7 @@ components: sources: - https://github.com/kubernetes/ingress-nginx keywords: - - ingress, nginx + - "ingress, nginx" created: 2018-04-11T18:11:24.761440762Z deprecated: false icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png @@ -23733,13 +23842,14 @@ components: digest: cf66d1666019b3e1647ba4dbc06a66ee7db1184629ae3669e11a9f72208eb7aa properties: chart: - $ref: '#/components/schemas/HelmChartDetailsResponse_chart' + $ref: '#/components/schemas/HelmChartsListResponse_inner_charts_inner_inner' values: example: IyMgbmdpbngtbGVnbyBzcGlucyB1cCBhIHNjYWxhYmxlIGluZ3Jlc3MgcHJvdmlkZXIgdGhhdCBjYW4gYWxzbyBwcm92aXNpb24gU1NMIGNlcnRzCiMjIFNlZSBodHRwczovL2dpdGh1Yi5jb20vamV0c3RhY2sva3ViZS1sZWdvL3RyZWUvbWFzdGVyL2V4YW1wbGVzL25naW54IGZvciBtb3JlIGluZm9ybWF0aW9uIG9uIGltcGxlbWVudGF0aW9uCgojIyBOZ2lueCBjb25maWd1cmF0aW9uCiMjIHJlZjogaHR0cHM6Ly9naXRodWIuY29tL2t1YmVybmV0ZXMvY29udHJpYi90cmVlL21hc3Rlci9pbmdyZXNzL2NvbnRyb2xsZXJzL25naW54I2F1dG9tYXRlZC1jZXJ0aWZpY2F0ZS1tYW5hZ2VtZW50LXdpdGgta3ViZS1sZWdvCiMjCm5naW54OgogIHJlcGxpY2FDb3VudDogMQogIGltYWdlOgogICAgcmVwb3NpdG9yeTogazhzLmdjci5pby9uZ2lueC1pbmdyZXNzLWNvbnRyb2xsZXIKICAgIHRhZzogIjAuOC4zIgogICAgcHVsbFBvbGljeTogSWZOb3RQcmVzZW50CiAgc2VydmljZToKICAgIHR5cGU6IExvYWRCYWxhbmNlcgogIG1vbml0b3Jpbmc6IGZhbHNlCiAgcmVzb3VyY2VzOgogICAgbGltaXRzOgogICAgICBjcHU6IDEKICAgICAgbWVtb3J5OiAyR2kKICAgIHJlcXVlc3RzOgogICAgICBjcHU6IDEKICAgICAgbWVtb3J5OiAxMjhNaQogIGNvbmZpZ21hcDoKICAgIHByb3h5X2Nvbm5lY3RfdGltZW91dDogIjMwIgogICAgcHJveHlfcmVhZF90aW1lb3V0OiAiNjAwIgogICAgcHJveHlfc2VuZF9pbWVvdXQ6ICI2MDAiCiAgICBoc3RzX2luY2x1ZGVfc3ViZG9tYWluczogImZhbHNlIgogICAgYm9keV9zaXplOiAiNjRtIgogICAgc2VydmVyX25hbWVfaGFzaF9idWNrZXRfc2l6ZTogIjI1NiIKICAgICMgVE9ETzogZmlndXJlIG91dCBob3cgdG8gZXhwb3NlIGB7bmdpbnhfYWRkcn06ODA4MC9uZ2lueF9zdGF0dXNgLCBvbiBleGlzdGluZyBzZXJ2aWNlIG9yIGNyZWF0ZSBuZXcgb25lPwogICAgZW5hYmxlX3Z0c19zdGF0dXM6ICJmYWxzZSIKCiMjIERlZmF1bHQgQmFja2VuZCBjb25maWd1cmF0aW9uCiMjIFRvIHJ1biBhIGRpZmZlcmVudCA0MDQgcGFnZSBmb3IgdGhlIG1hbmFnZWQgZG9tYWlucyBwbGVhc2Ugc2VlIHRoZSBkb2N1bWVudGF0aW9uIGJlbG93CiMjIHJlZjogaHR0cHM6Ly9naXRodWIuY29tL2t1YmVybmV0ZXMvY29udHJpYi90cmVlL21hc3Rlci80MDQtc2VydmVyCiMjCmRlZmF1bHQ6CiAgcmVwbGljYUNvdW50OiAxCiAgaW1hZ2U6CiAgICByZXBvc2l0b3J5OiBrOHMuZ2NyLmlvL2RlZmF1bHRiYWNrZW5kCiAgICB0YWc6ICIxLjAiCiAgICBwdWxsUG9saWN5OiBJZk5vdFByZXNlbnQKICByZXNvdXJjZXM6CiAgICBsaW1pdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDJHaQogICAgcmVxdWVzdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDEyOE1pCgojIyBrdWJlLWxlZ28gY29uZmlndXJhdGlvbgojIyByZWY6IGh0dHBzOi8vZ2l0aHViLmNvbS9qZXRzdGFjay9rdWJlLWxlZ28KIyMKbGVnbzoKICBlbmFibGVkOiBmYWxzZQogIHJlcGxpY2FDb3VudDogMQogIGltYWdlOgogICAgcmVwb3NpdG9yeTogamV0c3RhY2sva3ViZS1sZWdvCiAgICB0YWc6ICIwLjEuMyIKICAgIHB1bGxQb2xpY3k6IElmTm90UHJlc2VudAogIGNvbmZpZ21hcDoKICAgIGVtYWlsOiAibXlAZW1haWwudGxkIgogICAgIyBQcm9kdWN0aW9uIExldCdzIEVuY3J5cHQgc2VydmVyCiAgICAjIHVybDogImh0dHBzOi8vYWNtZS12MDEuYXBpLmxldHNlbmNyeXB0Lm9yZy9kaXJlY3RvcnkiCiAgICAjIFRlc3QgTGV0J3MgRW5jcnlwdCBzZXJ2ZXIKICAgIHVybDogImh0dHBzOi8vYWNtZS1zdGFnaW5nLmFwaS5sZXRzZW5jcnlwdC5vcmcvZGlyZWN0b3J5ICIKICByZXNvdXJjZXM6CiAgICBsaW1pdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDJHaQogICAgcmVxdWVzdHM6CiAgICAgIGNwdTogMQogICAgICBtZW1vcnk6IDEyOE1pCg== type: string readme: example: IyBuZ2lueC1sZWdvCgoqKlRoaXMgY2hhcnQgaGFzIGJlZW4gZGVwcmVjYXRlZCBhcyBvZiB2ZXJzaW9uIDAuMi4xIGFuZCB3aWxsIG5vdCBiZSB1cGRhdGVkLiBQbGVhc2UgdXNlIHRoZSBuZ2lueC1pbmdyZXNzIGFuZCAob3B0aW9uYWwpIGt1YmUtbGVnbyBjaGFydHMgaW5zdGVhZC4qKgoKW25naW54LWxlZ29dKGh0dHBzOi8vZ2l0aHViLmNvbS9qZXRzdGFjay9rdWJlLWxlZ28vdHJlZS9tYXN0ZXIvZXhhbXBsZXMvbmdpbngpIGlzIGEgY2hhcnQgZm9yIGFuIFtgbmdpbnhgIGluZ3Jlc3NdKGh0dHBzOi8vZ2l0aHViLmNvbS9rdWJlcm5ldGVzL2NvbnRyaWIvdHJlZS9tYXN0ZXIvaW5ncmVzcy9jb250cm9sbGVycy9uZ2lueCkgd2l0aCBvcHRpb25hbCBzdXBwb3J0IGZvciBhdXRvbWF0aWNhbGx5IGdlbmVyYXRpbmcgYFNTTGAgY2VydCBmb3IgdGhlIG1hbmFnZWQgcm91dGVzLgoKVG8gdXNlIHRoaXMgaW5ncmVzcyBjb250b2xsZXIgYWRkIHRoZSBmb2xsb3dpbmcgYW5ub3RhdGlvbnMgdG8gdGhlIGBpbmdyZXNzYCByZXNvdXJjZXMgeW91IHdvdWxkIGxpa2UgdG8gcm91dGUgdGhyb3VnaCBpdDoKCmBgYHlhbWwKYXBpVmVyc2lvbjogZXh0ZW5zaW9ucy92MWJldGExCmtpbmQ6IEluZ3Jlc3MKbWV0YWRhdGE6CiAgbmFtZXNwYWNlOiBmb28KICBhbm5vdGF0aW9uczoKICAgICMgQWRkIHRvIHJvdXRlIHRocm91Z2ggdGhlIG5naW54IHNlcnZpY2UKICAgIGt1YmVybmV0ZXMuaW8vaW5ncmVzcy5jbGFzczogbmdpbngKICAgICMgQWRkIHRvIGdlbmVyYXRlIGNlcnRpZmljYXRlcyBmb3IgdGhpcyBpbmdyZXNzCiAgICBrdWJlcm5ldGVzLmlvL3Rscy1hY21lOiAidHJ1ZSIKc3BlYzoKICB0bHM6CiAgICAjIFdpdGggdGhpcyBjb25maWd1cmF0aW9uIGt1YmUtbGVnbyB3aWxsIGdlbmVyYXRlIGEgc2VjcmV0IGluIG5hbWVzcGFjZSBmb28gY2FsbGVkIGBleGFtcGxlLXRsc2AKICAgICMgZm9yIHRoZSBVUkwgYHd3dy5leGFtcGxlLmNvbWAKICAgIC0gaG9zdHM6CiAgICAgIC0gInd3dy5leGFtcGxlLmNvbSIKICAgICAgc2VjcmV0TmFtZTogZXhhbXBsZS10bHMKYGBgCgojIyBUTDtEUjsKCmBgYGJhc2gKJCBoZWxtIGluc3RhbGwgc3RhYmxlL2t1YmUtbGVnbwpgYGAKCiMjIEludHJvZHVjdGlvbgoKVGhpcyBjaGFydCBib290c3RyYXBzIGFuIG5naW54LWxlZ28gZGVwbG95bWVudCBvbiBhIFtLdWJlcm5ldGVzXShodHRwOi8va3ViZXJuZXRlcy5pbykgY2x1c3RlciB1c2luZyB0aGUgW0hlbG1dKGh0dHBzOi8vaGVsbS5zaCkgcGFja2FnZSBtYW5hZ2VyLgoKIyMgUHJlcmVxdWlzaXRlcwoKLSBLdWJlcm5ldGVzIDEuNCsgd2l0aCBCZXRhIEFQSXMgZW5hYmxlZAoKIyMgSW5zdGFsbGluZyB0aGUgQ2hhcnQKClRvIGluc3RhbGwgdGhlIGNoYXJ0IHdpdGggdGhlIHJlbGVhc2UgbmFtZSBgbXktcmVsZWFzZWA6CgpgYGBiYXNoCiQgaGVsbSBpbnN0YWxsIC0tbmFtZSBteS1yZWxlYXNlIHN0YWJsZS9uZ2lueC1sZWdvCmBgYAoKVGhlIGNvbW1hbmQgZGVwbG95cyBuZ2lueC1sZWdvIG9uIHRoZSBLdWJlcm5ldGVzIGNsdXN0ZXIgaW4gdGhlIGRlZmF1bHQgY29uZmlndXJhdGlvbi4gVGhlIFtjb25maWd1cmF0aW9uXSgjY29uZmlndXJhdGlvbikgc2VjdGlvbiBsaXN0cyB0aGUgcGFyYW1ldGVycyB0aGF0IGNhbiBiZSBjb25maWd1cmVkIGR1cmluZyBpbnN0YWxsYXRpb24uCgo+ICoqVGlwKio6IExpc3QgYWxsIHJlbGVhc2VzIHVzaW5nIGBoZWxtIGxpc3RgCgojIyBVbmluc3RhbGxpbmcgdGhlIENoYXJ0CgpUbyB1bmluc3RhbGwvZGVsZXRlIHRoZSBgbXktcmVsZWFzZWAgZGVwbG95bWVudDoKCmBgYGJhc2gKJCBoZWxtIGRlbGV0ZSBteS1yZWxlYXNlCmBgYAoKVGhlIGNvbW1hbmQgcmVtb3ZlcyBhbGwgdGhlIEt1YmVybmV0ZXMgY29tcG9uZW50cyBhc3NvY2lhdGVkIHdpdGggdGhlIGNoYXJ0IGFuZCBkZWxldGVzIHRoZSByZWxlYXNlLgoKIyMgQ29uZmlndXJhdGlvbgoKU2VlIGB2YWx1ZXMueWFtbGAgZm9yIGNvbmZpZ3VyYXRpb24gbm90ZXMuIFNwZWNpZnkgZWFjaCBwYXJhbWV0ZXIgdXNpbmcgdGhlIGAtLXNldCBrZXk9dmFsdWVbLGtleT12YWx1ZV1gIGFyZ3VtZW50IHRvIGBoZWxtIGluc3RhbGxgLiBGb3IgZXhhbXBsZSwKCmBgYGJhc2gKJCBoZWxtIGluc3RhbGwgLS1uYW1lIG15LXJlbGVhc2UgXAogIC0tc2V0IGxlZ28uZW5hYmxlZD1mYWxzZSBcCiAgICBzdGFibGUvbmdpbngtbGVnbwpgYGAKCkluc3RhbGxzIHRoZSBjaGFydCB3aXRob3V0IGt1YmUtbGVnbyBhbmQgdGhlIGFiaWxpdHkgdG8gZ2VuZXJhdGUgY2VydHMuCgpBbHRlcm5hdGl2ZWx5LCBhIFlBTUwgZmlsZSB0aGF0IHNwZWNpZmllcyB0aGUgdmFsdWVzIGZvciB0aGUgcGFyYW1ldGVycyBjYW4gYmUgcHJvdmlkZWQgd2hpbGUgaW5zdGFsbGluZyB0aGUgY2hhcnQuIEZvciBleGFtcGxlLAoKYGBgYmFzaAokIGhlbG0gaW5zdGFsbCAtLW5hbWUgbXktcmVsZWFzZSAtZiB2YWx1ZXMueWFtbCBzdGFibGUvbmdpbngtbGVnbwpgYGAKCj4gKipUaXAqKjogWW91IGNhbiB1c2UgdGhlIGRlZmF1bHQgW3ZhbHVlcy55YW1sXSh2YWx1ZXMueWFtbCkK type: string + type: object InstallSecretsRequest_query: example: ids: @@ -23763,7 +23873,8 @@ components: items: type: string type: array - SecretTypeResponse_fields: + type: object + SecretTypeResponse_fields_inner: example: name: name isSafeToDisplay: true @@ -23778,6 +23889,7 @@ components: type: boolean description: type: string + type: object BucketInfo_secret: example: accessId: cc051aeaf686444e2f125d0e79eb051aaaf4fb73384f7b0f8c89e84a0502dcef @@ -23801,6 +23913,7 @@ components: type: string required: - id + type: object PodItem_labels: example: app: pipeline-traefik @@ -23816,6 +23929,7 @@ components: release: example: pipeline type: string + type: object PKEClusterReadinessResponse_master: example: ready: true @@ -23824,6 +23938,7 @@ components: description: true when the node has been reported to be ready example: true type: boolean + type: object securitySchemes: bearerAuth: bearerFormat: JWT diff --git a/.gen/pipeline/pipeline/BUILD.plz b/.gen/pipeline/pipeline/BUILD.plz index 877b8e7796..d3771fa7c0 100644 --- a/.gen/pipeline/pipeline/BUILD.plz +++ b/.gen/pipeline/pipeline/BUILD.plz @@ -2,5 +2,7 @@ go_library( name = "pipeline", srcs = glob(["*.go"], exclude = ["*_test.go"]), visibility = ["PUBLIC"], - deps = [], + deps = [ + "//third_party/go:github.com__gorilla__mux", + ], ) diff --git a/.gen/pipeline/pipeline/error.go b/.gen/pipeline/pipeline/error.go new file mode 100644 index 0000000000..5c08f257cf --- /dev/null +++ b/.gen/pipeline/pipeline/error.go @@ -0,0 +1,63 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +import ( + "errors" + "fmt" + "net/http" +) + +var ( + // ErrTypeAssertionError is thrown when type an interface does not match the asserted type + ErrTypeAssertionError = errors.New("unable to assert type") +) + +// ParsingError indicates that an error has occurred when parsing request parameters +type ParsingError struct { + Err error +} + +func (e *ParsingError) Unwrap() error { + return e.Err +} + +func (e *ParsingError) Error() string { + return e.Err.Error() +} + +// RequiredError indicates that an error has occurred when parsing request parameters +type RequiredError struct { + Field string +} + +func (e *RequiredError) Error() string { + return fmt.Sprintf("required field '%s' is zero value.", e.Field) +} + +// ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if +// you would like errors to be handled differently from the DefaultErrorHandler +type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) + +// DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing +// request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used. +func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) { + if _, ok := err.(*ParsingError); ok { + // Handle parsing errors + EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), w) + } else if _, ok := err.(*RequiredError); ok { + // Handle missing required errors + EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), w) + } else { + // Handle all other errors + EncodeJSONResponse(err.Error(), &result.Code, w) + } +} diff --git a/.gen/pipeline/pipeline/helpers.go b/.gen/pipeline/pipeline/helpers.go new file mode 100644 index 0000000000..1cf7358601 --- /dev/null +++ b/.gen/pipeline/pipeline/helpers.go @@ -0,0 +1,55 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +import ( + "reflect" +) + +// Response return a ImplResponse struct filled +func Response(code int, body interface{}) ImplResponse { + return ImplResponse { + Code: code, + Body: body, + } +} + +// IsZeroValue checks if the val is the zero-ed value. +func IsZeroValue(val interface{}) bool { + return val == nil || reflect.DeepEqual(val, reflect.Zero(reflect.TypeOf(val)).Interface()) +} + +// AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback. +// This method traverse nested slices in a preorder fashion. +func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error { + return AssertRecurseValueRequired(reflect.ValueOf(obj), callback) +} + +// AssertRecurseValueRequired checks each struct in the nested slice against the callback. +// This method traverse nested slices in a preorder fashion. +func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error { + switch value.Kind() { + // If it is a struct we check using callback + case reflect.Struct: + if err := callback(value.Interface()); err != nil { + return err + } + + // If it is a slice we continue recursion + case reflect.Slice: + for i := 0; i < value.Len(); i += 1 { + if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil { + return err + } + } + } + return nil +} diff --git a/.gen/pipeline/pipeline/model_update_pke_on_vsphere_cluster_request.go b/.gen/pipeline/pipeline/impl.go similarity index 74% rename from .gen/pipeline/pipeline/model_update_pke_on_vsphere_cluster_request.go rename to .gen/pipeline/pipeline/impl.go index 827d0525d0..195341bd17 100644 --- a/.gen/pipeline/pipeline/model_update_pke_on_vsphere_cluster_request.go +++ b/.gen/pipeline/pipeline/impl.go @@ -10,7 +10,8 @@ package pipeline -type UpdatePkeOnVsphereClusterRequest struct { - - Nodepools []PkeOnVsphereNodePool `json:"nodepools,omitempty"` +// ImplResponse response defines an error code with the associated body +type ImplResponse struct { + Code int + Body interface{} } diff --git a/.gen/pipeline/pipeline/model_secret_type_response_fields.go b/.gen/pipeline/pipeline/logger.go similarity index 54% rename from .gen/pipeline/pipeline/model_secret_type_response_fields.go rename to .gen/pipeline/pipeline/logger.go index 4d2b25bd8f..a98e33c265 100644 --- a/.gen/pipeline/pipeline/model_secret_type_response_fields.go +++ b/.gen/pipeline/pipeline/logger.go @@ -10,13 +10,24 @@ package pipeline -type SecretTypeResponseFields struct { +import ( + "log" + "net/http" + "time" +) - Name string `json:"name,omitempty"` +func Logger(inner http.Handler, name string) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() - Required bool `json:"required,omitempty"` + inner.ServeHTTP(w, r) - IsSafeToDisplay bool `json:"isSafeToDisplay,omitempty"` - - Description string `json:"description,omitempty"` + log.Printf( + "%s %s %s %s", + r.Method, + r.RequestURI, + name, + time.Since(start), + ) + }) } diff --git a/.gen/pipeline/pipeline/model_activate_integrated_service_request.go b/.gen/pipeline/pipeline/model_activate_integrated_service_request.go index 1fe10a0d29..a14edc65b6 100644 --- a/.gen/pipeline/pipeline/model_activate_integrated_service_request.go +++ b/.gen/pipeline/pipeline/model_activate_integrated_service_request.go @@ -14,3 +14,29 @@ type ActivateIntegratedServiceRequest struct { Spec map[string]interface{} `json:"spec"` } + +// AssertActivateIntegratedServiceRequestRequired checks if the required fields are not zero-ed +func AssertActivateIntegratedServiceRequestRequired(obj ActivateIntegratedServiceRequest) error { + elements := map[string]interface{}{ + "spec": obj.Spec, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseActivateIntegratedServiceRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ActivateIntegratedServiceRequest (e.g. [][]ActivateIntegratedServiceRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseActivateIntegratedServiceRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aActivateIntegratedServiceRequest, ok := obj.(ActivateIntegratedServiceRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertActivateIntegratedServiceRequestRequired(aActivateIntegratedServiceRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_amazon_auto_scaling_group.go b/.gen/pipeline/pipeline/model_amazon_auto_scaling_group.go index d487255331..51404e01f0 100644 --- a/.gen/pipeline/pipeline/model_amazon_auto_scaling_group.go +++ b/.gen/pipeline/pipeline/model_amazon_auto_scaling_group.go @@ -33,9 +33,48 @@ type AmazonAutoScalingGroup struct { Subnets []string `json:"subnets"` - Tags map[string]map[string]interface{} `json:"tags"` + Tags map[string]interface{} `json:"tags"` SpotPrice string `json:"spotPrice"` Size AmazonAutoScalingGroupSize `json:"size"` } + +// AssertAmazonAutoScalingGroupRequired checks if the required fields are not zero-ed +func AssertAmazonAutoScalingGroupRequired(obj AmazonAutoScalingGroup) error { + elements := map[string]interface{}{ + "name": obj.Name, + "image": obj.Image, + "zones": obj.Zones, + "instanceType": obj.InstanceType, + "launchConfigurationName": obj.LaunchConfigurationName, + "vpcID": obj.VpcID, + "securityGroupID": obj.SecurityGroupID, + "subnets": obj.Subnets, + "tags": obj.Tags, + "spotPrice": obj.SpotPrice, + "size": obj.Size, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertAmazonAutoScalingGroupSizeRequired(obj.Size); err != nil { + return err + } + return nil +} + +// AssertRecurseAmazonAutoScalingGroupRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of AmazonAutoScalingGroup (e.g. [][]AmazonAutoScalingGroup), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseAmazonAutoScalingGroupRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aAmazonAutoScalingGroup, ok := obj.(AmazonAutoScalingGroup) + if !ok { + return ErrTypeAssertionError + } + return AssertAmazonAutoScalingGroupRequired(aAmazonAutoScalingGroup) + }) +} diff --git a/.gen/pipeline/pipeline/model_amazon_auto_scaling_group_size.go b/.gen/pipeline/pipeline/model_amazon_auto_scaling_group_size.go index 57fcbdfa4c..f784a480e3 100644 --- a/.gen/pipeline/pipeline/model_amazon_auto_scaling_group_size.go +++ b/.gen/pipeline/pipeline/model_amazon_auto_scaling_group_size.go @@ -16,3 +16,30 @@ type AmazonAutoScalingGroupSize struct { Max int32 `json:"max"` } + +// AssertAmazonAutoScalingGroupSizeRequired checks if the required fields are not zero-ed +func AssertAmazonAutoScalingGroupSizeRequired(obj AmazonAutoScalingGroupSize) error { + elements := map[string]interface{}{ + "min": obj.Min, + "max": obj.Max, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseAmazonAutoScalingGroupSizeRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of AmazonAutoScalingGroupSize (e.g. [][]AmazonAutoScalingGroupSize), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseAmazonAutoScalingGroupSizeRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aAmazonAutoScalingGroupSize, ok := obj.(AmazonAutoScalingGroupSize) + if !ok { + return ErrTypeAssertionError + } + return AssertAmazonAutoScalingGroupSizeRequired(aAmazonAutoScalingGroupSize) + }) +} diff --git a/.gen/pipeline/pipeline/model_amazon_provider_config.go b/.gen/pipeline/pipeline/model_amazon_provider_config.go index a3a80fb2f3..d62b2b17ca 100644 --- a/.gen/pipeline/pipeline/model_amazon_provider_config.go +++ b/.gen/pipeline/pipeline/model_amazon_provider_config.go @@ -14,3 +14,32 @@ type AmazonProviderConfig struct { AutoScalingGroup AmazonAutoScalingGroup `json:"autoScalingGroup"` } + +// AssertAmazonProviderConfigRequired checks if the required fields are not zero-ed +func AssertAmazonProviderConfigRequired(obj AmazonProviderConfig) error { + elements := map[string]interface{}{ + "autoScalingGroup": obj.AutoScalingGroup, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertAmazonAutoScalingGroupRequired(obj.AutoScalingGroup); err != nil { + return err + } + return nil +} + +// AssertRecurseAmazonProviderConfigRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of AmazonProviderConfig (e.g. [][]AmazonProviderConfig), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseAmazonProviderConfigRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aAmazonProviderConfig, ok := obj.(AmazonProviderConfig) + if !ok { + return ErrTypeAssertionError + } + return AssertAmazonProviderConfigRequired(aAmazonProviderConfig) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_cluster_group.go b/.gen/pipeline/pipeline/model_api_cluster_group.go index 368fb327dc..0ad979d6e6 100644 --- a/.gen/pipeline/pipeline/model_api_cluster_group.go +++ b/.gen/pipeline/pipeline/model_api_cluster_group.go @@ -24,3 +24,25 @@ type ApiClusterGroup struct { Uid string `json:"uid,omitempty"` } + +// AssertApiClusterGroupRequired checks if the required fields are not zero-ed +func AssertApiClusterGroupRequired(obj ApiClusterGroup) error { + for _, el := range obj.Members { + if err := AssertApiMemberRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseApiClusterGroupRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiClusterGroup (e.g. [][]ApiClusterGroup), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiClusterGroupRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiClusterGroup, ok := obj.(ApiClusterGroup) + if !ok { + return ErrTypeAssertionError + } + return AssertApiClusterGroupRequired(aApiClusterGroup) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_create_request.go b/.gen/pipeline/pipeline/model_api_create_request.go index 5042a279d3..d80243797e 100644 --- a/.gen/pipeline/pipeline/model_api_create_request.go +++ b/.gen/pipeline/pipeline/model_api_create_request.go @@ -16,3 +16,20 @@ type ApiCreateRequest struct { Name string `json:"name,omitempty"` } + +// AssertApiCreateRequestRequired checks if the required fields are not zero-ed +func AssertApiCreateRequestRequired(obj ApiCreateRequest) error { + return nil +} + +// AssertRecurseApiCreateRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiCreateRequest (e.g. [][]ApiCreateRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiCreateRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiCreateRequest, ok := obj.(ApiCreateRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertApiCreateRequestRequired(aApiCreateRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_create_response.go b/.gen/pipeline/pipeline/model_api_create_response.go index 79f30200e6..55463304a9 100644 --- a/.gen/pipeline/pipeline/model_api_create_response.go +++ b/.gen/pipeline/pipeline/model_api_create_response.go @@ -16,3 +16,20 @@ type ApiCreateResponse struct { Name string `json:"name,omitempty"` } + +// AssertApiCreateResponseRequired checks if the required fields are not zero-ed +func AssertApiCreateResponseRequired(obj ApiCreateResponse) error { + return nil +} + +// AssertRecurseApiCreateResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiCreateResponse (e.g. [][]ApiCreateResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiCreateResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiCreateResponse, ok := obj.(ApiCreateResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertApiCreateResponseRequired(aApiCreateResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_feature_response.go b/.gen/pipeline/pipeline/model_api_feature_response.go index 1452b8388f..6199eae090 100644 --- a/.gen/pipeline/pipeline/model_api_feature_response.go +++ b/.gen/pipeline/pipeline/model_api_feature_response.go @@ -26,3 +26,23 @@ type ApiFeatureResponse struct { Status map[string]interface{} `json:"status,omitempty"` } + +// AssertApiFeatureResponseRequired checks if the required fields are not zero-ed +func AssertApiFeatureResponseRequired(obj ApiFeatureResponse) error { + if err := AssertApiClusterGroupRequired(obj.ClusterGroup); err != nil { + return err + } + return nil +} + +// AssertRecurseApiFeatureResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiFeatureResponse (e.g. [][]ApiFeatureResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiFeatureResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiFeatureResponse, ok := obj.(ApiFeatureResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertApiFeatureResponseRequired(aApiFeatureResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_member.go b/.gen/pipeline/pipeline/model_api_member.go index 0309e74928..d8d72dcad1 100644 --- a/.gen/pipeline/pipeline/model_api_member.go +++ b/.gen/pipeline/pipeline/model_api_member.go @@ -22,3 +22,20 @@ type ApiMember struct { Status string `json:"status,omitempty"` } + +// AssertApiMemberRequired checks if the required fields are not zero-ed +func AssertApiMemberRequired(obj ApiMember) error { + return nil +} + +// AssertRecurseApiMemberRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiMember (e.g. [][]ApiMember), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiMemberRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiMember, ok := obj.(ApiMember) + if !ok { + return ErrTypeAssertionError + } + return AssertApiMemberRequired(aApiMember) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_update_request.go b/.gen/pipeline/pipeline/model_api_update_request.go index a5523a0eeb..5ad57e8398 100644 --- a/.gen/pipeline/pipeline/model_api_update_request.go +++ b/.gen/pipeline/pipeline/model_api_update_request.go @@ -16,3 +16,20 @@ type ApiUpdateRequest struct { Name string `json:"name,omitempty"` } + +// AssertApiUpdateRequestRequired checks if the required fields are not zero-ed +func AssertApiUpdateRequestRequired(obj ApiUpdateRequest) error { + return nil +} + +// AssertRecurseApiUpdateRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiUpdateRequest (e.g. [][]ApiUpdateRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiUpdateRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiUpdateRequest, ok := obj.(ApiUpdateRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertApiUpdateRequestRequired(aApiUpdateRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_api_update_response.go b/.gen/pipeline/pipeline/model_api_update_response.go index bf666c9469..c97430dd87 100644 --- a/.gen/pipeline/pipeline/model_api_update_response.go +++ b/.gen/pipeline/pipeline/model_api_update_response.go @@ -16,3 +16,20 @@ type ApiUpdateResponse struct { Name string `json:"name,omitempty"` } + +// AssertApiUpdateResponseRequired checks if the required fields are not zero-ed +func AssertApiUpdateResponseRequired(obj ApiUpdateResponse) error { + return nil +} + +// AssertRecurseApiUpdateResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ApiUpdateResponse (e.g. [][]ApiUpdateResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseApiUpdateResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aApiUpdateResponse, ok := obj.(ApiUpdateResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertApiUpdateResponseRequired(aApiUpdateResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_azure_blob_storage_props.go b/.gen/pipeline/pipeline/model_azure_blob_storage_props.go index 7163dc5686..16a47550ee 100644 --- a/.gen/pipeline/pipeline/model_azure_blob_storage_props.go +++ b/.gen/pipeline/pipeline/model_azure_blob_storage_props.go @@ -16,3 +16,30 @@ type AzureBlobStorageProps struct { StorageAccount string `json:"storageAccount"` } + +// AssertAzureBlobStoragePropsRequired checks if the required fields are not zero-ed +func AssertAzureBlobStoragePropsRequired(obj AzureBlobStorageProps) error { + elements := map[string]interface{}{ + "resourceGroup": obj.ResourceGroup, + "storageAccount": obj.StorageAccount, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseAzureBlobStoragePropsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of AzureBlobStorageProps (e.g. [][]AzureBlobStorageProps), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseAzureBlobStoragePropsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aAzureBlobStorageProps, ok := obj.(AzureBlobStorageProps) + if !ok { + return ErrTypeAssertionError + } + return AssertAzureBlobStoragePropsRequired(aAzureBlobStorageProps) + }) +} diff --git a/.gen/pipeline/pipeline/model_backup_bucket_response.go b/.gen/pipeline/pipeline/model_backup_bucket_response.go index dabcd10bb6..9087a5419f 100644 --- a/.gen/pipeline/pipeline/model_backup_bucket_response.go +++ b/.gen/pipeline/pipeline/model_backup_bucket_response.go @@ -24,3 +24,20 @@ type BackupBucketResponse struct { InUse bool `json:"inUse,omitempty"` } + +// AssertBackupBucketResponseRequired checks if the required fields are not zero-ed +func AssertBackupBucketResponseRequired(obj BackupBucketResponse) error { + return nil +} + +// AssertRecurseBackupBucketResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BackupBucketResponse (e.g. [][]BackupBucketResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBackupBucketResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBackupBucketResponse, ok := obj.(BackupBucketResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertBackupBucketResponseRequired(aBackupBucketResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_backup_options.go b/.gen/pipeline/pipeline/model_backup_options.go index cf2816b0fa..aa2cdade6a 100644 --- a/.gen/pipeline/pipeline/model_backup_options.go +++ b/.gen/pipeline/pipeline/model_backup_options.go @@ -24,3 +24,20 @@ type BackupOptions struct { IncludeClusterResources bool `json:"includeClusterResources,omitempty"` } + +// AssertBackupOptionsRequired checks if the required fields are not zero-ed +func AssertBackupOptionsRequired(obj BackupOptions) error { + return nil +} + +// AssertRecurseBackupOptionsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BackupOptions (e.g. [][]BackupOptions), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBackupOptionsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBackupOptions, ok := obj.(BackupOptions) + if !ok { + return ErrTypeAssertionError + } + return AssertBackupOptionsRequired(aBackupOptions) + }) +} diff --git a/.gen/pipeline/pipeline/model_backup_response.go b/.gen/pipeline/pipeline/model_backup_response.go index f015288675..e54d2052cd 100644 --- a/.gen/pipeline/pipeline/model_backup_response.go +++ b/.gen/pipeline/pipeline/model_backup_response.go @@ -36,3 +36,26 @@ type BackupResponse struct { ClusterId int32 `json:"clusterId,omitempty"` } + +// AssertBackupResponseRequired checks if the required fields are not zero-ed +func AssertBackupResponseRequired(obj BackupResponse) error { + if err := AssertLabelsRequired(obj.Labels); err != nil { + return err + } + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseBackupResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BackupResponse (e.g. [][]BackupResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBackupResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBackupResponse, ok := obj.(BackupResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertBackupResponseRequired(aBackupResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_backup_service_response.go b/.gen/pipeline/pipeline/model_backup_service_response.go index d97ed7baf8..f69b98db8d 100644 --- a/.gen/pipeline/pipeline/model_backup_service_response.go +++ b/.gen/pipeline/pipeline/model_backup_service_response.go @@ -14,3 +14,20 @@ type BackupServiceResponse struct { Enabled bool `json:"enabled,omitempty"` } + +// AssertBackupServiceResponseRequired checks if the required fields are not zero-ed +func AssertBackupServiceResponseRequired(obj BackupServiceResponse) error { + return nil +} + +// AssertRecurseBackupServiceResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BackupServiceResponse (e.g. [][]BackupServiceResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBackupServiceResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBackupServiceResponse, ok := obj.(BackupServiceResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertBackupServiceResponseRequired(aBackupServiceResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_base_post_hook.go b/.gen/pipeline/pipeline/model_base_post_hook.go index 290f6d2a56..95e4a222df 100644 --- a/.gen/pipeline/pipeline/model_base_post_hook.go +++ b/.gen/pipeline/pipeline/model_base_post_hook.go @@ -14,3 +14,20 @@ type BasePostHook struct { PostHookFunctionName map[string]interface{} `json:"PostHookFunctionName,omitempty"` } + +// AssertBasePostHookRequired checks if the required fields are not zero-ed +func AssertBasePostHookRequired(obj BasePostHook) error { + return nil +} + +// AssertRecurseBasePostHookRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BasePostHook (e.g. [][]BasePostHook), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBasePostHookRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBasePostHook, ok := obj.(BasePostHook) + if !ok { + return ErrTypeAssertionError + } + return AssertBasePostHookRequired(aBasePostHook) + }) +} diff --git a/.gen/pipeline/pipeline/model_base_update_node_pool_options.go b/.gen/pipeline/pipeline/model_base_update_node_pool_options.go index 23f1307674..039947f1d3 100644 --- a/.gen/pipeline/pipeline/model_base_update_node_pool_options.go +++ b/.gen/pipeline/pipeline/model_base_update_node_pool_options.go @@ -24,3 +24,23 @@ type BaseUpdateNodePoolOptions struct { Drain UpdateNodePoolDrainOptions `json:"drain,omitempty"` } + +// AssertBaseUpdateNodePoolOptionsRequired checks if the required fields are not zero-ed +func AssertBaseUpdateNodePoolOptionsRequired(obj BaseUpdateNodePoolOptions) error { + if err := AssertUpdateNodePoolDrainOptionsRequired(obj.Drain); err != nil { + return err + } + return nil +} + +// AssertRecurseBaseUpdateNodePoolOptionsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BaseUpdateNodePoolOptions (e.g. [][]BaseUpdateNodePoolOptions), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBaseUpdateNodePoolOptionsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBaseUpdateNodePoolOptions, ok := obj.(BaseUpdateNodePoolOptions) + if !ok { + return ErrTypeAssertionError + } + return AssertBaseUpdateNodePoolOptionsRequired(aBaseUpdateNodePoolOptions) + }) +} diff --git a/.gen/pipeline/pipeline/model_base_update_node_pool_request.go b/.gen/pipeline/pipeline/model_base_update_node_pool_request.go index 4c693d6076..1bd35745f5 100644 --- a/.gen/pipeline/pipeline/model_base_update_node_pool_request.go +++ b/.gen/pipeline/pipeline/model_base_update_node_pool_request.go @@ -19,3 +19,29 @@ type BaseUpdateNodePoolRequest struct { // Node pool labels. Labels map[string]string `json:"labels,omitempty"` } + +// AssertBaseUpdateNodePoolRequestRequired checks if the required fields are not zero-ed +func AssertBaseUpdateNodePoolRequestRequired(obj BaseUpdateNodePoolRequest) error { + elements := map[string]interface{}{ + "size": obj.Size, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseBaseUpdateNodePoolRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BaseUpdateNodePoolRequest (e.g. [][]BaseUpdateNodePoolRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBaseUpdateNodePoolRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBaseUpdateNodePoolRequest, ok := obj.(BaseUpdateNodePoolRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertBaseUpdateNodePoolRequestRequired(aBaseUpdateNodePoolRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_bucket_info.go b/.gen/pipeline/pipeline/model_bucket_info.go index 7ebf1820e5..e0e0721aa4 100644 --- a/.gen/pipeline/pipeline/model_bucket_info.go +++ b/.gen/pipeline/pipeline/model_bucket_info.go @@ -37,3 +37,39 @@ type BucketInfo struct { // the reason for the error status StatusMessage string `json:"statusMessage,omitempty"` } + +// AssertBucketInfoRequired checks if the required fields are not zero-ed +func AssertBucketInfoRequired(obj BucketInfo) error { + elements := map[string]interface{}{ + "name": obj.Name, + "managed": obj.Managed, + "cloud": obj.Cloud, + "location": obj.Location, + "status": obj.Status, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertBucketInfoSecretRequired(obj.Secret); err != nil { + return err + } + if err := AssertAzureBlobStoragePropsRequired(obj.Aks); err != nil { + return err + } + return nil +} + +// AssertRecurseBucketInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BucketInfo (e.g. [][]BucketInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBucketInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBucketInfo, ok := obj.(BucketInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertBucketInfoRequired(aBucketInfo) + }) +} diff --git a/.gen/pipeline/pipeline/model_bucket_info_secret.go b/.gen/pipeline/pipeline/model_bucket_info_secret.go index df22ab26d0..7a916fbade 100644 --- a/.gen/pipeline/pipeline/model_bucket_info_secret.go +++ b/.gen/pipeline/pipeline/model_bucket_info_secret.go @@ -22,3 +22,29 @@ type BucketInfoSecret struct { // the secret name of the azure access information AccessName string `json:"accessName,omitempty"` } + +// AssertBucketInfoSecretRequired checks if the required fields are not zero-ed +func AssertBucketInfoSecretRequired(obj BucketInfoSecret) error { + elements := map[string]interface{}{ + "id": obj.Id, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseBucketInfoSecretRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of BucketInfoSecret (e.g. [][]BucketInfoSecret), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseBucketInfoSecretRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aBucketInfoSecret, ok := obj.(BucketInfoSecret) + if !ok { + return ErrTypeAssertionError + } + return AssertBucketInfoSecretRequired(aBucketInfoSecret) + }) +} diff --git a/.gen/pipeline/pipeline/model_cluster_config.go b/.gen/pipeline/pipeline/model_cluster_config.go index 633c3cd5a0..a74628f9d0 100644 --- a/.gen/pipeline/pipeline/model_cluster_config.go +++ b/.gen/pipeline/pipeline/model_cluster_config.go @@ -16,3 +16,20 @@ type ClusterConfig struct { Data string `json:"data,omitempty"` } + +// AssertClusterConfigRequired checks if the required fields are not zero-ed +func AssertClusterConfigRequired(obj ClusterConfig) error { + return nil +} + +// AssertRecurseClusterConfigRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ClusterConfig (e.g. [][]ClusterConfig), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseClusterConfigRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aClusterConfig, ok := obj.(ClusterConfig) + if !ok { + return ErrTypeAssertionError + } + return AssertClusterConfigRequired(aClusterConfig) + }) +} diff --git a/.gen/pipeline/pipeline/model_cluster_image.go b/.gen/pipeline/pipeline/model_cluster_image.go index d365a465a4..fb9ebaab0d 100644 --- a/.gen/pipeline/pipeline/model_cluster_image.go +++ b/.gen/pipeline/pipeline/model_cluster_image.go @@ -18,3 +18,20 @@ type ClusterImage struct { ImageDigest string `json:"imageDigest,omitempty"` } + +// AssertClusterImageRequired checks if the required fields are not zero-ed +func AssertClusterImageRequired(obj ClusterImage) error { + return nil +} + +// AssertRecurseClusterImageRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ClusterImage (e.g. [][]ClusterImage), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseClusterImageRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aClusterImage, ok := obj.(ClusterImage) + if !ok { + return ErrTypeAssertionError + } + return AssertClusterImageRequired(aClusterImage) + }) +} diff --git a/.gen/pipeline/pipeline/model_common_error.go b/.gen/pipeline/pipeline/model_common_error.go index 243420a87f..0065466462 100644 --- a/.gen/pipeline/pipeline/model_common_error.go +++ b/.gen/pipeline/pipeline/model_common_error.go @@ -22,3 +22,20 @@ type CommonError struct { // Error message Error string `json:"error,omitempty"` } + +// AssertCommonErrorRequired checks if the required fields are not zero-ed +func AssertCommonErrorRequired(obj CommonError) error { + return nil +} + +// AssertRecurseCommonErrorRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CommonError (e.g. [][]CommonError), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCommonErrorRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCommonError, ok := obj.(CommonError) + if !ok { + return ErrTypeAssertionError + } + return AssertCommonErrorRequired(aCommonError) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_aks_properties.go b/.gen/pipeline/pipeline/model_create_aks_properties.go index 474c751644..222837f0dd 100644 --- a/.gen/pipeline/pipeline/model_create_aks_properties.go +++ b/.gen/pipeline/pipeline/model_create_aks_properties.go @@ -14,3 +14,32 @@ type CreateAksProperties struct { Aks CreateAksPropertiesAks `json:"aks"` } + +// AssertCreateAksPropertiesRequired checks if the required fields are not zero-ed +func AssertCreateAksPropertiesRequired(obj CreateAksProperties) error { + elements := map[string]interface{}{ + "aks": obj.Aks, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreateAksPropertiesAksRequired(obj.Aks); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateAksPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateAksProperties (e.g. [][]CreateAksProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateAksPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateAksProperties, ok := obj.(CreateAksProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateAksPropertiesRequired(aCreateAksProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_aks_properties_aks.go b/.gen/pipeline/pipeline/model_create_aks_properties_aks.go index da562a01c5..b5ee74bef7 100644 --- a/.gen/pipeline/pipeline/model_create_aks_properties_aks.go +++ b/.gen/pipeline/pipeline/model_create_aks_properties_aks.go @@ -20,3 +20,31 @@ type CreateAksPropertiesAks struct { VnetSubnetID string `json:"vnetSubnetID,omitempty"` } + +// AssertCreateAksPropertiesAksRequired checks if the required fields are not zero-ed +func AssertCreateAksPropertiesAksRequired(obj CreateAksPropertiesAks) error { + elements := map[string]interface{}{ + "resourceGroup": obj.ResourceGroup, + "kubernetesVersion": obj.KubernetesVersion, + "nodePools": obj.NodePools, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateAksPropertiesAksRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateAksPropertiesAks (e.g. [][]CreateAksPropertiesAks), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateAksPropertiesAksRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateAksPropertiesAks, ok := obj.(CreateAksPropertiesAks) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateAksPropertiesAksRequired(aCreateAksPropertiesAks) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_amazon_object_store_bucket_properties.go b/.gen/pipeline/pipeline/model_create_amazon_object_store_bucket_properties.go index 7cf9a90bb6..c8a0d89653 100644 --- a/.gen/pipeline/pipeline/model_create_amazon_object_store_bucket_properties.go +++ b/.gen/pipeline/pipeline/model_create_amazon_object_store_bucket_properties.go @@ -14,3 +14,29 @@ type CreateAmazonObjectStoreBucketProperties struct { Location string `json:"location"` } + +// AssertCreateAmazonObjectStoreBucketPropertiesRequired checks if the required fields are not zero-ed +func AssertCreateAmazonObjectStoreBucketPropertiesRequired(obj CreateAmazonObjectStoreBucketProperties) error { + elements := map[string]interface{}{ + "location": obj.Location, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateAmazonObjectStoreBucketPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateAmazonObjectStoreBucketProperties (e.g. [][]CreateAmazonObjectStoreBucketProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateAmazonObjectStoreBucketPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateAmazonObjectStoreBucketProperties, ok := obj.(CreateAmazonObjectStoreBucketProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateAmazonObjectStoreBucketPropertiesRequired(aCreateAmazonObjectStoreBucketProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_azure_object_store_bucket_properties.go b/.gen/pipeline/pipeline/model_create_azure_object_store_bucket_properties.go index 9c79b27aad..fa887cd694 100644 --- a/.gen/pipeline/pipeline/model_create_azure_object_store_bucket_properties.go +++ b/.gen/pipeline/pipeline/model_create_azure_object_store_bucket_properties.go @@ -18,3 +18,31 @@ type CreateAzureObjectStoreBucketProperties struct { ResourceGroup string `json:"resourceGroup"` } + +// AssertCreateAzureObjectStoreBucketPropertiesRequired checks if the required fields are not zero-ed +func AssertCreateAzureObjectStoreBucketPropertiesRequired(obj CreateAzureObjectStoreBucketProperties) error { + elements := map[string]interface{}{ + "storageAccount": obj.StorageAccount, + "location": obj.Location, + "resourceGroup": obj.ResourceGroup, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateAzureObjectStoreBucketPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateAzureObjectStoreBucketProperties (e.g. [][]CreateAzureObjectStoreBucketProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateAzureObjectStoreBucketPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateAzureObjectStoreBucketProperties, ok := obj.(CreateAzureObjectStoreBucketProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateAzureObjectStoreBucketPropertiesRequired(aCreateAzureObjectStoreBucketProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_backup_bucket_request.go b/.gen/pipeline/pipeline/model_create_backup_bucket_request.go index 9d25e8c474..f473f626d0 100644 --- a/.gen/pipeline/pipeline/model_create_backup_bucket_request.go +++ b/.gen/pipeline/pipeline/model_create_backup_bucket_request.go @@ -29,3 +29,31 @@ type CreateBackupBucketRequest struct { // required only case of Azure ResourceGroup string `json:"resourceGroup,omitempty"` } + +// AssertCreateBackupBucketRequestRequired checks if the required fields are not zero-ed +func AssertCreateBackupBucketRequestRequired(obj CreateBackupBucketRequest) error { + elements := map[string]interface{}{ + "cloud": obj.Cloud, + "bucketName": obj.BucketName, + "secretId": obj.SecretId, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateBackupBucketRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateBackupBucketRequest (e.g. [][]CreateBackupBucketRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateBackupBucketRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateBackupBucketRequest, ok := obj.(CreateBackupBucketRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateBackupBucketRequestRequired(aCreateBackupBucketRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_backup_request.go b/.gen/pipeline/pipeline/model_create_backup_request.go index a890dff43b..0b0dd96a69 100644 --- a/.gen/pipeline/pipeline/model_create_backup_request.go +++ b/.gen/pipeline/pipeline/model_create_backup_request.go @@ -20,3 +20,36 @@ type CreateBackupRequest struct { Options BackupOptions `json:"options,omitempty"` } + +// AssertCreateBackupRequestRequired checks if the required fields are not zero-ed +func AssertCreateBackupRequestRequired(obj CreateBackupRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "ttl": obj.Ttl, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertLabelsRequired(obj.Labels); err != nil { + return err + } + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateBackupRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateBackupRequest (e.g. [][]CreateBackupRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateBackupRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateBackupRequest, ok := obj.(CreateBackupRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateBackupRequestRequired(aCreateBackupRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_backup_response.go b/.gen/pipeline/pipeline/model_create_backup_response.go index d2a631f956..aef95ae789 100644 --- a/.gen/pipeline/pipeline/model_create_backup_response.go +++ b/.gen/pipeline/pipeline/model_create_backup_response.go @@ -16,3 +16,20 @@ type CreateBackupResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertCreateBackupResponseRequired checks if the required fields are not zero-ed +func AssertCreateBackupResponseRequired(obj CreateBackupResponse) error { + return nil +} + +// AssertRecurseCreateBackupResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateBackupResponse (e.g. [][]CreateBackupResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateBackupResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateBackupResponse, ok := obj.(CreateBackupResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateBackupResponseRequired(aCreateBackupResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_cluster_request.go b/.gen/pipeline/pipeline/model_create_cluster_request.go index 026eb04d9b..d88b5f5a48 100644 --- a/.gen/pipeline/pipeline/model_create_cluster_request.go +++ b/.gen/pipeline/pipeline/model_create_cluster_request.go @@ -28,3 +28,32 @@ type CreateClusterRequest struct { Properties map[string]interface{} `json:"properties"` } + +// AssertCreateClusterRequestRequired checks if the required fields are not zero-ed +func AssertCreateClusterRequestRequired(obj CreateClusterRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "location": obj.Location, + "cloud": obj.Cloud, + "properties": obj.Properties, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateClusterRequest (e.g. [][]CreateClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateClusterRequest, ok := obj.(CreateClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateClusterRequestRequired(aCreateClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_cluster_request_base.go b/.gen/pipeline/pipeline/model_create_cluster_request_base.go index a894eb3fe7..f1c68f409b 100644 --- a/.gen/pipeline/pipeline/model_create_cluster_request_base.go +++ b/.gen/pipeline/pipeline/model_create_cluster_request_base.go @@ -22,3 +22,30 @@ type CreateClusterRequestBase struct { Type string `json:"type"` } + +// AssertCreateClusterRequestBaseRequired checks if the required fields are not zero-ed +func AssertCreateClusterRequestBaseRequired(obj CreateClusterRequestBase) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateClusterRequestBaseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateClusterRequestBase (e.g. [][]CreateClusterRequestBase), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateClusterRequestBaseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateClusterRequestBase, ok := obj.(CreateClusterRequestBase) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateClusterRequestBaseRequired(aCreateClusterRequestBase) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_cluster_request_v2.go b/.gen/pipeline/pipeline/model_create_cluster_request_v2.go index 58d8ed8893..359aef7af9 100644 --- a/.gen/pipeline/pipeline/model_create_cluster_request_v2.go +++ b/.gen/pipeline/pipeline/model_create_cluster_request_v2.go @@ -22,3 +22,30 @@ type CreateClusterRequestV2 struct { Type string `json:"type"` } + +// AssertCreateClusterRequestV2Required checks if the required fields are not zero-ed +func AssertCreateClusterRequestV2Required(obj CreateClusterRequestV2) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateClusterRequestV2Required recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateClusterRequestV2 (e.g. [][]CreateClusterRequestV2), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateClusterRequestV2Required(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateClusterRequestV2, ok := obj.(CreateClusterRequestV2) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateClusterRequestV2Required(aCreateClusterRequestV2) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_cluster_response_201.go b/.gen/pipeline/pipeline/model_create_cluster_response_201.go index dfb779bf8d..448aebb81b 100644 --- a/.gen/pipeline/pipeline/model_create_cluster_response_201.go +++ b/.gen/pipeline/pipeline/model_create_cluster_response_201.go @@ -16,3 +16,20 @@ type CreateClusterResponse201 struct { Message string `json:"message,omitempty"` } + +// AssertCreateClusterResponse201Required checks if the required fields are not zero-ed +func AssertCreateClusterResponse201Required(obj CreateClusterResponse201) error { + return nil +} + +// AssertRecurseCreateClusterResponse201Required recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateClusterResponse201 (e.g. [][]CreateClusterResponse201), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateClusterResponse201Required(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateClusterResponse201, ok := obj.(CreateClusterResponse201) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateClusterResponse201Required(aCreateClusterResponse201) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_cluster_response_202.go b/.gen/pipeline/pipeline/model_create_cluster_response_202.go index c94718724a..87cc8af02d 100644 --- a/.gen/pipeline/pipeline/model_create_cluster_response_202.go +++ b/.gen/pipeline/pipeline/model_create_cluster_response_202.go @@ -16,3 +16,20 @@ type CreateClusterResponse202 struct { Id int32 `json:"id,omitempty"` } + +// AssertCreateClusterResponse202Required checks if the required fields are not zero-ed +func AssertCreateClusterResponse202Required(obj CreateClusterResponse202) error { + return nil +} + +// AssertRecurseCreateClusterResponse202Required recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateClusterResponse202 (e.g. [][]CreateClusterResponse202), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateClusterResponse202Required(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateClusterResponse202, ok := obj.(CreateClusterResponse202) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateClusterResponse202Required(aCreateClusterResponse202) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_eks_properties.go b/.gen/pipeline/pipeline/model_create_eks_properties.go index a5ecba5754..3d966eecc3 100644 --- a/.gen/pipeline/pipeline/model_create_eks_properties.go +++ b/.gen/pipeline/pipeline/model_create_eks_properties.go @@ -14,3 +14,32 @@ type CreateEksProperties struct { Eks CreateEksPropertiesEks `json:"eks"` } + +// AssertCreateEksPropertiesRequired checks if the required fields are not zero-ed +func AssertCreateEksPropertiesRequired(obj CreateEksProperties) error { + elements := map[string]interface{}{ + "eks": obj.Eks, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreateEksPropertiesEksRequired(obj.Eks); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateEksPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateEksProperties (e.g. [][]CreateEksProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateEksPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateEksProperties, ok := obj.(CreateEksProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateEksPropertiesRequired(aCreateEksProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_eks_properties_eks.go b/.gen/pipeline/pipeline/model_create_eks_properties_eks.go index b08ff7e258..a489a2fa93 100644 --- a/.gen/pipeline/pipeline/model_create_eks_properties_eks.go +++ b/.gen/pipeline/pipeline/model_create_eks_properties_eks.go @@ -39,3 +39,48 @@ type CreateEksPropertiesEks struct { // User defined tags to be added to created AWS resources. Empty keys and values are not permitted. Tags map[string]string `json:"tags,omitempty"` } + +// AssertCreateEksPropertiesEksRequired checks if the required fields are not zero-ed +func AssertCreateEksPropertiesEksRequired(obj CreateEksPropertiesEks) error { + elements := map[string]interface{}{ + "nodePools": obj.NodePools, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertEksAuthConfigRequired(obj.AuthConfig); err != nil { + return err + } + for _, el := range obj.EncryptionConfig { + if err := AssertEksEncryptionConfigRequired(el); err != nil { + return err + } + } + if err := AssertEksVpcRequired(obj.Vpc); err != nil { + return err + } + for _, el := range obj.Subnets { + if err := AssertEksSubnetRequired(el); err != nil { + return err + } + } + if err := AssertEksIamRequired(obj.Iam); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateEksPropertiesEksRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateEksPropertiesEks (e.g. [][]CreateEksPropertiesEks), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateEksPropertiesEksRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateEksPropertiesEks, ok := obj.(CreateEksPropertiesEks) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateEksPropertiesEksRequired(aCreateEksPropertiesEks) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_gke_properties.go b/.gen/pipeline/pipeline/model_create_gke_properties.go index 68102c76ec..58894880ce 100644 --- a/.gen/pipeline/pipeline/model_create_gke_properties.go +++ b/.gen/pipeline/pipeline/model_create_gke_properties.go @@ -14,3 +14,32 @@ type CreateGkeProperties struct { Gke CreateGkePropertiesGke `json:"gke"` } + +// AssertCreateGkePropertiesRequired checks if the required fields are not zero-ed +func AssertCreateGkePropertiesRequired(obj CreateGkeProperties) error { + elements := map[string]interface{}{ + "gke": obj.Gke, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreateGkePropertiesGkeRequired(obj.Gke); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateGkePropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateGkeProperties (e.g. [][]CreateGkeProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateGkePropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateGkeProperties, ok := obj.(CreateGkeProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateGkePropertiesRequired(aCreateGkeProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_gke_properties_gke.go b/.gen/pipeline/pipeline/model_create_gke_properties_gke.go index 70481322ee..b11292a0bd 100644 --- a/.gen/pipeline/pipeline/model_create_gke_properties_gke.go +++ b/.gen/pipeline/pipeline/model_create_gke_properties_gke.go @@ -26,3 +26,32 @@ type CreateGkePropertiesGke struct { NodePools map[string]NodePoolsGoogle `json:"nodePools"` } + +// AssertCreateGkePropertiesGkeRequired checks if the required fields are not zero-ed +func AssertCreateGkePropertiesGkeRequired(obj CreateGkePropertiesGke) error { + elements := map[string]interface{}{ + "nodePools": obj.NodePools, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreateGkePropertiesGkeMasterRequired(obj.Master); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateGkePropertiesGkeRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateGkePropertiesGke (e.g. [][]CreateGkePropertiesGke), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateGkePropertiesGkeRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateGkePropertiesGke, ok := obj.(CreateGkePropertiesGke) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateGkePropertiesGkeRequired(aCreateGkePropertiesGke) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_gke_properties_gke_master.go b/.gen/pipeline/pipeline/model_create_gke_properties_gke_master.go index 486a6f412d..255587833d 100644 --- a/.gen/pipeline/pipeline/model_create_gke_properties_gke_master.go +++ b/.gen/pipeline/pipeline/model_create_gke_properties_gke_master.go @@ -14,3 +14,20 @@ type CreateGkePropertiesGkeMaster struct { Version string `json:"version,omitempty"` } + +// AssertCreateGkePropertiesGkeMasterRequired checks if the required fields are not zero-ed +func AssertCreateGkePropertiesGkeMasterRequired(obj CreateGkePropertiesGkeMaster) error { + return nil +} + +// AssertRecurseCreateGkePropertiesGkeMasterRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateGkePropertiesGkeMaster (e.g. [][]CreateGkePropertiesGkeMaster), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateGkePropertiesGkeMasterRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateGkePropertiesGkeMaster, ok := obj.(CreateGkePropertiesGkeMaster) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateGkePropertiesGkeMasterRequired(aCreateGkePropertiesGkeMaster) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_google_object_store_bucket_properties.go b/.gen/pipeline/pipeline/model_create_google_object_store_bucket_properties.go index da43bad2ab..ce17ca8f9c 100644 --- a/.gen/pipeline/pipeline/model_create_google_object_store_bucket_properties.go +++ b/.gen/pipeline/pipeline/model_create_google_object_store_bucket_properties.go @@ -14,3 +14,29 @@ type CreateGoogleObjectStoreBucketProperties struct { Location string `json:"location"` } + +// AssertCreateGoogleObjectStoreBucketPropertiesRequired checks if the required fields are not zero-ed +func AssertCreateGoogleObjectStoreBucketPropertiesRequired(obj CreateGoogleObjectStoreBucketProperties) error { + elements := map[string]interface{}{ + "location": obj.Location, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateGoogleObjectStoreBucketPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateGoogleObjectStoreBucketProperties (e.g. [][]CreateGoogleObjectStoreBucketProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateGoogleObjectStoreBucketPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateGoogleObjectStoreBucketProperties, ok := obj.(CreateGoogleObjectStoreBucketProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateGoogleObjectStoreBucketPropertiesRequired(aCreateGoogleObjectStoreBucketProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_node_pool_request.go b/.gen/pipeline/pipeline/model_create_node_pool_request.go index 8b146981e8..2cf4eed4c3 100644 --- a/.gen/pipeline/pipeline/model_create_node_pool_request.go +++ b/.gen/pipeline/pipeline/model_create_node_pool_request.go @@ -50,3 +50,39 @@ type CreateNodePoolRequest struct { NodePools map[string]NodePool `json:"nodePools,omitempty"` } + +// AssertCreateNodePoolRequestRequired checks if the required fields are not zero-ed +func AssertCreateNodePoolRequestRequired(obj CreateNodePoolRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "size": obj.Size, + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + return nil +} + +// AssertRecurseCreateNodePoolRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateNodePoolRequest (e.g. [][]CreateNodePoolRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateNodePoolRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateNodePoolRequest, ok := obj.(CreateNodePoolRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateNodePoolRequestRequired(aCreateNodePoolRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_object_store_bucket_properties.go b/.gen/pipeline/pipeline/model_create_object_store_bucket_properties.go index 785adf44ea..d178a7e5f9 100644 --- a/.gen/pipeline/pipeline/model_create_object_store_bucket_properties.go +++ b/.gen/pipeline/pipeline/model_create_object_store_bucket_properties.go @@ -18,3 +18,35 @@ type CreateObjectStoreBucketProperties struct { Google *CreateGoogleObjectStoreBucketProperties `json:"google,omitempty"` } + +// AssertCreateObjectStoreBucketPropertiesRequired checks if the required fields are not zero-ed +func AssertCreateObjectStoreBucketPropertiesRequired(obj CreateObjectStoreBucketProperties) error { + if obj.Amazon != nil { + if err := AssertCreateAmazonObjectStoreBucketPropertiesRequired(*obj.Amazon); err != nil { + return err + } + } + if obj.Azure != nil { + if err := AssertCreateAzureObjectStoreBucketPropertiesRequired(*obj.Azure); err != nil { + return err + } + } + if obj.Google != nil { + if err := AssertCreateGoogleObjectStoreBucketPropertiesRequired(*obj.Google); err != nil { + return err + } + } + return nil +} + +// AssertRecurseCreateObjectStoreBucketPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateObjectStoreBucketProperties (e.g. [][]CreateObjectStoreBucketProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateObjectStoreBucketPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateObjectStoreBucketProperties, ok := obj.(CreateObjectStoreBucketProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateObjectStoreBucketPropertiesRequired(aCreateObjectStoreBucketProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_object_store_bucket_request.go b/.gen/pipeline/pipeline/model_create_object_store_bucket_request.go index d1597d5076..cd3d34ff66 100644 --- a/.gen/pipeline/pipeline/model_create_object_store_bucket_request.go +++ b/.gen/pipeline/pipeline/model_create_object_store_bucket_request.go @@ -20,3 +20,33 @@ type CreateObjectStoreBucketRequest struct { Properties CreateObjectStoreBucketProperties `json:"properties"` } + +// AssertCreateObjectStoreBucketRequestRequired checks if the required fields are not zero-ed +func AssertCreateObjectStoreBucketRequestRequired(obj CreateObjectStoreBucketRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "properties": obj.Properties, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreateObjectStoreBucketPropertiesRequired(obj.Properties); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateObjectStoreBucketRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateObjectStoreBucketRequest (e.g. [][]CreateObjectStoreBucketRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateObjectStoreBucketRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateObjectStoreBucketRequest, ok := obj.(CreateObjectStoreBucketRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateObjectStoreBucketRequestRequired(aCreateObjectStoreBucketRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_object_store_bucket_response.go b/.gen/pipeline/pipeline/model_create_object_store_bucket_response.go index a4e5424847..78966abfa5 100644 --- a/.gen/pipeline/pipeline/model_create_object_store_bucket_response.go +++ b/.gen/pipeline/pipeline/model_create_object_store_bucket_response.go @@ -16,3 +16,30 @@ type CreateObjectStoreBucketResponse struct { Cloud string `json:"cloud"` } + +// AssertCreateObjectStoreBucketResponseRequired checks if the required fields are not zero-ed +func AssertCreateObjectStoreBucketResponseRequired(obj CreateObjectStoreBucketResponse) error { + elements := map[string]interface{}{ + "name": obj.Name, + "cloud": obj.Cloud, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateObjectStoreBucketResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateObjectStoreBucketResponse (e.g. [][]CreateObjectStoreBucketResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateObjectStoreBucketResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateObjectStoreBucketResponse, ok := obj.(CreateObjectStoreBucketResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateObjectStoreBucketResponseRequired(aCreateObjectStoreBucketResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes.go b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes.go index 965d9582fa..fa331f24bd 100644 --- a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes.go +++ b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes.go @@ -22,3 +22,38 @@ type CreatePkeClusterKubernetes struct { Network CreatePkeClusterKubernetesNetwork `json:"network,omitempty"` } + +// AssertCreatePkeClusterKubernetesRequired checks if the required fields are not zero-ed +func AssertCreatePkeClusterKubernetesRequired(obj CreatePkeClusterKubernetes) error { + elements := map[string]interface{}{ + "version": obj.Version, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkeClusterKubernetesOidcRequired(obj.Oidc); err != nil { + return err + } + if err := AssertCreatePkeClusterKubernetesCriRequired(obj.Cri); err != nil { + return err + } + if err := AssertCreatePkeClusterKubernetesNetworkRequired(obj.Network); err != nil { + return err + } + return nil +} + +// AssertRecurseCreatePkeClusterKubernetesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeClusterKubernetes (e.g. [][]CreatePkeClusterKubernetes), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeClusterKubernetesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeClusterKubernetes, ok := obj.(CreatePkeClusterKubernetes) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeClusterKubernetesRequired(aCreatePkeClusterKubernetes) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_cri.go b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_cri.go index 288850e92d..5cd94cea32 100644 --- a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_cri.go +++ b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_cri.go @@ -16,3 +16,20 @@ type CreatePkeClusterKubernetesCri struct { RuntimeConfig map[string]interface{} `json:"runtimeConfig,omitempty"` } + +// AssertCreatePkeClusterKubernetesCriRequired checks if the required fields are not zero-ed +func AssertCreatePkeClusterKubernetesCriRequired(obj CreatePkeClusterKubernetesCri) error { + return nil +} + +// AssertRecurseCreatePkeClusterKubernetesCriRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeClusterKubernetesCri (e.g. [][]CreatePkeClusterKubernetesCri), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeClusterKubernetesCriRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeClusterKubernetesCri, ok := obj.(CreatePkeClusterKubernetesCri) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeClusterKubernetesCriRequired(aCreatePkeClusterKubernetesCri) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_network.go b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_network.go index 383211ffd9..661d4a064b 100644 --- a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_network.go +++ b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_network.go @@ -20,3 +20,20 @@ type CreatePkeClusterKubernetesNetwork struct { ProviderConfig map[string]interface{} `json:"providerConfig,omitempty"` } + +// AssertCreatePkeClusterKubernetesNetworkRequired checks if the required fields are not zero-ed +func AssertCreatePkeClusterKubernetesNetworkRequired(obj CreatePkeClusterKubernetesNetwork) error { + return nil +} + +// AssertRecurseCreatePkeClusterKubernetesNetworkRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeClusterKubernetesNetwork (e.g. [][]CreatePkeClusterKubernetesNetwork), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeClusterKubernetesNetworkRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeClusterKubernetesNetwork, ok := obj.(CreatePkeClusterKubernetesNetwork) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeClusterKubernetesNetworkRequired(aCreatePkeClusterKubernetesNetwork) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_oidc.go b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_oidc.go index 4e6bbe15a4..b3340d2eeb 100644 --- a/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_oidc.go +++ b/.gen/pipeline/pipeline/model_create_pke_cluster_kubernetes_oidc.go @@ -14,3 +14,20 @@ type CreatePkeClusterKubernetesOidc struct { Enabled bool `json:"enabled,omitempty"` } + +// AssertCreatePkeClusterKubernetesOidcRequired checks if the required fields are not zero-ed +func AssertCreatePkeClusterKubernetesOidcRequired(obj CreatePkeClusterKubernetesOidc) error { + return nil +} + +// AssertRecurseCreatePkeClusterKubernetesOidcRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeClusterKubernetesOidc (e.g. [][]CreatePkeClusterKubernetesOidc), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeClusterKubernetesOidcRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeClusterKubernetesOidc, ok := obj.(CreatePkeClusterKubernetesOidc) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeClusterKubernetesOidcRequired(aCreatePkeClusterKubernetesOidc) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_cluster_request_base.go b/.gen/pipeline/pipeline/model_create_pke_cluster_request_base.go index 1677e97657..6b877469f4 100644 --- a/.gen/pipeline/pipeline/model_create_pke_cluster_request_base.go +++ b/.gen/pipeline/pipeline/model_create_pke_cluster_request_base.go @@ -26,3 +26,37 @@ type CreatePkeClusterRequestBase struct { Proxy PkeClusterHttpProxy `json:"proxy,omitempty"` } + +// AssertCreatePkeClusterRequestBaseRequired checks if the required fields are not zero-ed +func AssertCreatePkeClusterRequestBaseRequired(obj CreatePkeClusterRequestBase) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + "kubernetes": obj.Kubernetes, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkeClusterKubernetesRequired(obj.Kubernetes); err != nil { + return err + } + if err := AssertPkeClusterHttpProxyRequired(obj.Proxy); err != nil { + return err + } + return nil +} + +// AssertRecurseCreatePkeClusterRequestBaseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeClusterRequestBase (e.g. [][]CreatePkeClusterRequestBase), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeClusterRequestBaseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeClusterRequestBase, ok := obj.(CreatePkeClusterRequestBase) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeClusterRequestBaseRequired(aCreatePkeClusterRequestBase) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_cluster_request_base_all_of.go b/.gen/pipeline/pipeline/model_create_pke_cluster_request_base_all_of.go index 87aaffdddc..098fddc01c 100644 --- a/.gen/pipeline/pipeline/model_create_pke_cluster_request_base_all_of.go +++ b/.gen/pipeline/pipeline/model_create_pke_cluster_request_base_all_of.go @@ -16,3 +16,35 @@ type CreatePkeClusterRequestBaseAllOf struct { Proxy PkeClusterHttpProxy `json:"proxy,omitempty"` } + +// AssertCreatePkeClusterRequestBaseAllOfRequired checks if the required fields are not zero-ed +func AssertCreatePkeClusterRequestBaseAllOfRequired(obj CreatePkeClusterRequestBaseAllOf) error { + elements := map[string]interface{}{ + "kubernetes": obj.Kubernetes, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkeClusterKubernetesRequired(obj.Kubernetes); err != nil { + return err + } + if err := AssertPkeClusterHttpProxyRequired(obj.Proxy); err != nil { + return err + } + return nil +} + +// AssertRecurseCreatePkeClusterRequestBaseAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeClusterRequestBaseAllOf (e.g. [][]CreatePkeClusterRequestBaseAllOf), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeClusterRequestBaseAllOfRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeClusterRequestBaseAllOf, ok := obj.(CreatePkeClusterRequestBaseAllOf) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeClusterRequestBaseAllOfRequired(aCreatePkeClusterRequestBaseAllOf) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_on_azure_cluster_request.go b/.gen/pipeline/pipeline/model_create_pke_on_azure_cluster_request.go deleted file mode 100644 index d79d8919e2..0000000000 --- a/.gen/pipeline/pipeline/model_create_pke_on_azure_cluster_request.go +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type CreatePkeOnAzureClusterRequest struct { - - Name string `json:"name"` - - SecretId string `json:"secretId,omitempty"` - - SecretName string `json:"secretName,omitempty"` - - SshSecretId string `json:"sshSecretId,omitempty"` - - Type string `json:"type"` - - Kubernetes CreatePkeClusterKubernetes `json:"kubernetes"` - - Proxy PkeClusterHttpProxy `json:"proxy,omitempty"` - - // Non-existent resources will be created in this location. Existing resources that must have the same location as the cluster will be validated against this. - Location string `json:"location,omitempty"` - - // Required resources will be created in this resource group. - ResourceGroup string `json:"resourceGroup"` - - Network PkeOnAzureClusterNetwork `json:"network,omitempty"` - - // List of access points (i.e. load balancers, floating IPs) to be created for the cluster. Access points are implemented using cloud provider specific resources. - AccessPoints []string `json:"accessPoints,omitempty"` - - // List of access point references for the API server; currently, public and private are the only valid values - ApiServerAccessPoints []string `json:"apiServerAccessPoints,omitempty"` - - Nodepools []PkeOnAzureNodePool `json:"nodepools,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_create_pke_on_azure_cluster_request_all_of.go b/.gen/pipeline/pipeline/model_create_pke_on_azure_cluster_request_all_of.go deleted file mode 100644 index f3d8385e00..0000000000 --- a/.gen/pipeline/pipeline/model_create_pke_on_azure_cluster_request_all_of.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type CreatePkeOnAzureClusterRequestAllOf struct { - - // Non-existent resources will be created in this location. Existing resources that must have the same location as the cluster will be validated against this. - Location string `json:"location,omitempty"` - - // Required resources will be created in this resource group. - ResourceGroup string `json:"resourceGroup"` - - Network PkeOnAzureClusterNetwork `json:"network,omitempty"` - - // List of access points (i.e. load balancers, floating IPs) to be created for the cluster. Access points are implemented using cloud provider specific resources. - AccessPoints []string `json:"accessPoints,omitempty"` - - // List of access point references for the API server; currently, public and private are the only valid values - ApiServerAccessPoints []string `json:"apiServerAccessPoints,omitempty"` - - Nodepools []PkeOnAzureNodePool `json:"nodepools,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_create_pke_on_vsphere_cluster_request_all_of.go b/.gen/pipeline/pipeline/model_create_pke_on_vsphere_cluster_request_all_of.go deleted file mode 100644 index 8560bcd925..0000000000 --- a/.gen/pipeline/pipeline/model_create_pke_on_vsphere_cluster_request_all_of.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type CreatePkeOnVsphereClusterRequestAllOf struct { - - // Secret ID used to setup VSphere storage classes. Overrides the default settings in main cluster secret. - StorageSecretId string `json:"storageSecretId,omitempty"` - - // Secret name used to setup VSphere storage classes. Overrides default value from the main cluster secret. - StorageSecretName string `json:"storageSecretName,omitempty"` - - // Folder to create nodes in. Overrides default value from the main cluster secret. - Folder string `json:"folder,omitempty"` - - // Name of datastore or datastore cluster to place VM disks on. Overrides default value from the main cluster secret. - Datastore string `json:"datastore,omitempty"` - - // Virtual machines will be created in this resource pool. Overrides default value from the main cluster secret. - ResourcePool string `json:"resourcePool,omitempty"` - - Nodepools []PkeOnVsphereNodePool `json:"nodepools,omitempty"` - - // IPv4 range to allocate addresses for LoadBalancer Services (MetalLB) - LoadBalancerIPRange string `json:"loadBalancerIPRange,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_create_pke_properties.go b/.gen/pipeline/pipeline/model_create_pke_properties.go index 42d5e28e70..bae2dd2392 100644 --- a/.gen/pipeline/pipeline/model_create_pke_properties.go +++ b/.gen/pipeline/pipeline/model_create_pke_properties.go @@ -20,3 +20,46 @@ type CreatePkeProperties struct { Cri CreatePkePropertiesCri `json:"cri"` } + +// AssertCreatePkePropertiesRequired checks if the required fields are not zero-ed +func AssertCreatePkePropertiesRequired(obj CreatePkeProperties) error { + elements := map[string]interface{}{ + "network": obj.Network, + "nodePools": obj.NodePools, + "kubernetes": obj.Kubernetes, + "cri": obj.Cri, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkePropertiesNetworkRequired(obj.Network); err != nil { + return err + } + for _, el := range obj.NodePools { + if err := AssertNodePoolsPkeRequired(el); err != nil { + return err + } + } + if err := AssertCreatePkePropertiesKubernetesRequired(obj.Kubernetes); err != nil { + return err + } + if err := AssertCreatePkePropertiesCriRequired(obj.Cri); err != nil { + return err + } + return nil +} + +// AssertRecurseCreatePkePropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeProperties (e.g. [][]CreatePkeProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkePropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeProperties, ok := obj.(CreatePkeProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkePropertiesRequired(aCreatePkeProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_properties_cri.go b/.gen/pipeline/pipeline/model_create_pke_properties_cri.go index 61c95b1d18..79c9c98f4b 100644 --- a/.gen/pipeline/pipeline/model_create_pke_properties_cri.go +++ b/.gen/pipeline/pipeline/model_create_pke_properties_cri.go @@ -14,3 +14,29 @@ type CreatePkePropertiesCri struct { Runtime string `json:"runtime"` } + +// AssertCreatePkePropertiesCriRequired checks if the required fields are not zero-ed +func AssertCreatePkePropertiesCriRequired(obj CreatePkePropertiesCri) error { + elements := map[string]interface{}{ + "runtime": obj.Runtime, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreatePkePropertiesCriRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkePropertiesCri (e.g. [][]CreatePkePropertiesCri), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkePropertiesCriRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkePropertiesCri, ok := obj.(CreatePkePropertiesCri) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkePropertiesCriRequired(aCreatePkePropertiesCri) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes.go b/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes.go index 419ca58bd7..c4d55ff0ee 100644 --- a/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes.go +++ b/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes.go @@ -16,3 +16,33 @@ type CreatePkePropertiesKubernetes struct { Rbac CreatePkePropertiesKubernetesRbac `json:"rbac"` } + +// AssertCreatePkePropertiesKubernetesRequired checks if the required fields are not zero-ed +func AssertCreatePkePropertiesKubernetesRequired(obj CreatePkePropertiesKubernetes) error { + elements := map[string]interface{}{ + "version": obj.Version, + "rbac": obj.Rbac, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkePropertiesKubernetesRbacRequired(obj.Rbac); err != nil { + return err + } + return nil +} + +// AssertRecurseCreatePkePropertiesKubernetesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkePropertiesKubernetes (e.g. [][]CreatePkePropertiesKubernetes), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkePropertiesKubernetesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkePropertiesKubernetes, ok := obj.(CreatePkePropertiesKubernetes) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkePropertiesKubernetesRequired(aCreatePkePropertiesKubernetes) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes_rbac.go b/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes_rbac.go index 53ad937eae..6df06a0428 100644 --- a/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes_rbac.go +++ b/.gen/pipeline/pipeline/model_create_pke_properties_kubernetes_rbac.go @@ -14,3 +14,29 @@ type CreatePkePropertiesKubernetesRbac struct { Enabled bool `json:"enabled"` } + +// AssertCreatePkePropertiesKubernetesRbacRequired checks if the required fields are not zero-ed +func AssertCreatePkePropertiesKubernetesRbacRequired(obj CreatePkePropertiesKubernetesRbac) error { + elements := map[string]interface{}{ + "enabled": obj.Enabled, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreatePkePropertiesKubernetesRbacRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkePropertiesKubernetesRbac (e.g. [][]CreatePkePropertiesKubernetesRbac), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkePropertiesKubernetesRbacRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkePropertiesKubernetesRbac, ok := obj.(CreatePkePropertiesKubernetesRbac) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkePropertiesKubernetesRbacRequired(aCreatePkePropertiesKubernetesRbac) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_properties_network.go b/.gen/pipeline/pipeline/model_create_pke_properties_network.go index 9b7a1d337a..5398f0b676 100644 --- a/.gen/pipeline/pipeline/model_create_pke_properties_network.go +++ b/.gen/pipeline/pipeline/model_create_pke_properties_network.go @@ -20,3 +20,32 @@ type CreatePkePropertiesNetwork struct { Provider string `json:"provider"` } + +// AssertCreatePkePropertiesNetworkRequired checks if the required fields are not zero-ed +func AssertCreatePkePropertiesNetworkRequired(obj CreatePkePropertiesNetwork) error { + elements := map[string]interface{}{ + "apiServerAddress": obj.ApiServerAddress, + "serviceCIDR": obj.ServiceCIDR, + "podCIDR": obj.PodCIDR, + "provider": obj.Provider, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreatePkePropertiesNetworkRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkePropertiesNetwork (e.g. [][]CreatePkePropertiesNetwork), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkePropertiesNetworkRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkePropertiesNetwork, ok := obj.(CreatePkePropertiesNetwork) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkePropertiesNetworkRequired(aCreatePkePropertiesNetwork) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pkeon_azure_cluster_request.go b/.gen/pipeline/pipeline/model_create_pkeon_azure_cluster_request.go new file mode 100644 index 0000000000..c9d4e09023 --- /dev/null +++ b/.gen/pipeline/pipeline/model_create_pkeon_azure_cluster_request.go @@ -0,0 +1,87 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type CreatePkeonAzureClusterRequest struct { + + Name string `json:"name"` + + SecretId string `json:"secretId,omitempty"` + + SecretName string `json:"secretName,omitempty"` + + SshSecretId string `json:"sshSecretId,omitempty"` + + Type string `json:"type"` + + Kubernetes CreatePkeClusterKubernetes `json:"kubernetes"` + + Proxy PkeClusterHttpProxy `json:"proxy,omitempty"` + + // Non-existent resources will be created in this location. Existing resources that must have the same location as the cluster will be validated against this. + Location string `json:"location,omitempty"` + + // Required resources will be created in this resource group. + ResourceGroup string `json:"resourceGroup"` + + Network PkeonAzureClusterNetwork `json:"network,omitempty"` + + // List of access points (i.e. load balancers, floating IPs) to be created for the cluster. Access points are implemented using cloud provider specific resources. + AccessPoints []string `json:"accessPoints,omitempty"` + + // List of access point references for the API server; currently, public and private are the only valid values + ApiServerAccessPoints []string `json:"apiServerAccessPoints,omitempty"` + + Nodepools []PkeonAzureNodePool `json:"nodepools,omitempty"` +} + +// AssertCreatePkeonAzureClusterRequestRequired checks if the required fields are not zero-ed +func AssertCreatePkeonAzureClusterRequestRequired(obj CreatePkeonAzureClusterRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + "kubernetes": obj.Kubernetes, + "resourceGroup": obj.ResourceGroup, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkeClusterKubernetesRequired(obj.Kubernetes); err != nil { + return err + } + if err := AssertPkeClusterHttpProxyRequired(obj.Proxy); err != nil { + return err + } + if err := AssertPkeonAzureClusterNetworkRequired(obj.Network); err != nil { + return err + } + for _, el := range obj.Nodepools { + if err := AssertPkeonAzureNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseCreatePkeonAzureClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeonAzureClusterRequest (e.g. [][]CreatePkeonAzureClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeonAzureClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeonAzureClusterRequest, ok := obj.(CreatePkeonAzureClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeonAzureClusterRequestRequired(aCreatePkeonAzureClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pkeon_azure_cluster_request_all_of.go b/.gen/pipeline/pipeline/model_create_pkeon_azure_cluster_request_all_of.go new file mode 100644 index 0000000000..ae47e1bfc3 --- /dev/null +++ b/.gen/pipeline/pipeline/model_create_pkeon_azure_cluster_request_all_of.go @@ -0,0 +1,64 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type CreatePkeonAzureClusterRequestAllOf struct { + + // Non-existent resources will be created in this location. Existing resources that must have the same location as the cluster will be validated against this. + Location string `json:"location,omitempty"` + + // Required resources will be created in this resource group. + ResourceGroup string `json:"resourceGroup"` + + Network PkeonAzureClusterNetwork `json:"network,omitempty"` + + // List of access points (i.e. load balancers, floating IPs) to be created for the cluster. Access points are implemented using cloud provider specific resources. + AccessPoints []string `json:"accessPoints,omitempty"` + + // List of access point references for the API server; currently, public and private are the only valid values + ApiServerAccessPoints []string `json:"apiServerAccessPoints,omitempty"` + + Nodepools []PkeonAzureNodePool `json:"nodepools,omitempty"` +} + +// AssertCreatePkeonAzureClusterRequestAllOfRequired checks if the required fields are not zero-ed +func AssertCreatePkeonAzureClusterRequestAllOfRequired(obj CreatePkeonAzureClusterRequestAllOf) error { + elements := map[string]interface{}{ + "resourceGroup": obj.ResourceGroup, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertPkeonAzureClusterNetworkRequired(obj.Network); err != nil { + return err + } + for _, el := range obj.Nodepools { + if err := AssertPkeonAzureNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseCreatePkeonAzureClusterRequestAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeonAzureClusterRequestAllOf (e.g. [][]CreatePkeonAzureClusterRequestAllOf), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeonAzureClusterRequestAllOfRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeonAzureClusterRequestAllOf, ok := obj.(CreatePkeonAzureClusterRequestAllOf) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeonAzureClusterRequestAllOfRequired(aCreatePkeonAzureClusterRequestAllOf) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pkeon_vsphere_cluster_request.go b/.gen/pipeline/pipeline/model_create_pkeon_vsphere_cluster_request.go new file mode 100644 index 0000000000..739fe636b6 --- /dev/null +++ b/.gen/pipeline/pipeline/model_create_pkeon_vsphere_cluster_request.go @@ -0,0 +1,87 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type CreatePkeonVsphereClusterRequest struct { + + Name string `json:"name"` + + SecretId string `json:"secretId,omitempty"` + + SecretName string `json:"secretName,omitempty"` + + SshSecretId string `json:"sshSecretId,omitempty"` + + Type string `json:"type"` + + Kubernetes CreatePkeClusterKubernetes `json:"kubernetes"` + + Proxy PkeClusterHttpProxy `json:"proxy,omitempty"` + + // Secret ID used to setup VSphere storage classes. Overrides the default settings in main cluster secret. + StorageSecretId string `json:"storageSecretId,omitempty"` + + // Secret name used to setup VSphere storage classes. Overrides default value from the main cluster secret. + StorageSecretName string `json:"storageSecretName,omitempty"` + + // Folder to create nodes in. Overrides default value from the main cluster secret. + Folder string `json:"folder,omitempty"` + + // Name of datastore or datastore cluster to place VM disks on. Overrides default value from the main cluster secret. + Datastore string `json:"datastore,omitempty"` + + // Virtual machines will be created in this resource pool. Overrides default value from the main cluster secret. + ResourcePool string `json:"resourcePool,omitempty"` + + Nodepools []PkeonVsphereNodePool `json:"nodepools,omitempty"` + + // IPv4 range to allocate addresses for LoadBalancer Services (MetalLB) + LoadBalancerIPRange string `json:"loadBalancerIPRange,omitempty"` +} + +// AssertCreatePkeonVsphereClusterRequestRequired checks if the required fields are not zero-ed +func AssertCreatePkeonVsphereClusterRequestRequired(obj CreatePkeonVsphereClusterRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + "kubernetes": obj.Kubernetes, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertCreatePkeClusterKubernetesRequired(obj.Kubernetes); err != nil { + return err + } + if err := AssertPkeClusterHttpProxyRequired(obj.Proxy); err != nil { + return err + } + for _, el := range obj.Nodepools { + if err := AssertPkeonVsphereNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseCreatePkeonVsphereClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeonVsphereClusterRequest (e.g. [][]CreatePkeonVsphereClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeonVsphereClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeonVsphereClusterRequest, ok := obj.(CreatePkeonVsphereClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeonVsphereClusterRequestRequired(aCreatePkeonVsphereClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_pke_on_vsphere_cluster_request.go b/.gen/pipeline/pipeline/model_create_pkeon_vsphere_cluster_request_all_of.go similarity index 52% rename from .gen/pipeline/pipeline/model_create_pke_on_vsphere_cluster_request.go rename to .gen/pipeline/pipeline/model_create_pkeon_vsphere_cluster_request_all_of.go index bab95985ae..a995be2d77 100644 --- a/.gen/pipeline/pipeline/model_create_pke_on_vsphere_cluster_request.go +++ b/.gen/pipeline/pipeline/model_create_pkeon_vsphere_cluster_request_all_of.go @@ -10,21 +10,7 @@ package pipeline -type CreatePkeOnVsphereClusterRequest struct { - - Name string `json:"name"` - - SecretId string `json:"secretId,omitempty"` - - SecretName string `json:"secretName,omitempty"` - - SshSecretId string `json:"sshSecretId,omitempty"` - - Type string `json:"type"` - - Kubernetes CreatePkeClusterKubernetes `json:"kubernetes"` - - Proxy PkeClusterHttpProxy `json:"proxy,omitempty"` +type CreatePkeonVsphereClusterRequestAllOf struct { // Secret ID used to setup VSphere storage classes. Overrides the default settings in main cluster secret. StorageSecretId string `json:"storageSecretId,omitempty"` @@ -41,8 +27,30 @@ type CreatePkeOnVsphereClusterRequest struct { // Virtual machines will be created in this resource pool. Overrides default value from the main cluster secret. ResourcePool string `json:"resourcePool,omitempty"` - Nodepools []PkeOnVsphereNodePool `json:"nodepools,omitempty"` + Nodepools []PkeonVsphereNodePool `json:"nodepools,omitempty"` // IPv4 range to allocate addresses for LoadBalancer Services (MetalLB) LoadBalancerIPRange string `json:"loadBalancerIPRange,omitempty"` } + +// AssertCreatePkeonVsphereClusterRequestAllOfRequired checks if the required fields are not zero-ed +func AssertCreatePkeonVsphereClusterRequestAllOfRequired(obj CreatePkeonVsphereClusterRequestAllOf) error { + for _, el := range obj.Nodepools { + if err := AssertPkeonVsphereNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseCreatePkeonVsphereClusterRequestAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreatePkeonVsphereClusterRequestAllOf (e.g. [][]CreatePkeonVsphereClusterRequestAllOf), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreatePkeonVsphereClusterRequestAllOfRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreatePkeonVsphereClusterRequestAllOf, ok := obj.(CreatePkeonVsphereClusterRequestAllOf) + if !ok { + return ErrTypeAssertionError + } + return AssertCreatePkeonVsphereClusterRequestAllOfRequired(aCreatePkeonVsphereClusterRequestAllOf) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_resource_group.go b/.gen/pipeline/pipeline/model_create_resource_group.go index a30e42ebfc..da498d5e06 100644 --- a/.gen/pipeline/pipeline/model_create_resource_group.go +++ b/.gen/pipeline/pipeline/model_create_resource_group.go @@ -18,3 +18,31 @@ type CreateResourceGroup struct { SecretId string `json:"secretId"` } + +// AssertCreateResourceGroupRequired checks if the required fields are not zero-ed +func AssertCreateResourceGroupRequired(obj CreateResourceGroup) error { + elements := map[string]interface{}{ + "name": obj.Name, + "location": obj.Location, + "secretId": obj.SecretId, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateResourceGroupRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateResourceGroup (e.g. [][]CreateResourceGroup), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateResourceGroupRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateResourceGroup, ok := obj.(CreateResourceGroup) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateResourceGroupRequired(aCreateResourceGroup) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_restore_request.go b/.gen/pipeline/pipeline/model_create_restore_request.go index dd4495d13d..dd01ac734d 100644 --- a/.gen/pipeline/pipeline/model_create_restore_request.go +++ b/.gen/pipeline/pipeline/model_create_restore_request.go @@ -16,3 +16,32 @@ type CreateRestoreRequest struct { Options BackupOptions `json:"options,omitempty"` } + +// AssertCreateRestoreRequestRequired checks if the required fields are not zero-ed +func AssertCreateRestoreRequestRequired(obj CreateRestoreRequest) error { + elements := map[string]interface{}{ + "backupName": obj.BackupName, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateRestoreRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateRestoreRequest (e.g. [][]CreateRestoreRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateRestoreRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateRestoreRequest, ok := obj.(CreateRestoreRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateRestoreRequestRequired(aCreateRestoreRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_restore_response.go b/.gen/pipeline/pipeline/model_create_restore_response.go index d3795fb7e9..799ef2cecd 100644 --- a/.gen/pipeline/pipeline/model_create_restore_response.go +++ b/.gen/pipeline/pipeline/model_create_restore_response.go @@ -16,3 +16,23 @@ type CreateRestoreResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertCreateRestoreResponseRequired checks if the required fields are not zero-ed +func AssertCreateRestoreResponseRequired(obj CreateRestoreResponse) error { + if err := AssertRestoreResponseRequired(obj.Restore); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateRestoreResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateRestoreResponse (e.g. [][]CreateRestoreResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateRestoreResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateRestoreResponse, ok := obj.(CreateRestoreResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateRestoreResponseRequired(aCreateRestoreResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_schedule_request.go b/.gen/pipeline/pipeline/model_create_schedule_request.go index 9ab333382c..ddcc5f7cb7 100644 --- a/.gen/pipeline/pipeline/model_create_schedule_request.go +++ b/.gen/pipeline/pipeline/model_create_schedule_request.go @@ -22,3 +22,37 @@ type CreateScheduleRequest struct { Options BackupOptions `json:"options,omitempty"` } + +// AssertCreateScheduleRequestRequired checks if the required fields are not zero-ed +func AssertCreateScheduleRequestRequired(obj CreateScheduleRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "schedule": obj.Schedule, + "ttl": obj.Ttl, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertLabelsRequired(obj.Labels); err != nil { + return err + } + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseCreateScheduleRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateScheduleRequest (e.g. [][]CreateScheduleRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateScheduleRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateScheduleRequest, ok := obj.(CreateScheduleRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateScheduleRequestRequired(aCreateScheduleRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_schedule_response.go b/.gen/pipeline/pipeline/model_create_schedule_response.go index 82c3865b3e..8829dc910a 100644 --- a/.gen/pipeline/pipeline/model_create_schedule_response.go +++ b/.gen/pipeline/pipeline/model_create_schedule_response.go @@ -16,3 +16,20 @@ type CreateScheduleResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertCreateScheduleResponseRequired checks if the required fields are not zero-ed +func AssertCreateScheduleResponseRequired(obj CreateScheduleResponse) error { + return nil +} + +// AssertRecurseCreateScheduleResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateScheduleResponse (e.g. [][]CreateScheduleResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateScheduleResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateScheduleResponse, ok := obj.(CreateScheduleResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateScheduleResponseRequired(aCreateScheduleResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_secret_request.go b/.gen/pipeline/pipeline/model_create_secret_request.go index 5966899a9f..1d52049b37 100644 --- a/.gen/pipeline/pipeline/model_create_secret_request.go +++ b/.gen/pipeline/pipeline/model_create_secret_request.go @@ -20,3 +20,31 @@ type CreateSecretRequest struct { Values map[string]interface{} `json:"values"` } + +// AssertCreateSecretRequestRequired checks if the required fields are not zero-ed +func AssertCreateSecretRequestRequired(obj CreateSecretRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + "values": obj.Values, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateSecretRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateSecretRequest (e.g. [][]CreateSecretRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateSecretRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateSecretRequest, ok := obj.(CreateSecretRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateSecretRequestRequired(aCreateSecretRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_secret_response.go b/.gen/pipeline/pipeline/model_create_secret_response.go index 495f255954..b6bd393ee3 100644 --- a/.gen/pipeline/pipeline/model_create_secret_response.go +++ b/.gen/pipeline/pipeline/model_create_secret_response.go @@ -32,3 +32,31 @@ type CreateSecretResponse struct { Tags []string `json:"tags,omitempty"` } + +// AssertCreateSecretResponseRequired checks if the required fields are not zero-ed +func AssertCreateSecretResponseRequired(obj CreateSecretResponse) error { + elements := map[string]interface{}{ + "name": obj.Name, + "type": obj.Type, + "id": obj.Id, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateSecretResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateSecretResponse (e.g. [][]CreateSecretResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateSecretResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateSecretResponse, ok := obj.(CreateSecretResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateSecretResponseRequired(aCreateSecretResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_update_deployment_request.go b/.gen/pipeline/pipeline/model_create_update_deployment_request.go index aed370b003..8b25ed1308 100644 --- a/.gen/pipeline/pipeline/model_create_update_deployment_request.go +++ b/.gen/pipeline/pipeline/model_create_update_deployment_request.go @@ -40,3 +40,29 @@ type CreateUpdateDeploymentRequest struct { // current values of the deployment Values map[string]interface{} `json:"values,omitempty"` } + +// AssertCreateUpdateDeploymentRequestRequired checks if the required fields are not zero-ed +func AssertCreateUpdateDeploymentRequestRequired(obj CreateUpdateDeploymentRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseCreateUpdateDeploymentRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateUpdateDeploymentRequest (e.g. [][]CreateUpdateDeploymentRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateUpdateDeploymentRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateUpdateDeploymentRequest, ok := obj.(CreateUpdateDeploymentRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateUpdateDeploymentRequestRequired(aCreateUpdateDeploymentRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_create_update_deployment_response.go b/.gen/pipeline/pipeline/model_create_update_deployment_response.go index 1533aaa932..9168714801 100644 --- a/.gen/pipeline/pipeline/model_create_update_deployment_response.go +++ b/.gen/pipeline/pipeline/model_create_update_deployment_response.go @@ -17,3 +17,20 @@ type CreateUpdateDeploymentResponse struct { // deployment notes in base64 encoded format Notes string `json:"notes,omitempty"` } + +// AssertCreateUpdateDeploymentResponseRequired checks if the required fields are not zero-ed +func AssertCreateUpdateDeploymentResponseRequired(obj CreateUpdateDeploymentResponse) error { + return nil +} + +// AssertRecurseCreateUpdateDeploymentResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of CreateUpdateDeploymentResponse (e.g. [][]CreateUpdateDeploymentResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseCreateUpdateDeploymentResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aCreateUpdateDeploymentResponse, ok := obj.(CreateUpdateDeploymentResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertCreateUpdateDeploymentResponseRequired(aCreateUpdateDeploymentResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_delete_backup_bucket_response.go b/.gen/pipeline/pipeline/model_delete_backup_bucket_response.go index 59ede51735..d1abc77021 100644 --- a/.gen/pipeline/pipeline/model_delete_backup_bucket_response.go +++ b/.gen/pipeline/pipeline/model_delete_backup_bucket_response.go @@ -16,3 +16,20 @@ type DeleteBackupBucketResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertDeleteBackupBucketResponseRequired checks if the required fields are not zero-ed +func AssertDeleteBackupBucketResponseRequired(obj DeleteBackupBucketResponse) error { + return nil +} + +// AssertRecurseDeleteBackupBucketResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeleteBackupBucketResponse (e.g. [][]DeleteBackupBucketResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeleteBackupBucketResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeleteBackupBucketResponse, ok := obj.(DeleteBackupBucketResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeleteBackupBucketResponseRequired(aDeleteBackupBucketResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_delete_backup_response.go b/.gen/pipeline/pipeline/model_delete_backup_response.go index 9807069e52..b9929f757f 100644 --- a/.gen/pipeline/pipeline/model_delete_backup_response.go +++ b/.gen/pipeline/pipeline/model_delete_backup_response.go @@ -16,3 +16,20 @@ type DeleteBackupResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertDeleteBackupResponseRequired checks if the required fields are not zero-ed +func AssertDeleteBackupResponseRequired(obj DeleteBackupResponse) error { + return nil +} + +// AssertRecurseDeleteBackupResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeleteBackupResponse (e.g. [][]DeleteBackupResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeleteBackupResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeleteBackupResponse, ok := obj.(DeleteBackupResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeleteBackupResponseRequired(aDeleteBackupResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_delete_deployment_response.go b/.gen/pipeline/pipeline/model_delete_deployment_response.go index bbb0e0ffa8..aee4635aa2 100644 --- a/.gen/pipeline/pipeline/model_delete_deployment_response.go +++ b/.gen/pipeline/pipeline/model_delete_deployment_response.go @@ -18,3 +18,20 @@ type DeleteDeploymentResponse struct { Name string `json:"name,omitempty"` } + +// AssertDeleteDeploymentResponseRequired checks if the required fields are not zero-ed +func AssertDeleteDeploymentResponseRequired(obj DeleteDeploymentResponse) error { + return nil +} + +// AssertRecurseDeleteDeploymentResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeleteDeploymentResponse (e.g. [][]DeleteDeploymentResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeleteDeploymentResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeleteDeploymentResponse, ok := obj.(DeleteDeploymentResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeleteDeploymentResponseRequired(aDeleteDeploymentResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_delete_restore_response.go b/.gen/pipeline/pipeline/model_delete_restore_response.go index c9dcf75e52..baebbe1605 100644 --- a/.gen/pipeline/pipeline/model_delete_restore_response.go +++ b/.gen/pipeline/pipeline/model_delete_restore_response.go @@ -16,3 +16,20 @@ type DeleteRestoreResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertDeleteRestoreResponseRequired checks if the required fields are not zero-ed +func AssertDeleteRestoreResponseRequired(obj DeleteRestoreResponse) error { + return nil +} + +// AssertRecurseDeleteRestoreResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeleteRestoreResponse (e.g. [][]DeleteRestoreResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeleteRestoreResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeleteRestoreResponse, ok := obj.(DeleteRestoreResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeleteRestoreResponseRequired(aDeleteRestoreResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_delete_schedule_response.go b/.gen/pipeline/pipeline/model_delete_schedule_response.go index 34a6ed9b53..cb0334c653 100644 --- a/.gen/pipeline/pipeline/model_delete_schedule_response.go +++ b/.gen/pipeline/pipeline/model_delete_schedule_response.go @@ -16,3 +16,20 @@ type DeleteScheduleResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertDeleteScheduleResponseRequired checks if the required fields are not zero-ed +func AssertDeleteScheduleResponseRequired(obj DeleteScheduleResponse) error { + return nil +} + +// AssertRecurseDeleteScheduleResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeleteScheduleResponse (e.g. [][]DeleteScheduleResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeleteScheduleResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeleteScheduleResponse, ok := obj.(DeleteScheduleResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeleteScheduleResponseRequired(aDeleteScheduleResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_deployed_backup_bucket_response.go b/.gen/pipeline/pipeline/model_deployed_backup_bucket_response.go index cfa8dd1f62..4094dfa0e4 100644 --- a/.gen/pipeline/pipeline/model_deployed_backup_bucket_response.go +++ b/.gen/pipeline/pipeline/model_deployed_backup_bucket_response.go @@ -32,3 +32,20 @@ type DeployedBackupBucketResponse struct { ClusterDistribution string `json:"clusterDistribution,omitempty"` } + +// AssertDeployedBackupBucketResponseRequired checks if the required fields are not zero-ed +func AssertDeployedBackupBucketResponseRequired(obj DeployedBackupBucketResponse) error { + return nil +} + +// AssertRecurseDeployedBackupBucketResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeployedBackupBucketResponse (e.g. [][]DeployedBackupBucketResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeployedBackupBucketResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeployedBackupBucketResponse, ok := obj.(DeployedBackupBucketResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeployedBackupBucketResponseRequired(aDeployedBackupBucketResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_deployment_cluster_group_deployment.go b/.gen/pipeline/pipeline/model_deployment_cluster_group_deployment.go index 02c7497b63..a15a032e58 100644 --- a/.gen/pipeline/pipeline/model_deployment_cluster_group_deployment.go +++ b/.gen/pipeline/pipeline/model_deployment_cluster_group_deployment.go @@ -34,3 +34,29 @@ type DeploymentClusterGroupDeployment struct { Version string `json:"version,omitempty"` } + +// AssertDeploymentClusterGroupDeploymentRequired checks if the required fields are not zero-ed +func AssertDeploymentClusterGroupDeploymentRequired(obj DeploymentClusterGroupDeployment) error { + elements := map[string]interface{}{ + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseDeploymentClusterGroupDeploymentRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeploymentClusterGroupDeployment (e.g. [][]DeploymentClusterGroupDeployment), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeploymentClusterGroupDeploymentRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeploymentClusterGroupDeployment, ok := obj.(DeploymentClusterGroupDeployment) + if !ok { + return ErrTypeAssertionError + } + return AssertDeploymentClusterGroupDeploymentRequired(aDeploymentClusterGroupDeployment) + }) +} diff --git a/.gen/pipeline/pipeline/model_deployment_create_update_deployment_response.go b/.gen/pipeline/pipeline/model_deployment_create_update_deployment_response.go index f50f80abb7..39e0c2895b 100644 --- a/.gen/pipeline/pipeline/model_deployment_create_update_deployment_response.go +++ b/.gen/pipeline/pipeline/model_deployment_create_update_deployment_response.go @@ -16,3 +16,25 @@ type DeploymentCreateUpdateDeploymentResponse struct { TargetClusters []DeploymentTargetClusterStatus `json:"targetClusters,omitempty"` } + +// AssertDeploymentCreateUpdateDeploymentResponseRequired checks if the required fields are not zero-ed +func AssertDeploymentCreateUpdateDeploymentResponseRequired(obj DeploymentCreateUpdateDeploymentResponse) error { + for _, el := range obj.TargetClusters { + if err := AssertDeploymentTargetClusterStatusRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseDeploymentCreateUpdateDeploymentResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeploymentCreateUpdateDeploymentResponse (e.g. [][]DeploymentCreateUpdateDeploymentResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeploymentCreateUpdateDeploymentResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeploymentCreateUpdateDeploymentResponse, ok := obj.(DeploymentCreateUpdateDeploymentResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeploymentCreateUpdateDeploymentResponseRequired(aDeploymentCreateUpdateDeploymentResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_deployment_deployment_info.go b/.gen/pipeline/pipeline/model_deployment_deployment_info.go index 41adfab8e9..cf672cd2e3 100644 --- a/.gen/pipeline/pipeline/model_deployment_deployment_info.go +++ b/.gen/pipeline/pipeline/model_deployment_deployment_info.go @@ -36,3 +36,25 @@ type DeploymentDeploymentInfo struct { Version int32 `json:"version,omitempty"` } + +// AssertDeploymentDeploymentInfoRequired checks if the required fields are not zero-ed +func AssertDeploymentDeploymentInfoRequired(obj DeploymentDeploymentInfo) error { + for _, el := range obj.TargetClusters { + if err := AssertDeploymentTargetClusterStatusRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseDeploymentDeploymentInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeploymentDeploymentInfo (e.g. [][]DeploymentDeploymentInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeploymentDeploymentInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeploymentDeploymentInfo, ok := obj.(DeploymentDeploymentInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertDeploymentDeploymentInfoRequired(aDeploymentDeploymentInfo) + }) +} diff --git a/.gen/pipeline/pipeline/model_deployment_list_deployment_response.go b/.gen/pipeline/pipeline/model_deployment_list_deployment_response.go index 464c56a1b6..8f388c83f3 100644 --- a/.gen/pipeline/pipeline/model_deployment_list_deployment_response.go +++ b/.gen/pipeline/pipeline/model_deployment_list_deployment_response.go @@ -28,3 +28,20 @@ type DeploymentListDeploymentResponse struct { Version int32 `json:"version,omitempty"` } + +// AssertDeploymentListDeploymentResponseRequired checks if the required fields are not zero-ed +func AssertDeploymentListDeploymentResponseRequired(obj DeploymentListDeploymentResponse) error { + return nil +} + +// AssertRecurseDeploymentListDeploymentResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeploymentListDeploymentResponse (e.g. [][]DeploymentListDeploymentResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeploymentListDeploymentResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeploymentListDeploymentResponse, ok := obj.(DeploymentListDeploymentResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDeploymentListDeploymentResponseRequired(aDeploymentListDeploymentResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_deployment_target_cluster_status.go b/.gen/pipeline/pipeline/model_deployment_target_cluster_status.go index 602f8bea58..31f6b17e30 100644 --- a/.gen/pipeline/pipeline/model_deployment_target_cluster_status.go +++ b/.gen/pipeline/pipeline/model_deployment_target_cluster_status.go @@ -28,3 +28,20 @@ type DeploymentTargetClusterStatus struct { Version string `json:"version,omitempty"` } + +// AssertDeploymentTargetClusterStatusRequired checks if the required fields are not zero-ed +func AssertDeploymentTargetClusterStatusRequired(obj DeploymentTargetClusterStatus) error { + return nil +} + +// AssertRecurseDeploymentTargetClusterStatusRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DeploymentTargetClusterStatus (e.g. [][]DeploymentTargetClusterStatus), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDeploymentTargetClusterStatusRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDeploymentTargetClusterStatus, ok := obj.(DeploymentTargetClusterStatus) + if !ok { + return ErrTypeAssertionError + } + return AssertDeploymentTargetClusterStatusRequired(aDeploymentTargetClusterStatus) + }) +} diff --git a/.gen/pipeline/pipeline/model_disable_ark_response.go b/.gen/pipeline/pipeline/model_disable_ark_response.go index f81f83265a..944f6b18d8 100644 --- a/.gen/pipeline/pipeline/model_disable_ark_response.go +++ b/.gen/pipeline/pipeline/model_disable_ark_response.go @@ -14,3 +14,20 @@ type DisableArkResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertDisableArkResponseRequired checks if the required fields are not zero-ed +func AssertDisableArkResponseRequired(obj DisableArkResponse) error { + return nil +} + +// AssertRecurseDisableArkResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of DisableArkResponse (e.g. [][]DisableArkResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseDisableArkResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aDisableArkResponse, ok := obj.(DisableArkResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertDisableArkResponseRequired(aDisableArkResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_auth_config.go b/.gen/pipeline/pipeline/model_eks_auth_config.go index e7581cf27c..5f2e82741c 100644 --- a/.gen/pipeline/pipeline/model_eks_auth_config.go +++ b/.gen/pipeline/pipeline/model_eks_auth_config.go @@ -18,3 +18,30 @@ type EksAuthConfig struct { MapAccounts []string `json:"mapAccounts,omitempty"` } + +// AssertEksAuthConfigRequired checks if the required fields are not zero-ed +func AssertEksAuthConfigRequired(obj EksAuthConfig) error { + for _, el := range obj.MapRoles { + if err := AssertEksAuthConfigRolesRequired(el); err != nil { + return err + } + } + for _, el := range obj.MapUsers { + if err := AssertEksAuthConfigUsersRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseEksAuthConfigRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksAuthConfig (e.g. [][]EksAuthConfig), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksAuthConfigRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksAuthConfig, ok := obj.(EksAuthConfig) + if !ok { + return ErrTypeAssertionError + } + return AssertEksAuthConfigRequired(aEksAuthConfig) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_auth_config_roles.go b/.gen/pipeline/pipeline/model_eks_auth_config_roles.go index 15589f6309..db26e9a881 100644 --- a/.gen/pipeline/pipeline/model_eks_auth_config_roles.go +++ b/.gen/pipeline/pipeline/model_eks_auth_config_roles.go @@ -18,3 +18,20 @@ type EksAuthConfigRoles struct { Rolearn string `json:"rolearn,omitempty"` } + +// AssertEksAuthConfigRolesRequired checks if the required fields are not zero-ed +func AssertEksAuthConfigRolesRequired(obj EksAuthConfigRoles) error { + return nil +} + +// AssertRecurseEksAuthConfigRolesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksAuthConfigRoles (e.g. [][]EksAuthConfigRoles), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksAuthConfigRolesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksAuthConfigRoles, ok := obj.(EksAuthConfigRoles) + if !ok { + return ErrTypeAssertionError + } + return AssertEksAuthConfigRolesRequired(aEksAuthConfigRoles) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_auth_config_users.go b/.gen/pipeline/pipeline/model_eks_auth_config_users.go index f582625564..b7e1c663b9 100644 --- a/.gen/pipeline/pipeline/model_eks_auth_config_users.go +++ b/.gen/pipeline/pipeline/model_eks_auth_config_users.go @@ -18,3 +18,20 @@ type EksAuthConfigUsers struct { Userarn string `json:"userarn,omitempty"` } + +// AssertEksAuthConfigUsersRequired checks if the required fields are not zero-ed +func AssertEksAuthConfigUsersRequired(obj EksAuthConfigUsers) error { + return nil +} + +// AssertRecurseEksAuthConfigUsersRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksAuthConfigUsers (e.g. [][]EksAuthConfigUsers), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksAuthConfigUsersRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksAuthConfigUsers, ok := obj.(EksAuthConfigUsers) + if !ok { + return ErrTypeAssertionError + } + return AssertEksAuthConfigUsersRequired(aEksAuthConfigUsers) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_encryption_config.go b/.gen/pipeline/pipeline/model_eks_encryption_config.go index d2515a6157..2af465e3ce 100644 --- a/.gen/pipeline/pipeline/model_eks_encryption_config.go +++ b/.gen/pipeline/pipeline/model_eks_encryption_config.go @@ -18,3 +18,23 @@ type EksEncryptionConfig struct { // Resource kinds to encrypt with the corresponding encryption provider. Resources []string `json:"resources,omitempty"` } + +// AssertEksEncryptionConfigRequired checks if the required fields are not zero-ed +func AssertEksEncryptionConfigRequired(obj EksEncryptionConfig) error { + if err := AssertEksEncryptionConfigProviderRequired(obj.Provider); err != nil { + return err + } + return nil +} + +// AssertRecurseEksEncryptionConfigRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksEncryptionConfig (e.g. [][]EksEncryptionConfig), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksEncryptionConfigRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksEncryptionConfig, ok := obj.(EksEncryptionConfig) + if !ok { + return ErrTypeAssertionError + } + return AssertEksEncryptionConfigRequired(aEksEncryptionConfig) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_encryption_config_provider.go b/.gen/pipeline/pipeline/model_eks_encryption_config_provider.go index c61be5ec41..ed0eccff58 100644 --- a/.gen/pipeline/pipeline/model_eks_encryption_config_provider.go +++ b/.gen/pipeline/pipeline/model_eks_encryption_config_provider.go @@ -16,3 +16,20 @@ type EksEncryptionConfigProvider struct { // A customer master key to use for encryption. More information can be found at https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html. KeyARN string `json:"keyARN,omitempty"` } + +// AssertEksEncryptionConfigProviderRequired checks if the required fields are not zero-ed +func AssertEksEncryptionConfigProviderRequired(obj EksEncryptionConfigProvider) error { + return nil +} + +// AssertRecurseEksEncryptionConfigProviderRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksEncryptionConfigProvider (e.g. [][]EksEncryptionConfigProvider), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksEncryptionConfigProviderRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksEncryptionConfigProvider, ok := obj.(EksEncryptionConfigProvider) + if !ok { + return ErrTypeAssertionError + } + return AssertEksEncryptionConfigProviderRequired(aEksEncryptionConfigProvider) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_iam.go b/.gen/pipeline/pipeline/model_eks_iam.go index 8fe3e1044a..ecf86ebe45 100644 --- a/.gen/pipeline/pipeline/model_eks_iam.go +++ b/.gen/pipeline/pipeline/model_eks_iam.go @@ -21,3 +21,20 @@ type EksIam struct { // Marks if the userid associated with the clusters AWS secret has to be used in kubeconfig (bypasses IAM user creation). DefaultUser bool `json:"defaultUser,omitempty"` } + +// AssertEksIamRequired checks if the required fields are not zero-ed +func AssertEksIamRequired(obj EksIam) error { + return nil +} + +// AssertRecurseEksIamRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksIam (e.g. [][]EksIam), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksIamRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksIam, ok := obj.(EksIam) + if !ok { + return ErrTypeAssertionError + } + return AssertEksIamRequired(aEksIam) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_node_pool.go b/.gen/pipeline/pipeline/model_eks_node_pool.go index 8934c89a81..ae66118004 100644 --- a/.gen/pipeline/pipeline/model_eks_node_pool.go +++ b/.gen/pipeline/pipeline/model_eks_node_pool.go @@ -41,3 +41,40 @@ type EksNodePool struct { // Setup available instance stores (NVMe disks) to use for Kubelet root if available. As a result emptyDir volumes will be provisioned on local instance storage disks. You can check out available instance storages here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes. UseInstanceStore bool `json:"useInstanceStore,omitempty"` } + +// AssertEksNodePoolRequired checks if the required fields are not zero-ed +func AssertEksNodePoolRequired(obj EksNodePool) error { + elements := map[string]interface{}{ + "instanceType": obj.InstanceType, + "spotPrice": obj.SpotPrice, + "minCount": obj.MinCount, + "maxCount": obj.MaxCount, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + if err := AssertEksSubnetRequired(obj.Subnet); err != nil { + return err + } + return nil +} + +// AssertRecurseEksNodePoolRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksNodePool (e.g. [][]EksNodePool), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksNodePoolRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksNodePool, ok := obj.(EksNodePool) + if !ok { + return ErrTypeAssertionError + } + return AssertEksNodePoolRequired(aEksNodePool) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_node_pool_all_of.go b/.gen/pipeline/pipeline/model_eks_node_pool_all_of.go index 64309619da..455cc30116 100644 --- a/.gen/pipeline/pipeline/model_eks_node_pool_all_of.go +++ b/.gen/pipeline/pipeline/model_eks_node_pool_all_of.go @@ -39,3 +39,37 @@ type EksNodePoolAllOf struct { // Setup available instance stores (NVMe disks) to use for Kubelet root if available. As a result emptyDir volumes will be provisioned on local instance storage disks. You can check out available instance storages here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes. UseInstanceStore bool `json:"useInstanceStore,omitempty"` } + +// AssertEksNodePoolAllOfRequired checks if the required fields are not zero-ed +func AssertEksNodePoolAllOfRequired(obj EksNodePoolAllOf) error { + elements := map[string]interface{}{ + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + return nil +} + +// AssertRecurseEksNodePoolAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksNodePoolAllOf (e.g. [][]EksNodePoolAllOf), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksNodePoolAllOfRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksNodePoolAllOf, ok := obj.(EksNodePoolAllOf) + if !ok { + return ErrTypeAssertionError + } + return AssertEksNodePoolAllOfRequired(aEksNodePoolAllOf) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_node_pool_volume_encryption.go b/.gen/pipeline/pipeline/model_eks_node_pool_volume_encryption.go index ff59dd4837..288176f5fb 100644 --- a/.gen/pipeline/pipeline/model_eks_node_pool_volume_encryption.go +++ b/.gen/pipeline/pipeline/model_eks_node_pool_volume_encryption.go @@ -19,3 +19,29 @@ type EksNodePoolVolumeEncryption struct { // KMS key ARN to use for node volume encryption. EncryptionKeyARN string `json:"encryptionKeyARN,omitempty"` } + +// AssertEksNodePoolVolumeEncryptionRequired checks if the required fields are not zero-ed +func AssertEksNodePoolVolumeEncryptionRequired(obj EksNodePoolVolumeEncryption) error { + elements := map[string]interface{}{ + "enabled": obj.Enabled, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseEksNodePoolVolumeEncryptionRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksNodePoolVolumeEncryption (e.g. [][]EksNodePoolVolumeEncryption), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksNodePoolVolumeEncryptionRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksNodePoolVolumeEncryption, ok := obj.(EksNodePoolVolumeEncryption) + if !ok { + return ErrTypeAssertionError + } + return AssertEksNodePoolVolumeEncryptionRequired(aEksNodePoolVolumeEncryption) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_subnet.go b/.gen/pipeline/pipeline/model_eks_subnet.go index 6cda61eb8a..d890cc0eac 100644 --- a/.gen/pipeline/pipeline/model_eks_subnet.go +++ b/.gen/pipeline/pipeline/model_eks_subnet.go @@ -21,3 +21,20 @@ type EksSubnet struct { // The AZ to create the subnet into. AvailabilityZone string `json:"availabilityZone,omitempty"` } + +// AssertEksSubnetRequired checks if the required fields are not zero-ed +func AssertEksSubnetRequired(obj EksSubnet) error { + return nil +} + +// AssertRecurseEksSubnetRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksSubnet (e.g. [][]EksSubnet), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksSubnetRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksSubnet, ok := obj.(EksSubnet) + if !ok { + return ErrTypeAssertionError + } + return AssertEksSubnetRequired(aEksSubnet) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_update_cluster_request.go b/.gen/pipeline/pipeline/model_eks_update_cluster_request.go index 2d71e8953a..f70a41c17f 100644 --- a/.gen/pipeline/pipeline/model_eks_update_cluster_request.go +++ b/.gen/pipeline/pipeline/model_eks_update_cluster_request.go @@ -14,3 +14,20 @@ type EksUpdateClusterRequest struct { Version string `json:"version,omitempty"` } + +// AssertEksUpdateClusterRequestRequired checks if the required fields are not zero-ed +func AssertEksUpdateClusterRequestRequired(obj EksUpdateClusterRequest) error { + return nil +} + +// AssertRecurseEksUpdateClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksUpdateClusterRequest (e.g. [][]EksUpdateClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksUpdateClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksUpdateClusterRequest, ok := obj.(EksUpdateClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertEksUpdateClusterRequestRequired(aEksUpdateClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_update_node_pool_request.go b/.gen/pipeline/pipeline/model_eks_update_node_pool_request.go index a810b45333..719d19459e 100644 --- a/.gen/pipeline/pipeline/model_eks_update_node_pool_request.go +++ b/.gen/pipeline/pipeline/model_eks_update_node_pool_request.go @@ -49,3 +49,40 @@ type EksUpdateNodePoolRequest struct { Options BaseUpdateNodePoolOptions `json:"options,omitempty"` } + +// AssertEksUpdateNodePoolRequestRequired checks if the required fields are not zero-ed +func AssertEksUpdateNodePoolRequestRequired(obj EksUpdateNodePoolRequest) error { + elements := map[string]interface{}{ + "size": obj.Size, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + if err := AssertBaseUpdateNodePoolOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseEksUpdateNodePoolRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksUpdateNodePoolRequest (e.g. [][]EksUpdateNodePoolRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksUpdateNodePoolRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksUpdateNodePoolRequest, ok := obj.(EksUpdateNodePoolRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertEksUpdateNodePoolRequestRequired(aEksUpdateNodePoolRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_update_node_pool_request_all_of.go b/.gen/pipeline/pipeline/model_eks_update_node_pool_request_all_of.go index fa506536a6..8d43d4d970 100644 --- a/.gen/pipeline/pipeline/model_eks_update_node_pool_request_all_of.go +++ b/.gen/pipeline/pipeline/model_eks_update_node_pool_request_all_of.go @@ -42,3 +42,31 @@ type EksUpdateNodePoolRequestAllOf struct { Options BaseUpdateNodePoolOptions `json:"options,omitempty"` } + +// AssertEksUpdateNodePoolRequestAllOfRequired checks if the required fields are not zero-ed +func AssertEksUpdateNodePoolRequestAllOfRequired(obj EksUpdateNodePoolRequestAllOf) error { + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + if err := AssertBaseUpdateNodePoolOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseEksUpdateNodePoolRequestAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksUpdateNodePoolRequestAllOf (e.g. [][]EksUpdateNodePoolRequestAllOf), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksUpdateNodePoolRequestAllOfRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksUpdateNodePoolRequestAllOf, ok := obj.(EksUpdateNodePoolRequestAllOf) + if !ok { + return ErrTypeAssertionError + } + return AssertEksUpdateNodePoolRequestAllOfRequired(aEksUpdateNodePoolRequestAllOf) + }) +} diff --git a/.gen/pipeline/pipeline/model_eks_vpc.go b/.gen/pipeline/pipeline/model_eks_vpc.go index 6d2d67afde..46aa22de0b 100644 --- a/.gen/pipeline/pipeline/model_eks_vpc.go +++ b/.gen/pipeline/pipeline/model_eks_vpc.go @@ -18,3 +18,20 @@ type EksVpc struct { // The CIDR range for the VPC in case new VPC is created. Cidr string `json:"cidr,omitempty"` } + +// AssertEksVpcRequired checks if the required fields are not zero-ed +func AssertEksVpcRequired(obj EksVpc) error { + return nil +} + +// AssertRecurseEksVpcRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EksVpc (e.g. [][]EksVpc), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEksVpcRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEksVpc, ok := obj.(EksVpc) + if !ok { + return ErrTypeAssertionError + } + return AssertEksVpcRequired(aEksVpc) + }) +} diff --git a/.gen/pipeline/pipeline/model_enable_ark_request.go b/.gen/pipeline/pipeline/model_enable_ark_request.go index 03f06e8afd..db6e32bfa3 100644 --- a/.gen/pipeline/pipeline/model_enable_ark_request.go +++ b/.gen/pipeline/pipeline/model_enable_ark_request.go @@ -43,3 +43,39 @@ type EnableArkRequest struct { Options BackupOptions `json:"options,omitempty"` } + +// AssertEnableArkRequestRequired checks if the required fields are not zero-ed +func AssertEnableArkRequestRequired(obj EnableArkRequest) error { + elements := map[string]interface{}{ + "cloud": obj.Cloud, + "bucketName": obj.BucketName, + "schedule": obj.Schedule, + "ttl": obj.Ttl, + "secretId": obj.SecretId, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertLabelsRequired(obj.Labels); err != nil { + return err + } + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseEnableArkRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EnableArkRequest (e.g. [][]EnableArkRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEnableArkRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEnableArkRequest, ok := obj.(EnableArkRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertEnableArkRequestRequired(aEnableArkRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_enable_ark_response.go b/.gen/pipeline/pipeline/model_enable_ark_response.go index 904129dbe3..6d3370400b 100644 --- a/.gen/pipeline/pipeline/model_enable_ark_response.go +++ b/.gen/pipeline/pipeline/model_enable_ark_response.go @@ -14,3 +14,20 @@ type EnableArkResponse struct { Status int32 `json:"status,omitempty"` } + +// AssertEnableArkResponseRequired checks if the required fields are not zero-ed +func AssertEnableArkResponseRequired(obj EnableArkResponse) error { + return nil +} + +// AssertRecurseEnableArkResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EnableArkResponse (e.g. [][]EnableArkResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEnableArkResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEnableArkResponse, ok := obj.(EnableArkResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertEnableArkResponseRequired(aEnableArkResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_endpoint_item.go b/.gen/pipeline/pipeline/model_endpoint_item.go index 38bf72ca14..d3d5823eab 100644 --- a/.gen/pipeline/pipeline/model_endpoint_item.go +++ b/.gen/pipeline/pipeline/model_endpoint_item.go @@ -18,3 +18,25 @@ type EndpointItem struct { Urls []UrlItem `json:"urls,omitempty"` } + +// AssertEndpointItemRequired checks if the required fields are not zero-ed +func AssertEndpointItemRequired(obj EndpointItem) error { + for _, el := range obj.Urls { + if err := AssertUrlItemRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseEndpointItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EndpointItem (e.g. [][]EndpointItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEndpointItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEndpointItem, ok := obj.(EndpointItem) + if !ok { + return ErrTypeAssertionError + } + return AssertEndpointItemRequired(aEndpointItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_error.go b/.gen/pipeline/pipeline/model_error.go index b04f44c106..cfa425e1ef 100644 --- a/.gen/pipeline/pipeline/model_error.go +++ b/.gen/pipeline/pipeline/model_error.go @@ -29,11 +29,31 @@ type Error struct { Instance string `json:"instance,omitempty"` // HTTP status code. Deprecated: use status instead. + // Deprecated Code int32 `json:"code,omitempty"` // Error message. Deprecated: use detail instead. + // Deprecated Message string `json:"message,omitempty"` // Error message. Deprecated: use title instead. + // Deprecated Error string `json:"error,omitempty"` } + +// AssertErrorRequired checks if the required fields are not zero-ed +func AssertErrorRequired(obj Error) error { + return nil +} + +// AssertRecurseErrorRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Error (e.g. [][]Error), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseErrorRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aError, ok := obj.(Error) + if !ok { + return ErrTypeAssertionError + } + return AssertErrorRequired(aError) + }) +} diff --git a/.gen/pipeline/pipeline/model_generic_node_pool.go b/.gen/pipeline/pipeline/model_generic_node_pool.go index 1147e026f2..c49b736afa 100644 --- a/.gen/pipeline/pipeline/model_generic_node_pool.go +++ b/.gen/pipeline/pipeline/model_generic_node_pool.go @@ -22,3 +22,30 @@ type GenericNodePool struct { // Node pool labels. Labels map[string]string `json:"labels,omitempty"` } + +// AssertGenericNodePoolRequired checks if the required fields are not zero-ed +func AssertGenericNodePoolRequired(obj GenericNodePool) error { + elements := map[string]interface{}{ + "name": obj.Name, + "size": obj.Size, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseGenericNodePoolRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GenericNodePool (e.g. [][]GenericNodePool), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGenericNodePoolRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGenericNodePool, ok := obj.(GenericNodePool) + if !ok { + return ErrTypeAssertionError + } + return AssertGenericNodePoolRequired(aGenericNodePool) + }) +} diff --git a/.gen/pipeline/pipeline/model_get_cluster_bootstrap_response.go b/.gen/pipeline/pipeline/model_get_cluster_bootstrap_response.go index 7e43b77b93..84d141e450 100644 --- a/.gen/pipeline/pipeline/model_get_cluster_bootstrap_response.go +++ b/.gen/pipeline/pipeline/model_get_cluster_bootstrap_response.go @@ -18,3 +18,20 @@ type GetClusterBootstrapResponse struct { MasterAddress string `json:"masterAddress,omitempty"` } + +// AssertGetClusterBootstrapResponseRequired checks if the required fields are not zero-ed +func AssertGetClusterBootstrapResponseRequired(obj GetClusterBootstrapResponse) error { + return nil +} + +// AssertRecurseGetClusterBootstrapResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetClusterBootstrapResponse (e.g. [][]GetClusterBootstrapResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetClusterBootstrapResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetClusterBootstrapResponse, ok := obj.(GetClusterBootstrapResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertGetClusterBootstrapResponseRequired(aGetClusterBootstrapResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_get_cluster_status_response.go b/.gen/pipeline/pipeline/model_get_cluster_status_response.go index 397f2d3a04..8a136298ec 100644 --- a/.gen/pipeline/pipeline/model_get_cluster_status_response.go +++ b/.gen/pipeline/pipeline/model_get_cluster_status_response.go @@ -52,3 +52,26 @@ type GetClusterStatusResponse struct { TotalSummary ResourceSummary `json:"totalSummary,omitempty"` } + +// AssertGetClusterStatusResponseRequired checks if the required fields are not zero-ed +func AssertGetClusterStatusResponseRequired(obj GetClusterStatusResponse) error { + if err := AssertOidcConfigRequired(obj.Oidc); err != nil { + return err + } + if err := AssertResourceSummaryRequired(obj.TotalSummary); err != nil { + return err + } + return nil +} + +// AssertRecurseGetClusterStatusResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetClusterStatusResponse (e.g. [][]GetClusterStatusResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetClusterStatusResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetClusterStatusResponse, ok := obj.(GetClusterStatusResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertGetClusterStatusResponseRequired(aGetClusterStatusResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_get_deployment_resources_response_inner.go b/.gen/pipeline/pipeline/model_get_deployment_resources_response_inner.go new file mode 100644 index 0000000000..642caea6e7 --- /dev/null +++ b/.gen/pipeline/pipeline/model_get_deployment_resources_response_inner.go @@ -0,0 +1,35 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type GetDeploymentResourcesResponseInner struct { + + Name string `json:"name,omitempty"` + + Kind string `json:"kind,omitempty"` +} + +// AssertGetDeploymentResourcesResponseInnerRequired checks if the required fields are not zero-ed +func AssertGetDeploymentResourcesResponseInnerRequired(obj GetDeploymentResourcesResponseInner) error { + return nil +} + +// AssertRecurseGetDeploymentResourcesResponseInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetDeploymentResourcesResponseInner (e.g. [][]GetDeploymentResourcesResponseInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetDeploymentResourcesResponseInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetDeploymentResourcesResponseInner, ok := obj.(GetDeploymentResourcesResponseInner) + if !ok { + return ErrTypeAssertionError + } + return AssertGetDeploymentResourcesResponseInnerRequired(aGetDeploymentResourcesResponseInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_get_deployment_response.go b/.gen/pipeline/pipeline/model_get_deployment_response.go index 7a154936cc..4e09c901bb 100644 --- a/.gen/pipeline/pipeline/model_get_deployment_response.go +++ b/.gen/pipeline/pipeline/model_get_deployment_response.go @@ -36,3 +36,20 @@ type GetDeploymentResponse struct { // current values of the deployment Values map[string]interface{} `json:"values,omitempty"` } + +// AssertGetDeploymentResponseRequired checks if the required fields are not zero-ed +func AssertGetDeploymentResponseRequired(obj GetDeploymentResponse) error { + return nil +} + +// AssertRecurseGetDeploymentResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetDeploymentResponse (e.g. [][]GetDeploymentResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetDeploymentResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetDeploymentResponse, ok := obj.(GetDeploymentResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertGetDeploymentResponseRequired(aGetDeploymentResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_get_leader_election_response.go b/.gen/pipeline/pipeline/model_get_leader_election_response.go index 4ad08c1d08..644cd9b529 100644 --- a/.gen/pipeline/pipeline/model_get_leader_election_response.go +++ b/.gen/pipeline/pipeline/model_get_leader_election_response.go @@ -16,3 +16,29 @@ type GetLeaderElectionResponse struct { Ip string `json:"ip,omitempty"` } + +// AssertGetLeaderElectionResponseRequired checks if the required fields are not zero-ed +func AssertGetLeaderElectionResponseRequired(obj GetLeaderElectionResponse) error { + elements := map[string]interface{}{ + "hostname": obj.Hostname, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseGetLeaderElectionResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetLeaderElectionResponse (e.g. [][]GetLeaderElectionResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetLeaderElectionResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetLeaderElectionResponse, ok := obj.(GetLeaderElectionResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertGetLeaderElectionResponseRequired(aGetLeaderElectionResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_get_pke_commands_response.go b/.gen/pipeline/pipeline/model_get_pke_commands_response.go index 5ab4271032..ca3345a94c 100644 --- a/.gen/pipeline/pipeline/model_get_pke_commands_response.go +++ b/.gen/pipeline/pipeline/model_get_pke_commands_response.go @@ -12,5 +12,22 @@ package pipeline type GetPkeCommandsResponse struct { - AdditionalProperties string `json:"additionalProperties,omitempty"` + AdditionalPropertiesField string `json:"additionalProperties,omitempty"` +} + +// AssertGetPkeCommandsResponseRequired checks if the required fields are not zero-ed +func AssertGetPkeCommandsResponseRequired(obj GetPkeCommandsResponse) error { + return nil +} + +// AssertRecurseGetPkeCommandsResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetPkeCommandsResponse (e.g. [][]GetPkeCommandsResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetPkeCommandsResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetPkeCommandsResponse, ok := obj.(GetPkeCommandsResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertGetPkeCommandsResponseRequired(aGetPkeCommandsResponse) + }) } diff --git a/.gen/pipeline/pipeline/model_google_project.go b/.gen/pipeline/pipeline/model_google_project.go index f42c222c4e..96c3961cf4 100644 --- a/.gen/pipeline/pipeline/model_google_project.go +++ b/.gen/pipeline/pipeline/model_google_project.go @@ -21,3 +21,20 @@ type GoogleProject struct { LifecycleState string `json:"lifecycleState,omitempty"` } + +// AssertGoogleProjectRequired checks if the required fields are not zero-ed +func AssertGoogleProjectRequired(obj GoogleProject) error { + return nil +} + +// AssertRecurseGoogleProjectRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GoogleProject (e.g. [][]GoogleProject), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGoogleProjectRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGoogleProject, ok := obj.(GoogleProject) + if !ok { + return ErrTypeAssertionError + } + return AssertGoogleProjectRequired(aGoogleProject) + }) +} diff --git a/.gen/pipeline/pipeline/model_google_projects.go b/.gen/pipeline/pipeline/model_google_projects.go index 1052f23c13..c88bd58675 100644 --- a/.gen/pipeline/pipeline/model_google_projects.go +++ b/.gen/pipeline/pipeline/model_google_projects.go @@ -15,3 +15,25 @@ type GoogleProjects struct { Projects []GoogleProject `json:"projects,omitempty"` } + +// AssertGoogleProjectsRequired checks if the required fields are not zero-ed +func AssertGoogleProjectsRequired(obj GoogleProjects) error { + for _, el := range obj.Projects { + if err := AssertGoogleProjectRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseGoogleProjectsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GoogleProjects (e.g. [][]GoogleProjects), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGoogleProjectsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGoogleProjects, ok := obj.(GoogleProjects) + if !ok { + return ErrTypeAssertionError + } + return AssertGoogleProjectsRequired(aGoogleProjects) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_chart_details_response.go b/.gen/pipeline/pipeline/model_helm_chart_details_response.go index 52ac964bca..811e1d3b5c 100644 --- a/.gen/pipeline/pipeline/model_helm_chart_details_response.go +++ b/.gen/pipeline/pipeline/model_helm_chart_details_response.go @@ -16,5 +16,27 @@ type HelmChartDetailsResponse struct { Repo string `json:"repo,omitempty"` - Versions []HelmChartDetailsResponseVersions `json:"versions,omitempty"` + Versions []HelmChartDetailsResponseVersionsInner `json:"versions,omitempty"` +} + +// AssertHelmChartDetailsResponseRequired checks if the required fields are not zero-ed +func AssertHelmChartDetailsResponseRequired(obj HelmChartDetailsResponse) error { + for _, el := range obj.Versions { + if err := AssertHelmChartDetailsResponseVersionsInnerRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseHelmChartDetailsResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmChartDetailsResponse (e.g. [][]HelmChartDetailsResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmChartDetailsResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmChartDetailsResponse, ok := obj.(HelmChartDetailsResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmChartDetailsResponseRequired(aHelmChartDetailsResponse) + }) } diff --git a/.gen/pipeline/pipeline/model_helm_chart_details_response_chart.go b/.gen/pipeline/pipeline/model_helm_chart_details_response_chart.go deleted file mode 100644 index 087579ae84..0000000000 --- a/.gen/pipeline/pipeline/model_helm_chart_details_response_chart.go +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type HelmChartDetailsResponseChart struct { - - Name string `json:"name,omitempty"` - - Home string `json:"home,omitempty"` - - Sources []string `json:"sources,omitempty"` - - Version string `json:"version,omitempty"` - - Description string `json:"description,omitempty"` - - Keywords []string `json:"keywords,omitempty"` - - Maintainers []HelmChartDetailsResponseChartMaintainers `json:"maintainers,omitempty"` - - Engine string `json:"engine,omitempty"` - - Icon string `json:"icon,omitempty"` - - AppVersion string `json:"appVersion,omitempty"` - - ApiVersion string `json:"apiVersion,omitempty"` - - Deprecated bool `json:"deprecated,omitempty"` - - Urls []string `json:"urls,omitempty"` - - Created string `json:"created,omitempty"` - - Digest string `json:"digest,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_helm_chart_details_response_chart_maintainers.go b/.gen/pipeline/pipeline/model_helm_chart_details_response_chart_maintainers.go deleted file mode 100644 index 9cc8594ae5..0000000000 --- a/.gen/pipeline/pipeline/model_helm_chart_details_response_chart_maintainers.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type HelmChartDetailsResponseChartMaintainers struct { - - Name string `json:"name,omitempty"` - - Email string `json:"email,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_helm_chart_details_response_versions.go b/.gen/pipeline/pipeline/model_helm_chart_details_response_versions.go deleted file mode 100644 index bfde44bc40..0000000000 --- a/.gen/pipeline/pipeline/model_helm_chart_details_response_versions.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type HelmChartDetailsResponseVersions struct { - - Chart HelmChartDetailsResponseChart `json:"chart,omitempty"` - - Values string `json:"values,omitempty"` - - Readme string `json:"readme,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_helm_chart_details_response_versions_inner.go b/.gen/pipeline/pipeline/model_helm_chart_details_response_versions_inner.go new file mode 100644 index 0000000000..c6d0c2e729 --- /dev/null +++ b/.gen/pipeline/pipeline/model_helm_chart_details_response_versions_inner.go @@ -0,0 +1,40 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type HelmChartDetailsResponseVersionsInner struct { + + Chart HelmChartsListResponseInnerChartsInnerInner `json:"chart,omitempty"` + + Values string `json:"values,omitempty"` + + Readme string `json:"readme,omitempty"` +} + +// AssertHelmChartDetailsResponseVersionsInnerRequired checks if the required fields are not zero-ed +func AssertHelmChartDetailsResponseVersionsInnerRequired(obj HelmChartDetailsResponseVersionsInner) error { + if err := AssertHelmChartsListResponseInnerChartsInnerInnerRequired(obj.Chart); err != nil { + return err + } + return nil +} + +// AssertRecurseHelmChartDetailsResponseVersionsInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmChartDetailsResponseVersionsInner (e.g. [][]HelmChartDetailsResponseVersionsInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmChartDetailsResponseVersionsInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmChartDetailsResponseVersionsInner, ok := obj.(HelmChartDetailsResponseVersionsInner) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmChartDetailsResponseVersionsInnerRequired(aHelmChartDetailsResponseVersionsInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_charts_list_response_inner.go b/.gen/pipeline/pipeline/model_helm_charts_list_response_inner.go new file mode 100644 index 0000000000..980b938b5d --- /dev/null +++ b/.gen/pipeline/pipeline/model_helm_charts_list_response_inner.go @@ -0,0 +1,38 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type HelmChartsListResponseInner struct { + + Name string `json:"name,omitempty"` + + Charts [][]HelmChartsListResponseInnerChartsInnerInner `json:"charts,omitempty"` +} + +// AssertHelmChartsListResponseInnerRequired checks if the required fields are not zero-ed +func AssertHelmChartsListResponseInnerRequired(obj HelmChartsListResponseInner) error { + if err := AssertRecurseHelmChartsListResponseInnerChartsInnerInnerRequired(obj.Charts); err != nil { + return err + } + return nil +} + +// AssertRecurseHelmChartsListResponseInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmChartsListResponseInner (e.g. [][]HelmChartsListResponseInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmChartsListResponseInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmChartsListResponseInner, ok := obj.(HelmChartsListResponseInner) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmChartsListResponseInnerRequired(aHelmChartsListResponseInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_charts_list_response_inner_charts_inner_inner.go b/.gen/pipeline/pipeline/model_helm_charts_list_response_inner_charts_inner_inner.go new file mode 100644 index 0000000000..d193990b70 --- /dev/null +++ b/.gen/pipeline/pipeline/model_helm_charts_list_response_inner_charts_inner_inner.go @@ -0,0 +1,66 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type HelmChartsListResponseInnerChartsInnerInner struct { + + Name string `json:"name,omitempty"` + + Home string `json:"home,omitempty"` + + Sources []string `json:"sources,omitempty"` + + Version string `json:"version,omitempty"` + + Description string `json:"description,omitempty"` + + Keywords []string `json:"keywords,omitempty"` + + Maintainers []HelmChartsListResponseInnerChartsInnerInnerMaintainersInner `json:"maintainers,omitempty"` + + Engine string `json:"engine,omitempty"` + + Icon string `json:"icon,omitempty"` + + AppVersion string `json:"appVersion,omitempty"` + + ApiVersion string `json:"apiVersion,omitempty"` + + Deprecated bool `json:"deprecated,omitempty"` + + Urls []string `json:"urls,omitempty"` + + Created string `json:"created,omitempty"` + + Digest string `json:"digest,omitempty"` +} + +// AssertHelmChartsListResponseInnerChartsInnerInnerRequired checks if the required fields are not zero-ed +func AssertHelmChartsListResponseInnerChartsInnerInnerRequired(obj HelmChartsListResponseInnerChartsInnerInner) error { + for _, el := range obj.Maintainers { + if err := AssertHelmChartsListResponseInnerChartsInnerInnerMaintainersInnerRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseHelmChartsListResponseInnerChartsInnerInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmChartsListResponseInnerChartsInnerInner (e.g. [][]HelmChartsListResponseInnerChartsInnerInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmChartsListResponseInnerChartsInnerInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmChartsListResponseInnerChartsInnerInner, ok := obj.(HelmChartsListResponseInnerChartsInnerInner) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmChartsListResponseInnerChartsInnerInnerRequired(aHelmChartsListResponseInnerChartsInnerInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_charts_list_response_inner_charts_inner_inner_maintainers_inner.go b/.gen/pipeline/pipeline/model_helm_charts_list_response_inner_charts_inner_inner_maintainers_inner.go new file mode 100644 index 0000000000..48721f161d --- /dev/null +++ b/.gen/pipeline/pipeline/model_helm_charts_list_response_inner_charts_inner_inner_maintainers_inner.go @@ -0,0 +1,35 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type HelmChartsListResponseInnerChartsInnerInnerMaintainersInner struct { + + Name string `json:"name,omitempty"` + + Email string `json:"email,omitempty"` +} + +// AssertHelmChartsListResponseInnerChartsInnerInnerMaintainersInnerRequired checks if the required fields are not zero-ed +func AssertHelmChartsListResponseInnerChartsInnerInnerMaintainersInnerRequired(obj HelmChartsListResponseInnerChartsInnerInnerMaintainersInner) error { + return nil +} + +// AssertRecurseHelmChartsListResponseInnerChartsInnerInnerMaintainersInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmChartsListResponseInnerChartsInnerInnerMaintainersInner (e.g. [][]HelmChartsListResponseInnerChartsInnerInnerMaintainersInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmChartsListResponseInnerChartsInnerInnerMaintainersInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmChartsListResponseInnerChartsInnerInnerMaintainersInner, ok := obj.(HelmChartsListResponseInnerChartsInnerInnerMaintainersInner) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmChartsListResponseInnerChartsInnerInnerMaintainersInnerRequired(aHelmChartsListResponseInnerChartsInnerInnerMaintainersInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_repo_list_item.go b/.gen/pipeline/pipeline/model_helm_repo_list_item.go index d8c976f14c..b88fe69fc7 100644 --- a/.gen/pipeline/pipeline/model_helm_repo_list_item.go +++ b/.gen/pipeline/pipeline/model_helm_repo_list_item.go @@ -28,3 +28,20 @@ type HelmRepoListItem struct { TlsSecretRef string `json:"tlsSecretRef,omitempty"` } + +// AssertHelmRepoListItemRequired checks if the required fields are not zero-ed +func AssertHelmRepoListItemRequired(obj HelmRepoListItem) error { + return nil +} + +// AssertRecurseHelmRepoListItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmRepoListItem (e.g. [][]HelmRepoListItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmRepoListItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmRepoListItem, ok := obj.(HelmRepoListItem) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmRepoListItemRequired(aHelmRepoListItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_repos_add_request.go b/.gen/pipeline/pipeline/model_helm_repos_add_request.go index 527c9c42d3..3a1f4a37c2 100644 --- a/.gen/pipeline/pipeline/model_helm_repos_add_request.go +++ b/.gen/pipeline/pipeline/model_helm_repos_add_request.go @@ -26,3 +26,30 @@ type HelmReposAddRequest struct { TlsSecretRef string `json:"tlsSecretRef,omitempty"` } + +// AssertHelmReposAddRequestRequired checks if the required fields are not zero-ed +func AssertHelmReposAddRequestRequired(obj HelmReposAddRequest) error { + elements := map[string]interface{}{ + "name": obj.Name, + "url": obj.Url, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseHelmReposAddRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmReposAddRequest (e.g. [][]HelmReposAddRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmReposAddRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmReposAddRequest, ok := obj.(HelmReposAddRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmReposAddRequestRequired(aHelmReposAddRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_repos_delete_response.go b/.gen/pipeline/pipeline/model_helm_repos_delete_response.go index 5e964e4183..f1dbf35962 100644 --- a/.gen/pipeline/pipeline/model_helm_repos_delete_response.go +++ b/.gen/pipeline/pipeline/model_helm_repos_delete_response.go @@ -18,3 +18,20 @@ type HelmReposDeleteResponse struct { Name string `json:"name,omitempty"` } + +// AssertHelmReposDeleteResponseRequired checks if the required fields are not zero-ed +func AssertHelmReposDeleteResponseRequired(obj HelmReposDeleteResponse) error { + return nil +} + +// AssertRecurseHelmReposDeleteResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmReposDeleteResponse (e.g. [][]HelmReposDeleteResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmReposDeleteResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmReposDeleteResponse, ok := obj.(HelmReposDeleteResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmReposDeleteResponseRequired(aHelmReposDeleteResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_repos_modify_request.go b/.gen/pipeline/pipeline/model_helm_repos_modify_request.go index 73f5b015c9..1e785ec4f9 100644 --- a/.gen/pipeline/pipeline/model_helm_repos_modify_request.go +++ b/.gen/pipeline/pipeline/model_helm_repos_modify_request.go @@ -26,3 +26,20 @@ type HelmReposModifyRequest struct { TlsSecretRef string `json:"tlsSecretRef,omitempty"` } + +// AssertHelmReposModifyRequestRequired checks if the required fields are not zero-ed +func AssertHelmReposModifyRequestRequired(obj HelmReposModifyRequest) error { + return nil +} + +// AssertRecurseHelmReposModifyRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmReposModifyRequest (e.g. [][]HelmReposModifyRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmReposModifyRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmReposModifyRequest, ok := obj.(HelmReposModifyRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmReposModifyRequestRequired(aHelmReposModifyRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_helm_repos_update_response.go b/.gen/pipeline/pipeline/model_helm_repos_update_response.go index 2952d5a790..10a9d2709d 100644 --- a/.gen/pipeline/pipeline/model_helm_repos_update_response.go +++ b/.gen/pipeline/pipeline/model_helm_repos_update_response.go @@ -18,3 +18,20 @@ type HelmReposUpdateResponse struct { Name string `json:"name,omitempty"` } + +// AssertHelmReposUpdateResponseRequired checks if the required fields are not zero-ed +func AssertHelmReposUpdateResponseRequired(obj HelmReposUpdateResponse) error { + return nil +} + +// AssertRecurseHelmReposUpdateResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of HelmReposUpdateResponse (e.g. [][]HelmReposUpdateResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseHelmReposUpdateResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aHelmReposUpdateResponse, ok := obj.(HelmReposUpdateResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertHelmReposUpdateResponseRequired(aHelmReposUpdateResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_install_secret_request.go b/.gen/pipeline/pipeline/model_install_secret_request.go index d1bd813046..679f9de17a 100644 --- a/.gen/pipeline/pipeline/model_install_secret_request.go +++ b/.gen/pipeline/pipeline/model_install_secret_request.go @@ -18,3 +18,29 @@ type InstallSecretRequest struct { Spec map[string]InstallSecretRequestSpecItem `json:"spec,omitempty"` } + +// AssertInstallSecretRequestRequired checks if the required fields are not zero-ed +func AssertInstallSecretRequestRequired(obj InstallSecretRequest) error { + elements := map[string]interface{}{ + "namespace": obj.Namespace, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseInstallSecretRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InstallSecretRequest (e.g. [][]InstallSecretRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInstallSecretRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInstallSecretRequest, ok := obj.(InstallSecretRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertInstallSecretRequestRequired(aInstallSecretRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_install_secret_request_spec_item.go b/.gen/pipeline/pipeline/model_install_secret_request_spec_item.go index c1943c5a09..eb234711ae 100644 --- a/.gen/pipeline/pipeline/model_install_secret_request_spec_item.go +++ b/.gen/pipeline/pipeline/model_install_secret_request_spec_item.go @@ -18,3 +18,20 @@ type InstallSecretRequestSpecItem struct { Value string `json:"value,omitempty"` } + +// AssertInstallSecretRequestSpecItemRequired checks if the required fields are not zero-ed +func AssertInstallSecretRequestSpecItemRequired(obj InstallSecretRequestSpecItem) error { + return nil +} + +// AssertRecurseInstallSecretRequestSpecItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InstallSecretRequestSpecItem (e.g. [][]InstallSecretRequestSpecItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInstallSecretRequestSpecItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInstallSecretRequestSpecItem, ok := obj.(InstallSecretRequestSpecItem) + if !ok { + return ErrTypeAssertionError + } + return AssertInstallSecretRequestSpecItemRequired(aInstallSecretRequestSpecItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_install_secret_response.go b/.gen/pipeline/pipeline/model_install_secret_response.go index fd40dfdf89..1d8d193950 100644 --- a/.gen/pipeline/pipeline/model_install_secret_response.go +++ b/.gen/pipeline/pipeline/model_install_secret_response.go @@ -14,3 +14,29 @@ type InstallSecretResponse struct { Name string `json:"name"` } + +// AssertInstallSecretResponseRequired checks if the required fields are not zero-ed +func AssertInstallSecretResponseRequired(obj InstallSecretResponse) error { + elements := map[string]interface{}{ + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseInstallSecretResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InstallSecretResponse (e.g. [][]InstallSecretResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInstallSecretResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInstallSecretResponse, ok := obj.(InstallSecretResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertInstallSecretResponseRequired(aInstallSecretResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_install_secrets_request.go b/.gen/pipeline/pipeline/model_install_secrets_request.go index a900d1c75b..900e1ee3d8 100644 --- a/.gen/pipeline/pipeline/model_install_secrets_request.go +++ b/.gen/pipeline/pipeline/model_install_secrets_request.go @@ -16,3 +16,32 @@ type InstallSecretsRequest struct { Query InstallSecretsRequestQuery `json:"query,omitempty"` } + +// AssertInstallSecretsRequestRequired checks if the required fields are not zero-ed +func AssertInstallSecretsRequestRequired(obj InstallSecretsRequest) error { + elements := map[string]interface{}{ + "namespace": obj.Namespace, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertInstallSecretsRequestQueryRequired(obj.Query); err != nil { + return err + } + return nil +} + +// AssertRecurseInstallSecretsRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InstallSecretsRequest (e.g. [][]InstallSecretsRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInstallSecretsRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInstallSecretsRequest, ok := obj.(InstallSecretsRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertInstallSecretsRequestRequired(aInstallSecretsRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_install_secrets_request_query.go b/.gen/pipeline/pipeline/model_install_secrets_request_query.go index 2b3fef913b..59e6456d90 100644 --- a/.gen/pipeline/pipeline/model_install_secrets_request_query.go +++ b/.gen/pipeline/pipeline/model_install_secrets_request_query.go @@ -18,3 +18,20 @@ type InstallSecretsRequestQuery struct { Tags []string `json:"tags,omitempty"` } + +// AssertInstallSecretsRequestQueryRequired checks if the required fields are not zero-ed +func AssertInstallSecretsRequestQueryRequired(obj InstallSecretsRequestQuery) error { + return nil +} + +// AssertRecurseInstallSecretsRequestQueryRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InstallSecretsRequestQuery (e.g. [][]InstallSecretsRequestQuery), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInstallSecretsRequestQueryRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInstallSecretsRequestQuery, ok := obj.(InstallSecretsRequestQuery) + if !ok { + return ErrTypeAssertionError + } + return AssertInstallSecretsRequestQueryRequired(aInstallSecretsRequestQuery) + }) +} diff --git a/.gen/pipeline/pipeline/model_integrated_service_details.go b/.gen/pipeline/pipeline/model_integrated_service_details.go index 9109c5b291..e16fc12091 100644 --- a/.gen/pipeline/pipeline/model_integrated_service_details.go +++ b/.gen/pipeline/pipeline/model_integrated_service_details.go @@ -18,3 +18,29 @@ type IntegratedServiceDetails struct { Status string `json:"status"` } + +// AssertIntegratedServiceDetailsRequired checks if the required fields are not zero-ed +func AssertIntegratedServiceDetailsRequired(obj IntegratedServiceDetails) error { + elements := map[string]interface{}{ + "status": obj.Status, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseIntegratedServiceDetailsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of IntegratedServiceDetails (e.g. [][]IntegratedServiceDetails), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseIntegratedServiceDetailsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aIntegratedServiceDetails, ok := obj.(IntegratedServiceDetails) + if !ok { + return ErrTypeAssertionError + } + return AssertIntegratedServiceDetailsRequired(aIntegratedServiceDetails) + }) +} diff --git a/.gen/pipeline/pipeline/model_labels.go b/.gen/pipeline/pipeline/model_labels.go index e7be069a56..aa6fdac6c3 100644 --- a/.gen/pipeline/pipeline/model_labels.go +++ b/.gen/pipeline/pipeline/model_labels.go @@ -14,3 +14,20 @@ type Labels struct { BackupType string `json:"backup-type,omitempty"` } + +// AssertLabelsRequired checks if the required fields are not zero-ed +func AssertLabelsRequired(obj Labels) error { + return nil +} + +// AssertRecurseLabelsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Labels (e.g. [][]Labels), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseLabelsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aLabels, ok := obj.(Labels) + if !ok { + return ErrTypeAssertionError + } + return AssertLabelsRequired(aLabels) + }) +} diff --git a/.gen/pipeline/pipeline/model_list_deployments_response_item.go b/.gen/pipeline/pipeline/model_list_deployments_response_item.go index 5c4713c43a..a4d812953e 100644 --- a/.gen/pipeline/pipeline/model_list_deployments_response_item.go +++ b/.gen/pipeline/pipeline/model_list_deployments_response_item.go @@ -32,3 +32,20 @@ type ListDeploymentsResponseItem struct { Supported bool `json:"supported,omitempty"` } + +// AssertListDeploymentsResponseItemRequired checks if the required fields are not zero-ed +func AssertListDeploymentsResponseItemRequired(obj ListDeploymentsResponseItem) error { + return nil +} + +// AssertRecurseListDeploymentsResponseItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ListDeploymentsResponseItem (e.g. [][]ListDeploymentsResponseItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseListDeploymentsResponseItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aListDeploymentsResponseItem, ok := obj.(ListDeploymentsResponseItem) + if !ok { + return ErrTypeAssertionError + } + return AssertListDeploymentsResponseItemRequired(aListDeploymentsResponseItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_list_endpoints_response.go b/.gen/pipeline/pipeline/model_list_endpoints_response.go index 377b02d2e0..abc1f4f640 100644 --- a/.gen/pipeline/pipeline/model_list_endpoints_response.go +++ b/.gen/pipeline/pipeline/model_list_endpoints_response.go @@ -14,3 +14,25 @@ type ListEndpointsResponse struct { Endpoints []EndpointItem `json:"endpoints,omitempty"` } + +// AssertListEndpointsResponseRequired checks if the required fields are not zero-ed +func AssertListEndpointsResponseRequired(obj ListEndpointsResponse) error { + for _, el := range obj.Endpoints { + if err := AssertEndpointItemRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseListEndpointsResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ListEndpointsResponse (e.g. [][]ListEndpointsResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseListEndpointsResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aListEndpointsResponse, ok := obj.(ListEndpointsResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertListEndpointsResponseRequired(aListEndpointsResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_list_nodes_response.go b/.gen/pipeline/pipeline/model_list_nodes_response.go index fef97d545e..08f7c98860 100644 --- a/.gen/pipeline/pipeline/model_list_nodes_response.go +++ b/.gen/pipeline/pipeline/model_list_nodes_response.go @@ -16,3 +16,28 @@ type ListNodesResponse struct { Items []NodeItem `json:"items,omitempty"` } + +// AssertListNodesResponseRequired checks if the required fields are not zero-ed +func AssertListNodesResponseRequired(obj ListNodesResponse) error { + if err := AssertListNodesResponseMetadataRequired(obj.Metadata); err != nil { + return err + } + for _, el := range obj.Items { + if err := AssertNodeItemRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseListNodesResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ListNodesResponse (e.g. [][]ListNodesResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseListNodesResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aListNodesResponse, ok := obj.(ListNodesResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertListNodesResponseRequired(aListNodesResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_list_nodes_response_metadata.go b/.gen/pipeline/pipeline/model_list_nodes_response_metadata.go index 03b3f4b8e4..6d61b8e9c5 100644 --- a/.gen/pipeline/pipeline/model_list_nodes_response_metadata.go +++ b/.gen/pipeline/pipeline/model_list_nodes_response_metadata.go @@ -16,3 +16,20 @@ type ListNodesResponseMetadata struct { ResourceVersion string `json:"resourceVersion,omitempty"` } + +// AssertListNodesResponseMetadataRequired checks if the required fields are not zero-ed +func AssertListNodesResponseMetadataRequired(obj ListNodesResponseMetadata) error { + return nil +} + +// AssertRecurseListNodesResponseMetadataRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ListNodesResponseMetadata (e.g. [][]ListNodesResponseMetadata), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseListNodesResponseMetadataRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aListNodesResponseMetadata, ok := obj.(ListNodesResponseMetadata) + if !ok { + return ErrTypeAssertionError + } + return AssertListNodesResponseMetadataRequired(aListNodesResponseMetadata) + }) +} diff --git a/.gen/pipeline/pipeline/model_namespace_item.go b/.gen/pipeline/pipeline/model_namespace_item.go index d182834f24..db042cabe2 100644 --- a/.gen/pipeline/pipeline/model_namespace_item.go +++ b/.gen/pipeline/pipeline/model_namespace_item.go @@ -14,3 +14,20 @@ type NamespaceItem struct { Name string `json:"name,omitempty"` } + +// AssertNamespaceItemRequired checks if the required fields are not zero-ed +func AssertNamespaceItemRequired(obj NamespaceItem) error { + return nil +} + +// AssertRecurseNamespaceItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NamespaceItem (e.g. [][]NamespaceItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNamespaceItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNamespaceItem, ok := obj.(NamespaceItem) + if !ok { + return ErrTypeAssertionError + } + return AssertNamespaceItemRequired(aNamespaceItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_namespace_list_response.go b/.gen/pipeline/pipeline/model_namespace_list_response.go index a318b2dba1..d9b601fe79 100644 --- a/.gen/pipeline/pipeline/model_namespace_list_response.go +++ b/.gen/pipeline/pipeline/model_namespace_list_response.go @@ -14,3 +14,25 @@ type NamespaceListResponse struct { Namespaces []NamespaceItem `json:"namespaces,omitempty"` } + +// AssertNamespaceListResponseRequired checks if the required fields are not zero-ed +func AssertNamespaceListResponseRequired(obj NamespaceListResponse) error { + for _, el := range obj.Namespaces { + if err := AssertNamespaceItemRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseNamespaceListResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NamespaceListResponse (e.g. [][]NamespaceListResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNamespaceListResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNamespaceListResponse, ok := obj.(NamespaceListResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertNamespaceListResponseRequired(aNamespaceListResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item.go b/.gen/pipeline/pipeline/model_node_item.go index 41666c1fe3..f2cdd8ea8d 100644 --- a/.gen/pipeline/pipeline/model_node_item.go +++ b/.gen/pipeline/pipeline/model_node_item.go @@ -18,3 +18,29 @@ type NodeItem struct { Status NodeItemStatus `json:"status,omitempty"` } + +// AssertNodeItemRequired checks if the required fields are not zero-ed +func AssertNodeItemRequired(obj NodeItem) error { + if err := AssertNodeItemMetadataRequired(obj.Metadata); err != nil { + return err + } + if err := AssertNodeItemSpecRequired(obj.Spec); err != nil { + return err + } + if err := AssertNodeItemStatusRequired(obj.Status); err != nil { + return err + } + return nil +} + +// AssertRecurseNodeItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItem (e.g. [][]NodeItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItem, ok := obj.(NodeItem) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemRequired(aNodeItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_metadata.go b/.gen/pipeline/pipeline/model_node_item_metadata.go index 9d75e84802..896bc527c4 100644 --- a/.gen/pipeline/pipeline/model_node_item_metadata.go +++ b/.gen/pipeline/pipeline/model_node_item_metadata.go @@ -26,3 +26,20 @@ type NodeItemMetadata struct { Annotations map[string]string `json:"annotations,omitempty"` } + +// AssertNodeItemMetadataRequired checks if the required fields are not zero-ed +func AssertNodeItemMetadataRequired(obj NodeItemMetadata) error { + return nil +} + +// AssertRecurseNodeItemMetadataRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemMetadata (e.g. [][]NodeItemMetadata), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemMetadataRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemMetadata, ok := obj.(NodeItemMetadata) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemMetadataRequired(aNodeItemMetadata) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_spec.go b/.gen/pipeline/pipeline/model_node_item_spec.go index cf87b40201..bad30a65cc 100644 --- a/.gen/pipeline/pipeline/model_node_item_spec.go +++ b/.gen/pipeline/pipeline/model_node_item_spec.go @@ -18,3 +18,20 @@ type NodeItemSpec struct { ProviderID string `json:"providerID,omitempty"` } + +// AssertNodeItemSpecRequired checks if the required fields are not zero-ed +func AssertNodeItemSpecRequired(obj NodeItemSpec) error { + return nil +} + +// AssertRecurseNodeItemSpecRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemSpec (e.g. [][]NodeItemSpec), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemSpecRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemSpec, ok := obj.(NodeItemSpec) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemSpecRequired(aNodeItemSpec) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status.go b/.gen/pipeline/pipeline/model_node_item_status.go index f43efc8029..3901f08ef1 100644 --- a/.gen/pipeline/pipeline/model_node_item_status.go +++ b/.gen/pipeline/pipeline/model_node_item_status.go @@ -16,13 +16,57 @@ type NodeItemStatus struct { Allocatable NodeItemStatusAllocatable `json:"allocatable,omitempty"` - Conditions []NodeItemStatusConditions `json:"conditions,omitempty"` + Conditions []NodeItemStatusConditionsInner `json:"conditions,omitempty"` - Addresses []NodeItemStatusAddresses `json:"addresses,omitempty"` + Addresses []NodeItemStatusAddressesInner `json:"addresses,omitempty"` DaemonEndpoints NodeItemStatusDaemonEndpoints `json:"daemonEndpoints,omitempty"` NodeInfo NodeItemStatusNodeInfo `json:"nodeInfo,omitempty"` - Images []NodeItemStatusImages `json:"images,omitempty"` + Images []NodeItemStatusImagesInner `json:"images,omitempty"` +} + +// AssertNodeItemStatusRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusRequired(obj NodeItemStatus) error { + if err := AssertNodeItemStatusCapacityRequired(obj.Capacity); err != nil { + return err + } + if err := AssertNodeItemStatusAllocatableRequired(obj.Allocatable); err != nil { + return err + } + for _, el := range obj.Conditions { + if err := AssertNodeItemStatusConditionsInnerRequired(el); err != nil { + return err + } + } + for _, el := range obj.Addresses { + if err := AssertNodeItemStatusAddressesInnerRequired(el); err != nil { + return err + } + } + if err := AssertNodeItemStatusDaemonEndpointsRequired(obj.DaemonEndpoints); err != nil { + return err + } + if err := AssertNodeItemStatusNodeInfoRequired(obj.NodeInfo); err != nil { + return err + } + for _, el := range obj.Images { + if err := AssertNodeItemStatusImagesInnerRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseNodeItemStatusRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatus (e.g. [][]NodeItemStatus), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatus, ok := obj.(NodeItemStatus) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusRequired(aNodeItemStatus) + }) } diff --git a/.gen/pipeline/pipeline/model_node_item_status_addresses.go b/.gen/pipeline/pipeline/model_node_item_status_addresses.go deleted file mode 100644 index c66cc7d3c5..0000000000 --- a/.gen/pipeline/pipeline/model_node_item_status_addresses.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type NodeItemStatusAddresses struct { - - Type string `json:"type,omitempty"` - - Address string `json:"address,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_node_item_status_addresses_inner.go b/.gen/pipeline/pipeline/model_node_item_status_addresses_inner.go new file mode 100644 index 0000000000..b263f8c8ab --- /dev/null +++ b/.gen/pipeline/pipeline/model_node_item_status_addresses_inner.go @@ -0,0 +1,35 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type NodeItemStatusAddressesInner struct { + + Type string `json:"type,omitempty"` + + Address string `json:"address,omitempty"` +} + +// AssertNodeItemStatusAddressesInnerRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusAddressesInnerRequired(obj NodeItemStatusAddressesInner) error { + return nil +} + +// AssertRecurseNodeItemStatusAddressesInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusAddressesInner (e.g. [][]NodeItemStatusAddressesInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusAddressesInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusAddressesInner, ok := obj.(NodeItemStatusAddressesInner) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusAddressesInnerRequired(aNodeItemStatusAddressesInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status_allocatable.go b/.gen/pipeline/pipeline/model_node_item_status_allocatable.go index 67c3ed8b1a..f6980acc3e 100644 --- a/.gen/pipeline/pipeline/model_node_item_status_allocatable.go +++ b/.gen/pipeline/pipeline/model_node_item_status_allocatable.go @@ -18,3 +18,20 @@ type NodeItemStatusAllocatable struct { Pods string `json:"pods,omitempty"` } + +// AssertNodeItemStatusAllocatableRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusAllocatableRequired(obj NodeItemStatusAllocatable) error { + return nil +} + +// AssertRecurseNodeItemStatusAllocatableRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusAllocatable (e.g. [][]NodeItemStatusAllocatable), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusAllocatableRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusAllocatable, ok := obj.(NodeItemStatusAllocatable) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusAllocatableRequired(aNodeItemStatusAllocatable) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status_capacity.go b/.gen/pipeline/pipeline/model_node_item_status_capacity.go index 98f97513b3..528ae6648f 100644 --- a/.gen/pipeline/pipeline/model_node_item_status_capacity.go +++ b/.gen/pipeline/pipeline/model_node_item_status_capacity.go @@ -18,3 +18,20 @@ type NodeItemStatusCapacity struct { Pods string `json:"pods,omitempty"` } + +// AssertNodeItemStatusCapacityRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusCapacityRequired(obj NodeItemStatusCapacity) error { + return nil +} + +// AssertRecurseNodeItemStatusCapacityRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusCapacity (e.g. [][]NodeItemStatusCapacity), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusCapacityRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusCapacity, ok := obj.(NodeItemStatusCapacity) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusCapacityRequired(aNodeItemStatusCapacity) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status_conditions.go b/.gen/pipeline/pipeline/model_node_item_status_conditions.go deleted file mode 100644 index 9f73d52b52..0000000000 --- a/.gen/pipeline/pipeline/model_node_item_status_conditions.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type NodeItemStatusConditions struct { - - Type string `json:"type,omitempty"` - - Status string `json:"status,omitempty"` - - LastHeartbeatTime string `json:"lastHeartbeatTime,omitempty"` - - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - - Reason string `json:"reason,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_node_item_status_conditions_inner.go b/.gen/pipeline/pipeline/model_node_item_status_conditions_inner.go new file mode 100644 index 0000000000..03088dbb37 --- /dev/null +++ b/.gen/pipeline/pipeline/model_node_item_status_conditions_inner.go @@ -0,0 +1,43 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type NodeItemStatusConditionsInner struct { + + Type string `json:"type,omitempty"` + + Status string `json:"status,omitempty"` + + LastHeartbeatTime string `json:"lastHeartbeatTime,omitempty"` + + LastTransitionTime string `json:"lastTransitionTime,omitempty"` + + Reason string `json:"reason,omitempty"` + + Message string `json:"message,omitempty"` +} + +// AssertNodeItemStatusConditionsInnerRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusConditionsInnerRequired(obj NodeItemStatusConditionsInner) error { + return nil +} + +// AssertRecurseNodeItemStatusConditionsInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusConditionsInner (e.g. [][]NodeItemStatusConditionsInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusConditionsInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusConditionsInner, ok := obj.(NodeItemStatusConditionsInner) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusConditionsInnerRequired(aNodeItemStatusConditionsInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints.go b/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints.go index f355a21eb0..5f30cfabca 100644 --- a/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints.go +++ b/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints.go @@ -12,5 +12,25 @@ package pipeline type NodeItemStatusDaemonEndpoints struct { - KubeletEndpoint map[string]interface{} `json:"kubeletEndpoint,omitempty"` + KubeletEndpoint NodeItemStatusDaemonEndpointsKubeletEndpoint `json:"kubeletEndpoint,omitempty"` +} + +// AssertNodeItemStatusDaemonEndpointsRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusDaemonEndpointsRequired(obj NodeItemStatusDaemonEndpoints) error { + if err := AssertNodeItemStatusDaemonEndpointsKubeletEndpointRequired(obj.KubeletEndpoint); err != nil { + return err + } + return nil +} + +// AssertRecurseNodeItemStatusDaemonEndpointsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusDaemonEndpoints (e.g. [][]NodeItemStatusDaemonEndpoints), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusDaemonEndpointsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusDaemonEndpoints, ok := obj.(NodeItemStatusDaemonEndpoints) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusDaemonEndpointsRequired(aNodeItemStatusDaemonEndpoints) + }) } diff --git a/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints_kubelet_endpoint.go b/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints_kubelet_endpoint.go new file mode 100644 index 0000000000..4231e8e6f7 --- /dev/null +++ b/.gen/pipeline/pipeline/model_node_item_status_daemon_endpoints_kubelet_endpoint.go @@ -0,0 +1,33 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type NodeItemStatusDaemonEndpointsKubeletEndpoint struct { + + Port int32 `json:"Port,omitempty"` +} + +// AssertNodeItemStatusDaemonEndpointsKubeletEndpointRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusDaemonEndpointsKubeletEndpointRequired(obj NodeItemStatusDaemonEndpointsKubeletEndpoint) error { + return nil +} + +// AssertRecurseNodeItemStatusDaemonEndpointsKubeletEndpointRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusDaemonEndpointsKubeletEndpoint (e.g. [][]NodeItemStatusDaemonEndpointsKubeletEndpoint), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusDaemonEndpointsKubeletEndpointRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusDaemonEndpointsKubeletEndpoint, ok := obj.(NodeItemStatusDaemonEndpointsKubeletEndpoint) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusDaemonEndpointsKubeletEndpointRequired(aNodeItemStatusDaemonEndpointsKubeletEndpoint) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status_images.go b/.gen/pipeline/pipeline/model_node_item_status_images.go deleted file mode 100644 index c50be00233..0000000000 --- a/.gen/pipeline/pipeline/model_node_item_status_images.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type NodeItemStatusImages struct { - - Name []string `json:"name,omitempty"` - - SizeBytes int64 `json:"sizeBytes,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_node_item_status_images_inner.go b/.gen/pipeline/pipeline/model_node_item_status_images_inner.go new file mode 100644 index 0000000000..c40b2864cf --- /dev/null +++ b/.gen/pipeline/pipeline/model_node_item_status_images_inner.go @@ -0,0 +1,35 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type NodeItemStatusImagesInner struct { + + Name []string `json:"name,omitempty"` + + SizeBytes int64 `json:"sizeBytes,omitempty"` +} + +// AssertNodeItemStatusImagesInnerRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusImagesInnerRequired(obj NodeItemStatusImagesInner) error { + return nil +} + +// AssertRecurseNodeItemStatusImagesInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusImagesInner (e.g. [][]NodeItemStatusImagesInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusImagesInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusImagesInner, ok := obj.(NodeItemStatusImagesInner) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusImagesInnerRequired(aNodeItemStatusImagesInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_item_status_node_info.go b/.gen/pipeline/pipeline/model_node_item_status_node_info.go index 07f05a6b92..d59bf73a1f 100644 --- a/.gen/pipeline/pipeline/model_node_item_status_node_info.go +++ b/.gen/pipeline/pipeline/model_node_item_status_node_info.go @@ -32,3 +32,20 @@ type NodeItemStatusNodeInfo struct { Architecture string `json:"architecture,omitempty"` } + +// AssertNodeItemStatusNodeInfoRequired checks if the required fields are not zero-ed +func AssertNodeItemStatusNodeInfoRequired(obj NodeItemStatusNodeInfo) error { + return nil +} + +// AssertRecurseNodeItemStatusNodeInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodeItemStatusNodeInfo (e.g. [][]NodeItemStatusNodeInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodeItemStatusNodeInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodeItemStatusNodeInfo, ok := obj.(NodeItemStatusNodeInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertNodeItemStatusNodeInfoRequired(aNodeItemStatusNodeInfo) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool.go b/.gen/pipeline/pipeline/model_node_pool.go index ec5cb424dc..b5701b7dfc 100644 --- a/.gen/pipeline/pipeline/model_node_pool.go +++ b/.gen/pipeline/pipeline/model_node_pool.go @@ -48,3 +48,39 @@ type NodePool struct { // Setup available instance stores (NVMe disks) to use for Kubelet root if available. As a result emptyDir volumes will be provisioned on local instance storage disks. You can check out available instance storages here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes. UseInstanceStore bool `json:"useInstanceStore,omitempty"` } + +// AssertNodePoolRequired checks if the required fields are not zero-ed +func AssertNodePoolRequired(obj NodePool) error { + elements := map[string]interface{}{ + "name": obj.Name, + "size": obj.Size, + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + return nil +} + +// AssertRecurseNodePoolRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePool (e.g. [][]NodePool), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePool, ok := obj.(NodePool) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolRequired(aNodePool) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_auto_scaling.go b/.gen/pipeline/pipeline/model_node_pool_auto_scaling.go index 846e1e55f0..de9349e753 100644 --- a/.gen/pipeline/pipeline/model_node_pool_auto_scaling.go +++ b/.gen/pipeline/pipeline/model_node_pool_auto_scaling.go @@ -22,3 +22,30 @@ type NodePoolAutoScaling struct { // Maximum node pool size. MaxSize int32 `json:"maxSize"` } + +// AssertNodePoolAutoScalingRequired checks if the required fields are not zero-ed +func AssertNodePoolAutoScalingRequired(obj NodePoolAutoScaling) error { + elements := map[string]interface{}{ + "minSize": obj.MinSize, + "maxSize": obj.MaxSize, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseNodePoolAutoScalingRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolAutoScaling (e.g. [][]NodePoolAutoScaling), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolAutoScalingRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolAutoScaling, ok := obj.(NodePoolAutoScaling) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolAutoScalingRequired(aNodePoolAutoScaling) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_status.go b/.gen/pipeline/pipeline/model_node_pool_status.go index 00435cb2a3..55433227d7 100644 --- a/.gen/pipeline/pipeline/model_node_pool_status.go +++ b/.gen/pipeline/pipeline/model_node_pool_status.go @@ -36,3 +36,20 @@ type NodePoolStatus struct { Template string `json:"template,omitempty"` } + +// AssertNodePoolStatusRequired checks if the required fields are not zero-ed +func AssertNodePoolStatusRequired(obj NodePoolStatus) error { + return nil +} + +// AssertRecurseNodePoolStatusRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolStatus (e.g. [][]NodePoolStatus), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolStatusRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolStatus, ok := obj.(NodePoolStatus) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolStatusRequired(aNodePoolStatus) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_status_amazon.go b/.gen/pipeline/pipeline/model_node_pool_status_amazon.go index 351afa6bbf..5a5a8e5002 100644 --- a/.gen/pipeline/pipeline/model_node_pool_status_amazon.go +++ b/.gen/pipeline/pipeline/model_node_pool_status_amazon.go @@ -30,3 +30,20 @@ type NodePoolStatusAmazon struct { ResourceSummary map[string]ResourceSummary `json:"resourceSummary,omitempty"` } + +// AssertNodePoolStatusAmazonRequired checks if the required fields are not zero-ed +func AssertNodePoolStatusAmazonRequired(obj NodePoolStatusAmazon) error { + return nil +} + +// AssertRecurseNodePoolStatusAmazonRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolStatusAmazon (e.g. [][]NodePoolStatusAmazon), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolStatusAmazonRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolStatusAmazon, ok := obj.(NodePoolStatusAmazon) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolStatusAmazonRequired(aNodePoolStatusAmazon) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_status_azure.go b/.gen/pipeline/pipeline/model_node_pool_status_azure.go index a5ee3d01c9..552dc60f54 100644 --- a/.gen/pipeline/pipeline/model_node_pool_status_azure.go +++ b/.gen/pipeline/pipeline/model_node_pool_status_azure.go @@ -24,3 +24,20 @@ type NodePoolStatusAzure struct { ResourceSummary map[string]ResourceSummary `json:"resourceSummary,omitempty"` } + +// AssertNodePoolStatusAzureRequired checks if the required fields are not zero-ed +func AssertNodePoolStatusAzureRequired(obj NodePoolStatusAzure) error { + return nil +} + +// AssertRecurseNodePoolStatusAzureRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolStatusAzure (e.g. [][]NodePoolStatusAzure), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolStatusAzureRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolStatusAzure, ok := obj.(NodePoolStatusAzure) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolStatusAzureRequired(aNodePoolStatusAzure) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_status_google.go b/.gen/pipeline/pipeline/model_node_pool_status_google.go index 0730872ba9..500cc7abdf 100644 --- a/.gen/pipeline/pipeline/model_node_pool_status_google.go +++ b/.gen/pipeline/pipeline/model_node_pool_status_google.go @@ -24,3 +24,20 @@ type NodePoolStatusGoogle struct { ResourceSummary map[string]ResourceSummary `json:"resourceSummary,omitempty"` } + +// AssertNodePoolStatusGoogleRequired checks if the required fields are not zero-ed +func AssertNodePoolStatusGoogleRequired(obj NodePoolStatusGoogle) error { + return nil +} + +// AssertRecurseNodePoolStatusGoogleRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolStatusGoogle (e.g. [][]NodePoolStatusGoogle), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolStatusGoogleRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolStatusGoogle, ok := obj.(NodePoolStatusGoogle) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolStatusGoogleRequired(aNodePoolStatusGoogle) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_status_information.go b/.gen/pipeline/pipeline/model_node_pool_status_information.go index 885371c24f..4ffcaf80a9 100644 --- a/.gen/pipeline/pipeline/model_node_pool_status_information.go +++ b/.gen/pipeline/pipeline/model_node_pool_status_information.go @@ -19,3 +19,20 @@ type NodePoolStatusInformation struct { // Details and reasoning about the status value. StatusMessage string `json:"statusMessage,omitempty"` } + +// AssertNodePoolStatusInformationRequired checks if the required fields are not zero-ed +func AssertNodePoolStatusInformationRequired(obj NodePoolStatusInformation) error { + return nil +} + +// AssertRecurseNodePoolStatusInformationRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolStatusInformation (e.g. [][]NodePoolStatusInformation), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolStatusInformationRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolStatusInformation, ok := obj.(NodePoolStatusInformation) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolStatusInformationRequired(aNodePoolStatusInformation) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_status_v_sphere.go b/.gen/pipeline/pipeline/model_node_pool_status_v_sphere.go index f6676f32ab..3bf36d8632 100644 --- a/.gen/pipeline/pipeline/model_node_pool_status_v_sphere.go +++ b/.gen/pipeline/pipeline/model_node_pool_status_v_sphere.go @@ -22,3 +22,20 @@ type NodePoolStatusVSphere struct { ResourceSummary map[string]ResourceSummary `json:"resourceSummary,omitempty"` } + +// AssertNodePoolStatusVSphereRequired checks if the required fields are not zero-ed +func AssertNodePoolStatusVSphereRequired(obj NodePoolStatusVSphere) error { + return nil +} + +// AssertRecurseNodePoolStatusVSphereRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolStatusVSphere (e.g. [][]NodePoolStatusVSphere), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolStatusVSphereRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolStatusVSphere, ok := obj.(NodePoolStatusVSphere) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolStatusVSphereRequired(aNodePoolStatusVSphere) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pool_summary.go b/.gen/pipeline/pipeline/model_node_pool_summary.go index 91a55f4544..90ac4b801f 100644 --- a/.gen/pipeline/pipeline/model_node_pool_summary.go +++ b/.gen/pipeline/pipeline/model_node_pool_summary.go @@ -55,3 +55,39 @@ type NodePoolSummary struct { // Details and reasoning about the status value. StatusMessage string `json:"statusMessage,omitempty"` } + +// AssertNodePoolSummaryRequired checks if the required fields are not zero-ed +func AssertNodePoolSummaryRequired(obj NodePoolSummary) error { + elements := map[string]interface{}{ + "name": obj.Name, + "size": obj.Size, + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + return nil +} + +// AssertRecurseNodePoolSummaryRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolSummary (e.g. [][]NodePoolSummary), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolSummaryRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolSummary, ok := obj.(NodePoolSummary) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolSummaryRequired(aNodePoolSummary) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pools.go b/.gen/pipeline/pipeline/model_node_pools.go index 4aa4e4bc33..53afefe186 100644 --- a/.gen/pipeline/pipeline/model_node_pools.go +++ b/.gen/pipeline/pipeline/model_node_pools.go @@ -15,3 +15,20 @@ type NodePools struct { NodePools map[string]NodePool `json:"nodePools,omitempty"` } + +// AssertNodePoolsRequired checks if the required fields are not zero-ed +func AssertNodePoolsRequired(obj NodePools) error { + return nil +} + +// AssertRecurseNodePoolsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePools (e.g. [][]NodePools), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePools, ok := obj.(NodePools) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolsRequired(aNodePools) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pools_azure.go b/.gen/pipeline/pipeline/model_node_pools_azure.go index 56e2c4d2a0..d5a1fcda22 100644 --- a/.gen/pipeline/pipeline/model_node_pools_azure.go +++ b/.gen/pipeline/pipeline/model_node_pools_azure.go @@ -24,3 +24,30 @@ type NodePoolsAzure struct { Labels map[string]string `json:"labels,omitempty"` } + +// AssertNodePoolsAzureRequired checks if the required fields are not zero-ed +func AssertNodePoolsAzureRequired(obj NodePoolsAzure) error { + elements := map[string]interface{}{ + "count": obj.Count, + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseNodePoolsAzureRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolsAzure (e.g. [][]NodePoolsAzure), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolsAzureRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolsAzure, ok := obj.(NodePoolsAzure) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolsAzureRequired(aNodePoolsAzure) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pools_google.go b/.gen/pipeline/pipeline/model_node_pools_google.go index 0471e8159d..ba2d07a294 100644 --- a/.gen/pipeline/pipeline/model_node_pools_google.go +++ b/.gen/pipeline/pipeline/model_node_pools_google.go @@ -26,3 +26,30 @@ type NodePoolsGoogle struct { Labels map[string]string `json:"labels,omitempty"` } + +// AssertNodePoolsGoogleRequired checks if the required fields are not zero-ed +func AssertNodePoolsGoogleRequired(obj NodePoolsGoogle) error { + elements := map[string]interface{}{ + "count": obj.Count, + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseNodePoolsGoogleRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolsGoogle (e.g. [][]NodePoolsGoogle), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolsGoogleRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolsGoogle, ok := obj.(NodePoolsGoogle) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolsGoogleRequired(aNodePoolsGoogle) + }) +} diff --git a/.gen/pipeline/pipeline/model_node_pools_pke.go b/.gen/pipeline/pipeline/model_node_pools_pke.go index bf52bdeb2e..4350fc7a7b 100644 --- a/.gen/pipeline/pipeline/model_node_pools_pke.go +++ b/.gen/pipeline/pipeline/model_node_pools_pke.go @@ -28,3 +28,38 @@ type NodePoolsPke struct { Hosts []PkeHosts `json:"hosts,omitempty"` } + +// AssertNodePoolsPkeRequired checks if the required fields are not zero-ed +func AssertNodePoolsPkeRequired(obj NodePoolsPke) error { + elements := map[string]interface{}{ + "name": obj.Name, + "roles": obj.Roles, + "autoscaling": obj.Autoscaling, + "provider": obj.Provider, + "providerConfig": obj.ProviderConfig, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + for _, el := range obj.Hosts { + if err := AssertPkeHostsRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseNodePoolsPkeRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodePoolsPke (e.g. [][]NodePoolsPke), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodePoolsPkeRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodePoolsPke, ok := obj.(NodePoolsPke) + if !ok { + return ErrTypeAssertionError + } + return AssertNodePoolsPkeRequired(aNodePoolsPke) + }) +} diff --git a/.gen/pipeline/pipeline/model_nodepool_labels.go b/.gen/pipeline/pipeline/model_nodepool_labels.go index 3f5f42e196..009f55d514 100644 --- a/.gen/pipeline/pipeline/model_nodepool_labels.go +++ b/.gen/pipeline/pipeline/model_nodepool_labels.go @@ -18,3 +18,20 @@ type NodepoolLabels struct { Reserved bool `json:"reserved,omitempty"` } + +// AssertNodepoolLabelsRequired checks if the required fields are not zero-ed +func AssertNodepoolLabelsRequired(obj NodepoolLabels) error { + return nil +} + +// AssertRecurseNodepoolLabelsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of NodepoolLabels (e.g. [][]NodepoolLabels), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseNodepoolLabelsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aNodepoolLabels, ok := obj.(NodepoolLabels) + if !ok { + return ErrTypeAssertionError + } + return AssertNodepoolLabelsRequired(aNodepoolLabels) + }) +} diff --git a/.gen/pipeline/pipeline/model_oidc_config.go b/.gen/pipeline/pipeline/model_oidc_config.go index 5cfb331bc4..fdbc2c2b52 100644 --- a/.gen/pipeline/pipeline/model_oidc_config.go +++ b/.gen/pipeline/pipeline/model_oidc_config.go @@ -20,3 +20,20 @@ type OidcConfig struct { ClientSecret string `json:"clientSecret,omitempty"` } + +// AssertOidcConfigRequired checks if the required fields are not zero-ed +func AssertOidcConfigRequired(obj OidcConfig) error { + return nil +} + +// AssertRecurseOidcConfigRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of OidcConfig (e.g. [][]OidcConfig), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseOidcConfigRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aOidcConfig, ok := obj.(OidcConfig) + if !ok { + return ErrTypeAssertionError + } + return AssertOidcConfigRequired(aOidcConfig) + }) +} diff --git a/.gen/pipeline/pipeline/model_organization_list_item_response.go b/.gen/pipeline/pipeline/model_organization_list_item_response.go index 4252bea36c..9778a1daa4 100644 --- a/.gen/pipeline/pipeline/model_organization_list_item_response.go +++ b/.gen/pipeline/pipeline/model_organization_list_item_response.go @@ -22,3 +22,20 @@ type OrganizationListItemResponse struct { NormalizedName string `json:"normalizedName,omitempty"` } + +// AssertOrganizationListItemResponseRequired checks if the required fields are not zero-ed +func AssertOrganizationListItemResponseRequired(obj OrganizationListItemResponse) error { + return nil +} + +// AssertRecurseOrganizationListItemResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of OrganizationListItemResponse (e.g. [][]OrganizationListItemResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseOrganizationListItemResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aOrganizationListItemResponse, ok := obj.(OrganizationListItemResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertOrganizationListItemResponseRequired(aOrganizationListItemResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request.go b/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request.go index 1263602c69..ebd79d4515 100644 --- a/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request.go +++ b/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request.go @@ -35,3 +35,35 @@ type PkeAwsUpdateNodePoolRequest struct { Options BaseUpdateNodePoolOptions `json:"options,omitempty"` } + +// AssertPkeAwsUpdateNodePoolRequestRequired checks if the required fields are not zero-ed +func AssertPkeAwsUpdateNodePoolRequestRequired(obj PkeAwsUpdateNodePoolRequest) error { + elements := map[string]interface{}{ + "size": obj.Size, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if err := AssertBaseUpdateNodePoolOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecursePkeAwsUpdateNodePoolRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeAwsUpdateNodePoolRequest (e.g. [][]PkeAwsUpdateNodePoolRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeAwsUpdateNodePoolRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeAwsUpdateNodePoolRequest, ok := obj.(PkeAwsUpdateNodePoolRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeAwsUpdateNodePoolRequestRequired(aPkeAwsUpdateNodePoolRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request_all_of.go b/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request_all_of.go index 912b4c84be..3f563a1350 100644 --- a/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request_all_of.go +++ b/.gen/pipeline/pipeline/model_pke_aws_update_node_pool_request_all_of.go @@ -28,3 +28,26 @@ type PkeAwsUpdateNodePoolRequestAllOf struct { Options BaseUpdateNodePoolOptions `json:"options,omitempty"` } + +// AssertPkeAwsUpdateNodePoolRequestAllOfRequired checks if the required fields are not zero-ed +func AssertPkeAwsUpdateNodePoolRequestAllOfRequired(obj PkeAwsUpdateNodePoolRequestAllOf) error { + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if err := AssertBaseUpdateNodePoolOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecursePkeAwsUpdateNodePoolRequestAllOfRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeAwsUpdateNodePoolRequestAllOf (e.g. [][]PkeAwsUpdateNodePoolRequestAllOf), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeAwsUpdateNodePoolRequestAllOfRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeAwsUpdateNodePoolRequestAllOf, ok := obj.(PkeAwsUpdateNodePoolRequestAllOf) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeAwsUpdateNodePoolRequestAllOfRequired(aPkeAwsUpdateNodePoolRequestAllOf) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_cluster_http_proxy.go b/.gen/pipeline/pipeline/model_pke_cluster_http_proxy.go index 068c147666..7ebe8e3670 100644 --- a/.gen/pipeline/pipeline/model_pke_cluster_http_proxy.go +++ b/.gen/pipeline/pipeline/model_pke_cluster_http_proxy.go @@ -18,3 +18,26 @@ type PkeClusterHttpProxy struct { Exceptions []string `json:"exceptions,omitempty"` } + +// AssertPkeClusterHttpProxyRequired checks if the required fields are not zero-ed +func AssertPkeClusterHttpProxyRequired(obj PkeClusterHttpProxy) error { + if err := AssertPkeClusterHttpProxyOptionsRequired(obj.Http); err != nil { + return err + } + if err := AssertPkeClusterHttpProxyOptionsRequired(obj.Https); err != nil { + return err + } + return nil +} + +// AssertRecursePkeClusterHttpProxyRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeClusterHttpProxy (e.g. [][]PkeClusterHttpProxy), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeClusterHttpProxyRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeClusterHttpProxy, ok := obj.(PkeClusterHttpProxy) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeClusterHttpProxyRequired(aPkeClusterHttpProxy) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_cluster_http_proxy_options.go b/.gen/pipeline/pipeline/model_pke_cluster_http_proxy_options.go index 77d1eabea7..90add42a91 100644 --- a/.gen/pipeline/pipeline/model_pke_cluster_http_proxy_options.go +++ b/.gen/pipeline/pipeline/model_pke_cluster_http_proxy_options.go @@ -24,3 +24,29 @@ type PkeClusterHttpProxyOptions struct { // Scheme of the proxy Scheme string `json:"scheme,omitempty"` } + +// AssertPkeClusterHttpProxyOptionsRequired checks if the required fields are not zero-ed +func AssertPkeClusterHttpProxyOptionsRequired(obj PkeClusterHttpProxyOptions) error { + elements := map[string]interface{}{ + "host": obj.Host, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecursePkeClusterHttpProxyOptionsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeClusterHttpProxyOptions (e.g. [][]PkeClusterHttpProxyOptions), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeClusterHttpProxyOptionsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeClusterHttpProxyOptions, ok := obj.(PkeClusterHttpProxyOptions) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeClusterHttpProxyOptionsRequired(aPkeClusterHttpProxyOptions) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_cluster_readiness_response.go b/.gen/pipeline/pipeline/model_pke_cluster_readiness_response.go index 8c452e7d0c..4675154673 100644 --- a/.gen/pipeline/pipeline/model_pke_cluster_readiness_response.go +++ b/.gen/pipeline/pipeline/model_pke_cluster_readiness_response.go @@ -14,3 +14,23 @@ type PkeClusterReadinessResponse struct { Master PkeClusterReadinessResponseMaster `json:"master,omitempty"` } + +// AssertPkeClusterReadinessResponseRequired checks if the required fields are not zero-ed +func AssertPkeClusterReadinessResponseRequired(obj PkeClusterReadinessResponse) error { + if err := AssertPkeClusterReadinessResponseMasterRequired(obj.Master); err != nil { + return err + } + return nil +} + +// AssertRecursePkeClusterReadinessResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeClusterReadinessResponse (e.g. [][]PkeClusterReadinessResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeClusterReadinessResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeClusterReadinessResponse, ok := obj.(PkeClusterReadinessResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeClusterReadinessResponseRequired(aPkeClusterReadinessResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_cluster_readiness_response_master.go b/.gen/pipeline/pipeline/model_pke_cluster_readiness_response_master.go index 771b41de0e..d7e2deada5 100644 --- a/.gen/pipeline/pipeline/model_pke_cluster_readiness_response_master.go +++ b/.gen/pipeline/pipeline/model_pke_cluster_readiness_response_master.go @@ -15,3 +15,20 @@ type PkeClusterReadinessResponseMaster struct { // true when the node has been reported to be ready Ready bool `json:"ready,omitempty"` } + +// AssertPkeClusterReadinessResponseMasterRequired checks if the required fields are not zero-ed +func AssertPkeClusterReadinessResponseMasterRequired(obj PkeClusterReadinessResponseMaster) error { + return nil +} + +// AssertRecursePkeClusterReadinessResponseMasterRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeClusterReadinessResponseMaster (e.g. [][]PkeClusterReadinessResponseMaster), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeClusterReadinessResponseMasterRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeClusterReadinessResponseMaster, ok := obj.(PkeClusterReadinessResponseMaster) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeClusterReadinessResponseMasterRequired(aPkeClusterReadinessResponseMaster) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_hosts.go b/.gen/pipeline/pipeline/model_pke_hosts.go index 5d11ee7b8b..87cb705347 100644 --- a/.gen/pipeline/pipeline/model_pke_hosts.go +++ b/.gen/pipeline/pipeline/model_pke_hosts.go @@ -18,3 +18,31 @@ type PkeHosts struct { Roles []string `json:"roles"` } + +// AssertPkeHostsRequired checks if the required fields are not zero-ed +func AssertPkeHostsRequired(obj PkeHosts) error { + elements := map[string]interface{}{ + "name": obj.Name, + "privateIP": obj.PrivateIP, + "roles": obj.Roles, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecursePkeHostsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeHosts (e.g. [][]PkeHosts), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeHostsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeHosts, ok := obj.(PkeHosts) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeHostsRequired(aPkeHosts) + }) +} diff --git a/.gen/pipeline/pipeline/model_pke_on_azure_cluster_network.go b/.gen/pipeline/pipeline/model_pke_on_azure_cluster_network.go deleted file mode 100644 index ba5b98e3d1..0000000000 --- a/.gen/pipeline/pipeline/model_pke_on_azure_cluster_network.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type PkeOnAzureClusterNetwork struct { - - Name string `json:"name,omitempty"` - - // When referencing an already existing virtual network this field does not need to be specified. - Cidr string `json:"cidr,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_pke_on_azure_node_pool.go b/.gen/pipeline/pipeline/model_pke_on_azure_node_pool.go deleted file mode 100644 index 1a59620afa..0000000000 --- a/.gen/pipeline/pipeline/model_pke_on_azure_node_pool.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type PkeOnAzureNodePool struct { - - Name string `json:"name"` - - Roles []string `json:"roles"` - - Labels map[string]string `json:"labels,omitempty"` - - Subnet PkeOnAzureNodePoolSubnet `json:"subnet,omitempty"` - - Zones []string `json:"zones,omitempty"` - - Autoscaling bool `json:"autoscaling,omitempty"` - - MinCount int32 `json:"minCount,omitempty"` - - MaxCount int32 `json:"maxCount,omitempty"` - - Count int32 `json:"count,omitempty"` - - InstanceType string `json:"instanceType"` -} diff --git a/.gen/pipeline/pipeline/model_pke_on_azure_node_pool_subnet.go b/.gen/pipeline/pipeline/model_pke_on_azure_node_pool_subnet.go deleted file mode 100644 index c5c87ee3d1..0000000000 --- a/.gen/pipeline/pipeline/model_pke_on_azure_node_pool_subnet.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type PkeOnAzureNodePoolSubnet struct { - - Name string `json:"name,omitempty"` - - // When referencing an already existing subnetwork this field does not need to be specified. - Cidr string `json:"cidr,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_pke_on_vsphere_node_pool.go b/.gen/pipeline/pipeline/model_pke_on_vsphere_node_pool.go deleted file mode 100644 index 9717f278af..0000000000 --- a/.gen/pipeline/pipeline/model_pke_on_vsphere_node_pool.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type PkeOnVsphereNodePool struct { - - Name string `json:"name"` - - Roles []string `json:"roles"` - - Labels map[string]string `json:"labels,omitempty"` - - Size int32 `json:"size,omitempty"` - - // Number of VCPUs to attach to each node. - Vcpu int32 `json:"vcpu"` - - // MiBs of RAM to attach to each node. - Ram int32 `json:"ram"` - - // Name of VM template available on vSphere to clone as the base of nodes. Overrides default value from the main cluster secret. - Template string `json:"template,omitempty"` - - // Name of admin user to deploy the generated SSH public key for. No key will be deployed if omitted. - AdminUsername string `json:"adminUsername,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_pkeon_azure_cluster_network.go b/.gen/pipeline/pipeline/model_pkeon_azure_cluster_network.go new file mode 100644 index 0000000000..a1690a42a8 --- /dev/null +++ b/.gen/pipeline/pipeline/model_pkeon_azure_cluster_network.go @@ -0,0 +1,36 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type PkeonAzureClusterNetwork struct { + + Name string `json:"name,omitempty"` + + // When referencing an already existing virtual network this field does not need to be specified. + Cidr string `json:"cidr,omitempty"` +} + +// AssertPkeonAzureClusterNetworkRequired checks if the required fields are not zero-ed +func AssertPkeonAzureClusterNetworkRequired(obj PkeonAzureClusterNetwork) error { + return nil +} + +// AssertRecursePkeonAzureClusterNetworkRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeonAzureClusterNetwork (e.g. [][]PkeonAzureClusterNetwork), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeonAzureClusterNetworkRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeonAzureClusterNetwork, ok := obj.(PkeonAzureClusterNetwork) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeonAzureClusterNetworkRequired(aPkeonAzureClusterNetwork) + }) +} diff --git a/.gen/pipeline/pipeline/model_pkeon_azure_node_pool.go b/.gen/pipeline/pipeline/model_pkeon_azure_node_pool.go new file mode 100644 index 0000000000..5f00b248ef --- /dev/null +++ b/.gen/pipeline/pipeline/model_pkeon_azure_node_pool.go @@ -0,0 +1,65 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type PkeonAzureNodePool struct { + + Name string `json:"name"` + + Roles []string `json:"roles"` + + Labels map[string]string `json:"labels,omitempty"` + + Subnet PkeonAzureNodePoolSubnet `json:"subnet,omitempty"` + + Zones []string `json:"zones,omitempty"` + + Autoscaling bool `json:"autoscaling,omitempty"` + + MinCount int32 `json:"minCount,omitempty"` + + MaxCount int32 `json:"maxCount,omitempty"` + + Count int32 `json:"count,omitempty"` + + InstanceType string `json:"instanceType"` +} + +// AssertPkeonAzureNodePoolRequired checks if the required fields are not zero-ed +func AssertPkeonAzureNodePoolRequired(obj PkeonAzureNodePool) error { + elements := map[string]interface{}{ + "name": obj.Name, + "roles": obj.Roles, + "instanceType": obj.InstanceType, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertPkeonAzureNodePoolSubnetRequired(obj.Subnet); err != nil { + return err + } + return nil +} + +// AssertRecursePkeonAzureNodePoolRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeonAzureNodePool (e.g. [][]PkeonAzureNodePool), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeonAzureNodePoolRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeonAzureNodePool, ok := obj.(PkeonAzureNodePool) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeonAzureNodePoolRequired(aPkeonAzureNodePool) + }) +} diff --git a/.gen/pipeline/pipeline/model_pkeon_azure_node_pool_subnet.go b/.gen/pipeline/pipeline/model_pkeon_azure_node_pool_subnet.go new file mode 100644 index 0000000000..c9bd95b553 --- /dev/null +++ b/.gen/pipeline/pipeline/model_pkeon_azure_node_pool_subnet.go @@ -0,0 +1,36 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type PkeonAzureNodePoolSubnet struct { + + Name string `json:"name,omitempty"` + + // When referencing an already existing subnetwork this field does not need to be specified. + Cidr string `json:"cidr,omitempty"` +} + +// AssertPkeonAzureNodePoolSubnetRequired checks if the required fields are not zero-ed +func AssertPkeonAzureNodePoolSubnetRequired(obj PkeonAzureNodePoolSubnet) error { + return nil +} + +// AssertRecursePkeonAzureNodePoolSubnetRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeonAzureNodePoolSubnet (e.g. [][]PkeonAzureNodePoolSubnet), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeonAzureNodePoolSubnetRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeonAzureNodePoolSubnet, ok := obj.(PkeonAzureNodePoolSubnet) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeonAzureNodePoolSubnetRequired(aPkeonAzureNodePoolSubnet) + }) +} diff --git a/.gen/pipeline/pipeline/model_pkeon_vsphere_node_pool.go b/.gen/pipeline/pipeline/model_pkeon_vsphere_node_pool.go new file mode 100644 index 0000000000..bf90eb7350 --- /dev/null +++ b/.gen/pipeline/pipeline/model_pkeon_vsphere_node_pool.go @@ -0,0 +1,63 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type PkeonVsphereNodePool struct { + + Name string `json:"name"` + + Roles []string `json:"roles"` + + Labels map[string]string `json:"labels,omitempty"` + + Size int32 `json:"size,omitempty"` + + // Number of VCPUs to attach to each node. + Vcpu int32 `json:"vcpu"` + + // MiBs of RAM to attach to each node. + Ram int32 `json:"ram"` + + // Name of VM template available on vSphere to clone as the base of nodes. Overrides default value from the main cluster secret. + Template string `json:"template,omitempty"` + + // Name of admin user to deploy the generated SSH public key for. No key will be deployed if omitted. + AdminUsername string `json:"adminUsername,omitempty"` +} + +// AssertPkeonVsphereNodePoolRequired checks if the required fields are not zero-ed +func AssertPkeonVsphereNodePoolRequired(obj PkeonVsphereNodePool) error { + elements := map[string]interface{}{ + "name": obj.Name, + "roles": obj.Roles, + "vcpu": obj.Vcpu, + "ram": obj.Ram, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecursePkeonVsphereNodePoolRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PkeonVsphereNodePool (e.g. [][]PkeonVsphereNodePool), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePkeonVsphereNodePoolRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPkeonVsphereNodePool, ok := obj.(PkeonVsphereNodePool) + if !ok { + return ErrTypeAssertionError + } + return AssertPkeonVsphereNodePoolRequired(aPkeonVsphereNodePool) + }) +} diff --git a/.gen/pipeline/pipeline/model_pod_condition.go b/.gen/pipeline/pipeline/model_pod_condition.go index 7da2fd4314..52f8bbc64a 100644 --- a/.gen/pipeline/pipeline/model_pod_condition.go +++ b/.gen/pipeline/pipeline/model_pod_condition.go @@ -20,3 +20,20 @@ type PodCondition struct { LastTransitionTime string `json:"lastTransitionTime,omitempty"` } + +// AssertPodConditionRequired checks if the required fields are not zero-ed +func AssertPodConditionRequired(obj PodCondition) error { + return nil +} + +// AssertRecursePodConditionRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PodCondition (e.g. [][]PodCondition), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePodConditionRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPodCondition, ok := obj.(PodCondition) + if !ok { + return ErrTypeAssertionError + } + return AssertPodConditionRequired(aPodCondition) + }) +} diff --git a/.gen/pipeline/pipeline/model_pod_item.go b/.gen/pipeline/pipeline/model_pod_item.go index 7e5b9f7892..09ad093f06 100644 --- a/.gen/pipeline/pipeline/model_pod_item.go +++ b/.gen/pipeline/pipeline/model_pod_item.go @@ -26,3 +26,31 @@ type PodItem struct { ResourceSummary ResourceSummary `json:"resourceSummary,omitempty"` } + +// AssertPodItemRequired checks if the required fields are not zero-ed +func AssertPodItemRequired(obj PodItem) error { + if err := AssertPodItemLabelsRequired(obj.Labels); err != nil { + return err + } + for _, el := range obj.Conditions { + if err := AssertPodConditionRequired(el); err != nil { + return err + } + } + if err := AssertResourceSummaryRequired(obj.ResourceSummary); err != nil { + return err + } + return nil +} + +// AssertRecursePodItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PodItem (e.g. [][]PodItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePodItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPodItem, ok := obj.(PodItem) + if !ok { + return ErrTypeAssertionError + } + return AssertPodItemRequired(aPodItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_pod_item_labels.go b/.gen/pipeline/pipeline/model_pod_item_labels.go index 1441d3b004..5cda59e951 100644 --- a/.gen/pipeline/pipeline/model_pod_item_labels.go +++ b/.gen/pipeline/pipeline/model_pod_item_labels.go @@ -18,3 +18,20 @@ type PodItemLabels struct { Release string `json:"release,omitempty"` } + +// AssertPodItemLabelsRequired checks if the required fields are not zero-ed +func AssertPodItemLabelsRequired(obj PodItemLabels) error { + return nil +} + +// AssertRecursePodItemLabelsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PodItemLabels (e.g. [][]PodItemLabels), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePodItemLabelsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPodItemLabels, ok := obj.(PodItemLabels) + if !ok { + return ErrTypeAssertionError + } + return AssertPodItemLabelsRequired(aPodItemLabels) + }) +} diff --git a/.gen/pipeline/pipeline/model_post_hooks.go b/.gen/pipeline/pipeline/model_post_hooks.go index 8c57845238..176b01b20b 100644 --- a/.gen/pipeline/pipeline/model_post_hooks.go +++ b/.gen/pipeline/pipeline/model_post_hooks.go @@ -14,3 +14,20 @@ type PostHooks struct { PostHookFunctionName map[string]interface{} `json:"PostHookFunctionName,omitempty"` } + +// AssertPostHooksRequired checks if the required fields are not zero-ed +func AssertPostHooksRequired(obj PostHooks) error { + return nil +} + +// AssertRecursePostHooksRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PostHooks (e.g. [][]PostHooks), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePostHooksRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPostHooks, ok := obj.(PostHooks) + if !ok { + return ErrTypeAssertionError + } + return AssertPostHooksRequired(aPostHooks) + }) +} diff --git a/.gen/pipeline/pipeline/model_post_leader_election_request.go b/.gen/pipeline/pipeline/model_post_leader_election_request.go index f4469e854e..ef81090949 100644 --- a/.gen/pipeline/pipeline/model_post_leader_election_request.go +++ b/.gen/pipeline/pipeline/model_post_leader_election_request.go @@ -16,3 +16,29 @@ type PostLeaderElectionRequest struct { Ip string `json:"ip,omitempty"` } + +// AssertPostLeaderElectionRequestRequired checks if the required fields are not zero-ed +func AssertPostLeaderElectionRequestRequired(obj PostLeaderElectionRequest) error { + elements := map[string]interface{}{ + "hostname": obj.Hostname, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecursePostLeaderElectionRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PostLeaderElectionRequest (e.g. [][]PostLeaderElectionRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePostLeaderElectionRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPostLeaderElectionRequest, ok := obj.(PostLeaderElectionRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertPostLeaderElectionRequestRequired(aPostLeaderElectionRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_post_leader_election_response.go b/.gen/pipeline/pipeline/model_post_leader_election_response.go index b17c25ab10..9282c61296 100644 --- a/.gen/pipeline/pipeline/model_post_leader_election_response.go +++ b/.gen/pipeline/pipeline/model_post_leader_election_response.go @@ -16,3 +16,29 @@ type PostLeaderElectionResponse struct { Ip string `json:"ip,omitempty"` } + +// AssertPostLeaderElectionResponseRequired checks if the required fields are not zero-ed +func AssertPostLeaderElectionResponseRequired(obj PostLeaderElectionResponse) error { + elements := map[string]interface{}{ + "hostname": obj.Hostname, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecursePostLeaderElectionResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PostLeaderElectionResponse (e.g. [][]PostLeaderElectionResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePostLeaderElectionResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPostLeaderElectionResponse, ok := obj.(PostLeaderElectionResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertPostLeaderElectionResponseRequired(aPostLeaderElectionResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_post_ready_pke_node_request.go b/.gen/pipeline/pipeline/model_post_ready_pke_node_request.go index b99bd908ea..aa782c4915 100644 --- a/.gen/pipeline/pipeline/model_post_ready_pke_node_request.go +++ b/.gen/pipeline/pipeline/model_post_ready_pke_node_request.go @@ -30,3 +30,20 @@ type PostReadyPkeNodeRequest struct { // if this node is a worker node Worker bool `json:"worker,omitempty"` } + +// AssertPostReadyPkeNodeRequestRequired checks if the required fields are not zero-ed +func AssertPostReadyPkeNodeRequestRequired(obj PostReadyPkeNodeRequest) error { + return nil +} + +// AssertRecursePostReadyPkeNodeRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PostReadyPkeNodeRequest (e.g. [][]PostReadyPkeNodeRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePostReadyPkeNodeRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPostReadyPkeNodeRequest, ok := obj.(PostReadyPkeNodeRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertPostReadyPkeNodeRequestRequired(aPostReadyPkeNodeRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_process.go b/.gen/pipeline/pipeline/model_process.go index 08a322ab18..bd332f3adb 100644 --- a/.gen/pipeline/pipeline/model_process.go +++ b/.gen/pipeline/pipeline/model_process.go @@ -38,3 +38,25 @@ type Process struct { Events []ProcessEvent `json:"events,omitempty"` } + +// AssertProcessRequired checks if the required fields are not zero-ed +func AssertProcessRequired(obj Process) error { + for _, el := range obj.Events { + if err := AssertProcessEventRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseProcessRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Process (e.g. [][]Process), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseProcessRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aProcess, ok := obj.(Process) + if !ok { + return ErrTypeAssertionError + } + return AssertProcessRequired(aProcess) + }) +} diff --git a/.gen/pipeline/pipeline/model_process_event.go b/.gen/pipeline/pipeline/model_process_event.go index 0047300a37..80ffb60c3e 100644 --- a/.gen/pipeline/pipeline/model_process_event.go +++ b/.gen/pipeline/pipeline/model_process_event.go @@ -28,3 +28,20 @@ type ProcessEvent struct { Timestamp time.Time `json:"timestamp,omitempty"` } + +// AssertProcessEventRequired checks if the required fields are not zero-ed +func AssertProcessEventRequired(obj ProcessEvent) error { + return nil +} + +// AssertRecurseProcessEventRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ProcessEvent (e.g. [][]ProcessEvent), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseProcessEventRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aProcessEvent, ok := obj.(ProcessEvent) + if !ok { + return ErrTypeAssertionError + } + return AssertProcessEventRequired(aProcessEvent) + }) +} diff --git a/.gen/pipeline/pipeline/model_process_status.go b/.gen/pipeline/pipeline/model_process_status.go index 61e5710239..64fa473950 100644 --- a/.gen/pipeline/pipeline/model_process_status.go +++ b/.gen/pipeline/pipeline/model_process_status.go @@ -19,3 +19,20 @@ const ( FINISHED ProcessStatus = "finished" CANCELED ProcessStatus = "canceled" ) + +// AssertProcessStatusRequired checks if the required fields are not zero-ed +func AssertProcessStatusRequired(obj ProcessStatus) error { + return nil +} + +// AssertRecurseProcessStatusRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ProcessStatus (e.g. [][]ProcessStatus), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseProcessStatusRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aProcessStatus, ok := obj.(ProcessStatus) + if !ok { + return ErrTypeAssertionError + } + return AssertProcessStatusRequired(aProcessStatus) + }) +} diff --git a/.gen/pipeline/pipeline/model_release_white_list_item.go b/.gen/pipeline/pipeline/model_release_white_list_item.go index da70f757dd..7e96845c29 100644 --- a/.gen/pipeline/pipeline/model_release_white_list_item.go +++ b/.gen/pipeline/pipeline/model_release_white_list_item.go @@ -18,3 +18,30 @@ type ReleaseWhiteListItem struct { Reason string `json:"reason,omitempty"` } + +// AssertReleaseWhiteListItemRequired checks if the required fields are not zero-ed +func AssertReleaseWhiteListItemRequired(obj ReleaseWhiteListItem) error { + elements := map[string]interface{}{ + "name": obj.Name, + "owner": obj.Owner, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseReleaseWhiteListItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ReleaseWhiteListItem (e.g. [][]ReleaseWhiteListItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseReleaseWhiteListItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aReleaseWhiteListItem, ok := obj.(ReleaseWhiteListItem) + if !ok { + return ErrTypeAssertionError + } + return AssertReleaseWhiteListItemRequired(aReleaseWhiteListItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_report_pke_node_status_request.go b/.gen/pipeline/pipeline/model_report_pke_node_status_request.go index 9b6aa8b5d6..da43c4fdc8 100644 --- a/.gen/pipeline/pipeline/model_report_pke_node_status_request.go +++ b/.gen/pipeline/pipeline/model_report_pke_node_status_request.go @@ -42,3 +42,20 @@ type ReportPkeNodeStatusRequest struct { // ID of the process registered earlier (register new process if empty) ProcessId string `json:"processId,omitempty"` } + +// AssertReportPkeNodeStatusRequestRequired checks if the required fields are not zero-ed +func AssertReportPkeNodeStatusRequestRequired(obj ReportPkeNodeStatusRequest) error { + return nil +} + +// AssertRecurseReportPkeNodeStatusRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ReportPkeNodeStatusRequest (e.g. [][]ReportPkeNodeStatusRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseReportPkeNodeStatusRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aReportPkeNodeStatusRequest, ok := obj.(ReportPkeNodeStatusRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertReportPkeNodeStatusRequestRequired(aReportPkeNodeStatusRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_report_pke_node_status_response.go b/.gen/pipeline/pipeline/model_report_pke_node_status_response.go index 530bc317c8..3733309611 100644 --- a/.gen/pipeline/pipeline/model_report_pke_node_status_response.go +++ b/.gen/pipeline/pipeline/model_report_pke_node_status_response.go @@ -15,3 +15,20 @@ type ReportPkeNodeStatusResponse struct { // ID of the registered process ProcessId string `json:"processId,omitempty"` } + +// AssertReportPkeNodeStatusResponseRequired checks if the required fields are not zero-ed +func AssertReportPkeNodeStatusResponseRequired(obj ReportPkeNodeStatusResponse) error { + return nil +} + +// AssertRecurseReportPkeNodeStatusResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ReportPkeNodeStatusResponse (e.g. [][]ReportPkeNodeStatusResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseReportPkeNodeStatusResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aReportPkeNodeStatusResponse, ok := obj.(ReportPkeNodeStatusResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertReportPkeNodeStatusResponseRequired(aReportPkeNodeStatusResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_requested_resources.go b/.gen/pipeline/pipeline/model_requested_resources.go index f51e64c435..bb8ee22eb5 100644 --- a/.gen/pipeline/pipeline/model_requested_resources.go +++ b/.gen/pipeline/pipeline/model_requested_resources.go @@ -32,3 +32,20 @@ type RequestedResources struct { // Maximum number of nodes in the recommended cluster MaxNodes int32 `json:"maxNodes,omitempty"` } + +// AssertRequestedResourcesRequired checks if the required fields are not zero-ed +func AssertRequestedResourcesRequired(obj RequestedResources) error { + return nil +} + +// AssertRecurseRequestedResourcesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RequestedResources (e.g. [][]RequestedResources), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRequestedResourcesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRequestedResources, ok := obj.(RequestedResources) + if !ok { + return ErrTypeAssertionError + } + return AssertRequestedResourcesRequired(aRequestedResources) + }) +} diff --git a/.gen/pipeline/pipeline/model_resource.go b/.gen/pipeline/pipeline/model_resource.go index 47a9f0b1ed..ea4ad16688 100644 --- a/.gen/pipeline/pipeline/model_resource.go +++ b/.gen/pipeline/pipeline/model_resource.go @@ -20,3 +20,20 @@ type Resource struct { Request string `json:"request,omitempty"` } + +// AssertResourceRequired checks if the required fields are not zero-ed +func AssertResourceRequired(obj Resource) error { + return nil +} + +// AssertRecurseResourceRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Resource (e.g. [][]Resource), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseResourceRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aResource, ok := obj.(Resource) + if !ok { + return ErrTypeAssertionError + } + return AssertResourceRequired(aResource) + }) +} diff --git a/.gen/pipeline/pipeline/model_resource_group_created.go b/.gen/pipeline/pipeline/model_resource_group_created.go index f45a52a5aa..73fcbe09ed 100644 --- a/.gen/pipeline/pipeline/model_resource_group_created.go +++ b/.gen/pipeline/pipeline/model_resource_group_created.go @@ -14,3 +14,20 @@ type ResourceGroupCreated struct { Name string `json:"name,omitempty"` } + +// AssertResourceGroupCreatedRequired checks if the required fields are not zero-ed +func AssertResourceGroupCreatedRequired(obj ResourceGroupCreated) error { + return nil +} + +// AssertRecurseResourceGroupCreatedRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ResourceGroupCreated (e.g. [][]ResourceGroupCreated), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseResourceGroupCreatedRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aResourceGroupCreated, ok := obj.(ResourceGroupCreated) + if !ok { + return ErrTypeAssertionError + } + return AssertResourceGroupCreatedRequired(aResourceGroupCreated) + }) +} diff --git a/.gen/pipeline/pipeline/model_resource_summary.go b/.gen/pipeline/pipeline/model_resource_summary.go index 6a4ba00f0c..a5bd598eb2 100644 --- a/.gen/pipeline/pipeline/model_resource_summary.go +++ b/.gen/pipeline/pipeline/model_resource_summary.go @@ -18,3 +18,26 @@ type ResourceSummary struct { Status string `json:"status,omitempty"` } + +// AssertResourceSummaryRequired checks if the required fields are not zero-ed +func AssertResourceSummaryRequired(obj ResourceSummary) error { + if err := AssertResourceRequired(obj.Cpu); err != nil { + return err + } + if err := AssertResourceRequired(obj.Memory); err != nil { + return err + } + return nil +} + +// AssertRecurseResourceSummaryRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ResourceSummary (e.g. [][]ResourceSummary), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseResourceSummaryRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aResourceSummary, ok := obj.(ResourceSummary) + if !ok { + return ErrTypeAssertionError + } + return AssertResourceSummaryRequired(aResourceSummary) + }) +} diff --git a/.gen/pipeline/pipeline/model_restore_response.go b/.gen/pipeline/pipeline/model_restore_response.go index 3536e817dc..0bb9feca3a 100644 --- a/.gen/pipeline/pipeline/model_restore_response.go +++ b/.gen/pipeline/pipeline/model_restore_response.go @@ -28,3 +28,23 @@ type RestoreResponse struct { Errors int32 `json:"errors,omitempty"` } + +// AssertRestoreResponseRequired checks if the required fields are not zero-ed +func AssertRestoreResponseRequired(obj RestoreResponse) error { + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseRestoreResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RestoreResponse (e.g. [][]RestoreResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRestoreResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRestoreResponse, ok := obj.(RestoreResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertRestoreResponseRequired(aRestoreResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_restore_result_errors.go b/.gen/pipeline/pipeline/model_restore_result_errors.go index 9af611f1cd..52e00c2587 100644 --- a/.gen/pipeline/pipeline/model_restore_result_errors.go +++ b/.gen/pipeline/pipeline/model_restore_result_errors.go @@ -18,3 +18,20 @@ type RestoreResultErrors struct { Namespaces map[string][]string `json:"namespaces,omitempty"` } + +// AssertRestoreResultErrorsRequired checks if the required fields are not zero-ed +func AssertRestoreResultErrorsRequired(obj RestoreResultErrors) error { + return nil +} + +// AssertRecurseRestoreResultErrorsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RestoreResultErrors (e.g. [][]RestoreResultErrors), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRestoreResultErrorsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRestoreResultErrors, ok := obj.(RestoreResultErrors) + if !ok { + return ErrTypeAssertionError + } + return AssertRestoreResultErrorsRequired(aRestoreResultErrors) + }) +} diff --git a/.gen/pipeline/pipeline/model_restore_result_warnings.go b/.gen/pipeline/pipeline/model_restore_result_warnings.go index 1686ce807e..5af22afeca 100644 --- a/.gen/pipeline/pipeline/model_restore_result_warnings.go +++ b/.gen/pipeline/pipeline/model_restore_result_warnings.go @@ -18,3 +18,20 @@ type RestoreResultWarnings struct { Namespaces map[string][]string `json:"namespaces,omitempty"` } + +// AssertRestoreResultWarningsRequired checks if the required fields are not zero-ed +func AssertRestoreResultWarningsRequired(obj RestoreResultWarnings) error { + return nil +} + +// AssertRecurseRestoreResultWarningsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RestoreResultWarnings (e.g. [][]RestoreResultWarnings), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRestoreResultWarningsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRestoreResultWarnings, ok := obj.(RestoreResultWarnings) + if !ok { + return ErrTypeAssertionError + } + return AssertRestoreResultWarningsRequired(aRestoreResultWarnings) + }) +} diff --git a/.gen/pipeline/pipeline/model_restore_results_response.go b/.gen/pipeline/pipeline/model_restore_results_response.go index 5a295fb33e..c6965ddcb7 100644 --- a/.gen/pipeline/pipeline/model_restore_results_response.go +++ b/.gen/pipeline/pipeline/model_restore_results_response.go @@ -16,3 +16,26 @@ type RestoreResultsResponse struct { Warnings RestoreResultWarnings `json:"warnings,omitempty"` } + +// AssertRestoreResultsResponseRequired checks if the required fields are not zero-ed +func AssertRestoreResultsResponseRequired(obj RestoreResultsResponse) error { + if err := AssertRestoreResultErrorsRequired(obj.Errors); err != nil { + return err + } + if err := AssertRestoreResultWarningsRequired(obj.Warnings); err != nil { + return err + } + return nil +} + +// AssertRecurseRestoreResultsResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RestoreResultsResponse (e.g. [][]RestoreResultsResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRestoreResultsResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRestoreResultsResponse, ok := obj.(RestoreResultsResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertRestoreResultsResponseRequired(aRestoreResultsResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_route_table_info.go b/.gen/pipeline/pipeline/model_route_table_info.go index d1a2cf021b..c9f63db1f9 100644 --- a/.gen/pipeline/pipeline/model_route_table_info.go +++ b/.gen/pipeline/pipeline/model_route_table_info.go @@ -18,3 +18,29 @@ type RouteTableInfo struct { // Name of the route table Name string `json:"name,omitempty"` } + +// AssertRouteTableInfoRequired checks if the required fields are not zero-ed +func AssertRouteTableInfoRequired(obj RouteTableInfo) error { + elements := map[string]interface{}{ + "id": obj.Id, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseRouteTableInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RouteTableInfo (e.g. [][]RouteTableInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRouteTableInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRouteTableInfo, ok := obj.(RouteTableInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertRouteTableInfoRequired(aRouteTableInfo) + }) +} diff --git a/.gen/pipeline/pipeline/model_scan_log_item.go b/.gen/pipeline/pipeline/model_scan_log_item.go index 442eca6713..2b26797083 100644 --- a/.gen/pipeline/pipeline/model_scan_log_item.go +++ b/.gen/pipeline/pipeline/model_scan_log_item.go @@ -22,3 +22,25 @@ type ScanLogItem struct { Action string `json:"action,omitempty"` } + +// AssertScanLogItemRequired checks if the required fields are not zero-ed +func AssertScanLogItemRequired(obj ScanLogItem) error { + for _, el := range obj.Image { + if err := AssertScanLogItemImageRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseScanLogItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ScanLogItem (e.g. [][]ScanLogItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseScanLogItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aScanLogItem, ok := obj.(ScanLogItem) + if !ok { + return ErrTypeAssertionError + } + return AssertScanLogItemRequired(aScanLogItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_scan_log_item_image.go b/.gen/pipeline/pipeline/model_scan_log_item_image.go index d726ffcc0a..c3dcd3cad4 100644 --- a/.gen/pipeline/pipeline/model_scan_log_item_image.go +++ b/.gen/pipeline/pipeline/model_scan_log_item_image.go @@ -20,3 +20,20 @@ type ScanLogItemImage struct { LastUpdated string `json:"lastUpdated,omitempty"` } + +// AssertScanLogItemImageRequired checks if the required fields are not zero-ed +func AssertScanLogItemImageRequired(obj ScanLogItemImage) error { + return nil +} + +// AssertRecurseScanLogItemImageRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ScanLogItemImage (e.g. [][]ScanLogItemImage), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseScanLogItemImageRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aScanLogItemImage, ok := obj.(ScanLogItemImage) + if !ok { + return ErrTypeAssertionError + } + return AssertScanLogItemImageRequired(aScanLogItemImage) + }) +} diff --git a/.gen/pipeline/pipeline/model_schedule_response.go b/.gen/pipeline/pipeline/model_schedule_response.go index 7b5041b713..e3ad34a59a 100644 --- a/.gen/pipeline/pipeline/model_schedule_response.go +++ b/.gen/pipeline/pipeline/model_schedule_response.go @@ -28,3 +28,26 @@ type ScheduleResponse struct { LastBackup string `json:"lastBackup,omitempty"` } + +// AssertScheduleResponseRequired checks if the required fields are not zero-ed +func AssertScheduleResponseRequired(obj ScheduleResponse) error { + if err := AssertLabelsRequired(obj.Labels); err != nil { + return err + } + if err := AssertBackupOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseScheduleResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of ScheduleResponse (e.g. [][]ScheduleResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseScheduleResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aScheduleResponse, ok := obj.(ScheduleResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertScheduleResponseRequired(aScheduleResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_item.go b/.gen/pipeline/pipeline/model_secret_item.go index 1ad0093d21..fb44ba7420 100644 --- a/.gen/pipeline/pipeline/model_secret_item.go +++ b/.gen/pipeline/pipeline/model_secret_item.go @@ -30,3 +30,20 @@ type SecretItem struct { Values map[string]interface{} `json:"values,omitempty"` } + +// AssertSecretItemRequired checks if the required fields are not zero-ed +func AssertSecretItemRequired(obj SecretItem) error { + return nil +} + +// AssertRecurseSecretItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretItem (e.g. [][]SecretItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretItem, ok := obj.(SecretItem) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretItemRequired(aSecretItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_key_value_amazon.go b/.gen/pipeline/pipeline/model_secret_key_value_amazon.go index 7afd7a38dd..e7bdcb74d8 100644 --- a/.gen/pipeline/pipeline/model_secret_key_value_amazon.go +++ b/.gen/pipeline/pipeline/model_secret_key_value_amazon.go @@ -16,3 +16,30 @@ type SecretKeyValueAmazon struct { AWS_SECRET_ACCESS_KEY string `json:"AWS_SECRET_ACCESS_KEY"` } + +// AssertSecretKeyValueAmazonRequired checks if the required fields are not zero-ed +func AssertSecretKeyValueAmazonRequired(obj SecretKeyValueAmazon) error { + elements := map[string]interface{}{ + "AWS_ACCESS_KEY_ID": obj.AWS_ACCESS_KEY_ID, + "AWS_SECRET_ACCESS_KEY": obj.AWS_SECRET_ACCESS_KEY, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseSecretKeyValueAmazonRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretKeyValueAmazon (e.g. [][]SecretKeyValueAmazon), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretKeyValueAmazonRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretKeyValueAmazon, ok := obj.(SecretKeyValueAmazon) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretKeyValueAmazonRequired(aSecretKeyValueAmazon) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_key_value_azure.go b/.gen/pipeline/pipeline/model_secret_key_value_azure.go index 930df64ade..7e2979d258 100644 --- a/.gen/pipeline/pipeline/model_secret_key_value_azure.go +++ b/.gen/pipeline/pipeline/model_secret_key_value_azure.go @@ -20,3 +20,32 @@ type SecretKeyValueAzure struct { AZURE_SUBSCRIPTION_ID string `json:"AZURE_SUBSCRIPTION_ID"` } + +// AssertSecretKeyValueAzureRequired checks if the required fields are not zero-ed +func AssertSecretKeyValueAzureRequired(obj SecretKeyValueAzure) error { + elements := map[string]interface{}{ + "AZURE_CLIENT_ID": obj.AZURE_CLIENT_ID, + "AZURE_CLIENT_SECRET": obj.AZURE_CLIENT_SECRET, + "AZURE_TENANT_ID": obj.AZURE_TENANT_ID, + "AZURE_SUBSCRIPTION_ID": obj.AZURE_SUBSCRIPTION_ID, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseSecretKeyValueAzureRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretKeyValueAzure (e.g. [][]SecretKeyValueAzure), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretKeyValueAzureRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretKeyValueAzure, ok := obj.(SecretKeyValueAzure) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretKeyValueAzureRequired(aSecretKeyValueAzure) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_key_value_generic.go b/.gen/pipeline/pipeline/model_secret_key_value_generic.go index c64c064727..ff3490b14e 100644 --- a/.gen/pipeline/pipeline/model_secret_key_value_generic.go +++ b/.gen/pipeline/pipeline/model_secret_key_value_generic.go @@ -14,3 +14,20 @@ type SecretKeyValueGeneric struct { Any string `json:"any,omitempty"` } + +// AssertSecretKeyValueGenericRequired checks if the required fields are not zero-ed +func AssertSecretKeyValueGenericRequired(obj SecretKeyValueGeneric) error { + return nil +} + +// AssertRecurseSecretKeyValueGenericRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretKeyValueGeneric (e.g. [][]SecretKeyValueGeneric), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretKeyValueGenericRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretKeyValueGeneric, ok := obj.(SecretKeyValueGeneric) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretKeyValueGenericRequired(aSecretKeyValueGeneric) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_key_value_google.go b/.gen/pipeline/pipeline/model_secret_key_value_google.go index 690ff2babc..9733ad6b33 100644 --- a/.gen/pipeline/pipeline/model_secret_key_value_google.go +++ b/.gen/pipeline/pipeline/model_secret_key_value_google.go @@ -32,3 +32,38 @@ type SecretKeyValueGoogle struct { ClientX509CertUrl string `json:"client_x509_cert_url"` } + +// AssertSecretKeyValueGoogleRequired checks if the required fields are not zero-ed +func AssertSecretKeyValueGoogleRequired(obj SecretKeyValueGoogle) error { + elements := map[string]interface{}{ + "type": obj.Type, + "project_id": obj.ProjectId, + "private_key_id": obj.PrivateKeyId, + "private_key": obj.PrivateKey, + "client_email": obj.ClientEmail, + "client_id": obj.ClientId, + "auth_uri": obj.AuthUri, + "token_uri": obj.TokenUri, + "auth_provider_x509_cert_url": obj.AuthProviderX509CertUrl, + "client_x509_cert_url": obj.ClientX509CertUrl, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseSecretKeyValueGoogleRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretKeyValueGoogle (e.g. [][]SecretKeyValueGoogle), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretKeyValueGoogleRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretKeyValueGoogle, ok := obj.(SecretKeyValueGoogle) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretKeyValueGoogleRequired(aSecretKeyValueGoogle) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_key_value_kubernetes.go b/.gen/pipeline/pipeline/model_secret_key_value_kubernetes.go index e4c4773d2f..1da544c25a 100644 --- a/.gen/pipeline/pipeline/model_secret_key_value_kubernetes.go +++ b/.gen/pipeline/pipeline/model_secret_key_value_kubernetes.go @@ -14,3 +14,20 @@ type SecretKeyValueKubernetes struct { K8Sconfig string `json:"K8Sconfig,omitempty"` } + +// AssertSecretKeyValueKubernetesRequired checks if the required fields are not zero-ed +func AssertSecretKeyValueKubernetesRequired(obj SecretKeyValueKubernetes) error { + return nil +} + +// AssertRecurseSecretKeyValueKubernetesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretKeyValueKubernetes (e.g. [][]SecretKeyValueKubernetes), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretKeyValueKubernetesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretKeyValueKubernetes, ok := obj.(SecretKeyValueKubernetes) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretKeyValueKubernetesRequired(aSecretKeyValueKubernetes) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_key_value_tls.go b/.gen/pipeline/pipeline/model_secret_key_value_tls.go index df673caa28..ff6fba3757 100644 --- a/.gen/pipeline/pipeline/model_secret_key_value_tls.go +++ b/.gen/pipeline/pipeline/model_secret_key_value_tls.go @@ -28,3 +28,29 @@ type SecretKeyValueTls struct { ClientKey string `json:"clientKey,omitempty"` } + +// AssertSecretKeyValueTlsRequired checks if the required fields are not zero-ed +func AssertSecretKeyValueTlsRequired(obj SecretKeyValueTls) error { + elements := map[string]interface{}{ + "hosts": obj.Hosts, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseSecretKeyValueTlsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretKeyValueTls (e.g. [][]SecretKeyValueTls), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretKeyValueTlsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretKeyValueTls, ok := obj.(SecretKeyValueTls) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretKeyValueTlsRequired(aSecretKeyValueTls) + }) +} diff --git a/.gen/pipeline/pipeline/model_secret_type_response.go b/.gen/pipeline/pipeline/model_secret_type_response.go index 4eb1331a34..50c0203b52 100644 --- a/.gen/pipeline/pipeline/model_secret_type_response.go +++ b/.gen/pipeline/pipeline/model_secret_type_response.go @@ -12,5 +12,27 @@ package pipeline type SecretTypeResponse struct { - Fields []SecretTypeResponseFields `json:"fields,omitempty"` + Fields []SecretTypeResponseFieldsInner `json:"fields,omitempty"` +} + +// AssertSecretTypeResponseRequired checks if the required fields are not zero-ed +func AssertSecretTypeResponseRequired(obj SecretTypeResponse) error { + for _, el := range obj.Fields { + if err := AssertSecretTypeResponseFieldsInnerRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseSecretTypeResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretTypeResponse (e.g. [][]SecretTypeResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretTypeResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretTypeResponse, ok := obj.(SecretTypeResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretTypeResponseRequired(aSecretTypeResponse) + }) } diff --git a/.gen/pipeline/pipeline/model_secret_type_response_fields_inner.go b/.gen/pipeline/pipeline/model_secret_type_response_fields_inner.go new file mode 100644 index 0000000000..25ab3300a2 --- /dev/null +++ b/.gen/pipeline/pipeline/model_secret_type_response_fields_inner.go @@ -0,0 +1,39 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type SecretTypeResponseFieldsInner struct { + + Name string `json:"name,omitempty"` + + Required bool `json:"required,omitempty"` + + IsSafeToDisplay bool `json:"isSafeToDisplay,omitempty"` + + Description string `json:"description,omitempty"` +} + +// AssertSecretTypeResponseFieldsInnerRequired checks if the required fields are not zero-ed +func AssertSecretTypeResponseFieldsInnerRequired(obj SecretTypeResponseFieldsInner) error { + return nil +} + +// AssertRecurseSecretTypeResponseFieldsInnerRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SecretTypeResponseFieldsInner (e.g. [][]SecretTypeResponseFieldsInner), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSecretTypeResponseFieldsInnerRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSecretTypeResponseFieldsInner, ok := obj.(SecretTypeResponseFieldsInner) + if !ok { + return ErrTypeAssertionError + } + return AssertSecretTypeResponseFieldsInnerRequired(aSecretTypeResponseFieldsInner) + }) +} diff --git a/.gen/pipeline/pipeline/model_subnet_info.go b/.gen/pipeline/pipeline/model_subnet_info.go index 3f564f1499..9e8efff2a8 100644 --- a/.gen/pipeline/pipeline/model_subnet_info.go +++ b/.gen/pipeline/pipeline/model_subnet_info.go @@ -24,3 +24,30 @@ type SubnetInfo struct { // Name of the subnetwork Name string `json:"name,omitempty"` } + +// AssertSubnetInfoRequired checks if the required fields are not zero-ed +func AssertSubnetInfoRequired(obj SubnetInfo) error { + elements := map[string]interface{}{ + "cidrs": obj.Cidrs, + "id": obj.Id, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseSubnetInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of SubnetInfo (e.g. [][]SubnetInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSubnetInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSubnetInfo, ok := obj.(SubnetInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertSubnetInfoRequired(aSubnetInfo) + }) +} diff --git a/.gen/pipeline/pipeline/model_token_create_request.go b/.gen/pipeline/pipeline/model_token_create_request.go index 99c05d52c5..e48b07734b 100644 --- a/.gen/pipeline/pipeline/model_token_create_request.go +++ b/.gen/pipeline/pipeline/model_token_create_request.go @@ -22,3 +22,20 @@ type TokenCreateRequest struct { ExpiresAt *time.Time `json:"expiresAt,omitempty"` } + +// AssertTokenCreateRequestRequired checks if the required fields are not zero-ed +func AssertTokenCreateRequestRequired(obj TokenCreateRequest) error { + return nil +} + +// AssertRecurseTokenCreateRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of TokenCreateRequest (e.g. [][]TokenCreateRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseTokenCreateRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aTokenCreateRequest, ok := obj.(TokenCreateRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertTokenCreateRequestRequired(aTokenCreateRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_token_create_response.go b/.gen/pipeline/pipeline/model_token_create_response.go index 392cd9dc31..f999ee84a0 100644 --- a/.gen/pipeline/pipeline/model_token_create_response.go +++ b/.gen/pipeline/pipeline/model_token_create_response.go @@ -18,3 +18,31 @@ type TokenCreateResponse struct { Name string `json:"name"` } + +// AssertTokenCreateResponseRequired checks if the required fields are not zero-ed +func AssertTokenCreateResponseRequired(obj TokenCreateResponse) error { + elements := map[string]interface{}{ + "id": obj.Id, + "token": obj.Token, + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseTokenCreateResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of TokenCreateResponse (e.g. [][]TokenCreateResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseTokenCreateResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aTokenCreateResponse, ok := obj.(TokenCreateResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertTokenCreateResponseRequired(aTokenCreateResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_token_list_response_item.go b/.gen/pipeline/pipeline/model_token_list_response_item.go index b51719bda7..93daa3dbcd 100644 --- a/.gen/pipeline/pipeline/model_token_list_response_item.go +++ b/.gen/pipeline/pipeline/model_token_list_response_item.go @@ -18,3 +18,31 @@ type TokenListResponseItem struct { Name string `json:"name"` } + +// AssertTokenListResponseItemRequired checks if the required fields are not zero-ed +func AssertTokenListResponseItemRequired(obj TokenListResponseItem) error { + elements := map[string]interface{}{ + "id": obj.Id, + "createdAt": obj.CreatedAt, + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseTokenListResponseItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of TokenListResponseItem (e.g. [][]TokenListResponseItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseTokenListResponseItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aTokenListResponseItem, ok := obj.(TokenListResponseItem) + if !ok { + return ErrTypeAssertionError + } + return AssertTokenListResponseItemRequired(aTokenListResponseItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_azure_properties.go b/.gen/pipeline/pipeline/model_update_azure_properties.go index 9b1cf900a6..37c1db24f3 100644 --- a/.gen/pipeline/pipeline/model_update_azure_properties.go +++ b/.gen/pipeline/pipeline/model_update_azure_properties.go @@ -14,3 +14,32 @@ type UpdateAzureProperties struct { Azure UpdateAzurePropertiesAzure `json:"azure"` } + +// AssertUpdateAzurePropertiesRequired checks if the required fields are not zero-ed +func AssertUpdateAzurePropertiesRequired(obj UpdateAzureProperties) error { + elements := map[string]interface{}{ + "azure": obj.Azure, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertUpdateAzurePropertiesAzureRequired(obj.Azure); err != nil { + return err + } + return nil +} + +// AssertRecurseUpdateAzurePropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateAzureProperties (e.g. [][]UpdateAzureProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateAzurePropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateAzureProperties, ok := obj.(UpdateAzureProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateAzurePropertiesRequired(aUpdateAzureProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_azure_properties_azure.go b/.gen/pipeline/pipeline/model_update_azure_properties_azure.go index 98607671b9..f1c84e7d94 100644 --- a/.gen/pipeline/pipeline/model_update_azure_properties_azure.go +++ b/.gen/pipeline/pipeline/model_update_azure_properties_azure.go @@ -14,3 +14,20 @@ type UpdateAzurePropertiesAzure struct { NodePools map[string]UpdateNodePoolsAzure `json:"nodePools,omitempty"` } + +// AssertUpdateAzurePropertiesAzureRequired checks if the required fields are not zero-ed +func AssertUpdateAzurePropertiesAzureRequired(obj UpdateAzurePropertiesAzure) error { + return nil +} + +// AssertRecurseUpdateAzurePropertiesAzureRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateAzurePropertiesAzure (e.g. [][]UpdateAzurePropertiesAzure), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateAzurePropertiesAzureRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateAzurePropertiesAzure, ok := obj.(UpdateAzurePropertiesAzure) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateAzurePropertiesAzureRequired(aUpdateAzurePropertiesAzure) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_cluster_request.go b/.gen/pipeline/pipeline/model_update_cluster_request.go index 754b3eafb7..5e7b3a4a63 100644 --- a/.gen/pipeline/pipeline/model_update_cluster_request.go +++ b/.gen/pipeline/pipeline/model_update_cluster_request.go @@ -14,3 +14,20 @@ type UpdateClusterRequest struct { Version string `json:"version,omitempty"` } + +// AssertUpdateClusterRequestRequired checks if the required fields are not zero-ed +func AssertUpdateClusterRequestRequired(obj UpdateClusterRequest) error { + return nil +} + +// AssertRecurseUpdateClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateClusterRequest (e.g. [][]UpdateClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateClusterRequest, ok := obj.(UpdateClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateClusterRequestRequired(aUpdateClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_cluster_request_deprecated.go b/.gen/pipeline/pipeline/model_update_cluster_request_deprecated.go index 068086567a..494c2e94a3 100644 --- a/.gen/pipeline/pipeline/model_update_cluster_request_deprecated.go +++ b/.gen/pipeline/pipeline/model_update_cluster_request_deprecated.go @@ -16,3 +16,30 @@ type UpdateClusterRequestDeprecated struct { Properties map[string]interface{} `json:"properties"` } + +// AssertUpdateClusterRequestDeprecatedRequired checks if the required fields are not zero-ed +func AssertUpdateClusterRequestDeprecatedRequired(obj UpdateClusterRequestDeprecated) error { + elements := map[string]interface{}{ + "cloud": obj.Cloud, + "properties": obj.Properties, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseUpdateClusterRequestDeprecatedRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateClusterRequestDeprecated (e.g. [][]UpdateClusterRequestDeprecated), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateClusterRequestDeprecatedRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateClusterRequestDeprecated, ok := obj.(UpdateClusterRequestDeprecated) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateClusterRequestDeprecatedRequired(aUpdateClusterRequestDeprecated) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_cluster_request_v2.go b/.gen/pipeline/pipeline/model_update_cluster_request_v2.go index 3938e6a468..74d6aefc13 100644 --- a/.gen/pipeline/pipeline/model_update_cluster_request_v2.go +++ b/.gen/pipeline/pipeline/model_update_cluster_request_v2.go @@ -12,5 +12,27 @@ package pipeline type UpdateClusterRequestV2 struct { - Nodepools []PkeOnVsphereNodePool `json:"nodepools,omitempty"` + Nodepools []PkeonVsphereNodePool `json:"nodepools,omitempty"` +} + +// AssertUpdateClusterRequestV2Required checks if the required fields are not zero-ed +func AssertUpdateClusterRequestV2Required(obj UpdateClusterRequestV2) error { + for _, el := range obj.Nodepools { + if err := AssertPkeonVsphereNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseUpdateClusterRequestV2Required recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateClusterRequestV2 (e.g. [][]UpdateClusterRequestV2), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateClusterRequestV2Required(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateClusterRequestV2, ok := obj.(UpdateClusterRequestV2) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateClusterRequestV2Required(aUpdateClusterRequestV2) + }) } diff --git a/.gen/pipeline/pipeline/model_update_eks_properties.go b/.gen/pipeline/pipeline/model_update_eks_properties.go index 732c18955e..418c3c30b0 100644 --- a/.gen/pipeline/pipeline/model_update_eks_properties.go +++ b/.gen/pipeline/pipeline/model_update_eks_properties.go @@ -14,3 +14,32 @@ type UpdateEksProperties struct { Eks UpdateEksPropertiesEks `json:"eks"` } + +// AssertUpdateEksPropertiesRequired checks if the required fields are not zero-ed +func AssertUpdateEksPropertiesRequired(obj UpdateEksProperties) error { + elements := map[string]interface{}{ + "eks": obj.Eks, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertUpdateEksPropertiesEksRequired(obj.Eks); err != nil { + return err + } + return nil +} + +// AssertRecurseUpdateEksPropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateEksProperties (e.g. [][]UpdateEksProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateEksPropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateEksProperties, ok := obj.(UpdateEksProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateEksPropertiesRequired(aUpdateEksProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_eks_properties_eks.go b/.gen/pipeline/pipeline/model_update_eks_properties_eks.go index 05e969a35a..3139af9880 100644 --- a/.gen/pipeline/pipeline/model_update_eks_properties_eks.go +++ b/.gen/pipeline/pipeline/model_update_eks_properties_eks.go @@ -14,3 +14,29 @@ type UpdateEksPropertiesEks struct { NodePools map[string]EksNodePool `json:"nodePools"` } + +// AssertUpdateEksPropertiesEksRequired checks if the required fields are not zero-ed +func AssertUpdateEksPropertiesEksRequired(obj UpdateEksPropertiesEks) error { + elements := map[string]interface{}{ + "nodePools": obj.NodePools, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseUpdateEksPropertiesEksRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateEksPropertiesEks (e.g. [][]UpdateEksPropertiesEks), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateEksPropertiesEksRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateEksPropertiesEks, ok := obj.(UpdateEksPropertiesEks) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateEksPropertiesEksRequired(aUpdateEksPropertiesEks) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_google_properties.go b/.gen/pipeline/pipeline/model_update_google_properties.go index 944d3a3dde..e1dd0bb794 100644 --- a/.gen/pipeline/pipeline/model_update_google_properties.go +++ b/.gen/pipeline/pipeline/model_update_google_properties.go @@ -18,3 +18,23 @@ type UpdateGoogleProperties struct { NodePools map[string]UpdateNodePoolsGoogle `json:"nodePools,omitempty"` } + +// AssertUpdateGooglePropertiesRequired checks if the required fields are not zero-ed +func AssertUpdateGooglePropertiesRequired(obj UpdateGoogleProperties) error { + if err := AssertUpdateGooglePropertiesMasterRequired(obj.Master); err != nil { + return err + } + return nil +} + +// AssertRecurseUpdateGooglePropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateGoogleProperties (e.g. [][]UpdateGoogleProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateGooglePropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateGoogleProperties, ok := obj.(UpdateGoogleProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateGooglePropertiesRequired(aUpdateGoogleProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_google_properties_master.go b/.gen/pipeline/pipeline/model_update_google_properties_master.go index 9a960dece1..a454dc0c1b 100644 --- a/.gen/pipeline/pipeline/model_update_google_properties_master.go +++ b/.gen/pipeline/pipeline/model_update_google_properties_master.go @@ -14,3 +14,20 @@ type UpdateGooglePropertiesMaster struct { Version string `json:"version,omitempty"` } + +// AssertUpdateGooglePropertiesMasterRequired checks if the required fields are not zero-ed +func AssertUpdateGooglePropertiesMasterRequired(obj UpdateGooglePropertiesMaster) error { + return nil +} + +// AssertRecurseUpdateGooglePropertiesMasterRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateGooglePropertiesMaster (e.g. [][]UpdateGooglePropertiesMaster), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateGooglePropertiesMasterRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateGooglePropertiesMaster, ok := obj.(UpdateGooglePropertiesMaster) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateGooglePropertiesMasterRequired(aUpdateGooglePropertiesMaster) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_integrated_service_request.go b/.gen/pipeline/pipeline/model_update_integrated_service_request.go index 5823c942dc..12e8941b5d 100644 --- a/.gen/pipeline/pipeline/model_update_integrated_service_request.go +++ b/.gen/pipeline/pipeline/model_update_integrated_service_request.go @@ -14,3 +14,29 @@ type UpdateIntegratedServiceRequest struct { Spec map[string]interface{} `json:"spec"` } + +// AssertUpdateIntegratedServiceRequestRequired checks if the required fields are not zero-ed +func AssertUpdateIntegratedServiceRequestRequired(obj UpdateIntegratedServiceRequest) error { + elements := map[string]interface{}{ + "spec": obj.Spec, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseUpdateIntegratedServiceRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateIntegratedServiceRequest (e.g. [][]UpdateIntegratedServiceRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateIntegratedServiceRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateIntegratedServiceRequest, ok := obj.(UpdateIntegratedServiceRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateIntegratedServiceRequestRequired(aUpdateIntegratedServiceRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_node_pool_drain_options.go b/.gen/pipeline/pipeline/model_update_node_pool_drain_options.go index 0460ff1333..5872eed2af 100644 --- a/.gen/pipeline/pipeline/model_update_node_pool_drain_options.go +++ b/.gen/pipeline/pipeline/model_update_node_pool_drain_options.go @@ -22,3 +22,20 @@ type UpdateNodePoolDrainOptions struct { // Only evict those pods that matches this selector. PodSelector string `json:"podSelector,omitempty"` } + +// AssertUpdateNodePoolDrainOptionsRequired checks if the required fields are not zero-ed +func AssertUpdateNodePoolDrainOptionsRequired(obj UpdateNodePoolDrainOptions) error { + return nil +} + +// AssertRecurseUpdateNodePoolDrainOptionsRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateNodePoolDrainOptions (e.g. [][]UpdateNodePoolDrainOptions), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateNodePoolDrainOptionsRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateNodePoolDrainOptions, ok := obj.(UpdateNodePoolDrainOptions) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateNodePoolDrainOptionsRequired(aUpdateNodePoolDrainOptions) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_node_pool_request.go b/.gen/pipeline/pipeline/model_update_node_pool_request.go index 0d7e164999..72a815a2d8 100644 --- a/.gen/pipeline/pipeline/model_update_node_pool_request.go +++ b/.gen/pipeline/pipeline/model_update_node_pool_request.go @@ -48,3 +48,40 @@ type UpdateNodePoolRequest struct { Options BaseUpdateNodePoolOptions `json:"options,omitempty"` } + +// AssertUpdateNodePoolRequestRequired checks if the required fields are not zero-ed +func AssertUpdateNodePoolRequestRequired(obj UpdateNodePoolRequest) error { + elements := map[string]interface{}{ + "size": obj.Size, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertNodePoolAutoScalingRequired(obj.Autoscaling); err != nil { + return err + } + if obj.VolumeEncryption != nil { + if err := AssertEksNodePoolVolumeEncryptionRequired(*obj.VolumeEncryption); err != nil { + return err + } + } + if err := AssertBaseUpdateNodePoolOptionsRequired(obj.Options); err != nil { + return err + } + return nil +} + +// AssertRecurseUpdateNodePoolRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateNodePoolRequest (e.g. [][]UpdateNodePoolRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateNodePoolRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateNodePoolRequest, ok := obj.(UpdateNodePoolRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateNodePoolRequestRequired(aUpdateNodePoolRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_node_pool_response.go b/.gen/pipeline/pipeline/model_update_node_pool_response.go index 5485dedd57..4bd7ff247e 100644 --- a/.gen/pipeline/pipeline/model_update_node_pool_response.go +++ b/.gen/pipeline/pipeline/model_update_node_pool_response.go @@ -15,3 +15,20 @@ type UpdateNodePoolResponse struct { // Node pool update process ID. ProcessId string `json:"processId,omitempty"` } + +// AssertUpdateNodePoolResponseRequired checks if the required fields are not zero-ed +func AssertUpdateNodePoolResponseRequired(obj UpdateNodePoolResponse) error { + return nil +} + +// AssertRecurseUpdateNodePoolResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateNodePoolResponse (e.g. [][]UpdateNodePoolResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateNodePoolResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateNodePoolResponse, ok := obj.(UpdateNodePoolResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateNodePoolResponseRequired(aUpdateNodePoolResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_node_pools_azure.go b/.gen/pipeline/pipeline/model_update_node_pools_azure.go index c8ee939103..fbad484785 100644 --- a/.gen/pipeline/pipeline/model_update_node_pools_azure.go +++ b/.gen/pipeline/pipeline/model_update_node_pools_azure.go @@ -26,3 +26,29 @@ type UpdateNodePoolsAzure struct { VnetSubnetID string `json:"vnetSubnetID,omitempty"` } + +// AssertUpdateNodePoolsAzureRequired checks if the required fields are not zero-ed +func AssertUpdateNodePoolsAzureRequired(obj UpdateNodePoolsAzure) error { + elements := map[string]interface{}{ + "count": obj.Count, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseUpdateNodePoolsAzureRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateNodePoolsAzure (e.g. [][]UpdateNodePoolsAzure), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateNodePoolsAzureRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateNodePoolsAzure, ok := obj.(UpdateNodePoolsAzure) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateNodePoolsAzureRequired(aUpdateNodePoolsAzure) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_node_pools_google.go b/.gen/pipeline/pipeline/model_update_node_pools_google.go index 1bb3975808..cdc98cb7ff 100644 --- a/.gen/pipeline/pipeline/model_update_node_pools_google.go +++ b/.gen/pipeline/pipeline/model_update_node_pools_google.go @@ -22,3 +22,29 @@ type UpdateNodePoolsGoogle struct { InstanceType string `json:"instanceType,omitempty"` } + +// AssertUpdateNodePoolsGoogleRequired checks if the required fields are not zero-ed +func AssertUpdateNodePoolsGoogleRequired(obj UpdateNodePoolsGoogle) error { + elements := map[string]interface{}{ + "count": obj.Count, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseUpdateNodePoolsGoogleRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateNodePoolsGoogle (e.g. [][]UpdateNodePoolsGoogle), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateNodePoolsGoogleRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateNodePoolsGoogle, ok := obj.(UpdateNodePoolsGoogle) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateNodePoolsGoogleRequired(aUpdateNodePoolsGoogle) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_node_pools_pke.go b/.gen/pipeline/pipeline/model_update_node_pools_pke.go index 18eb64118a..2fa4141456 100644 --- a/.gen/pipeline/pipeline/model_update_node_pools_pke.go +++ b/.gen/pipeline/pipeline/model_update_node_pools_pke.go @@ -36,3 +36,20 @@ type UpdateNodePoolsPke struct { // user provided custom node labels to be placed onto the nodes of the node pool Labels map[string]string `json:"labels,omitempty"` } + +// AssertUpdateNodePoolsPkeRequired checks if the required fields are not zero-ed +func AssertUpdateNodePoolsPkeRequired(obj UpdateNodePoolsPke) error { + return nil +} + +// AssertRecurseUpdateNodePoolsPkeRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdateNodePoolsPke (e.g. [][]UpdateNodePoolsPke), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdateNodePoolsPkeRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdateNodePoolsPke, ok := obj.(UpdateNodePoolsPke) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdateNodePoolsPkeRequired(aUpdateNodePoolsPke) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_pke_on_azure_cluster_request.go b/.gen/pipeline/pipeline/model_update_pke_on_azure_cluster_request.go deleted file mode 100644 index e7fb1524ad..0000000000 --- a/.gen/pipeline/pipeline/model_update_pke_on_azure_cluster_request.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Pipeline API - * - * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. - * - * API version: latest - * Contact: info@banzaicloud.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package pipeline - -type UpdatePkeOnAzureClusterRequest struct { - - Nodepools []PkeOnAzureNodePool `json:"nodepools,omitempty"` -} diff --git a/.gen/pipeline/pipeline/model_update_pke_properties.go b/.gen/pipeline/pipeline/model_update_pke_properties.go index 0280e27c35..6c2b8fc466 100644 --- a/.gen/pipeline/pipeline/model_update_pke_properties.go +++ b/.gen/pipeline/pipeline/model_update_pke_properties.go @@ -14,3 +14,32 @@ type UpdatePkeProperties struct { Pke UpdatePkePropertiesPke `json:"pke"` } + +// AssertUpdatePkePropertiesRequired checks if the required fields are not zero-ed +func AssertUpdatePkePropertiesRequired(obj UpdatePkeProperties) error { + elements := map[string]interface{}{ + "pke": obj.Pke, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertUpdatePkePropertiesPkeRequired(obj.Pke); err != nil { + return err + } + return nil +} + +// AssertRecurseUpdatePkePropertiesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdatePkeProperties (e.g. [][]UpdatePkeProperties), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdatePkePropertiesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdatePkeProperties, ok := obj.(UpdatePkeProperties) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdatePkePropertiesRequired(aUpdatePkeProperties) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_pke_properties_pke.go b/.gen/pipeline/pipeline/model_update_pke_properties_pke.go index 1e080a2116..fe9817fcfe 100644 --- a/.gen/pipeline/pipeline/model_update_pke_properties_pke.go +++ b/.gen/pipeline/pipeline/model_update_pke_properties_pke.go @@ -14,3 +14,29 @@ type UpdatePkePropertiesPke struct { NodePools map[string]UpdateNodePoolsPke `json:"nodePools"` } + +// AssertUpdatePkePropertiesPkeRequired checks if the required fields are not zero-ed +func AssertUpdatePkePropertiesPkeRequired(obj UpdatePkePropertiesPke) error { + elements := map[string]interface{}{ + "nodePools": obj.NodePools, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseUpdatePkePropertiesPkeRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdatePkePropertiesPke (e.g. [][]UpdatePkePropertiesPke), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdatePkePropertiesPkeRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdatePkePropertiesPke, ok := obj.(UpdatePkePropertiesPke) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdatePkePropertiesPkeRequired(aUpdatePkePropertiesPke) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_pkeon_azure_cluster_request.go b/.gen/pipeline/pipeline/model_update_pkeon_azure_cluster_request.go new file mode 100644 index 0000000000..bf6261e15b --- /dev/null +++ b/.gen/pipeline/pipeline/model_update_pkeon_azure_cluster_request.go @@ -0,0 +1,38 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type UpdatePkeonAzureClusterRequest struct { + + Nodepools []PkeonAzureNodePool `json:"nodepools,omitempty"` +} + +// AssertUpdatePkeonAzureClusterRequestRequired checks if the required fields are not zero-ed +func AssertUpdatePkeonAzureClusterRequestRequired(obj UpdatePkeonAzureClusterRequest) error { + for _, el := range obj.Nodepools { + if err := AssertPkeonAzureNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseUpdatePkeonAzureClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdatePkeonAzureClusterRequest (e.g. [][]UpdatePkeonAzureClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdatePkeonAzureClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdatePkeonAzureClusterRequest, ok := obj.(UpdatePkeonAzureClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdatePkeonAzureClusterRequestRequired(aUpdatePkeonAzureClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_update_pkeon_vsphere_cluster_request.go b/.gen/pipeline/pipeline/model_update_pkeon_vsphere_cluster_request.go new file mode 100644 index 0000000000..a6833ff153 --- /dev/null +++ b/.gen/pipeline/pipeline/model_update_pkeon_vsphere_cluster_request.go @@ -0,0 +1,38 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +type UpdatePkeonVsphereClusterRequest struct { + + Nodepools []PkeonVsphereNodePool `json:"nodepools,omitempty"` +} + +// AssertUpdatePkeonVsphereClusterRequestRequired checks if the required fields are not zero-ed +func AssertUpdatePkeonVsphereClusterRequestRequired(obj UpdatePkeonVsphereClusterRequest) error { + for _, el := range obj.Nodepools { + if err := AssertPkeonVsphereNodePoolRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseUpdatePkeonVsphereClusterRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UpdatePkeonVsphereClusterRequest (e.g. [][]UpdatePkeonVsphereClusterRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUpdatePkeonVsphereClusterRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUpdatePkeonVsphereClusterRequest, ok := obj.(UpdatePkeonVsphereClusterRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertUpdatePkeonVsphereClusterRequestRequired(aUpdatePkeonVsphereClusterRequest) + }) +} diff --git a/.gen/pipeline/pipeline/model_url_item.go b/.gen/pipeline/pipeline/model_url_item.go index 633c05b590..31e932a2b1 100644 --- a/.gen/pipeline/pipeline/model_url_item.go +++ b/.gen/pipeline/pipeline/model_url_item.go @@ -16,3 +16,20 @@ type UrlItem struct { Url string `json:"url,omitempty"` } + +// AssertUrlItemRequired checks if the required fields are not zero-ed +func AssertUrlItemRequired(obj UrlItem) error { + return nil +} + +// AssertRecurseUrlItemRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of UrlItem (e.g. [][]UrlItem), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUrlItemRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUrlItem, ok := obj.(UrlItem) + if !ok { + return ErrTypeAssertionError + } + return AssertUrlItemRequired(aUrlItem) + }) +} diff --git a/.gen/pipeline/pipeline/model_user.go b/.gen/pipeline/pipeline/model_user.go index 958dc461e1..9bfc42acd0 100644 --- a/.gen/pipeline/pipeline/model_user.go +++ b/.gen/pipeline/pipeline/model_user.go @@ -28,3 +28,20 @@ type User struct { Organizations map[string]interface{} `json:"organizations,omitempty"` } + +// AssertUserRequired checks if the required fields are not zero-ed +func AssertUserRequired(obj User) error { + return nil +} + +// AssertRecurseUserRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of User (e.g. [][]User), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseUserRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aUser, ok := obj.(User) + if !ok { + return ErrTypeAssertionError + } + return AssertUserRequired(aUser) + }) +} diff --git a/.gen/pipeline/pipeline/model_version_response.go b/.gen/pipeline/pipeline/model_version_response.go index d289889fc6..c84fbb32bd 100644 --- a/.gen/pipeline/pipeline/model_version_response.go +++ b/.gen/pipeline/pipeline/model_version_response.go @@ -29,3 +29,20 @@ type VersionResponse struct { InstanceUuid string `json:"instance_uuid,omitempty"` } + +// AssertVersionResponseRequired checks if the required fields are not zero-ed +func AssertVersionResponseRequired(obj VersionResponse) error { + return nil +} + +// AssertRecurseVersionResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of VersionResponse (e.g. [][]VersionResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseVersionResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aVersionResponse, ok := obj.(VersionResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertVersionResponseRequired(aVersionResponse) + }) +} diff --git a/.gen/pipeline/pipeline/model_vpc_network_info.go b/.gen/pipeline/pipeline/model_vpc_network_info.go index 17651bf36e..f0adb94531 100644 --- a/.gen/pipeline/pipeline/model_vpc_network_info.go +++ b/.gen/pipeline/pipeline/model_vpc_network_info.go @@ -21,3 +21,30 @@ type VpcNetworkInfo struct { // Name of the VPC network Name string `json:"name,omitempty"` } + +// AssertVpcNetworkInfoRequired checks if the required fields are not zero-ed +func AssertVpcNetworkInfoRequired(obj VpcNetworkInfo) error { + elements := map[string]interface{}{ + "cidrs": obj.Cidrs, + "id": obj.Id, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseVpcNetworkInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of VpcNetworkInfo (e.g. [][]VpcNetworkInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseVpcNetworkInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aVpcNetworkInfo, ok := obj.(VpcNetworkInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertVpcNetworkInfoRequired(aVpcNetworkInfo) + }) +} diff --git a/.gen/pipeline/pipeline/routers.go b/.gen/pipeline/pipeline/routers.go new file mode 100644 index 0000000000..2706e230f2 --- /dev/null +++ b/.gen/pipeline/pipeline/routers.go @@ -0,0 +1,218 @@ +/* + * Pipeline API + * + * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. + * + * API version: latest + * Contact: info@banzaicloud.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package pipeline + +import ( + "encoding/json" + "errors" + "github.com/gorilla/mux" + "io/ioutil" + "mime/multipart" + "net/http" + "os" + "strconv" + "strings" +) + +// A Route defines the parameters for an api endpoint +type Route struct { + Name string + Method string + Pattern string + HandlerFunc http.HandlerFunc +} + +// Routes are a collection of defined api endpoints +type Routes []Route + +// Router defines the required methods for retrieving api routes +type Router interface { + Routes() Routes +} + +const errMsgRequiredMissing = "required parameter is missing" + +// NewRouter creates a new router for any number of api routers +func NewRouter(routers ...Router) *mux.Router { + router := mux.NewRouter().StrictSlash(true) + for _, api := range routers { + for _, route := range api.Routes() { + var handler http.Handler + handler = route.HandlerFunc + handler = Logger(handler, route.Name) + + router. + Methods(route.Method). + Path(route.Pattern). + Name(route.Name). + Handler(handler) + } + } + + return router +} + +// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code +func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + if status != nil { + w.WriteHeader(*status) + } else { + w.WriteHeader(http.StatusOK) + } + + return json.NewEncoder(w).Encode(i) +} + +// ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file +func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error) { + _, fileHeader, err := r.FormFile(key) + if err != nil { + return nil, err + } + + return readFileHeaderToTempFile(fileHeader) +} + +// ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files +func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error) { + if err := r.ParseMultipartForm(32 << 20); err != nil { + return nil, err + } + + files := make([]*os.File, 0, len(r.MultipartForm.File[key])) + + for _, fileHeader := range r.MultipartForm.File[key] { + file, err := readFileHeaderToTempFile(fileHeader) + if err != nil { + return nil, err + } + + files = append(files, file) + } + + return files, nil +} + +// readFileHeaderToTempFile reads multipart.FileHeader and writes it to a temporary file +func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error) { + formFile, err := fileHeader.Open() + if err != nil { + return nil, err + } + + defer formFile.Close() + + fileBytes, err := ioutil.ReadAll(formFile) + if err != nil { + return nil, err + } + + file, err := ioutil.TempFile("", fileHeader.Filename) + if err != nil { + return nil, err + } + + defer file.Close() + + file.Write(fileBytes) + + return file, nil +} + +// parseInt64Parameter parses a string parameter to an int64. +func parseInt64Parameter(param string, required bool) (int64, error) { + if param == "" { + if required { + return 0, errors.New(errMsgRequiredMissing) + } + + return 0, nil + } + + return strconv.ParseInt(param, 10, 64) +} + +// parseInt32Parameter parses a string parameter to an int32. +func parseInt32Parameter(param string, required bool) (int32, error) { + if param == "" { + if required { + return 0, errors.New(errMsgRequiredMissing) + } + + return 0, nil + } + + val, err := strconv.ParseInt(param, 10, 32) + if err != nil { + return -1, err + } + + return int32(val), nil +} + +// parseBoolParameter parses a string parameter to a bool +func parseBoolParameter(param string) (bool, error) { + val, err := strconv.ParseBool(param) + if err != nil { + return false, err + } + + return bool(val), nil +} + +// parseInt64ArrayParameter parses a string parameter containing array of values to []int64. +func parseInt64ArrayParameter(param, delim string, required bool) ([]int64, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + ints := make([]int64, len(str)) + + for i, s := range str { + if v, err := strconv.ParseInt(s, 10, 64); err != nil { + return nil, err + } else { + ints[i] = v + } + } + + return ints, nil +} + +// parseInt32ArrayParameter parses a string parameter containing array of values to []int32. +func parseInt32ArrayParameter(param, delim string, required bool) ([]int32, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + ints := make([]int32, len(str)) + + for i, s := range str { + if v, err := strconv.ParseInt(s, 10, 32); err != nil { + return nil, err + } else { + ints[i] = int32(v) + } + } + + return ints, nil +} \ No newline at end of file diff --git a/.plzconfig b/.plzconfig index 876328d171..38e6ec0e81 100644 --- a/.plzconfig +++ b/.plzconfig @@ -11,9 +11,9 @@ GoTestRootCompat = True [buildconfig] golangci-lint-version = 1.50.0 -openapi-generator-version = v4.3.1 +openapi-generator-version = v6.2.0 gotestsum-version = 0.4.1 -mga-version = 0.4.2 +mga-version = 0.9.0 licensei-version = 0.2.0 migrate-version = 4.9.1 kubectl-version = 1.20.5 diff --git a/.wollemi.json b/.wollemi.json index 1e41c83e92..a5fc49f4e8 100644 --- a/.wollemi.json +++ b/.wollemi.json @@ -52,7 +52,6 @@ "github.com/ThreeDotsLabs/watermill/message/subscriber": "//third_party/go:github.com__ThreeDotsLabs__watermill__message__subscriber", "github.com/ThreeDotsLabs/watermill/pubsub/gochannel": "//third_party/go:github.com__ThreeDotsLabs__watermill__pubsub__gochannel", "github.com/ThreeDotsLabs/watermill/pubsub/sync": "//third_party/go:github.com__ThreeDotsLabs__watermill__pubsub__sync", - "github.com/antihax/optional": "//third_party/go:github.com__antihax__optional", "github.com/aokoli/goutils": "//third_party/go:github.com__aokoli__goutils", "github.com/apache/thrift/lib/go/thrift": "//third_party/go:github.com__apache__thrift__lib__go__thrift", "github.com/asaskevich/EventBus": "//third_party/go:github.com__asaskevich__EventBus", diff --git a/Makefile b/Makefile index e5b98337e9..412cd04ce2 100644 --- a/Makefile +++ b/Makefile @@ -28,16 +28,14 @@ TEST_FORMAT = short-verbose endif CLOUDINFO_VERSION = 0.9.5 -DEX_VERSION = 2.19.0 -# TODO: use an exact version -ANCHORE_VERSION = 156836d +ANCHORE_VERSION = 1.1.0 GOLANGCI_VERSION = 1.50.0 LICENSEI_VERSION = 0.3.1 -OPENAPI_GENERATOR_VERSION = v4.3.1 +OPENAPI_GENERATOR_VERSION = v6.2.0 MIGRATE_VERSION = 4.9.1 GOTESTSUM_VERSION = 0.4.1 -MGA_VERSION = 0.4.2 +MGA_VERSION = 0.9.0 GRYPE_VERSION = 0.32.0 ETCD_VERSION = 3.4.16 KUBE_APISERVER_VERSION = 1.19.11 @@ -327,7 +325,7 @@ generate-openapi: validate-openapi ## Generate go server based on openapi descri -g go-server \ -o /local/.gen/pipeline @ if [[ "$$OSTYPE" == "linux-gnu" ]]; then sudo chown -R $(shell id -u):$(shell id -g) .gen/pipeline/; fi - rm .gen/pipeline/{Dockerfile,go.*,README.md,main.go,go/api*.go,go/logger.go,go/routers.go} + rm .gen/pipeline/{Dockerfile,go.*,README.md,main.go,go/api*.go} mv .gen/pipeline/go .gen/pipeline/pipeline $(call restore_backup_file,.gen/pipeline/pipeline/BUILD.plz) @@ -354,7 +352,7 @@ generate-cloudinfo-client: apis/cloudinfo/openapi.yaml ## Generate client from C $(call restore_backup_file,.gen/cloudinfo/BUILD.plz) apis/anchore/swagger.yaml: - curl https://raw.githubusercontent.com/anchore/anchore-engine/${ANCHORE_VERSION}/anchore_engine/services/apiext/swagger/swagger.yaml | tr '\n' '\r' | sed $$'s/- Images\r - Vulnerabilities/- Images/g' | tr '\r' '\n' | sed '/- Image Content/d; /- Policy Evaluation/d; /- Queries/d' > apis/anchore/swagger.yaml + curl https://raw.githubusercontent.com/anchore/anchore-engine/v${ANCHORE_VERSION}/anchore_engine/services/apiext/swagger/swagger.yaml | tr '\n' '\r' | sed $$'s/- Images\r - Vulnerabilities/- Images/g' | tr '\r' '\n' | sed '/- Image Content/d; /- Policy Evaluation/d; /- Queries/d' > apis/anchore/swagger.yaml .PHONY: generate-anchore-client generate-anchore-client: ## apis/anchore/swagger.yaml ## https://github.com/anchore/anchore-engine/pull/846 ## Generate client from Anchore OpenAPI spec diff --git a/apis/anchore/swagger.yaml b/apis/anchore/swagger.yaml index 6303dd3f82..5773fb0d9d 100644 --- a/apis/anchore/swagger.yaml +++ b/apis/anchore/swagger.yaml @@ -1,7 +1,7 @@ swagger: "2.0" info: description: "This is the Anchore Engine API. Provides the primary external API for users of the service." - version: "0.1.12" + version: "0.1.20" title: "Anchore Engine API Server" contact: email: "nurmi@anchore.com" @@ -12,51 +12,47 @@ info: # description: "Anchore Engine" # url: "http://github.com/anchore/anchore-engine" tags: -- name: Subscriptions - description: Subscription Management -- name: Policies - description: Policy Management -- name: Images - description: Image Management -- name: Image Content - description: View Image Content -- name: Vulnerabilities - description: Vulnerability checks and reports -- name: Policy Evaluation - description: Evaluate images against policies -- name: Registries - description: Registry Management -- name: Repository Credentials - description: Repository Credential Management -- name: System - description: System Management -- name: Services - description: Service Management -- name: Summaries - description: Resource Summaries -- name: Events - description: View and delete events -- name: Queries - description: Resource Queries -- name: User Management - description: Manage Accounts, Users, and Credentials -- name: Identity - description: Get and operate on the authenticated user's identity -- name: Archives - description: Data Archiving Management + - name: Subscriptions + description: Subscription Management + - name: Policies + description: Policy Management + - name: Images + description: Image Management + - name: Image Content + description: View Image Content + - name: Vulnerabilities + description: Vulnerability checks and reports + - name: Policy Evaluation + description: Evaluate images against policies + - name: Registries + description: Registry Management + - name: Repository Credentials + description: Repository Credential Management + - name: System + description: System Management + - name: Services + description: Service Management + - name: Summaries + description: Resource Summaries + - name: Events + description: View and delete events + - name: Queries + description: Resource Queries + - name: User Management + description: Manage Accounts, Users, and Credentials + - name: Identity + description: Get and operate on the authenticated user's identity + - name: Archives + description: Data Archiving Management basePath: "/" schemes: -- "http" -- "https" + - "http" + - "https" consumes: -- application/json + - application/json produces: -- application/json -securityDefinitions: - basicAuth: - type: basic -security: -- basicAuth: [] + - application/json + parameters: AsAccountParameter: name: x-anchore-account @@ -78,8 +74,8 @@ paths: type: string /health: get: - x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system - operationId: health_noop + x-swagger-router-controller: anchore_engine.apis.common + operationId: health_check x-anchore-authz-action: None description: Health check, returns 200 and no body if service is running responses: @@ -87,8 +83,8 @@ paths: description: Empty body on success /version: get: - x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system - operationId: version_noop + x-swagger-router-controller: anchore_engine.apis.common + operationId: version_check x-anchore-authz-action: None description: Returns the version object for the service, including db schema version info responses: @@ -99,19 +95,19 @@ paths: /policies: get: tags: - - Policies + - Policies x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.policies x-anchore-authz-action: listPolicies operationId: list_policies summary: List policies description: List all saved policy bundles parameters: - - name: detail - in: query - type: boolean - required: false - description: Include policy bundle detail in the form of the full bundle content for each entry - - $ref: "#/parameters/AsAccountParameter" + - name: detail + in: query + type: boolean + required: false + description: Include policy bundle detail in the form of the full bundle content for each entry + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Policy listing @@ -119,19 +115,19 @@ paths: $ref: "#/definitions/PolicyBundleList" post: tags: - - Policies + - Policies x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.policies operationId: add_policy x-anchore-authz-action: createPolicy summary: Add a new policy description: Adds a new policy bundle to the system parameters: - - name: bundle - in: body - required: true - schema: - $ref: "#/definitions/PolicyBundle" - - $ref: "#/parameters/AsAccountParameter" + - name: bundle + in: body + required: true + schema: + $ref: "#/definitions/PolicyBundle" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Saved bundle @@ -144,23 +140,23 @@ paths: /policies/{policyId}: get: tags: - - Policies + - Policies x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.policies operationId: get_policy x-anchore-authz-action: getPolicy description: Get the policy bundle content summary: Get specific policy parameters: - - name: policyId - in: path - type: string - required: True - - name: detail - in: query - type: boolean - required: false - description: Include policy bundle detail in the form of the full bundle content for each entry - - $ref: "#/parameters/AsAccountParameter" + - name: policyId + in: path + type: string + required: True + - name: detail + in: query + type: boolean + required: false + description: Include policy bundle detail in the form of the full bundle content for each entry + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: A list with a single fetched policy bundle record @@ -172,28 +168,28 @@ paths: $ref: "#/definitions/ApiErrorResponse" put: tags: - - Policies + - Policies x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.policies operationId: update_policy x-anchore-authz-action: updatePolicy description: Update/replace and existing policy summary: Update policy parameters: - - name: bundle - in: body - required: true - schema: - $ref: "#/definitions/PolicyBundleRecord" - - name: policyId - in: path - type: string - required: True - - name: active - in: query - type: boolean - required: false - description: Mark policy as active - - $ref: "#/parameters/AsAccountParameter" + - name: bundle + in: body + required: true + schema: + $ref: "#/definitions/PolicyBundleRecord" + - name: policyId + in: path + type: string + required: True + - name: active + in: query + type: boolean + required: false + description: Mark policy as active + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: A list with a single updated policy bundle record @@ -205,18 +201,18 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - Policies + - Policies x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.policies operationId: delete_policy x-anchore-authz-action: deletePolicy description: Delete the specified policy summary: Delete policy parameters: - - name: policyId - in: path - required: true - type: string - - $ref: "#/parameters/AsAccountParameter" + - name: policyId + in: path + required: true + type: string + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Delete success @@ -231,23 +227,23 @@ paths: /subscriptions: get: tags: - - Subscriptions + - Subscriptions x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.subscriptions operationId: list_subscriptions x-anchore-authz-action: listSubscriptions summary: List all subscriptions parameters: - - name: 'subscription_key' - in: query - type: string - description: "filter only subscriptions matching key" - required: false - - name: 'subscription_type' - in: query - type: string - description: "filter only subscriptions matching type" - required: false - - $ref: "#/parameters/AsAccountParameter" + - name: 'subscription_key' + in: query + type: string + description: "filter only subscriptions matching key" + required: false + - name: 'subscription_type' + in: query + type: string + description: "filter only subscriptions matching type" + required: false + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Subscription listing @@ -259,19 +255,19 @@ paths: $ref: "#/definitions/ApiErrorResponse" post: tags: - - Subscriptions + - Subscriptions x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.subscriptions operationId: add_subscription x-anchore-authz-action: createSubscription summary: Add a subscription of a specific type description: Create a new subscription to watch a tag and get notifications of changes parameters: - - name: subscription - in: body - required: true - schema: - $ref: "#/definitions/SubscriptionRequest" - - $ref: "#/parameters/AsAccountParameter" + - name: subscription + in: body + required: true + schema: + $ref: "#/definitions/SubscriptionRequest" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Subscription add success @@ -280,17 +276,17 @@ paths: /subscriptions/{subscriptionId}: get: tags: - - Subscriptions + - Subscriptions x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.subscriptions operationId: get_subscription x-anchore-authz-action: getSubscription summary: Get a specific subscription set parameters: - - name: subscriptionId - in: path - required: true - type: string - - $ref: "#/parameters/AsAccountParameter" + - name: subscriptionId + in: path + required: true + type: string + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Filtered subscription list by type @@ -302,22 +298,22 @@ paths: $ref: "#/definitions/ApiErrorResponse" put: tags: - - Subscriptions + - Subscriptions x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.subscriptions operationId: update_subscription x-anchore-authz-action: updateSubscription summary: Update an existing and specific subscription parameters: - - name: subscriptionId - in: path - required: true - type: string - - name: subscription - in: body - required: true - schema: - $ref: "#/definitions/SubscriptionUpdate" - - $ref: "#/parameters/AsAccountParameter" + - name: subscriptionId + in: path + required: true + type: string + - name: subscription + in: body + required: true + schema: + $ref: "#/definitions/SubscriptionUpdate" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Subscription add success @@ -325,17 +321,17 @@ paths: $ref: "#/definitions/SubscriptionList" delete: tags: - - Subscriptions + - Subscriptions x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.subscriptions operationId: delete_subscription x-anchore-authz-action: deleteSubscription summary: Delete subscriptions of a specific type parameters: - - name: subscriptionId - in: path - required: true - type: string - - $ref: "#/parameters/AsAccountParameter" + - name: subscriptionId + in: path + required: true + type: string + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Delete success @@ -346,14 +342,28 @@ paths: /summaries/imagetags: get: tags: - - Summaries + - Summaries x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: list_imagetags x-anchore-authz-action: listImages summary: List all visible image digests and tags description: List all image tags visible to the user parameters: - - $ref: "#/parameters/AsAccountParameter" + - name: 'image_status' + in: query + type: array + items: + type: string + enum: + - all + - active + - deleting + collectionFormat: csv + required: false + default: + - active + description: "Filter images in one or more states such as active, deleting. Defaults to active images only if unspecified" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: "successful operation" @@ -366,29 +376,29 @@ paths: /images: post: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: add_image x-anchore-authz-action: createImage summary: Submit a new image for analysis by the engine description: Creates a new analysis task that is executed asynchronously parameters: - - name: force - in: query - type: boolean - required: false - description: Override any existing entry in the system - - name: autosubscribe - in: query - type: boolean - required: false - description: Instruct engine to automatically begin watching the added tag for updates from registry - - name: image - required: true - in: body - schema: - $ref: "#/definitions/ImageAnalysisRequest" - - $ref: "#/parameters/AsAccountParameter" + - name: force + in: query + type: boolean + required: false + description: Override any existing entry in the system + - name: autosubscribe + in: query + type: boolean + required: false + description: Instruct engine to automatically begin watching the added tag for updates from registry + - name: image + required: true + in: body + schema: + $ref: "#/definitions/ImageAnalysisRequest" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Successfully added image to analysis queue @@ -400,30 +410,44 @@ paths: $ref: "#/definitions/ApiErrorResponse" get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: list_images x-anchore-authz-action: listImages summary: List all visible images description: List all images visible to the user parameters: - - name: history - in: query - type: boolean - required: false - description: Include image history in the response - - name: image_to_get - in: body - required: false - x-nullable: true - schema: - $ref: "#/definitions/ImageFilter" - - name: fulltag - in: query - required: false - type: string - description: "Full docker-pull string to filter results by (e.g. docker.io/library/nginx:latest, or myhost.com:5000/testimages:v1.1.1)" - - $ref: "#/parameters/AsAccountParameter" + - name: history + in: query + type: boolean + required: false + description: Include image history in the response + - name: fulltag + in: query + required: false + type: string + description: "Full docker-pull string to filter results by (e.g. docker.io/library/nginx:latest, or myhost.com:5000/testimages:v1.1.1)" + - name: image_status + in: query + required: false + type: string + description: Filter by image_status value on the record. Default if omitted is 'active'. + enum: + - all + - active + - deleting + default: active + - name: analysis_status + in: query + required: false + type: string + description: Filter by analysis_status value on the record. + enum: + - not_analyzed + - analyzed + - analyzing + - analysis_failed + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: "successful operation" @@ -433,14 +457,45 @@ paths: description: Internal Error schema: $ref: "#/definitions/ApiErrorResponse" + delete: + tags: + - Images + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + operationId: delete_images_async + x-anchore-authz-action: deleteImage + summary: Bulk mark images for deletion + description: Delete analysis for image digests in the list asynchronously + parameters: + - name: imageDigests + in: query + required: true + x-nullable: false + type: array + items: + type: string + collectionFormat: csv + - name: force + in: query + required: false + type: boolean + - $ref: "#/parameters/AsAccountParameter" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/DeleteImageResponseList" + 500: + description: Internal Error + schema: + $ref: "#/definitions/ApiErrorResponse" /import/images: post: tags: - - Import + - Import x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: import_image_archive x-anchore-authz-action: importImage - summary: Import an anchore image tar.gz archive file. + summary: Import an anchore image tar.gz archive file. This is a deprecated API replaced by the "/imports/images" route consumes: - multipart/form-data parameters: @@ -461,17 +516,17 @@ paths: /images/{imageDigest}: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image x-anchore-authz-action: getImage summary: Get image metadata parameters: - - name: imageDigest - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Image lookup success @@ -483,38 +538,40 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: delete_image x-anchore-authz-action: deleteImage summary: Delete an image analysis parameters: - - name: imageDigest - in: path - type: string - required: true - - name: force - in: query - required: false - type: boolean - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - name: force + in: query + required: false + type: boolean + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Image deletion success + schema: + $ref: "#/definitions/DeleteImageResponse" /images/by_id/{imageId}: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_by_imageId x-anchore-authz-action: getImage summary: Lookup image by docker imageId parameters: - - name: imageId - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Image lookup success @@ -526,24 +583,26 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: delete_image_by_imageId x-anchore-authz-action: deleteImage summary: Delete image by docker imageId parameters: - - name: imageId - in: path - type: string - required: true - - name: force - in: query - required: false - type: boolean - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - name: force + in: query + required: false + type: boolean + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Image deletion success + schema: + $ref: "#/definitions/DeleteImageResponse" 500: description: Internal error schema: @@ -551,38 +610,38 @@ paths: /images/{imageDigest}/check: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_policy_check x-anchore-authz-action: getImageEvaluation description: Get the policy evaluation for the given image summary: Check policy evaluation status for image parameters: - - name: imageDigest - in: path - type: string - required: true - - name: policyId - in: query - required: false - type: string - - name: tag - in: query - required: true - type: string - - name: detail - in: query - required: false - type: boolean - - name: history - in: query - required: false - type: boolean - - name: interactive - in: query - required: false - type: boolean - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - name: policyId + in: query + required: false + type: string + - name: tag + in: query + required: true + type: string + - name: detail + in: query + required: false + type: boolean + - name: history + in: query + required: false + type: boolean + - name: interactive + in: query + required: false + type: boolean + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Policy evaluation success @@ -595,34 +654,34 @@ paths: /images/by_id/{imageId}/check: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_policy_check_by_imageId x-anchore-authz-action: getImageEvaluation description: Get the policy evaluation for the given image summary: Check policy evaluation status for image parameters: - - name: imageId - in: path - type: string - required: true - - name: policyId - in: query - required: false - type: string - - name: tag - in: query - required: true - type: string - - name: detail - in: query - required: false - type: boolean - - name: history - in: query - required: false - type: boolean - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - name: policyId + in: query + required: false + type: string + - name: tag + in: query + required: true + type: string + - name: detail + in: query + required: false + type: boolean + - name: history + in: query + required: false + type: boolean + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Policy evaluation success @@ -635,17 +694,17 @@ paths: /images/{imageDigest}/vuln: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_vulnerability_types x-anchore-authz-action: getImage summary: Get vulnerability types parameters: - - name: imageDigest - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Vulnerability listing for the image @@ -654,9 +713,9 @@ paths: items: type: string enum: - - all - - os - - non-os + - all + - os + - non-os 500: description: Internal Error schema: @@ -664,29 +723,30 @@ paths: /images/{imageDigest}/vuln/{vtype}: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_vulnerabilities_by_type x-anchore-authz-action: getImage summary: Get vulnerabilities by type parameters: - - name: imageDigest - in: path - type: string - required: true - - name: vtype - in: path - type: string - required: true - - name: force_refresh - in: query - type: boolean - required: false - - name: vendor_only - in: query - type: boolean - required: false - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - name: vtype + in: path + type: string + required: true + - name: force_refresh + in: query + type: boolean + required: false + - name: vendor_only + in: query + type: boolean + required: false + description: Filter results to include only vulnerabilities that are not marked as invalid by upstream OS vendor data. When set to true, it will filter out all vulnerabilities where `will_not_fix` is False. If false all vulnerabilities are returned regardless of `will_not_fix` + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Vulnerability listing for the image @@ -699,17 +759,17 @@ paths: /images/by_id/{imageId}/vuln: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_vulnerability_types_by_imageId x-anchore-authz-action: getImage summary: Get vulnerability types parameters: - - name: imageId - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Vulnerability listing for the image @@ -718,9 +778,9 @@ paths: items: type: string enum: - - all - - os - - non-os + - all + - os + - non-os 500: description: Internal Error schema: @@ -728,21 +788,21 @@ paths: /images/by_id/{imageId}/vuln/{vtype}: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_vulnerabilities_by_type_imageId x-anchore-authz-action: getImage summary: Get vulnerabilities by type parameters: - - name: imageId - in: path - type: string - required: true - - name: vtype - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - name: vtype + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Vulnerability listing for the image @@ -755,17 +815,17 @@ paths: /images/{imageDigest}/content: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: list_image_content x-anchore-authz-action: getImage summary: List image content types parameters: - - name: imageDigest - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content listing for the image @@ -780,17 +840,17 @@ paths: /images/by_id/{imageId}/content: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: list_image_content_by_imageid x-anchore-authz-action: getImage summary: List image content types parameters: - - name: imageId - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -805,21 +865,21 @@ paths: /images/{imageDigest}/content/{ctype}: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_content_by_type x-anchore-authz-action: getImage summary: Get the content of an image by type parameters: - - name: imageDigest - in: path - type: string - required: true - - name: ctype - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - name: ctype + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -832,17 +892,17 @@ paths: /images/{imageDigest}/content/files: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_content_by_type_files x-anchore-authz-action: getImage summary: Get the content of an image by type files parameters: - - name: imageDigest - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -855,17 +915,17 @@ paths: /images/{imageDigest}/content/java: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_content_by_type_javapackage x-anchore-authz-action: getImage summary: Get the content of an image by type java parameters: - - name: imageDigest - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -875,24 +935,47 @@ paths: description: Internal error schema: $ref: "#/definitions/ApiErrorResponse" - /images/by_id/{imageId}/content/{ctype}: + /images/{imageDigest}/content/malware: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images - operationId: get_image_content_by_type_imageId + operationId: get_image_content_by_type_malware x-anchore-authz-action: getImage - summary: Get the content of an image by type + summary: Get the content of an image by type malware parameters: - - name: imageId - in: path - type: string - required: true - - name: ctype - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" + responses: + 200: + description: Content of specified type from the image + schema: + $ref: "#/definitions/ContentMalwareResponse" + 500: + description: Internal error + schema: + $ref: "#/definitions/ApiErrorResponse" + /images/by_id/{imageId}/content/{ctype}: + get: + tags: + - Images + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + operationId: get_image_content_by_type_imageId + x-anchore-authz-action: getImage + summary: Get the content of an image by type + parameters: + - name: imageId + in: path + type: string + required: true + - name: ctype + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -905,17 +988,17 @@ paths: /images/by_id/{imageId}/content/files: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_content_by_type_imageId_files x-anchore-authz-action: getImage summary: Get the content of an image by type files parameters: - - name: imageId - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -928,17 +1011,17 @@ paths: /images/by_id/{imageId}/content/java: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_content_by_type_imageId_javapackage x-anchore-authz-action: getImage summary: Get the content of an image by type java parameters: - - name: imageId - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageId + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Content of specified type from the image @@ -948,20 +1031,80 @@ paths: description: Internal error schema: $ref: "#/definitions/ApiErrorResponse" + /images/{imageDigest}/artifacts/retrieved_files: + get: + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + operationId: list_retrieved_files + x-anchore-authz-action: getImage + summary: Return a list of analyzer artifacts of the specified type + produces: + - application/json + parameters: + - name: imageDigest + in: path + type: string + required: true + responses: + 200: + description: "List of file metadata objects" + schema: + $ref: "#/definitions/RetrievedFileList" + 404: + description: "Image not found in this service" + /images/{imageDigest}/artifacts/file_content_search: + get: + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + operationId: list_file_content_search_results + x-anchore-authz-action: getImage + summary: Return a list of analyzer artifacts of the specified type + produces: + - application/json + parameters: + - name: imageDigest + in: path + type: string + required: true + responses: + 200: + description: "List of file metadata objects" + schema: + $ref: "#/definitions/FileContentSearchList" + 404: + description: "Image not found in this service" + /images/{imageDigest}/artifacts/secret_search: + get: + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images + operationId: list_secret_search_results + x-anchore-authz-action: getImage + summary: Return a list of analyzer artifacts of the specified type + produces: + - application/json + parameters: + - name: imageDigest + in: path + type: string + required: true + responses: + 200: + description: "List of file metadata objects" + schema: + $ref: "#/definitions/SecretSearchList" + 404: + description: "Image not found in this service" /images/{imageDigest}/metadata: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: list_image_metadata x-anchore-authz-action: getImage summary: List image metadata types parameters: - - name: imageDigest - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Metadata listing for the image @@ -976,21 +1119,21 @@ paths: /images/{imageDigest}/metadata/{mtype}: get: tags: - - Images + - Images x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.images operationId: get_image_metadata_by_type x-anchore-authz-action: getImage summary: Get the metadata of an image by type parameters: - - name: imageDigest - in: path - type: string - required: true - - name: mtype - in: path - type: string - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: imageDigest + in: path + type: string + required: true + - name: mtype + in: path + type: string + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Metadata of specified type from the image @@ -1003,28 +1146,28 @@ paths: /repositories: post: tags: - - Repository Credentials + - Repository Credentials summary: "Add repository to watch" description: "" operationId: add_repository x-anchore-authz-action: createRepository parameters: - - name: 'repository' - in: query - type: string - description: "full repository to add e.g. docker.io/library/alpine" - required: true - - name: 'autosubscribe' - in: query - type: boolean - description: "flag to enable/disable auto tag_update activation when new images from a repo are added" - required: false - - name: 'lookuptag' - in: query - type: string - description: "use specified existing tag to perform repo scan (default is 'latest')" - required: false - - $ref: "#/parameters/AsAccountParameter" + - name: 'repository' + in: query + type: string + description: "full repository to add e.g. docker.io/library/alpine" + required: true + - name: 'autosubscribe' + in: query + type: boolean + description: "flag to enable/disable auto tag_update activation when new images from a repo are added" + required: false + - name: 'dryrun' + in: query + type: boolean + description: "flag to return tags in the repository without actually watching the repository, default is false" + required: false + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Repository and discovered tags added @@ -1034,14 +1177,14 @@ paths: /registries: get: tags: - - Registries + - Registries x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.registries operationId: list_registries x-anchore-authz-action: listRegistries summary: List configured registries description: List all configured registries the system can/will watch parameters: - - $ref: "#/parameters/AsAccountParameter" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Registry listing @@ -1049,24 +1192,24 @@ paths: $ref: "#/definitions/RegistryConfigurationList" post: tags: - - Registries + - Registries x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.registries operationId: create_registry x-anchore-authz-action: createRegistry summary: Add a new registry description: Adds a new registry to the system parameters: - - name: 'validate' - in: query - type: boolean - description: "flag to determine whether or not to validate registry/credential at registry add time" - required: false - - name: registrydata - in: body - required: true - schema: - $ref: "#/definitions/RegistryConfigurationRequest" - - $ref: "#/parameters/AsAccountParameter" + - name: 'validate' + in: query + type: boolean + description: "flag to determine whether or not to validate registry/credential at registry add time" + required: false + - name: registrydata + in: body + required: true + schema: + $ref: "#/definitions/RegistryConfigurationRequest" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Saved registry configuration @@ -1079,19 +1222,19 @@ paths: /registries/{registry}: get: tags: - - Registries + - Registries x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.registries operationId: get_registry x-anchore-authz-action: getRegistry summary: Get a specific registry configuration description: Get information on a specific registry parameters: - - name: registry - in: path - required: true - type: string - format: path - - $ref: "#/parameters/AsAccountParameter" + - name: registry + in: path + required: true + type: string + format: path + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Registry configuration @@ -1099,29 +1242,29 @@ paths: $ref: "#/definitions/RegistryConfigurationList" put: tags: - - Registries + - Registries x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.registries operationId: update_registry x-anchore-authz-action: updateRegistry summary: Update/replace a registry configuration description: Replaces an existing registry record with the given record parameters: - - name: registry - in: path - required: true - type: string - format: path - - name: 'validate' - in: query - type: boolean - description: "flag to determine whether or not to validate registry/credential at registry update time" - required: false - - name: registrydata - in: body - required: true - schema: - $ref: "#/definitions/RegistryConfigurationRequest" - - $ref: "#/parameters/AsAccountParameter" + - name: registry + in: path + required: true + type: string + format: path + - name: 'validate' + in: query + type: boolean + description: "flag to determine whether or not to validate registry/credential at registry update time" + required: false + - name: registrydata + in: body + required: true + schema: + $ref: "#/definitions/RegistryConfigurationRequest" + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Updated registry configuration @@ -1133,19 +1276,19 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - Registries + - Registries x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.registries operationId: delete_registry x-anchore-authz-action: deleteRegistry summary: Delete a registry configuration description: Delete a registry configuration record from the system. Does not remove any images. parameters: - - name: registry - in: path - required: true - type: string - format: path - - $ref: "#/parameters/AsAccountParameter" + - name: registry + in: path + required: true + type: string + format: path + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Delete success @@ -1156,7 +1299,7 @@ paths: /status: get: tags: - - System + - System x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system operationId: get_status x-anchore-authz-action: None @@ -1174,7 +1317,7 @@ paths: /system: get: tags: - - System + - System x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system operationId: get_service_detail x-anchore-authz-action: None @@ -1192,9 +1335,9 @@ paths: /system/feeds: get: tags: - - System + - System summary: "list feeds operations and information" - description: "" + description: "Return a list of feed and their groups along with update and record count information. This data reflects the state of the policy engine, not the upstream feed service itself." operationId: "get_system_feeds" x-anchore-authz-action: listFeeds responses: @@ -1211,22 +1354,22 @@ paths: x-swagger-router-controller: "anchore_engine.services.apiext.api.controllers.system" post: tags: - - System + - System summary: "trigger feeds operations" - description: "" + description: "Execute a synchronous feed sync operation. The response will block until complete, then return the result summary." operationId: "post_system_feeds" x-anchore-authz-action: updateFeeds parameters: - - name: 'flush' - in: query - type: boolean - description: "instruct system to flush existing data feeds records from anchore-engine" - required: false - - name: 'sync' - in: query - type: boolean - description: "instruct system to re-sync data feeds" - required: false + - name: 'flush' + in: query + type: boolean + description: "instruct system to flush existing data feeds records from anchore-engine" + required: false + - name: 'sync' + in: query + type: boolean + description: "instruct system to re-sync data feeds" + required: false responses: 200: description: "Feeds operation success" @@ -1237,12 +1380,126 @@ paths: schema: $ref: "#/definitions/ApiErrorResponse" x-swagger-router-controller: "anchore_engine.services.apiext.api.controllers.system" - + /system/feeds/{feed}: + put: + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + operationId: toggle_feed_enabled + x-anchore-authz-action: updateFeeds + description: "Disable the feed so that it does not sync on subsequent sync operations" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: feed + in: path + required: true + type: string + - name: enabled + type: boolean + required: true + in: query + responses: + 200: + description: "FeedInfo" + schema: + $ref: "#/definitions/FeedMetadata" + 500: + description: "Internal server error processing the request. Retry expected" + 400: + description: "Bad request, fix and resend" + delete: + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + operationId: delete_feed + x-anchore-authz-action: updateFeeds + description: "Delete the groups and data for the feed and disable the feed itself" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: feed + in: path + required: true + type: string + responses: + 200: + description: "Successfully deleted" + 500: + description: "Internal server error processing the request. Retry expected" + 404: + description: "Not found" + /system/feeds/{feed}/{group}: + put: + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + x-anchore-authz-action: updateFeeds + operationId: toggle_group_enabled + description: "Disable a specific group within a feed to not sync" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: feed + in: path + required: true + type: string + - name: group + in: path + type: string + required: true + - name: enabled + type: boolean + required: true + in: query + responses: + 200: + description: "FeedInfo listing" + schema: + type: array + items: + $ref: "#/definitions/FeedMetadata" + 500: + description: "Internal server error processing the request. Retry expected" + 400: + description: "Bad request, fix and resend" + delete: + tags: + - System + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + operationId: delete_feed_group + x-anchore-authz-action: updateFeeds + description: "Delete the group data and disable the group itself" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: feed + in: path + required: true + type: string + - name: group + in: path + type: string + required: true + responses: + 200: + description: "Successfully deleted" + 500: + description: "Internal server error processing the request. Retry expected" + 404: + description: "Not found" /system/services: get: tags: - - System - - Services + - System x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system operationId: list_services x-anchore-authz-action: listServices @@ -1259,17 +1516,16 @@ paths: /system/services/{servicename}: get: tags: - - System - - Services + - System x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system operationId: get_services_by_name x-anchore-authz-action: getService summary: Get a service configuration and state parameters: - - name: servicename - in: path - type: string - required: true + - name: servicename + in: path + type: string + required: true responses: 200: description: Service Info @@ -1282,21 +1538,20 @@ paths: /system/services/{servicename}/{hostid}: get: tags: - - System - - Services + - System x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system operationId: get_services_by_name_and_host x-anchore-authz-action: getService summary: Get service config for a specific host parameters: - - name: servicename - in: path - type: string - required: true - - name: hostid - in: path - type: string - required: true + - name: servicename + in: path + type: string + required: true + - name: hostid + in: path + type: string + required: true responses: 200: description: Listing of registered services @@ -1308,21 +1563,20 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - System - - Services + - System x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system operationId: delete_service x-anchore-authz-action: deleteService summary: Delete the service config parameters: - - name: servicename - in: path - type: string - required: true - - name: hostid - in: path - type: string - required: true + - name: servicename + in: path + type: string + required: true + - name: hostid + in: path + type: string + required: true responses: 200: description: Delete success @@ -1337,8 +1591,7 @@ paths: operationId: describe_policy x-anchore-authz-action: None tags: - - System - - Policy + - System responses: 200: description: Policy Language Description @@ -1355,7 +1608,7 @@ paths: operationId: describe_error_codes x-anchore-authz-action: None tags: - - System + - System responses: 200: description: Error Codes Description @@ -1365,121 +1618,141 @@ paths: items: $ref: "#/definitions/AnchoreErrorCode" x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system - /events: + /event_types: get: tags: - - Events + - Events x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.events - operationId: list_events + operationId: list_event_types x-anchore-authz-action: listEvents - summary: List Events - description: Returns a paginated list of events in the descending order of their occurrence. Optional query parameters may be used for filtering results - parameters: - - name: source_servicename - in: query - type: string - description: Filter events by the originating service - required: false - - name: source_hostid - in: query - type: string - description: Filter events by the originating host ID - required: false - - name: resource_type - in: query - type: string - description: Filter events by the type of resource - tag, imageDigest, repository etc - required: false - - name: resource_id - in: query - type: string - description: Filter events by the id of the resource - required: false - - name: level - in: query - type: string - description: Filter events by the level - INFO or ERROR - required: false - - name: since - in: query - type: string - description: Return events that occurred after the timestamp - required: false - - name: before - in: query - type: string - description: Return events that occurred before the timestamp - required: false - - name: page - in: query - type: integer - description: Pagination controls - return the nth page of results. Defaults to first page if left empty - required: false - default: 1 - - name: limit - in: query - type: integer - description: Number of events in the result set. Defaults to 100 if left empty - required: false - default: 100 - - $ref: "#/parameters/AsAccountParameter" + summary: List Event Types + description: Returns list of event types in the category hierarchy responses: 200: - description: Paginated list of event records and the next token + description: List of event types schema: - $ref: "#/definitions/EventsList" - delete: + $ref: "#/definitions/EventTypesList" + /events: + get: tags: - - Events + - Events x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.events - operationId: delete_events - x-anchore-authz-action: deleteEvents - summary: Delete Events - description: Delete all or a subset of events filtered using the optional query parameters + operationId: list_events + x-anchore-authz-action: listEvents + summary: List Events + description: Returns a paginated list of events in the descending order of their occurrence. Optional query parameters may be used for filtering results parameters: - - name: before - in: query - type: string - description: Delete events that occurred before the timestamp - required: false - - name: since - in: query - type: string - description: Delete events that occurred after the timestamp - required: false - - name: level - in: query - type: string - description: Delete events that match the level - INFO or ERROR - required: false - - $ref: "#/parameters/AsAccountParameter" - responses: - 200: - description: List of deleted event IDs - schema: - type: array - items: - type: string - 500: - description: Internal Error + - name: source_servicename + in: query + type: string + description: Filter events by the originating service + required: false + - name: source_hostid + in: query + type: string + description: Filter events by the originating host ID + required: false + - name: event_type + in: query + type: string + description: Filter events by a prefix match on the event type (e.g. "user.image.") + required: false + pattern: '^[a-z0-9-_.*]+$' + - name: resource_type + in: query + type: string + description: Filter events by the type of resource - tag, imageDigest, repository etc + required: false + - name: resource_id + in: query + type: string + description: Filter events by the id of the resource + required: false + - name: level + in: query + type: string + description: Filter events by the level - INFO or ERROR + required: false + - name: since + in: query + type: string + description: Return events that occurred after the timestamp + required: false + - name: before + in: query + type: string + description: Return events that occurred before the timestamp + required: false + - name: page + in: query + type: integer + description: Pagination controls - return the nth page of results. Defaults to first page if left empty + required: false + default: 1 + - name: limit + in: query + type: integer + description: Number of events in the result set. Defaults to 100 if left empty + required: false + default: 100 + - $ref: "#/parameters/AsAccountParameter" + responses: + 200: + description: Paginated list of event records and the next token + schema: + $ref: "#/definitions/EventsList" + delete: + tags: + - Events + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.events + operationId: delete_events + x-anchore-authz-action: deleteEvents + summary: Delete Events + description: Delete all or a subset of events filtered using the optional query parameters + parameters: + - name: before + in: query + type: string + description: Delete events that occurred before the timestamp + required: false + - name: since + in: query + type: string + description: Delete events that occurred after the timestamp + required: false + - name: level + in: query + type: string + description: Delete events that match the level - INFO or ERROR + required: false + - $ref: "#/parameters/AsAccountParameter" + responses: + 200: + description: List of deleted event IDs + schema: + type: array + items: + type: string + 500: + description: Internal Error schema: $ref: "#/definitions/ApiErrorResponse" /events/{eventId}: get: tags: - - Events + - Events x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.events operationId: get_event x-anchore-authz-action: getEvent summary: Get Event description: Lookup an event by its event ID parameters: - - name: eventId - in: path - type: string - description: "Event ID of the event for lookup" - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: eventId + in: path + type: string + description: "Event ID of the event for lookup" + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Single event record @@ -1487,76 +1760,76 @@ paths: $ref: "#/definitions/EventResponse" delete: tags: - - Events + - Events x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.events operationId: delete_event x-anchore-authz-action: getEvent summary: Delete Event description: Delete an event by its event ID parameters: - - name: eventId - in: path - type: string - description: "Event ID of the event to be deleted" - required: true - - $ref: "#/parameters/AsAccountParameter" + - name: eventId + in: path + type: string + description: "Event ID of the event to be deleted" + required: true + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Delete success /query/images/by_vulnerability: get: tags: - - Vulnerabilities + - Query x-swagger-router-controller: "anchore_engine.services.apiext.api.controllers.query" operationId: query_images_by_vulnerability x-anchore-authz-action: listImages summary: List images vulnerable to the specific vulnerability ID. description: Returns a listing of images and their respective packages vulnerable to the given vulnerability ID parameters: - - name: vulnerability_id - in: query - required: true - type: string - description: The ID of the vulnerability to search for within all images stored in anchore-engine (e.g. CVE-1999-0001) - - name: namespace - in: query - description: Filter results to images within the given vulnerability namespace (e.g. debian:8, ubuntu:14.04) - required: false - type: string - - name: affected_package - in: query - description: Filter results to images with vulnable packages with the given package name (e.g. libssl) - required: false - type: string - - name: severity - in: query - description: Filter results to vulnerable package/vulnerability with the given severity - required: false - type: string - enum: - - Unknown - - Negligible - - Low - - Medium - - High - - Critical - - name: vendor_only - in: query - type: boolean - description: Filter results to include only vulnerabilities that are not marked as invalid by upstream OS vendor data - required: false - default: true - - name: page - in: query - description: The page of results to fetch. Pages start at 1 - required: false - type: integer - - name: limit - in: query - type: integer - description: Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page - required: false - - $ref: "#/parameters/AsAccountParameter" + - name: vulnerability_id + in: query + required: true + type: string + description: The ID of the vulnerability to search for within all images stored in anchore-engine (e.g. CVE-1999-0001) + - name: namespace + in: query + description: Filter results to images within the given vulnerability namespace (e.g. debian:8, ubuntu:14.04) + required: false + type: string + - name: affected_package + in: query + description: Filter results to images with vulnable packages with the given package name (e.g. libssl) + required: false + type: string + - name: severity + in: query + description: Filter results to vulnerable package/vulnerability with the given severity + required: false + type: string + enum: + - Unknown + - Negligible + - Low + - Medium + - High + - Critical + - name: vendor_only + in: query + type: boolean + description: Filter results to include only vulnerabilities that are not marked as invalid by upstream OS vendor data + required: false + default: true + - name: page + in: query + description: The page of results to fetch. Pages start at 1 + required: false + type: integer + - name: limit + in: query + type: integer + description: Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page + required: false + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Image lookup success @@ -1569,38 +1842,39 @@ paths: /query/images/by_package: get: tags: + - Query x-swagger-router-controller: "anchore_engine.services.apiext.api.controllers.query" operationId: query_images_by_package x-anchore-authz-action: listImages summary: List of images containing given package description: Filterable query interface to search for images containing specified package parameters: - - name: name - in: query - description: Name of package to search for (e.g. sed) - required: true - type: string - - name: package_type - in: query - description: Type of package to filter on (e.g. dpkg) - required: false - type: string - - name: version - in: query - description: Version of named package to filter on (e.g. 4.4-1) - required: false - type: string - - name: page - in: query - description: The page of results to fetch. Pages start at 1 - required: false - type: string - - name: limit - in: query - type: integer - description: Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page - required: false - - $ref: "#/parameters/AsAccountParameter" + - name: name + in: query + description: Name of package to search for (e.g. sed) + required: true + type: string + - name: package_type + in: query + description: Type of package to filter on (e.g. dpkg) + required: false + type: string + - name: version + in: query + description: Version of named package to filter on (e.g. 4.4-1) + required: false + type: string + - name: page + in: query + description: The page of results to fetch. Pages start at 1 + required: false + type: string + - name: limit + in: query + type: integer + description: Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page + required: false + - $ref: "#/parameters/AsAccountParameter" responses: 200: description: Image listing @@ -1613,39 +1887,48 @@ paths: /query/vulnerabilities: get: tags: - - Vulnerabilities + - Query x-swagger-router-controller: "anchore_engine.services.apiext.api.controllers.query" operationId: query_vulnerabilities x-anchore-authz-action: None summary: Listing information about given vulnerability description: List (w/filters) vulnerability records known by the system, with affected packages information if present parameters: - - name: id - in: query - required: true - type: string - description: The ID of the vulnerability (e.g. CVE-1999-0001) - - name: affected_package - in: query - description: Filter results by specified package name (e.g. sed) - required: false - type: string - - name: affected_package_version - in: query - description: Filter results by specified package version (e.g. 4.4-1) - required: false - type: string - - name: page - in: query - type: string - description: The page of results to fetch. Pages start at 1 - required: false - default: "1" - - name: limit - in: query - type: integer - description: Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page - required: false + - name: id + in: query + required: true + type: array + items: + type: string + description: The ID of the vulnerability (e.g. CVE-1999-0001) + - name: affected_package + in: query + description: Filter results by specified package name (e.g. sed) + required: false + type: string + - name: affected_package_version + in: query + description: Filter results by specified package version (e.g. 4.4-1) + required: false + type: string + - name: page + in: query + type: string + description: The page of results to fetch. Pages start at 1 + required: false + default: "1" + - name: limit + in: query + type: integer + description: Limit the number of records for the requested page. If omitted or set to 0, return all results in a single page + required: false + - name: namespace + in: query + type: array + items: + type: string + description: Namespace(s) to filter vulnerability records by + required: false responses: 200: description: Vulnerability listing paginated @@ -1664,15 +1947,15 @@ paths: x-anchore-authz-action: listAccounts summary: List user summaries. Only available to the system admin user. parameters: - - name: state - in: query - type: string - enum: - - active - - disabled - - deleting - required: false - description: Filter accounts by state + - name: state + in: query + type: string + enum: + - enabled + - disabled + - deleting + required: false + description: Filter accounts by state responses: 200: description: Accound summary listing @@ -1684,17 +1967,17 @@ paths: $ref: "#/definitions/ApiErrorResponse" post: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: create_account x-anchore-authz-action: createAccount summary: Create a new user. Only avaialble to admin user. parameters: - - name: account - in: body - required: true - schema: - $ref: "#/definitions/AccountCreationRequest" + - name: account + in: body + required: true + schema: + $ref: "#/definitions/AccountCreationRequest" responses: 200: description: Account Record @@ -1711,16 +1994,16 @@ paths: /accounts/{accountname}: get: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: get_account x-anchore-authz-action: getAccount summary: Get info about an user. Only available to admin user. Uses the main user Id, not a username. parameters: - - name: accountname - in: path - required: true - type: string + - name: accountname + in: path + required: true + type: string responses: 200: description: Get user information @@ -1732,16 +2015,16 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: delete_account x-anchore-authz-action: deleteAccount summary: Delete the specified account, only allowed if the account is in the disabled state. All users will be deleted along with the account and all resources will be garbage collected parameters: - - name: accountname - in: path - required: true - type: string + - name: accountname + in: path + required: true + type: string responses: 204: description: Successful deletion @@ -1752,21 +2035,21 @@ paths: /accounts/{accountname}/state: put: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: update_account_state x-anchore-authz-action: updateAccount summary: Update the state of an account to either enabled or disabled. For deletion use the DELETE route parameters: - - name: accountname - in: path - required: true - type: string - - name: desired_state - in: body - required: true - schema: - $ref: "#/definitions/AccountStatus" + - name: accountname + in: path + required: true + type: string + - name: desired_state + in: body + required: true + schema: + $ref: "#/definitions/AccountStatus" responses: 200: description: Updated state of the account @@ -1783,16 +2066,16 @@ paths: /accounts/{accountname}/users: get: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: list_users x-anchore-authz-action: listUsers summary: List accounts for the user parameters: - - name: accountname - in: path - type: string - required: true + - name: accountname + in: path + type: string + required: true responses: 200: description: User listing @@ -1807,21 +2090,21 @@ paths: $ref: "#/definitions/ApiErrorResponse" post: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: create_user x-anchore-authz-action: createUser summary: Create a new user parameters: - - name: accountname - in: path - type: string - required: true - - name: user - in: body - required: true - schema: - $ref: "#/definitions/UserCreationRequest" + - name: accountname + in: path + type: string + required: true + - name: user + in: body + required: true + schema: + $ref: "#/definitions/UserCreationRequest" responses: 200: description: Credential summary @@ -1830,20 +2113,20 @@ paths: /accounts/{accountname}/users/{username}: delete: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: delete_user x-anchore-authz-action: deleteUser summary: Delete a specific user credential by username of the credential. Cannot be the credential used to authenticate the request. parameters: - - name: accountname - type: string - in: path - required: true - - name: username - type: string - in: path - required: true + - name: accountname + type: string + in: path + required: true + - name: username + type: string + in: path + required: true responses: 204: description: Deleted credential @@ -1853,20 +2136,20 @@ paths: $ref: "#/definitions/ApiErrorResponse" get: tags: - - User Management + - User Management x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: get_account_user x-anchore-authz-action: getUser summary: Get a specific user in the specified account parameters: - - name: accountname - type: string - in: path - required: true - - name: username - type: string - in: path - required: true + - name: accountname + type: string + in: path + required: true + - name: username + type: string + in: path + required: true responses: 200: description: User record @@ -1879,17 +2162,17 @@ paths: /accounts/{accountname}/users/{username}/credentials: get: tags: - - User Management + - User Management summary: Get current credential summary parameters: - - name: accountname - in: path - type: string - required: true - - name: username - in: path - type: string - required: true + - name: accountname + in: path + type: string + required: true + - name: username + in: path + type: string + required: true responses: 200: description: User credential listing @@ -1904,25 +2187,25 @@ paths: x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts post: tags: - - User Management + - User Management operationId: create_user_credential x-anchore-authz-action: updateUser x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts summary: add/replace credential parameters: - - name: accountname - in: path - type: string - required: true - - name: username - in: path - type: string - required: true - - name: credential - in: body - required: true - schema: - $ref: "#/definitions/AccessCredential" + - name: accountname + in: path + type: string + required: true + - name: username + in: path + type: string + required: true + - name: credential + in: body + required: true + schema: + $ref: "#/definitions/AccessCredential" responses: 200: description: Add a credential, overwritting if already exists @@ -1934,26 +2217,26 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - User Management + - User Management summary: Delete a credential by type operationId: delete_user_credential x-anchore-authz-action: updateUser x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts parameters: - - name: accountname - in: path - type: string - required: true - - name: username - in: path - type: string - required: true - - name: credential_type - type: string - in: query - required: true - enum: - - password + - name: accountname + in: path + type: string + required: true + - name: username + in: path + type: string + required: true + - name: credential_type + type: string + in: query + required: true + enum: + - password responses: 204: description: Successful deletion @@ -1967,7 +2250,7 @@ paths: /account: get: tags: - - Identity + - Identity x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.accounts operationId: get_users_account x-anchore-authz-action: getAccount @@ -1984,7 +2267,7 @@ paths: /user: get: tags: - - Identity + - Identity x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.user operationId: get_user x-anchore-authz-action: None @@ -2001,7 +2284,7 @@ paths: /user/credentials: get: tags: - - Identity + - Identity summary: Get current credential summary operationId: get_credentials x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.user @@ -2017,17 +2300,17 @@ paths: $ref: "#/definitions/ApiErrorResponse" post: tags: - - Identity + - Identity summary: add/replace credential operationId: add_credential x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.user x-anchore-authz-action: None parameters: - - name: credential - in: body - required: true - schema: - $ref: "#/definitions/AccessCredential" + - name: credential + in: body + required: true + schema: + $ref: "#/definitions/AccessCredential" responses: 200: description: Add a credential, overwritting if already exists @@ -2041,7 +2324,7 @@ paths: /archives: get: tags: - - Archives + - Archives operationId: list_archives x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: listArchives @@ -2057,7 +2340,7 @@ paths: /archives/rules: get: tags: - - Archives + - Archives operationId: list_analysis_archive_rules x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: listArchiveTransitionRules @@ -2078,7 +2361,7 @@ paths: $ref: "#/definitions/ApiErrorResponse" post: tags: - - Archives + - Archives operationId: create_analysis_archive_rule x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: createArchiveTransitionRule @@ -2100,7 +2383,7 @@ paths: /archives/rules/{ruleId}: get: tags: - - Archives + - Archives operationId: get_analysis_archive_rule x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: getArchiveTransitionRule @@ -2120,7 +2403,7 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - Archives + - Archives operationId: delete_analysis_archive_rule x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: deleteArchiveTransitionRule @@ -2131,38 +2414,36 @@ paths: in: path responses: 200: - description: Archive transition rule - schema: - $ref: "#/definitions/AnalysisArchiveTransitionRule" + description: Analysis archive rule succesfuly deleted 500: description: Internal error schema: $ref: "#/definitions/ApiErrorResponse" -# /archives/rules/{ruleId}/history: -# get: -# tags: -# - Archives -# operationId: get_analysis_archive_rule_history -# x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive -# x-anchore-authz-action: getArchiveTransitionRuleHistory -# parameters: -# - name: ruleId -# type: string -# required: true -# in: path -# responses: -# 200: -# description: Archive transition rule history of actions -# schema: -# $ref: "#/definitions/AnalysisArchiveTransitionHistory" -# 500: -# description: Internal error -# schema: -# $ref: "#/definitions/ApiErrorResponse" + # /archives/rules/{ruleId}/history: + # get: + # tags: + # - Archives + # operationId: get_analysis_archive_rule_history + # x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive + # x-anchore-authz-action: getArchiveTransitionRuleHistory + # parameters: + # - name: ruleId + # type: string + # required: true + # in: path + # responses: + # 200: + # description: Archive transition rule history of actions + # schema: + # $ref: "#/definitions/AnalysisArchiveTransitionHistory" + # 500: + # description: Internal error + # schema: + # $ref: "#/definitions/ApiErrorResponse" /archives/images: get: tags: - - Archives + - Archives operationId: list_analysis_archive x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: listArchivedImageAnalysis @@ -2177,7 +2458,7 @@ paths: $ref: "#/definitions/ApiErrorResponse" post: tags: - - Archives + - Archives operationId: archive_image_analysis x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive x-anchore-authz-action: createArchivedImageAnalysis @@ -2199,7 +2480,7 @@ paths: /archives/images/{imageDigest}: get: tags: - - Archives + - Archives description: Returns the archive metadata record identifying the image and tags for the analysis in the archive. operationId: get_archived_analysis x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive @@ -2221,7 +2502,7 @@ paths: $ref: "#/definitions/ApiErrorResponse" delete: tags: - - Archives + - Archives description: Performs a synchronous archive deletion operationId: delete_archived_analysis x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.archive @@ -2237,9 +2518,7 @@ paths: type: boolean responses: 200: - description: ArchivdImageAnalysis record but with status 'deleted' - schema: - $ref: "#/definitions/ArchivedAnalysis" + description: ArchivdImageAnalysis successfully deleted 500: description: Internal error schema: @@ -2252,6 +2531,25 @@ paths: description: Request a jwt token for subsequent operations, this request is authenticated with normal HTTP auth consumes: - application/x-www-form-urlencoded + parameters: + - name: grant_type + in: formData + description: 'OAuth Grant type for token' + type: string + default: password + - name: username + in: formData + type: string + description: 'User to assign OAuth token to' + - name: password + in: formData + type: string + description: 'Password for corresponding user' + - name: client_id + in: formData + description: 'The type of client used for the OAuth token' + type: string + default: anonymous responses: 200: description: Resulting JWT token @@ -2261,17 +2559,382 @@ paths: description: Internal error schema: $ref: "#/definitions/ApiErrorResponse" -definitions: - PaginationProperties: - type: object - properties: - page: - type: string - description: The page number returned (should match the requested page query string param) - next_page: - type: string - description: True if additional pages exist (page + 1) or False if this is the last page - returned_count: + /system/webhooks/{webhook_type}/test: + post: + summary: Adds the capabilities to test a webhook delivery for the given notification type + description: Loads the Webhook configuration for webhook_type, and sends the notification out as a test + operationId: test_webhook + x-anchore-authz-action: None + tags: + - System + parameters: + - name: webhook_type + in: path + required: true + type: string + description: The Webhook Type that we should test + - name: notification_type + in: query + required: false + description: What kind of Notification to send + default: tag_update + type: string + enum: + - tag_update + - analysis_update + - vuln_update + - policy_eval + responses: + 200: + description: The Webhook was sent successfully. Schemas may be found under Models (PolicyEvalNotification, TagUpdateNotification, VulnUpdateNotification, AnalysisUpdateNotification) + 400: + description: The Webhook failed to send due to misconfiguration + schema: + $ref: "#/definitions/ApiErrorResponse" + 500: + description: The Webhook failed to send due to an Internal Error + schema: + $ref: "#/definitions/ApiErrorResponse" + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.system + /imports/images: + post: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: create_operation + x-anchore-authz-action: importImage + summary: "Begin the import of an image analyzed by Syft into the system" + produces: + - "application/json" + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportOperation" + 500: + description: "Internal Error" + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: list_operations + x-anchore-authz-action: importImage + summary: "Lists in-progress imports" + produces: + - "application/json" + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImports" + 500: + description: "Internal Error" + /imports/images/{operation_id}: + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: get_operation + x-anchore-authz-action: importImage + summary: "Get detail on a single import" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportOperation" + 500: + description: "Internal Error" + delete: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: invalidate_operation + x-anchore-authz-action: importImage + summary: "Invalidate operation ID so it can be garbage collected" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportOperation" + 500: + description: "Internal Error" + /imports/images/{operation_id}/packages: + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: list_import_packages + x-anchore-authz-action: importImage + summary: "List uploaded package manifests" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImportContentDigestList" + 500: + description: "Internal Error" + post: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: import_image_packages + x-anchore-authz-action: importImage + summary: "Begin the import of an image analyzed by Syft into the system" + produces: + - "application/json" + consumes: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + - name: sbom + in: body + required: true + schema: + $ref: "#/definitions/ImagePackageManifest" + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportContentResponse" + 500: + description: "Internal Error" + /imports/images/{operation_id}/dockerfile: + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: list_import_dockerfiles + x-anchore-authz-action: importImage + summary: "List uploaded dockerfiles" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImportContentDigestList" + 500: + description: "Internal Error" + post: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: import_image_dockerfile + x-anchore-authz-action: importImage + summary: "Begin the import of an image analyzed by Syft into the system" + produces: + - "application/json" + consumes: + - "text/plain; utf-8" + parameters: + - name: operation_id + in: path + type: string + required: true + - in: body + name: contents + required: true + schema: + type: string + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportContentResponse" + 500: + description: "Internal Error" + /imports/images/{operation_id}/manifest: + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: list_import_image_manifests + x-anchore-authz-action: importImage + summary: "List uploaded image manifests" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImportContentDigestList" + 500: + description: "Internal Error" + post: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: import_image_manifest + x-anchore-authz-action: importImage + summary: "Import a docker or OCI distribution manifest to associate with the image" + produces: + - "application/json" + consumes: + - "application/vnd.oci.image.manifest.v1+json" + - "application/vnd.docker.distribution.manifest.v2+json" + - "application/vnd.docker.distribution.manifest.v1+json" # Older Docker spec + - "application/vnd.docker.distribution.manifest.v1+prettyjws" # Signed version + parameters: + - name: operation_id + in: path + type: string + required: true + - in: body + name: contents + required: true + schema: + type: object + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportContentResponse" + 500: + description: "Internal Error" + /imports/images/{operation_id}/parent_manifest: + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: list_import_parent_manifests + x-anchore-authz-action: importImage + summary: "List uploaded parent manifests (manifest lists for a tag)" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImportContentDigestList" + 500: + description: "Internal Error" + post: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: import_image_parent_manifest + x-anchore-authz-action: importImage + summary: "Import a docker or OCI distribution manifest list to associate with the image" + produces: + - "application/json" + consumes: + - "application/vnd.docker.distribution.manifest.list.v2+json" + - "application/vnd.oci.image.index.v1+json" + parameters: + - name: operation_id + in: path + type: string + required: true + - in: body + name: contents + required: true + schema: + type: object + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportContentResponse" + 500: + description: "Internal Error" + /imports/images/{operation_id}/image_config: + get: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: list_import_image_configs + x-anchore-authz-action: importImage + summary: "List uploaded image configs" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImportContentDigestList" + 500: + description: "Internal Error" + post: + tags: + - Imports + x-swagger-router-controller: anchore_engine.services.apiext.api.controllers.image_imports + operationId: import_image_config + x-anchore-authz-action: importImage + summary: "Import a docker or OCI image config to associate with the image" + produces: + - "application/json" + parameters: + - name: operation_id + in: path + type: string + required: true + - in: body + name: contents + required: true + schema: + type: object + responses: + 200: + description: "success" + schema: + $ref: "#/definitions/ImageImportContentResponse" + 500: + description: "Internal Error" +definitions: + PaginationProperties: + type: object + properties: + page: + type: string + description: The page number returned (should match the requested page query string param) + next_page: + type: string + description: True if additional pages exist (page + 1) or False if this is the last page + returned_count: type: integer description: The number of items sent in this response description: Properties for common pagination handling to be included in any wrapping object that needs pagination elements @@ -2288,6 +2951,9 @@ definitions: type: type: string description: Package type (e.g. package, rpm, deb, apk, jar, npm, gem, ...) + will_not_fix: + type: boolean + description: Whether a vendor will or will not fix a vulnerabitlity description: A record of a software item which is vulnerable or carries a fix for a vulnerability VulnerablePackageReference: type: object @@ -2327,12 +2993,12 @@ definitions: type: string description: Severity label specific to the namepsace enum: - - Unknown - - Negligible - - Low - - Medium - - High - - Critical + - Unknown + - Negligible + - Low + - Medium + - High + - Critical link: type: string description: URL for the upstream CVE record in the reporting source (e.g. ubuntu security tracker) @@ -2340,7 +3006,29 @@ definitions: $ref: "#/definitions/NvdDataList" vendor_data: $ref: "#/definitions/VendorDataList" - description: A single vulnerability record in a single namespace, the unique key is the combinatino of the id and namespace + description: + type: string + description: Description of the vulnerability if available + references: + type: array + description: List of references including + items: + $ref: "#/definitions/VulnerabilityReference" + description: A single vulnerability record in a single namespace, the unique key is the combination of the id and namespace + VulnerabilityReference: + description: An external link/reference + type: object + properties: + source: + type: string + description: The reference source + tags: + type: array + items: + type: string + url: + type: string + description: The reference url ImageReference: type: object properties: @@ -2400,34 +3088,34 @@ definitions: description: An image record that contains packages PaginatedVulnerableImageList: allOf: - - $ref: '#/definitions/PaginationProperties' - - type: object - properties: - images: - type: array - items: - $ref: '#/definitions/VulnerableImage' + - $ref: '#/definitions/PaginationProperties' + - type: object + properties: + images: + type: array + items: + $ref: '#/definitions/VulnerableImage' description: Pagination wrapped list of images with vulnerabilties that match some filter PaginatedVulnerabilityList: allOf: - - $ref: '#/definitions/PaginationProperties' - - type: object - properties: - vulnerabilities: - type: array - description: The listing of matching vulnerabilities for the query subject to pagination - items: - $ref: '#/definitions/StandaloneVulnerability' + - $ref: '#/definitions/PaginationProperties' + - type: object + properties: + vulnerabilities: + type: array + description: The listing of matching vulnerabilities for the query subject to pagination + items: + $ref: '#/definitions/StandaloneVulnerability' description: A paginated listing of vulnerability records sorted by ID in descending order PaginatedImageList: allOf: - - $ref: '#/definitions/PaginationProperties' - - type: object - properties: - images: - type: array - items: - $ref: '#/definitions/ImageWithPackages' + - $ref: '#/definitions/PaginationProperties' + - type: object + properties: + images: + type: array + items: + $ref: '#/definitions/ImageWithPackages' description: Pagination wrapped list of images that match some filter ImageAnalysisRequest: type: object @@ -2465,7 +3153,10 @@ definitions: $ref: "#/definitions/RegistryDigestSource" archive: $ref: "#/definitions/AnalysisArchiveSource" + import: + $ref: "#/definitions/ImageImportManifest" RegistryTagSource: + x-nullable: True type: object description: An image reference using a tag in a registry, this is the most common source type. required: @@ -2479,19 +3170,19 @@ definitions: description: Base64 encoded content of the dockerfile used to build the image, if available. pattern: "^[a-zA-Z0-9+/=]+$" RegistryDigestSource: + x-nullable: True type: object description: An image reference using a digest in a registry, includes some extra tag and timestamp info in addition to the pull string to allow proper tag history reconstruction. required: - pullstring - tag - - creation_timestamp_override properties: pullstring: type: string description: A digest-based pullstring (e.g. docker.io/nginx@sha256:123abc) tag: type: string - description: A docker pull string (e.g. docker.io/nginx:latest, or docker.io/nginx@sha256:abd) to retrieve the image + description: A valid docker tag reference (e.g. docker.io/nginx:latest) that will be associated with the image but not used to pull the image. creation_timestamp_override: type: string format: date-time @@ -2501,6 +3192,7 @@ definitions: description: Base64 encoded content of the dockerfile used to build the image, if available. pattern: "^[a-zA-Z0-9+/=]+$" AnalysisArchiveSource: + x-nullable: True type: object description: An image reference in the analysis archive for the purposes of loading analysis from the archive into th working set required: @@ -2510,14 +3202,19 @@ definitions: type: string description: The image digest identify the analysis. Archived analyses are based on digest, tag records are restored as analysis is restored. pattern: "^sha256:[a-fA-F0-9]{64}$" + LocalAnalysisSource: + type: object + properties: + digest: + type: string PolicyBundle: description: A bundle containing a set of policies, whitelists, and rules for mapping them to specific images type: object required: - - id - - version - - policies - - mappings + - id + - version + - policies + - mappings properties: id: type: string @@ -2560,8 +3257,8 @@ definitions: type: object description: Identifies a specific gate and trigger match from a policy against an image and indicates it should be ignored in final policy decisions required: - - gate - - trigger_id + - gate + - trigger_id properties: id: type: string @@ -2569,13 +3266,17 @@ definitions: type: string trigger_id: type: string + expires_on: + type: string + format: "date-time" + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:\:\d+)?[A-Z]?$ PolicyRule: type: object description: A rule that defines and decision value if the match is found true for a given image. required: - - gate - - trigger - - action + - gate + - trigger + - action properties: id: type: string @@ -2585,16 +3286,16 @@ definitions: type: string action: enum: - - GO - - STOP - - WARN + - GO + - STOP + - WARN params: type: array items: type: object required: - - name - - value + - name + - value properties: name: type: string @@ -2604,8 +3305,8 @@ definitions: type: object description: A collection of whitelist items to match a policy evaluation against. required: - - id - - version + - id + - version properties: id: type: string @@ -2623,27 +3324,50 @@ definitions: type: object description: A reference to an image required: - - type - - value + - type + - value properties: type: enum: - - tag - - digest - - id + - tag + - digest + - id value: type: string - Policy: + DeleteImageResponse: type: object + description: Image deletion response containing status and details required: - - id - - version + - digest + - status properties: - id: + digest: type: string - name: + status: type: string - comment: + description: Current status of the image deletion + enum: + - not_found + - deleting + - delete_failed + detail: + type: string + DeleteImageResponseList: + type: array + description: A list of delete image responses + items: + $ref: "#/definitions/DeleteImageResponse" + Policy: + type: object + required: + - id + - version + properties: + id: + type: string + name: + type: string + comment: type: string version: type: string @@ -2654,10 +3378,10 @@ definitions: ImageSelectionRule: type: object required: - - "name" - - "registry" - - "repository" - - "image" + - "name" + - "registry" + - "repository" + - "image" properties: id: type: string @@ -2672,10 +3396,10 @@ definitions: MappingRule: type: object required: - - name - - registry - - repository - - image + - name + - registry + - repository + - image properties: id: type: string @@ -2738,10 +3462,10 @@ definitions: properties: created_at: type: string - format: "date-time" + format: date-time last_updated: type: string - format: "date-time" + format: date-time fulltag: description: "Full docker-pullable tag string referencing the image" type: string @@ -2787,6 +3511,8 @@ definitions: type: integer tag_detected_at: type: integer + image_status: + type: string AnchoreImage: description: A unique image in the engine. May have multiple tags or references. Unique to an image content across registries or repositories. type: object @@ -2800,10 +3526,10 @@ definitions: $ref: "#/definitions/ImageDetail" last_updated: type: string - format: "date-time" + format: date-time created_at: type: string - format: "date-time" + format: date-time imageDigest: type: string userId: @@ -2814,17 +3540,17 @@ definitions: type: string description: State of the image enum: - - active - - inactive - - disabled + - active + - inactive + - disabled analysis_status: type: string description: A state value for the current status of the analysis progress of the image enum: - - not_analyzed - - analyzing - - analyzed - - analysis_failed + - not_analyzed + - analyzing + - analyzed + - analysis_failed AnchoreImageList: description: A list of Anchore Images type: array @@ -2967,8 +3693,55 @@ definitions: type: string license: type: string + description: Deprecated in favor of the 'licenses' field" + licenses: + type: array + items: + type: string location: type: string + cpes: + type: array + items: + type: string + description: A list of Common Platform Enumerations that may uniquely identify the package + ContentMalwareResponse: + type: object + description: Malware listing response + properties: + imageDigest: + type: string + content_type: + type: string + content: + description: List of malware scan results, one per scanner configured to run + type: array + items: + $ref: '#/definitions/MalwareScan' + MalwareScan: + description: A single scan from a scanner + type: object + properties: + enabled: + type: boolean + description: Indicates if the scanner is enabled + scanner: + type: string + description: The name of the scanner that produced the finding + metadata: + type: object + description: Open schema for scanner-specific metadata related to the scan result + findings: + type: array + items: + type: object + properties: + path: + type: string + description: A path for a file in the image's rootfs + signature: + type: string + description: The malware signature found at the path ContentJAVAPackageResponse: type: object description: "Java package content listings from images" @@ -2996,6 +3769,11 @@ definitions: type: string origin: type: string + cpes: + type: array + items: + type: string + description: A list of Common Platform Enumerations that may uniquely identify the package MetadataResponse: type: object description: "Generic wrapper for metadata listings from images" @@ -3035,12 +3813,6 @@ definitions: x-nullable: True subscription_type: type: string - enum: - - policy_eval - - tag_update - - vuln_update - - repo_update - - analysis_update Subscription: description: Subscription entry type: object @@ -3051,12 +3823,6 @@ definitions: subscription_type: type: string description: The type of the subscription - enum: - - policy_eval - - tag_update - - vuln_update - - repo_update - - analysis_update subscription_value: type: string x-nullable: True @@ -3174,6 +3940,9 @@ definitions: package_path: type: string description: The location (if applicable) of the vulnerable package in the container filesystem + will_not_fix: + type: boolean + description: Whether a vendor will fix or not fix the vulnerability nvd_data: $ref: "#/definitions/NvdDataList" vendor_data: @@ -3279,9 +4048,9 @@ definitions: type: string description: State of the gate and transitively all triggers it contains if not 'active' enum: - - active - - deprecated - - eol + - active + - deprecated + - eol superceded_by: type: string x-nullable: True @@ -3305,9 +4074,9 @@ definitions: type: string description: State of the trigger enum: - - active - - deprecated - - eol + - active + - deprecated + - eol superceded_by: type: string x-nullable: True @@ -3333,9 +4102,9 @@ definitions: type: string description: State of the trigger parameter enum: - - active - - deprecated - - eol + - active + - deprecated + - eol superceded_by: type: string x-nullable: True @@ -3415,6 +4184,8 @@ definitions: type: string type: type: string + category: + type: string level: type: string message: @@ -3460,7 +4231,7 @@ definitions: type: object description: Account information required: - - name + - name properties: name: type: string @@ -3469,9 +4240,9 @@ definitions: type: string description: The user type (admin vs user). If not specified in a POST request, 'user' is default enum: - - user - - admin - - service + - user + - admin + - service state: type: string enum: @@ -3504,7 +4275,7 @@ definitions: type: object description: A username for authenticating with one or more types of credentials. User type defines the expected credentials allowed for the user. Native users have passwords, External users have no credential internally. Internal users are service/system users for inter-service communication. required: - - username + - username properties: username: description: The username to authenticate with @@ -3531,8 +4302,8 @@ definitions: type: object description: A payload for creating a new user, includes the username and password in a single request required: - - username - - password + - username + - password properties: username: description: The username to create @@ -3546,14 +4317,14 @@ definitions: type: object description: A login credential mapped to a user identity. For password credentials, the username to present for Basic auth is the user's username from the user record required: - - type - - value + - type + - value properties: type: description: The type of credential type: string enum: - - password + - password value: description: The credential value (e.g. the password) type: string @@ -3680,10 +4451,10 @@ definitions: description: The archival status type: string enum: - - archiving - - archived - - deleting - - deleted + - archiving + - archived + - deleting + - deleted image_detail: description: List of tags associated with the image digest type: array @@ -3714,6 +4485,9 @@ definitions: properties: selector: $ref: "#/definitions/ImageSelector" + rule_id: + type: string + description: Unique identifier for archive rule tag_versions_newer: type: integer description: Number of images mapped to the tag that are newer @@ -3735,6 +4509,21 @@ definitions: last_updated: type: string format: date-time + exclude: + $ref: "#/definitions/AnalysisArchiveTransitionRuleExclude" + max_images_per_account: + type: integer + description: This is the maximum number of image analyses an account can have. Can only be set on system_global rules + AnalysisArchiveTransitionRuleExclude: + type: object + description: Which Images to exclude from auto-archiving logic + properties: + selector: + $ref: "#/definitions/ImageSelector" + expiration_days: + type: integer + description: How long the image selected will be excluded from the archive transition + default: -1 AnalysisArchiveTransitionHistory: type: object description: A rule for auto-archiving image analysis by time and/or tag-history @@ -3824,3 +4613,523 @@ definitions: token: type: string description: The token content + RetrievedFile: + type: object + description: The retrieved file entry including content (b64 encoded) + properties: + path: + type: string + b64_content: + type: string + RetrievedFileList: + type: array + description: Simple array of RetrievedFileMetadata objects + items: + $ref: "#/definitions/RetrievedFile" + SecretSearchResult: + type: object + description: The retrieved file entry including content (b64 encoded) + properties: + path: + type: string + matches: + type: array + items: + $ref: "#/definitions/RegexContentMatch" + SecretSearchList: + type: array + description: Simple array of RetrievedFileMetadata objects + items: + $ref: "#/definitions/SecretSearchResult" + FileContentSearchResult: + type: object + description: The retrieved file entry including content (b64 encoded) + properties: + path: + type: string + matches: + type: array + items: + $ref: "#/definitions/RegexContentMatch" + FileContentSearchList: + type: array + description: Simple array of RetrievedFileMetadata objects + items: + $ref: "#/definitions/FileContentSearchResult" + RegexContentMatch: + type: object + description: Match of a named regex on a file + properties: + name: + type: string + description: The name associated with the regular expression + regex: + type: string + description: The regular expression used for the match + lines: + type: array + description: A list of line numbers in the file that matched the regex + items: + type: integer + EventTypesList: + type: array + description: Array of EventCategory objects + items: + $ref: "#/definitions/EventCategory" + EventCategory: + type: object + description: A collection of event subcategories + properties: + category: + type: string + description: + type: string + subcategories: + type: array + items: + $ref: "#/definitions/EventSubcategory" + EventSubcategory: + type: object + description: A collection of events related to each other + properties: + name: + type: string + description: + type: string + events: + type: array + items: + $ref: "#/definitions/EventDescription" + EventDescription: + type: object + description: A description of an event type + properties: + name: + type: string + description: The event type. The last component of the fully-qualified event_type (category.subcategory.event) + type: + type: string + description: The fully qualified event type as would be seen in the event payload + message: + type: string + description: The message associated with the event type + resource_type: + type: string + description: The type of resource this event is generated from + NotificationBase: + type: object + description: base object for Notifications (every notification has this basic structure) + properties: + queueId: + type: string + userId: + type: string + dataId: + type: string + created_at: + type: integer + last_updated: + type: integer + record_state_key: + type: string + default: "active" + record_state_val: + type: string + x-nullable: true + tries: + type: integer + max_tries: + type: integer + PolicyEvalNotification: + allOf: + - $ref: "#/definitions/NotificationBase" + - type: object + description: The Notification Object definition for Policy Eval Notifications + properties: + data: + $ref: "#/definitions/PolicyEvalNotificationData" + TagUpdateNotification: + allOf: + - $ref: "#/definitions/NotificationBase" + - type: object + description: The Notification Object definition for Tag Update Notifications + properties: + data: + $ref: "#/definitions/TagUpdateNotificationData" + VulnUpdateNotification: + allOf: + - $ref: "#/definitions/NotificationBase" + - type: object + description: The Notification Object definition for Tag Update Notifications + properties: + data: + $ref: "#/definitions/VulnUpdateNotificationData" + AnalysisUpdateNotification: + allOf: + - $ref: "#/definitions/NotificationBase" + - type: object + description: The Notification Object definition for Tag Update Notifications + properties: + data: + $ref: "#/definitions/AnalysisUpdateNotificationData" + BaseNotificationData: + type: object + description: Every notification has a payload, which follows this basic structure + properties: + notification_user: + type: string + notification_user_email: + type: string + notification_type: + type: string + PolicyEvalNotificationData: + allOf: + - $ref: "#/definitions/BaseNotificationData" + - type: object + properties: + notification_payload: + $ref: "#/definitions/PolicyEvalNotificationPayload" + TagUpdateNotificationData: + allOf: + - $ref: "#/definitions/BaseNotificationData" + - type: object + properties: + notification_payload: + $ref: "#/definitions/TagUpdateNotificationPayload" + VulnUpdateNotificationData: + allOf: + - $ref: "#/definitions/BaseNotificationData" + - type: object + properties: + notification_payload: + $ref: "#/definitions/VulnUpdateNotificationPayload" + AnalysisUpdateNotificationData: + allOf: + - $ref: "#/definitions/BaseNotificationData" + - type: object + properties: + notification_payload: + $ref: "#/definitions/AnalysisUpdateNotificationPayload" + GenericNotificationPayload: + type: object + description: Parent class for Notification Payloads + properties: + userId: + type: string + subscription_key: + type: string + subscription_type: + type: string + notificationId: + type: string + PolicyEvalNotificationPayload: + allOf: + - $ref: "#/definitions/GenericNotificationPayload" + - type: object + properties: + curr_eval: + type: object + description: The Current Policy Evaluation result + last_eval: + type: object + description: The Previous Policy Evaluation result + annotations: + type: object + description: List of Corresponding Image Annotations + x-nullable: true + TagUpdateNotificationPayload: + allOf: + - $ref: "#/definitions/GenericNotificationPayload" + - type: object + properties: + curr_eval: + type: array + items: {} + description: A list containing the current image digest + last_eval: + type: array + items: {} + description: A list containing the previous image digests + annotations: + type: object + description: List of Corresponding Image Annotations + x-nullable: true + VulnUpdateNotificationPayload: + allOf: + - $ref: "#/definitions/GenericNotificationPayload" + - type: object + properties: + diff_vulnerability_result: + $ref: "#/definitions/VulnDiffResult" + imageDigest: + type: string + annotations: + type: object + description: List of Corresponding Image Annotations + x-nullable: true + AnalysisUpdateNotificationPayload: + allOf: + - $ref: "#/definitions/GenericNotificationPayload" + - type: object + properties: + curr_eval: + $ref: "#/definitions/AnalysisUpdateEval" + last_eval: + $ref: "#/definitions/AnalysisUpdateEval" + annotations: + type: object + description: List of Corresponding Image Annotations + x-nullable: true + VulnDiffResult: + type: object + description: The results of the comparing two vulnerability records during an update + properties: + added: + type: array + items: {} + updated: + type: array + items: {} + removed: + type: array + items: {} + AnalysisUpdateEval: + type: object + description: Evaluation Results for an entity (current or last) + properties: + analysis_status: + type: string + annotations: + type: object + image_digest: + type: string + ImageImportOperation: + type: object + description: An import record, creating a unique identifier for referencing the operation as well as its state + properties: + uuid: + type: string + status: + type: string + enum: + - pending + - queued + - processing + - complete + - failed + - expired + expires_at: + type: string + format: date-time + created_at: + type: string + format: date-time + ImageImportContentResponse: + type: object + properties: + digest: + type: string + created_at: + type: string + format: date-time + ImageContentDeleteResponse: + type: object + ImageImportManifest: + x-nullable: True + type: object + properties: + contents: + $ref: "#/definitions/ImportContentDigests" + tags: + type: array + items: + type: string + description: Full docker reference tags + example: "docker.io/library/nginx:latest" + digest: + type: string + parent_digest: + type: string + description: The digest of the images's manifest-list parent if it was accessed from a multi-arch tag where the tag pointed to a manifest-list. This allows preservation of that relationship in the data + local_image_id: + type: string + description: An "imageId" as used by Docker if available + operation_uuid: + type: string + ImportContentDigests: + type: object + required: + - packages + - manifest + - image_config + description: Digest of content to use in the final import + properties: + packages: + type: string + description: Digest to use for the packages content + image_config: + type: string + description: Digest for reference content for image config + manifest: + type: string + description: Digest to reference content for the image manifest + parent_manifest: + type: string + description: Digest for reference content for parent manifest + dockerfile: + type: string + description: Digest for reference content for dockerfile + Annotations: + type: object + description: Simple key/value pairs where the value may be optional + ImageImports: + type: array + items: + $ref: "#/definitions/ImageImportOperation" + ImportContentDigestList: + type: array + items: + type: string + description: String digest of an uploaded content + ImagePackageManifest: + required: + - artifacts + - source + - distro + properties: + artifacts: + items: + "$ref": "#/definitions/ImportPackage" + type: array + source: + "$ref": "#/definitions/ImportSource" + distro: + "$ref": "#/definitions/ImportDistribution" + descriptor: + "$ref": "#/definitions/ImportDescriptor" + schema: + "$ref": "#/definitions/ImportSchema" + artifactRelationships: + items: + "$ref": "#/definitions/ImportPackageRelationship" + type: array + additionalProperties: true + type: object + ImportDescriptor: + required: + - name + - version + properties: + name: + type: string + version: + type: string + additionalProperties: true + type: object + ImportDistribution: + required: + - name + - version + - idLike + properties: + name: + type: string + version: + type: string + idLike: + type: string + additionalProperties: true + type: object + ImportPackageLocation: + required: + - path + properties: + path: + type: string + layerID: + type: string + additionalProperties: true + type: object + ImportPackage: + required: + - name + - version + - type + - locations + - licenses + - language + - cpes + - metadataType + properties: + id: + type: string + name: + type: string + version: + type: string + type: + type: string + foundBy: + type: string + locations: + items: + "$schema": http://json-schema.org/draft-04/schema# + "$ref": "#/definitions/ImportPackageLocation" + type: array + licenses: + items: + type: string + type: array + language: + type: string + cpes: + items: + type: string + type: array + purl: + type: string + metadataType: + type: string + metadata: + type: object + additionalProperties: true + type: object + ImportSchema: + required: + - version + - url + properties: + version: + type: string + url: + type: string + additionalProperties: true + type: object + ImportSource: + required: + - type + - target + properties: + type: + type: string + target: + additionalProperties: true + additionalProperties: true + type: object + ImportPackageRelationship: + required: + - parent + - child + - type + properties: + parent: + type: string + child: + type: string + type: + type: string + metadata: + additionalProperties: true + type: object + additionalProperties: true + type: object \ No newline at end of file diff --git a/cmd/pipeline/main.go b/cmd/pipeline/main.go index 7da3c83a05..989b143919 100644 --- a/cmd/pipeline/main.go +++ b/cmd/pipeline/main.go @@ -424,10 +424,23 @@ func main() { var group run.Group + url, _ := url.Parse(config.Cloudinfo.Endpoint) + if err != nil { + emperror.Panic(errors.WrapIf(err, "failed to parse Cloudinfo endpoint")) + } + cloudinfoClient := cloudinfo.NewClient(cloudinfoapi.NewAPIClient(&cloudinfoapi.Configuration{ - BasePath: config.Cloudinfo.Endpoint, + Host: url.Host, + Scheme: url.Scheme, DefaultHeader: make(map[string]string), UserAgent: fmt.Sprintf("Pipeline/%s", version), + Debug: true, + Servers: cloudinfoapi.ServerConfigurations{ + { + URL: url.Path, + }, + }, + OperationServers: map[string]cloudinfoapi.ServerConfigurations{}, })) azurePKEClusterStore := azurePKEAdapter.NewClusterStore(db, commonLogger) diff --git a/cmd/worker/main.go b/cmd/worker/main.go index 72747f570a..6bd49b6ba4 100644 --- a/cmd/worker/main.go +++ b/cmd/worker/main.go @@ -18,6 +18,7 @@ import ( "context" "encoding/base32" "fmt" + "net/url" "os" "syscall" "text/template" @@ -437,8 +438,14 @@ func main() { updateClusterStatusActivity := cluster.NewUpdateClusterStatusActivity(clusterManager) worker.RegisterActivityWithOptions(updateClusterStatusActivity.Execute, activity.RegisterOptions{Name: cluster.UpdateClusterStatusActivityName}) + url, _ := url.Parse(config.Cloudinfo.Endpoint) + if err != nil { + emperror.Panic(errors.WrapIf(err, "failed to parse Cloudinfo endpoint")) + } + cloudinfoClient := cloudinfoapi.NewAPIClient(&cloudinfoapi.Configuration{ - BasePath: config.Cloudinfo.Endpoint, + Host: url.Host, + Scheme: url.Scheme, DefaultHeader: make(map[string]string), UserAgent: fmt.Sprintf("Pipeline/%s", version), }) diff --git a/go.mod b/go.mod index e2917b564d..61d318d15d 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,6 @@ require ( github.com/MakeNowJust/heredoc v1.0.0 github.com/Masterminds/semver/v3 v3.1.1 github.com/ThreeDotsLabs/watermill v1.1.0 - github.com/antihax/optional v1.0.0 github.com/aokoli/goutils v1.1.0 github.com/asaskevich/EventBus v0.0.0-20180315140547-d46933a94f05 github.com/aws/aws-sdk-go v1.37.1 diff --git a/go.sum b/go.sum index 7f1ea339f0..7e15e0e65b 100644 --- a/go.sum +++ b/go.sum @@ -122,7 +122,6 @@ github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc82 github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5hodBMJ5+l/7J4xAyMeuM2PNuepvHlGs8yilUCA= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -178,7 +177,6 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNg github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.1.0 h1:jy4ghdcYvs5EIoGssZNslIASX5m+KNMfyyKvRQ0TEVE= github.com/aokoli/goutils v1.1.0/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= @@ -198,7 +196,6 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:o github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7/go.mod h1:LWMyo4iOLWXHGdBki7NIht1kHru/0wM179h+d3g8ATM= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.34.4/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= diff --git a/internal/anchore/zz_generated.mock_test.go b/internal/anchore/zz_generated.mock_test.go index c2a12c6563..33cc546543 100644 --- a/internal/anchore/zz_generated.mock_test.go +++ b/internal/anchore/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/frontend/notification/notificationdriver/zz_generated.endpoint.go b/internal/app/frontend/notification/notificationdriver/zz_generated.endpoint.go index 1cbf876329..3e6e5b75b8 100644 --- a/internal/app/frontend/notification/notificationdriver/zz_generated.endpoint.go +++ b/internal/app/frontend/notification/notificationdriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/frontend/notification/zz_generated.mock.go b/internal/app/frontend/notification/zz_generated.mock.go index 43050de356..df6ac525ac 100644 --- a/internal/app/frontend/notification/zz_generated.mock.go +++ b/internal/app/frontend/notification/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/frontend/notification/zz_generated.mock_test.go b/internal/app/frontend/notification/zz_generated.mock_test.go index 5ed709a935..ddfbdb1e7f 100644 --- a/internal/app/frontend/notification/zz_generated.mock_test.go +++ b/internal/app/frontend/notification/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/auth/token/tokendriver/zz_generated.endpoint.go b/internal/app/pipeline/auth/token/tokendriver/zz_generated.endpoint.go index 6dd67d3340..75fd000690 100644 --- a/internal/app/pipeline/auth/token/tokendriver/zz_generated.endpoint.go +++ b/internal/app/pipeline/auth/token/tokendriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/auth/token/tokendriver/zz_generated.mock_test.go b/internal/app/pipeline/auth/token/tokendriver/zz_generated.mock_test.go index dbe0bfee9d..5adcd50a7f 100644 --- a/internal/app/pipeline/auth/token/tokendriver/zz_generated.mock_test.go +++ b/internal/app/pipeline/auth/token/tokendriver/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/auth/token/zz_generated.mock.go b/internal/app/pipeline/auth/token/zz_generated.mock.go index 0d5afcb420..2c4b2a1371 100644 --- a/internal/app/pipeline/auth/token/zz_generated.mock.go +++ b/internal/app/pipeline/auth/token/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/auth/token/zz_generated.mock_test.go b/internal/app/pipeline/auth/token/zz_generated.mock_test.go index 61152cc193..6d6f5d5812 100644 --- a/internal/app/pipeline/auth/token/zz_generated.mock_test.go +++ b/internal/app/pipeline/auth/token/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/cloud/google/project/projectdriver/zz_generated.endpoint.go b/internal/app/pipeline/cloud/google/project/projectdriver/zz_generated.endpoint.go index 4089e0a4e9..989ad60920 100644 --- a/internal/app/pipeline/cloud/google/project/projectdriver/zz_generated.endpoint.go +++ b/internal/app/pipeline/cloud/google/project/projectdriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/cloud/google/project/zz_generated.mock.go b/internal/app/pipeline/cloud/google/project/zz_generated.mock.go index dd6409f253..64c12065c3 100644 --- a/internal/app/pipeline/cloud/google/project/zz_generated.mock.go +++ b/internal/app/pipeline/cloud/google/project/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/process/processdriver/zz_generated.endpoint.go b/internal/app/pipeline/process/processdriver/zz_generated.endpoint.go index 1da3a715f8..71f9e5e9b2 100644 --- a/internal/app/pipeline/process/processdriver/zz_generated.endpoint.go +++ b/internal/app/pipeline/process/processdriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/process/zz_generated.mock.go b/internal/app/pipeline/process/zz_generated.mock.go index 22323a4fca..b476ff4c39 100644 --- a/internal/app/pipeline/process/zz_generated.mock.go +++ b/internal/app/pipeline/process/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/secrettype/secrettypedriver/zz_generated.endpoint.go b/internal/app/pipeline/secrettype/secrettypedriver/zz_generated.endpoint.go index c4094dae66..eaf9b36b13 100644 --- a/internal/app/pipeline/secrettype/secrettypedriver/zz_generated.endpoint.go +++ b/internal/app/pipeline/secrettype/secrettypedriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/app/pipeline/secrettype/zz_generated.mock.go b/internal/app/pipeline/secrettype/zz_generated.mock.go index ec48ee8044..b90fc0cc85 100644 --- a/internal/app/pipeline/secrettype/zz_generated.mock.go +++ b/internal/app/pipeline/secrettype/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/clusteradapter/node_pool_labels.go b/internal/cluster/clusteradapter/node_pool_labels.go index b954c243b0..bf4677d25e 100644 --- a/internal/cluster/clusteradapter/node_pool_labels.go +++ b/internal/cluster/clusteradapter/node_pool_labels.go @@ -59,9 +59,9 @@ func (s cloudinfoNodePoolLabelSource) GetLabels( return nil, err } - labels := make(map[string]string, len(details.Attributes)) + labels := make(map[string]string, len(*details.Attributes)) - for key, value := range details.Attributes { + for key, value := range *details.Attributes { labels[nodePoolLabelKeyPrefix+labelFormatRe.ReplaceAllString(key, "_")] = labelFormatRe.ReplaceAllString(value, "_") } diff --git a/internal/cluster/clusterdriver/zz_generated.endpoint.go b/internal/cluster/clusterdriver/zz_generated.endpoint.go index 9b58f4c5b8..ee0c539359 100644 --- a/internal/cluster/clusterdriver/zz_generated.endpoint.go +++ b/internal/cluster/clusterdriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/clustersetup/zz_generated.mock_test.go b/internal/cluster/clustersetup/zz_generated.mock_test.go index 6fe76fd8ea..d920c66e9e 100644 --- a/internal/cluster/clustersetup/zz_generated.mock_test.go +++ b/internal/cluster/clustersetup/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock.go b/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock.go index 956b1a95e2..5668b20408 100644 --- a/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock.go +++ b/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock_test.go b/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock_test.go index 7cd6181a22..bbe77b6baf 100644 --- a/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock_test.go +++ b/internal/cluster/distribution/eks/eksprovider/workflow/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/eks/zz_generated.mock.go b/internal/cluster/distribution/eks/zz_generated.mock.go index e88cb75c55..11ad999c35 100644 --- a/internal/cluster/distribution/eks/zz_generated.mock.go +++ b/internal/cluster/distribution/eks/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/eks/zz_generated.mock_test.go b/internal/cluster/distribution/eks/zz_generated.mock_test.go index 8f1a566ce4..0bd3a57c67 100644 --- a/internal/cluster/distribution/eks/zz_generated.mock_test.go +++ b/internal/cluster/distribution/eks/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/BUILD.plz b/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/BUILD.plz index 93a276d3c1..ea75cbfc39 100644 --- a/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/BUILD.plz +++ b/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/BUILD.plz @@ -15,7 +15,6 @@ go_library( "//internal/providers/pke", "//third_party/go:emperror.dev__errors", "//third_party/go:github.com__Masterminds__semver__v3", - "//third_party/go:github.com__antihax__optional", "//third_party/go:github.com__jinzhu__gorm", "//third_party/go:go.uber.org__cadence__client", ], @@ -35,7 +34,6 @@ go_test( "//pkg/sdk/brn", "//third_party/go:emperror.dev__errors", "//third_party/go:github.com__Masterminds__semver__v3", - "//third_party/go:github.com__antihax__optional", "//third_party/go:github.com__jinzhu__gorm", "//third_party/go:github.com__stretchr__testify__mock", "//third_party/go:github.com__stretchr__testify__require", diff --git a/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/image_selector.go b/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/image_selector.go index 95e62f272e..b6e2385c66 100644 --- a/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/image_selector.go +++ b/internal/cluster/distribution/pke/pkeaws/pkeawsadapter/image_selector.go @@ -21,7 +21,6 @@ import ( "emperror.dev/errors" "github.com/Masterminds/semver/v3" - "github.com/antihax/optional" "github.com/banzaicloud/pipeline/.gen/cloudinfo" "github.com/banzaicloud/pipeline/internal/cluster/distribution/pke/pkeaws" @@ -59,28 +58,32 @@ func (s CloudinfoImageSelector) SelectImage(ctx context.Context, criteria pkeaws strings.HasPrefix(instanceType, "g3.") || strings.HasPrefix(instanceType, "g4.") } - opts := &cloudinfo.GetImagesOpts{ - Version: optional.NewString(kubeVersion.String()), - Os: optional.NewString(criteria.OperatingSystem), - PkeVersion: optional.NewString(criteria.PKEVersion), - LatestOnly: optional.NewString("true"), - Gpu: optional.NewString(strconv.FormatBool(isGPUInstance(criteria.InstanceType))), - Cr: optional.NewString(criteria.ContainerRuntime), - } - const ( cloudProvider = "amazon" serviceName = "pke" ) - images, _, err := s.client.ImagesApi.GetImages(ctx, cloudProvider, serviceName, criteria.Region, opts) + getImagesRequest := s.client.ImagesApi.GetImages(ctx, cloudProvider, serviceName, criteria.Region) + getImagesRequest.Version(kubeVersion.String()) + getImagesRequest.Os(criteria.OperatingSystem) + getImagesRequest.PkeVersion(criteria.PKEVersion) + getImagesRequest.LatestOnly("true") + getImagesRequest.Gpu(strconv.FormatBool(isGPUInstance(criteria.InstanceType))) + getImagesRequest.Cr(criteria.ContainerRuntime) + + images, _, err := s.client.ImagesApi.GetImagesExecute(getImagesRequest) if err != nil { return "", errors.WrapIfWithDetails( err, "get images from cloudinfo", "cloudProvider", cloudProvider, "service", serviceName, "region", criteria.Region, - "getImagesOpts", opts, + "version", kubeVersion.String(), + "os", criteria.OperatingSystem, + "PkeVersion", criteria.PKEVersion, + "LatestOnly", "true", + "Gpu", strconv.FormatBool(isGPUInstance(criteria.InstanceType)), + "Cr", criteria.ContainerRuntime, ) } if len(images) == 0 { @@ -89,22 +92,35 @@ func (s CloudinfoImageSelector) SelectImage(ctx context.Context, criteria pkeaws "cloudProvider", cloudProvider, "service", serviceName, "region", criteria.Region, - "getImagesOpts", opts, + "region", criteria.Region, + "version", kubeVersion.String(), + "os", criteria.OperatingSystem, + "PkeVersion", criteria.PKEVersion, + "LatestOnly", "true", + "Gpu", strconv.FormatBool(isGPUInstance(criteria.InstanceType)), + "Cr", criteria.ContainerRuntime, ) } // As a result of a bug in cloudinfo, // the returned item might be empty // See https://github.com/banzaicloud/cloudinfo/pull/356 - if images[0].Name == "" { + e := "" + if images[0].Name == &e { return "", errors.WithDetails( errors.WithStack(pkeaws.ImageNotFoundError), "cloudProvider", cloudProvider, "service", serviceName, "region", criteria.Region, - "getImagesOpts", opts, + "region", criteria.Region, + "version", kubeVersion.String(), + "os", criteria.OperatingSystem, + "PkeVersion", criteria.PKEVersion, + "LatestOnly", "true", + "Gpu", strconv.FormatBool(isGPUInstance(criteria.InstanceType)), + "Cr", criteria.ContainerRuntime, ) } - return images[0].Name, nil + return *images[0].Name, nil } diff --git a/internal/cluster/distribution/pke/pkeaws/pkeawsworkflow/zz_generated.mock_test.go b/internal/cluster/distribution/pke/pkeaws/pkeawsworkflow/zz_generated.mock_test.go index e6c7a688df..07619db408 100644 --- a/internal/cluster/distribution/pke/pkeaws/pkeawsworkflow/zz_generated.mock_test.go +++ b/internal/cluster/distribution/pke/pkeaws/pkeawsworkflow/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/pke/pkeaws/zz_generated.mock_test.go b/internal/cluster/distribution/pke/pkeaws/zz_generated.mock_test.go index f841a6f037..d5b7ea757a 100644 --- a/internal/cluster/distribution/pke/pkeaws/zz_generated.mock_test.go +++ b/internal/cluster/distribution/pke/pkeaws/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/pke/zz_generated.mock.go b/internal/cluster/distribution/pke/zz_generated.mock.go index da54da82c2..2a456b6c78 100644 --- a/internal/cluster/distribution/pke/zz_generated.mock.go +++ b/internal/cluster/distribution/pke/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/distribution/pke/zz_generated.mock_test.go b/internal/cluster/distribution/pke/zz_generated.mock_test.go index ab13455611..cf169e04c4 100644 --- a/internal/cluster/distribution/pke/zz_generated.mock_test.go +++ b/internal/cluster/distribution/pke/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/infrastructure/aws/awsworkflow/zz_generated.mock.go b/internal/cluster/infrastructure/aws/awsworkflow/zz_generated.mock.go index f935571d5d..b3d691b9fc 100644 --- a/internal/cluster/infrastructure/aws/awsworkflow/zz_generated.mock.go +++ b/internal/cluster/infrastructure/aws/awsworkflow/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/workflow/zz_generated.mock_test.go b/internal/cluster/workflow/zz_generated.mock_test.go index 1c2b864c47..4b79e94ff7 100644 --- a/internal/cluster/workflow/zz_generated.mock_test.go +++ b/internal/cluster/workflow/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/zz_generated.mock.go b/internal/cluster/zz_generated.mock.go index 12915346bd..d49c7841f2 100644 --- a/internal/cluster/zz_generated.mock.go +++ b/internal/cluster/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/cluster/zz_generated.mock_test.go b/internal/cluster/zz_generated.mock_test.go index 4582febb99..1ae32e4498 100644 --- a/internal/cluster/zz_generated.mock_test.go +++ b/internal/cluster/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/common/commonadapter/zz_generated.mock_test.go b/internal/common/commonadapter/zz_generated.mock_test.go index 016670663d..d698c1c981 100644 --- a/internal/common/commonadapter/zz_generated.mock_test.go +++ b/internal/common/commonadapter/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/helm/helmdriver/zz_generated.endpoint.go b/internal/helm/helmdriver/zz_generated.endpoint.go index 7d0a5dfcd9..6dd3a9f3c4 100644 --- a/internal/helm/helmdriver/zz_generated.endpoint.go +++ b/internal/helm/helmdriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/helm/zz_generated.mock_external_test.go b/internal/helm/zz_generated.mock_external_test.go index bea4c7f63f..40756c6eed 100644 --- a/internal/helm/zz_generated.mock_external_test.go +++ b/internal/helm/zz_generated.mock_external_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/helm/zz_generated.mock_test.go b/internal/helm/zz_generated.mock_test.go index 7f0db0dbec..e241eaccd8 100644 --- a/internal/helm/zz_generated.mock_test.go +++ b/internal/helm/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/integratedservices/integratedserviceadapter/zz_generated.mock.go b/internal/integratedservices/integratedserviceadapter/zz_generated.mock.go index 4d0e2a8cc9..011256d301 100644 --- a/internal/integratedservices/integratedserviceadapter/zz_generated.mock.go +++ b/internal/integratedservices/integratedserviceadapter/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/integratedservices/integratedservicesdriver/zz_generated.endpoint.go b/internal/integratedservices/integratedservicesdriver/zz_generated.endpoint.go index 0f780d126a..cd3c0de466 100644 --- a/internal/integratedservices/integratedservicesdriver/zz_generated.endpoint.go +++ b/internal/integratedservices/integratedservicesdriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/integratedservices/services/securityscan/SecretStore_test.go b/internal/integratedservices/services/securityscan/SecretStore_test.go index b730fd1164..7fab40304c 100644 --- a/internal/integratedservices/services/securityscan/SecretStore_test.go +++ b/internal/integratedservices/services/securityscan/SecretStore_test.go @@ -91,3 +91,18 @@ func (_m *SecretStore) GetSecretValues(ctx context.Context, secretID string) (ma return r0, r1 } + +type mockConstructorTestingTNewSecretStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewSecretStore creates a new instance of SecretStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSecretStore(t mockConstructorTestingTNewSecretStore) *SecretStore { + mock := &SecretStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/integratedservices/services/zz_generated.mock.go b/internal/integratedservices/services/zz_generated.mock.go index d43a1b8c42..17a5968aed 100644 --- a/internal/integratedservices/services/zz_generated.mock.go +++ b/internal/integratedservices/services/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/integratedservices/zz_generated.mock.go b/internal/integratedservices/zz_generated.mock.go index ec5986f745..5c0740deb0 100644 --- a/internal/integratedservices/zz_generated.mock.go +++ b/internal/integratedservices/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/integratedservices/zz_generated.mock_test.go b/internal/integratedservices/zz_generated.mock_test.go index e446b0bccd..90a9e22a61 100644 --- a/internal/integratedservices/zz_generated.mock_test.go +++ b/internal/integratedservices/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/internal/security/BUILD.plz b/internal/security/BUILD.plz index ad69e048ba..a612b26566 100644 --- a/internal/security/BUILD.plz +++ b/internal/security/BUILD.plz @@ -13,7 +13,6 @@ go_library( "//pkg/security", "//src/secret", "//third_party/go:emperror.dev__errors", - "//third_party/go:github.com__antihax__optional", "//third_party/go:github.com__banzaicloud__anchore-image-validator__pkg__apis__security__v1alpha1", "//third_party/go:gopkg.in__resty.v1", "//third_party/go:k8s.io__apimachinery__pkg__apis__meta__v1", diff --git a/internal/security/anchore_client.go b/internal/security/anchore_client.go index 38355235ef..50bf8e7021 100644 --- a/internal/security/anchore_client.go +++ b/internal/security/anchore_client.go @@ -19,10 +19,10 @@ import ( "crypto/tls" "encoding/json" "net/http" + "net/url" "regexp" "emperror.dev/errors" - "github.com/antihax/optional" "gopkg.in/resty.v1" "github.com/banzaicloud/pipeline/.gen/anchore" @@ -75,16 +75,26 @@ type AnchoreClient interface { type anchoreClient struct { userName string password string - endpoint string + host string + scheme string + path string logger common.Logger insecure bool } func NewAnchoreClient(userName string, password string, endpoint string, insecure bool, logger common.Logger) AnchoreClient { + url, err := url.Parse(endpoint) + if err != nil { + logger.Error("parsing Anchore endpoint failed") + return nil + } + return anchoreClient{ userName: userName, password: password, - endpoint: endpoint, + host: url.Host, + scheme: url.Scheme, + path: url.Path, logger: logger.WithFields(map[string]interface{}{"anchore-client": ""}), insecure: insecure, } @@ -94,11 +104,9 @@ func (a anchoreClient) CreateAccount(ctx context.Context, accountName string, em fnCtx := map[string]interface{}{"accountName": accountName, "email": email} a.logger.Info("creating anchore account", fnCtx) - _, resp, err := a.getRestClient().UserManagementApi.CreateAccount(a.authorizedContext(ctx), - anchore.AccountCreationRequest{ - Name: accountName, - Email: email, - }) + _, resp, err := a.getRestClient().UserManagementApi.CreateAccountExecute( + a.getRestClient().UserManagementApi.CreateAccount(a.authorizedContext(ctx)), + ) if err != nil || (resp.StatusCode != http.StatusOK) { a.logger.Debug("failed to create anchore account", fnCtx) @@ -114,11 +122,9 @@ func (a anchoreClient) CreateUser(ctx context.Context, accountName string, userN fnCtx := map[string]interface{}{"accountName": accountName, "userName": userName} a.logger.Info("creating anchore user", fnCtx) - _, resp, err := a.getRestClient().UserManagementApi.CreateUser(a.authorizedContext(ctx), - accountName, anchore.UserCreationRequest{ - Username: userName, - Password: password, - }) + _, resp, err := a.getRestClient().UserManagementApi.CreateUserExecute( + a.getRestClient().UserManagementApi.CreateUser(a.authorizedContext(ctx), accountName), + ) if err != nil || (resp.StatusCode != http.StatusOK) { a.logger.Debug("failed to create anchore user", fnCtx) @@ -134,7 +140,9 @@ func (a anchoreClient) GetUser(ctx context.Context, userName string) (interface{ fnCtx := map[string]interface{}{"userName": userName} a.logger.Info("retrieving anchore user", fnCtx) - usr, resp, err := a.getRestClient().UserManagementApi.GetAccountUser(a.authorizedContext(ctx), userName, userName) + usr, resp, err := a.getRestClient().UserManagementApi.GetAccountUserExecute( + a.getRestClient().UserManagementApi.GetAccountUser(a.authorizedContext(ctx), userName, userName), + ) if err != nil && resp == nil { // TODO: simplify error checking (openapi returns a generic error for 404 as well) a.logger.Debug("failed to retrieve user from anchore", fnCtx) @@ -159,7 +167,9 @@ func (a anchoreClient) GetUserCredentials(ctx context.Context, userName string) fnCtx := map[string]interface{}{"userName": userName} a.logger.Info("retrieving anchore credentials", fnCtx) - credentials, resp, err := a.getRestClient().UserManagementApi.ListUserCredentials(a.authorizedContext(ctx), userName, userName) + credentials, resp, err := a.getRestClient().UserManagementApi.ListUserCredentialsExecute( + a.getRestClient().UserManagementApi.ListUserCredentials(a.authorizedContext(ctx), userName, userName), + ) if err != nil || (resp.StatusCode != http.StatusOK) { a.logger.Debug("failed to retrieve user credentials from anchore", fnCtx) @@ -180,16 +190,25 @@ func (a anchoreClient) DeleteAccount(ctx context.Context, accountName string) er a.logger.Info("deleting anchore account", fnCtx) // update the status of the account before delete - s, ur, err := a.getRestClient().UserManagementApi.UpdateAccountState(a.authorizedContext(ctx), accountName, anchore.AccountStatus{State: "disabled"}) + var desiredState anchore.AccountStatus + disabled := "disabled" + desiredState.State = &disabled + + updateAccountRequest := a.getRestClient().UserManagementApi.UpdateAccountState(a.authorizedContext(ctx), accountName) + updateAccountRequest.DesiredState(desiredState) - if err != nil || ur.StatusCode != http.StatusOK || s.State != "disabled" { + s, ur, err := a.getRestClient().UserManagementApi.UpdateAccountStateExecute(updateAccountRequest) + + if err != nil || ur.StatusCode != http.StatusOK || *s.State != "disabled" { a.logger.Debug("failed to deactivate anchore account", fnCtx) return errors.WrapIfWithDetails(err, "failed to deactivate anchore account", fnCtx) } // delete the account upon successful disable - dr, err := a.getRestClient().UserManagementApi.DeleteAccount(a.authorizedContext(ctx), accountName) + dr, err := a.getRestClient().UserManagementApi.DeleteAccountExecute( + a.getRestClient().UserManagementApi.DeleteAccount(a.authorizedContext(ctx), accountName), + ) if err != nil || (dr.StatusCode != http.StatusOK && dr.StatusCode != http.StatusNoContent) { a.logger.Debug("failed to delete anchore account", fnCtx) @@ -204,7 +223,9 @@ func (a anchoreClient) GetAccount(ctx context.Context, accountName string) (stri fnCtx := map[string]interface{}{"accountName": accountName} a.logger.Info("retrieving anchore account", fnCtx) - acc, r, err := a.getRestClient().UserManagementApi.GetAccount(a.authorizedContext(ctx), accountName) + acc, r, err := a.getRestClient().UserManagementApi.GetAccountExecute( + a.getRestClient().UserManagementApi.GetAccount(a.authorizedContext(ctx), accountName), + ) if err != nil || r.StatusCode != http.StatusOK { a.logger.Debug("failed to get anchore account", fnCtx) @@ -219,7 +240,9 @@ func (a anchoreClient) DeleteUser(ctx context.Context, accountName string, userN fnCtx := map[string]interface{}{"accountName": accountName, "userName": userName} a.logger.Info("deleting anchore user", fnCtx) - r, err := a.getRestClient().UserManagementApi.DeleteUser(a.authorizedContext(ctx), accountName, userName) + r, err := a.getRestClient().UserManagementApi.DeleteUserExecute( + a.getRestClient().UserManagementApi.DeleteUser(a.authorizedContext(ctx), accountName, userName), + ) if err != nil || r.StatusCode != http.StatusNoContent { a.logger.Debug("failed to delete anchore user", fnCtx) @@ -234,20 +257,24 @@ func (a anchoreClient) ActivatePolicy(ctx context.Context, policyID string) erro fnCtx := map[string]interface{}{"policyId": policyID} a.logger.Info("activating anchore policy", fnCtx) - getOpts := &anchore.GetPolicyOpts{Detail: optional.NewBool(true)} + getPolicyRequest := a.getRestClient().PoliciesApi.GetPolicy(a.authorizedContext(ctx), policyID) + getPolicyRequest.Detail(true) - policyBundle, resp, err := a.getRestClient().PoliciesApi.GetPolicy(a.authorizedContext(ctx), policyID, getOpts) + policyBundle, resp, err := a.getRestClient().PoliciesApi.GetPolicyExecute(getPolicyRequest) if err != nil || (resp.StatusCode != http.StatusOK) { a.logger.Debug("failed to get anchore policy", fnCtx) return errors.WrapIfWithDetails(err, "failed to get anchore policy", fnCtx) } - policyBundle[0].Active = true + active := true + policyBundle[0].Active = &active - updateOpts := &anchore.UpdatePolicyOpts{Active: optional.NewBool(true)} + updatePolicyRequest := a.getRestClient().PoliciesApi.UpdatePolicy(a.authorizedContext(ctx), policyID) + updatePolicyRequest.Bundle(policyBundle[0]) + updatePolicyRequest.Active(true) - _, resp, err = a.getRestClient().PoliciesApi.UpdatePolicy(a.authorizedContext(ctx), policyID, policyBundle[0], updateOpts) + _, resp, err = a.getRestClient().PoliciesApi.UpdatePolicyExecute(updatePolicyRequest) if err != nil || (resp.StatusCode != http.StatusOK) { a.logger.Debug("failed to activate policy", fnCtx) @@ -273,7 +300,9 @@ func (a anchoreClient) CreatePolicy(ctx context.Context, policyRaw map[string]in return "", errors.WrapIfWithDetails(err, "failed to unmarshal policy", fnCtx) } - policyRecord, resp, err := a.getRestClient().PoliciesApi.AddPolicy(a.authorizedContext(ctx), policy, nil) + policyRecord, resp, err := a.getRestClient().PoliciesApi.AddPolicyExecute( + a.getRestClient().PoliciesApi.AddPolicy(a.authorizedContext(ctx)), + ) if err != nil || (resp.StatusCode != http.StatusOK) { a.logger.Debug("failed to create anchore policy", fnCtx) @@ -281,7 +310,7 @@ func (a anchoreClient) CreatePolicy(ctx context.Context, policyRaw map[string]in } a.logger.Info("anchore policy created", fnCtx) - return policyRecord.PolicyId, nil + return *policyRecord.PolicyId, nil } func (a anchoreClient) AddRegistry(ctx context.Context, registry Registry) error { @@ -297,18 +326,20 @@ func (a anchoreClient) AddRegistry(ctx context.Context, registry Registry) error } } - request := anchore.RegistryConfigurationRequest{ - Registry: registry.Registry, - RegistryName: registry.Registry, - RegistryUser: registry.Username, - RegistryPass: registry.Password, - RegistryType: registryType, - RegistryVerify: registry.Verify, + registryData := anchore.RegistryConfigurationRequest{ + Registry: ®istry.Registry, + RegistryName: ®istry.Registry, + RegistryUser: ®istry.Username, + RegistryPass: ®istry.Password, + RegistryType: ®istryType, + RegistryVerify: ®istry.Verify, } - opts := &anchore.CreateRegistryOpts{Validate: optional.NewBool(true)} + createRegistryRequest := a.getRestClient().RegistriesApi.CreateRegistry(a.authorizedContext(ctx)) + createRegistryRequest = createRegistryRequest.Registrydata(registryData) + createRegistryRequest = createRegistryRequest.Validate(true) - _, resp, err := a.getRestClient().RegistriesApi.CreateRegistry(a.authorizedContext(ctx), request, opts) + _, resp, err := a.getRestClient().RegistriesApi.CreateRegistryExecute(createRegistryRequest) if err != nil || resp.StatusCode != http.StatusOK { a.logger.Debug("failed to add anchore registry", fnCtx) @@ -325,8 +356,9 @@ func (a anchoreClient) GetRegistry(ctx context.Context, registryName string) ([] "registryName": registryName, }) - opts := &anchore.GetRegistryOpts{} - registry, resp, err := a.getRestClient().RegistriesApi.GetRegistry(a.authorizedContext(ctx), registryName, opts) + registry, resp, err := a.getRestClient().RegistriesApi.GetRegistryExecute( + a.getRestClient().RegistriesApi.GetRegistry(a.authorizedContext(ctx), registryName), + ) if err != nil || (resp.StatusCode != http.StatusOK) { return nil, errors.WrapIfWithDetails(err, "failed to get registry", registryName) @@ -357,8 +389,9 @@ func (a anchoreClient) DeleteRegistry(ctx context.Context, registry Registry) er fnCtx := map[string]interface{}{"registry": registry.Registry} a.logger.Info("deleting anchore registry", fnCtx) - opts := &anchore.DeleteRegistryOpts{} - resp, err := a.getRestClient().RegistriesApi.DeleteRegistry(a.authorizedContext(ctx), registry.Registry, opts) + resp, err := a.getRestClient().RegistriesApi.DeleteRegistryExecute( + a.getRestClient().RegistriesApi.DeleteRegistry(a.authorizedContext(ctx), registry.Registry), + ) if err != nil || resp.StatusCode != http.StatusOK { return errors.WrapIfWithDetails(err, "failed to delete anchore registry", fnCtx) } @@ -378,7 +411,8 @@ func (a anchoreClient) authorizedContext(ctx context.Context) context.Context { func (a anchoreClient) getRestClient() *anchore.APIClient { return anchore.NewAPIClient(&anchore.Configuration{ - BasePath: a.endpoint, + Host: a.host, + Scheme: a.scheme, DefaultHeader: make(map[string]string), UserAgent: "Pipeline/go", HTTPClient: &http.Client{ @@ -388,6 +422,12 @@ func (a anchoreClient) getRestClient() *anchore.APIClient { }, }, }, + Servers: anchore.ServerConfigurations{ + { + URL: a.path, + }, + }, + OperationServers: map[string]anchore.ServerConfigurations{}, }) } diff --git a/pkg/auth/zz_generated.mock_test.go b/pkg/auth/zz_generated.mock_test.go index 0cc9d05bd0..9d6541f284 100644 --- a/pkg/auth/zz_generated.mock_test.go +++ b/pkg/auth/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/pkg/cloudinfo/products.go b/pkg/cloudinfo/products.go index 785a17fbe0..e3592e9aa4 100644 --- a/pkg/cloudinfo/products.go +++ b/pkg/cloudinfo/products.go @@ -69,7 +69,9 @@ func (c *Client) GetProductDetails( } func (c *Client) warmProductCache(ctx context.Context, cloud string, service string, region string) error { - response, _, err := c.apiClient.ProductsApi.GetProducts(ctx, cloud, service, region) + response, _, err := c.apiClient.ProductsApi.GetProductsExecute( + c.apiClient.ProductsApi.GetProducts(ctx, cloud, service, region), + ) if err != nil { return errors.WithStack(err) } @@ -80,7 +82,7 @@ func (c *Client) warmProductCache(ctx context.Context, cloud string, service str cloud: cloud, service: service, region: region, - productType: product.Type, + productType: *product.Type, }, product, ) diff --git a/pkg/cloudinfo/services.go b/pkg/cloudinfo/services.go index b00420757b..9785276b54 100644 --- a/pkg/cloudinfo/services.go +++ b/pkg/cloudinfo/services.go @@ -22,7 +22,9 @@ import ( // GetServiceRegions returns the cloud provider regions where the specified service is available. func (c *Client) GetServiceRegions(ctx context.Context, cloudProvider string, service string) ([]string, error) { - regions, _, err := c.apiClient.RegionsApi.GetRegions(ctx, cloudProvider, service) + regions, _, err := c.apiClient.RegionsApi.GetRegionsExecute( + c.apiClient.RegionsApi.GetRegions(ctx, cloudProvider, service), + ) if err != nil { return nil, errors.WrapWithDetails( err, "could not get service availability regions", @@ -33,7 +35,7 @@ func (c *Client) GetServiceRegions(ctx context.Context, cloudProvider string, se regionIds := make([]string, len(regions)) for idx, region := range regions { - regionIds[idx] = region.Id + regionIds[idx] = *region.Id } return regionIds, nil diff --git a/pkg/kubernetes/zz_generated.mock.go b/pkg/kubernetes/zz_generated.mock.go index cb1e34c033..a5ebc23ed4 100644 --- a/pkg/kubernetes/zz_generated.mock.go +++ b/pkg/kubernetes/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/src/api/cluster/pke/pkeservice/pkeservicedriver/zz_generated.endpoint.go b/src/api/cluster/pke/pkeservice/pkeservicedriver/zz_generated.endpoint.go index d7831e525f..b01a568b34 100644 --- a/src/api/cluster/pke/pkeservice/pkeservicedriver/zz_generated.endpoint.go +++ b/src/api/cluster/pke/pkeservice/pkeservicedriver/zz_generated.endpoint.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/src/api/cluster/pke/pkeservice/zz_generated.mock.go b/src/api/cluster/pke/pkeservice/zz_generated.mock.go index cccee7fff5..e302916ca7 100644 --- a/src/api/cluster/pke/pkeservice/zz_generated.mock.go +++ b/src/api/cluster/pke/pkeservice/zz_generated.mock.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/src/api/cluster/pke/pkeservice/zz_generated.mock_test.go b/src/api/cluster/pke/pkeservice/zz_generated.mock_test.go index 4d39431feb..a3f0b41a31 100644 --- a/src/api/cluster/pke/pkeservice/zz_generated.mock_test.go +++ b/src/api/cluster/pke/pkeservice/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/src/api/cluster/pke_azure.go b/src/api/cluster/pke_azure.go index 44b286e62e..f057d873d1 100644 --- a/src/api/cluster/pke_azure.go +++ b/src/api/cluster/pke_azure.go @@ -23,7 +23,7 @@ import ( const PKEOnAzure = pke.PKEOnAzure -type CreatePKEOnAzureClusterRequest pipeline.CreatePkeOnAzureClusterRequest +type CreatePKEOnAzureClusterRequest pipeline.CreatePkeonAzureClusterRequest func (req CreatePKEOnAzureClusterRequest) ToAzurePKEClusterCreationParams(organizationID, userID uint) driver.ClusterCreationParams { var accessPoints pke.AccessPoints @@ -85,7 +85,7 @@ func clientPKEClusterHTTPProxyOptionsToPKEHTTPProxyOptions(o pipeline.PkeCluster } } -type UpdatePKEOnAzureClusterRequest pipeline.UpdatePkeOnAzureClusterRequest +type UpdatePKEOnAzureClusterRequest pipeline.UpdatePkeonAzureClusterRequest func (req UpdatePKEOnAzureClusterRequest) ToAzurePKEClusterUpdateParams(clusterID, userID uint) driver.ClusterUpdateParams { return driver.ClusterUpdateParams{ @@ -94,7 +94,7 @@ func (req UpdatePKEOnAzureClusterRequest) ToAzurePKEClusterUpdateParams(clusterI } } -func azureRequestToClusterNodepools(request []pipeline.PkeOnAzureNodePool, userID uint) []driver.NodePool { +func azureRequestToClusterNodepools(request []pipeline.PkeonAzureNodePool, userID uint) []driver.NodePool { nodepools := make([]driver.NodePool, len(request)) for i, node := range request { nodepools[i] = driver.NodePool{ diff --git a/src/api/cluster/pke_azure_test.go b/src/api/cluster/pke_azure_test.go index e1c124704d..092a3e5e17 100644 --- a/src/api/cluster/pke_azure_test.go +++ b/src/api/cluster/pke_azure_test.go @@ -41,11 +41,11 @@ const ( func TestToAzurePKEClusterCreationParams(t *testing.T) { var ( - Azuresubnet = pipeline.PkeOnAzureNodePoolSubnet{ + Azuresubnet = pipeline.PkeonAzureNodePoolSubnet{ Name: "test-subnet", Cidr: "1.1.1.1/16", } - Nodepool = pipeline.PkeOnAzureNodePool{ + Nodepool = pipeline.PkeonAzureNodePool{ Labels: nil, Name: "nodepool1", Roles: []string{"role"}, @@ -57,7 +57,7 @@ func TestToAzurePKEClusterCreationParams(t *testing.T) { MinCount: 1, MaxCount: 3, } - Azurenetwork = pipeline.PkeOnAzureClusterNetwork{ + Azurenetwork = pipeline.PkeonAzureClusterNetwork{ Name: "test-net", Cidr: "1.1.1.1/10", } @@ -96,7 +96,7 @@ func TestToAzurePKEClusterCreationParams(t *testing.T) { Type: PKEOnAzure, Location: Location, ResourceGroup: ResourceGroup, - Nodepools: []pipeline.PkeOnAzureNodePool{Nodepool}, + Nodepools: []pipeline.PkeonAzureNodePool{Nodepool}, Kubernetes: pipeline.CreatePkeClusterKubernetes{ Cri: cri, Network: network, diff --git a/src/api/cluster/pke_vsphere.go b/src/api/cluster/pke_vsphere.go index 0b42703e67..ffc1bfc781 100644 --- a/src/api/cluster/pke_vsphere.go +++ b/src/api/cluster/pke_vsphere.go @@ -24,7 +24,7 @@ import ( const PKEOnVsphere = pke.PKEOnVsphere -type CreatePKEOnVsphereClusterRequest pipeline.CreatePkeOnVsphereClusterRequest +type CreatePKEOnVsphereClusterRequest pipeline.CreatePkeonVsphereClusterRequest func (req CreatePKEOnVsphereClusterRequest) ToVspherePKEClusterCreationParams(organizationID, userID uint) driver.VspherePKEClusterCreationParams { storagetSecretID := req.StorageSecretId @@ -69,7 +69,7 @@ func (req CreatePKEOnVsphereClusterRequest) ToVspherePKEClusterCreationParams(or } } -type UpdatePKEOnVsphereClusterRequest pipeline.UpdatePkeOnVsphereClusterRequest +type UpdatePKEOnVsphereClusterRequest pipeline.UpdatePkeonVsphereClusterRequest func (req UpdatePKEOnVsphereClusterRequest) ToVspherePKEClusterUpdateParams(clusterID, userID uint) driver.VspherePKEClusterUpdateParams { return driver.VspherePKEClusterUpdateParams{ @@ -78,7 +78,7 @@ func (req UpdatePKEOnVsphereClusterRequest) ToVspherePKEClusterUpdateParams(clus } } -func vsphereRequestToClusterNodepools(request []pipeline.PkeOnVsphereNodePool, userID uint) []driver.NodePool { +func vsphereRequestToClusterNodepools(request []pipeline.PkeonVsphereNodePool, userID uint) []driver.NodePool { nodepools := make([]driver.NodePool, len(request)) for i, node := range request { nodepools[i] = driver.NodePool{ diff --git a/src/auth/zz_generated.event_dispatcher.go b/src/auth/zz_generated.event_dispatcher.go index 710320221b..fedb7c1bf7 100644 --- a/src/auth/zz_generated.event_dispatcher.go +++ b/src/auth/zz_generated.event_dispatcher.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/src/auth/zz_generated.mock_test.go b/src/auth/zz_generated.mock_test.go index a359de0ffb..22b6310702 100644 --- a/src/auth/zz_generated.mock_test.go +++ b/src/auth/zz_generated.mock_test.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // Code generated by mga tool. DO NOT EDIT. diff --git a/third_party/go/BUILD.plz b/third_party/go/BUILD.plz index 71d30a7b3a..a9bae9d9cf 100644 --- a/third_party/go/BUILD.plz +++ b/third_party/go/BUILD.plz @@ -854,22 +854,6 @@ go_module( deps = [], ) -go_mod_download( - name = "github.com__antihax__optional", - _tag = "download", - module = "github.com/antihax/optional", - version = "v1.0.0", -) - -go_module( - name = "github.com__antihax__optional", - download = ":_github.com__antihax__optional#download", - install = ["."], - module = "github.com/antihax/optional", - visibility = ["PUBLIC"], - deps = [], -) - go_mod_download( name = "github.com__aokoli__goutils", _tag = "download",