// SecretInspectWithRaw mocks base method
189679
func (m *MockSecretAPIClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) {
	ret := m.ctrl.Call(m, "SecretInspectWithRaw", ctx, name)
	ret0, _ := ret[0].(swarm.Secret)
	ret1, _ := ret[1].([]byte)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}
815623
func NodeInspect(id string) (node swarm.Node, raw []byte, err error) {
	var (
		ctx context.Context
		cli *client.Client
	)
	if ctx, cli, err = mgr.Client(); err == nil {
		return cli.NodeInspectWithRaw(ctx, id)
	}
	return
}
819520
func validateSecretRefsSpec(spec api.TaskSpec) error {
	container := spec.GetContainer()
	if container == nil {
		return nil
	}

	// Keep a map to track all the targets that will be exposed
	// The string returned is only used for logging. It could as well be struct{}{}
	existingTargets := make(map[string]string)
	for _, secretRef := range container.Secrets {
		// SecretID and SecretName are mandatory, we have invalid references without them
		if secretRef.SecretID == "" || secretRef.SecretName == "" {
			return status.Errorf(codes.InvalidArgument, "malformed secret reference")
		}

		// Every secret reference requires a Target
		if secretRef.GetTarget() == nil {
			return status.Errorf(codes.InvalidArgument, "malformed secret reference, no target provided")
		}

		// If this is a file target, we will ensure filename uniqueness
		if secretRef.GetFile() != nil {
			fileName := secretRef.GetFile().Name
			if fileName == "" {
				return status.Errorf(codes.InvalidArgument, "malformed file secret reference, invalid target file name provided")
			}
			// If this target is already in use, we have conflicting targets
			if prevSecretName, ok := existingTargets[fileName]; ok {
				return status.Errorf(codes.InvalidArgument, "secret references '%s' and '%s' have a conflicting target: '%s'", prevSecretName, secretRef.SecretName, fileName)
			}

			existingTargets[fileName] = secretRef.SecretName
		}
	}

	return nil
}
90995
func (k *Keyrings) GetSecretKeyWithPrompt(m MetaContext, arg SecretKeyPromptArg) (key GenericKey, err error) {
	defer m.Trace(fmt.Sprintf("Keyrings#GetSecretKeyWithPrompt(%s)", arg.Reason), func() error { return err })()

	key = k.cachedSecretKey(m, arg.Ska)
	if key != nil {
		return key, err
	}

	key, _, err = k.GetSecretKeyAndSKBWithPrompt(m, arg)

	if key != nil && err == nil {
		setCachedSecretKey(m, arg.Ska, key, nil)
	}

	return key, err
}
100961
func (_m *APIClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) {
	ret := _m.Called(ctx, secret)

	var r0 types.SecretCreateResponse
	if rf, ok := ret.Get(0).(func(context.Context, swarm.SecretSpec) types.SecretCreateResponse); ok {
		r0 = rf(ctx, secret)
	} else {
		r0 = ret.Get(0).(types.SecretCreateResponse)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, swarm.SecretSpec) error); ok {
		r1 = rf(ctx, secret)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
875766
func (mr *MockNetworkAPIClientMockRecorder) NetworkInspect(ctx, networkID, verbose interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkInspect", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkInspect), ctx, networkID, verbose)
}
725189
func Convert_build_SecretSpec_To_v1_SecretSpec(in *build.SecretSpec, out *v1.SecretSpec, s conversion.Scope) error {
	return autoConvert_build_SecretSpec_To_v1_SecretSpec(in, out, s)
}
398733
func (d *driver) SnapshotInspect(
	ctx types.Context,
	snapshotID string,
	opts types.Store) (*types.Snapshot, error) {
	// TODO Snapshots are not implemented yet
	return nil, types.ErrNotImplemented
}
243900
func (_m *APIClient) ContainerInspectWithRaw(ctx context.Context, _a1 string, getSize bool) (types.ContainerJSON, []byte, error) {
	ret := _m.Called(ctx, _a1, getSize)

	var r0 types.ContainerJSON
	if rf, ok := ret.Get(0).(func(context.Context, string, bool) types.ContainerJSON); ok {
		r0 = rf(ctx, _a1, getSize)
	} else {
		r0 = ret.Get(0).(types.ContainerJSON)
	}

	var r1 []byte
	if rf, ok := ret.Get(1).(func(context.Context, string, bool) []byte); ok {
		r1 = rf(ctx, _a1, getSize)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).([]byte)
		}
	}

	var r2 error
	if rf, ok := ret.Get(2).(func(context.Context, string, bool) error); ok {
		r2 = rf(ctx, _a1, getSize)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}
221195
func TaskInspect(ctx types.Context, taskID int) *types.Task {
	return getTaskService(ctx).TaskInspect(taskID)
}
511389
func (m *MockCommonAPIClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) {
	ret := m.ctrl.Call(m, "NodeInspectWithRaw", ctx, nodeID)
	ret0, _ := ret[0].(swarm.Node)
	ret1, _ := ret[1].([]byte)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}
776534
func (_m *APIClient) NetworkInspectWithRaw(ctx context.Context, _a1 string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) {
	ret := _m.Called(ctx, _a1, options)

	var r0 types.NetworkResource
	if rf, ok := ret.Get(0).(func(context.Context, string, types.NetworkInspectOptions) types.NetworkResource); ok {
		r0 = rf(ctx, _a1, options)
	} else {
		r0 = ret.Get(0).(types.NetworkResource)
	}

	var r1 []byte
	if rf, ok := ret.Get(1).(func(context.Context, string, types.NetworkInspectOptions) []byte); ok {
		r1 = rf(ctx, _a1, options)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).([]byte)
		}
	}

	var r2 error
	if rf, ok := ret.Get(2).(func(context.Context, string, types.NetworkInspectOptions) error); ok {
		r2 = rf(ctx, _a1, options)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}
145038
func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
	if volumeID == "" {
		return types.Volume{}, nil, objectNotFoundError{object: "volume", id: volumeID}
	}

	var volume types.Volume
	resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil)
	defer ensureReaderClosed(resp)
	if err != nil {
		return volume, nil, wrapResponseError(err, resp, "volume", volumeID)
	}

	body, err := ioutil.ReadAll(resp.body)
	if err != nil {
		return volume, nil, err
	}
	rdr := bytes.NewReader(body)
	err = json.NewDecoder(rdr).Decode(&volume)
	return volume, body, err
}
223172
func (s *globalTaskService) TaskInspect(taskID int) *types.Task {
	s.RLock()
	defer s.RUnlock()
	if t, ok := s.tasks[taskID]; ok {
		return &t.Task
	}
	return nil
}
814510
func (_m *APIClient) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) {
	ret := _m.Called(ctx, taskID)

	var r0 swarm.Task
	if rf, ok := ret.Get(0).(func(context.Context, string) swarm.Task); ok {
		r0 = rf(ctx, taskID)
	} else {
		r0 = ret.Get(0).(swarm.Task)
	}

	var r1 []byte
	if rf, ok := ret.Get(1).(func(context.Context, string) []byte); ok {
		r1 = rf(ctx, taskID)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).([]byte)
		}
	}

	var r2 error
	if rf, ok := ret.Get(2).(func(context.Context, string) error); ok {
		r2 = rf(ctx, taskID)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}
7774
func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) {
	var networkResource types.NetworkResource
	resp, err := cli.get(ctx, "/networks/"+networkID, nil, nil)
	if err != nil {
		if resp.statusCode == http.StatusNotFound {
			return networkResource, nil, networkNotFoundError{networkID}
		}
		return networkResource, nil, err
	}
	defer ensureReaderClosed(resp)

	body, err := ioutil.ReadAll(resp.body)
	if err != nil {
		return networkResource, nil, err
	}
	rdr := bytes.NewReader(body)
	err = json.NewDecoder(rdr).Decode(&networkResource)
	return networkResource, body, err
}
65794
func (obj *Doc) GetScriptExRaw(ctx context.Context) (json.RawMessage, error) {
	result := &struct {
		Script json.RawMessage	`json:"qScript"`
	} {}
	err := obj.rpc(ctx, "GetScriptEx", result)
	return result.Script, err 
}