// Get the introduced_SRs field of the given DR_task.
546984
func (_class DRTaskClass) GetIntroducedSRs(sessionID SessionRef, self DRTaskRef) (_retval []SRRef, _err error) {
	_method := "DR_task.get_introduced_SRs"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertDRTaskRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertSRRefSetToGo(_method + " -> ", _result.Value)
	return
}
368404
func (_class DRTaskClass) Create(sessionID SessionRef, atype string, deviceConfig map[string]string, whitelist []string) (_retval DRTaskRef, _err error) {
	_method := "DR_task.create"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_atypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "type"), atype)
	if _err != nil {
		return
	}
	_deviceConfigArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "device_config"), deviceConfig)
	if _err != nil {
		return
	}
	_whitelistArg, _err := convertStringSetToXen(fmt.Sprintf("%s(%s)", _method, "whitelist"), whitelist)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _atypeArg, _deviceConfigArg, _whitelistArg)
	if _err != nil {
		return
	}
	_retval, _err = convertDRTaskRefToGo(_method + " -> ", _result.Value)
	return
}
976364
func (_class DRTaskClass) GetAllRecords(sessionID SessionRef) (_retval map[DRTaskRef]DRTaskRecord, _err error) {
	_method := "DR_task.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertDRTaskRefToDRTaskRecordMapToGo(_method + " -> ", _result.Value)
	return
}
136355
func (obj *GenericDimension) GetLinkedObjectsRaw(ctx context.Context) (json.RawMessage, error) {
	result := &struct {
		Items json.RawMessage	`json:"qItems"`
	} {}
	err := obj.rpc(ctx, "GetLinkedObjects", result)
	return result.Items, err 
}
105069
func (obj *Doc) GetFieldDescriptionRaw(ctx context.Context, fieldName string) (json.RawMessage, error) {
	result := &struct {
		Return json.RawMessage	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "GetFieldDescription", result, ensureEncodable(fieldName))
	return result.Return, err 
}
1185886
func (_class SRClass) Introduce(sessionID SessionRef, uuid string, nameLabel string, nameDescription string, atype string, contentType string, shared bool, smConfig map[string]string) (_retval SRRef, _err error) {
	_method := "SR.introduce"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_uuidArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "uuid"), uuid)
	if _err != nil {
		return
	}
	_nameLabelArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name_label"), nameLabel)
	if _err != nil {
		return
	}
	_nameDescriptionArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name_description"), nameDescription)
	if _err != nil {
		return
	}
	_atypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "type"), atype)
	if _err != nil {
		return
	}
	_contentTypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "content_type"), contentType)
	if _err != nil {
		return
	}
	_sharedArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "shared"), shared)
	if _err != nil {
		return
	}
	_smConfigArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "sm_config"), smConfig)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _uuidArg, _nameLabelArg, _nameDescriptionArg, _atypeArg, _contentTypeArg, _sharedArg, _smConfigArg)
	if _err != nil {
		return
	}
	_retval, _err = convertSRRefToGo(_method + " -> ", _result.Value)
	return
}
657378
func (t *Template) GetAWSRedshiftClusterWithName(name string) (*resources.AWSRedshiftCluster, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSRedshiftCluster:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSRedshiftCluster not found", name)
}
665970
func (t *Template) GetAWSServiceDiscoveryServiceWithName(name string) (*resources.AWSServiceDiscoveryService, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSServiceDiscoveryService:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSServiceDiscoveryService not found", name)
}
159330
func (obj *Global) GetActiveDoc(ctx context.Context) (*Doc, error) {
	result := &struct {
		Return *ObjectInterface	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "GetActiveDoc", result)
	if err != nil {
		return nil, err
	}
	return &Doc{obj.session.getRemoteObject(result.Return)}, err 
}
357809
func (t *Template) GetAllAWSGreengrassResourceDefinitionVersionResources() map[string]*resources.AWSGreengrassResourceDefinitionVersion {
	results := map[string]*resources.AWSGreengrassResourceDefinitionVersion{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSGreengrassResourceDefinitionVersion:
			results[name] = resource
		}
	}
	return results
}
646988
func (api *HostsAPI) Provision(id string) (task *Task, err error) {
	body := []byte{}
	res, err := api.client.restClient.Post(
		api.client.Endpoint+hostUrl+"/"+id+"/provision",
		"application/json",
		bytes.NewReader(body),
		api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()
	task, err = getTask(getError(res))
	return
}
291325
func TaskFromGRPC(t swarmapi.Task) (types.Task, error) {
	containerStatus := t.Status.GetContainer()
	taskSpec, err := taskSpecFromGRPC(t.Spec)
	if err != nil {
		return types.Task{}, err
	}
	task := types.Task{
		ID:          t.ID,
		Annotations: annotationsFromGRPC(t.Annotations),
		ServiceID:   t.ServiceID,
		Slot:        int(t.Slot),
		NodeID:      t.NodeID,
		Spec:        taskSpec,
		Status: types.TaskStatus{
			State:   types.TaskState(strings.ToLower(t.Status.State.String())),
			Message: t.Status.Message,
			Err:     t.Status.Err,
		},
		DesiredState:     types.TaskState(strings.ToLower(t.DesiredState.String())),
		GenericResources: GenericResourcesFromGRPC(t.AssignedGenericResources),
	}

	// Meta
	task.Version.Index = t.Meta.Version.Index
	task.CreatedAt, _ = gogotypes.TimestampFromProto(t.Meta.CreatedAt)
	task.UpdatedAt, _ = gogotypes.TimestampFromProto(t.Meta.UpdatedAt)

	task.Status.Timestamp, _ = gogotypes.TimestampFromProto(t.Status.Timestamp)

	if containerStatus != nil {
		task.Status.ContainerStatus = &types.ContainerStatus{
			ContainerID: containerStatus.ContainerID,
			PID:         int(containerStatus.PID),
			ExitCode:    int(containerStatus.ExitCode),
		}
	}

	// NetworksAttachments
	for _, na := range t.Networks {
		task.NetworksAttachments = append(task.NetworksAttachments, networkAttachmentFromGRPC(na))
	}

	if t.Status.PortStatus == nil {
		return task, nil
	}

	for _, p := range t.Status.PortStatus.Ports {
		task.Status.PortStatus.Ports = append(task.Status.PortStatus.Ports, types.PortConfig{
			Name:          p.Name,
			Protocol:      types.PortConfigProtocol(strings.ToLower(swarmapi.PortConfig_Protocol_name[int32(p.Protocol)])),
			PublishMode:   types.PortConfigPublishMode(strings.ToLower(swarmapi.PortConfig_PublishMode_name[int32(p.PublishMode)])),
			TargetPort:    p.TargetPort,
			PublishedPort: p.PublishedPort,
		})
	}

	return task, nil
}
72193
func (c *CDN) GetRefreshTasks(taskId, objectPath string, pageSize, pageNumber int64, resp interface{}) (err error) {
	req := c.cdnReq.Clone().(*Request)
	req.Action = DescribeRefreshTasksAction
	if global.EmptyString != objectPath {
		req.SetArgs("ObjectPath", objectPath)
	}
	if global.EmptyString != taskId {
		req.SetArgs("TaskId", taskId)
	}
	if pageSize >= 1 {
		req.SetArgs("PageSize", fmt.Sprintf("%d", pageSize))
	}

	if pageNumber >= 1 {
		req.SetArgs("PageNumber", fmt.Sprintf("%d", pageNumber))
	}
	err = c.rpc.Query(req, resp)
	return
}
1220060
func (d *domainClient) GetFlattenedDocument(ctx context.Context, args *GetFlattenedDocumentArgs) (reply *GetFlattenedDocumentReply, err error) {
	reply = new(GetFlattenedDocumentReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "DOM.getFlattenedDocument", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "DOM.getFlattenedDocument", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "DOM", Op: "GetFlattenedDocument", Err: err}
	}
	return
}
119909
func (t *Template) GetAWSRoboMakerRobotApplicationWithName(name string) (*resources.AWSRoboMakerRobotApplication, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSRoboMakerRobotApplication:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSRoboMakerRobotApplication not found", name)
}
1296346
func TaskTrack(ctx types.Context) *types.Task {
	return getTaskService(ctx).TaskTrack(ctx)
}
373169
func (cm *CeleryMessage) GetTaskMessage() *TaskMessage {
	// ensure content-type is 'application/json'
	if cm.ContentType != "application/json" {
		log.Println("unsupported content type " + cm.ContentType)
		return nil
	}
	// ensure body encoding is base64
	if cm.Properties.BodyEncoding != "base64" {
		log.Println("unsupported body encoding " + cm.Properties.BodyEncoding)
		return nil
	}
	// ensure content encoding is utf-8
	if cm.ContentEncoding != "utf-8" {
		log.Println("unsupported encoding " + cm.ContentEncoding)
		return nil
	}
	// decode body
	taskMessage, err := DecodeTaskMessage(cm.Body)
	if err != nil {
		log.Println("failed to decode task message")
		return nil
	}
	return taskMessage
}