// NewCmdSubject returns the "new subject" sub command
339787
func NewCmdSubject(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
	o := NewSubjectOptions(streams)
	cmd := &cobra.Command{
		Use:                   "subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]",
		DisableFlagsInUseLine: true,
		Short:                 i18n.T("Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding"),
		Long:                  subjectLong,
		Example:               subjectExample,
		Run: func(cmd *cobra.Command, args []string) {
			cmdutil.CheckErr(o.Complete(f, cmd, args))
			cmdutil.CheckErr(o.Validate())
			cmdutil.CheckErr(o.Run(addSubjects))
		},
	}

	o.PrintFlags.AddFlags(cmd)

	cmdutil.AddFilenameOptionFlags(cmd, &o.FilenameOptions, "the resource to update the subjects")
	cmd.Flags().BoolVar(&o.All, "all", o.All, "Select all resources, including uninitialized ones, in the namespace of the specified resource types")
	cmd.Flags().StringVarP(&o.Selector, "selector", "l", o.Selector, "Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")
	cmd.Flags().BoolVar(&o.Local, "local", o.Local, "If true, set subject will NOT contact api-server but run locally.")
	cmdutil.AddDryRunFlag(cmd)
	cmd.Flags().StringArrayVar(&o.Users, "user", o.Users, "Usernames to bind to the role")
	cmd.Flags().StringArrayVar(&o.Groups, "group", o.Groups, "Groups to bind to the role")
	cmd.Flags().StringArrayVar(&o.ServiceAccounts, "serviceaccount", o.ServiceAccounts, "Service accounts to bind to the role")
	cmdutil.AddIncludeUninitializedFlag(cmd)
	return cmd
}
155728
func NewCmdCreate() *cobra.Command {
	return &cobra.Command{
		Use:   "create <imageName> <destination>",
		Short: "Bootstrap a new S2I image repository",
		Long:  "Bootstrap a new S2I image with given imageName inside the destination directory",
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) < 2 {
				cmd.Help()
				return
			}
			b := create.New(args[0], args[1])
			b.AddSTIScripts()
			b.AddDockerfile()
			b.AddReadme()
			b.AddTests()
		},
	}
}
543394
func NewGetObjectsCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "getobjects",
		Short: "Get Objects from a RETS server",
		Run:   getObjects,
	}
	cmd.Flags().String(goResourceFlag, "Property", "Resource type of the request")
	cmd.Flags().String(goTypeFlag, "Photo", "Metadata format")
	cmd.Flags().String(goIDFlag, "", "Object ID for the request ('key1:*;key2:0')")

	return cmd
}
1339922
func (o *ListSubjectConsentSessionsParams) WithSubject(subject string) *ListSubjectConsentSessionsParams {
	o.SetSubject(subject)
	return o
}
1119706
func NewKeyObject(key interface{}, expiryTime int64) KeyObject {
	k := KeyObject{
		Key: key,
	}
	if expiryTime >= 0 {
		k.ExpiryTime = time.Unix(expiryTime/1000, 0).UTC()
	}

	return k
}
597068
func (s *NotifyEmailType) SetSubject(v string) *NotifyEmailType {
	s.Subject = &v
	return s
}
516088
func NewRecoverAddressesCmd(account string, n int) *RecoverAddressesCmd {
	return &RecoverAddressesCmd{
		Account: account,
		N:       n,
	}
}
706941
func NewObj(kind ObjKind, name string) *Object {
	return &Object{Kind: kind, Name: name}
}
732327
func newCommandSub(args []string, cli *client.Client) (command, error) {
	// Create a flag set.
	var flg flag.FlagSet

	// Define the flags.
	topicFilter := flg.String("t", "", "Topic Filter")
	qos := flg.Uint("q", uint(mqtt.QoS0), "QoS")

	// Parse the flag.
	if err := flg.Parse(args); err != nil {
		return nil, errCmdArgsParse
	}

	// Create a sub command.
	cmd := &commandSub{
		cli: cli,
		subscribeOpts: &client.SubscribeOptions{
			SubReqs: []*client.SubReq{
				&client.SubReq{
					TopicFilter: []byte(*topicFilter),
					QoS:         byte(*qos),
					Handler:     messageHandler,
				},
			},
		},
	}

	// Return the command.
	return cmd, nil
}
786509
func NewObject(Expr node.Node) *Object {
	return &Object{
		FreeFloating: nil,
		Expr:         Expr,
	}
}
532081
func NewObject(id string, resourceType string, attributes interface{}) (*Object, *Error) {
	object := &Object{
		ID:            id,
		Type:          resourceType,
		Links:         map[string]*Link{},
		Relationships: map[string]*Relationship{},
	}

	rawJSON, err := json.MarshalIndent(attributes, "", " ")
	if err != nil {
		return nil, ISE(fmt.Sprintf("Error marshaling attrs while creating a new JSON Object: %s", err))
	}

	object.Attributes = rawJSON
	return object, nil
}
504688
func NewCmdImport(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "import COMMAND",
		Short: "Commands that import applications",
		Long:  importLong,
		Run:   kcmdutil.DefaultSubCommandRun(streams.ErrOut),
	}

	name := fmt.Sprintf("%s import", fullName)

	cmd.AddCommand(appjson.NewCmdAppJSON(name, f, streams))
	return cmd
}
1194059
func newObject(reqCh chan<- getRequest, resCh <-chan getResponse, doneCh chan<- struct{}) *Object {
	return &Object{
		mutex:  &sync.Mutex{},
		reqCh:  reqCh,
		resCh:  resCh,
		doneCh: doneCh,
	}
}
922292
func (s *PublishInput) SetSubject(v string) *PublishInput {
	s.Subject = &v
	return s
}
1318307
func NewImportAddressCmd(address string, account string, rescan *bool) *ImportAddressCmd {
	return &ImportAddressCmd{
		Address: address,
		Account: account,
		Rescan:  rescan,
	}
}
1205753
func newCommandUnsub(args []string, cli *client.Client) (command, error) {
	// Create a flag set.
	var flg flag.FlagSet

	// Define the flags.
	topicFilter := flg.String("t", "", "Topic Filter")

	// Parse the flag.
	if err := flg.Parse(args); err != nil {
		return nil, errCmdArgsParse
	}

	// Create an unsub command.
	cmd := &commandUnsub{
		cli: cli,
		unsubscribeOpts: &client.UnsubscribeOptions{
			TopicFilters: [][]byte{
				[]byte(*topicFilter),
			},
		},
	}

	// Return the command.
	return cmd, nil
}
6249
func NewDeliverSMResp() Body {
	b := newDeliverSMResp(&Header{ID: DeliverSMRespID})
	b.init()
	return b
}