INNER CODE UNIT · Go

func

mweagle/Sparta · apigateway.go:826

func (resource *Resource) NewMethod(httpMethod string,
	defaultHTTPStatusCode int,
	possibleHTTPStatusCodeResponses ...int) (*Method, error) {

	if OptionsGlobal.Logger != nil && len(possibleHTTPStatusCodeResponses) != 0 {
		OptionsGlobal.Logger.Debug().Interface(
			"possibleHTTPStatusCodeResponses", possibleHTTPStatusCodeResponses).
			Msg("The set of all HTTP status codes is no longer required for NewMethod(...). Any valid HTTP status code can be returned starting with v1.8.0.")
	}

	// http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-method-settings.html#how-to-method-settings-console
	keyname := httpMethod
	existingMethod, exists := resource.Methods[keyname]
	if exists {
		return nil, fmt.Errorf("method %s (Auth: %#v) already defined for resource",
			httpMethod,
			existingMethod.authorizationID)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…