• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang commands_util.ConvertValue_int64函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/skelterjohn/gcloud_apis/commands_util.ConvertValue_int64函数的典型用法代码示例。如果您正苦于以下问题:Golang ConvertValue_int64函数的具体用法?Golang ConvertValue_int64怎么用?Golang ConvertValue_int64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ConvertValue_int64函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: Sql_v1beta3_BackupRunsList

func Sql_v1beta3_BackupRunsList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("project"))
		pathParams = append(pathParams, commands_util.AngrySnakes("instance"))
		pathParams = append(pathParams, commands_util.AngrySnakes("backupConfiguration"))

		if len(pathParams) != 0 {
			if strings.Contains("projects/{project}/instances/{instance}/backupRuns", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " --backupConfiguration=VALUE"

		usageBits += " [--maxResults=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewBackupRunsService(api_service)

	queryParamNames := map[string]bool{
		"backupConfiguration": true,
		"maxResults":          false,
		"pageToken":           false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"project",
		"instance",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_project, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}
	param_instance, err := commands_util.ConvertValue_string(paramValues[1])
	if err != nil {
		return err
	}
	param_backupConfiguration, err := commands_util.ConvertValue_string(flagValues["backupConfiguration"])
	if err != nil {
		return err
	}

	call := service.List(param_project, param_instance, param_backupConfiguration)

	// Set query parameters.
	if value, ok := flagValues["maxResults"]; ok {
		query_maxResults, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.MaxResults(query_maxResults)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:sqladmin_v1beta3.go


示例2: Cloudfunctions_v1beta1_ProjectsLocationsList

func Cloudfunctions_v1beta1_ProjectsLocationsList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("name"))

		if len(pathParams) != 0 {
			if strings.Contains("v1beta1/{+name}/locations", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--filter=VALUE]"

		usageBits += " [--pageSize=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewProjectsLocationsService(api_service)

	queryParamNames := map[string]bool{
		"filter":    false,
		"pageSize":  false,
		"pageToken": false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"name",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_name, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.List(param_name)

	// Set query parameters.
	if value, ok := flagValues["filter"]; ok {
		query_filter, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.Filter(query_filter)
	}
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.PageSize(query_pageSize)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:cloudfunctions_v1beta1.go


示例3: Dataflow_v1b3_ProjectsJobsMessagesList

func Dataflow_v1b3_ProjectsJobsMessagesList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("projectId"))
		pathParams = append(pathParams, commands_util.AngrySnakes("jobId"))

		if len(pathParams) != 0 {
			if strings.Contains("v1b3/projects/{projectId}/jobs/{jobId}/messages", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--endTime=VALUE]"

		usageBits += " [--minimumImportance=VALUE]"

		usageBits += " [--pageSize=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		usageBits += " [--startTime=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewProjectsJobsMessagesService(api_service)

	queryParamNames := map[string]bool{
		"endTime":           false,
		"minimumImportance": false,
		"pageSize":          false,
		"pageToken":         false,
		"startTime":         false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"projectId",
		"jobId",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}
	param_jobId, err := commands_util.ConvertValue_string(paramValues[1])
	if err != nil {
		return err
	}

	call := service.List(param_projectId, param_jobId)

	// Set query parameters.
	if value, ok := flagValues["endTime"]; ok {
		query_endTime, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.EndTime(query_endTime)
	}
	if value, ok := flagValues["minimumImportance"]; ok {
		query_minimumImportance, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.MinimumImportance(query_minimumImportance)
	}
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:dataflow_v1b3.go


示例4: Clouduseraccounts_alpha_LinuxGetLinuxAccountViews

func Clouduseraccounts_alpha_LinuxGetLinuxAccountViews(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("project"))
		pathParams = append(pathParams, commands_util.AngrySnakes("zone"))
		pathParams = append(pathParams, commands_util.AngrySnakes("instance"))

		if len(pathParams) != 0 {
			if strings.Contains("{project}/zones/{zone}/linuxAccountViews", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--filter=VALUE]"

		usageBits += " --instance=VALUE"

		usageBits += " [--maxResults=VALUE]"

		usageBits += " [--orderBy=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewLinuxService(api_service)

	queryParamNames := map[string]bool{
		"filter":     false,
		"instance":   true,
		"maxResults": false,
		"orderBy":    false,
		"pageToken":  false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"project",
		"zone",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_project, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}
	param_zone, err := commands_util.ConvertValue_string(paramValues[1])
	if err != nil {
		return err
	}
	param_instance, err := commands_util.ConvertValue_string(flagValues["instance"])
	if err != nil {
		return err
	}

	call := service.GetLinuxAccountViews(param_project, param_zone, param_instance)

	// Set query parameters.
	if value, ok := flagValues["filter"]; ok {
		query_filter, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.Filter(query_filter)
	}
	if value, ok := flagValues["maxResults"]; ok {
		query_maxResults, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.MaxResults(query_maxResults)
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:clouduseraccounts_alpha.go


示例5: Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsThumbnailsList

func Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsThumbnailsList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("projectId"))
		pathParams = append(pathParams, commands_util.AngrySnakes("historyId"))
		pathParams = append(pathParams, commands_util.AngrySnakes("executionId"))
		pathParams = append(pathParams, commands_util.AngrySnakes("stepId"))

		if len(pathParams) != 0 {
			if strings.Contains("{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/thumbnails", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--pageSize=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewProjectsHistoriesExecutionsStepsThumbnailsService(api_service)

	queryParamNames := map[string]bool{
		"pageSize":  false,
		"pageToken": false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"projectId",
		"historyId",
		"executionId",
		"stepId",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}
	param_historyId, err := commands_util.ConvertValue_string(paramValues[1])
	if err != nil {
		return err
	}
	param_executionId, err := commands_util.ConvertValue_string(paramValues[2])
	if err != nil {
		return err
	}
	param_stepId, err := commands_util.ConvertValue_string(paramValues[3])
	if err != nil {
		return err
	}

	call := service.List(param_projectId, param_historyId, param_executionId, param_stepId)

	// Set query parameters.
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.PageSize(query_pageSize)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}

//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:toolresults_v1beta3.go


示例6: Genomics_v1alpha2_PipelinesList

func Genomics_v1alpha2_PipelinesList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--namePrefix=VALUE]"

		usageBits += " [--pageSize=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		usageBits += " [--projectId=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	queryParamNames := map[string]bool{
		"namePrefix": false,
		"pageSize":   false,
		"pageToken":  false,
		"projectId":  false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	call := service.List()

	// Set query parameters.
	if value, ok := flagValues["namePrefix"]; ok {
		query_namePrefix, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.NamePrefix(query_namePrefix)
	}
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.PageSize(query_pageSize)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}
	if value, ok := flagValues["projectId"]; ok {
		query_projectId, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.ProjectId(query_projectId)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:genomics_v1alpha2.go


示例7: Clouderrorreporting_v1beta1_ProjectsGroupStatsList


//.........这里部分代码省略.........

	expectedParams := []string{
		"projectName",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_projectName, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.List(param_projectName)

	// Set query parameters.
	if value, ok := flagValues["alignment"]; ok {
		query_alignment, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.Alignment(query_alignment)
	}
	if value, ok := flagValues["alignmentTime"]; ok {
		query_alignmentTime, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.AlignmentTime(query_alignmentTime)
	}
	if value, ok := flagValues["groupId"]; ok {
		query_groupId, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.GroupId(query_groupId)
	}
	if value, ok := flagValues["order"]; ok {
		query_order, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.Order(query_order)
	}
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.PageSize(query_pageSize)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}
	if value, ok := flagValues["serviceFilter_service"]; ok {
		query_serviceFilter_service, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.ServiceFilterService(query_serviceFilter_service)
	}
	if value, ok := flagValues["serviceFilter_version"]; ok {
		query_serviceFilter_version, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.ServiceFilterVersion(query_serviceFilter_version)
	}
	if value, ok := flagValues["timeRange_period"]; ok {
		query_timeRange_period, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.TimeRangePeriod(query_timeRange_period)
	}
	if value, ok := flagValues["timedCountDuration"]; ok {
		query_timedCountDuration, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.TimedCountDuration(query_timedCountDuration)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:clouderrorreporting_v1beta1.go


示例8: Bigquery_v2_JobsGetQueryResults

func Bigquery_v2_JobsGetQueryResults(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("projectId"))
		pathParams = append(pathParams, commands_util.AngrySnakes("jobId"))

		if len(pathParams) != 0 {
			if strings.Contains("projects/{projectId}/queries/{jobId}", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--maxResults=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		usageBits += " [--startIndex=VALUE]"

		usageBits += " [--timeoutMs=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewJobsService(api_service)

	queryParamNames := map[string]bool{
		"maxResults": false,
		"pageToken":  false,
		"startIndex": false,
		"timeoutMs":  false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"projectId",
		"jobId",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}
	param_jobId, err := commands_util.ConvertValue_string(paramValues[1])
	if err != nil {
		return err
	}

	call := service.GetQueryResults(param_projectId, param_jobId)

	// Set query parameters.
	if value, ok := flagValues["maxResults"]; ok {
		query_maxResults, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.MaxResults(query_maxResults)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}
	if value, ok := flagValues["startIndex"]; ok {
		query_startIndex, err := commands_util.ConvertValue_uint64(value)
		if err != nil {
			return err
		}
		call.StartIndex(query_startIndex)
	}
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:bigquery_v2.go


示例9: Container_v1_MasterProjectsZonesAuthenticate

func Container_v1_MasterProjectsZonesAuthenticate(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("masterProjectId"))
		pathParams = append(pathParams, commands_util.AngrySnakes("zone"))
		pathParams = append(pathParams, commands_util.AngrySnakes("projectNumber"))
		pathParams = append(pathParams, commands_util.AngrySnakes("clusterId"))

		if len(pathParams) != 0 {
			if strings.Contains("v1/masterProjects/{masterProjectId}/zones/{zone}/{projectNumber}/{clusterId}/authenticate", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
		commands_util.PrintRequestExample(&api_client.AuthenticateRequest{})

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewMasterProjectsZonesService(api_service)

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	// Only positional arguments should remain in args.
	if len(args) == 0 || len(args) > 2 {
		usageFunc()
	}

	request := &api_client.AuthenticateRequest{}
	if len(args) == 2 {
		err = commands_util.PopulateRequestFromFilename(&request, args[1])
		if err != nil {
			return err
		}
	}

	keyValues := flagValues

	err = commands_util.OverwriteRequestWithValues(&request, keyValues)
	if err != nil {
		return err
	}

	expectedParams := []string{
		"masterProjectId",
		"zone",
		"projectNumber",
		"clusterId",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_masterProjectId, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}
	param_zone, err := commands_util.ConvertValue_string(paramValues[1])
	if err != nil {
		return err
	}
	param_projectNumber, err := commands_util.ConvertValue_int64(paramValues[2])
	if err != nil {
		return err
	}
	param_clusterId, err := commands_util.ConvertValue_string(paramValues[3])
	if err != nil {
		return err
	}

	call := service.Authenticate(param_masterProjectId, param_zone, param_projectNumber, param_clusterId,
		request,
	)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:container_v1.go



注:本文中的github.com/skelterjohn/gcloud_apis/commands_util.ConvertValue_int64函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang commands_util.ConvertValue_string函数代码示例发布时间:2022-05-28
下一篇:
Golang commands_util.AngrySnakes函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap