2016-12-03 09:42:26 +00:00
|
|
|
// +-------------------------------------------------------------------------
|
|
|
|
// | Copyright (C) 2016 Yunify, Inc.
|
|
|
|
// +-------------------------------------------------------------------------
|
|
|
|
// | Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// | you may not use this work except in compliance with the License.
|
|
|
|
// | You may obtain a copy of the License in the LICENSE file, or at:
|
|
|
|
// |
|
|
|
|
// | http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
// |
|
|
|
|
// | Unless required by applicable law or agreed to in writing, software
|
|
|
|
// | distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// | See the License for the specific language governing permissions and
|
|
|
|
// | limitations under the License.
|
|
|
|
// +-------------------------------------------------------------------------
|
|
|
|
|
2016-12-08 13:02:38 +00:00
|
|
|
package service
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/yunify/qingcloud-sdk-go/config"
|
|
|
|
"github.com/yunify/qingcloud-sdk-go/request"
|
|
|
|
"github.com/yunify/qingcloud-sdk-go/request/data"
|
2017-01-05 14:03:55 +00:00
|
|
|
"github.com/yunify/qingcloud-sdk-go/request/errors"
|
2016-12-03 09:42:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ fmt.State
|
|
|
|
var _ time.Time
|
|
|
|
|
|
|
|
type ImageService struct {
|
|
|
|
Config *config.Config
|
|
|
|
Properties *ImageServiceProperties
|
|
|
|
}
|
|
|
|
|
|
|
|
type ImageServiceProperties struct {
|
|
|
|
// QingCloud Zone ID
|
2017-01-05 14:03:55 +00:00
|
|
|
Zone *string `json:"zone" name:"zone"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *QingCloudService) Image(zone string) (*ImageService, error) {
|
|
|
|
properties := &ImageServiceProperties{
|
2017-01-05 14:03:55 +00:00
|
|
|
Zone: &zone,
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return &ImageService{Config: s.Config, Properties: properties}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/capture_instance.html
|
|
|
|
func (s *ImageService) CaptureInstance(i *CaptureInstanceInput) (*CaptureInstanceOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &CaptureInstanceInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "CaptureInstance",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &CaptureInstanceOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type CaptureInstanceInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
ImageName *string `json:"image_name" name:"image_name" location:"params"`
|
|
|
|
Instance *string `json:"instance" name:"instance" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *CaptureInstanceInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Instance == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Instance",
|
|
|
|
ParentName: "CaptureInstanceInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type CaptureInstanceOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
ImageID *string `json:"image_id" name:"image_id" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/delete_images.html
|
|
|
|
func (s *ImageService) DeleteImages(i *DeleteImagesInput) (*DeleteImagesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteImagesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteImages",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteImagesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteImagesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Images []*string `json:"images" name:"images" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteImagesInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.Images) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Images",
|
|
|
|
ParentName: "DeleteImagesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteImagesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/describe-image-users.html
|
|
|
|
func (s *ImageService) DescribeImageUsers(i *DescribeImageUsersInput) (*DescribeImageUsersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeImageUsersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeImageUsers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeImageUsersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeImageUsersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
ImageID *string `json:"image_id" name:"image_id" location:"params"` // Required
|
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeImageUsersInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.ImageID == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "ImageID",
|
|
|
|
ParentName: "DescribeImageUsersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeImageUsersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
ImageUserSet []*ImageUser `json:"image_user_set" name:"image_user_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/describe_images.html
|
|
|
|
func (s *ImageService) DescribeImages(i *DescribeImagesInput) (*DescribeImagesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeImagesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeImages",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeImagesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeImagesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Images []*string `json:"images" name:"images" location:"params"`
|
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
|
|
|
OSFamily *string `json:"os_family" name:"os_family" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
// ProcessorType's available values: 64bit, 32bit
|
2017-01-05 14:03:55 +00:00
|
|
|
ProcessorType *string `json:"processor_type" name:"processor_type" location:"params"`
|
2019-07-14 02:27:58 +00:00
|
|
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
// Provider's available values: system, self
|
2017-01-05 14:03:55 +00:00
|
|
|
Provider *string `json:"provider" name:"provider" location:"params"`
|
|
|
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
|
|
|
Status []*string `json:"status" name:"status" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
// Verbose's available values: 0
|
2017-01-05 14:03:55 +00:00
|
|
|
Verbose *int `json:"verbose" name:"verbose" default:"0" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
// Visibility's available values: public, private
|
2017-01-05 14:03:55 +00:00
|
|
|
Visibility *string `json:"visibility" name:"visibility" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeImagesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.ProcessorType != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
processorTypeValidValues := []string{"64bit", "32bit"}
|
2017-01-05 14:03:55 +00:00
|
|
|
processorTypeParameterValue := fmt.Sprint(*v.ProcessorType)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
processorTypeIsValid := false
|
|
|
|
for _, value := range processorTypeValidValues {
|
|
|
|
if value == processorTypeParameterValue {
|
|
|
|
processorTypeIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !processorTypeIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "ProcessorType",
|
|
|
|
ParameterValue: processorTypeParameterValue,
|
|
|
|
AllowedValues: processorTypeValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Provider != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
providerValidValues := []string{"system", "self"}
|
2017-01-05 14:03:55 +00:00
|
|
|
providerParameterValue := fmt.Sprint(*v.Provider)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
providerIsValid := false
|
|
|
|
for _, value := range providerValidValues {
|
|
|
|
if value == providerParameterValue {
|
|
|
|
providerIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !providerIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Provider",
|
|
|
|
ParameterValue: providerParameterValue,
|
|
|
|
AllowedValues: providerValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Verbose != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
verboseValidValues := []string{"0"}
|
2017-01-05 14:03:55 +00:00
|
|
|
verboseParameterValue := fmt.Sprint(*v.Verbose)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
verboseIsValid := false
|
|
|
|
for _, value := range verboseValidValues {
|
|
|
|
if value == verboseParameterValue {
|
|
|
|
verboseIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !verboseIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Verbose",
|
|
|
|
ParameterValue: verboseParameterValue,
|
|
|
|
AllowedValues: verboseValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Visibility != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
visibilityValidValues := []string{"public", "private"}
|
2017-01-05 14:03:55 +00:00
|
|
|
visibilityParameterValue := fmt.Sprint(*v.Visibility)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
visibilityIsValid := false
|
|
|
|
for _, value := range visibilityValidValues {
|
|
|
|
if value == visibilityParameterValue {
|
|
|
|
visibilityIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !visibilityIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Visibility",
|
|
|
|
ParameterValue: visibilityParameterValue,
|
|
|
|
AllowedValues: visibilityValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeImagesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
ImageSet []*Image `json:"image_set" name:"image_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/grant-image-to-users.html
|
|
|
|
func (s *ImageService) GrantImageToUsers(i *GrantImageToUsersInput) (*GrantImageToUsersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &GrantImageToUsersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "GrantImageToUsers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &GrantImageToUsersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type GrantImageToUsersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Image *string `json:"image" name:"image" location:"params"` // Required
|
|
|
|
Users []*string `json:"users" name:"users" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *GrantImageToUsersInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Image == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Image",
|
|
|
|
ParentName: "GrantImageToUsersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(v.Users) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Users",
|
|
|
|
ParentName: "GrantImageToUsersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type GrantImageToUsersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/modify_image_attributes.html
|
|
|
|
func (s *ImageService) ModifyImageAttributes(i *ModifyImageAttributesInput) (*ModifyImageAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyImageAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyImageAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyImageAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyImageAttributesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Description *string `json:"description" name:"description" location:"params"`
|
|
|
|
Image *string `json:"image" name:"image" location:"params"` // Required
|
|
|
|
ImageName *string `json:"image_name" name:"image_name" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyImageAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Image == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Image",
|
|
|
|
ParentName: "ModifyImageAttributesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyImageAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
ImageID *string `json:"image_id" name:"image_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/image/revoke-image-from-users.html
|
|
|
|
func (s *ImageService) RevokeImageFromUsers(i *RevokeImageFromUsersInput) (*RevokeImageFromUsersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &RevokeImageFromUsersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "RevokeImageFromUsers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &RevokeImageFromUsersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type RevokeImageFromUsersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Image *string `json:"image" name:"image" location:"params"` // Required
|
|
|
|
Users []*string `json:"users" name:"users" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *RevokeImageFromUsersInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Image == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Image",
|
|
|
|
ParentName: "RevokeImageFromUsersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(v.Users) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Users",
|
|
|
|
ParentName: "RevokeImageFromUsersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type RevokeImageFromUsersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|